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