npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-dynamic-accordion

v1.0.5

Published

It is nested accordion & also contains dynamic feature for handling accordion behaviours

Downloads

6

Readme

Angular-dynamic-Accordion

Angular dynamic accordion for web applications. Easy to integrate and use. It contains nested section.

Getting Started

Features

  • Accordion user array for content show.
  • array contain heading, descriptions & nested section heading/descriptions.
  • array also contain key for default open section & disabling the particular section key.
  • Object that contains multiple feature like heading key & description key.
  • you can also add CSS class by passing in object.

Installation

npm i ng-dynamic-accordion

```ts
import { AccordionModule } from 'ng-dynamic-accordion';
// ...

@NgModule({
  imports: [
    AccordionModule
    // ...
  ]
  // ...
})
export class AppModule {}

Usage

import { Component, OnInit } from '@angular/core';

export class AppComponent implements OnInit {
  userArray: any[] = [];
  options: object;
  
  ngOnInit () {
    this.userArray = [
      {
        heading: 'section 1 heading', desc: 'section 1 body', isDisable: false, isOpen: true,
        group: [{ subHeading: 'subSection 1 Heading', isOpen: true, subDesc: 'subSection 1 body' }]
      },
      {
        heading: 'section 2 heading', desc: 'section 2 body', isDisable: false, isOpen: false,
        group: [{ subHeading: 'subSection 2 Heading', isOpen: false, subDesc: 'subSection 2 body' }]
      },
      {
        heading: 'section 3 heading', desc: 'section 3 body', isDisable: false, isOpen: false,
        group: [{ subHeading: 'subSection 3 Heading', isOpen: false, subDesc: 'subSection 3 body' }]
      },
      {
        heading: 'section 4 heading', desc: 'section 4 body', isDisable: false, isOpen: false,
        group: [
          { subHeading: 'subSection 4.2 Heading', isOpen: false, subDesc: 'subSection 4.1 body' },
          { subHeading: 'subSection 4.2 Heading', isOpen: false, subDesc: 'subSection 4.2 body' }
        ]
      },
      {
        heading: 'section 5 heading', desc: 'section 5 body', isDisable: false, isOpen: false,
        group: [{ subHeading: 'subSection 5 subHeading', isOpen: false, subDesc: 'subSection 5 body' }]
      },
    ];
  
  this.options = {

      textKeyHeading: 'heading', // Accordion heading key of the array, you can take anything.
      textKeyDesc: 'desc',       // Accordion description key of the array, you can take anything.
      textKeysubHeading: 'subHeading', // Accordion nested section heading key of the array, you can take anything.
      textKeysubDesc: 'subDesc',     // Accordion nested section description key of the array, you can take anything.
      addCssClass: '',         // For adding CSS class in accordion.
      array: this.userArray   // Array of accordion.
    };

  }
}

<ng-dynamic-accordion [option] = options ></ng-dynamic-accordion>

options


| options | Type | Description | Default Value | | :----------------------- | :--------- | :----------------------------------------------------------------------------------------------------------- | :-------------------------| | heading | String | Heading of outer section accordion. | 'section heading' |
| desc | String | Description of outer section accordion. | 'section body' |
| subHeading | String | Heading of inner section accordion | 'subSection Heading' |
| subDesc | String | description of inner section accordion. | 'subSection body' | | textKeyHeading | String | Heading Key of outer section accordion. | 'heading' |
| array | Array | This is User Array | userArray |
| textKeyDesc | String | description Key of outer section accordion | 'desc' |
| addCssClass | String | add Css class on accordion section | '' |
| textKeysubHeading | String | Heading Key of inner section accordion of user array | 'subHeading' |
| textKeysubDesc | String | description Key of inner section accordion of user array | 'subDesc' |
| isOpen | boolean | for default section open of accordion if true. | true |
| isDisable | boolean | for disabling particular section of accordion if pass true | false |

Run locally

  • Clone the repository or downlod the .zip,.tar files.
  • Run npm install
  • Run ng serve for a dev server
  • Navigate to http://localhost:4200/

Library Build / NPM Package

Run yarn build:lib to build the library and generate an NPM package. The build artifacts will be stored in the dist-lib/ folder.

Development

This project was generated with Angular CLI version 6.0.8.

Contributions

Contributions are welcome, please open an issue and preferrably file a pull request.

Opening Issue

Please share sample code using codesandbox.com or stackblitz.com to help me re-produce the issue.

License

MIT License.