Gathering detailed insights and metrics for ng-multiselect-dropdown-infinite-scroll
Gathering detailed insights and metrics for ng-multiselect-dropdown-infinite-scroll
Angular Multi Select Dropdown with Infinite Scroll
npm install ng-multiselect-dropdown-infinite-scroll
Typescript
Module System
Node Version
NPM Version
TypeScript (70.04%)
SCSS (16.36%)
HTML (11.05%)
JavaScript (2.49%)
Shell (0.05%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,362
Last Day
3
Last Week
9
Last Month
205
Last Year
1,362
1 Commits
1 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.18
Package Id
ng-multiselect-dropdown-infinite-scroll@1.0.18
Unpacked Size
169.54 kB
Size
40.06 kB
File Count
19
NPM Version
10.8.2
Node Version
18.20.5
Publised On
25 Nov 2024
Cumulative downloads
Total Downloads
Last day
200%
3
Compared to previous day
Last week
-85%
9
Compared to previous week
Last month
48.6%
205
Compared to previous month
Last year
0%
1,362
Compared to previous year
1
Angular multiselect dropdown component for web applications. Easy to integrate and use. It can be bind to any custom data source.
npm install ng-multiselect-dropdown
And then include it in your module (see app.module.ts):
1import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown-infinite-scroll'; 2// ... 3 4@NgModule({ 5 imports: [ 6 NgMultiSelectDropDownModule.forRoot() 7 // ... 8 ] 9 // ... 10}) 11export class AppModule {}
1import { Component, OnInit } from '@angular/core'; 2import { IDropdownSettings } from 'ng-multiselect-dropdown'; 3 4export class AppComponent implements OnInit { 5 dropdownList = []; 6 selectedItems = []; 7 dropdownSettings = {}; 8 ngOnInit() { 9 this.dropdownList = [ 10 { item_id: 1, item_text: 'Mumbai' }, 11 { item_id: 2, item_text: 'Bangaluru' }, 12 { item_id: 3, item_text: 'Pune' }, 13 { item_id: 4, item_text: 'Navsari' }, 14 { item_id: 5, item_text: 'New Delhi' } 15 ]; 16 this.selectedItems = [ 17 { item_id: 3, item_text: 'Pune' }, 18 { item_id: 4, item_text: 'Navsari' } 19 ]; 20 this.dropdownSettings:IDropdownSettings = { 21 singleSelection: false, 22 idField: 'item_id', 23 textField: 'item_text', 24 selectAllText: 'Select All', 25 unSelectAllText: 'UnSelect All', 26 itemsShowLimit: 3, 27 allowSearchFilter: true 28 }; 29 } 30 onItemSelect(item: any) { 31 console.log(item); 32 } 33 onSelectAll(items: any) { 34 console.log(items); 35 } 36}
1<ng-multiselect-dropdown 2 [placeholder]="'custom placeholder'" 3 [settings]="dropdownSettings" 4 [data]="dropdownList" 5 [(ngModel)]="selectedItems" 6 (onSelect)="onItemSelect($event)" 7 (onSelectAll)="onSelectAll($event)" 8> 9</ng-multiselect-dropdown>
Setting | Type | Description | Default Value |
---|---|---|---|
singleSelection | Boolean | Mode of this component. If set true user can select more than one option. | false |
placeholder | String | Text to be show in the dropdown, when no items are selected. | 'Select' |
disabled | Boolean | Disable the dropdown | false |
data | Array | Array of items from which to select. Should be an array of objects with id and text properties. You can also use custom properties. In that case you need to map idField and textField properties. As convenience, you may also pass an array of strings, in which case the same string is used for both the ID and the text(no mapping is required) | n/a |
idField | String | map id field in case of custom array of object | 'id' |
textField | String | map text field in case of custom array of object | 'text' |
enableCheckAll | Boolean | Enable the option to select all items in list | false |
selectAllText | String | Text to display as the label of select all option | Select All |
unSelectAllText | String | Text to display as the label of unSelect option | UnSelect All |
allowSearchFilter | Boolean | Enable filter option for the list. | false |
searchPlaceholderText | String | custom search placeholder | Search |
clearSearchFilter | Boolean | clear search filter on dropdown close | true |
maxHeight | Number | Set maximum height of the dropdown list in px. | 197 |
itemsShowLimit | Number | Limit the number of items to show in the input field. If not set will show all selected. | All |
limitSelection | Number | Limit the selection of number of items from the dropdown list. Once the limit is reached, all unselected items gets disabled. | none |
searchPlaceholderText | String | Custom text for the search placeholder text. Default value would be 'Search' | 'Search' |
noDataAvailablePlaceholderText | String | Custom text when no data is available. | 'No data available' |
closeDropDownOnSelection | Boolean | Closes the dropdown when item is selected. applicable only in cas of single selection | false |
defaultOpen | Boolean | open state of dropdown | false |
allowRemoteDataSearch | Boolean | allow search remote api if no data is present. | false |
onScrollEnd
- Return True/False if the scroll has completed on the Dropdown
Example : (onScrollEnd)="onItemSelect($event)"onSelect
- Return the selected item when an item is checked.
Example : (onSelect)="onItemSelect($event)"onSelectAll
- Return the all items.
Example : (onSelectAll)="onSelectAll($event)".onDeSelect
- Return the unselected item when an item is unchecked.
Example : (onDeSelect)="onItemDeSelect($event)"onFilterChange
- Return the key press.
Example : (onFilterChange)="onFilterChange($event)"onDropDownClose
-
Example : (onDropDownClose)="onDropDownClose()"ng-multiselet-dropdown-infinite-scroll\themes\ng-multiselect-dropdown-infinite-scroll.theme.scss
ng-multiselet-dropdown-infinite-scroll.theme.css
in angular-cli.json
(for versions below angular 6) and angular.json
(for version 6 or more).Template for each item
<ng-template #optionsTemplate let-item let-option="option" let-id="id" let-isSelected="isSelected">
{{option}}
</ng-template>
Template for selected item
<ng-template #optionSelectedTemplate optionSelectedTemplate let-option="option" let-id="id">
{{option}}
</ng-template>
npm install
ng serve
for a dev serverhttp://localhost:4200/
Run yarn build:lib
to build the library and generate an NPM package. The build artifacts will be stored in the dist-lib/ folder.
Run yarn test
to execute the unit tests.
This project was generated with Angular CLI version 1.7.1.
Contributions are welcome, please open an issue and preferrably file a pull request.
Please share sample code using codesandbox.com or stackblitz.com to help me re-produce the issue.
MIT License.
No vulnerabilities found.
No security vulnerabilities found.