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