@ruc-lib/multi-select 2.0.8 → 3.1.0

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 (33) hide show
  1. package/README.md +3 -149
  2. package/fesm2022/ruc-lib-multi-select.mjs +519 -0
  3. package/fesm2022/ruc-lib-multi-select.mjs.map +1 -0
  4. package/index.d.ts +207 -4
  5. package/package.json +13 -26
  6. package/esm2020/index.mjs +0 -5
  7. package/esm2020/lib/animations/animations.mjs +0 -30
  8. package/esm2020/lib/directives/clickOutside.directive.mjs +0 -31
  9. package/esm2020/lib/interfaces/multiSelectDefault.mjs +0 -2
  10. package/esm2020/lib/model/ruc-multi-select.model.mjs +0 -11
  11. package/esm2020/lib/pipes/filter.pipe.mjs +0 -28
  12. package/esm2020/lib/pipes/sort.pipe.mjs +0 -38
  13. package/esm2020/lib/ruclib-multi-select/ruclib-multi-select.component.mjs +0 -361
  14. package/esm2020/lib/ruclib-multi-select.module.mjs +0 -72
  15. package/esm2020/ruc-lib-multi-select.mjs +0 -5
  16. package/fesm2015/ruc-lib-multi-select.mjs +0 -557
  17. package/fesm2015/ruc-lib-multi-select.mjs.map +0 -1
  18. package/fesm2020/ruc-lib-multi-select.mjs +0 -558
  19. package/fesm2020/ruc-lib-multi-select.mjs.map +0 -1
  20. package/lib/animations/animations.d.ts +0 -1
  21. package/lib/directives/clickOutside.directive.d.ts +0 -10
  22. package/lib/interfaces/multiSelectDefault.d.ts +0 -64
  23. package/lib/model/ruc-multi-select.model.d.ts +0 -9
  24. package/lib/pipes/filter.pipe.d.ts +0 -7
  25. package/lib/pipes/sort.pipe.d.ts +0 -9
  26. package/lib/ruclib-multi-select/ruclib-multi-select.component.d.ts +0 -118
  27. package/lib/ruclib-multi-select.module.d.ts +0 -20
  28. package/ruc-lib-multi-select-2.0.6.tgz +0 -0
  29. package/ruc-lib-multi-select-2.0.7.tgz +0 -0
  30. package/ruc-lib-multi-select-2.0.9.tgz +0 -0
  31. package/ruc-lib-multi-select-2.1.0.tgz +0 -0
  32. package/ruc-lib-multi-select-2.1.1.tgz +0 -0
  33. package/ruc-lib-multi-select-2.1.2.tgz +0 -0
@@ -1,557 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Pipe, Injectable, EventEmitter, Directive, Output, HostListener, Component, Input, ViewChild, NgModule } from '@angular/core';
3
- import * as i3 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import * as i4 from '@angular/forms';
6
- import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
- import { ENTER, COMMA } from '@angular/cdk/keycodes';
8
- import { MatPaginator } from '@angular/material/paginator';
9
- import { MatSort } from '@angular/material/sort';
10
- import { trigger, transition, style, query, sequence, animate, stagger } from '@angular/animations';
11
- import * as i5 from '@angular/material/icon';
12
- import { MatIconModule } from '@angular/material/icon';
13
- import * as i6 from '@angular/material/form-field';
14
- import { MatFormFieldModule } from '@angular/material/form-field';
15
- import * as i7 from '@angular/material/core';
16
- import * as i8 from '@angular/material/checkbox';
17
- import { MatCheckboxModule } from '@angular/material/checkbox';
18
- import * as i9 from '@angular/material/chips';
19
- import { MatChipsModule } from '@angular/material/chips';
20
- import * as i10 from '@angular/material/divider';
21
- import { MatDividerModule } from '@angular/material/divider';
22
- import * as i11 from '@angular/material/slide-toggle';
23
- import { MatSlideToggleModule } from '@angular/material/slide-toggle';
24
- import { MatInputModule } from '@angular/material/input';
25
- import { MatSelectModule } from '@angular/material/select';
26
-
27
- class ListItem {
28
- constructor(data) {
29
- this.id = data.id;
30
- this.text = data.text;
31
- this.isDisabled = data.isDisabled;
32
- this.icon = data.icon;
33
- this.childItem = data.childItem;
34
- this.grouped = data.grouped;
35
- }
36
- }
37
-
38
- class FilterPipe {
39
- transform(items, searchText, key) {
40
- if (!items)
41
- return [];
42
- if (!searchText)
43
- return items;
44
- searchText = searchText.toLowerCase();
45
- return items.filter(it => {
46
- if (!key) {
47
- return it.toLowerCase().includes(searchText);
48
- }
49
- else {
50
- return it[key].toLowerCase().includes(searchText);
51
- }
52
- });
53
- }
54
- }
55
- FilterPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
56
- FilterPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FilterPipe, name: "filter" });
57
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilterPipe, decorators: [{
58
- type: Pipe,
59
- args: [{
60
- name: 'filter'
61
- }]
62
- }] });
63
-
64
- class SortPipe {
65
- transform(value, sortOrder = 'asc', sortKey = 'text') {
66
- sortOrder = sortOrder && sortOrder.toLowerCase();
67
- if (!value || (sortOrder !== 'asc' && sortOrder !== 'desc'))
68
- return value;
69
- let numberArray = [];
70
- let stringArray = [];
71
- numberArray = value
72
- .filter((item) => typeof item[sortKey] === 'number')
73
- .sort((a, b) => a[sortKey] - b[sortKey]);
74
- stringArray = value
75
- .filter((item) => typeof item[sortKey] === 'string')
76
- .sort((a, b) => {
77
- if (a[sortKey] < b[sortKey])
78
- return -1;
79
- else if (a[sortKey] > b[sortKey])
80
- return 1;
81
- else
82
- return 0;
83
- });
84
- const sorted = numberArray.concat(stringArray);
85
- return sortOrder === 'asc' ? sorted : sorted.reverse();
86
- }
87
- }
88
- SortPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SortPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
89
- SortPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SortPipe, name: "sort" });
90
- SortPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SortPipe });
91
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SortPipe, decorators: [{
92
- type: Injectable
93
- }, {
94
- type: Pipe,
95
- args: [{
96
- name: 'sort',
97
- }]
98
- }] });
99
-
100
- const DropDownAnimation = trigger("dropDownMenu", [
101
- transition(":enter", [
102
- style({ height: 0, overflow: "hidden" }),
103
- query(".option", [
104
- style({ opacity: 0, transform: "translateY(-50px)" })
105
- ]),
106
- sequence([
107
- animate("400ms", style({ height: "*" })),
108
- query(".option", [
109
- stagger(50, [
110
- animate("200ms ease", style({ opacity: 1, transform: "none" }))
111
- ])
112
- ])
113
- ])
114
- ]),
115
- transition(":leave", [
116
- style({ height: "*", overflow: "hidden" }),
117
- query(".option", [style({ opacity: 1, transform: "none" })]),
118
- sequence([
119
- query(".option", [
120
- stagger(-10, [
121
- animate("400ms ease", style({ opacity: 0, transform: "translateY(-50px)" }))
122
- ])
123
- ]),
124
- animate("400ms", style({ height: 0 }))
125
- ])
126
- ])
127
- ]);
128
-
129
- class ClickOutsideDirective {
130
- constructor(_elementRef) {
131
- this._elementRef = _elementRef;
132
- this.clickOutside = new EventEmitter();
133
- }
134
- onClick(event, targetElement) {
135
- if (!targetElement) {
136
- return;
137
- }
138
- const clickedInside = this._elementRef.nativeElement.contains(targetElement);
139
- if (!clickedInside) {
140
- this.clickOutside.emit(event);
141
- }
142
- }
143
- }
144
- ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
145
- ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "document:click": "onClick($event,$event.target)" } }, ngImport: i0 });
146
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ClickOutsideDirective, decorators: [{
147
- type: Directive,
148
- args: [{
149
- selector: '[clickOutside]'
150
- }]
151
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { clickOutside: [{
152
- type: Output
153
- }], onClick: [{
154
- type: HostListener,
155
- args: ['document:click', ['$event', '$event.target']]
156
- }] } });
157
-
158
- /* eslint-disable @typescript-eslint/no-explicit-any */
159
- class RuclibMultiSelectComponent {
160
- constructor(filterPipe, sortPipe) {
161
- this.filterPipe = filterPipe;
162
- this.sortPipe = sortPipe;
163
- this.separatorKeysCodes = [ENTER, COMMA];
164
- this.rucEvent = new EventEmitter();
165
- this.dataSource = []; /** dropdwon data source */
166
- }
167
- /** getApperrance method to define appearance */
168
- getApperance() {
169
- if (this.appearance === 'fill') {
170
- return 'fill';
171
- }
172
- return 'outline';
173
- }
174
- ngOnInit() {
175
- this.filteredItem = [];
176
- this.selectedItems = [];
177
- this.sortToggle = false;
178
- this.addOnBlur = true;
179
- this.showdropdown = false;
180
- this.theme = 'primary';
181
- this.isAllCheckboxSelected = false;
182
- this.isShowSelectedFilter = false;
183
- this.limitSelection = null;
184
- this.scroll = false;
185
- this.disabled = false;
186
- this.limitSelection = null;
187
- this.dataSource = this.dataSource.map((item) => new ListItem({
188
- text: item.text,
189
- id: item.id,
190
- isDisabled: item.isDisable ? item.isDisable : false,
191
- childItem: item.childItem && item.childItem.length ? item.childItem : [],
192
- grouped: item.grouped ? true : false,
193
- icon: item.icon ? item.icon : '',
194
- }));
195
- this.filteredItem = this.dataSource;
196
- // this.width = this.rucInputData.width === "" || this.rucInputData.width === undefined ? 100: this.rucInputData.width; /** width in % */
197
- this.height =
198
- this.rucInputData.maxHeight === undefined
199
- ? 150
200
- : this.rucInputData.maxHeight; /** width in px */
201
- this.singleSelection =
202
- this.rucInputData.singleSelection === undefined
203
- ? false
204
- : this.rucInputData.singleSelection;
205
- this.label =
206
- this.rucInputData.label === '' || this.rucInputData.label === undefined
207
- ? 'Cities'
208
- : this.rucInputData.label;
209
- this.appearance =
210
- this.rucInputData.appearance === '' ||
211
- this.rucInputData.appearance === undefined
212
- ? 'outline'
213
- : this.rucInputData.appearance;
214
- this.limitSelection =
215
- this.rucInputData.limit === undefined ? null : this.rucInputData.limit;
216
- this.multiSelectList = new FormControl({
217
- value: '',
218
- disabled: !!this.rucInputData.disabled,
219
- });
220
- this.scroll =
221
- this.rucInputData.scroll === undefined ? true : this.rucInputData.scroll;
222
- this.placeholder =
223
- this.rucInputData.placeholder === '' ||
224
- this.rucInputData.placeholder === undefined
225
- ? ''
226
- : this.rucInputData.placeholder;
227
- this.maxDropdownHeight =
228
- this.rucInputData.maxDropdownHeight === undefined
229
- ? ''
230
- : this.rucInputData.maxDropdownHeight;
231
- this.sortObj = {
232
- sortBy: this.rucInputData.sortBy === undefined ? '' : this.rucInputData.sortBy,
233
- sortOrder: this.rucInputData.sortOrder === undefined
234
- ? ''
235
- : this.rucInputData.sortOrder,
236
- };
237
- this.showSelectAll =
238
- this.rucInputData.showSelectAll === undefined
239
- ? true
240
- : this.rucInputData.showSelectAll;
241
- this.showSelected =
242
- this.rucInputData.showSelected === undefined
243
- ? true
244
- : this.rucInputData.showSelected;
245
- }
246
- /**
247
- * Dynamic data change
248
- * @param changes input provide change detection
249
- * @return none
250
- */
251
- ngOnChanges(changes) {
252
- if (changes['dataSource'] && changes['dataSource'].currentValue) {
253
- this.dataSource = changes['dataSource'].currentValue.map((item) => new ListItem({
254
- id: item.id,
255
- text: item.text,
256
- isDisabled: item.isDisable,
257
- childItem: item.childItem && item.childItem.length ? item.childItem : [],
258
- grouped: item.grouped ? true : false,
259
- icon: item.icon ? item.icon : '',
260
- }));
261
- }
262
- this.filteredItem = this.dataSource;
263
- }
264
- /**
265
- * Select options checkbox
266
- * @param ListItem input provide whole list of data
267
- * @return none
268
- */
269
- onSelection(item) {
270
- this.searchText = '';
271
- if (this.singleSelection === true) {
272
- if (this.selectedItems.length >= 0) {
273
- this.selectedItems = [];
274
- this.selectedItems.push(item);
275
- }
276
- }
277
- else {
278
- if (this.selectedItems.indexOf(item) > -1) {
279
- this.selectedItems = this.selectedItems.filter((data) => data.id != item.id);
280
- }
281
- else {
282
- this.selectedItems.push(item);
283
- }
284
- this.rucEvent.emit({ eventName: 'onSelection', eventOutput: item });
285
- this.isAllSelected();
286
- if (this.selectedItems.length === 0) {
287
- this.isShowSelectedFilter = false;
288
- this.filteredItem = this.dataSource;
289
- }
290
- }
291
- }
292
- // disable other items as limit selection is there
293
- checkSelectedStatus(obj) {
294
- const index = this.selectedItems.findIndex((res) => res.id === obj.id);
295
- if (index === -1) {
296
- return true;
297
- }
298
- return false;
299
- }
300
- /**
301
- * clear selected Menu
302
- * @return none
303
- */
304
- clearSelectedMenu() {
305
- this.selectedItems = [];
306
- }
307
- /**
308
- * select all Checkbox options at once
309
- * @param ListItem input provide whole list of data
310
- * @return none
311
- */
312
- onAllSelection() {
313
- this.searchText = '';
314
- if (!this.isAllCheckboxSelected) {
315
- this.selectedItems = this.dataSource.filter((res) => {
316
- if (res.childItem && res.childItem.length > 0) {
317
- return res.childItem.filter((res1) => {
318
- return res1.isDisable != true;
319
- });
320
- }
321
- else {
322
- return res.isDisabled != true;
323
- }
324
- });
325
- }
326
- else {
327
- this.selectedItems = [];
328
- }
329
- this.rucEvent.emit({
330
- eventName: 'onAllSelection',
331
- eventOutput: this.selectedItems,
332
- });
333
- this.isAllCheckboxSelected = !this.isAllCheckboxSelected;
334
- if (this.isAllCheckboxSelected === false &&
335
- this.isShowSelectedFilter === true) {
336
- this.filteredItem = this.dataSource;
337
- this.isShowSelectedFilter = false;
338
- }
339
- if (this.isAllCheckboxSelected === true &&
340
- this.isShowSelectedFilter === true) {
341
- this.filteredItem = this.dataSource;
342
- }
343
- }
344
- /**
345
- * toggle dropdown
346
- */
347
- toggleDropdown() {
348
- this.showdropdown = !this.showdropdown;
349
- if (this.showdropdown) {
350
- this.rucEvent.emit({ eventName: 'onInputClick', eventOutput: null });
351
- }
352
- }
353
- /**
354
- * Remove the data based on the select input
355
- * @param ListItem input provide whole list of data
356
- * @return none
357
- */
358
- removeItem(item) {
359
- if (this.selectedItems.indexOf(item) > -1) {
360
- this.selectedItems = this.selectedItems.filter((data) => data.id != item.id);
361
- }
362
- this.rucEvent.emit({ eventName: 'onDeSelection', eventOutput: item });
363
- }
364
- /**
365
- * Filter the data based on the provided input
366
- * @param searchvalue input label provided in search box
367
- * @return none
368
- */
369
- filterData(searchvalue) {
370
- /*Filter the data using filter pipe*/
371
- if (!this.showdropdown) {
372
- this.showdropdown = true;
373
- }
374
- this.filteredItem = this.filterPipe.transform(this.dataSource, searchvalue, 'text');
375
- }
376
- /**
377
- * add and remove checked item
378
- * @param ListItem input provide whole list of data
379
- * @return boolean
380
- */
381
- isSelected(checkedItem) {
382
- let found = false;
383
- this.selectedItems.forEach((item) => {
384
- if (item.childItem && item.childItem.length > 0) {
385
- item.childItem.forEach((item1) => {
386
- if (checkedItem.id === item1.id) {
387
- found = true;
388
- }
389
- });
390
- }
391
- else {
392
- if (checkedItem.id === item.id) {
393
- found = true;
394
- }
395
- }
396
- });
397
- return found;
398
- }
399
- /**
400
- * check if all checkbox selected or not
401
- * @return boolean
402
- */
403
- isAllSelected() {
404
- const totalLength = this.dataSource.filter((data) => data.isDisabled != true);
405
- if (this.selectedItems.length === totalLength.length) {
406
- this.isAllCheckboxSelected = true;
407
- }
408
- else {
409
- this.isAllCheckboxSelected = false;
410
- }
411
- return this.isAllCheckboxSelected;
412
- }
413
- /**
414
- * check if show checkbox selected or not
415
- * @return boolean
416
- */
417
- isShowSelected() {
418
- return this.isShowSelectedFilter;
419
- }
420
- /**
421
- * check if show checkbox selected or not
422
- * @return boolean
423
- */
424
- onShowSelection() {
425
- this.isShowSelectedFilter = !this.isShowSelectedFilter;
426
- if (this.isShowSelectedFilter) {
427
- if (this.sortToggle) {
428
- const sortedArr = this.sortPipe.transform(this.selectedItems, this.rucInputData.sortOrder, this.rucInputData.sortBy);
429
- this.filteredItem = sortedArr;
430
- }
431
- else {
432
- this.filteredItem = this.selectedItems;
433
- }
434
- }
435
- else {
436
- this.isShowSelectedFilter = false;
437
- if (this.sortToggle) {
438
- const sortedArr = this.sortPipe.transform(this.dataSource, this.rucInputData.sortOrder, this.rucInputData.sortBy);
439
- this.filteredItem = sortedArr;
440
- }
441
- else {
442
- this.filteredItem = this.dataSource;
443
- }
444
- }
445
- }
446
- // pipe to toggle sort
447
- onSortToggle() {
448
- this.sortToggle = !this.sortToggle;
449
- if (this.sortToggle) {
450
- const sortedArr = this.sortPipe.transform(this.filteredItem, this.rucInputData.sortOrder, this.rucInputData.sortBy);
451
- this.filteredItem = sortedArr;
452
- }
453
- else {
454
- if (this.isShowSelectedFilter) {
455
- this.filteredItem = this.selectedItems;
456
- }
457
- else {
458
- this.filteredItem = this.dataSource;
459
- }
460
- }
461
- }
462
- /**
463
- * close popup when click outside of container
464
- */
465
- close() {
466
- this.showdropdown = false;
467
- }
468
- }
469
- RuclibMultiSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RuclibMultiSelectComponent, deps: [{ token: FilterPipe }, { token: SortPipe }], target: i0.ɵɵFactoryTarget.Component });
470
- RuclibMultiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RuclibMultiSelectComponent, selector: "uxp-ruclib-multi-select", inputs: { rucInputData: "rucInputData", customTheme: "customTheme", dataSource: "dataSource" }, outputs: { rucEvent: "rucEvent" }, providers: [FilterPipe, SortPipe], viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "matTable", first: true, predicate: ["matTable"], descendants: true }, { propertyName: "matTableElementRef", first: true, predicate: ["matTable"], descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"{{ customTheme }}\" (clickOutside)=\"close()\">\r\n <mat-form-field\r\n class=\"chip-list\"\r\n [ngStyle]=\"{ 'max-height.px': height, 'width.%': 100 }\"\r\n [appearance]=\"getApperance()\"\r\n >\r\n <mat-label>{{ label }}</mat-label>\r\n <mat-chip-grid\r\n matInput\r\n [formControl]=\"multiSelectList\"\r\n #chipGrid\r\n aria-label=\"Cities\"\r\n >\r\n <mat-chip-row *ngFor=\"let item of selectedItems\" (removed)=\"removeItem(item)\">\r\n {{ item.text }}\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n <input\r\n (click)=\"toggleDropdown()\"\r\n [placeholder]=\"placeholder\"\r\n [matChipInputFor]=\"chipGrid\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (keyup)=\"filterData(searchText)\"\r\n [(ngModel)]=\"searchText\"\r\n />\r\n </mat-chip-grid>\r\n <mat-icon\r\n *ngIf=\"selectedItems.length\"\r\n (click)=\"clearSelectedMenu()\"\r\n matSuffix\r\n >clear</mat-icon\r\n >\r\n <mat-icon *ngIf=\"!selectedItems.length && !showdropdown\" matSuffix\r\n >expand_more</mat-icon\r\n >\r\n <mat-icon *ngIf=\"!selectedItems.length && showdropdown\" matSuffix\r\n >expand_less</mat-icon\r\n >\r\n </mat-form-field>\r\n\r\n <div\r\n *ngIf=\"searchText && filteredItem.length < 1\"\r\n class=\"margin-2-top-bottom\"\r\n >\r\n <div>No option found</div>\r\n </div>\r\n\r\n <div class=\"box-border-option\">\r\n <div\r\n *ngIf=\"showdropdown\"\r\n class=\"option-header\"\r\n role=\"options\"\r\n tabindex=\"-1\"\r\n [@dropDownMenu]\r\n >\r\n <ng-container *ngIf=\"!singleSelection\">\r\n <div *ngIf=\"showSelectAll\">\r\n <div *ngIf=\"limitSelection === null\">\r\n <mat-checkbox\r\n class=\"option mat-primary\"\r\n role=\"option\"\r\n color=\"{{ theme }}\"\r\n [checked]=\"isAllSelected()\"\r\n (change)=\"onAllSelection()\"\r\n value=\"select-all\"\r\n >Select All\r\n </mat-checkbox>\r\n </div>\r\n </div>\r\n <mat-checkbox\r\n *ngIf=\"showSelected\"\r\n class=\"option mat-primary\"\r\n role=\"option\"\r\n color=\"{{ theme }}\"\r\n [checked]=\"isShowSelected()\"\r\n (change)=\"onShowSelection()\"\r\n value=\"select-all\"\r\n >Show Selected\r\n </mat-checkbox>\r\n <mat-slide-toggle\r\n *ngIf=\"sortObj['sortBy']\"\r\n class=\"option mat-primary\"\r\n (click)=\"onSortToggle()\"\r\n >Sort\r\n </mat-slide-toggle>\r\n <mat-divider></mat-divider>\r\n </ng-container>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"showdropdown\"\r\n [ngClass]=\"{\r\n 'scroll-option-container': scroll,\r\n 'option-container': '!scroll'\r\n }\"\r\n role=\"options\"\r\n [ngStyle]=\"{ 'max-height.px': maxDropdownHeight, 'width.%': 100 }\"\r\n tabindex=\"-1\"\r\n >\r\n <ng-container>\r\n <div *ngIf=\"!singleSelection\" [@dropDownMenu]>\r\n <!-- for grouped -->\r\n <div *ngFor=\"let item of filteredItem\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"\r\n (item.childItem && item.childItem.length > 0) || item.grouped\r\n ? multipleGroupedCase\r\n : multipleNonGroupedCase\r\n \"\r\n [ngTemplateOutletContext]=\"{ item: item }\"\r\n >\r\n </ng-container>\r\n </div>\r\n </div>\r\n <!-- for single selection case -->\r\n <div *ngIf=\"singleSelection\">\r\n <div *ngFor=\"let item of filteredItem\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"\r\n item.childItem && item.childItem.length > 0\r\n ? singleGroupedCase\r\n : singleNonGroupedCase\r\n \"\r\n [ngTemplateOutletContext]=\"{ item: item }\"\r\n >\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n\r\n <!-- for multiple selected group case -->\r\n <ng-template #multipleGroupedCase let-item=\"item\">\r\n <mat-optgroup [label]=\"item.text\" [disabled]=\"item.isDisabled\">\r\n <mat-option\r\n *ngFor=\"let itemObj of item.childItem\"\r\n [value]=\"itemObj.id\"\r\n disabled=\"{{\r\n itemObj.isDisable ||\r\n (limitSelection != null &&\r\n selectedItems.length >= limitSelection &&\r\n checkSelectedStatus(itemObj))\r\n }}\"\r\n >\r\n <mat-checkbox\r\n class=\"mat-primary\"\r\n role=\"option\"\r\n color=\"{{ theme }}\"\r\n [checked]=\"isSelected(itemObj)\"\r\n (change)=\"onSelection(itemObj)\"\r\n value=\"{{ itemObj.id }}\"\r\n disabled=\"{{\r\n itemObj.isDisable ||\r\n (limitSelection != null &&\r\n selectedItems.length >= limitSelection &&\r\n checkSelectedStatus(itemObj))\r\n }}\"\r\n >\r\n </mat-checkbox>\r\n <mat-icon *ngIf=\"itemObj.icon\">{{ itemObj.icon }}</mat-icon>\r\n {{ itemObj.text }}\r\n </mat-option>\r\n </mat-optgroup>\r\n </ng-template>\r\n\r\n <!-- for multiple selected non grouped case -->\r\n <ng-template #multipleNonGroupedCase let-item=\"item\">\r\n <mat-checkbox\r\n class=\"option mat-primary\"\r\n role=\"option\"\r\n color=\"{{ theme }}\"\r\n [checked]=\"isSelected(item)\"\r\n (change)=\"onSelection(item)\"\r\n value=\"{{ item.id }}\"\r\n disabled=\"{{\r\n item.isDisabled ||\r\n (limitSelection != null &&\r\n selectedItems.length >= limitSelection &&\r\n checkSelectedStatus(item))\r\n }}\"\r\n >\r\n <mat-icon *ngIf=\"item.icon\">{{ item.icon }}</mat-icon>\r\n {{ item.text }}\r\n </mat-checkbox>\r\n </ng-template>\r\n\r\n <!-- for single selection group case -->\r\n <ng-template #singleGroupedCase let-item=\"item\">\r\n <mat-optgroup\r\n *ngFor=\"let item of filteredItem\"\r\n [label]=\"item.text\"\r\n [disabled]=\"item.isDisabled\"\r\n >\r\n <mat-option\r\n *ngFor=\"let itemObj of item.childItem\"\r\n [value]=\"itemObj.id\"\r\n disabled=\"{{ itemObj.isDisable }}\"\r\n (click)=\"onSelection(itemObj)\"\r\n >\r\n <mat-icon *ngIf=\"itemObj.icon\">{{ itemObj.icon }}</mat-icon>\r\n {{ itemObj.text }}\r\n </mat-option>\r\n </mat-optgroup>\r\n </ng-template>\r\n\r\n <!-- for single selection non group case -->\r\n <ng-template #singleNonGroupedCase let-item=\"item\">\r\n <span\r\n class=\"option mat-primary\"\r\n (click)=\"onSelection(item)\"\r\n *ngFor=\"let item of filteredItem; let index = index\"\r\n >\r\n <mat-icon *ngIf=\"item.icon\">{{ item.icon }}</mat-icon>\r\n {{ item.text }}\r\n </span>\r\n </ng-template>\r\n </div>\r\n</div>\r\n", styles: [".scroll-option-container{overflow-x:auto;overflow-y:auto;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px #0000001f}.option-container{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px #0000001f}.option{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:52px;height:52px;padding:0 16px;text-align:left;text-decoration:none;position:relative;cursor:pointer;outline:0;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.option:focus:not(.mat-option-disabled),.option:hover:not(.mat-option-disabled){background:rgba(0,0,0,.04)}::ng-deep .mat-checkbox-layout{display:inline-block!important;flex-grow:1;text-overflow:ellipsis}.selected-item:hover{box-shadow:1px 1px #959595}.chip-list{overflow:auto}.option-header{display:flex!important}.box-border-option{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px #0000001f}mat-icon{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i7.MatOptgroup, selector: "mat-optgroup", inputs: ["disabled"], exportAs: ["matOptgroup"] }, { kind: "component", type: i8.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i9.MatChipGrid, selector: "mat-chip-grid", inputs: ["tabIndex", "disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i9.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i9.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i9.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["color", "disabled", "disableRipple", "tabIndex", "editable"], outputs: ["edited"] }, { kind: "component", type: i10.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i11.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }], animations: [DropDownAnimation] });
471
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RuclibMultiSelectComponent, decorators: [{
472
- type: Component,
473
- args: [{ selector: 'uxp-ruclib-multi-select', animations: [DropDownAnimation], providers: [FilterPipe, SortPipe], template: "<div class=\"{{ customTheme }}\" (clickOutside)=\"close()\">\r\n <mat-form-field\r\n class=\"chip-list\"\r\n [ngStyle]=\"{ 'max-height.px': height, 'width.%': 100 }\"\r\n [appearance]=\"getApperance()\"\r\n >\r\n <mat-label>{{ label }}</mat-label>\r\n <mat-chip-grid\r\n matInput\r\n [formControl]=\"multiSelectList\"\r\n #chipGrid\r\n aria-label=\"Cities\"\r\n >\r\n <mat-chip-row *ngFor=\"let item of selectedItems\" (removed)=\"removeItem(item)\">\r\n {{ item.text }}\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n <input\r\n (click)=\"toggleDropdown()\"\r\n [placeholder]=\"placeholder\"\r\n [matChipInputFor]=\"chipGrid\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (keyup)=\"filterData(searchText)\"\r\n [(ngModel)]=\"searchText\"\r\n />\r\n </mat-chip-grid>\r\n <mat-icon\r\n *ngIf=\"selectedItems.length\"\r\n (click)=\"clearSelectedMenu()\"\r\n matSuffix\r\n >clear</mat-icon\r\n >\r\n <mat-icon *ngIf=\"!selectedItems.length && !showdropdown\" matSuffix\r\n >expand_more</mat-icon\r\n >\r\n <mat-icon *ngIf=\"!selectedItems.length && showdropdown\" matSuffix\r\n >expand_less</mat-icon\r\n >\r\n </mat-form-field>\r\n\r\n <div\r\n *ngIf=\"searchText && filteredItem.length < 1\"\r\n class=\"margin-2-top-bottom\"\r\n >\r\n <div>No option found</div>\r\n </div>\r\n\r\n <div class=\"box-border-option\">\r\n <div\r\n *ngIf=\"showdropdown\"\r\n class=\"option-header\"\r\n role=\"options\"\r\n tabindex=\"-1\"\r\n [@dropDownMenu]\r\n >\r\n <ng-container *ngIf=\"!singleSelection\">\r\n <div *ngIf=\"showSelectAll\">\r\n <div *ngIf=\"limitSelection === null\">\r\n <mat-checkbox\r\n class=\"option mat-primary\"\r\n role=\"option\"\r\n color=\"{{ theme }}\"\r\n [checked]=\"isAllSelected()\"\r\n (change)=\"onAllSelection()\"\r\n value=\"select-all\"\r\n >Select All\r\n </mat-checkbox>\r\n </div>\r\n </div>\r\n <mat-checkbox\r\n *ngIf=\"showSelected\"\r\n class=\"option mat-primary\"\r\n role=\"option\"\r\n color=\"{{ theme }}\"\r\n [checked]=\"isShowSelected()\"\r\n (change)=\"onShowSelection()\"\r\n value=\"select-all\"\r\n >Show Selected\r\n </mat-checkbox>\r\n <mat-slide-toggle\r\n *ngIf=\"sortObj['sortBy']\"\r\n class=\"option mat-primary\"\r\n (click)=\"onSortToggle()\"\r\n >Sort\r\n </mat-slide-toggle>\r\n <mat-divider></mat-divider>\r\n </ng-container>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"showdropdown\"\r\n [ngClass]=\"{\r\n 'scroll-option-container': scroll,\r\n 'option-container': '!scroll'\r\n }\"\r\n role=\"options\"\r\n [ngStyle]=\"{ 'max-height.px': maxDropdownHeight, 'width.%': 100 }\"\r\n tabindex=\"-1\"\r\n >\r\n <ng-container>\r\n <div *ngIf=\"!singleSelection\" [@dropDownMenu]>\r\n <!-- for grouped -->\r\n <div *ngFor=\"let item of filteredItem\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"\r\n (item.childItem && item.childItem.length > 0) || item.grouped\r\n ? multipleGroupedCase\r\n : multipleNonGroupedCase\r\n \"\r\n [ngTemplateOutletContext]=\"{ item: item }\"\r\n >\r\n </ng-container>\r\n </div>\r\n </div>\r\n <!-- for single selection case -->\r\n <div *ngIf=\"singleSelection\">\r\n <div *ngFor=\"let item of filteredItem\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"\r\n item.childItem && item.childItem.length > 0\r\n ? singleGroupedCase\r\n : singleNonGroupedCase\r\n \"\r\n [ngTemplateOutletContext]=\"{ item: item }\"\r\n >\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n\r\n <!-- for multiple selected group case -->\r\n <ng-template #multipleGroupedCase let-item=\"item\">\r\n <mat-optgroup [label]=\"item.text\" [disabled]=\"item.isDisabled\">\r\n <mat-option\r\n *ngFor=\"let itemObj of item.childItem\"\r\n [value]=\"itemObj.id\"\r\n disabled=\"{{\r\n itemObj.isDisable ||\r\n (limitSelection != null &&\r\n selectedItems.length >= limitSelection &&\r\n checkSelectedStatus(itemObj))\r\n }}\"\r\n >\r\n <mat-checkbox\r\n class=\"mat-primary\"\r\n role=\"option\"\r\n color=\"{{ theme }}\"\r\n [checked]=\"isSelected(itemObj)\"\r\n (change)=\"onSelection(itemObj)\"\r\n value=\"{{ itemObj.id }}\"\r\n disabled=\"{{\r\n itemObj.isDisable ||\r\n (limitSelection != null &&\r\n selectedItems.length >= limitSelection &&\r\n checkSelectedStatus(itemObj))\r\n }}\"\r\n >\r\n </mat-checkbox>\r\n <mat-icon *ngIf=\"itemObj.icon\">{{ itemObj.icon }}</mat-icon>\r\n {{ itemObj.text }}\r\n </mat-option>\r\n </mat-optgroup>\r\n </ng-template>\r\n\r\n <!-- for multiple selected non grouped case -->\r\n <ng-template #multipleNonGroupedCase let-item=\"item\">\r\n <mat-checkbox\r\n class=\"option mat-primary\"\r\n role=\"option\"\r\n color=\"{{ theme }}\"\r\n [checked]=\"isSelected(item)\"\r\n (change)=\"onSelection(item)\"\r\n value=\"{{ item.id }}\"\r\n disabled=\"{{\r\n item.isDisabled ||\r\n (limitSelection != null &&\r\n selectedItems.length >= limitSelection &&\r\n checkSelectedStatus(item))\r\n }}\"\r\n >\r\n <mat-icon *ngIf=\"item.icon\">{{ item.icon }}</mat-icon>\r\n {{ item.text }}\r\n </mat-checkbox>\r\n </ng-template>\r\n\r\n <!-- for single selection group case -->\r\n <ng-template #singleGroupedCase let-item=\"item\">\r\n <mat-optgroup\r\n *ngFor=\"let item of filteredItem\"\r\n [label]=\"item.text\"\r\n [disabled]=\"item.isDisabled\"\r\n >\r\n <mat-option\r\n *ngFor=\"let itemObj of item.childItem\"\r\n [value]=\"itemObj.id\"\r\n disabled=\"{{ itemObj.isDisable }}\"\r\n (click)=\"onSelection(itemObj)\"\r\n >\r\n <mat-icon *ngIf=\"itemObj.icon\">{{ itemObj.icon }}</mat-icon>\r\n {{ itemObj.text }}\r\n </mat-option>\r\n </mat-optgroup>\r\n </ng-template>\r\n\r\n <!-- for single selection non group case -->\r\n <ng-template #singleNonGroupedCase let-item=\"item\">\r\n <span\r\n class=\"option mat-primary\"\r\n (click)=\"onSelection(item)\"\r\n *ngFor=\"let item of filteredItem; let index = index\"\r\n >\r\n <mat-icon *ngIf=\"item.icon\">{{ item.icon }}</mat-icon>\r\n {{ item.text }}\r\n </span>\r\n </ng-template>\r\n </div>\r\n</div>\r\n", styles: [".scroll-option-container{overflow-x:auto;overflow-y:auto;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px #0000001f}.option-container{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px #0000001f}.option{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:52px;height:52px;padding:0 16px;text-align:left;text-decoration:none;position:relative;cursor:pointer;outline:0;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.option:focus:not(.mat-option-disabled),.option:hover:not(.mat-option-disabled){background:rgba(0,0,0,.04)}::ng-deep .mat-checkbox-layout{display:inline-block!important;flex-grow:1;text-overflow:ellipsis}.selected-item:hover{box-shadow:1px 1px #959595}.chip-list{overflow:auto}.option-header{display:flex!important}.box-border-option{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px #0000001f}mat-icon{cursor:pointer}\n"] }]
474
- }], ctorParameters: function () { return [{ type: FilterPipe }, { type: SortPipe }]; }, propDecorators: { rucEvent: [{
475
- type: Output
476
- }], rucInputData: [{
477
- type: Input
478
- }], customTheme: [{
479
- type: Input
480
- }], dataSource: [{
481
- type: Input
482
- }], paginator: [{
483
- type: ViewChild,
484
- args: [MatPaginator]
485
- }], matTable: [{
486
- type: ViewChild,
487
- args: ['matTable']
488
- }], matTableElementRef: [{
489
- type: ViewChild,
490
- args: ['matTable']
491
- }], sort: [{
492
- type: ViewChild,
493
- args: [MatSort]
494
- }] } });
495
-
496
- class RuclibMultiSelectModule {
497
- }
498
- RuclibMultiSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RuclibMultiSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
499
- RuclibMultiSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: RuclibMultiSelectModule, declarations: [RuclibMultiSelectComponent,
500
- FilterPipe,
501
- SortPipe,
502
- ClickOutsideDirective], imports: [CommonModule,
503
- FormsModule,
504
- ReactiveFormsModule,
505
- MatIconModule,
506
- MatFormFieldModule,
507
- MatInputModule,
508
- MatSelectModule,
509
- MatCheckboxModule,
510
- MatChipsModule,
511
- MatDividerModule,
512
- MatSlideToggleModule], exports: [RuclibMultiSelectComponent] });
513
- RuclibMultiSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RuclibMultiSelectModule, imports: [CommonModule,
514
- FormsModule,
515
- ReactiveFormsModule,
516
- MatIconModule,
517
- MatFormFieldModule,
518
- MatInputModule,
519
- MatSelectModule,
520
- MatCheckboxModule,
521
- MatChipsModule,
522
- MatDividerModule,
523
- MatSlideToggleModule] });
524
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RuclibMultiSelectModule, decorators: [{
525
- type: NgModule,
526
- args: [{
527
- imports: [
528
- CommonModule,
529
- FormsModule,
530
- ReactiveFormsModule,
531
- MatIconModule,
532
- MatFormFieldModule,
533
- MatInputModule,
534
- MatSelectModule,
535
- MatCheckboxModule,
536
- MatChipsModule,
537
- MatDividerModule,
538
- MatSlideToggleModule
539
- ],
540
- declarations: [
541
- RuclibMultiSelectComponent,
542
- FilterPipe,
543
- SortPipe,
544
- ClickOutsideDirective
545
- ],
546
- exports: [
547
- RuclibMultiSelectComponent
548
- ]
549
- }]
550
- }] });
551
-
552
- /**
553
- * Generated bundle index. Do not edit.
554
- */
555
-
556
- export { ListItem, RuclibMultiSelectComponent, RuclibMultiSelectModule };
557
- //# sourceMappingURL=ruc-lib-multi-select.mjs.map