@unnilouis.org/vs-chipdropdown 9.0.9 → 9.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +76 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,24 +1,87 @@
1
- # VsChipdropdown
1
+ 📦 Chip Dropdown Package - <lib-vs-chipdd-cmp>
2
+ This component provides a multi-select dropdown with autocomplete, infinite scroll, and search functionality. It displays selected items as chips and is ideal when users need to choose multiple options.
2
3
 
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.13.
4
+ 🔧 Usage
5
+ <lib-vs-chipdd-cmp
6
+ [InputFields]="inputaccount"
7
+ (dataEvent)="chipfunction($event)">
8
+ </lib-vs-chipdd-cmp>
4
9
 
5
- ## Code scaffolding
6
10
 
7
- Run `ng generate component component-name --project vs-chipdropdown` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project vs-chipdropdown`.
8
- > Note: Don't forget to add `--project vs-chipdropdown` or else it will be added to the default project in your `angular.json` file.
11
+ 📥 Inputs
9
12
 
10
- ## Build
13
+ 1. InputFields
11
14
 
12
- Run `ng build vs-chipdropdown` to build the project. The build artifacts will be stored in the `dist/` directory.
15
+ Pass an object to configure the dropdown. It supports both API-driven and frontend static data.
13
16
 
14
- ## Publishing
17
+ Supported keys:
15
18
 
16
- After building your library with `ng build vs-chipdropdown`, go to the dist folder `cd dist/vs-chipdropdown` and run `npm publish`.
19
+ method: HTTP method to call the API (GET, POST, etc.)
17
20
 
18
- ## Running unit tests
21
+ url: Backend API endpoint
19
22
 
20
- Run `ng test vs-chipdropdown` to execute the unit tests via [Karma](https://karma-runner.github.io).
23
+ searchkey: Key to be used for searching within the dropdown
21
24
 
22
- ## Further help
25
+ params: Default query/body params for the API request (e.g., { flag: 1 })
23
26
 
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
27
+ displaykey: Key in the response object used to display dropdown values
28
+
29
+ label: Label of the dropdown
30
+
31
+ Outputkey: Key to emit through the dataEvent output (optional)
32
+
33
+ If omitted, the entire selected object(s) will be emitted.
34
+
35
+ formcontrolname: Name of the FormControl defined in the parent form
36
+
37
+ fronentdata: Set true to use frontend data (disables API call)
38
+
39
+ data: Array of objects used as options in frontend mode
40
+
41
+
42
+ 2. formGroup (Optional)
43
+ Pass the parent form's FormGroup to enable form integration and auto-patching selected values.
44
+
45
+
46
+ 📤 Output
47
+ 3. dataEvent
48
+ An output event that emits the selected dropdown data whenever the selection changes.
49
+
50
+ Example:
51
+
52
+ chipfunction(event: any) {
53
+ console.log('Selected items:', event);
54
+ }
55
+
56
+
57
+ ✅ Example InputFields Object
58
+
59
+ this.inputaccount = {
60
+ method: 'POST',
61
+ url: 'https://your.api/multiselect',
62
+ params: { flag: 2 },
63
+ displaykey: 'account_name',
64
+ Outputkey: 'account_id',
65
+ label: 'Accounts',
66
+ formcontrolname: 'selectedAccounts',
67
+ fronentdata: false,
68
+ };
69
+
70
+ 🧩 Use Cases
71
+
72
+ Multi-select dropdowns with autocomplete
73
+
74
+ Displaying selected items as chips
75
+
76
+ API-driven or static list of options
77
+
78
+ Search-enabled large datasets
79
+
80
+
81
+ 💡 Tips
82
+
83
+ Use Outputkey if you only want to emit specific values (like IDs or names).
84
+
85
+ If you need the full object, simply skip the Outputkey.
86
+
87
+ Works well with Angular Reactive Forms.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unnilouis.org/vs-chipdropdown",
3
- "version": "9.0.9",
3
+ "version": "9.1.2",
4
4
  "main": "bundles/unnilouis.org-vs-chipdropdown.umd.js",
5
5
  "module": "fesm5/unnilouis.org-vs-chipdropdown.js",
6
6
  "es2015": "fesm2015/unnilouis.org-vs-chipdropdown.js",