@sd-angular/core 1.3.218 → 1.3.219
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/bundles/sd-angular-core-select.umd.js +36 -34
- package/bundles/sd-angular-core-select.umd.js.map +1 -1
- package/bundles/sd-angular-core-select.umd.min.js +2 -2
- package/bundles/sd-angular-core-select.umd.min.js.map +1 -1
- package/esm2015/select/src/lib/select.component.js +39 -37
- package/fesm2015/sd-angular-core-select.js +37 -35
- package/fesm2015/sd-angular-core-select.js.map +1 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.3.218.tgz → sd-angular-core-1.3.219.tgz} +0 -0
- package/select/sd-angular-core-select.metadata.json +1 -1
- package/select/src/lib/select.component.d.ts +1 -0
|
@@ -82,9 +82,7 @@ class SdSelect {
|
|
|
82
82
|
this.formControl.setValidators(validators);
|
|
83
83
|
this.formControl.setAsyncValidators(asyncValidators);
|
|
84
84
|
this.formControl.updateValueAndValidity();
|
|
85
|
-
}
|
|
86
|
-
// Hàm tạo Validators tùy chỉnh cho inlineError
|
|
87
|
-
);
|
|
85
|
+
});
|
|
88
86
|
_loadSelectedItems.set(this, (value, items) => __awaiter(this, void 0, void 0, function* () {
|
|
89
87
|
if (!(value === null || value === void 0 ? void 0 : value.toString())) {
|
|
90
88
|
return [];
|
|
@@ -95,7 +93,9 @@ class SdSelect {
|
|
|
95
93
|
}
|
|
96
94
|
this.loading = true;
|
|
97
95
|
if (values.some(val => __classPrivateFieldGet(this, _allItem)[val] === undefined)) {
|
|
98
|
-
const results = yield items(value, true)
|
|
96
|
+
const results = yield items(value, true)
|
|
97
|
+
.catch(() => [])
|
|
98
|
+
.finally(() => (this.loading = false));
|
|
99
99
|
const objItem = Array.toObject(results, this.valueField);
|
|
100
100
|
const objValue = Array.toObject(values.map(val => ({ [val === null || val === void 0 ? void 0 : val.toString()]: { [this.valueField]: val, [this.displayField]: val } })), this.valueField);
|
|
101
101
|
__classPrivateFieldSet(this, _allItem, Object.assign(Object.assign(Object.assign({}, objValue), __classPrivateFieldGet(this, _allItem)), objItem));
|
|
@@ -106,11 +106,13 @@ class SdSelect {
|
|
|
106
106
|
searchText = (searchText === null || searchText === void 0 ? void 0 : searchText.toString()) || '';
|
|
107
107
|
const key = hash({
|
|
108
108
|
checksum: this.cacheChecksum || null,
|
|
109
|
-
searchText
|
|
109
|
+
searchText,
|
|
110
110
|
});
|
|
111
111
|
if (__classPrivateFieldGet(this, _cache)[key] === undefined && this.isFocused) {
|
|
112
112
|
this.loading = true;
|
|
113
|
-
const results = yield items(searchText)
|
|
113
|
+
const results = yield items(searchText)
|
|
114
|
+
.catch(() => [])
|
|
115
|
+
.finally(() => (this.loading = false));
|
|
114
116
|
const objItem = Array.toObject(results, this.valueField);
|
|
115
117
|
__classPrivateFieldSet(this, _allItem, Object.assign(Object.assign({}, __classPrivateFieldGet(this, _allItem)), objItem));
|
|
116
118
|
__classPrivateFieldGet(this, _cache)[key] = results.union(this.valueField);
|
|
@@ -140,7 +142,7 @@ class SdSelect {
|
|
|
140
142
|
this.sdChange.emit(value);
|
|
141
143
|
this.sdSelection.emit({
|
|
142
144
|
value: value,
|
|
143
|
-
items: value.map(val => __classPrivateFieldGet(this, _allItem)[val === null || val === void 0 ? void 0 : val.toString()])
|
|
145
|
+
items: value.map(val => __classPrivateFieldGet(this, _allItem)[val === null || val === void 0 ? void 0 : val.toString()]),
|
|
144
146
|
});
|
|
145
147
|
}
|
|
146
148
|
else {
|
|
@@ -148,7 +150,7 @@ class SdSelect {
|
|
|
148
150
|
this.sdChange.emit(value);
|
|
149
151
|
this.sdSelection.emit({
|
|
150
152
|
value: value,
|
|
151
|
-
item: __classPrivateFieldGet(this, _allItem)[value === null || value === void 0 ? void 0 : value.toString()]
|
|
153
|
+
item: __classPrivateFieldGet(this, _allItem)[value === null || value === void 0 ? void 0 : value.toString()],
|
|
152
154
|
});
|
|
153
155
|
}
|
|
154
156
|
}));
|
|
@@ -160,7 +162,7 @@ class SdSelect {
|
|
|
160
162
|
this.sdChange.emit([]);
|
|
161
163
|
this.sdSelection.emit({
|
|
162
164
|
value: [],
|
|
163
|
-
items: []
|
|
165
|
+
items: [],
|
|
164
166
|
});
|
|
165
167
|
}
|
|
166
168
|
else {
|
|
@@ -169,7 +171,7 @@ class SdSelect {
|
|
|
169
171
|
this.sdChange.emit(null);
|
|
170
172
|
this.sdSelection.emit({
|
|
171
173
|
value: null,
|
|
172
|
-
item: null
|
|
174
|
+
item: null,
|
|
173
175
|
});
|
|
174
176
|
}
|
|
175
177
|
};
|
|
@@ -192,20 +194,20 @@ class SdSelect {
|
|
|
192
194
|
_customValidator.set(this, (func) => {
|
|
193
195
|
return (c) => __awaiter(this, void 0, void 0, function* () {
|
|
194
196
|
const value = c.value || null;
|
|
195
|
-
if (func && typeof
|
|
197
|
+
if (func && typeof func === 'function') {
|
|
196
198
|
const result = func(value);
|
|
197
199
|
if (result instanceof Promise) {
|
|
198
200
|
const message = yield result;
|
|
199
201
|
if (message) {
|
|
200
202
|
return {
|
|
201
|
-
customValidator: message
|
|
203
|
+
customValidator: message,
|
|
202
204
|
};
|
|
203
205
|
}
|
|
204
206
|
return null;
|
|
205
207
|
}
|
|
206
208
|
if (result) {
|
|
207
209
|
return {
|
|
208
|
-
customValidator: result
|
|
210
|
+
customValidator: result,
|
|
209
211
|
};
|
|
210
212
|
}
|
|
211
213
|
return null;
|
|
@@ -274,8 +276,8 @@ class SdSelect {
|
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
278
|
set _disableErrorMessage(val) {
|
|
277
|
-
this.disableErrorMessage =
|
|
278
|
-
val =
|
|
279
|
+
this.disableErrorMessage = val === '' || val;
|
|
280
|
+
val = val === '' || val;
|
|
279
281
|
}
|
|
280
282
|
set form(val) {
|
|
281
283
|
if (val) {
|
|
@@ -291,10 +293,9 @@ class SdSelect {
|
|
|
291
293
|
this.label = val;
|
|
292
294
|
this.qcId = hash({
|
|
293
295
|
selector: 'sd-select',
|
|
294
|
-
label: val
|
|
296
|
+
label: val,
|
|
295
297
|
});
|
|
296
298
|
}
|
|
297
|
-
;
|
|
298
299
|
set model(value) {
|
|
299
300
|
// if(this.formControl.disabled) {
|
|
300
301
|
// this.formControl.enable({
|
|
@@ -324,7 +325,7 @@ class SdSelect {
|
|
|
324
325
|
this.searchTerm$.next('');
|
|
325
326
|
}
|
|
326
327
|
set required(val) {
|
|
327
|
-
this.isRequired =
|
|
328
|
+
this.isRequired = val === '' || val;
|
|
328
329
|
__classPrivateFieldGet(this, _updateValidator).call(this);
|
|
329
330
|
}
|
|
330
331
|
set validator(validator) {
|
|
@@ -337,7 +338,7 @@ class SdSelect {
|
|
|
337
338
|
}
|
|
338
339
|
// Optional
|
|
339
340
|
set disabled(val) {
|
|
340
|
-
val =
|
|
341
|
+
val = val === '' || val;
|
|
341
342
|
if (val) {
|
|
342
343
|
this.formControl.disable();
|
|
343
344
|
}
|
|
@@ -346,16 +347,16 @@ class SdSelect {
|
|
|
346
347
|
}
|
|
347
348
|
}
|
|
348
349
|
set _multiple(val) {
|
|
349
|
-
this.multiple =
|
|
350
|
+
this.multiple = val === '' || val;
|
|
350
351
|
}
|
|
351
352
|
set _filtered(val) {
|
|
352
|
-
this.filtered =
|
|
353
|
+
this.filtered = val === '' || val;
|
|
353
354
|
}
|
|
354
355
|
set _selectAll(val) {
|
|
355
|
-
this.selectAll =
|
|
356
|
+
this.selectAll = val === '' || val;
|
|
356
357
|
}
|
|
357
358
|
set _copyable(val) {
|
|
358
|
-
this.copyable =
|
|
359
|
+
this.copyable = val === '' || val;
|
|
359
360
|
}
|
|
360
361
|
ngOnInit() {
|
|
361
362
|
var _a;
|
|
@@ -366,10 +367,10 @@ class SdSelect {
|
|
|
366
367
|
__classPrivateFieldSet(this, _allItems, combineLatest([
|
|
367
368
|
__classPrivateFieldGet(this, _itemsChanges).asObservable(),
|
|
368
369
|
this.searchTerm$.asObservable().pipe(startWith(''), debounceTime(__classPrivateFieldGet(this, _delay))),
|
|
369
|
-
this.formControl.valueChanges.pipe(startWith(this.formControl.value))
|
|
370
|
+
this.formControl.valueChanges.pipe(startWith(this.formControl.value)),
|
|
370
371
|
]).pipe(switchMap(([items, val, formValue]) => __awaiter(this, void 0, void 0, function* () {
|
|
371
372
|
formValue = this.formControl.value;
|
|
372
|
-
if (typeof
|
|
373
|
+
if (typeof items === 'function') {
|
|
373
374
|
return yield __classPrivateFieldGet(this, _loadItems).call(this, val, items);
|
|
374
375
|
}
|
|
375
376
|
__classPrivateFieldSet(this, _allItem, items.toObject(this.valueField));
|
|
@@ -407,9 +408,8 @@ class SdSelect {
|
|
|
407
408
|
}))));
|
|
408
409
|
this.selectedItems = combineLatest([
|
|
409
410
|
__classPrivateFieldGet(this, _itemsChanges).asObservable(),
|
|
410
|
-
this.formControl.valueChanges.pipe(startWith(this.formControl.value))
|
|
411
|
-
])
|
|
412
|
-
.pipe(switchMap(([items, val]) => __awaiter(this, void 0, void 0, function* () {
|
|
411
|
+
this.formControl.valueChanges.pipe(startWith(this.formControl.value)),
|
|
412
|
+
]).pipe(switchMap(([items, val]) => __awaiter(this, void 0, void 0, function* () {
|
|
413
413
|
// Vì một số lý do chưa xác định mà khi sử dụng sdViewDef thì khi chuyển sang dạng view sẽ trigger val = null
|
|
414
414
|
// Nhưng formControl.value vẫn có giá trị đúng nên thực hiện gán val = this.formControl.value;
|
|
415
415
|
val = this.formControl.value;
|
|
@@ -420,18 +420,20 @@ class SdSelect {
|
|
|
420
420
|
if (!this.valueField) {
|
|
421
421
|
return values;
|
|
422
422
|
}
|
|
423
|
-
if (typeof
|
|
423
|
+
if (typeof items === 'function') {
|
|
424
424
|
return yield __classPrivateFieldGet(this, _loadSelectedItems).call(this, val, items);
|
|
425
425
|
}
|
|
426
426
|
return values.map(value => {
|
|
427
|
-
return (items === null || items === void 0 ? void 0 : items.find(item => item[this.valueField] === value)) || {
|
|
427
|
+
return ((items === null || items === void 0 ? void 0 : items.find(item => item[this.valueField] === value)) || {
|
|
428
428
|
[this.valueField]: value,
|
|
429
|
-
[this.displayField]: value
|
|
430
|
-
};
|
|
429
|
+
[this.displayField]: value,
|
|
430
|
+
});
|
|
431
431
|
});
|
|
432
432
|
})));
|
|
433
433
|
this.filteredItems = __classPrivateFieldGet(this, _allItems).pipe(map(allItems => allItems.paging(this.limit)));
|
|
434
|
-
this.display = this.selectedItems.pipe(map(selectedItems => { var _a; return (_a = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map(item => this.displayField ? item[this.displayField] : item)) === null || _a === void 0 ? void 0 : _a.join(', '); }));
|
|
434
|
+
this.display = this.selectedItems.pipe(map(selectedItems => { var _a; return (_a = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map(item => (this.displayField ? item[this.displayField] : item))) === null || _a === void 0 ? void 0 : _a.join(', '); }));
|
|
435
|
+
// Lấy dữ liệu cho tooltip
|
|
436
|
+
__classPrivateFieldGet(this, _subscription).add(this.selectedItems.subscribe(selectedItems => { var _a; return this.tooltip = (_a = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map(item => this.valueField ? `• ${item[this.valueField]} - ${item[this.displayField]}` : `• ${item}`)) === null || _a === void 0 ? void 0 : _a.join('\n'); }));
|
|
435
437
|
}
|
|
436
438
|
ngAfterViewInit() {
|
|
437
439
|
var _a;
|
|
@@ -462,9 +464,9 @@ _input = new WeakMap(), _name = new WeakMap(), _form = new WeakMap(), _itemsChan
|
|
|
462
464
|
SdSelect.decorators = [
|
|
463
465
|
{ type: Component, args: [{
|
|
464
466
|
selector: 'sd-select',
|
|
465
|
-
template: "<ng-container *ngIf=\"!appearance && sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\"> </ng-container>\r\n</ng-container>\r\n<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\"\r\n >{{ label }} <span class=\"text-danger mb-2\" *ngIf=\"isRequired\">*</span></label\r\n>\r\n<div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdView?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\">\r\n <ng-container *ngIf=\"sdView?.templateRef && !isFocused; else default\">\r\n <ng-container *ngTemplateOutlet=\"sdView.templateRef; context: { value: formControl.value, selectedItems: selectedItems | async }\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #default>\r\n <mat-form-field\r\n class=\"sd-md\"\r\n [ngClass]=\"{ 'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage }\"\r\n [appearance]=\"appearance || 'outline'\">\r\n <mat-label *ngIf=\"appearance && label\">{{ label }}</mat-label>\r\n <mat-select\r\n *ngIf=\"multiple\"\r\n #select\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n multiple\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n disableOptionCentering=\"true\"\r\n panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{ 'sd-selected': !isRequired && (multiple ? formControl?.value?.length : formControl?.value != null) }\"\r\n [required]=\"isRequired\"\r\n (openedChange)=\"onOpenChange($event)\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\"\r\n [
|
|
467
|
+
template: "<ng-container *ngIf=\"!appearance && sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\"> </ng-container>\r\n</ng-container>\r\n<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\"\r\n >{{ label }} <span class=\"text-danger mb-2\" *ngIf=\"isRequired\">*</span></label\r\n>\r\n<div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdView?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\">\r\n <ng-container *ngIf=\"sdView?.templateRef && !isFocused; else default\">\r\n <ng-container *ngTemplateOutlet=\"sdView.templateRef; context: { value: formControl.value, selectedItems: selectedItems | async }\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #default>\r\n <mat-form-field\r\n class=\"sd-md\"\r\n [ngClass]=\"{ 'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage }\"\r\n [appearance]=\"appearance || 'outline'\">\r\n <mat-label *ngIf=\"appearance && label\">{{ label }}</mat-label>\r\n <mat-select\r\n *ngIf=\"multiple\"\r\n #select\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n multiple\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n disableOptionCentering=\"true\"\r\n panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{ 'sd-selected': !isRequired && (multiple ? formControl?.value?.length : formControl?.value != null) }\"\r\n [required]=\"isRequired\"\r\n (openedChange)=\"onOpenChange($event)\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\"\r\n matTooltipClass=\"sd-multiline-tooltip\"\r\n [matTooltipDisabled]=\"!formControl.disabled || !formControl?.value?.length\"\r\n [matTooltip]=\"tooltip\">\r\n <mat-select-trigger>\r\n {{ display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input\r\n aria-hidden=\"true\"\r\n #input\r\n placeholder=\"{{ 'Search' | sdTranslate }}\"\r\n matInput\r\n autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (keyup)=\"searchTerm$.next($event.target.value)\" />\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"multiple && selectAll\">\r\n <mat-checkbox class=\"mat-option\" [(ngModel)]=\"allSelected\" [ngModelOptions]=\"{ standalone: true }\" (change)=\"onSelectAll()\">\r\n T\u1EA5t c\u1EA3</mat-checkbox\r\n >\r\n </ng-container>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item[valueField]\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <mat-select\r\n *ngIf=\"!multiple\"\r\n #select\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n disableOptionCentering=\"true\"\r\n panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{ 'sd-selected': !isRequired && formControl?.value != null }\"\r\n [required]=\"isRequired\"\r\n (openedChange)=\"onOpenChange($event)\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\">\r\n <mat-select-trigger>\r\n {{ display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input\r\n aria-hidden=\"true\"\r\n #input\r\n placeholder=\"{{ 'Search' | sdTranslate }}\"\r\n matInput\r\n autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (keyup)=\"searchTerm$.next($event.target.value)\" />\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item[valueField]\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <svg\r\n #copyTooltip=\"matTooltip\"\r\n *ngIf=\"(multiple ? formControl?.value?.length : formControl?.value != null) && copyable\"\r\n matSuffix\r\n [matTooltip]=\"copied ? 'Copied' : 'Copy'\"\r\n class=\"icon-copy\"\r\n focusable=\"false\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 448 512\"\r\n (click)=\"onCopyText($event)\">\r\n <path\r\n d=\"M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z\"></path>\r\n </svg>\r\n <mat-icon\r\n *ngIf=\"(multiple ? formControl?.value?.length : formControl?.value != null) && !isRequired && !formControl.disabled\"\r\n class=\"pointer sd-suffix-icon\"\r\n (click)=\"clear($event)\"\r\n matSuffix\r\n >cancel\r\n </mat-icon>\r\n <mat-error *ngIf=\"formControl.errors?.required\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ 'This field is required' | sdTranslate }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.customValidator\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ formControl?.errors?.customValidator }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.errors?.inlineError\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{inlineError}}</ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n</div>\r\n<!-- <sd-popover #popoverValues=\"sdPopover\" width=\"auto\">\r\n <ng-container *ngIf=\"formControl?.value?.length\">\r\n <ng-container *sdLet=\"selectedItems | async as items\">\r\n <div *ngFor=\"let item of items\">\r\n <strong>{{ item[valueField] }}</strong> - {{ item[displayField] }}\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n</sd-popover> -->\r\n",
|
|
466
468
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
467
|
-
styles: [":host{display:block;padding-top:5px}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:none}:host ::ng-deep .sd-selected .mat-select-arrow{border:none}:host ::ng-deep .mat-form-field.no-padding-wrapper .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-form-field-outline{background:#f6f6f6;color:#e9e9e9}:host ::ng-deep .mat-form-field mat-select.mat-select-disabled .mat-select-value{color:#4d4d4d!important}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}:host ::ng-deep .mat-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-form-field .icon-copy{cursor:pointer;fill:rgba(0,0,0,.5);height:.9em;opacity:0;transition:opacity .2s linear;width:.9em}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input{background-color:#fff;position:-webkit-sticky;position:sticky;top:0;z-index:10}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline{width:100%}::ng-deep .sd-select-panel .mat-option.sd-filtered-input mat-pseudo-checkbox{display:none}::ng-deep .mat-select-panel .mat-option.sd-filtered-input{height:auto}::ng-deep .sd-select-panel .mat-option.sd-filtered-input input{color:#000}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field-prefix .mat-icon{margin-right:0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper{padding:10px 0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-outline{background-color:rgba(0,0,0,.04)}"]
|
|
469
|
+
styles: [":host{display:block;padding-top:5px}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:none}:host ::ng-deep .sd-selected .mat-select-arrow{border:none}:host ::ng-deep .mat-form-field.no-padding-wrapper .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-form-field-outline{background:#f6f6f6;color:#e9e9e9}:host ::ng-deep .mat-form-field mat-select.mat-select-disabled .mat-select-value{color:#4d4d4d!important}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}:host ::ng-deep .mat-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-form-field .icon-copy{cursor:pointer;fill:rgba(0,0,0,.5);height:.9em;opacity:0;transition:opacity .2s linear;width:.9em}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input{background-color:#fff;position:-webkit-sticky;position:sticky;top:0;z-index:10}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline{width:100%}::ng-deep .sd-select-panel .mat-option.sd-filtered-input mat-pseudo-checkbox{display:none}::ng-deep .mat-select-panel .mat-option.sd-filtered-input{height:auto}::ng-deep .sd-select-panel .mat-option.sd-filtered-input input{color:#000}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field-prefix .mat-icon{margin-right:0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper{padding:10px 0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-outline{background-color:rgba(0,0,0,.04)}:host ::ng-deep .sd-multiline-tooltip{white-space:pre-line}"]
|
|
468
470
|
},] }
|
|
469
471
|
];
|
|
470
472
|
SdSelect.ctorParameters = () => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-select.js","sources":["../../../../projects/sd-core/select/src/lib/select-display-def.directive.ts","../../../../projects/sd-core/select/src/lib/select.component.ts","../../../../projects/sd-core/select/src/lib/select.module.ts","../../../../projects/sd-core/select/src/public-api.ts","../../../../projects/sd-core/select/sd-angular-core-select.ts"],"sourcesContent":["import { Directive, TemplateRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[sdSelectDisplayDef]'\r\n})\r\nexport class SdSelectDisplayDefDirective {\r\n constructor(public templateRef: TemplateRef<any>) { }\r\n}\r\n","import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, EventEmitter, Inject, Input, OnDestroy, OnInit, Optional, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, AsyncValidatorFn, FormGroup, NgForm, ValidatorFn, Validators } from '@angular/forms';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { MatSelect, MatSelectChange } from '@angular/material/select';\r\nimport { MatTooltip } from '@angular/material/tooltip';\r\nimport { FORM_CONFIG, IFormConfiguration, SdFormControl, SdLabelDefDirective, SdViewDefDirective } from '@sd-angular/core/common';\r\nimport { PopoverComponent } from '@sd-angular/core/popover';\r\nimport hash from 'object-hash';\r\nimport { BehaviorSubject, Observable, Subject, Subscription, combineLatest } from 'rxjs';\r\nimport { debounceTime, map, startWith, switchMap } from 'rxjs/operators';\r\nimport * as uuid from 'uuid';\r\nimport { SdSelectDisplayDefDirective } from './select-display-def.directive';\r\n@Component({\r\n selector: 'sd-select',\r\n templateUrl: './select.component.html',\r\n styleUrls: ['./select.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdSelect implements OnInit, AfterViewInit, OnDestroy {\r\n #input: MatInput;\r\n @ViewChild(MatInput) set input(input: MatInput) {\r\n if (this.#input !== input) {\r\n this.#input = input;\r\n this.#input.value = null;\r\n }\r\n }\r\n @ViewChild('select') select: MatSelect;\r\n #name = uuid.v4();\r\n @Input() set name(val: string) {\r\n if (val) {\r\n this.#name = val;\r\n }\r\n }\r\n @Input() appearance: MatFormFieldAppearance;\r\n disableErrorMessage = false;\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = (val === '') || val;\r\n val = (val === '') || val;\r\n }\r\n formControl = new SdFormControl();\r\n\r\n searchTerm$ = new Subject<string>();\r\n\r\n @Input() size: 'sm' | 'lg';\r\n #form: FormGroup;\r\n @Input() set form(val: NgForm | FormGroup) {\r\n if (val) {\r\n if (val instanceof NgForm) {\r\n this.#form = val.form;\r\n } else {\r\n this.#form = val;\r\n }\r\n }\r\n }\r\n qcId: string;\r\n label: string;\r\n @Input('label') set _label(val: string) {\r\n this.label = val;\r\n this.qcId = hash({\r\n selector: 'sd-select',\r\n label: val\r\n });\r\n };\r\n @Input() placeholder: string;\r\n\r\n // Model\r\n display: Observable<string>;\r\n @Input() set model(value: undefined | boolean | number | string | (number | string)[]) {\r\n // if(this.formControl.disabled) {\r\n // this.formControl.enable({\r\n // emitEvent: false\r\n // });\r\n // this.formControl.setValue(value);\r\n // this.formControl.disable({\r\n // emitEvent: false\r\n // });\r\n // } else {\r\n // this.formControl.setValue(value);\r\n // }\r\n this.formControl.setValue(value);\r\n }\r\n // Items\r\n\r\n #itemsChanges = new BehaviorSubject<any[] | SearchFunc>([]);\r\n @Input() set items(items: undefined | any[] | SearchFunc) {\r\n this.#delay = 0;\r\n if (!items) {\r\n this.#itemsChanges.next([]);\r\n } else if (Array.isArray(items)) {\r\n this.#itemsChanges.next(items.filter(e => e !== null && e !== undefined));\r\n } else {\r\n this.#delay = 500;\r\n this.#itemsChanges.next(items);\r\n }\r\n this.searchTerm$.next('');\r\n }\r\n @Input() valueField: string;\r\n @Input() displayField: string;\r\n @Input() cacheChecksum: any;\r\n\r\n // Server search\r\n loading = false;\r\n #delay = 200; // Sau khoảng thời gian delay nếu không có thay đổi thì thì mới bắt đầu thực hiện gọi hàm\r\n\r\n // Validator\r\n isRequired = false;\r\n #validator: (value: any) => string | Promise<string>;\r\n @Input() set required(val: boolean | '') {\r\n this.isRequired = (val === '') || val;\r\n this.#updateValidator();\r\n }\r\n @Input() set validator(validator: (value: any) => string | Promise<string>) {\r\n this.#validator = validator;\r\n this.#updateValidator();\r\n }\r\n\r\n inlineError: string;\r\n @Input('inlineError') set _inlineError(val: string) {\r\n this.inlineError = val;\r\n this.#updateValidator();\r\n }\r\n\r\n // Optional\r\n @Input() set disabled(val: boolean | '') {\r\n val = (val === '') || val;\r\n if (val) {\r\n this.formControl.disable();\r\n } else {\r\n this.formControl.enable();\r\n }\r\n }\r\n multiple = false;\r\n @Input('multiple') set _multiple(val: boolean | '') {\r\n this.multiple = (val === '') || val;\r\n }\r\n @Input() limit = 100;\r\n filtered = false;\r\n @Input('filtered') set _filtered(val: boolean | '') {\r\n this.filtered = (val === '') || val;\r\n }\r\n @ContentChild(SdSelectDisplayDefDirective) selectDisplayDef: SdSelectDisplayDefDirective;\r\n selectAll = false;\r\n @Input('selectAll') set _selectAll(val: boolean | '') {\r\n this.selectAll = (val === '') || val;\r\n }\r\n\r\n @ViewChild('copyTooltip') copyTooltip: MatTooltip;\r\n copyable = false;\r\n @Input('copyable') set _copyable(val: boolean | '') {\r\n this.copyable = (val === '') || val;\r\n }\r\n copied = false;\r\n @Input() copyText: ((value: string | string[], items: any[]) => string) | string;\r\n\r\n @Output() modelChange = new EventEmitter();\r\n @Output() sdChange = new EventEmitter();\r\n @Output() sdSelection = new EventEmitter<{ value: any | any[], item?: any, items?: any[] }>();\r\n #subscription = new Subscription();\r\n selectedItems: Observable<any[]>;\r\n #allItems: Observable<any[]>;\r\n filteredItems: Observable<any[]>;\r\n #allItem: {\r\n [key: string]: any\r\n } = {};\r\n allSelected = false;\r\n #cache: {\r\n [key: string]: any[]\r\n } = {};\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n isFocused = false;\r\n\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n @Inject(FORM_CONFIG) @Optional() private formConfig: IFormConfiguration\r\n ) { }\r\n\r\n ngOnInit() {\r\n this.appearance = this.appearance || this.formConfig?.appearance;\r\n this.#subscription.add(this.formControl.sdChanges.subscribe(() => {\r\n this.ref.markForCheck();\r\n }));\r\n this.#allItems = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.searchTerm$.asObservable().pipe(startWith(''), debounceTime(this.#delay)),\r\n this.formControl.valueChanges.pipe(startWith(this.formControl.value))]).pipe(\r\n switchMap(async ([items, val, formValue]) => {\r\n formValue = this.formControl.value;\r\n if (typeof (items) === 'function') {\r\n return await this.#loadItems(val, items);\r\n }\r\n this.#allItem = items.toObject(this.valueField);\r\n const isArray = Array.isArray(formValue);\r\n const hasFields = !!this.valueField && !!this.displayField;\r\n const filteredItems = items.filter(item => {\r\n const value = hasFields ? item[this.valueField] : item;\r\n const display = hasFields ? item[this.displayField] : item;\r\n if (String.aliasIncludes(value, val) || String.aliasIncludes(display, val)) {\r\n return true;\r\n }\r\n if (isArray) {\r\n return formValue.some(e => e === value);\r\n }\r\n return formValue === value;\r\n });\r\n if (items.length <= this.limit) {\r\n return filteredItems;\r\n }\r\n // Đưa những selectedItems lên đầu nếu không mat-select-trigger sẽ không work\r\n return filteredItems.sort((current, next) => {\r\n const value1 = hasFields ? current[this.valueField] : current;\r\n const value2 = hasFields ? next[this.valueField] : next;\r\n let flag1 = 0;\r\n let flag2 = 0;\r\n if (isArray) {\r\n flag1 = formValue.some(e => e === value1) ? 1 : 0;\r\n flag2 = formValue.some(e => e === value2) ? 1 : 0;\r\n return flag2 - flag1;\r\n }\r\n flag1 = formValue === value1 ? 1 : 0;\r\n flag2 = formValue === value2 ? 1 : 0;\r\n return flag2 - flag1;\r\n });\r\n }));\r\n this.selectedItems = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.formControl.valueChanges.pipe(startWith(this.formControl.value))])\r\n .pipe(\r\n switchMap(async ([items, val]) => {\r\n // Vì một số lý do chưa xác định mà khi sử dụng sdViewDef thì khi chuyển sang dạng view sẽ trigger val = null\r\n // Nhưng formControl.value vẫn có giá trị đúng nên thực hiện gán val = this.formControl.value;\r\n val = this.formControl.value;\r\n if (!val?.toString()) {\r\n return [];\r\n }\r\n const values = Array.isArray(val) ? val : [val];\r\n if (!this.valueField) {\r\n return values;\r\n }\r\n if (typeof (items) === 'function') {\r\n return await this.#loadSelectedItems(val, items);\r\n }\r\n return values.map(value => {\r\n return items?.find(item => item[this.valueField] === value) || {\r\n [this.valueField]: value,\r\n [this.displayField]: value\r\n };\r\n });\r\n })\r\n );\r\n this.filteredItems = this.#allItems.pipe(map(allItems => allItems.paging(this.limit)));\r\n this.display = this.selectedItems.pipe(\r\n map(selectedItems => selectedItems?.map(item => this.displayField ? item[this.displayField] : item)?.join(', ')));\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n #updateValidator = () => {\r\n this.formControl.clearValidators();\r\n this.formControl.clearAsyncValidators();\r\n const validators: ValidatorFn[] = [];\r\n const asyncValidators: AsyncValidatorFn[] = [];\r\n if (this.isRequired) {\r\n validators.push(Validators.required);\r\n }\r\n if (this.#validator) {\r\n asyncValidators.push(this.#customValidator(this.#validator));\r\n }\r\n if (this.inlineError) {\r\n validators.push(this.customInlineErrorValidator());\r\n }\r\n this.formControl.setValidators(validators);\r\n this.formControl.setAsyncValidators(asyncValidators);\r\n this.formControl.updateValueAndValidity();\r\n }\r\n\r\n // Hàm tạo Validators tùy chỉnh cho inlineError\r\n customInlineErrorValidator(): ValidatorFn {\r\n return (control: AbstractControl): { [key: string]: any } | null => {\r\n return { inlineError: true };\r\n };\r\n }\r\n\r\n #loadSelectedItems = async (value: string | string[], items: SearchFunc) => {\r\n if (!value?.toString()) {\r\n return [];\r\n }\r\n const values = Array.isArray(value) ? value : [value];\r\n if (!this.valueField && !this.displayField) {\r\n return values;\r\n }\r\n this.loading = true;\r\n if (values.some(val => this.#allItem[val] === undefined)) {\r\n const results = await items(value, true).catch(() => []).finally(() => this.loading = false);\r\n const objItem = Array.toObject(results, this.valueField);\r\n const objValue = Array.toObject(\r\n values.map(val => ({ [val?.toString()]: { [this.valueField]: val, [this.displayField]: val } })), this.valueField);\r\n this.#allItem = {\r\n ...objValue,\r\n ...this.#allItem,\r\n ...objItem\r\n };\r\n }\r\n return values.map(val => this.#allItem[val?.toString()] ?? { [this.valueField]: val, [this.displayField]: val });\r\n }\r\n\r\n #loadItems = async (searchText: string, items: SearchFunc) => {\r\n searchText = searchText?.toString() || '';\r\n const key = hash({\r\n checksum: this.cacheChecksum || null,\r\n searchText\r\n });\r\n\r\n if (this.#cache[key] === undefined && this.isFocused) {\r\n this.loading = true;\r\n const results = await items(searchText).catch(() => []).finally(() => this.loading = false);\r\n const objItem = Array.toObject(results, this.valueField);\r\n this.#allItem = {\r\n ...this.#allItem,\r\n ...objItem\r\n };\r\n this.#cache[key] = results.union(this.valueField);\r\n }\r\n const selectedItems = await this.#loadSelectedItems(this.formControl.value, items);\r\n // Đưa những selectedItems lên đầu nếu không mat-select-trigger sẽ không work\r\n return [...selectedItems, ...(this.#cache[key] || [])].union(this.valueField);\r\n }\r\n\r\n onSelectionChange = (change: MatSelectChange) => {\r\n this.allSelected = !this.select.options.some(e => !e.selected);\r\n const value = change?.value ?? '';\r\n if (this.multiple) {\r\n this.#onChange(value || []);\r\n } else {\r\n this.searchTerm$.next('');\r\n this.#onChange(value);\r\n }\r\n }\r\n\r\n onSelectAll() {\r\n if (this.allSelected) {\r\n this.formControl.setValue(this.select.options.map(e => e.value));\r\n } else {\r\n this.formControl.setValue([]);\r\n }\r\n this.#onChange(this.formControl.value);\r\n }\r\n\r\n reValidate = () => {\r\n this.formControl.updateValueAndValidity({ emitEvent: true });\r\n }\r\n\r\n #onChange = async (value: boolean | number | string | (number | string)[]) => {\r\n if (Array.isArray(value)) {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n this.sdSelection.emit({\r\n value: value,\r\n items: value.map(val => this.#allItem[val?.toString()])\r\n });\r\n } else {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n this.sdSelection.emit({\r\n value: value,\r\n item: this.#allItem[value?.toString()]\r\n });\r\n }\r\n }\r\n\r\n clear = ($event?: any) => {\r\n $event?.stopPropagation();\r\n if (this.multiple) {\r\n this.formControl.setValue([]);\r\n this.modelChange.emit([]);\r\n this.sdChange.emit([]);\r\n this.sdSelection.emit({\r\n value: [],\r\n items: []\r\n });\r\n } else {\r\n this.formControl.setValue(null);\r\n this.modelChange.emit(null);\r\n this.sdChange.emit(null);\r\n this.sdSelection.emit({\r\n value: null,\r\n item: null\r\n });\r\n }\r\n }\r\n\r\n onClick = () => {\r\n if (this.sdView?.templateRef) {\r\n if (!this.formControl.disabled && !this.isFocused) {\r\n this.focus();\r\n }\r\n }\r\n }\r\n\r\n focus = () => {\r\n this.isFocused = true;\r\n setTimeout(() => {\r\n this.select?.focus();\r\n this.select?.open();\r\n }, 100);\r\n }\r\n\r\n #customValidator = (func: (value: any) => string | Promise<string>): AsyncValidatorFn => {\r\n return async (c: AbstractControl): Promise<{ [key: string]: any } | null> => {\r\n const value = c.value || null;\r\n if (func && typeof (func) === 'function') {\r\n const result = func(value);\r\n if (result instanceof Promise) {\r\n const message = await result;\r\n if (message) {\r\n return {\r\n customValidator: message\r\n };\r\n }\r\n return null;\r\n }\r\n if (result) {\r\n return {\r\n customValidator: result\r\n };\r\n }\r\n return null;\r\n }\r\n return null;\r\n };\r\n }\r\n\r\n onOpenChange = (isOpened: boolean) => {\r\n if (isOpened) {\r\n this.isFocused = true;\r\n if (this.#input) {\r\n this.#input.value = null;\r\n }\r\n this.searchTerm$.next('');\r\n } else {\r\n this.isFocused = false;\r\n }\r\n }\r\n\r\n onOptionChange = (tooltip: MatTooltip) => {\r\n tooltip?.hide();\r\n }\r\n\r\n trackByKey = (index, item) => {\r\n if (this.valueField) {\r\n return item?.[this.valueField];\r\n }\r\n return item;\r\n }\r\n\r\n onCopyText = (event: MouseEvent) => {\r\n event?.stopPropagation();\r\n const text: string = this.#getCopyText();\r\n SdUtility.copyToClipboard(text);\r\n this.copied = true;\r\n setTimeout(() => {\r\n this.copied = false;\r\n this.ref.markForCheck();\r\n }, 2000)\r\n }\r\n\r\n #getCopyText = () => {\r\n const value: string | string[] = this.formControl.value;\r\n let text = value?.toString() ?? '';\r\n if (typeof this.copyText === 'function') {\r\n if (Array.isArray(value)) {\r\n text = this.copyText(value, value.map(val => this.#allItem[val?.toString()]))\r\n }\r\n else {\r\n text = this.copyText(value, this.#allItem[value?.toString()])\r\n }\r\n }\r\n else if (this.copyText) {\r\n text = this.copyText;\r\n }\r\n return text;\r\n }\r\n}\r\n\r\ntype SearchFunc = (searchText?: string | string[], isFormValue?: boolean) => Promise<any[]>;","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { SdSelect } from './select.component';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { SdSelectDisplayDefDirective } from './select-display-def.directive';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { SdPopoverModule } from '@sd-angular/core/popover';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatTooltipModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatSelectModule,\r\n MatProgressSpinnerModule,\r\n MatCheckboxModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n SdPopoverModule\r\n ],\r\n declarations: [\r\n SdSelect,\r\n SdSelectDisplayDefDirective\r\n ],\r\n exports: [\r\n SdSelect,\r\n SdSelectDisplayDefDirective,\r\n SdCommonModule\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdSelectModule {\r\n\r\n}\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/select.module';\r\nexport * from './lib/select.component';\r\nexport * from './lib/select-display-def.directive';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;;;MAKa,2BAA2B;IACtC,YAAmB,WAA6B;QAA7B,gBAAW,GAAX,WAAW,CAAkB;KAAK;;;YAJtD,SAAS,SAAC;gBACT,QAAQ,EAAE,sBAAsB;aACjC;;;YAJmB,WAAW;;;;MCmBlB,QAAQ;IA0JnB,YACU,GAAsB,EACW,UAA8B;QAD/D,QAAG,GAAH,GAAG,CAAmB;QACW,eAAU,GAAV,UAAU,CAAoB;QA3JzE,yBAAiB;QAQjB,gBAAQA,EAAO,EAAE,EAAC;QAOlB,wBAAmB,GAAG,KAAK,CAAC;QAK5B,gBAAW,GAAG,IAAI,aAAa,EAAE,CAAC;QAElC,gBAAW,GAAG,IAAI,OAAO,EAAU,CAAC;QAGpC,wBAAiB;;QAuCjB,wBAAgB,IAAI,eAAe,CAAqB,EAAE,CAAC,EAAC;;QAkB5D,YAAO,GAAG,KAAK,CAAC;QAChB,iBAAS,GAAG,EAAC;;QAGb,eAAU,GAAG,KAAK,CAAC;QACnB,6BAAqD;QAyBrD,aAAQ,GAAG,KAAK,CAAC;QAIR,UAAK,GAAG,GAAG,CAAC;QACrB,aAAQ,GAAG,KAAK,CAAC;QAKjB,cAAS,GAAG,KAAK,CAAC;QAMlB,aAAQ,GAAG,KAAK,CAAC;QAIjB,WAAM,GAAG,KAAK,CAAC;QAGL,gBAAW,GAAG,IAAI,YAAY,EAAE,CAAC;QACjC,aAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC9B,gBAAW,GAAG,IA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;oBACjB,iBAAiB;oBACjB,cAAc;oBACd,eAAe;iBAChB;gBACD,YAAY,EAAE;oBACZ,QAAQ;oBACR,2BAA2B;iBAC5B;gBACD,OAAO,EAAE;oBACP,QAAQ;oBACR,2BAA2B;oBAC3B,cAAc;iBACf;gBACD,SAAS,EAAE,EACV;aACF;;;AC3CD;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sd-angular-core-select.js","sources":["../../../../projects/sd-core/select/src/lib/select-display-def.directive.ts","../../../../projects/sd-core/select/src/lib/select.component.ts","../../../../projects/sd-core/select/src/lib/select.module.ts","../../../../projects/sd-core/select/src/public-api.ts","../../../../projects/sd-core/select/sd-angular-core-select.ts"],"sourcesContent":["import { Directive, TemplateRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[sdSelectDisplayDef]'\r\n})\r\nexport class SdSelectDisplayDefDirective {\r\n constructor(public templateRef: TemplateRef<any>) { }\r\n}\r\n","import {\r\n AfterViewInit,\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ContentChild,\r\n EventEmitter,\r\n Inject,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Optional,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { AbstractControl, AsyncValidatorFn, FormGroup, NgForm, ValidatorFn, Validators } from '@angular/forms';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { MatSelect, MatSelectChange } from '@angular/material/select';\r\nimport { MatTooltip } from '@angular/material/tooltip';\r\nimport { FORM_CONFIG, IFormConfiguration, SdFormControl, SdLabelDefDirective, SdViewDefDirective } from '@sd-angular/core/common';\r\nimport hash from 'object-hash';\r\nimport { BehaviorSubject, Observable, Subject, Subscription, combineLatest } from 'rxjs';\r\nimport { debounceTime, map, startWith, switchMap } from 'rxjs/operators';\r\nimport * as uuid from 'uuid';\r\nimport { SdSelectDisplayDefDirective } from './select-display-def.directive';\r\n@Component({\r\n selector: 'sd-select',\r\n templateUrl: './select.component.html',\r\n styleUrls: ['./select.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class SdSelect implements OnInit, AfterViewInit, OnDestroy {\r\n #input: MatInput;\r\n @ViewChild(MatInput) set input(input: MatInput) {\r\n if (this.#input !== input) {\r\n this.#input = input;\r\n this.#input.value = null;\r\n }\r\n }\r\n @ViewChild('select') select: MatSelect;\r\n #name = uuid.v4();\r\n @Input() set name(val: string) {\r\n if (val) {\r\n this.#name = val;\r\n }\r\n }\r\n @Input() appearance: MatFormFieldAppearance;\r\n disableErrorMessage = false;\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = val === '' || val;\r\n val = val === '' || val;\r\n }\r\n formControl = new SdFormControl();\r\n\r\n searchTerm$ = new Subject<string>();\r\n\r\n @Input() size: 'sm' | 'lg';\r\n #form: FormGroup;\r\n @Input() set form(val: NgForm | FormGroup) {\r\n if (val) {\r\n if (val instanceof NgForm) {\r\n this.#form = val.form;\r\n } else {\r\n this.#form = val;\r\n }\r\n }\r\n }\r\n qcId: string;\r\n label: string;\r\n @Input('label') set _label(val: string) {\r\n this.label = val;\r\n this.qcId = hash({\r\n selector: 'sd-select',\r\n label: val,\r\n });\r\n }\r\n @Input() placeholder: string;\r\n\r\n // Model\r\n display: Observable<string>;\r\n @Input() set model(value: undefined | boolean | number | string | (number | string)[]) {\r\n // if(this.formControl.disabled) {\r\n // this.formControl.enable({\r\n // emitEvent: false\r\n // });\r\n // this.formControl.setValue(value);\r\n // this.formControl.disable({\r\n // emitEvent: false\r\n // });\r\n // } else {\r\n // this.formControl.setValue(value);\r\n // }\r\n this.formControl.setValue(value);\r\n }\r\n // Items\r\n\r\n #itemsChanges = new BehaviorSubject<any[] | SearchFunc>([]);\r\n @Input() set items(items: undefined | any[] | SearchFunc) {\r\n this.#delay = 0;\r\n if (!items) {\r\n this.#itemsChanges.next([]);\r\n } else if (Array.isArray(items)) {\r\n this.#itemsChanges.next(items.filter(e => e !== null && e !== undefined));\r\n } else {\r\n this.#delay = 500;\r\n this.#itemsChanges.next(items);\r\n }\r\n this.searchTerm$.next('');\r\n }\r\n @Input() valueField: string;\r\n @Input() displayField: string;\r\n @Input() cacheChecksum: any;\r\n\r\n // Server search\r\n loading = false;\r\n #delay = 200; // Sau khoảng thời gian delay nếu không có thay đổi thì thì mới bắt đầu thực hiện gọi hàm\r\n\r\n // Validator\r\n isRequired = false;\r\n #validator: (value: any) => string | Promise<string>;\r\n @Input() set required(val: boolean | '') {\r\n this.isRequired = val === '' || val;\r\n this.#updateValidator();\r\n }\r\n @Input() set validator(validator: (value: any) => string | Promise<string>) {\r\n this.#validator = validator;\r\n this.#updateValidator();\r\n }\r\n\r\n inlineError: string;\r\n @Input('inlineError') set _inlineError(val: string) {\r\n this.inlineError = val;\r\n this.#updateValidator();\r\n }\r\n\r\n // Optional\r\n @Input() set disabled(val: boolean | '') {\r\n val = val === '' || val;\r\n if (val) {\r\n this.formControl.disable();\r\n } else {\r\n this.formControl.enable();\r\n }\r\n }\r\n multiple = false;\r\n @Input('multiple') set _multiple(val: boolean | '') {\r\n this.multiple = val === '' || val;\r\n }\r\n @Input() limit = 100;\r\n filtered = false;\r\n @Input('filtered') set _filtered(val: boolean | '') {\r\n this.filtered = val === '' || val;\r\n }\r\n @ContentChild(SdSelectDisplayDefDirective) selectDisplayDef: SdSelectDisplayDefDirective;\r\n selectAll = false;\r\n @Input('selectAll') set _selectAll(val: boolean | '') {\r\n this.selectAll = val === '' || val;\r\n }\r\n\r\n @ViewChild('copyTooltip') copyTooltip: MatTooltip;\r\n copyable = false;\r\n @Input('copyable') set _copyable(val: boolean | '') {\r\n this.copyable = val === '' || val;\r\n }\r\n copied = false;\r\n @Input() copyText: ((value: string | string[], items: any[]) => string) | string;\r\n\r\n @Output() modelChange = new EventEmitter();\r\n @Output() sdChange = new EventEmitter();\r\n @Output() sdSelection = new EventEmitter<{ value: any | any[]; item?: any; items?: any[] }>();\r\n #subscription = new Subscription();\r\n selectedItems: Observable<any[]>;\r\n #allItems: Observable<any[]>;\r\n filteredItems: Observable<any[]>;\r\n #allItem: {\r\n [key: string]: any;\r\n } = {};\r\n allSelected = false;\r\n #cache: {\r\n [key: string]: any[];\r\n } = {};\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n isFocused = false;\r\n tooltip: string;\r\n constructor(private ref: ChangeDetectorRef, @Inject(FORM_CONFIG) @Optional() private formConfig: IFormConfiguration) {}\r\n\r\n ngOnInit() {\r\n this.appearance = this.appearance || this.formConfig?.appearance;\r\n this.#subscription.add(\r\n this.formControl.sdChanges.subscribe(() => {\r\n this.ref.markForCheck();\r\n })\r\n );\r\n this.#allItems = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.searchTerm$.asObservable().pipe(startWith(''), debounceTime(this.#delay)),\r\n this.formControl.valueChanges.pipe(startWith(this.formControl.value)),\r\n ]).pipe(\r\n switchMap(async ([items, val, formValue]) => {\r\n formValue = this.formControl.value;\r\n if (typeof items === 'function') {\r\n return await this.#loadItems(val, items);\r\n }\r\n this.#allItem = items.toObject(this.valueField);\r\n const isArray = Array.isArray(formValue);\r\n const hasFields = !!this.valueField && !!this.displayField;\r\n const filteredItems = items.filter(item => {\r\n const value = hasFields ? item[this.valueField] : item;\r\n const display = hasFields ? item[this.displayField] : item;\r\n if (String.aliasIncludes(value, val) || String.aliasIncludes(display, val)) {\r\n return true;\r\n }\r\n if (isArray) {\r\n return formValue.some(e => e === value);\r\n }\r\n return formValue === value;\r\n });\r\n if (items.length <= this.limit) {\r\n return filteredItems;\r\n }\r\n // Đưa những selectedItems lên đầu nếu không mat-select-trigger sẽ không work\r\n return filteredItems.sort((current, next) => {\r\n const value1 = hasFields ? current[this.valueField] : current;\r\n const value2 = hasFields ? next[this.valueField] : next;\r\n let flag1 = 0;\r\n let flag2 = 0;\r\n if (isArray) {\r\n flag1 = formValue.some(e => e === value1) ? 1 : 0;\r\n flag2 = formValue.some(e => e === value2) ? 1 : 0;\r\n return flag2 - flag1;\r\n }\r\n flag1 = formValue === value1 ? 1 : 0;\r\n flag2 = formValue === value2 ? 1 : 0;\r\n return flag2 - flag1;\r\n });\r\n })\r\n );\r\n this.selectedItems = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.formControl.valueChanges.pipe(startWith(this.formControl.value)),\r\n ]).pipe(\r\n switchMap(async ([items, val]) => {\r\n // Vì một số lý do chưa xác định mà khi sử dụng sdViewDef thì khi chuyển sang dạng view sẽ trigger val = null\r\n // Nhưng formControl.value vẫn có giá trị đúng nên thực hiện gán val = this.formControl.value;\r\n val = this.formControl.value;\r\n if (!val?.toString()) {\r\n return [];\r\n }\r\n const values = Array.isArray(val) ? val : [val];\r\n if (!this.valueField) {\r\n return values;\r\n }\r\n if (typeof items === 'function') {\r\n return await this.#loadSelectedItems(val, items);\r\n }\r\n return values.map(value => {\r\n return (\r\n items?.find(item => item[this.valueField] === value) || {\r\n [this.valueField]: value,\r\n [this.displayField]: value,\r\n }\r\n );\r\n });\r\n })\r\n );\r\n this.filteredItems = this.#allItems.pipe(map(allItems => allItems.paging(this.limit)));\r\n this.display = this.selectedItems.pipe(\r\n map(selectedItems => selectedItems?.map(item => (this.displayField ? item[this.displayField] : item))?.join(', '))\r\n );\r\n // Lấy dữ liệu cho tooltip\r\n this.#subscription.add(this.selectedItems.subscribe(selectedItems => this.tooltip = selectedItems?.map(item=> this.valueField ? `• ${item[this.valueField]} - ${item[this.displayField]}` : `• ${item}`)?.join('\\n')));\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n #updateValidator = () => {\r\n this.formControl.clearValidators();\r\n this.formControl.clearAsyncValidators();\r\n const validators: ValidatorFn[] = [];\r\n const asyncValidators: AsyncValidatorFn[] = [];\r\n if (this.isRequired) {\r\n validators.push(Validators.required);\r\n }\r\n if (this.#validator) {\r\n asyncValidators.push(this.#customValidator(this.#validator));\r\n }\r\n if (this.inlineError) {\r\n validators.push(this.customInlineErrorValidator());\r\n }\r\n this.formControl.setValidators(validators);\r\n this.formControl.setAsyncValidators(asyncValidators);\r\n this.formControl.updateValueAndValidity();\r\n };\r\n\r\n // Hàm tạo Validators tùy chỉnh cho inlineError\r\n customInlineErrorValidator(): ValidatorFn {\r\n return (control: AbstractControl): { [key: string]: any } | null => {\r\n return { inlineError: true };\r\n };\r\n }\r\n\r\n #loadSelectedItems = async (value: string | string[], items: SearchFunc) => {\r\n if (!value?.toString()) {\r\n return [];\r\n }\r\n const values = Array.isArray(value) ? value : [value];\r\n if (!this.valueField && !this.displayField) {\r\n return values;\r\n }\r\n this.loading = true;\r\n if (values.some(val => this.#allItem[val] === undefined)) {\r\n const results = await items(value, true)\r\n .catch(() => [])\r\n .finally(() => (this.loading = false));\r\n const objItem = Array.toObject(results, this.valueField);\r\n const objValue = Array.toObject(\r\n values.map(val => ({ [val?.toString()]: { [this.valueField]: val, [this.displayField]: val } })),\r\n this.valueField\r\n );\r\n this.#allItem = {\r\n ...objValue,\r\n ...this.#allItem,\r\n ...objItem,\r\n };\r\n }\r\n return values.map(val => this.#allItem[val?.toString()] ?? { [this.valueField]: val, [this.displayField]: val });\r\n };\r\n\r\n #loadItems = async (searchText: string, items: SearchFunc) => {\r\n searchText = searchText?.toString() || '';\r\n const key = hash({\r\n checksum: this.cacheChecksum || null,\r\n searchText,\r\n });\r\n\r\n if (this.#cache[key] === undefined && this.isFocused) {\r\n this.loading = true;\r\n const results = await items(searchText)\r\n .catch(() => [])\r\n .finally(() => (this.loading = false));\r\n const objItem = Array.toObject(results, this.valueField);\r\n this.#allItem = {\r\n ...this.#allItem,\r\n ...objItem,\r\n };\r\n this.#cache[key] = results.union(this.valueField);\r\n }\r\n const selectedItems = await this.#loadSelectedItems(this.formControl.value, items);\r\n // Đưa những selectedItems lên đầu nếu không mat-select-trigger sẽ không work\r\n return [...selectedItems, ...(this.#cache[key] || [])].union(this.valueField);\r\n };\r\n\r\n onSelectionChange = (change: MatSelectChange) => {\r\n this.allSelected = !this.select.options.some(e => !e.selected);\r\n const value = change?.value ?? '';\r\n if (this.multiple) {\r\n this.#onChange(value || []);\r\n } else {\r\n this.searchTerm$.next('');\r\n this.#onChange(value);\r\n }\r\n };\r\n\r\n onSelectAll() {\r\n if (this.allSelected) {\r\n this.formControl.setValue(this.select.options.map(e => e.value));\r\n } else {\r\n this.formControl.setValue([]);\r\n }\r\n this.#onChange(this.formControl.value);\r\n }\r\n\r\n reValidate = () => {\r\n this.formControl.updateValueAndValidity({ emitEvent: true });\r\n };\r\n\r\n #onChange = async (value: boolean | number | string | (number | string)[]) => {\r\n if (Array.isArray(value)) {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n this.sdSelection.emit({\r\n value: value,\r\n items: value.map(val => this.#allItem[val?.toString()]),\r\n });\r\n } else {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n this.sdSelection.emit({\r\n value: value,\r\n item: this.#allItem[value?.toString()],\r\n });\r\n }\r\n };\r\n\r\n clear = ($event?: any) => {\r\n $event?.stopPropagation();\r\n if (this.multiple) {\r\n this.formControl.setValue([]);\r\n this.modelChange.emit([]);\r\n this.sdChange.emit([]);\r\n this.sdSelection.emit({\r\n value: [],\r\n items: [],\r\n });\r\n } else {\r\n this.formControl.setValue(null);\r\n this.modelChange.emit(null);\r\n this.sdChange.emit(null);\r\n this.sdSelection.emit({\r\n value: null,\r\n item: null,\r\n });\r\n }\r\n };\r\n\r\n onClick = () => {\r\n if (this.sdView?.templateRef) {\r\n if (!this.formControl.disabled && !this.isFocused) {\r\n this.focus();\r\n }\r\n }\r\n };\r\n\r\n focus = () => {\r\n this.isFocused = true;\r\n setTimeout(() => {\r\n this.select?.focus();\r\n this.select?.open();\r\n }, 100);\r\n };\r\n\r\n #customValidator = (func: (value: any) => string | Promise<string>): AsyncValidatorFn => {\r\n return async (c: AbstractControl): Promise<{ [key: string]: any } | null> => {\r\n const value = c.value || null;\r\n if (func && typeof func === 'function') {\r\n const result = func(value);\r\n if (result instanceof Promise) {\r\n const message = await result;\r\n if (message) {\r\n return {\r\n customValidator: message,\r\n };\r\n }\r\n return null;\r\n }\r\n if (result) {\r\n return {\r\n customValidator: result,\r\n };\r\n }\r\n return null;\r\n }\r\n return null;\r\n };\r\n };\r\n\r\n onOpenChange = (isOpened: boolean) => {\r\n if (isOpened) {\r\n this.isFocused = true;\r\n if (this.#input) {\r\n this.#input.value = null;\r\n }\r\n this.searchTerm$.next('');\r\n } else {\r\n this.isFocused = false;\r\n }\r\n };\r\n\r\n onOptionChange = (tooltip: MatTooltip) => {\r\n tooltip?.hide();\r\n };\r\n\r\n trackByKey = (index, item) => {\r\n if (this.valueField) {\r\n return item?.[this.valueField];\r\n }\r\n return item;\r\n };\r\n\r\n onCopyText = (event: MouseEvent) => {\r\n event?.stopPropagation();\r\n const text: string = this.#getCopyText();\r\n SdUtility.copyToClipboard(text);\r\n this.copied = true;\r\n setTimeout(() => {\r\n this.copied = false;\r\n this.ref.markForCheck();\r\n }, 2000);\r\n };\r\n\r\n #getCopyText = () => {\r\n const value: string | string[] = this.formControl.value;\r\n let text = value?.toString() ?? '';\r\n if (typeof this.copyText === 'function') {\r\n if (Array.isArray(value)) {\r\n text = this.copyText(\r\n value,\r\n value.map(val => this.#allItem[val?.toString()])\r\n );\r\n } else {\r\n text = this.copyText(value, this.#allItem[value?.toString()]);\r\n }\r\n } else if (this.copyText) {\r\n text = this.copyText;\r\n }\r\n return text;\r\n };\r\n}\r\n\r\ntype SearchFunc = (searchText?: string | string[], isFormValue?: boolean) => Promise<any[]>;\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { SdSelect } from './select.component';\r\nimport { MatSelectModule } from '@angular/material/select';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { SdSelectDisplayDefDirective } from './select-display-def.directive';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { SdPopoverModule } from '@sd-angular/core/popover';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatTooltipModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatSelectModule,\r\n MatProgressSpinnerModule,\r\n MatCheckboxModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n SdPopoverModule\r\n ],\r\n declarations: [\r\n SdSelect,\r\n SdSelectDisplayDefDirective\r\n ],\r\n exports: [\r\n SdSelect,\r\n SdSelectDisplayDefDirective,\r\n SdCommonModule\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdSelectModule {\r\n\r\n}\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/select.module';\r\nexport * from './lib/select.component';\r\nexport * from './lib/select-display-def.directive';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;;;MAKa,2BAA2B;IACtC,YAAmB,WAA6B;QAA7B,gBAAW,GAAX,WAAW,CAAkB;KAAK;;;YAJtD,SAAS,SAAC;gBACT,QAAQ,EAAE,sBAAsB;aACjC;;;YAJmB,WAAW;;;;MCgClB,QAAQ;IA0JnB,YAAoB,GAAsB,EAA2C,UAA8B;QAA/F,QAAG,GAAH,GAAG,CAAmB;QAA2C,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
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"SdSelectModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":16,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":18,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":19,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":20,"character":4},{"__symbolic":"reference","module":"@angular/material/input","name":"MatInputModule","line":21,"character":4},{"__symbolic":"reference","module":"@angular/material/tooltip","name":"MatTooltipModule","line":22,"character":4},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":23,"character":4},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":24,"character":4},{"__symbolic":"reference","module":"@angular/material/select","name":"MatSelectModule","line":25,"character":4},{"__symbolic":"reference","module":"@angular/material/progress-spinner","name":"MatProgressSpinnerModule","line":26,"character":4},{"__symbolic":"reference","module":"@angular/material/checkbox","name":"MatCheckboxModule","line":27,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/translate","name":"SdTranslateModule","line":28,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdCommonModule","line":29,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/popover","name":"SdPopoverModule","line":30,"character":4}],"declarations":[{"__symbolic":"reference","name":"SdSelect"},{"__symbolic":"reference","name":"SdSelectDisplayDefDirective"}],"exports":[{"__symbolic":"reference","name":"SdSelect"},{"__symbolic":"reference","name":"SdSelectDisplayDefDirective"},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdCommonModule","line":39,"character":4}],"providers":[]}]}],"members":{}},"SdSelect":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":13,"character":1},"arguments":[{"selector":"sd-select","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":17,"character":19},"member":"OnPush"},"template":"<ng-container *ngIf=\"!appearance && sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\"> </ng-container>\r\n</ng-container>\r\n<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\"\r\n >{{ label }} <span class=\"text-danger mb-2\" *ngIf=\"isRequired\">*</span></label\r\n>\r\n<div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdView?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\">\r\n <ng-container *ngIf=\"sdView?.templateRef && !isFocused; else default\">\r\n <ng-container *ngTemplateOutlet=\"sdView.templateRef; context: { value: formControl.value, selectedItems: selectedItems | async }\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #default>\r\n <mat-form-field\r\n class=\"sd-md\"\r\n [ngClass]=\"{ 'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage }\"\r\n [appearance]=\"appearance || 'outline'\">\r\n <mat-label *ngIf=\"appearance && label\">{{ label }}</mat-label>\r\n <mat-select\r\n *ngIf=\"multiple\"\r\n #select\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n multiple\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n disableOptionCentering=\"true\"\r\n panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{ 'sd-selected': !isRequired && (multiple ? formControl?.value?.length : formControl?.value != null) }\"\r\n [required]=\"isRequired\"\r\n (openedChange)=\"onOpenChange($event)\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\"\r\n [sdPopoverDisabled]=\"!formControl.disabled || !formControl?.value?.length\"\r\n [sdPopoverTriggerFor]=\"popoverValues\">\r\n <mat-select-trigger>\r\n {{ display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input\r\n aria-hidden=\"true\"\r\n #input\r\n placeholder=\"{{ 'Search' | sdTranslate }}\"\r\n matInput\r\n autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (keyup)=\"searchTerm$.next($event.target.value)\" />\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"multiple && selectAll\">\r\n <mat-checkbox class=\"mat-option\" [(ngModel)]=\"allSelected\" [ngModelOptions]=\"{ standalone: true }\" (change)=\"onSelectAll()\">\r\n Tất cả</mat-checkbox\r\n >\r\n </ng-container>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item[valueField]\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <mat-select\r\n *ngIf=\"!multiple\"\r\n #select\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n disableOptionCentering=\"true\"\r\n panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{ 'sd-selected': !isRequired && formControl?.value != null }\"\r\n [required]=\"isRequired\"\r\n (openedChange)=\"onOpenChange($event)\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\">\r\n <mat-select-trigger>\r\n {{ display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input\r\n aria-hidden=\"true\"\r\n #input\r\n placeholder=\"{{ 'Search' | sdTranslate }}\"\r\n matInput\r\n autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (keyup)=\"searchTerm$.next($event.target.value)\" />\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item[valueField]\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <svg\r\n #copyTooltip=\"matTooltip\"\r\n *ngIf=\"(multiple ? formControl?.value?.length : formControl?.value != null) && copyable\"\r\n matSuffix\r\n [matTooltip]=\"copied ? 'Copied' : 'Copy'\"\r\n class=\"icon-copy\"\r\n focusable=\"false\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 448 512\"\r\n (click)=\"onCopyText($event)\">\r\n <path\r\n d=\"M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z\"></path>\r\n </svg>\r\n <mat-icon\r\n *ngIf=\"(multiple ? formControl?.value?.length : formControl?.value != null) && !isRequired && !formControl.disabled\"\r\n class=\"pointer sd-suffix-icon\"\r\n (click)=\"clear($event)\"\r\n matSuffix\r\n >cancel\r\n </mat-icon>\r\n <mat-error *ngIf=\"formControl.errors?.required\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ 'This field is required' | sdTranslate }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.customValidator\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ formControl?.errors?.customValidator }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.errors?.inlineError\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{inlineError}}</ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n</div>\r\n<sd-popover #popoverValues=\"sdPopover\" width=\"auto\">\r\n <ng-container *ngIf=\"formControl?.value?.length\">\r\n <ng-container *sdLet=\"selectedItems | async as items\">\r\n <div *ngFor=\"let item of items\">\r\n <strong>{{ item[valueField] }}</strong> - {{ item[displayField] }}\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n</sd-popover>\r\n","styles":[":host{display:block;padding-top:5px}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:none}:host ::ng-deep .sd-selected .mat-select-arrow{border:none}:host ::ng-deep .mat-form-field.no-padding-wrapper .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-form-field-outline{background:#f6f6f6;color:#e9e9e9}:host ::ng-deep .mat-form-field mat-select.mat-select-disabled .mat-select-value{color:#4d4d4d!important}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}:host ::ng-deep .mat-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-form-field .icon-copy{cursor:pointer;fill:rgba(0,0,0,.5);height:.9em;opacity:0;transition:opacity .2s linear;width:.9em}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input{background-color:#fff;position:-webkit-sticky;position:sticky;top:0;z-index:10}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline{width:100%}::ng-deep .sd-select-panel .mat-option.sd-filtered-input mat-pseudo-checkbox{display:none}::ng-deep .mat-select-panel .mat-option.sd-filtered-input{height:auto}::ng-deep .sd-select-panel .mat-option.sd-filtered-input input{color:#000}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field-prefix .mat-icon{margin-right:0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper{padding:10px 0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-outline{background-color:rgba(0,0,0,.04)}"]}]}],"members":{"input":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":21,"character":3},"arguments":[{"__symbolic":"reference","module":"@angular/material/input","name":"MatInput","line":21,"character":13}]}]}],"select":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":27,"character":3},"arguments":["select"]}]}],"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"appearance":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"_disableErrorMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3},"arguments":["disableErrorMessage"]}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"_label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":57,"character":3},"arguments":["label"]}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":3}}]}],"model":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":3}}]}],"items":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":85,"character":3}}]}],"valueField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":97,"character":3}}]}],"displayField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":98,"character":3}}]}],"cacheChecksum":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":99,"character":3}}]}],"required":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":108,"character":3}}]}],"validator":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":112,"character":3}}]}],"_inlineError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":118,"character":3},"arguments":["inlineError"]}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":124,"character":3}}]}],"_multiple":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":133,"character":3},"arguments":["multiple"]}]}],"limit":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":136,"character":3}}]}],"_filtered":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":138,"character":3},"arguments":["filtered"]}]}],"selectDisplayDef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":141,"character":3},"arguments":[{"__symbolic":"reference","name":"SdSelectDisplayDefDirective"}]}]}],"_selectAll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":143,"character":3},"arguments":["selectAll"]}]}],"copyTooltip":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":147,"character":3},"arguments":["copyTooltip"]}]}],"_copyable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":149,"character":3},"arguments":["copyable"]}]}],"copyText":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":153,"character":3}}]}],"modelChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":155,"character":3}}]}],"sdChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":156,"character":3}}]}],"sdSelection":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":157,"character":3}}]}],"sdLabelDef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":169,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdLabelDefDirective","line":169,"character":16}]}]}],"sdView":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":170,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdViewDefDirective","line":170,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":175,"character":5},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"FORM_CONFIG","line":175,"character":12}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":175,"character":26}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":174,"character":17},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"IFormConfiguration","line":175,"character":57}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"customInlineErrorValidator":[{"__symbolic":"method"}],"onSelectAll":[{"__symbolic":"method"}]}},"SdSelectDisplayDefDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[sdSelectDisplayDef]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"TemplateRef","module":"@angular/core","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}}},"origins":{"SdSelectModule":"./src/lib/select.module","SdSelect":"./src/lib/select.component","SdSelectDisplayDefDirective":"./src/lib/select-display-def.directive"},"importAs":"@sd-angular/core/select"}
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"SdSelectModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":16,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":18,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":19,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":20,"character":4},{"__symbolic":"reference","module":"@angular/material/input","name":"MatInputModule","line":21,"character":4},{"__symbolic":"reference","module":"@angular/material/tooltip","name":"MatTooltipModule","line":22,"character":4},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":23,"character":4},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":24,"character":4},{"__symbolic":"reference","module":"@angular/material/select","name":"MatSelectModule","line":25,"character":4},{"__symbolic":"reference","module":"@angular/material/progress-spinner","name":"MatProgressSpinnerModule","line":26,"character":4},{"__symbolic":"reference","module":"@angular/material/checkbox","name":"MatCheckboxModule","line":27,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/translate","name":"SdTranslateModule","line":28,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdCommonModule","line":29,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/popover","name":"SdPopoverModule","line":30,"character":4}],"declarations":[{"__symbolic":"reference","name":"SdSelect"},{"__symbolic":"reference","name":"SdSelectDisplayDefDirective"}],"exports":[{"__symbolic":"reference","name":"SdSelect"},{"__symbolic":"reference","name":"SdSelectDisplayDefDirective"},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdCommonModule","line":39,"character":4}],"providers":[]}]}],"members":{}},"SdSelect":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":26,"character":1},"arguments":[{"selector":"sd-select","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":30,"character":19},"member":"OnPush"},"template":"<ng-container *ngIf=\"!appearance && sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\"> </ng-container>\r\n</ng-container>\r\n<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\"\r\n >{{ label }} <span class=\"text-danger mb-2\" *ngIf=\"isRequired\">*</span></label\r\n>\r\n<div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdView?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\">\r\n <ng-container *ngIf=\"sdView?.templateRef && !isFocused; else default\">\r\n <ng-container *ngTemplateOutlet=\"sdView.templateRef; context: { value: formControl.value, selectedItems: selectedItems | async }\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #default>\r\n <mat-form-field\r\n class=\"sd-md\"\r\n [ngClass]=\"{ 'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage }\"\r\n [appearance]=\"appearance || 'outline'\">\r\n <mat-label *ngIf=\"appearance && label\">{{ label }}</mat-label>\r\n <mat-select\r\n *ngIf=\"multiple\"\r\n #select\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n multiple\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n disableOptionCentering=\"true\"\r\n panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{ 'sd-selected': !isRequired && (multiple ? formControl?.value?.length : formControl?.value != null) }\"\r\n [required]=\"isRequired\"\r\n (openedChange)=\"onOpenChange($event)\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\"\r\n matTooltipClass=\"sd-multiline-tooltip\"\r\n [matTooltipDisabled]=\"!formControl.disabled || !formControl?.value?.length\"\r\n [matTooltip]=\"tooltip\">\r\n <mat-select-trigger>\r\n {{ display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input\r\n aria-hidden=\"true\"\r\n #input\r\n placeholder=\"{{ 'Search' | sdTranslate }}\"\r\n matInput\r\n autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (keyup)=\"searchTerm$.next($event.target.value)\" />\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"multiple && selectAll\">\r\n <mat-checkbox class=\"mat-option\" [(ngModel)]=\"allSelected\" [ngModelOptions]=\"{ standalone: true }\" (change)=\"onSelectAll()\">\r\n Tất cả</mat-checkbox\r\n >\r\n </ng-container>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item[valueField]\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <mat-select\r\n *ngIf=\"!multiple\"\r\n #select\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n disableOptionCentering=\"true\"\r\n panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{ 'sd-selected': !isRequired && formControl?.value != null }\"\r\n [required]=\"isRequired\"\r\n (openedChange)=\"onOpenChange($event)\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\">\r\n <mat-select-trigger>\r\n {{ display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input\r\n aria-hidden=\"true\"\r\n #input\r\n placeholder=\"{{ 'Search' | sdTranslate }}\"\r\n matInput\r\n autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (keyup)=\"searchTerm$.next($event.target.value)\" />\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item[valueField]\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <svg\r\n #copyTooltip=\"matTooltip\"\r\n *ngIf=\"(multiple ? formControl?.value?.length : formControl?.value != null) && copyable\"\r\n matSuffix\r\n [matTooltip]=\"copied ? 'Copied' : 'Copy'\"\r\n class=\"icon-copy\"\r\n focusable=\"false\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 448 512\"\r\n (click)=\"onCopyText($event)\">\r\n <path\r\n d=\"M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z\"></path>\r\n </svg>\r\n <mat-icon\r\n *ngIf=\"(multiple ? formControl?.value?.length : formControl?.value != null) && !isRequired && !formControl.disabled\"\r\n class=\"pointer sd-suffix-icon\"\r\n (click)=\"clear($event)\"\r\n matSuffix\r\n >cancel\r\n </mat-icon>\r\n <mat-error *ngIf=\"formControl.errors?.required\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ 'This field is required' | sdTranslate }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.customValidator\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ formControl?.errors?.customValidator }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.errors?.inlineError\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{inlineError}}</ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n</div>\r\n<!-- <sd-popover #popoverValues=\"sdPopover\" width=\"auto\">\r\n <ng-container *ngIf=\"formControl?.value?.length\">\r\n <ng-container *sdLet=\"selectedItems | async as items\">\r\n <div *ngFor=\"let item of items\">\r\n <strong>{{ item[valueField] }}</strong> - {{ item[displayField] }}\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n</sd-popover> -->\r\n","styles":[":host{display:block;padding-top:5px}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:none}:host ::ng-deep .sd-selected .mat-select-arrow{border:none}:host ::ng-deep .mat-form-field.no-padding-wrapper .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-form-field-outline{background:#f6f6f6;color:#e9e9e9}:host ::ng-deep .mat-form-field mat-select.mat-select-disabled .mat-select-value{color:#4d4d4d!important}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}:host ::ng-deep .mat-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-form-field .icon-copy{cursor:pointer;fill:rgba(0,0,0,.5);height:.9em;opacity:0;transition:opacity .2s linear;width:.9em}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input{background-color:#fff;position:-webkit-sticky;position:sticky;top:0;z-index:10}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline{width:100%}::ng-deep .sd-select-panel .mat-option.sd-filtered-input mat-pseudo-checkbox{display:none}::ng-deep .mat-select-panel .mat-option.sd-filtered-input{height:auto}::ng-deep .sd-select-panel .mat-option.sd-filtered-input input{color:#000}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field-prefix .mat-icon{margin-right:0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper{padding:10px 0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-outline{background-color:rgba(0,0,0,.04)}:host ::ng-deep .sd-multiline-tooltip{white-space:pre-line}"]}]}],"members":{"input":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":34,"character":3},"arguments":[{"__symbolic":"reference","module":"@angular/material/input","name":"MatInput","line":34,"character":13}]}]}],"select":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":40,"character":3},"arguments":["select"]}]}],"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":3}}]}],"appearance":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":3}}]}],"_disableErrorMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":3},"arguments":["disableErrorMessage"]}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":57,"character":3}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":3}}]}],"_label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":3},"arguments":["label"]}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":77,"character":3}}]}],"model":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":81,"character":3}}]}],"items":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":98,"character":3}}]}],"valueField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":110,"character":3}}]}],"displayField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":111,"character":3}}]}],"cacheChecksum":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":112,"character":3}}]}],"required":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":121,"character":3}}]}],"validator":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":125,"character":3}}]}],"_inlineError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":131,"character":3},"arguments":["inlineError"]}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":137,"character":3}}]}],"_multiple":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":146,"character":3},"arguments":["multiple"]}]}],"limit":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":149,"character":3}}]}],"_filtered":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":151,"character":3},"arguments":["filtered"]}]}],"selectDisplayDef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":154,"character":3},"arguments":[{"__symbolic":"reference","name":"SdSelectDisplayDefDirective"}]}]}],"_selectAll":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":156,"character":3},"arguments":["selectAll"]}]}],"copyTooltip":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":160,"character":3},"arguments":["copyTooltip"]}]}],"_copyable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":162,"character":3},"arguments":["copyable"]}]}],"copyText":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":166,"character":3}}]}],"modelChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":168,"character":3}}]}],"sdChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":169,"character":3}}]}],"sdSelection":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":170,"character":3}}]}],"sdLabelDef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":182,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdLabelDefDirective","line":182,"character":16}]}]}],"sdView":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":183,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdViewDefDirective","line":183,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":186,"character":47},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"FORM_CONFIG","line":186,"character":54}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":186,"character":68}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":186,"character":27},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"IFormConfiguration","line":186,"character":99}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"customInlineErrorValidator":[{"__symbolic":"method"}],"onSelectAll":[{"__symbolic":"method"}]}},"SdSelectDisplayDefDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[sdSelectDisplayDef]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"TemplateRef","module":"@angular/core","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}}},"origins":{"SdSelectModule":"./src/lib/select.module","SdSelect":"./src/lib/select.component","SdSelectDisplayDefDirective":"./src/lib/select-display-def.directive"},"importAs":"@sd-angular/core/select"}
|