@sdcorejs/angular 20.2.15 → 20.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/assets/STYLE-GUIDE.md +6 -3
- package/assets/THEME.md +166 -0
- package/assets/fonts/fonts.scss +1 -1
- package/assets/scss/ckeditor5.scss +2 -2
- package/assets/scss/core/_inline-edit.scss +3 -3
- package/assets/scss/core/_read-state-panel.scss +2 -2
- package/assets/scss/core/color.scss +4 -2
- package/assets/scss/core/form.scss +35 -12
- package/assets/scss/core/scrollbar.scss +3 -3
- package/assets/scss/core/utilities/_base.scss +5 -5
- package/assets/scss/core/utilities/_typography.scss +22 -22
- package/assets/scss/sd-core.scss +12 -0
- package/assets/scss/themes/_component-tokens.scss +261 -0
- package/assets/scss/themes/_presets.scss +3 -0
- package/assets/scss/themes/_ramps.scss +56 -0
- package/assets/scss/themes/_scales.scss +90 -0
- package/assets/scss/themes/_semantic.scss +22 -0
- package/assets/scss/themes/default.scss +113 -10
- package/assets/scss/themes/material-theme.scss +3 -0
- package/components/breadcrumb/index.d.ts +2 -1
- package/components/data-state/index.d.ts +6 -2
- package/components/file-explorer/index.d.ts +450 -57
- package/components/form-generic/index.d.ts +949 -834
- package/components/highlight/index.d.ts +27 -0
- package/components/image-editor/index.d.ts +478 -0
- package/components/index.d.ts +3 -0
- package/components/inform/index.d.ts +5 -2
- package/components/kanban/index.d.ts +179 -0
- package/components/mini-editor/index.d.ts +1 -1
- package/components/preview/index.d.ts +51 -2
- package/components/query-builder/index.d.ts +1 -1
- package/components/section/index.d.ts +7 -2
- package/components/tab/index.d.ts +3 -1
- package/components/table/index.d.ts +6 -0
- package/directives/index.d.ts +8 -0
- package/fesm2022/sdcorejs-angular-components-anchor.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +6 -6
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-audit-diff.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-audit-diff.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-avatar.mjs +34 -27
- package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-badge.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs +35 -5
- package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +13 -11
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-card.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-card.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-data-state.mjs +8 -4
- package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-editor.mjs +12 -4
- package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +2260 -133
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +6502 -6557
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-highlight.mjs +63 -0
- package/fesm2022/sdcorejs-angular-components-highlight.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-history.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-image-editor.mjs +2088 -0
- package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs +9 -5
- package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-job-progress.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-job-progress.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-kanban.mjs +441 -0
- package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +40 -22
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-operator.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-org-chart.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-org-chart.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-preview.mjs +129 -7
- package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +33 -24
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +14 -9
- package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +28 -4
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-splitter.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-stepper.mjs +7 -3
- package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +12 -4
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +308 -113
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +14 -5
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components.mjs +3 -0
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +99 -13
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +149 -6
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +19 -4
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +19 -4
- package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +17 -7
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +17 -7
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-inline-text.mjs +3 -3
- package/fesm2022/sdcorejs-angular-forms-inline-text.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +18 -4
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +29 -5
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-label.mjs +27 -2
- package/fesm2022/sdcorejs-angular-forms-label.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-segmented.mjs +244 -0
- package/fesm2022/sdcorejs-angular-forms-segmented.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-forms-select.mjs +498 -7
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +22 -4
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-time-range.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-time-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms.mjs +8 -0
- package/fesm2022/sdcorejs-angular-forms.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +1729 -271
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-auth.mjs +35 -3
- package/fesm2022/sdcorejs-angular-modules-auth.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-icon.mjs +19 -0
- package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +39 -48
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-permission.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-api.mjs +196 -8
- package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +10 -3
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-excel.mjs +5 -0
- package/fesm2022/sdcorejs-angular-services-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-notify.mjs +107 -7
- package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-extensions.mjs +458 -1
- package/fesm2022/sdcorejs-angular-utilities-extensions.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-theme.mjs +169 -0
- package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-utilities.mjs +1 -0
- package/fesm2022/sdcorejs-angular-utilities.mjs.map +1 -1
- package/forms/autocomplete/index.d.ts +19 -1
- package/forms/chip/index.d.ts +13 -2
- package/forms/chip-calendar/index.d.ts +13 -2
- package/forms/date/index.d.ts +7 -2
- package/forms/datetime/index.d.ts +7 -2
- package/forms/index.d.ts +8 -6
- package/forms/inline-text/index.d.ts +1 -1
- package/forms/input/index.d.ts +21 -5
- package/forms/input-number/index.d.ts +12 -2
- package/forms/label/index.d.ts +16 -1
- package/forms/models/index.d.ts +16 -1
- package/forms/segmented/index.d.ts +90 -0
- package/forms/select/index.d.ts +66 -4
- package/forms/textarea/index.d.ts +9 -2
- package/i18n/index.d.ts +344 -54
- package/modules/auth/index.d.ts +3 -3
- package/modules/icon/index.d.ts +11 -1
- package/modules/layout/index.d.ts +2 -2
- package/modules/permission/index.d.ts +3 -2
- package/package.json +22 -2
- package/services/api/index.d.ts +49 -2
- package/services/confirm/index.d.ts +15 -0
- package/services/notify/index.d.ts +8 -0
- package/utilities/extensions/index.d.ts +68 -1
- package/utilities/index.d.ts +1 -0
- package/utilities/theme/index.d.ts +25 -0
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { LiveAnnouncer } from '@angular/cdk/a11y';
|
|
2
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
3
|
+
import * as i7 from '@angular/cdk/scrolling';
|
|
4
|
+
import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
|
|
1
5
|
import * as i1 from '@angular/common';
|
|
2
6
|
import { CommonModule } from '@angular/common';
|
|
3
7
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, TemplateRef, input, Directive, viewChild, contentChild, contentChildren, computed, ChangeDetectorRef,
|
|
8
|
+
import { inject, TemplateRef, input, Directive, viewChild, ElementRef, contentChild, contentChildren, computed, ChangeDetectorRef, booleanAttribute, numberAttribute, output, model, signal, isSignal, DestroyRef, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
9
|
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
10
|
import * as i2 from '@angular/forms';
|
|
7
11
|
import { NgForm, FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -43,16 +47,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
43
47
|
}]
|
|
44
48
|
}], propDecorators: { when: [{ type: i0.Input, args: [{ isSignal: true, alias: "when", required: false }] }] } });
|
|
45
49
|
|
|
50
|
+
/**
|
|
51
|
+
* why (D-030 V1): value of the single hidden option of the virtual branch. `mat-select` renders its
|
|
52
|
+
* trigger — and so our labels — only while at least one option is selected, but with virtual scrolling
|
|
53
|
+
* most selected options are not rendered. `virtualCompareWith` lets this option stand in for them; it is
|
|
54
|
+
* disabled, hidden, and never reaches the model.
|
|
55
|
+
*/
|
|
56
|
+
const SD_SELECT_VIRTUAL_SENTINEL = Symbol('sd-select-virtual-sentinel');
|
|
57
|
+
/** Rows the virtual viewport shows at most before it scrolls. */
|
|
58
|
+
const SD_SELECT_VIRTUAL_ROWS = 6;
|
|
59
|
+
/** Same step as Material's key manager (`withPageUpDown()`). */
|
|
60
|
+
const SD_SELECT_VIRTUAL_PAGE = 10;
|
|
61
|
+
/** Same window as Material's typeahead (`withTypeAhead()`). */
|
|
62
|
+
const SD_SELECT_TYPEAHEAD_MS = 200;
|
|
63
|
+
const SD_SELECT_VIRTUAL_NAV_KEYS = new Set(['ArrowDown', 'ArrowUp', 'PageDown', 'PageUp', 'Home', 'End']);
|
|
64
|
+
/**
|
|
65
|
+
* why (D-026): the only code in sd-select that touches a Material internal for virtual scrolling —
|
|
66
|
+
* `MatSelect._keyManager`. It keeps Material's active option on the row the component made active, so
|
|
67
|
+
* the trigger's `aria-activedescendant` and Material's own Enter/Tab handling point at that row. Only the
|
|
68
|
+
* active item changes: no styles and no `change` event (which would make Material scroll its panel).
|
|
69
|
+
* Covered by select.virtual-scroll.spec.ts.
|
|
70
|
+
*/
|
|
71
|
+
class SdSelectVirtualAdapter {
|
|
72
|
+
select;
|
|
73
|
+
constructor(select) {
|
|
74
|
+
this.select = select;
|
|
75
|
+
}
|
|
76
|
+
setActive(option) {
|
|
77
|
+
const manager = this.select()?._keyManager;
|
|
78
|
+
if (!manager || manager.activeItem === (option ?? null))
|
|
79
|
+
return;
|
|
80
|
+
if (option)
|
|
81
|
+
manager.updateActiveItem(option);
|
|
82
|
+
else
|
|
83
|
+
manager.updateActiveItem(-1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
46
86
|
class SdSelect {
|
|
47
87
|
id = `I${Utilities.generateUuid()}`;
|
|
48
88
|
/** why: id ổn định của <mat-error> để control trỏ `aria-describedby` sang — thông báo lỗi
|
|
49
89
|
* phải đọc được từ chính control, không chỉ hiện ra màn hình. */
|
|
50
90
|
errorId = `${this.id}-error`;
|
|
91
|
+
/** id của nhãn/helper khi `labelPlacement='top'` — `mat-select` trỏ `aria-labelledby` sang nhãn. */
|
|
92
|
+
labelId = `${this.id}-label`;
|
|
93
|
+
hintId = `${this.id}-hint`;
|
|
51
94
|
// ==========================================
|
|
52
95
|
// 1. SIGNAL QUERIES & INJECTS
|
|
53
96
|
// ==========================================
|
|
54
97
|
matInputRef = viewChild(MatInput, ...(ngDevMode ? [{ debugName: "matInputRef" }] : []));
|
|
55
98
|
selectRef = viewChild('select', ...(ngDevMode ? [{ debugName: "selectRef" }] : []));
|
|
99
|
+
selectElement = viewChild('select', ...(ngDevMode ? [{ debugName: "selectElement", read: ElementRef }] : [{ read: ElementRef }]));
|
|
100
|
+
virtualViewport = viewChild(CdkVirtualScrollViewport, ...(ngDevMode ? [{ debugName: "virtualViewport" }] : []));
|
|
56
101
|
sdLabelTemplate = contentChild('sdLabel', ...(ngDevMode ? [{ debugName: "sdLabelTemplate" }] : []));
|
|
57
102
|
sdValueTemplate = contentChild('sdValue', ...(ngDevMode ? [{ debugName: "sdValueTemplate" }] : []));
|
|
58
103
|
/**
|
|
@@ -80,6 +125,9 @@ class SdSelect {
|
|
|
80
125
|
// why: focus/mở panel + focus ô search đều hoãn 100ms; handle phải bị clear khi destroy,
|
|
81
126
|
// nếu không callback vẫn chạm selectRef/matInputRef của view đã tháo.
|
|
82
127
|
#timers = _sdTimerScope();
|
|
128
|
+
#liveAnnouncer = inject(LiveAnnouncer);
|
|
129
|
+
#dir = inject(Directionality, { optional: true });
|
|
130
|
+
#virtualAdapter = new SdSelectVirtualAdapter(() => this.selectRef());
|
|
83
131
|
// ==========================================
|
|
84
132
|
// 2. SIGNAL INPUTS & MODEL
|
|
85
133
|
// ==========================================
|
|
@@ -143,6 +191,14 @@ class SdSelect {
|
|
|
143
191
|
disabledField = input('', ...(ngDevMode ? [{ debugName: "disabledField" }] : []));
|
|
144
192
|
cacheChecksum = input(...(ngDevMode ? [undefined, { debugName: "cacheChecksum" }] : []));
|
|
145
193
|
limit = input(50, ...(ngDevMode ? [{ debugName: "limit" }] : []));
|
|
194
|
+
/**
|
|
195
|
+
* Virtual scrolling for long lists (opt-in, default `false`). When on, the panel renders only the rows
|
|
196
|
+
* in view, array items are no longer cut by `limit`, and the component — not `mat-select` — owns the
|
|
197
|
+
* value. See sd-select.md, "Virtual scroll".
|
|
198
|
+
*/
|
|
199
|
+
virtualScroll = input(false, ...(ngDevMode ? [{ debugName: "virtualScroll", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
200
|
+
/** Fixed row height in px for the virtual viewport. Default 36 = the panel's compact option row. */
|
|
201
|
+
itemSize = input(36, ...(ngDevMode ? [{ debugName: "itemSize", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
146
202
|
hyperlink = input(...(ngDevMode ? [undefined, { debugName: "hyperlink" }] : []));
|
|
147
203
|
minWidthPanel = input('auto', ...(ngDevMode ? [{ debugName: "minWidthPanel", transform: value => value ?? 'auto' }] : [{
|
|
148
204
|
transform: value => value ?? 'auto',
|
|
@@ -209,6 +265,8 @@ class SdSelect {
|
|
|
209
265
|
appearanceInput = input(undefined, ...(ngDevMode ? [{ debugName: "appearanceInput", alias: 'appearance' }] : [{ alias: 'appearance' }]));
|
|
210
266
|
appearance = computed(() => this.appearanceInput() ?? this.#formConfiguration?.appearance ?? 'outline', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
211
267
|
floatLabel = input('auto', ...(ngDevMode ? [{ debugName: "floatLabel" }] : []));
|
|
268
|
+
/** `'float'` (mặc định) hoặc `'top'` — nhãn tĩnh phía trên, helper text dưới control. */
|
|
269
|
+
labelPlacement = input('float', ...(ngDevMode ? [{ debugName: "labelPlacement" }] : []));
|
|
212
270
|
// Mở rộng kiểu dữ liệu cho phép nhận Signal từ bên ngoài truyền vào
|
|
213
271
|
items = input(...(ngDevMode ? [undefined, { debugName: "items" }] : []));
|
|
214
272
|
valueModel = model(undefined, ...(ngDevMode ? [{ debugName: "valueModel", alias: 'model' }] : [{ alias: 'model' }]));
|
|
@@ -266,6 +324,8 @@ class SdSelect {
|
|
|
266
324
|
checksum: this.cacheChecksum(),
|
|
267
325
|
valueField: this.valueField(),
|
|
268
326
|
displayField: this.displayField(),
|
|
327
|
+
// why: switching virtualScroll re-runs the pipeline, since only the non-virtual list is cut at `limit`.
|
|
328
|
+
virtualScroll: this.virtualScroll(),
|
|
269
329
|
}))).pipe(map(context => context.items));
|
|
270
330
|
#valueModel$ = toObservable(this.valueModel);
|
|
271
331
|
filteredItems = signal([], ...(ngDevMode ? [{ debugName: "filteredItems" }] : []));
|
|
@@ -280,6 +340,61 @@ class SdSelect {
|
|
|
280
340
|
}), ...(ngDevMode ? [{ debugName: "footerActionContext" }] : []));
|
|
281
341
|
#footerFnVisibility = signal(new WeakMap(), ...(ngDevMode ? [{ debugName: "#footerFnVisibility" }] : []));
|
|
282
342
|
visibleFooterActions = computed(() => this.footerActions().filter(action => this.shouldRenderFooterAction(action)), ...(ngDevMode ? [{ debugName: "visibleFooterActions" }] : []));
|
|
343
|
+
// ==========================================
|
|
344
|
+
// VIRTUAL SCROLL (opt-in) — D-026: the component owns the value; D-030 V1: Material shell + one sentinel
|
|
345
|
+
// ==========================================
|
|
346
|
+
/** Value bound one-way to the virtual shell; the shell never writes it back (no `formControl` on it). */
|
|
347
|
+
virtualShellValue = computed(() => {
|
|
348
|
+
const value = this.normalizedValue();
|
|
349
|
+
if (this.multiple())
|
|
350
|
+
return Array.isArray(value) ? value : [];
|
|
351
|
+
return value ?? null;
|
|
352
|
+
}, ...(ngDevMode ? [{ debugName: "virtualShellValue" }] : []));
|
|
353
|
+
virtualSentinel = SD_SELECT_VIRTUAL_SENTINEL;
|
|
354
|
+
virtualPanelClass = {
|
|
355
|
+
single: ['sd-select-panel', 'sd-select-virtual'],
|
|
356
|
+
multiple: ['sd-select-panel', 'sd-multiple', 'sd-select-virtual'],
|
|
357
|
+
};
|
|
358
|
+
/** A rendered option matches its own value; the sentinel matches any value whose option is not rendered. */
|
|
359
|
+
virtualCompareWith = (optionValue, value) => value != null && (optionValue === value || optionValue === SD_SELECT_VIRTUAL_SENTINEL);
|
|
360
|
+
/** The virtual shell cannot see `formControl`, so the component supplies Material's error state. */
|
|
361
|
+
virtualErrorStateMatcher = {
|
|
362
|
+
isErrorState: (_control, form) => !!(this.formControl.invalid && (this.formControl.touched || form?.submitted)),
|
|
363
|
+
};
|
|
364
|
+
/** Same rule as the non-virtual template: rows render when both fields are set, or neither. */
|
|
365
|
+
virtualRenderable = computed(() => !this.valueField() === !this.displayField(), ...(ngDevMode ? [{ debugName: "virtualRenderable" }] : []));
|
|
366
|
+
virtualViewportHeight = computed(() => Math.min(this.filteredItems().length, SD_SELECT_VIRTUAL_ROWS) * this.itemSize(), ...(ngDevMode ? [{ debugName: "virtualViewportHeight" }] : []));
|
|
367
|
+
virtualTrackBy = (_index, item) => this.itemValue(item);
|
|
368
|
+
/** Stable id per row index: aria-activedescendant targets and finds the rendered option by it. */
|
|
369
|
+
virtualOptionId = (index) => `${this.id}-option-${index}`;
|
|
370
|
+
/** Context of `#sdSelected` in the virtual branch — the same shape as the non-virtual templates. */
|
|
371
|
+
selectedTemplateContext = computed(() => {
|
|
372
|
+
const items = this.selectedItems();
|
|
373
|
+
const display = this.display();
|
|
374
|
+
return this.multiple()
|
|
375
|
+
? { $implicit: items, item: items, items, display, multiple: true }
|
|
376
|
+
: { $implicit: items[0], item: items[0], items, display, multiple: false };
|
|
377
|
+
}, ...(ngDevMode ? [{ debugName: "selectedTemplateContext" }] : []));
|
|
378
|
+
/** Row the keyboard made active, tracked by value so re-sorting the list keeps it. */
|
|
379
|
+
#virtualActiveKey = signal(null, ...(ngDevMode ? [{ debugName: "#virtualActiveKey" }] : []));
|
|
380
|
+
/** Index of the active row in the full filtered list, or -1. */
|
|
381
|
+
virtualActiveIndex = computed(() => {
|
|
382
|
+
const key = this.#virtualActiveKey();
|
|
383
|
+
if (!key || !this.virtualScroll())
|
|
384
|
+
return -1;
|
|
385
|
+
return this.filteredItems().findIndex(item => this.itemValue(item) === key.value);
|
|
386
|
+
}, ...(ngDevMode ? [{ debugName: "virtualActiveIndex" }] : []));
|
|
387
|
+
#virtualRange = signal({ start: 0, end: 0 }, ...(ngDevMode ? [{ debugName: "#virtualRange" }] : []));
|
|
388
|
+
/** `aria-activedescendant` of the search box: the active row, only while it is rendered. */
|
|
389
|
+
virtualActiveDescendant = computed(() => {
|
|
390
|
+
const index = this.virtualActiveIndex();
|
|
391
|
+
const range = this.#virtualRange();
|
|
392
|
+
return index >= range.start && index < range.end ? this.virtualOptionId(index) : null;
|
|
393
|
+
}, ...(ngDevMode ? [{ debugName: "virtualActiveDescendant" }] : []));
|
|
394
|
+
/** Labels folded like the search box (no diacritics, lower case), computed once per list for typeahead. */
|
|
395
|
+
#virtualLabels = computed(() => this.filteredItems().map(item => StringUtilities.changeAliasLowerCase(this.itemDisplay(item))), ...(ngDevMode ? [{ debugName: "#virtualLabels" }] : []));
|
|
396
|
+
#typeahead = '';
|
|
397
|
+
#typeaheadAt = 0;
|
|
283
398
|
normalizedValue = computed(() => {
|
|
284
399
|
const val = this.valueModel();
|
|
285
400
|
if (this.multiple() && val !== undefined && val !== null && !Array.isArray(val)) {
|
|
@@ -486,6 +601,42 @@ class SdSelect {
|
|
|
486
601
|
this.#ref.markForCheck();
|
|
487
602
|
});
|
|
488
603
|
});
|
|
604
|
+
// Virtual scroll wiring. Each effect removes its listener when the virtual branch goes away.
|
|
605
|
+
effect(onCleanup => {
|
|
606
|
+
const select = this.selectRef();
|
|
607
|
+
if (!select || !this.virtualScroll())
|
|
608
|
+
return;
|
|
609
|
+
const selections = select.optionSelectionChanges.subscribe(this.#onVirtualOptionSelection);
|
|
610
|
+
// why: Material re-syncs its selection in a microtask queued when the options change (and moves its
|
|
611
|
+
// active option there); queue after it so Material's active option points back at ours.
|
|
612
|
+
const options = select.options.changes.subscribe(() => Promise.resolve().then(() => this.#syncVirtualKeyManager()));
|
|
613
|
+
onCleanup(() => {
|
|
614
|
+
selections.unsubscribe();
|
|
615
|
+
options.unsubscribe();
|
|
616
|
+
});
|
|
617
|
+
});
|
|
618
|
+
effect(onCleanup => {
|
|
619
|
+
const element = this.selectElement()?.nativeElement;
|
|
620
|
+
if (!element || !this.virtualScroll())
|
|
621
|
+
return;
|
|
622
|
+
// why: capture phase on the trigger runs before MatSelect's own keydown listener on the same element.
|
|
623
|
+
element.addEventListener('keydown', this.#onVirtualTriggerKeydown, true);
|
|
624
|
+
onCleanup(() => element.removeEventListener('keydown', this.#onVirtualTriggerKeydown, true));
|
|
625
|
+
});
|
|
626
|
+
effect(onCleanup => {
|
|
627
|
+
const viewport = this.virtualViewport();
|
|
628
|
+
if (!viewport)
|
|
629
|
+
return;
|
|
630
|
+
this.#virtualRange.set(viewport.getRenderedRange());
|
|
631
|
+
const range = viewport.renderedRangeStream.subscribe(value => this.#virtualRange.set(value));
|
|
632
|
+
onCleanup(() => range.unsubscribe());
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
ngDoCheck() {
|
|
636
|
+
// why: MatSelect refreshes its error state in its own ngDoCheck only when it has an NgControl; the
|
|
637
|
+
// virtual shell has none, so refresh it at the same cadence here.
|
|
638
|
+
if (this.virtualScroll())
|
|
639
|
+
this.selectRef()?.updateErrorState();
|
|
489
640
|
}
|
|
490
641
|
ngOnInit() {
|
|
491
642
|
this.formControl.valueChanges.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(val => {
|
|
@@ -591,7 +742,7 @@ class SdSelect {
|
|
|
591
742
|
}), filter((items) => items !== undefined),
|
|
592
743
|
// why: selectedItems và display cùng dùng một request VALUE, kể cả khi retry.
|
|
593
744
|
shareReplay({ bufferSize: 1, refCount: true }));
|
|
594
|
-
const filteredItems$ = allItems$.pipe(map(this.#
|
|
745
|
+
const filteredItems$ = allItems$.pipe(map(this.#visibleItems));
|
|
595
746
|
const display$ = selectedItems$.pipe(map(items => items?.map(item => (this.displayField() ? this.itemDisplay(item) : item))?.join(', ') || ''));
|
|
596
747
|
filteredItems$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(val => {
|
|
597
748
|
this.filteredItems.set(val || []);
|
|
@@ -606,6 +757,8 @@ class SdSelect {
|
|
|
606
757
|
this.#ref.markForCheck();
|
|
607
758
|
});
|
|
608
759
|
}
|
|
760
|
+
/** Rows the panel shows: the non-virtual list is cut at `limit`; the virtual list is not (D-026). */
|
|
761
|
+
#visibleItems = (allItems) => (this.virtualScroll() ? allItems : this.#pageReadItems(allItems));
|
|
609
762
|
#pageReadItems = (allItems) => {
|
|
610
763
|
const limit = this.limit();
|
|
611
764
|
const val = this.valueModel();
|
|
@@ -835,7 +988,7 @@ class SdSelect {
|
|
|
835
988
|
const items = await this.#loadItems(request.args.searchText, request.loader, true);
|
|
836
989
|
if (!request.valid() || !items)
|
|
837
990
|
return;
|
|
838
|
-
this.filteredItems.set(this.#
|
|
991
|
+
this.filteredItems.set(this.#visibleItems(items));
|
|
839
992
|
}
|
|
840
993
|
this.#syncReadLoading();
|
|
841
994
|
};
|
|
@@ -927,6 +1080,16 @@ class SdSelect {
|
|
|
927
1080
|
this.focus();
|
|
928
1081
|
}
|
|
929
1082
|
};
|
|
1083
|
+
/**
|
|
1084
|
+
* Bấm nhãn rời (`labelPlacement='top'`) focus `mat-select` — như `<label for>` với input gốc.
|
|
1085
|
+
* why: `mat-select` không phải phần tử "labelable" nên `for` không có tác dụng; chỉ focus, KHÔNG
|
|
1086
|
+
* mở panel (hành vi giống select gốc).
|
|
1087
|
+
*/
|
|
1088
|
+
onLabelClick = () => {
|
|
1089
|
+
if (this.formControl.disabled)
|
|
1090
|
+
return;
|
|
1091
|
+
this.selectRef()?.focus();
|
|
1092
|
+
};
|
|
930
1093
|
focus = () => {
|
|
931
1094
|
this.focused.set(true);
|
|
932
1095
|
this.updatePanelWidth();
|
|
@@ -966,8 +1129,15 @@ class SdSelect {
|
|
|
966
1129
|
// why: vẫn 100ms như cũ — chỉ scope handle theo DestroyRef.
|
|
967
1130
|
this.#timers.schedule(() => this.matInputRef()?.focus(), 100);
|
|
968
1131
|
this.#hashedValue = Utilities.hash({ value: this.formControl.value });
|
|
1132
|
+
if (this.virtualScroll())
|
|
1133
|
+
this.#onVirtualOpened();
|
|
969
1134
|
}
|
|
970
1135
|
else {
|
|
1136
|
+
// why: the non-virtual shell marks the control touched through its value accessor when it closes.
|
|
1137
|
+
if (this.virtualScroll()) {
|
|
1138
|
+
this.formControl.markAsTouched();
|
|
1139
|
+
this.#virtualActiveKey.set(null);
|
|
1140
|
+
}
|
|
971
1141
|
this.focused.set(false);
|
|
972
1142
|
const hashedValue = Utilities.hash({ value: this.formControl.value });
|
|
973
1143
|
if (this.#hashedValue !== hashedValue) {
|
|
@@ -992,12 +1162,332 @@ class SdSelect {
|
|
|
992
1162
|
this.#hashedValue = undefined;
|
|
993
1163
|
}
|
|
994
1164
|
};
|
|
1165
|
+
// ==========================================
|
|
1166
|
+
// VIRTUAL SCROLL — selection, keyboard, active row
|
|
1167
|
+
// ==========================================
|
|
1168
|
+
/** Mirrors MatSelect._onBlur: a blur while the panel is open is focus moving into the panel. */
|
|
1169
|
+
onVirtualBlur = () => {
|
|
1170
|
+
if (!this.selectRef()?.panelOpen)
|
|
1171
|
+
this.formControl.markAsTouched();
|
|
1172
|
+
};
|
|
1173
|
+
/** Keys in the search box: rows move with the arrows/Page/Home/End, Enter chooses the active row. */
|
|
1174
|
+
onVirtualSearchKeydown = (event) => {
|
|
1175
|
+
if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey)
|
|
1176
|
+
return;
|
|
1177
|
+
if (SD_SELECT_VIRTUAL_NAV_KEYS.has(event.key)) {
|
|
1178
|
+
// why: the search box only filters, so Home/End move through the rows instead of the caret (the
|
|
1179
|
+
// MUI autocomplete default) — otherwise nothing past the first screen of 10,000 rows is reachable.
|
|
1180
|
+
event.preventDefault();
|
|
1181
|
+
this.#moveVirtualActive(event.key);
|
|
1182
|
+
}
|
|
1183
|
+
else if (event.key === 'Enter' && this.virtualActiveIndex() >= 0) {
|
|
1184
|
+
event.preventDefault();
|
|
1185
|
+
this.#commitVirtualIndex(this.virtualActiveIndex());
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
/** Keys on the trigger. Material's own handling only reaches the rendered rows, so the list-wide keys are ours. */
|
|
1189
|
+
#onVirtualTriggerKeydown = (event) => {
|
|
1190
|
+
const select = this.selectRef();
|
|
1191
|
+
if (!select || select.disabled || event.defaultPrevented)
|
|
1192
|
+
return;
|
|
1193
|
+
const modified = event.altKey || event.ctrlKey || event.metaKey;
|
|
1194
|
+
const printable = event.key.length === 1 && event.key !== ' ' && !modified;
|
|
1195
|
+
let handled = false;
|
|
1196
|
+
if (select.panelOpen) {
|
|
1197
|
+
if (SD_SELECT_VIRTUAL_NAV_KEYS.has(event.key) && !modified) {
|
|
1198
|
+
const previous = this.virtualActiveIndex();
|
|
1199
|
+
const index = this.#moveVirtualActive(event.key);
|
|
1200
|
+
// Material: Shift + arrow in a multiple select also toggles the row it lands on.
|
|
1201
|
+
if (this.multiple() && event.shiftKey && event.key.startsWith('Arrow') && index !== previous)
|
|
1202
|
+
this.#commitVirtualIndex(index);
|
|
1203
|
+
handled = true;
|
|
1204
|
+
}
|
|
1205
|
+
else if ((event.key === 'Enter' || (event.key === ' ' && !this.#isTyping())) && !modified && this.virtualActiveIndex() >= 0) {
|
|
1206
|
+
this.#commitVirtualIndex(this.virtualActiveIndex());
|
|
1207
|
+
handled = true;
|
|
1208
|
+
}
|
|
1209
|
+
else if (this.multiple() && event.ctrlKey && event.key.toLowerCase() === 'a' && !this.#isTyping()) {
|
|
1210
|
+
// Material: Ctrl + A selects every option, or clears them when all are selected — here over the whole list.
|
|
1211
|
+
this.#toggleAllVirtual();
|
|
1212
|
+
handled = true;
|
|
1213
|
+
}
|
|
1214
|
+
else if (printable) {
|
|
1215
|
+
this.#typeaheadVirtual(event.key, false);
|
|
1216
|
+
handled = true;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
else if (!this.multiple() && !modified) {
|
|
1220
|
+
// Closed single select: Material changes the value with these keys, but only among the rendered rows.
|
|
1221
|
+
if (SD_SELECT_VIRTUAL_NAV_KEYS.has(event.key) || event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
1222
|
+
this.#stepClosedVirtual(event.key);
|
|
1223
|
+
handled = true;
|
|
1224
|
+
}
|
|
1225
|
+
else if (printable) {
|
|
1226
|
+
this.#typeaheadVirtual(event.key, true);
|
|
1227
|
+
handled = true;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
if (handled) {
|
|
1231
|
+
event.preventDefault();
|
|
1232
|
+
event.stopImmediatePropagation();
|
|
1233
|
+
}
|
|
1234
|
+
};
|
|
1235
|
+
/** A click (or Material's own keyboard selection) on a rendered row. */
|
|
1236
|
+
#onVirtualOptionSelection = (event) => {
|
|
1237
|
+
const option = event.source;
|
|
1238
|
+
if (!event.isUserInput || option.value === SD_SELECT_VIRTUAL_SENTINEL)
|
|
1239
|
+
return;
|
|
1240
|
+
this.#virtualActiveKey.set({ value: option.value });
|
|
1241
|
+
if (this.multiple()) {
|
|
1242
|
+
this.#toggleVirtualValue(option.value, option.selected);
|
|
1243
|
+
}
|
|
1244
|
+
else if (option.selected) {
|
|
1245
|
+
// Material closes the panel and focuses the trigger itself after a single-select user choice.
|
|
1246
|
+
this.clearSearch();
|
|
1247
|
+
this.#commitVirtualValue(option.value);
|
|
1248
|
+
}
|
|
1249
|
+
};
|
|
1250
|
+
#onVirtualOpened = () => {
|
|
1251
|
+
// why: the viewport was created while the panel was detached (size 0). After the search box is cleared
|
|
1252
|
+
// (a zero-delay search) measure it and bring the selected row — or the first enabled one — into view,
|
|
1253
|
+
// like Material does for its active option.
|
|
1254
|
+
this.#timers.schedule(() => {
|
|
1255
|
+
this.virtualViewport()?.checkViewportSize();
|
|
1256
|
+
const items = this.filteredItems();
|
|
1257
|
+
let index = -1;
|
|
1258
|
+
if (this.multiple()) {
|
|
1259
|
+
const selected = new Set(this.#virtualValues());
|
|
1260
|
+
index = items.findIndex(item => selected.has(this.itemValue(item)));
|
|
1261
|
+
}
|
|
1262
|
+
else {
|
|
1263
|
+
index = this.#virtualSelectedIndex();
|
|
1264
|
+
}
|
|
1265
|
+
if (index < 0)
|
|
1266
|
+
index = items.findIndex(item => !this.itemDisabled(item));
|
|
1267
|
+
if (index >= 0)
|
|
1268
|
+
this.#activateVirtual(index);
|
|
1269
|
+
}, 0);
|
|
1270
|
+
};
|
|
1271
|
+
/** Moves the active row like Material's open-panel key manager (no wrap; disabled rows stay reachable). */
|
|
1272
|
+
#moveVirtualActive = (key) => {
|
|
1273
|
+
const count = this.filteredItems().length;
|
|
1274
|
+
const current = this.virtualActiveIndex();
|
|
1275
|
+
if (!count)
|
|
1276
|
+
return current;
|
|
1277
|
+
let target;
|
|
1278
|
+
switch (key) {
|
|
1279
|
+
case 'Home':
|
|
1280
|
+
target = 0;
|
|
1281
|
+
break;
|
|
1282
|
+
case 'End':
|
|
1283
|
+
target = count - 1;
|
|
1284
|
+
break;
|
|
1285
|
+
case 'PageDown':
|
|
1286
|
+
target = current + SD_SELECT_VIRTUAL_PAGE;
|
|
1287
|
+
break;
|
|
1288
|
+
case 'PageUp':
|
|
1289
|
+
target = current - SD_SELECT_VIRTUAL_PAGE;
|
|
1290
|
+
break;
|
|
1291
|
+
case 'ArrowDown':
|
|
1292
|
+
target = current + 1;
|
|
1293
|
+
break;
|
|
1294
|
+
default:
|
|
1295
|
+
// ArrowUp with no active row does nothing, as in Material.
|
|
1296
|
+
if (current < 0)
|
|
1297
|
+
return current;
|
|
1298
|
+
target = current - 1;
|
|
1299
|
+
}
|
|
1300
|
+
const index = Math.min(count - 1, Math.max(0, target));
|
|
1301
|
+
this.#activateVirtual(index);
|
|
1302
|
+
return index;
|
|
1303
|
+
};
|
|
1304
|
+
#activateVirtual = (index) => {
|
|
1305
|
+
const item = this.filteredItems()[index];
|
|
1306
|
+
if (item === undefined)
|
|
1307
|
+
return;
|
|
1308
|
+
this.#virtualActiveKey.set({ value: this.itemValue(item) });
|
|
1309
|
+
this.#scrollVirtualIntoView(index);
|
|
1310
|
+
// The row may render only after the viewport scrolls; the options subscription syncs again then.
|
|
1311
|
+
this.#syncVirtualKeyManager();
|
|
1312
|
+
};
|
|
1313
|
+
/** Scrolls the least distance that shows the whole row (Material's `_getOptionScrollPosition` rule). */
|
|
1314
|
+
#scrollVirtualIntoView = (index) => {
|
|
1315
|
+
const viewport = this.virtualViewport();
|
|
1316
|
+
if (!viewport)
|
|
1317
|
+
return;
|
|
1318
|
+
const size = this.itemSize();
|
|
1319
|
+
const top = index * size;
|
|
1320
|
+
const offset = viewport.measureScrollOffset();
|
|
1321
|
+
const height = viewport.getViewportSize() || this.virtualViewportHeight();
|
|
1322
|
+
if (top < offset)
|
|
1323
|
+
viewport.scrollToOffset(top);
|
|
1324
|
+
else if (top + size > offset + height)
|
|
1325
|
+
viewport.scrollToOffset(top + size - height);
|
|
1326
|
+
};
|
|
1327
|
+
#syncVirtualKeyManager = () => {
|
|
1328
|
+
const select = this.selectRef();
|
|
1329
|
+
if (!select?.panelOpen || !this.virtualScroll())
|
|
1330
|
+
return;
|
|
1331
|
+
const index = this.virtualActiveIndex();
|
|
1332
|
+
const id = index >= 0 ? this.virtualOptionId(index) : null;
|
|
1333
|
+
this.#virtualAdapter.setActive(id ? select.options.find(option => option.id === id) : undefined);
|
|
1334
|
+
};
|
|
1335
|
+
/** Chooses row `index`: toggles it in a multiple select; sets it and closes the panel in a single one. */
|
|
1336
|
+
#commitVirtualIndex = (index) => {
|
|
1337
|
+
const item = this.filteredItems()[index];
|
|
1338
|
+
// A disabled row can be active (ARIA listbox) but not chosen — same as a disabled mat-option.
|
|
1339
|
+
if (item === undefined || this.itemDisabled(item))
|
|
1340
|
+
return;
|
|
1341
|
+
const value = this.itemValue(item);
|
|
1342
|
+
this.#virtualActiveKey.set({ value });
|
|
1343
|
+
if (this.multiple()) {
|
|
1344
|
+
this.#toggleVirtualValue(value, !this.#virtualValues().includes(value));
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
this.clearSearch();
|
|
1348
|
+
this.#commitVirtualValue(value);
|
|
1349
|
+
const select = this.selectRef();
|
|
1350
|
+
select?.close();
|
|
1351
|
+
select?.focus();
|
|
1352
|
+
};
|
|
1353
|
+
#toggleVirtualValue = (value, selected) => {
|
|
1354
|
+
const current = this.#virtualValues();
|
|
1355
|
+
if (current.includes(value) === selected)
|
|
1356
|
+
return;
|
|
1357
|
+
const next = selected ? [...current, value] : current.filter(entry => entry !== value);
|
|
1358
|
+
this.#commitVirtualValue(this.#orderByList(next));
|
|
1359
|
+
};
|
|
1360
|
+
#toggleAllVirtual = () => {
|
|
1361
|
+
const enabled = this.filteredItems()
|
|
1362
|
+
.filter(item => !this.itemDisabled(item))
|
|
1363
|
+
.map(item => this.itemValue(item));
|
|
1364
|
+
const current = this.#virtualValues();
|
|
1365
|
+
const selected = new Set(current);
|
|
1366
|
+
if (enabled.some(value => !selected.has(value))) {
|
|
1367
|
+
this.#commitVirtualValue(this.#orderByList([...current, ...enabled.filter(value => !selected.has(value))]));
|
|
1368
|
+
}
|
|
1369
|
+
else {
|
|
1370
|
+
const scope = new Set(enabled);
|
|
1371
|
+
this.#commitVirtualValue(current.filter(value => !scope.has(value)));
|
|
1372
|
+
}
|
|
1373
|
+
};
|
|
1374
|
+
#virtualValues = () => {
|
|
1375
|
+
const value = this.normalizedValue();
|
|
1376
|
+
return Array.isArray(value) ? value : [];
|
|
1377
|
+
};
|
|
1378
|
+
#virtualSelectedIndex = () => {
|
|
1379
|
+
const value = this.normalizedValue();
|
|
1380
|
+
if (value === undefined || value === null)
|
|
1381
|
+
return -1;
|
|
1382
|
+
return this.filteredItems().findIndex(item => this.itemValue(item) === value);
|
|
1383
|
+
};
|
|
1384
|
+
/** The order the non-virtual branch emits: the order of the (pinned) filtered list; unknown values last. */
|
|
1385
|
+
#orderByList = (values) => {
|
|
1386
|
+
const position = new Map();
|
|
1387
|
+
this.filteredItems().forEach((item, index) => {
|
|
1388
|
+
const value = this.itemValue(item);
|
|
1389
|
+
if (!position.has(value))
|
|
1390
|
+
position.set(value, index);
|
|
1391
|
+
});
|
|
1392
|
+
return values
|
|
1393
|
+
.map((value, index) => ({ value, index, position: position.get(value) ?? Number.MAX_SAFE_INTEGER }))
|
|
1394
|
+
.sort((a, b) => a.position - b.position || a.index - b.index)
|
|
1395
|
+
.map(entry => entry.value);
|
|
1396
|
+
};
|
|
1397
|
+
#commitVirtualValue = (next) => {
|
|
1398
|
+
// why: same rules as toggleSelectAll — setValue with its event (async validator kept) and the `!==`
|
|
1399
|
+
// guard so one choice emits one valueChanges.
|
|
1400
|
+
if (this.formControl.value !== next)
|
|
1401
|
+
this.formControl.setValue(next);
|
|
1402
|
+
this.#onChange(next);
|
|
1403
|
+
};
|
|
1404
|
+
/** Closed single select: steps the value through the whole list, skipping disabled rows like Material. */
|
|
1405
|
+
#stepClosedVirtual = (key) => {
|
|
1406
|
+
const items = this.filteredItems();
|
|
1407
|
+
const count = items.length;
|
|
1408
|
+
if (!count)
|
|
1409
|
+
return;
|
|
1410
|
+
const rtl = this.#dir?.value === 'rtl';
|
|
1411
|
+
const direction = key === 'ArrowLeft' ? (rtl ? 'ArrowDown' : 'ArrowUp') : key === 'ArrowRight' ? (rtl ? 'ArrowUp' : 'ArrowDown') : key;
|
|
1412
|
+
const current = this.#virtualSelectedIndex();
|
|
1413
|
+
const scan = (start, step) => {
|
|
1414
|
+
for (let index = start; index >= 0 && index < count; index += step)
|
|
1415
|
+
if (!this.itemDisabled(items[index]))
|
|
1416
|
+
return index;
|
|
1417
|
+
return -1;
|
|
1418
|
+
};
|
|
1419
|
+
let target;
|
|
1420
|
+
switch (direction) {
|
|
1421
|
+
case 'ArrowDown':
|
|
1422
|
+
target = scan(current + 1, 1);
|
|
1423
|
+
break;
|
|
1424
|
+
case 'ArrowUp':
|
|
1425
|
+
target = current < 0 ? -1 : scan(current - 1, -1);
|
|
1426
|
+
break;
|
|
1427
|
+
case 'Home':
|
|
1428
|
+
target = scan(0, 1);
|
|
1429
|
+
break;
|
|
1430
|
+
case 'End':
|
|
1431
|
+
target = scan(count - 1, -1);
|
|
1432
|
+
break;
|
|
1433
|
+
case 'PageDown':
|
|
1434
|
+
target = scan(Math.min(count - 1, current + SD_SELECT_VIRTUAL_PAGE), -1);
|
|
1435
|
+
break;
|
|
1436
|
+
default:
|
|
1437
|
+
target = scan(Math.max(0, current - SD_SELECT_VIRTUAL_PAGE), 1);
|
|
1438
|
+
}
|
|
1439
|
+
if (target >= 0 && target !== current)
|
|
1440
|
+
this.#selectClosedVirtual(target);
|
|
1441
|
+
};
|
|
1442
|
+
#selectClosedVirtual = (index) => {
|
|
1443
|
+
const item = this.filteredItems()[index];
|
|
1444
|
+
this.clearSearch();
|
|
1445
|
+
this.#commitVirtualValue(this.itemValue(item));
|
|
1446
|
+
// Material announces the new value itself when a closed select changes; do the same.
|
|
1447
|
+
this.#liveAnnouncer.announce(this.itemDisplay(item), 10000);
|
|
1448
|
+
};
|
|
1449
|
+
#isTyping = () => !!this.#typeahead && performance.now() - this.#typeaheadAt <= SD_SELECT_TYPEAHEAD_MS;
|
|
1450
|
+
/**
|
|
1451
|
+
* Typeahead over the whole list, folded like the search box. Unlike Material's (debounced, rendered rows
|
|
1452
|
+
* only) it moves on every key: a longer prefix keeps the current row if it still matches.
|
|
1453
|
+
*/
|
|
1454
|
+
#typeaheadVirtual = (char, commit) => {
|
|
1455
|
+
const now = performance.now();
|
|
1456
|
+
if (now - this.#typeaheadAt > SD_SELECT_TYPEAHEAD_MS)
|
|
1457
|
+
this.#typeahead = '';
|
|
1458
|
+
this.#typeahead += char;
|
|
1459
|
+
this.#typeaheadAt = now;
|
|
1460
|
+
const query = StringUtilities.changeAliasLowerCase(this.#typeahead);
|
|
1461
|
+
const labels = this.#virtualLabels();
|
|
1462
|
+
const count = labels.length;
|
|
1463
|
+
if (!query || !count)
|
|
1464
|
+
return;
|
|
1465
|
+
const start = commit ? this.#virtualSelectedIndex() : this.virtualActiveIndex();
|
|
1466
|
+
const first = start < 0 ? 0 : this.#typeahead.length > 1 ? start : start + 1;
|
|
1467
|
+
for (let step = 0; step < count; step++) {
|
|
1468
|
+
const index = (first + step) % count;
|
|
1469
|
+
if (commit && this.itemDisabled(this.filteredItems()[index]))
|
|
1470
|
+
continue;
|
|
1471
|
+
if (!labels[index].startsWith(query))
|
|
1472
|
+
continue;
|
|
1473
|
+
if (commit)
|
|
1474
|
+
this.#selectClosedVirtual(index);
|
|
1475
|
+
else
|
|
1476
|
+
this.#activateVirtual(index);
|
|
1477
|
+
return;
|
|
1478
|
+
}
|
|
1479
|
+
};
|
|
995
1480
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
996
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSelect, isStandalone: true, selector: "sd-select", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, displayField: { classPropertyName: "displayField", publicName: "displayField", isSignal: true, isRequired: false, transformFunction: null }, disabledField: { classPropertyName: "disabledField", publicName: "disabledField", isSignal: true, isRequired: false, transformFunction: null }, cacheChecksum: { classPropertyName: "cacheChecksum", publicName: "cacheChecksum", isSignal: true, isRequired: false, transformFunction: null }, limit: { classPropertyName: "limit", publicName: "limit", isSignal: true, isRequired: false, transformFunction: null }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", isSignal: true, isRequired: false, transformFunction: null }, minWidthPanel: { classPropertyName: "minWidthPanel", publicName: "minWidthPanel", isSignal: true, isRequired: false, transformFunction: null }, hideInlineError: { classPropertyName: "hideInlineError", publicName: "hideInlineError", isSignal: true, isRequired: false, transformFunction: null }, hideReadError: { classPropertyName: "hideReadError", publicName: "hideReadError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, viewed: { classPropertyName: "viewed", publicName: "viewed", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showSelectAll: { classPropertyName: "showSelectAll", publicName: "showSelectAll", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, validator: { classPropertyName: "validator", publicName: "validator", isSignal: true, isRequired: false, transformFunction: null }, inlineError: { classPropertyName: "inlineError", publicName: "inlineError", isSignal: true, isRequired: false, transformFunction: null }, appearanceInput: { classPropertyName: "appearanceInput", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, valueModel: { classPropertyName: "valueModel", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdReadStateChange: "sdReadStateChange", valueModel: "modelChange", sdChange: "sdChange", sdSelection: "sdSelection" }, host: { properties: { "class.sd-bare": "isInline()", "class.sd-viewed": "isViewed() || isInline()", "class.sd-has-label": "!!label()" } }, queries: [{ propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true, isSignal: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true, isSignal: true }, { propertyName: "sdSelectedTemplate", first: true, predicate: ["sdSelected"], descendants: true, isSignal: true }, { propertyName: "itemDef", first: true, predicate: SdItemDefDefDirective, descendants: true, isSignal: true }, { propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }, { propertyName: "footerActions", predicate: SdSelectFooterActionDirective, isSignal: true }, { propertyName: "dataStateTemplate", first: true, predicate: SdDataStateTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "matInputRef", first: true, predicate: MatInput, descendants: true, isSignal: true }, { propertyName: "selectRef", first: true, predicate: ["select"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _loading = loading();\n@let _readState = readState();\n@let _hideReadError = hideReadError();\n@let _selectedItems = selectedItems();\n@let _tooltip = tooltip();\n@let _label = label();\n@let _appearance = appearance();\n@let _hideInlineError = hideInlineError();\n@let _errorMessage = errorMessage();\n@let _helperText = helperText();\n@let _multiple = multiple();\n@let _required = required();\n@let _normalizedValue = $any(normalizedValue());\n@let _focused = $any(focused());\n@let _isInline = isInline();\n@let _bare = _isInline;\n@let _hasValue = _multiple ? !!_normalizedValue?.length : _normalizedValue !== undefined && _normalizedValue !== null;\n@let _display = display();\n@let _size = size();\n@let _floatLabel = floatLabel();\n@let _valueField = valueField();\n@let _displayField = displayField();\n@let _autoId = autoId();\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\n@let _errorVisible = !!_errorMessage && formControl.touched;\n@let _showInlineError = !_hideInlineError && _errorVisible;\n\n<ng-template #selectionTooltip>\n <div class=\"sd-select-tooltip\">{{ _tooltip }}</div>\n</ng-template>\n\n@if (isViewed()) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_normalizedValue\"\n [display]=\"_display\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\"\n [selectedItems]=\"_selectedItems\">\n </sd-view>\n} @else {\n @if (_isInline) {\n <!-- why: inline \u2014 sd-view text l\u00E0 \"m\u1EB7t\" + trigger; editor v\u1EABn render b\u00EAn d\u01B0\u1EDBi (chrome \u1EA9n qua\n .sd-inline-editor) \u0111\u1EC3 m\u1EDF panel. Text gi\u1EEF nguy\u00EAn, ch\u1EC9 \u0111\u1ED5i khi commit gi\u00E1 tr\u1ECB m\u1EDBi. -->\n <span\n class=\"sd-inline-view\"\n [sdTooltip]=\"_multiple && _tooltip ? selectionTooltip : ''\"\n sdTooltipPosition=\"top\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"enterInlineEdit()\"\n (keydown.enter)=\"enterInlineEdit()\">\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_normalizedValue\"\n [display]=\"_display\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\"\n [selectedItems]=\"_selectedItems\">\n </sd-view>\n\n <!-- why: clear-\u00D7 ch\u1EC9 hi\u1EC7n khi hover (CSS), \u0111\u1EB7t CU\u1ED0I face + clear($event) stopPropagation \u2192\n xo\u00E1 gi\u00E1 tr\u1ECB m\u00E0 KH\u00D4NG m\u1EDF panel; tr\u00E1nh bug c\u0169 (\u00D7 s\u00E1t trigger b\u1ECB b\u1EA5m nh\u1EA7m l\u00FAc \u0111\u00F3ng panel). -->\n @if (clearable() && _hasValue && !_required && !formControl.disabled) {\n <button type=\"button\" class=\"sd-inline-clear\" (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </span>\n }\n\n @if (!_appearance) {\n <ng-content select=\"[sdLabel]\">\n @if (_label) {\n <sd-label [label]=\"_label\" [required]=\"_required\"></sd-label>\n }\n </ng-content>\n }\n\n <!-- why: div ch\u1EC9 l\u00E0 h\u1ED9p layout. aria-hidden=\"true\" c\u0169 \u1EA9n C\u1EA2 c\u00E2y con \u2014 label, <mat-select>,\n <mat-error>, n\u00FAt clear \u2014 kh\u1ECFi accessibility tree. role=\"presentation\" ch\u1EC9 v\u00F4 hi\u1EC7u ho\u00E1\n ch\u00EDnh div, KH\u00D4NG lan xu\u1ED1ng con; (click) l\u00E0 ti\u1EC7n \u00EDch chu\u1ED9t, b\u00E0n ph\u00EDm Tab th\u1EB3ng v\u00E0o\n <mat-select> v\u00E0 (focusin) \u0111\u00E3 lo ph\u1EA7n updatePanelWidth() t\u01B0\u01A1ng \u1EE9ng. -->\n <div\n class=\"d-flex align-items-center\"\n role=\"presentation\"\n [class.sd-inline-editor]=\"_isInline\"\n [class.c-focused]=\"_focused\"\n [class.c-disabled]=\"formControl.disabled\"\n (click)=\"onClick()\"\n (mouseenter)=\"updatePanelWidth()\"\n (focusin)=\"updatePanelWidth()\">\n @if (_multiple) {\n <mat-form-field\n [sdTooltip]=\"_tooltip ? selectionTooltip : ''\"\n sdTooltipPosition=\"top\"\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [appearance]=\"_appearance!\"\n [floatLabel]=\"_floatLabel\">\n @if (_appearance && _label) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <mat-select\n #select\n multiple\n [formControl]=\"formControl\"\n [placeholder]=\"placeholder() || _label || ''\"\n (selectionChange)=\"onSelectionChange($event)\"\n disableOptionCentering=\"true\"\n [panelWidth]=\"calculatedPanelWidth()\"\n [panelClass]=\"['sd-select-panel', 'sd-multiple']\"\n [class.sd-selected]=\"!_required && _normalizedValue?.length\"\n [required]=\"_required\"\n (openedChange)=\"onOpenedChange($event)\"\n [attr.data-autoId]=\"_autoId\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-loading]=\"dataLoading()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\">\n <mat-select-trigger>\n @if (sdSelectedTemplate(); as _selTpl) {\n <ng-container\n *ngTemplateOutlet=\"\n _selTpl;\n context: { $implicit: _selectedItems, item: _selectedItems, items: _selectedItems, display: _display, multiple: true }\n \">\n </ng-container>\n } @else {\n <div class=\"sd-trigger-text\">\n {{ _display }}\n </div>\n }\n </mat-select-trigger>\n\n @if (filtered()) {\n <div class=\"c-filter-input-container\">\n <div class=\"filter-input-wrapper\">\n <sd-icon name=\"search\" aria-hidden=\"true\"></sd-icon>\n <!-- why: B\u1ECE aria-hidden \u2014 \u0111\u00E2y l\u00E0 \u00F4 l\u1ECDc TH\u1EACT, ng\u01B0\u1EDDi d\u00F9ng focus v\u00E0 g\u00F5 v\u00E0o \u0111\u01B0\u1EE3c, n\u00EAn\n aria-hidden ch\u1EC9 l\u00E0m screen reader c\u00E2m. Panel kh\u00F4ng c\u00F3 <label> n\u00E0o, n\u00EAn ph\u1EA3i\n t\u1EF1 \u0111\u1EB7t t\u00EAn b\u1EB1ng aria-label, n\u1EBFu kh\u00F4ng AT ch\u1EC9 \u0111\u1ECDc \"edit text\" tr\u1ED1ng tr\u01A1n. -->\n <input\n [formControl]=\"inputControl\"\n matInput\n autocomplete=\"off\"\n class=\"c-search-input\"\n [attr.aria-label]=\"'core.form.select.search' | sdTranslate\"\n (keydown)=\"focusReadRetry($event); $event.stopPropagation()\" />\n </div>\n </div>\n }\n\n <!-- why: row \"T\u1EA5t c\u1EA3\" KH\u00D4NG ph\u1EA3i mat-option th\u1EADt \u2014 n\u1EBFu l\u00E0 option, gi\u00E1 tr\u1ECB c\u1EE7a n\u00F3 l\u1ECDt v\u00E0o\n formControl.value v\u00E0 keyboard navigation c\u1EE7a mat-select. Nh\u01B0ng n\u00F3 ph\u1EA3i TR\u00D4NG y h\u1EC7t m\u1ED9t\n option: d\u00F9ng ch\u00EDnh <mat-pseudo-checkbox> + .mdc-list-item__primary-text m\u00E0 mat-option\n render, n\u00EAn \u0103n c\u00F9ng scale/margin (rule .sd-multiple) v\u00E0 c\u00F9ng m\u00E0u theme (panel mang\n class mat-primary) \u2014 mat-checkbox MDC th\u1EADt th\u00EC l\u1EC7ch c\u1ED9t v\u00E0 \u0103n accent c\u1EE7a theme.\n V\u00EC pseudo-checkbox l\u00E0 decorative + aria-hidden, ch\u00EDnh div mang role/aria/keyboard. -->\n @if (selectAllVisible()) {\n @let _selectAllState = selectAllState();\n <div\n class=\"sd-select-all-row\"\n role=\"checkbox\"\n tabindex=\"0\"\n [attr.aria-checked]=\"_selectAllState === 'indeterminate' ? 'mixed' : _selectAllState === 'checked'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-select-all' : null\"\n (click)=\"toggleSelectAll()\"\n (keydown.enter)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown.space)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown)=\"$event.stopPropagation()\">\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [state]=\"_selectAllState\"\n aria-hidden=\"true\"></mat-pseudo-checkbox>\n <span class=\"mdc-list-item__primary-text\">{{ 'core.form.select.selectAll' | sdTranslate }}</span>\n </div>\n }\n\n @if (!_loading && _readState.status === 'error') {\n <!-- why: MatSelect c\u1EA7n option tr\u1EF1c ti\u1EBFp \u0111\u1EC3 gi\u1EEF panel m\u1EDF khi ch\u1EC9 c\u00F3 l\u1ED7i. -->\n <mat-option disabled class=\"sd-read-state-anchor\" aria-hidden=\"true\"></mat-option>\n }\n @let _filteredItems = filteredItems();\n @if (_filteredItems) {\n @if (!_filteredItems.length && !_loading && _readState.status !== 'error') {\n <mat-option class=\"sd-empty\" disabled>\n <img class=\"sd-image-data-empty\" alt=\"empty-image\" style=\"width: 95px\" />\n </mat-option>\n } @else {\n @let iDefTpl = itemDef()?.templateRef;\n @if (_valueField && _displayField) {\n @for (item of _filteredItems; track itemValue(item)) {\n <mat-option [value]=\"itemValue(item)\" [disabled]=\"itemDisabled(item)\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ itemDisplay(item) }}\n }\n </div>\n </mat-option>\n }\n } @else if (!_valueField && !_displayField) {\n @for (item of _filteredItems; track item) {\n <mat-option [value]=\"item\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ item }}\n }\n </div>\n </mat-option>\n }\n }\n }\n }\n\n <ng-container [ngTemplateOutlet]=\"readRegion\"></ng-container>\n\n @if (_loading) {\n <mat-option disabled class=\"sd-loading-option\">\n <mat-spinner diameter=\"24\"></mat-spinner>\n </mat-option>\n }\n\n @let _visibleFooterActions = visibleFooterActions();\n @if (_visibleFooterActions.length) {\n <div class=\"sd-select-footer-actions\">\n @for (action of _visibleFooterActions; track action) {\n <ng-container *ngTemplateOutlet=\"action.templateRef; context: footerActionContext()\"> </ng-container>\n }\n </div>\n }\n </mat-select>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\n }\n\n <!-- why: <mat-error> ph\u1EA3i c\u00F3 id \u1ED4N \u0110\u1ECANH. MatFormField t\u1EF1 n\u1ED1i id n\u00E0y v\u00E0o aria-describedby\n c\u1EE7a <mat-select> (v\u00E0 host binding c\u1EE7a MatSelect lo aria-invalid), nh\u01B0ng ch\u1EC9 khi id\n t\u1ED3n t\u1EA1i \u2014 id auto-gen c\u1EE7a Material \u0111\u1ED5i theo t\u1EEBng instance n\u00EAn test/AT kh\u00F4ng b\u00E1m \u0111\u01B0\u1EE3c. -->\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n }\n\n @if (_normalizedValue?.length && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n } @else {\n <sd-icon class=\"cursor-pointer sd-suffix-icon\" matSuffix name=\"keyboard_arrow_down\"></sd-icon>\n }\n </mat-form-field>\n } @else {\n <mat-form-field\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [appearance]=\"_appearance!\"\n [floatLabel]=\"_floatLabel\">\n @if (_appearance && _label) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <mat-select\n #select\n [formControl]=\"formControl\"\n [placeholder]=\"placeholder() || _label || ''\"\n (selectionChange)=\"onSelectionChange($event)\"\n disableOptionCentering=\"true\"\n [panelWidth]=\"calculatedPanelWidth()\"\n [panelClass]=\"'sd-select-panel'\"\n [class.sd-selected]=\"!_required && _normalizedValue !== undefined && _normalizedValue !== null\"\n [required]=\"_required\"\n (openedChange)=\"onOpenedChange($event)\"\n [attr.data-autoId]=\"_autoId\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-loading]=\"dataLoading()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n matTooltipClass=\"sd-multiline-tooltip\"\n [matTooltipDisabled]=\"!formControl.disabled || !_normalizedValue?.length\"\n [matTooltip]=\"_tooltip || ''\">\n <mat-select-trigger>\n @if (sdSelectedTemplate(); as _selTpl) {\n <ng-container\n *ngTemplateOutlet=\"\n _selTpl;\n context: {\n $implicit: _selectedItems[0],\n item: _selectedItems[0],\n items: _selectedItems,\n display: _display,\n multiple: false,\n }\n \">\n </ng-container>\n } @else {\n {{ _display }}\n }\n </mat-select-trigger>\n\n @if (filtered()) {\n <div class=\"c-filter-input-container\">\n <div class=\"filter-input-wrapper\">\n <sd-icon name=\"search\" aria-hidden=\"true\"></sd-icon>\n <!-- why: B\u1ECE aria-hidden \u2014 \u0111\u00E2y l\u00E0 \u00F4 l\u1ECDc TH\u1EACT, ng\u01B0\u1EDDi d\u00F9ng focus v\u00E0 g\u00F5 v\u00E0o \u0111\u01B0\u1EE3c, n\u00EAn\n aria-hidden ch\u1EC9 l\u00E0m screen reader c\u00E2m. Panel kh\u00F4ng c\u00F3 <label> n\u00E0o, n\u00EAn ph\u1EA3i\n t\u1EF1 \u0111\u1EB7t t\u00EAn b\u1EB1ng aria-label, n\u1EBFu kh\u00F4ng AT ch\u1EC9 \u0111\u1ECDc \"edit text\" tr\u1ED1ng tr\u01A1n. -->\n <input\n [formControl]=\"inputControl\"\n matInput\n autocomplete=\"off\"\n class=\"c-search-input\"\n [attr.aria-label]=\"'core.form.select.search' | sdTranslate\"\n (keydown)=\"focusReadRetry($event); $event.stopPropagation()\" />\n </div>\n </div>\n }\n\n @if (!_loading && _readState.status === 'error') {\n <!-- why: MatSelect c\u1EA7n option tr\u1EF1c ti\u1EBFp \u0111\u1EC3 gi\u1EEF panel m\u1EDF khi ch\u1EC9 c\u00F3 l\u1ED7i. -->\n <mat-option disabled class=\"sd-read-state-anchor\" aria-hidden=\"true\"></mat-option>\n }\n @let _filteredItems = filteredItems();\n @if (_filteredItems) {\n @if (!_filteredItems.length && !_loading && _readState.status !== 'error') {\n <mat-option class=\"sd-empty\" disabled>\n <img class=\"sd-image-data-empty\" alt=\"empty-image\" style=\"width: 95px\" />\n </mat-option>\n } @else {\n @let iDefTpl = itemDef()?.templateRef;\n\n @if (_valueField && _displayField) {\n @for (item of _filteredItems; track itemValue(item)) {\n <mat-option [value]=\"itemValue(item)\" [disabled]=\"itemDisabled(item)\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ itemDisplay(item) }}\n }\n </div>\n </mat-option>\n }\n } @else if (!_valueField && !_displayField) {\n @for (item of _filteredItems; track item) {\n <mat-option [value]=\"item\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ item }}\n }\n </div>\n </mat-option>\n }\n }\n }\n }\n\n <ng-container [ngTemplateOutlet]=\"readRegion\"></ng-container>\n\n @if (_loading) {\n <mat-option disabled class=\"sd-loading-option\">\n <mat-spinner diameter=\"24\"></mat-spinner>\n </mat-option>\n }\n\n @let _visibleFooterActions = visibleFooterActions();\n @if (_visibleFooterActions.length) {\n <div class=\"sd-select-footer-actions\">\n @for (action of _visibleFooterActions; track action) {\n <ng-container *ngTemplateOutlet=\"action.templateRef; context: footerActionContext()\"> </ng-container>\n }\n </div>\n }\n </mat-select>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\n }\n\n <!-- why: <mat-error> ph\u1EA3i c\u00F3 id \u1ED4N \u0110\u1ECANH. MatFormField t\u1EF1 n\u1ED1i id n\u00E0y v\u00E0o aria-describedby\n c\u1EE7a <mat-select> (v\u00E0 host binding c\u1EE7a MatSelect lo aria-invalid), nh\u01B0ng ch\u1EC9 khi id\n t\u1ED3n t\u1EA1i \u2014 id auto-gen c\u1EE7a Material \u0111\u1ED5i theo t\u1EEBng instance n\u00EAn test/AT kh\u00F4ng b\u00E1m \u0111\u01B0\u1EE3c. -->\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n }\n\n @if (_normalizedValue !== undefined && _normalizedValue !== null && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n } @else {\n <sd-icon class=\"cursor-pointer sd-suffix-icon\" matSuffix name=\"keyboard_arrow_down\"></sd-icon>\n }\n </mat-form-field>\n }\n </div>\n}\n\n<ng-template #readRegion>\n <!-- why: VALUE/SEARCH gi\u1EEF l\u1ED7i \u0111\u1ED9c l\u1EADp; trong l\u00FAc k\u00EAnh kh\u00E1c \u0111ang \u0111\u1ECDc ch\u1EC9 hi\u1EC3n th\u1ECB loading. -->\n @if (!_loading && _readState.status === 'error') {\n <!-- why: n\u00FAt retry n\u1EB1m ngo\u00E0i mat-option \u0111\u1EC3 kh\u00F4ng tr\u1EDF th\u00E0nh m\u1ED9t l\u1EF1a ch\u1ECDn/form value. -->\n @if (!_hideReadError) {\n <div\n class=\"sd-read-state-region\"\n role=\"presentation\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onReadRegionKeydown($event)\">\n <sd-data-state state=\"error\" compact retryable (sdRetry)=\"retryRead()\">\n @if (dataStateTemplate(); as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n </div>\n }\n }\n</ng-template>\n", styles: ["@charset \"UTF-8\";.text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-primary-contrast{color:var(--sd-primary-contrast)!important}.bg-primary-contrast{background:var(--sd-primary-contrast)!important}.border-primary-contrast{border-color:var(--sd-primary-contrast)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-secondary-contrast{color:var(--sd-secondary-contrast)!important}.bg-secondary-contrast{background:var(--sd-secondary-contrast)!important}.border-secondary-contrast{border-color:var(--sd-secondary-contrast)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-info-contrast{color:var(--sd-info-contrast)!important}.bg-info-contrast{background:var(--sd-info-contrast)!important}.border-info-contrast{border-color:var(--sd-info-contrast)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-success-contrast{color:var(--sd-success-contrast)!important}.bg-success-contrast{background:var(--sd-success-contrast)!important}.border-success-contrast{border-color:var(--sd-success-contrast)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-warning-contrast{color:var(--sd-warning-contrast)!important}.bg-warning-contrast{background:var(--sd-warning-contrast)!important}.border-warning-contrast{border-color:var(--sd-warning-contrast)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-error-contrast{color:var(--sd-error-contrast)!important}.bg-error-contrast{background:var(--sd-error-contrast)!important}.border-error-contrast{border-color:var(--sd-error-contrast)!important}.text-surface{color:var(--sd-surface)!important}.bg-surface{background:var(--sd-surface)!important}.border-surface{border-color:var(--sd-surface)!important}.text-surface-muted{color:var(--sd-surface-muted)!important}.bg-surface-muted{background:var(--sd-surface-muted)!important}.border-surface-muted{border-color:var(--sd-surface-muted)!important}.text-text{color:var(--sd-text)!important}.bg-text{background:var(--sd-text)!important}.border-text{border-color:var(--sd-text)!important}.text-text-secondary{color:var(--sd-text-secondary)!important}.bg-text-secondary{background:var(--sd-text-secondary)!important}.border-text-secondary{border-color:var(--sd-text-secondary)!important}.text-text-muted{color:var(--sd-text-muted)!important}.bg-text-muted{background:var(--sd-text-muted)!important}.border-text-muted{border-color:var(--sd-text-muted)!important}.text-border{color:var(--sd-border)!important}.bg-border{background:var(--sd-border)!important}.border-border{border-color:var(--sd-border)!important}.text-border-strong{color:var(--sd-border-strong)!important}.bg-border-strong{background:var(--sd-border-strong)!important}.border-border-strong{border-color:var(--sd-border-strong)!important}.text-disabled-bg{color:var(--sd-disabled-bg)!important}.bg-disabled-bg{background:var(--sd-disabled-bg)!important}.border-disabled-bg{border-color:var(--sd-disabled-bg)!important}.text-disabled-text{color:var(--sd-disabled-text)!important}.bg-disabled-text{background:var(--sd-disabled-text)!important}.border-disabled-text{border-color:var(--sd-disabled-text)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}.text-secondary{color:var(--sd-text-secondary)!important}.text-muted{color:var(--sd-text-muted)!important}.text-body{color:var(--sd-text)!important}.bg-muted{background:var(--sd-surface-muted)!important}:host{display:block;max-width:100%}:host(.sd-has-label){padding-top:4px}:host(.sd-viewed){padding-top:0}::ng-deep .sd-loading-option{min-height:50px!important}::ng-deep .sd-loading-option .mat-pseudo-checkbox{display:none!important}::ng-deep .sd-loading-option .mdc-list-item__primary-text{width:100%;display:flex;justify-content:center;align-items:center}.sd-trigger-text{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host ::ng-deep .mat-mdc-select-value{max-width:100%;overflow:hidden;width:0;min-width:100%}:host ::ng-deep .sd-selected .mat-mdc-select-arrow{display:none}:host ::ng-deep .mat-mdc-select-arrow{display:none!important}:host ::ng-deep .custom-arrow{pointer-events:none;position:absolute;right:1rem;top:50%;transform:translateY(-50%);display:flex;align-items:center}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-disabled-bg)}:host ::ng-deep .mat-mdc-form-field mat-select.mat-mdc-select-disabled .mat-mdc-select-value{color:var(--sd-disabled-text)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}::ng-deep .sd-select-panel .mat-mdc-option.sd-empty .mat-pseudo-checkbox{display:none}::ng-deep .sd-select-panel .mat-mdc-option{min-height:36px!important;padding:8px 12px!important}::ng-deep .sd-select-panel .c-filter-input-container{position:sticky;top:0;background-color:#fff;box-shadow:0 1px #f2f2f2;padding:8px;margin-bottom:8px;z-index:1000}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper{display:flex;align-items:center;padding:4px 8px;border:1px solid var(--sd-border);border-radius:4px;background-color:#fff}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper sd-icon{color:#dadada}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper .c-search-input{min-width:0;width:100%;background-color:#fff;border:none;outline:none;flex:1;padding:4px}::ng-deep .sd-select-panel .sd-select-footer-actions{position:sticky;bottom:0;z-index:1000;display:flex;flex-direction:column;gap:4px;border-top:1px solid #f2f2f2;background-color:#fff}::ng-deep .sd-select-panel .sd-select-all-row{display:flex;align-items:center;justify-content:flex-start;min-height:36px;padding:8px 12px;cursor:pointer;-webkit-user-select:none;user-select:none;border-bottom:1px solid var(--sd-border, #f2f2f2)}::ng-deep .sd-select-panel .sd-select-all-row:hover,::ng-deep .sd-select-panel .sd-select-all-row:focus-visible{background-color:var(--mat-option-hover-state-layer-color, rgba(0, 0, 0, .04));outline:none}::ng-deep .sd-select-panel .sd-select-all-row .mdc-list-item__primary-text{font-size:14px;white-space:normal}::ng-deep .sd-multiline-tooltip{white-space:pre-line}::ng-deep .mat-mdc-select-panel.sd-select-panel{padding:0}::ng-deep .mat-mdc-select-panel.sd-select-panel .mat-mdc-option.mdc-list-item--disabled.sd-empty .mdc-list-item__primary-text{opacity:.8;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px}::ng-deep .sd-select-panel .mat-pseudo-checkbox-minimal{transform:scale(.7);transform-origin:center right}::ng-deep .sd-select-panel.sd-multiple .mat-pseudo-checkbox{transform:scale(.75);margin-right:8px!important}::ng-deep .sd-select-panel.sd-multiple .mdc-list-item__primary-text{font-size:14px;white-space:normal}::ng-deep .mat-mdc-select-panel.sd-select-panel{max-width:90vw!important}::ng-deep .mat-mdc-select-panel.sd-select-panel .mat-mdc-option .mdc-list-item__primary-text{white-space:normal;word-break:break-word;line-height:1.4}:host(.sd-bare){display:inline-flex;align-items:center}:host(.sd-bare){position:relative}.sd-inline-view{cursor:pointer;display:inline-flex;align-items:center;width:100%;padding:1px 6px;border-radius:4px;background-color:#0000000a;transition:background-color .15s ease}.sd-inline-view:hover{background-color:#00000014}.sd-inline-view .sd-inline-clear{display:none;align-items:center;margin-left:4px;padding:0;border:0;background:transparent;cursor:pointer;line-height:0;color:var(--sd-text-secondary, #6b7280);transition:color .15s ease}.sd-inline-view .sd-inline-clear sd-icon{font-size:16px;width:16px;height:16px}.sd-inline-view .sd-inline-clear:hover{color:var(--sd-error, #b32626)}.sd-inline-view:hover .sd-inline-clear{display:inline-flex}.sd-inline-editor{position:absolute;inset:0;opacity:0;pointer-events:none}.sd-inline-editor ::ng-deep *{pointer-events:none!important}:host(.sd-bare) ::ng-deep .mat-mdc-form-field{width:auto}:host(.sd-bare) ::ng-deep .mat-mdc-text-field-wrapper{padding:0;background:transparent}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-flex{padding:0;align-items:center}:host(.sd-bare) ::ng-deep .mdc-notched-outline{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}:host(.sd-bare) ::ng-deep .mat-mdc-select-arrow-wrapper{display:none}.sd-select-tooltip{white-space:pre-line}::ng-deep .sd-select-panel .sd-read-state-anchor{display:none}::ng-deep .sd-select-panel .sd-read-state-region{container:sd-read-panel/inline-size;box-sizing:border-box;width:100%;min-width:0;text-align:center}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact{display:flex;flex-direction:column;align-items:center;min-height:120px;padding:20px 16px;text-align:center}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__symbol{margin:0 0 8px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__message{max-width:100%}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__actions{justify-content:center}@container sd-read-panel (max-width: 220px){::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact{padding:8px 10px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__symbol{width:24px;height:24px;margin-bottom:4px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__icon{width:18px;height:18px;font-size:18px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__message{line-height:18px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__actions{margin-top:6px}}\n"], dependencies: [{ kind: "component", type: SdDataState, selector: "sd-data-state", inputs: ["state", "title", "message", "icon", "fontSet", "retryable", "retryLabel", "actionLabel", "compact", "fullPage"], outputs: ["sdRetry", "sdAction"] }, { kind: "directive", type: SdDataStateTemplateDirective, selector: "ng-template[sdDataStateTemplate]" }, { kind: "directive", type: SdTooltipDirective, selector: "[sdTooltip]", inputs: ["sdTooltip", "sdTooltipPosition", "sdTooltipDelay", "sdTooltipColor"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i5.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatPseudoCheckbox, selector: "mat-pseudo-checkbox", inputs: ["state", "disabled", "appearance"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate", "selectedItems"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1481
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSelect, isStandalone: true, selector: "sd-select", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, displayField: { classPropertyName: "displayField", publicName: "displayField", isSignal: true, isRequired: false, transformFunction: null }, disabledField: { classPropertyName: "disabledField", publicName: "disabledField", isSignal: true, isRequired: false, transformFunction: null }, cacheChecksum: { classPropertyName: "cacheChecksum", publicName: "cacheChecksum", isSignal: true, isRequired: false, transformFunction: null }, limit: { classPropertyName: "limit", publicName: "limit", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", isSignal: true, isRequired: false, transformFunction: null }, minWidthPanel: { classPropertyName: "minWidthPanel", publicName: "minWidthPanel", isSignal: true, isRequired: false, transformFunction: null }, hideInlineError: { classPropertyName: "hideInlineError", publicName: "hideInlineError", isSignal: true, isRequired: false, transformFunction: null }, hideReadError: { classPropertyName: "hideReadError", publicName: "hideReadError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, viewed: { classPropertyName: "viewed", publicName: "viewed", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showSelectAll: { classPropertyName: "showSelectAll", publicName: "showSelectAll", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, validator: { classPropertyName: "validator", publicName: "validator", isSignal: true, isRequired: false, transformFunction: null }, inlineError: { classPropertyName: "inlineError", publicName: "inlineError", isSignal: true, isRequired: false, transformFunction: null }, appearanceInput: { classPropertyName: "appearanceInput", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, labelPlacement: { classPropertyName: "labelPlacement", publicName: "labelPlacement", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, valueModel: { classPropertyName: "valueModel", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdReadStateChange: "sdReadStateChange", valueModel: "modelChange", sdChange: "sdChange", sdSelection: "sdSelection" }, host: { properties: { "class.sd-bare": "isInline()", "class.sd-viewed": "isViewed() || isInline()", "class.sd-has-label": "!!label()", "class.sd-label-top": "labelPlacement() === 'top'" } }, queries: [{ propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true, isSignal: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true, isSignal: true }, { propertyName: "sdSelectedTemplate", first: true, predicate: ["sdSelected"], descendants: true, isSignal: true }, { propertyName: "itemDef", first: true, predicate: SdItemDefDefDirective, descendants: true, isSignal: true }, { propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }, { propertyName: "footerActions", predicate: SdSelectFooterActionDirective, isSignal: true }, { propertyName: "dataStateTemplate", first: true, predicate: SdDataStateTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "matInputRef", first: true, predicate: MatInput, descendants: true, isSignal: true }, { propertyName: "selectRef", first: true, predicate: ["select"], descendants: true, isSignal: true }, { propertyName: "selectElement", first: true, predicate: ["select"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "virtualViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }], ngImport: i0, template: "@let _loading = loading();\n@let _readState = readState();\n@let _hideReadError = hideReadError();\n@let _selectedItems = selectedItems();\n@let _tooltip = tooltip();\n@let _label = label();\n@let _appearance = appearance();\n@let _hideInlineError = hideInlineError();\n@let _errorMessage = errorMessage();\n@let _helperText = helperText();\n@let _multiple = multiple();\n@let _required = required();\n@let _normalizedValue = $any(normalizedValue());\n@let _focused = $any(focused());\n@let _isInline = isInline();\n@let _labelTop = labelPlacement() === 'top';\n@let _placeholder = placeholder() || (_labelTop ? '' : _label) || '';\n@let _bare = _isInline;\n@let _hasValue = _multiple ? !!_normalizedValue?.length : _normalizedValue !== undefined && _normalizedValue !== null;\n@let _display = display();\n@let _size = size();\n@let _floatLabel = floatLabel();\n@let _valueField = valueField();\n@let _displayField = displayField();\n@let _autoId = autoId();\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\n@let _errorVisible = !!_errorMessage && formControl.touched;\n@let _showInlineError = !_hideInlineError && _errorVisible;\n\n<ng-template #selectionTooltip>\n <div class=\"sd-select-tooltip\">{{ _tooltip }}</div>\n</ng-template>\n\n@if (isViewed()) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_normalizedValue\"\n [display]=\"_display\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\"\n [selectedItems]=\"_selectedItems\">\n </sd-view>\n} @else {\n @if (_isInline) {\n <!-- why: inline \u2014 sd-view text l\u00E0 \"m\u1EB7t\" + trigger; editor v\u1EABn render b\u00EAn d\u01B0\u1EDBi (chrome \u1EA9n qua\n .sd-inline-editor) \u0111\u1EC3 m\u1EDF panel. Text gi\u1EEF nguy\u00EAn, ch\u1EC9 \u0111\u1ED5i khi commit gi\u00E1 tr\u1ECB m\u1EDBi. -->\n <span\n class=\"sd-inline-view\"\n [sdTooltip]=\"_multiple && _tooltip ? selectionTooltip : ''\"\n sdTooltipPosition=\"top\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"enterInlineEdit()\"\n (keydown.enter)=\"enterInlineEdit()\">\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_normalizedValue\"\n [display]=\"_display\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\"\n [selectedItems]=\"_selectedItems\">\n </sd-view>\n\n <!-- why: clear-\u00D7 ch\u1EC9 hi\u1EC7n khi hover (CSS), \u0111\u1EB7t CU\u1ED0I face + clear($event) stopPropagation \u2192\n xo\u00E1 gi\u00E1 tr\u1ECB m\u00E0 KH\u00D4NG m\u1EDF panel; tr\u00E1nh bug c\u0169 (\u00D7 s\u00E1t trigger b\u1ECB b\u1EA5m nh\u1EA7m l\u00FAc \u0111\u00F3ng panel). -->\n @if (clearable() && _hasValue && !_required && !formControl.disabled) {\n <button type=\"button\" class=\"sd-inline-clear\" (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </span>\n }\n\n @if (!_appearance || _labelTop) {\n <ng-content select=\"[sdLabel]\">\n @if (_label) {\n <!-- why: mat-select kh\u00F4ng \"labelable\" n\u00EAn nh\u00E3n r\u1EDDi d\u00F9ng id + aria-labelledby, c\u00F2n click\n nh\u00E3n th\u00EC t\u1EF1 focus control (t\u01B0\u01A1ng \u0111\u01B0\u01A1ng <label for>). -->\n <sd-label\n [label]=\"_label\"\n [required]=\"_required\"\n [labelId]=\"_labelTop ? labelId : null\"\n (click)=\"_labelTop && onLabelClick()\"></sd-label>\n }\n </ng-content>\n }\n\n <!-- why: div ch\u1EC9 l\u00E0 h\u1ED9p layout. aria-hidden=\"true\" c\u0169 \u1EA9n C\u1EA2 c\u00E2y con \u2014 label, <mat-select>,\n <mat-error>, n\u00FAt clear \u2014 kh\u1ECFi accessibility tree. role=\"presentation\" ch\u1EC9 v\u00F4 hi\u1EC7u ho\u00E1\n ch\u00EDnh div, KH\u00D4NG lan xu\u1ED1ng con; (click) l\u00E0 ti\u1EC7n \u00EDch chu\u1ED9t, b\u00E0n ph\u00EDm Tab th\u1EB3ng v\u00E0o\n <mat-select> v\u00E0 (focusin) \u0111\u00E3 lo ph\u1EA7n updatePanelWidth() t\u01B0\u01A1ng \u1EE9ng. -->\n <div\n class=\"d-flex align-items-center\"\n role=\"presentation\"\n [class.sd-inline-editor]=\"_isInline\"\n [class.c-focused]=\"_focused\"\n [class.c-disabled]=\"formControl.disabled\"\n (click)=\"onClick()\"\n (mouseenter)=\"updatePanelWidth()\"\n (focusin)=\"updatePanelWidth()\">\n <!-- why: virtualScroll (opt-in) gets its own branch; the 2.15 branches below are unchanged. The\n @if recreates the field when `multiple` changes, because mat-select cannot switch it later. -->\n @if (virtualScroll()) {\n @if (_multiple) {\n <ng-container *ngTemplateOutlet=\"virtualField; context: { $implicit: true }\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"virtualField; context: { $implicit: false }\"></ng-container>\n }\n } @else if (_multiple) {\n <mat-form-field\n [sdTooltip]=\"_tooltip ? selectionTooltip : ''\"\n sdTooltipPosition=\"top\"\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [class.sd-label-top]=\"_labelTop\"\n [appearance]=\"_appearance!\"\n [floatLabel]=\"_floatLabel\">\n @if (_appearance && _label && !_labelTop) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <mat-select\n #select\n [aria-labelledby]=\"_labelTop ? labelId : null\"\n multiple\n [formControl]=\"formControl\"\n [placeholder]=\"_placeholder\"\n (selectionChange)=\"onSelectionChange($event)\"\n disableOptionCentering=\"true\"\n [panelWidth]=\"calculatedPanelWidth()\"\n [panelClass]=\"['sd-select-panel', 'sd-multiple']\"\n [class.sd-selected]=\"!_required && _normalizedValue?.length\"\n [required]=\"_required\"\n (openedChange)=\"onOpenedChange($event)\"\n [attr.data-autoId]=\"_autoId\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-loading]=\"dataLoading()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\">\n <mat-select-trigger>\n @if (sdSelectedTemplate(); as _selTpl) {\n <ng-container\n *ngTemplateOutlet=\"\n _selTpl;\n context: { $implicit: _selectedItems, item: _selectedItems, items: _selectedItems, display: _display, multiple: true }\n \">\n </ng-container>\n } @else {\n <div class=\"sd-trigger-text\">\n {{ _display }}\n </div>\n }\n </mat-select-trigger>\n\n @if (filtered()) {\n <div class=\"c-filter-input-container\">\n <div class=\"filter-input-wrapper\">\n <sd-icon name=\"search\" aria-hidden=\"true\"></sd-icon>\n <!-- why: B\u1ECE aria-hidden \u2014 \u0111\u00E2y l\u00E0 \u00F4 l\u1ECDc TH\u1EACT, ng\u01B0\u1EDDi d\u00F9ng focus v\u00E0 g\u00F5 v\u00E0o \u0111\u01B0\u1EE3c, n\u00EAn\n aria-hidden ch\u1EC9 l\u00E0m screen reader c\u00E2m. Panel kh\u00F4ng c\u00F3 <label> n\u00E0o, n\u00EAn ph\u1EA3i\n t\u1EF1 \u0111\u1EB7t t\u00EAn b\u1EB1ng aria-label, n\u1EBFu kh\u00F4ng AT ch\u1EC9 \u0111\u1ECDc \"edit text\" tr\u1ED1ng tr\u01A1n. -->\n <input\n [formControl]=\"inputControl\"\n matInput\n autocomplete=\"off\"\n class=\"c-search-input\"\n [attr.aria-label]=\"'core.form.select.search' | sdTranslate\"\n (keydown)=\"focusReadRetry($event); $event.stopPropagation()\" />\n </div>\n </div>\n }\n\n <!-- why: row \"T\u1EA5t c\u1EA3\" KH\u00D4NG ph\u1EA3i mat-option th\u1EADt \u2014 n\u1EBFu l\u00E0 option, gi\u00E1 tr\u1ECB c\u1EE7a n\u00F3 l\u1ECDt v\u00E0o\n formControl.value v\u00E0 keyboard navigation c\u1EE7a mat-select. Nh\u01B0ng n\u00F3 ph\u1EA3i TR\u00D4NG y h\u1EC7t m\u1ED9t\n option: d\u00F9ng ch\u00EDnh <mat-pseudo-checkbox> + .mdc-list-item__primary-text m\u00E0 mat-option\n render, n\u00EAn \u0103n c\u00F9ng scale/margin (rule .sd-multiple) v\u00E0 c\u00F9ng m\u00E0u theme (panel mang\n class mat-primary) \u2014 mat-checkbox MDC th\u1EADt th\u00EC l\u1EC7ch c\u1ED9t v\u00E0 \u0103n accent c\u1EE7a theme.\n V\u00EC pseudo-checkbox l\u00E0 decorative + aria-hidden, ch\u00EDnh div mang role/aria/keyboard. -->\n @if (selectAllVisible()) {\n @let _selectAllState = selectAllState();\n <div\n class=\"sd-select-all-row\"\n role=\"checkbox\"\n tabindex=\"0\"\n [attr.aria-checked]=\"_selectAllState === 'indeterminate' ? 'mixed' : _selectAllState === 'checked'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-select-all' : null\"\n (click)=\"toggleSelectAll()\"\n (keydown.enter)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown.space)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown)=\"$event.stopPropagation()\">\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [state]=\"_selectAllState\"\n aria-hidden=\"true\"></mat-pseudo-checkbox>\n <span class=\"mdc-list-item__primary-text\">{{ 'core.form.select.selectAll' | sdTranslate }}</span>\n </div>\n }\n\n @if (!_loading && _readState.status === 'error') {\n <!-- why: MatSelect c\u1EA7n option tr\u1EF1c ti\u1EBFp \u0111\u1EC3 gi\u1EEF panel m\u1EDF khi ch\u1EC9 c\u00F3 l\u1ED7i. -->\n <mat-option disabled class=\"sd-read-state-anchor\" aria-hidden=\"true\"></mat-option>\n }\n @let _filteredItems = filteredItems();\n @if (_filteredItems) {\n @if (!_filteredItems.length && !_loading && _readState.status !== 'error') {\n <mat-option class=\"sd-empty\" disabled>\n <img class=\"sd-image-data-empty\" alt=\"empty-image\" style=\"width: 95px\" />\n </mat-option>\n } @else {\n @let iDefTpl = itemDef()?.templateRef;\n @if (_valueField && _displayField) {\n @for (item of _filteredItems; track itemValue(item)) {\n <mat-option [value]=\"itemValue(item)\" [disabled]=\"itemDisabled(item)\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ itemDisplay(item) }}\n }\n </div>\n </mat-option>\n }\n } @else if (!_valueField && !_displayField) {\n @for (item of _filteredItems; track item) {\n <mat-option [value]=\"item\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ item }}\n }\n </div>\n </mat-option>\n }\n }\n }\n }\n\n <ng-container [ngTemplateOutlet]=\"readRegion\"></ng-container>\n\n @if (_loading) {\n <mat-option disabled class=\"sd-loading-option\">\n <mat-spinner diameter=\"24\"></mat-spinner>\n </mat-option>\n }\n\n @let _visibleFooterActions = visibleFooterActions();\n @if (_visibleFooterActions.length) {\n <div class=\"sd-select-footer-actions\">\n @for (action of _visibleFooterActions; track action) {\n <ng-container *ngTemplateOutlet=\"action.templateRef; context: footerActionContext()\"> </ng-container>\n }\n </div>\n }\n </mat-select>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\n }\n\n <!-- why: <mat-error> ph\u1EA3i c\u00F3 id \u1ED4N \u0110\u1ECANH. MatFormField t\u1EF1 n\u1ED1i id n\u00E0y v\u00E0o aria-describedby\n c\u1EE7a <mat-select> (v\u00E0 host binding c\u1EE7a MatSelect lo aria-invalid), nh\u01B0ng ch\u1EC9 khi id\n t\u1ED3n t\u1EA1i \u2014 id auto-gen c\u1EE7a Material \u0111\u1ED5i theo t\u1EEBng instance n\u00EAn test/AT kh\u00F4ng b\u00E1m \u0111\u01B0\u1EE3c. -->\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n } @else if (_labelTop && _helperText) {\n <mat-hint [id]=\"hintId\">{{ _helperText }}</mat-hint>\n }\n\n @if (_normalizedValue?.length && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n } @else {\n <sd-icon class=\"cursor-pointer sd-suffix-icon\" matSuffix name=\"keyboard_arrow_down\"></sd-icon>\n }\n </mat-form-field>\n } @else {\n <mat-form-field\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [class.sd-label-top]=\"_labelTop\"\n [appearance]=\"_appearance!\"\n [floatLabel]=\"_floatLabel\">\n @if (_appearance && _label && !_labelTop) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <mat-select\n #select\n [aria-labelledby]=\"_labelTop ? labelId : null\"\n [formControl]=\"formControl\"\n [placeholder]=\"_placeholder\"\n (selectionChange)=\"onSelectionChange($event)\"\n disableOptionCentering=\"true\"\n [panelWidth]=\"calculatedPanelWidth()\"\n [panelClass]=\"'sd-select-panel'\"\n [class.sd-selected]=\"!_required && _normalizedValue !== undefined && _normalizedValue !== null\"\n [required]=\"_required\"\n (openedChange)=\"onOpenedChange($event)\"\n [attr.data-autoId]=\"_autoId\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-loading]=\"dataLoading()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n matTooltipClass=\"sd-multiline-tooltip\"\n [matTooltipDisabled]=\"!formControl.disabled || !_normalizedValue?.length\"\n [matTooltip]=\"_tooltip || ''\">\n <mat-select-trigger>\n @if (sdSelectedTemplate(); as _selTpl) {\n <ng-container\n *ngTemplateOutlet=\"\n _selTpl;\n context: {\n $implicit: _selectedItems[0],\n item: _selectedItems[0],\n items: _selectedItems,\n display: _display,\n multiple: false,\n }\n \">\n </ng-container>\n } @else {\n {{ _display }}\n }\n </mat-select-trigger>\n\n @if (filtered()) {\n <div class=\"c-filter-input-container\">\n <div class=\"filter-input-wrapper\">\n <sd-icon name=\"search\" aria-hidden=\"true\"></sd-icon>\n <!-- why: B\u1ECE aria-hidden \u2014 \u0111\u00E2y l\u00E0 \u00F4 l\u1ECDc TH\u1EACT, ng\u01B0\u1EDDi d\u00F9ng focus v\u00E0 g\u00F5 v\u00E0o \u0111\u01B0\u1EE3c, n\u00EAn\n aria-hidden ch\u1EC9 l\u00E0m screen reader c\u00E2m. Panel kh\u00F4ng c\u00F3 <label> n\u00E0o, n\u00EAn ph\u1EA3i\n t\u1EF1 \u0111\u1EB7t t\u00EAn b\u1EB1ng aria-label, n\u1EBFu kh\u00F4ng AT ch\u1EC9 \u0111\u1ECDc \"edit text\" tr\u1ED1ng tr\u01A1n. -->\n <input\n [formControl]=\"inputControl\"\n matInput\n autocomplete=\"off\"\n class=\"c-search-input\"\n [attr.aria-label]=\"'core.form.select.search' | sdTranslate\"\n (keydown)=\"focusReadRetry($event); $event.stopPropagation()\" />\n </div>\n </div>\n }\n\n @if (!_loading && _readState.status === 'error') {\n <!-- why: MatSelect c\u1EA7n option tr\u1EF1c ti\u1EBFp \u0111\u1EC3 gi\u1EEF panel m\u1EDF khi ch\u1EC9 c\u00F3 l\u1ED7i. -->\n <mat-option disabled class=\"sd-read-state-anchor\" aria-hidden=\"true\"></mat-option>\n }\n @let _filteredItems = filteredItems();\n @if (_filteredItems) {\n @if (!_filteredItems.length && !_loading && _readState.status !== 'error') {\n <mat-option class=\"sd-empty\" disabled>\n <img class=\"sd-image-data-empty\" alt=\"empty-image\" style=\"width: 95px\" />\n </mat-option>\n } @else {\n @let iDefTpl = itemDef()?.templateRef;\n\n @if (_valueField && _displayField) {\n @for (item of _filteredItems; track itemValue(item)) {\n <mat-option [value]=\"itemValue(item)\" [disabled]=\"itemDisabled(item)\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ itemDisplay(item) }}\n }\n </div>\n </mat-option>\n }\n } @else if (!_valueField && !_displayField) {\n @for (item of _filteredItems; track item) {\n <mat-option [value]=\"item\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ item }}\n }\n </div>\n </mat-option>\n }\n }\n }\n }\n\n <ng-container [ngTemplateOutlet]=\"readRegion\"></ng-container>\n\n @if (_loading) {\n <mat-option disabled class=\"sd-loading-option\">\n <mat-spinner diameter=\"24\"></mat-spinner>\n </mat-option>\n }\n\n @let _visibleFooterActions = visibleFooterActions();\n @if (_visibleFooterActions.length) {\n <div class=\"sd-select-footer-actions\">\n @for (action of _visibleFooterActions; track action) {\n <ng-container *ngTemplateOutlet=\"action.templateRef; context: footerActionContext()\"> </ng-container>\n }\n </div>\n }\n </mat-select>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\n }\n\n <!-- why: <mat-error> ph\u1EA3i c\u00F3 id \u1ED4N \u0110\u1ECANH. MatFormField t\u1EF1 n\u1ED1i id n\u00E0y v\u00E0o aria-describedby\n c\u1EE7a <mat-select> (v\u00E0 host binding c\u1EE7a MatSelect lo aria-invalid), nh\u01B0ng ch\u1EC9 khi id\n t\u1ED3n t\u1EA1i \u2014 id auto-gen c\u1EE7a Material \u0111\u1ED5i theo t\u1EEBng instance n\u00EAn test/AT kh\u00F4ng b\u00E1m \u0111\u01B0\u1EE3c. -->\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n } @else if (_labelTop && _helperText) {\n <mat-hint [id]=\"hintId\">{{ _helperText }}</mat-hint>\n }\n\n @if (_normalizedValue !== undefined && _normalizedValue !== null && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n } @else {\n <sd-icon class=\"cursor-pointer sd-suffix-icon\" matSuffix name=\"keyboard_arrow_down\"></sd-icon>\n }\n </mat-form-field>\n }\n </div>\n}\n\n<ng-template #readRegion>\n <!-- why: VALUE/SEARCH gi\u1EEF l\u1ED7i \u0111\u1ED9c l\u1EADp; trong l\u00FAc k\u00EAnh kh\u00E1c \u0111ang \u0111\u1ECDc ch\u1EC9 hi\u1EC3n th\u1ECB loading. -->\n @if (!_loading && _readState.status === 'error') {\n <!-- why: n\u00FAt retry n\u1EB1m ngo\u00E0i mat-option \u0111\u1EC3 kh\u00F4ng tr\u1EDF th\u00E0nh m\u1ED9t l\u1EF1a ch\u1ECDn/form value. -->\n @if (!_hideReadError) {\n <div\n class=\"sd-read-state-region\"\n role=\"presentation\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onReadRegionKeydown($event)\">\n <sd-data-state state=\"error\" compact retryable (sdRetry)=\"retryRead()\">\n @if (dataStateTemplate(); as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n </div>\n }\n }\n</ng-template>\n\n<!-- Virtual scroll branch (D-026, D-030 V1). mat-select is only the shell: it gets the value one way\n ([value] + virtualCompareWith) and never a formControl \u2014 the component owns the value, the keyboard\n over the whole list and aria-activedescendant. Rows are real mat-options inside a CDK viewport; one\n hidden sentinel option keeps the trigger rendered while the selected rows are scrolled away. -->\n<ng-template #virtualField let-multiple>\n <mat-form-field\n [sdTooltip]=\"multiple && _tooltip ? selectionTooltip : ''\"\n sdTooltipPosition=\"top\"\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [class.sd-label-top]=\"_labelTop\"\n [appearance]=\"_appearance!\"\n [floatLabel]=\"_floatLabel\">\n @if (_appearance && _label && !_labelTop) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <mat-select\n #select\n [aria-labelledby]=\"_labelTop ? labelId : null\"\n [multiple]=\"multiple\"\n [value]=\"virtualShellValue()\"\n [compareWith]=\"virtualCompareWith\"\n [errorStateMatcher]=\"virtualErrorStateMatcher\"\n [disabled]=\"formControl.disabled\"\n [placeholder]=\"_placeholder\"\n disableOptionCentering=\"true\"\n [panelWidth]=\"calculatedPanelWidth()\"\n [panelClass]=\"multiple ? virtualPanelClass.multiple : virtualPanelClass.single\"\n [class.sd-selected]=\"!_required && _hasValue\"\n [required]=\"_required\"\n (openedChange)=\"onOpenedChange($event)\"\n (blur)=\"onVirtualBlur()\"\n [attr.data-autoId]=\"_autoId\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-loading]=\"dataLoading()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n matTooltipClass=\"sd-multiline-tooltip\"\n [matTooltipDisabled]=\"multiple || !formControl.disabled || !_normalizedValue?.length\"\n [matTooltip]=\"multiple ? '' : _tooltip || ''\">\n <mat-select-trigger>\n @if (sdSelectedTemplate(); as _selTpl) {\n <ng-container *ngTemplateOutlet=\"_selTpl; context: selectedTemplateContext()\"></ng-container>\n } @else if (multiple) {\n <div class=\"sd-trigger-text\">\n {{ _display }}\n </div>\n } @else {\n {{ _display }}\n }\n </mat-select-trigger>\n\n @if (filtered()) {\n <div class=\"c-filter-input-container\">\n <div class=\"filter-input-wrapper\">\n <sd-icon name=\"search\" aria-hidden=\"true\"></sd-icon>\n <input\n [formControl]=\"inputControl\"\n matInput\n autocomplete=\"off\"\n class=\"c-search-input\"\n [attr.aria-label]=\"'core.form.select.search' | sdTranslate\"\n [attr.aria-activedescendant]=\"virtualActiveDescendant()\"\n (keydown)=\"focusReadRetry($event); onVirtualSearchKeydown($event); $event.stopPropagation()\" />\n </div>\n </div>\n }\n\n @if (multiple && selectAllVisible()) {\n @let _selectAllState = selectAllState();\n <div\n class=\"sd-select-all-row\"\n role=\"checkbox\"\n tabindex=\"0\"\n [attr.aria-checked]=\"_selectAllState === 'indeterminate' ? 'mixed' : _selectAllState === 'checked'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-select-all' : null\"\n (click)=\"toggleSelectAll()\"\n (keydown.enter)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown.space)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown)=\"$event.stopPropagation()\">\n <mat-pseudo-checkbox class=\"mat-mdc-option-pseudo-checkbox\" [state]=\"_selectAllState\" aria-hidden=\"true\"></mat-pseudo-checkbox>\n <span class=\"mdc-list-item__primary-text\">{{ 'core.form.select.selectAll' | sdTranslate }}</span>\n </div>\n }\n\n @if (!_loading && _readState.status === 'error') {\n <mat-option disabled class=\"sd-read-state-anchor\" aria-hidden=\"true\"></mat-option>\n }\n @let _virtualItems = filteredItems();\n @if (!_virtualItems.length && !_loading && _readState.status !== 'error') {\n <mat-option class=\"sd-empty\" disabled>\n <img class=\"sd-image-data-empty\" alt=\"empty-image\" style=\"width: 95px\" />\n </mat-option>\n } @else if (_virtualItems.length && virtualRenderable()) {\n @let iDefTpl = itemDef()?.templateRef;\n @let _itemSize = itemSize();\n <!-- why: templateCacheSize 0 \u2014 a recycled mat-option would carry the previous row's selected\n state until Material re-syncs; fresh options always start clean. -->\n <cdk-virtual-scroll-viewport\n class=\"sd-select-virtual-viewport\"\n [itemSize]=\"_itemSize\"\n [minBufferPx]=\"_itemSize * 5\"\n [maxBufferPx]=\"_itemSize * 10\"\n [style.height.px]=\"virtualViewportHeight()\">\n <mat-option\n *cdkVirtualFor=\"let item of _virtualItems; let i = index; trackBy: virtualTrackBy; templateCacheSize: 0\"\n [id]=\"virtualOptionId(i)\"\n [value]=\"itemValue(item)\"\n [disabled]=\"itemDisabled(item)\"\n [class.sd-virtual-active]=\"i === virtualActiveIndex()\"\n [style.height.px]=\"_itemSize\">\n <div class=\"sd-select-virtual-label\">\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl; context: { item: item }\"></ng-container>\n } @else {\n {{ itemDisplay(item) }}\n }\n </div>\n </mat-option>\n </cdk-virtual-scroll-viewport>\n }\n\n <ng-container [ngTemplateOutlet]=\"readRegion\"></ng-container>\n\n @if (_loading) {\n <mat-option disabled class=\"sd-loading-option\">\n <mat-spinner diameter=\"24\"></mat-spinner>\n </mat-option>\n }\n\n <!-- why: declared after the rows, so a rendered row wins over the sentinel in virtualCompareWith. -->\n <mat-option class=\"sd-virtual-sentinel\" [value]=\"virtualSentinel\" disabled aria-hidden=\"true\"></mat-option>\n\n @let _visibleFooterActions = visibleFooterActions();\n @if (_visibleFooterActions.length) {\n <div class=\"sd-select-footer-actions\">\n @for (action of _visibleFooterActions; track action) {\n <ng-container *ngTemplateOutlet=\"action.templateRef; context: footerActionContext()\"> </ng-container>\n }\n </div>\n }\n </mat-select>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\n }\n\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n } @else if (_labelTop && _helperText) {\n <mat-hint [id]=\"hintId\">{{ _helperText }}</mat-hint>\n }\n\n @if (_hasValue && !_required && !formControl.disabled && !_bare) {\n @let _clearLabel = 'core.form.select.clear' | sdTranslate;\n <button type=\"button\" class=\"sd-clear-btn\" matSuffix (click)=\"clear($event)\" [title]=\"_clearLabel\" [attr.aria-label]=\"_clearLabel\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n } @else {\n <sd-icon class=\"cursor-pointer sd-suffix-icon\" matSuffix name=\"keyboard_arrow_down\"></sd-icon>\n }\n </mat-form-field>\n</ng-template>\n", styles: ["@charset \"UTF-8\";.text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-primary-contrast{color:var(--sd-primary-contrast)!important}.bg-primary-contrast{background:var(--sd-primary-contrast)!important}.border-primary-contrast{border-color:var(--sd-primary-contrast)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-secondary-contrast{color:var(--sd-secondary-contrast)!important}.bg-secondary-contrast{background:var(--sd-secondary-contrast)!important}.border-secondary-contrast{border-color:var(--sd-secondary-contrast)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-info-contrast{color:var(--sd-info-contrast)!important}.bg-info-contrast{background:var(--sd-info-contrast)!important}.border-info-contrast{border-color:var(--sd-info-contrast)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-success-contrast{color:var(--sd-success-contrast)!important}.bg-success-contrast{background:var(--sd-success-contrast)!important}.border-success-contrast{border-color:var(--sd-success-contrast)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-warning-contrast{color:var(--sd-warning-contrast)!important}.bg-warning-contrast{background:var(--sd-warning-contrast)!important}.border-warning-contrast{border-color:var(--sd-warning-contrast)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-error-contrast{color:var(--sd-error-contrast)!important}.bg-error-contrast{background:var(--sd-error-contrast)!important}.border-error-contrast{border-color:var(--sd-error-contrast)!important}.text-surface{color:var(--sd-surface)!important}.bg-surface{background:var(--sd-surface)!important}.border-surface{border-color:var(--sd-surface)!important}.text-surface-muted{color:var(--sd-surface-muted)!important}.bg-surface-muted{background:var(--sd-surface-muted)!important}.border-surface-muted{border-color:var(--sd-surface-muted)!important}.text-text{color:var(--sd-text)!important}.bg-text{background:var(--sd-text)!important}.border-text{border-color:var(--sd-text)!important}.text-text-secondary{color:var(--sd-text-secondary)!important}.bg-text-secondary{background:var(--sd-text-secondary)!important}.border-text-secondary{border-color:var(--sd-text-secondary)!important}.text-text-muted{color:var(--sd-text-muted)!important}.bg-text-muted{background:var(--sd-text-muted)!important}.border-text-muted{border-color:var(--sd-text-muted)!important}.text-border{color:var(--sd-border)!important}.bg-border{background:var(--sd-border)!important}.border-border{border-color:var(--sd-border)!important}.text-border-strong{color:var(--sd-border-strong)!important}.bg-border-strong{background:var(--sd-border-strong)!important}.border-border-strong{border-color:var(--sd-border-strong)!important}.text-disabled-bg{color:var(--sd-disabled-bg)!important}.bg-disabled-bg{background:var(--sd-disabled-bg)!important}.border-disabled-bg{border-color:var(--sd-disabled-bg)!important}.text-disabled-text{color:var(--sd-disabled-text)!important}.bg-disabled-text{background:var(--sd-disabled-text)!important}.border-disabled-text{border-color:var(--sd-disabled-text)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}.text-secondary{color:var(--sd-text-secondary)!important}.text-muted{color:var(--sd-text-muted)!important}.text-body{color:var(--sd-text)!important}.bg-muted{background:var(--sd-surface-muted)!important}:host{display:block;max-width:100%}:host(.sd-has-label){padding-top:4px}:host(.sd-label-top){padding-top:0}:host(.sd-viewed){padding-top:0}::ng-deep .sd-loading-option{min-height:50px!important}::ng-deep .sd-loading-option .mat-pseudo-checkbox{display:none!important}::ng-deep .sd-loading-option .mdc-list-item__primary-text{width:100%;display:flex;justify-content:center;align-items:center}.sd-trigger-text{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host ::ng-deep .mat-mdc-select-value{max-width:100%;overflow:hidden;width:0;min-width:100%}:host ::ng-deep .sd-selected .mat-mdc-select-arrow{display:none}:host ::ng-deep .mat-mdc-select-arrow{display:none!important}:host ::ng-deep .custom-arrow{pointer-events:none;position:absolute;right:1rem;top:50%;transform:translateY(-50%);display:flex;align-items:center}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-disabled-bg)}:host ::ng-deep .mat-mdc-form-field mat-select.mat-mdc-select-disabled .mat-mdc-select-value{color:var(--sd-disabled-text)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}::ng-deep .sd-select-panel .mat-mdc-option.sd-empty .mat-pseudo-checkbox{display:none}::ng-deep .sd-select-panel .mat-mdc-option{min-height:36px!important;padding:8px 12px!important}::ng-deep .sd-select-panel .c-filter-input-container{position:sticky;top:0;background-color:var(--sd-select-panel-bg, #ffffff);box-shadow:0 1px 0 0 var(--sd-select-panel-divider, #f2f2f2);padding:8px;margin-bottom:8px;z-index:var(--sd-z-dropdown, 1000)}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper{display:flex;align-items:center;padding:4px 8px;border:1px solid var(--sd-border);border-radius:var(--sd-radius-4, 4px);background-color:var(--sd-select-panel-bg, #ffffff)}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper sd-icon{color:var(--sd-select-icon-muted, #dadada)}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper .c-search-input{min-width:0;width:100%;background-color:var(--sd-select-panel-bg, #ffffff);border:none;outline:none;flex:1;padding:4px}::ng-deep .sd-select-panel .sd-select-footer-actions{position:sticky;bottom:0;z-index:var(--sd-z-dropdown, 1000);display:flex;flex-direction:column;gap:4px;border-top:1px solid var(--sd-select-panel-divider, #f2f2f2);background-color:var(--sd-select-panel-bg, #ffffff)}::ng-deep .sd-select-panel .sd-select-all-row{display:flex;align-items:center;justify-content:flex-start;min-height:36px;padding:8px 12px;cursor:pointer;-webkit-user-select:none;user-select:none;border-bottom:1px solid var(--sd-border, #f2f2f2)}::ng-deep .sd-select-panel .sd-select-all-row:hover,::ng-deep .sd-select-panel .sd-select-all-row:focus-visible{background-color:var(--mat-option-hover-state-layer-color, rgba(0, 0, 0, .04));outline:none}::ng-deep .sd-select-panel .sd-select-all-row .mdc-list-item__primary-text{font-size:var(--sd-font-size-14, 14px);white-space:normal}::ng-deep .sd-multiline-tooltip{white-space:pre-line}::ng-deep .mat-mdc-select-panel.sd-select-panel{padding:0}::ng-deep .mat-mdc-select-panel.sd-select-panel .mat-mdc-option.mdc-list-item--disabled.sd-empty .mdc-list-item__primary-text{opacity:.8;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px}::ng-deep .sd-select-panel .mat-pseudo-checkbox-minimal{transform:scale(.7);transform-origin:center right}::ng-deep .sd-select-panel.sd-multiple .mat-pseudo-checkbox{transform:scale(.75);margin-right:8px!important}::ng-deep .sd-select-panel.sd-multiple .mdc-list-item__primary-text{font-size:var(--sd-font-size-14, 14px);white-space:normal}::ng-deep .mat-mdc-select-panel.sd-select-panel{max-width:90vw!important}::ng-deep .mat-mdc-select-panel.sd-select-panel .mat-mdc-option .mdc-list-item__primary-text{white-space:normal;word-break:break-word;line-height:1.4}:host(.sd-bare){display:inline-flex;align-items:center}:host(.sd-bare){position:relative}.sd-inline-view{cursor:pointer;display:inline-flex;align-items:center;width:100%;padding:1px 6px;border-radius:var(--sd-radius-4, 4px);background-color:#0000000a;transition:background-color .15s ease}.sd-inline-view:hover{background-color:#00000014}.sd-inline-view .sd-inline-clear{display:none;align-items:center;margin-left:4px;padding:0;border:0;background:transparent;cursor:pointer;line-height:0;color:var(--sd-text-secondary, #6b7280);transition:color .15s ease}.sd-inline-view .sd-inline-clear sd-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px}.sd-inline-view .sd-inline-clear:hover{color:var(--sd-error, #b32626)}.sd-inline-view:hover .sd-inline-clear{display:inline-flex}.sd-inline-editor{position:absolute;inset:0;opacity:0;pointer-events:none}.sd-inline-editor ::ng-deep *{pointer-events:none!important}:host(.sd-bare) ::ng-deep .mat-mdc-form-field{width:auto}:host(.sd-bare) ::ng-deep .mat-mdc-text-field-wrapper{padding:0;background:transparent}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-flex{padding:0;align-items:center}:host(.sd-bare) ::ng-deep .mdc-notched-outline{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}:host(.sd-bare) ::ng-deep .mat-mdc-select-arrow-wrapper{display:none}.sd-select-tooltip{white-space:pre-line}::ng-deep .sd-select-panel .sd-read-state-anchor{display:none}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual{max-height:none;overflow:hidden}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .sd-select-virtual-viewport{width:100%}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .sd-select-virtual-viewport .mat-mdc-option{min-height:0!important;padding-top:0!important;padding-bottom:0!important;box-sizing:border-box}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .sd-select-virtual-viewport .mat-mdc-option .mdc-list-item__primary-text,::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .sd-select-virtual-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:normal}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .mat-mdc-option.sd-virtual-active{background-color:var(--mat-option-focus-state-layer-color, rgba(0, 0, 0, .12))}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .mat-mdc-option.mat-mdc-option-active:not(.sd-virtual-active):not(:hover){background-color:transparent}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .sd-virtual-sentinel{display:none!important}::ng-deep .sd-select-panel .sd-read-state-region{container:sd-read-panel/inline-size;box-sizing:border-box;width:100%;min-width:0;text-align:center}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact{display:flex;flex-direction:column;align-items:center;min-height:120px;padding:20px 16px;text-align:center}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__symbol{margin:0 0 8px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__message{max-width:100%}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__actions{justify-content:center}@container sd-read-panel (max-width: 220px){::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact{padding:8px 10px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__symbol{width:24px;height:24px;margin-bottom:4px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__message{line-height:var(--sd-line-height-18, 18px)}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__actions{margin-top:6px}}\n"], dependencies: [{ kind: "component", type: SdDataState, selector: "sd-data-state", inputs: ["state", "title", "message", "icon", "fontSet", "iconShape", "retryable", "retryLabel", "actionLabel", "compact", "fullPage"], outputs: ["sdRetry", "sdAction"] }, { kind: "directive", type: SdDataStateTemplateDirective, selector: "ng-template[sdDataStateTemplate]" }, { kind: "directive", type: SdTooltipDirective, selector: "[sdTooltip]", inputs: ["sdTooltip", "sdTooltipPosition", "sdTooltipDelay", "sdTooltipColor"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i5.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatPseudoCheckbox, selector: "mat-pseudo-checkbox", inputs: ["state", "disabled", "appearance"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i6.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText", "for", "labelId"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate", "selectedItems"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i7.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i7.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i7.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
997
1482
|
}
|
|
998
1483
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSelect, decorators: [{
|
|
999
1484
|
type: Component,
|
|
1000
|
-
args: [{ selector: 'sd-select', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, host: {
|
|
1485
|
+
args: [{ selector: 'sd-select', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, host: {
|
|
1486
|
+
'[class.sd-bare]': 'isInline()',
|
|
1487
|
+
'[class.sd-viewed]': 'isViewed() || isInline()',
|
|
1488
|
+
'[class.sd-has-label]': '!!label()',
|
|
1489
|
+
'[class.sd-label-top]': "labelPlacement() === 'top'",
|
|
1490
|
+
}, imports: [
|
|
1001
1491
|
SdDataState,
|
|
1002
1492
|
SdDataStateTemplateDirective,
|
|
1003
1493
|
SdTooltipDirective,
|
|
@@ -1015,8 +1505,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
1015
1505
|
SdView,
|
|
1016
1506
|
SdSelectFooterActionDirective,
|
|
1017
1507
|
SdTranslatePipe,
|
|
1018
|
-
], template: "@let _loading = loading();\n@let _readState = readState();\n@let _hideReadError = hideReadError();\n@let _selectedItems = selectedItems();\n@let _tooltip = tooltip();\n@let _label = label();\n@let _appearance = appearance();\n@let _hideInlineError = hideInlineError();\n@let _errorMessage = errorMessage();\n@let _helperText = helperText();\n@let _multiple = multiple();\n@let _required = required();\n@let _normalizedValue = $any(normalizedValue());\n@let _focused = $any(focused());\n@let _isInline = isInline();\n@let _bare = _isInline;\n@let _hasValue = _multiple ? !!_normalizedValue?.length : _normalizedValue !== undefined && _normalizedValue !== null;\n@let _display = display();\n@let _size = size();\n@let _floatLabel = floatLabel();\n@let _valueField = valueField();\n@let _displayField = displayField();\n@let _autoId = autoId();\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\n@let _errorVisible = !!_errorMessage && formControl.touched;\n@let _showInlineError = !_hideInlineError && _errorVisible;\n\n<ng-template #selectionTooltip>\n <div class=\"sd-select-tooltip\">{{ _tooltip }}</div>\n</ng-template>\n\n@if (isViewed()) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_normalizedValue\"\n [display]=\"_display\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\"\n [selectedItems]=\"_selectedItems\">\n </sd-view>\n} @else {\n @if (_isInline) {\n <!-- why: inline \u2014 sd-view text l\u00E0 \"m\u1EB7t\" + trigger; editor v\u1EABn render b\u00EAn d\u01B0\u1EDBi (chrome \u1EA9n qua\n .sd-inline-editor) \u0111\u1EC3 m\u1EDF panel. Text gi\u1EEF nguy\u00EAn, ch\u1EC9 \u0111\u1ED5i khi commit gi\u00E1 tr\u1ECB m\u1EDBi. -->\n <span\n class=\"sd-inline-view\"\n [sdTooltip]=\"_multiple && _tooltip ? selectionTooltip : ''\"\n sdTooltipPosition=\"top\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"enterInlineEdit()\"\n (keydown.enter)=\"enterInlineEdit()\">\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_normalizedValue\"\n [display]=\"_display\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\"\n [selectedItems]=\"_selectedItems\">\n </sd-view>\n\n <!-- why: clear-\u00D7 ch\u1EC9 hi\u1EC7n khi hover (CSS), \u0111\u1EB7t CU\u1ED0I face + clear($event) stopPropagation \u2192\n xo\u00E1 gi\u00E1 tr\u1ECB m\u00E0 KH\u00D4NG m\u1EDF panel; tr\u00E1nh bug c\u0169 (\u00D7 s\u00E1t trigger b\u1ECB b\u1EA5m nh\u1EA7m l\u00FAc \u0111\u00F3ng panel). -->\n @if (clearable() && _hasValue && !_required && !formControl.disabled) {\n <button type=\"button\" class=\"sd-inline-clear\" (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </span>\n }\n\n @if (!_appearance) {\n <ng-content select=\"[sdLabel]\">\n @if (_label) {\n <sd-label [label]=\"_label\" [required]=\"_required\"></sd-label>\n }\n </ng-content>\n }\n\n <!-- why: div ch\u1EC9 l\u00E0 h\u1ED9p layout. aria-hidden=\"true\" c\u0169 \u1EA9n C\u1EA2 c\u00E2y con \u2014 label, <mat-select>,\n <mat-error>, n\u00FAt clear \u2014 kh\u1ECFi accessibility tree. role=\"presentation\" ch\u1EC9 v\u00F4 hi\u1EC7u ho\u00E1\n ch\u00EDnh div, KH\u00D4NG lan xu\u1ED1ng con; (click) l\u00E0 ti\u1EC7n \u00EDch chu\u1ED9t, b\u00E0n ph\u00EDm Tab th\u1EB3ng v\u00E0o\n <mat-select> v\u00E0 (focusin) \u0111\u00E3 lo ph\u1EA7n updatePanelWidth() t\u01B0\u01A1ng \u1EE9ng. -->\n <div\n class=\"d-flex align-items-center\"\n role=\"presentation\"\n [class.sd-inline-editor]=\"_isInline\"\n [class.c-focused]=\"_focused\"\n [class.c-disabled]=\"formControl.disabled\"\n (click)=\"onClick()\"\n (mouseenter)=\"updatePanelWidth()\"\n (focusin)=\"updatePanelWidth()\">\n @if (_multiple) {\n <mat-form-field\n [sdTooltip]=\"_tooltip ? selectionTooltip : ''\"\n sdTooltipPosition=\"top\"\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [appearance]=\"_appearance!\"\n [floatLabel]=\"_floatLabel\">\n @if (_appearance && _label) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <mat-select\n #select\n multiple\n [formControl]=\"formControl\"\n [placeholder]=\"placeholder() || _label || ''\"\n (selectionChange)=\"onSelectionChange($event)\"\n disableOptionCentering=\"true\"\n [panelWidth]=\"calculatedPanelWidth()\"\n [panelClass]=\"['sd-select-panel', 'sd-multiple']\"\n [class.sd-selected]=\"!_required && _normalizedValue?.length\"\n [required]=\"_required\"\n (openedChange)=\"onOpenedChange($event)\"\n [attr.data-autoId]=\"_autoId\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-loading]=\"dataLoading()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\">\n <mat-select-trigger>\n @if (sdSelectedTemplate(); as _selTpl) {\n <ng-container\n *ngTemplateOutlet=\"\n _selTpl;\n context: { $implicit: _selectedItems, item: _selectedItems, items: _selectedItems, display: _display, multiple: true }\n \">\n </ng-container>\n } @else {\n <div class=\"sd-trigger-text\">\n {{ _display }}\n </div>\n }\n </mat-select-trigger>\n\n @if (filtered()) {\n <div class=\"c-filter-input-container\">\n <div class=\"filter-input-wrapper\">\n <sd-icon name=\"search\" aria-hidden=\"true\"></sd-icon>\n <!-- why: B\u1ECE aria-hidden \u2014 \u0111\u00E2y l\u00E0 \u00F4 l\u1ECDc TH\u1EACT, ng\u01B0\u1EDDi d\u00F9ng focus v\u00E0 g\u00F5 v\u00E0o \u0111\u01B0\u1EE3c, n\u00EAn\n aria-hidden ch\u1EC9 l\u00E0m screen reader c\u00E2m. Panel kh\u00F4ng c\u00F3 <label> n\u00E0o, n\u00EAn ph\u1EA3i\n t\u1EF1 \u0111\u1EB7t t\u00EAn b\u1EB1ng aria-label, n\u1EBFu kh\u00F4ng AT ch\u1EC9 \u0111\u1ECDc \"edit text\" tr\u1ED1ng tr\u01A1n. -->\n <input\n [formControl]=\"inputControl\"\n matInput\n autocomplete=\"off\"\n class=\"c-search-input\"\n [attr.aria-label]=\"'core.form.select.search' | sdTranslate\"\n (keydown)=\"focusReadRetry($event); $event.stopPropagation()\" />\n </div>\n </div>\n }\n\n <!-- why: row \"T\u1EA5t c\u1EA3\" KH\u00D4NG ph\u1EA3i mat-option th\u1EADt \u2014 n\u1EBFu l\u00E0 option, gi\u00E1 tr\u1ECB c\u1EE7a n\u00F3 l\u1ECDt v\u00E0o\n formControl.value v\u00E0 keyboard navigation c\u1EE7a mat-select. Nh\u01B0ng n\u00F3 ph\u1EA3i TR\u00D4NG y h\u1EC7t m\u1ED9t\n option: d\u00F9ng ch\u00EDnh <mat-pseudo-checkbox> + .mdc-list-item__primary-text m\u00E0 mat-option\n render, n\u00EAn \u0103n c\u00F9ng scale/margin (rule .sd-multiple) v\u00E0 c\u00F9ng m\u00E0u theme (panel mang\n class mat-primary) \u2014 mat-checkbox MDC th\u1EADt th\u00EC l\u1EC7ch c\u1ED9t v\u00E0 \u0103n accent c\u1EE7a theme.\n V\u00EC pseudo-checkbox l\u00E0 decorative + aria-hidden, ch\u00EDnh div mang role/aria/keyboard. -->\n @if (selectAllVisible()) {\n @let _selectAllState = selectAllState();\n <div\n class=\"sd-select-all-row\"\n role=\"checkbox\"\n tabindex=\"0\"\n [attr.aria-checked]=\"_selectAllState === 'indeterminate' ? 'mixed' : _selectAllState === 'checked'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-select-all' : null\"\n (click)=\"toggleSelectAll()\"\n (keydown.enter)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown.space)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown)=\"$event.stopPropagation()\">\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [state]=\"_selectAllState\"\n aria-hidden=\"true\"></mat-pseudo-checkbox>\n <span class=\"mdc-list-item__primary-text\">{{ 'core.form.select.selectAll' | sdTranslate }}</span>\n </div>\n }\n\n @if (!_loading && _readState.status === 'error') {\n <!-- why: MatSelect c\u1EA7n option tr\u1EF1c ti\u1EBFp \u0111\u1EC3 gi\u1EEF panel m\u1EDF khi ch\u1EC9 c\u00F3 l\u1ED7i. -->\n <mat-option disabled class=\"sd-read-state-anchor\" aria-hidden=\"true\"></mat-option>\n }\n @let _filteredItems = filteredItems();\n @if (_filteredItems) {\n @if (!_filteredItems.length && !_loading && _readState.status !== 'error') {\n <mat-option class=\"sd-empty\" disabled>\n <img class=\"sd-image-data-empty\" alt=\"empty-image\" style=\"width: 95px\" />\n </mat-option>\n } @else {\n @let iDefTpl = itemDef()?.templateRef;\n @if (_valueField && _displayField) {\n @for (item of _filteredItems; track itemValue(item)) {\n <mat-option [value]=\"itemValue(item)\" [disabled]=\"itemDisabled(item)\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ itemDisplay(item) }}\n }\n </div>\n </mat-option>\n }\n } @else if (!_valueField && !_displayField) {\n @for (item of _filteredItems; track item) {\n <mat-option [value]=\"item\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ item }}\n }\n </div>\n </mat-option>\n }\n }\n }\n }\n\n <ng-container [ngTemplateOutlet]=\"readRegion\"></ng-container>\n\n @if (_loading) {\n <mat-option disabled class=\"sd-loading-option\">\n <mat-spinner diameter=\"24\"></mat-spinner>\n </mat-option>\n }\n\n @let _visibleFooterActions = visibleFooterActions();\n @if (_visibleFooterActions.length) {\n <div class=\"sd-select-footer-actions\">\n @for (action of _visibleFooterActions; track action) {\n <ng-container *ngTemplateOutlet=\"action.templateRef; context: footerActionContext()\"> </ng-container>\n }\n </div>\n }\n </mat-select>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\n }\n\n <!-- why: <mat-error> ph\u1EA3i c\u00F3 id \u1ED4N \u0110\u1ECANH. MatFormField t\u1EF1 n\u1ED1i id n\u00E0y v\u00E0o aria-describedby\n c\u1EE7a <mat-select> (v\u00E0 host binding c\u1EE7a MatSelect lo aria-invalid), nh\u01B0ng ch\u1EC9 khi id\n t\u1ED3n t\u1EA1i \u2014 id auto-gen c\u1EE7a Material \u0111\u1ED5i theo t\u1EEBng instance n\u00EAn test/AT kh\u00F4ng b\u00E1m \u0111\u01B0\u1EE3c. -->\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n }\n\n @if (_normalizedValue?.length && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n } @else {\n <sd-icon class=\"cursor-pointer sd-suffix-icon\" matSuffix name=\"keyboard_arrow_down\"></sd-icon>\n }\n </mat-form-field>\n } @else {\n <mat-form-field\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [appearance]=\"_appearance!\"\n [floatLabel]=\"_floatLabel\">\n @if (_appearance && _label) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <mat-select\n #select\n [formControl]=\"formControl\"\n [placeholder]=\"placeholder() || _label || ''\"\n (selectionChange)=\"onSelectionChange($event)\"\n disableOptionCentering=\"true\"\n [panelWidth]=\"calculatedPanelWidth()\"\n [panelClass]=\"'sd-select-panel'\"\n [class.sd-selected]=\"!_required && _normalizedValue !== undefined && _normalizedValue !== null\"\n [required]=\"_required\"\n (openedChange)=\"onOpenedChange($event)\"\n [attr.data-autoId]=\"_autoId\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-loading]=\"dataLoading()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n matTooltipClass=\"sd-multiline-tooltip\"\n [matTooltipDisabled]=\"!formControl.disabled || !_normalizedValue?.length\"\n [matTooltip]=\"_tooltip || ''\">\n <mat-select-trigger>\n @if (sdSelectedTemplate(); as _selTpl) {\n <ng-container\n *ngTemplateOutlet=\"\n _selTpl;\n context: {\n $implicit: _selectedItems[0],\n item: _selectedItems[0],\n items: _selectedItems,\n display: _display,\n multiple: false,\n }\n \">\n </ng-container>\n } @else {\n {{ _display }}\n }\n </mat-select-trigger>\n\n @if (filtered()) {\n <div class=\"c-filter-input-container\">\n <div class=\"filter-input-wrapper\">\n <sd-icon name=\"search\" aria-hidden=\"true\"></sd-icon>\n <!-- why: B\u1ECE aria-hidden \u2014 \u0111\u00E2y l\u00E0 \u00F4 l\u1ECDc TH\u1EACT, ng\u01B0\u1EDDi d\u00F9ng focus v\u00E0 g\u00F5 v\u00E0o \u0111\u01B0\u1EE3c, n\u00EAn\n aria-hidden ch\u1EC9 l\u00E0m screen reader c\u00E2m. Panel kh\u00F4ng c\u00F3 <label> n\u00E0o, n\u00EAn ph\u1EA3i\n t\u1EF1 \u0111\u1EB7t t\u00EAn b\u1EB1ng aria-label, n\u1EBFu kh\u00F4ng AT ch\u1EC9 \u0111\u1ECDc \"edit text\" tr\u1ED1ng tr\u01A1n. -->\n <input\n [formControl]=\"inputControl\"\n matInput\n autocomplete=\"off\"\n class=\"c-search-input\"\n [attr.aria-label]=\"'core.form.select.search' | sdTranslate\"\n (keydown)=\"focusReadRetry($event); $event.stopPropagation()\" />\n </div>\n </div>\n }\n\n @if (!_loading && _readState.status === 'error') {\n <!-- why: MatSelect c\u1EA7n option tr\u1EF1c ti\u1EBFp \u0111\u1EC3 gi\u1EEF panel m\u1EDF khi ch\u1EC9 c\u00F3 l\u1ED7i. -->\n <mat-option disabled class=\"sd-read-state-anchor\" aria-hidden=\"true\"></mat-option>\n }\n @let _filteredItems = filteredItems();\n @if (_filteredItems) {\n @if (!_filteredItems.length && !_loading && _readState.status !== 'error') {\n <mat-option class=\"sd-empty\" disabled>\n <img class=\"sd-image-data-empty\" alt=\"empty-image\" style=\"width: 95px\" />\n </mat-option>\n } @else {\n @let iDefTpl = itemDef()?.templateRef;\n\n @if (_valueField && _displayField) {\n @for (item of _filteredItems; track itemValue(item)) {\n <mat-option [value]=\"itemValue(item)\" [disabled]=\"itemDisabled(item)\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ itemDisplay(item) }}\n }\n </div>\n </mat-option>\n }\n } @else if (!_valueField && !_displayField) {\n @for (item of _filteredItems; track item) {\n <mat-option [value]=\"item\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ item }}\n }\n </div>\n </mat-option>\n }\n }\n }\n }\n\n <ng-container [ngTemplateOutlet]=\"readRegion\"></ng-container>\n\n @if (_loading) {\n <mat-option disabled class=\"sd-loading-option\">\n <mat-spinner diameter=\"24\"></mat-spinner>\n </mat-option>\n }\n\n @let _visibleFooterActions = visibleFooterActions();\n @if (_visibleFooterActions.length) {\n <div class=\"sd-select-footer-actions\">\n @for (action of _visibleFooterActions; track action) {\n <ng-container *ngTemplateOutlet=\"action.templateRef; context: footerActionContext()\"> </ng-container>\n }\n </div>\n }\n </mat-select>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\n }\n\n <!-- why: <mat-error> ph\u1EA3i c\u00F3 id \u1ED4N \u0110\u1ECANH. MatFormField t\u1EF1 n\u1ED1i id n\u00E0y v\u00E0o aria-describedby\n c\u1EE7a <mat-select> (v\u00E0 host binding c\u1EE7a MatSelect lo aria-invalid), nh\u01B0ng ch\u1EC9 khi id\n t\u1ED3n t\u1EA1i \u2014 id auto-gen c\u1EE7a Material \u0111\u1ED5i theo t\u1EEBng instance n\u00EAn test/AT kh\u00F4ng b\u00E1m \u0111\u01B0\u1EE3c. -->\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n }\n\n @if (_normalizedValue !== undefined && _normalizedValue !== null && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n } @else {\n <sd-icon class=\"cursor-pointer sd-suffix-icon\" matSuffix name=\"keyboard_arrow_down\"></sd-icon>\n }\n </mat-form-field>\n }\n </div>\n}\n\n<ng-template #readRegion>\n <!-- why: VALUE/SEARCH gi\u1EEF l\u1ED7i \u0111\u1ED9c l\u1EADp; trong l\u00FAc k\u00EAnh kh\u00E1c \u0111ang \u0111\u1ECDc ch\u1EC9 hi\u1EC3n th\u1ECB loading. -->\n @if (!_loading && _readState.status === 'error') {\n <!-- why: n\u00FAt retry n\u1EB1m ngo\u00E0i mat-option \u0111\u1EC3 kh\u00F4ng tr\u1EDF th\u00E0nh m\u1ED9t l\u1EF1a ch\u1ECDn/form value. -->\n @if (!_hideReadError) {\n <div\n class=\"sd-read-state-region\"\n role=\"presentation\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onReadRegionKeydown($event)\">\n <sd-data-state state=\"error\" compact retryable (sdRetry)=\"retryRead()\">\n @if (dataStateTemplate(); as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n </div>\n }\n }\n</ng-template>\n", styles: ["@charset \"UTF-8\";.text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-primary-contrast{color:var(--sd-primary-contrast)!important}.bg-primary-contrast{background:var(--sd-primary-contrast)!important}.border-primary-contrast{border-color:var(--sd-primary-contrast)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-secondary-contrast{color:var(--sd-secondary-contrast)!important}.bg-secondary-contrast{background:var(--sd-secondary-contrast)!important}.border-secondary-contrast{border-color:var(--sd-secondary-contrast)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-info-contrast{color:var(--sd-info-contrast)!important}.bg-info-contrast{background:var(--sd-info-contrast)!important}.border-info-contrast{border-color:var(--sd-info-contrast)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-success-contrast{color:var(--sd-success-contrast)!important}.bg-success-contrast{background:var(--sd-success-contrast)!important}.border-success-contrast{border-color:var(--sd-success-contrast)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-warning-contrast{color:var(--sd-warning-contrast)!important}.bg-warning-contrast{background:var(--sd-warning-contrast)!important}.border-warning-contrast{border-color:var(--sd-warning-contrast)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-error-contrast{color:var(--sd-error-contrast)!important}.bg-error-contrast{background:var(--sd-error-contrast)!important}.border-error-contrast{border-color:var(--sd-error-contrast)!important}.text-surface{color:var(--sd-surface)!important}.bg-surface{background:var(--sd-surface)!important}.border-surface{border-color:var(--sd-surface)!important}.text-surface-muted{color:var(--sd-surface-muted)!important}.bg-surface-muted{background:var(--sd-surface-muted)!important}.border-surface-muted{border-color:var(--sd-surface-muted)!important}.text-text{color:var(--sd-text)!important}.bg-text{background:var(--sd-text)!important}.border-text{border-color:var(--sd-text)!important}.text-text-secondary{color:var(--sd-text-secondary)!important}.bg-text-secondary{background:var(--sd-text-secondary)!important}.border-text-secondary{border-color:var(--sd-text-secondary)!important}.text-text-muted{color:var(--sd-text-muted)!important}.bg-text-muted{background:var(--sd-text-muted)!important}.border-text-muted{border-color:var(--sd-text-muted)!important}.text-border{color:var(--sd-border)!important}.bg-border{background:var(--sd-border)!important}.border-border{border-color:var(--sd-border)!important}.text-border-strong{color:var(--sd-border-strong)!important}.bg-border-strong{background:var(--sd-border-strong)!important}.border-border-strong{border-color:var(--sd-border-strong)!important}.text-disabled-bg{color:var(--sd-disabled-bg)!important}.bg-disabled-bg{background:var(--sd-disabled-bg)!important}.border-disabled-bg{border-color:var(--sd-disabled-bg)!important}.text-disabled-text{color:var(--sd-disabled-text)!important}.bg-disabled-text{background:var(--sd-disabled-text)!important}.border-disabled-text{border-color:var(--sd-disabled-text)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}.text-secondary{color:var(--sd-text-secondary)!important}.text-muted{color:var(--sd-text-muted)!important}.text-body{color:var(--sd-text)!important}.bg-muted{background:var(--sd-surface-muted)!important}:host{display:block;max-width:100%}:host(.sd-has-label){padding-top:4px}:host(.sd-viewed){padding-top:0}::ng-deep .sd-loading-option{min-height:50px!important}::ng-deep .sd-loading-option .mat-pseudo-checkbox{display:none!important}::ng-deep .sd-loading-option .mdc-list-item__primary-text{width:100%;display:flex;justify-content:center;align-items:center}.sd-trigger-text{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host ::ng-deep .mat-mdc-select-value{max-width:100%;overflow:hidden;width:0;min-width:100%}:host ::ng-deep .sd-selected .mat-mdc-select-arrow{display:none}:host ::ng-deep .mat-mdc-select-arrow{display:none!important}:host ::ng-deep .custom-arrow{pointer-events:none;position:absolute;right:1rem;top:50%;transform:translateY(-50%);display:flex;align-items:center}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-disabled-bg)}:host ::ng-deep .mat-mdc-form-field mat-select.mat-mdc-select-disabled .mat-mdc-select-value{color:var(--sd-disabled-text)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}::ng-deep .sd-select-panel .mat-mdc-option.sd-empty .mat-pseudo-checkbox{display:none}::ng-deep .sd-select-panel .mat-mdc-option{min-height:36px!important;padding:8px 12px!important}::ng-deep .sd-select-panel .c-filter-input-container{position:sticky;top:0;background-color:#fff;box-shadow:0 1px #f2f2f2;padding:8px;margin-bottom:8px;z-index:1000}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper{display:flex;align-items:center;padding:4px 8px;border:1px solid var(--sd-border);border-radius:4px;background-color:#fff}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper sd-icon{color:#dadada}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper .c-search-input{min-width:0;width:100%;background-color:#fff;border:none;outline:none;flex:1;padding:4px}::ng-deep .sd-select-panel .sd-select-footer-actions{position:sticky;bottom:0;z-index:1000;display:flex;flex-direction:column;gap:4px;border-top:1px solid #f2f2f2;background-color:#fff}::ng-deep .sd-select-panel .sd-select-all-row{display:flex;align-items:center;justify-content:flex-start;min-height:36px;padding:8px 12px;cursor:pointer;-webkit-user-select:none;user-select:none;border-bottom:1px solid var(--sd-border, #f2f2f2)}::ng-deep .sd-select-panel .sd-select-all-row:hover,::ng-deep .sd-select-panel .sd-select-all-row:focus-visible{background-color:var(--mat-option-hover-state-layer-color, rgba(0, 0, 0, .04));outline:none}::ng-deep .sd-select-panel .sd-select-all-row .mdc-list-item__primary-text{font-size:14px;white-space:normal}::ng-deep .sd-multiline-tooltip{white-space:pre-line}::ng-deep .mat-mdc-select-panel.sd-select-panel{padding:0}::ng-deep .mat-mdc-select-panel.sd-select-panel .mat-mdc-option.mdc-list-item--disabled.sd-empty .mdc-list-item__primary-text{opacity:.8;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px}::ng-deep .sd-select-panel .mat-pseudo-checkbox-minimal{transform:scale(.7);transform-origin:center right}::ng-deep .sd-select-panel.sd-multiple .mat-pseudo-checkbox{transform:scale(.75);margin-right:8px!important}::ng-deep .sd-select-panel.sd-multiple .mdc-list-item__primary-text{font-size:14px;white-space:normal}::ng-deep .mat-mdc-select-panel.sd-select-panel{max-width:90vw!important}::ng-deep .mat-mdc-select-panel.sd-select-panel .mat-mdc-option .mdc-list-item__primary-text{white-space:normal;word-break:break-word;line-height:1.4}:host(.sd-bare){display:inline-flex;align-items:center}:host(.sd-bare){position:relative}.sd-inline-view{cursor:pointer;display:inline-flex;align-items:center;width:100%;padding:1px 6px;border-radius:4px;background-color:#0000000a;transition:background-color .15s ease}.sd-inline-view:hover{background-color:#00000014}.sd-inline-view .sd-inline-clear{display:none;align-items:center;margin-left:4px;padding:0;border:0;background:transparent;cursor:pointer;line-height:0;color:var(--sd-text-secondary, #6b7280);transition:color .15s ease}.sd-inline-view .sd-inline-clear sd-icon{font-size:16px;width:16px;height:16px}.sd-inline-view .sd-inline-clear:hover{color:var(--sd-error, #b32626)}.sd-inline-view:hover .sd-inline-clear{display:inline-flex}.sd-inline-editor{position:absolute;inset:0;opacity:0;pointer-events:none}.sd-inline-editor ::ng-deep *{pointer-events:none!important}:host(.sd-bare) ::ng-deep .mat-mdc-form-field{width:auto}:host(.sd-bare) ::ng-deep .mat-mdc-text-field-wrapper{padding:0;background:transparent}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-flex{padding:0;align-items:center}:host(.sd-bare) ::ng-deep .mdc-notched-outline{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}:host(.sd-bare) ::ng-deep .mat-mdc-select-arrow-wrapper{display:none}.sd-select-tooltip{white-space:pre-line}::ng-deep .sd-select-panel .sd-read-state-anchor{display:none}::ng-deep .sd-select-panel .sd-read-state-region{container:sd-read-panel/inline-size;box-sizing:border-box;width:100%;min-width:0;text-align:center}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact{display:flex;flex-direction:column;align-items:center;min-height:120px;padding:20px 16px;text-align:center}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__symbol{margin:0 0 8px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__message{max-width:100%}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__actions{justify-content:center}@container sd-read-panel (max-width: 220px){::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact{padding:8px 10px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__symbol{width:24px;height:24px;margin-bottom:4px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__icon{width:18px;height:18px;font-size:18px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__message{line-height:18px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__actions{margin-top:6px}}\n"] }]
|
|
1019
|
-
}], ctorParameters: () => [], propDecorators: { matInputRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatInput), { isSignal: true }] }], selectRef: [{ type: i0.ViewChild, args: ['select', { isSignal: true }] }], sdLabelTemplate: [{ type: i0.ContentChild, args: ['sdLabel', { isSignal: true }] }], sdValueTemplate: [{ type: i0.ContentChild, args: ['sdValue', { isSignal: true }] }], sdSelectedTemplate: [{ type: i0.ContentChild, args: ['sdSelected', { isSignal: true }] }], itemDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdItemDefDefDirective), { isSignal: true }] }], sdViewDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdViewDefDirective), { isSignal: true }] }], footerActions: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdSelectFooterActionDirective), { isSignal: true }] }], autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], displayField: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayField", required: false }] }], disabledField: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledField", required: false }] }], cacheChecksum: [{ type: i0.Input, args: [{ isSignal: true, alias: "cacheChecksum", required: false }] }], limit: [{ type: i0.Input, args: [{ isSignal: true, alias: "limit", required: false }] }], hyperlink: [{ type: i0.Input, args: [{ isSignal: true, alias: "hyperlink", required: false }] }], minWidthPanel: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidthPanel", required: false }] }], hideInlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideInlineError", required: false }] }], hideReadError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideReadError", required: false }] }], dataStateTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdDataStateTemplateDirective), { isSignal: true }] }], sdReadStateChange: [{ type: i0.Output, args: ["sdReadStateChange"] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], viewed: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewed", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showSelectAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSelectAll", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], validator: [{ type: i0.Input, args: [{ isSignal: true, alias: "validator", required: false }] }], inlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineError", required: false }] }], appearanceInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], valueModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }], sdSelection: [{ type: i0.Output, args: ["sdSelection"] }] } });
|
|
1508
|
+
ScrollingModule,
|
|
1509
|
+
], template: "@let _loading = loading();\n@let _readState = readState();\n@let _hideReadError = hideReadError();\n@let _selectedItems = selectedItems();\n@let _tooltip = tooltip();\n@let _label = label();\n@let _appearance = appearance();\n@let _hideInlineError = hideInlineError();\n@let _errorMessage = errorMessage();\n@let _helperText = helperText();\n@let _multiple = multiple();\n@let _required = required();\n@let _normalizedValue = $any(normalizedValue());\n@let _focused = $any(focused());\n@let _isInline = isInline();\n@let _labelTop = labelPlacement() === 'top';\n@let _placeholder = placeholder() || (_labelTop ? '' : _label) || '';\n@let _bare = _isInline;\n@let _hasValue = _multiple ? !!_normalizedValue?.length : _normalizedValue !== undefined && _normalizedValue !== null;\n@let _display = display();\n@let _size = size();\n@let _floatLabel = floatLabel();\n@let _valueField = valueField();\n@let _displayField = displayField();\n@let _autoId = autoId();\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\n@let _errorVisible = !!_errorMessage && formControl.touched;\n@let _showInlineError = !_hideInlineError && _errorVisible;\n\n<ng-template #selectionTooltip>\n <div class=\"sd-select-tooltip\">{{ _tooltip }}</div>\n</ng-template>\n\n@if (isViewed()) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_normalizedValue\"\n [display]=\"_display\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\"\n [selectedItems]=\"_selectedItems\">\n </sd-view>\n} @else {\n @if (_isInline) {\n <!-- why: inline \u2014 sd-view text l\u00E0 \"m\u1EB7t\" + trigger; editor v\u1EABn render b\u00EAn d\u01B0\u1EDBi (chrome \u1EA9n qua\n .sd-inline-editor) \u0111\u1EC3 m\u1EDF panel. Text gi\u1EEF nguy\u00EAn, ch\u1EC9 \u0111\u1ED5i khi commit gi\u00E1 tr\u1ECB m\u1EDBi. -->\n <span\n class=\"sd-inline-view\"\n [sdTooltip]=\"_multiple && _tooltip ? selectionTooltip : ''\"\n sdTooltipPosition=\"top\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"enterInlineEdit()\"\n (keydown.enter)=\"enterInlineEdit()\">\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_normalizedValue\"\n [display]=\"_display\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\"\n [selectedItems]=\"_selectedItems\">\n </sd-view>\n\n <!-- why: clear-\u00D7 ch\u1EC9 hi\u1EC7n khi hover (CSS), \u0111\u1EB7t CU\u1ED0I face + clear($event) stopPropagation \u2192\n xo\u00E1 gi\u00E1 tr\u1ECB m\u00E0 KH\u00D4NG m\u1EDF panel; tr\u00E1nh bug c\u0169 (\u00D7 s\u00E1t trigger b\u1ECB b\u1EA5m nh\u1EA7m l\u00FAc \u0111\u00F3ng panel). -->\n @if (clearable() && _hasValue && !_required && !formControl.disabled) {\n <button type=\"button\" class=\"sd-inline-clear\" (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </span>\n }\n\n @if (!_appearance || _labelTop) {\n <ng-content select=\"[sdLabel]\">\n @if (_label) {\n <!-- why: mat-select kh\u00F4ng \"labelable\" n\u00EAn nh\u00E3n r\u1EDDi d\u00F9ng id + aria-labelledby, c\u00F2n click\n nh\u00E3n th\u00EC t\u1EF1 focus control (t\u01B0\u01A1ng \u0111\u01B0\u01A1ng <label for>). -->\n <sd-label\n [label]=\"_label\"\n [required]=\"_required\"\n [labelId]=\"_labelTop ? labelId : null\"\n (click)=\"_labelTop && onLabelClick()\"></sd-label>\n }\n </ng-content>\n }\n\n <!-- why: div ch\u1EC9 l\u00E0 h\u1ED9p layout. aria-hidden=\"true\" c\u0169 \u1EA9n C\u1EA2 c\u00E2y con \u2014 label, <mat-select>,\n <mat-error>, n\u00FAt clear \u2014 kh\u1ECFi accessibility tree. role=\"presentation\" ch\u1EC9 v\u00F4 hi\u1EC7u ho\u00E1\n ch\u00EDnh div, KH\u00D4NG lan xu\u1ED1ng con; (click) l\u00E0 ti\u1EC7n \u00EDch chu\u1ED9t, b\u00E0n ph\u00EDm Tab th\u1EB3ng v\u00E0o\n <mat-select> v\u00E0 (focusin) \u0111\u00E3 lo ph\u1EA7n updatePanelWidth() t\u01B0\u01A1ng \u1EE9ng. -->\n <div\n class=\"d-flex align-items-center\"\n role=\"presentation\"\n [class.sd-inline-editor]=\"_isInline\"\n [class.c-focused]=\"_focused\"\n [class.c-disabled]=\"formControl.disabled\"\n (click)=\"onClick()\"\n (mouseenter)=\"updatePanelWidth()\"\n (focusin)=\"updatePanelWidth()\">\n <!-- why: virtualScroll (opt-in) gets its own branch; the 2.15 branches below are unchanged. The\n @if recreates the field when `multiple` changes, because mat-select cannot switch it later. -->\n @if (virtualScroll()) {\n @if (_multiple) {\n <ng-container *ngTemplateOutlet=\"virtualField; context: { $implicit: true }\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"virtualField; context: { $implicit: false }\"></ng-container>\n }\n } @else if (_multiple) {\n <mat-form-field\n [sdTooltip]=\"_tooltip ? selectionTooltip : ''\"\n sdTooltipPosition=\"top\"\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [class.sd-label-top]=\"_labelTop\"\n [appearance]=\"_appearance!\"\n [floatLabel]=\"_floatLabel\">\n @if (_appearance && _label && !_labelTop) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <mat-select\n #select\n [aria-labelledby]=\"_labelTop ? labelId : null\"\n multiple\n [formControl]=\"formControl\"\n [placeholder]=\"_placeholder\"\n (selectionChange)=\"onSelectionChange($event)\"\n disableOptionCentering=\"true\"\n [panelWidth]=\"calculatedPanelWidth()\"\n [panelClass]=\"['sd-select-panel', 'sd-multiple']\"\n [class.sd-selected]=\"!_required && _normalizedValue?.length\"\n [required]=\"_required\"\n (openedChange)=\"onOpenedChange($event)\"\n [attr.data-autoId]=\"_autoId\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-loading]=\"dataLoading()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\">\n <mat-select-trigger>\n @if (sdSelectedTemplate(); as _selTpl) {\n <ng-container\n *ngTemplateOutlet=\"\n _selTpl;\n context: { $implicit: _selectedItems, item: _selectedItems, items: _selectedItems, display: _display, multiple: true }\n \">\n </ng-container>\n } @else {\n <div class=\"sd-trigger-text\">\n {{ _display }}\n </div>\n }\n </mat-select-trigger>\n\n @if (filtered()) {\n <div class=\"c-filter-input-container\">\n <div class=\"filter-input-wrapper\">\n <sd-icon name=\"search\" aria-hidden=\"true\"></sd-icon>\n <!-- why: B\u1ECE aria-hidden \u2014 \u0111\u00E2y l\u00E0 \u00F4 l\u1ECDc TH\u1EACT, ng\u01B0\u1EDDi d\u00F9ng focus v\u00E0 g\u00F5 v\u00E0o \u0111\u01B0\u1EE3c, n\u00EAn\n aria-hidden ch\u1EC9 l\u00E0m screen reader c\u00E2m. Panel kh\u00F4ng c\u00F3 <label> n\u00E0o, n\u00EAn ph\u1EA3i\n t\u1EF1 \u0111\u1EB7t t\u00EAn b\u1EB1ng aria-label, n\u1EBFu kh\u00F4ng AT ch\u1EC9 \u0111\u1ECDc \"edit text\" tr\u1ED1ng tr\u01A1n. -->\n <input\n [formControl]=\"inputControl\"\n matInput\n autocomplete=\"off\"\n class=\"c-search-input\"\n [attr.aria-label]=\"'core.form.select.search' | sdTranslate\"\n (keydown)=\"focusReadRetry($event); $event.stopPropagation()\" />\n </div>\n </div>\n }\n\n <!-- why: row \"T\u1EA5t c\u1EA3\" KH\u00D4NG ph\u1EA3i mat-option th\u1EADt \u2014 n\u1EBFu l\u00E0 option, gi\u00E1 tr\u1ECB c\u1EE7a n\u00F3 l\u1ECDt v\u00E0o\n formControl.value v\u00E0 keyboard navigation c\u1EE7a mat-select. Nh\u01B0ng n\u00F3 ph\u1EA3i TR\u00D4NG y h\u1EC7t m\u1ED9t\n option: d\u00F9ng ch\u00EDnh <mat-pseudo-checkbox> + .mdc-list-item__primary-text m\u00E0 mat-option\n render, n\u00EAn \u0103n c\u00F9ng scale/margin (rule .sd-multiple) v\u00E0 c\u00F9ng m\u00E0u theme (panel mang\n class mat-primary) \u2014 mat-checkbox MDC th\u1EADt th\u00EC l\u1EC7ch c\u1ED9t v\u00E0 \u0103n accent c\u1EE7a theme.\n V\u00EC pseudo-checkbox l\u00E0 decorative + aria-hidden, ch\u00EDnh div mang role/aria/keyboard. -->\n @if (selectAllVisible()) {\n @let _selectAllState = selectAllState();\n <div\n class=\"sd-select-all-row\"\n role=\"checkbox\"\n tabindex=\"0\"\n [attr.aria-checked]=\"_selectAllState === 'indeterminate' ? 'mixed' : _selectAllState === 'checked'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-select-all' : null\"\n (click)=\"toggleSelectAll()\"\n (keydown.enter)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown.space)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown)=\"$event.stopPropagation()\">\n <mat-pseudo-checkbox\n class=\"mat-mdc-option-pseudo-checkbox\"\n [state]=\"_selectAllState\"\n aria-hidden=\"true\"></mat-pseudo-checkbox>\n <span class=\"mdc-list-item__primary-text\">{{ 'core.form.select.selectAll' | sdTranslate }}</span>\n </div>\n }\n\n @if (!_loading && _readState.status === 'error') {\n <!-- why: MatSelect c\u1EA7n option tr\u1EF1c ti\u1EBFp \u0111\u1EC3 gi\u1EEF panel m\u1EDF khi ch\u1EC9 c\u00F3 l\u1ED7i. -->\n <mat-option disabled class=\"sd-read-state-anchor\" aria-hidden=\"true\"></mat-option>\n }\n @let _filteredItems = filteredItems();\n @if (_filteredItems) {\n @if (!_filteredItems.length && !_loading && _readState.status !== 'error') {\n <mat-option class=\"sd-empty\" disabled>\n <img class=\"sd-image-data-empty\" alt=\"empty-image\" style=\"width: 95px\" />\n </mat-option>\n } @else {\n @let iDefTpl = itemDef()?.templateRef;\n @if (_valueField && _displayField) {\n @for (item of _filteredItems; track itemValue(item)) {\n <mat-option [value]=\"itemValue(item)\" [disabled]=\"itemDisabled(item)\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ itemDisplay(item) }}\n }\n </div>\n </mat-option>\n }\n } @else if (!_valueField && !_displayField) {\n @for (item of _filteredItems; track item) {\n <mat-option [value]=\"item\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ item }}\n }\n </div>\n </mat-option>\n }\n }\n }\n }\n\n <ng-container [ngTemplateOutlet]=\"readRegion\"></ng-container>\n\n @if (_loading) {\n <mat-option disabled class=\"sd-loading-option\">\n <mat-spinner diameter=\"24\"></mat-spinner>\n </mat-option>\n }\n\n @let _visibleFooterActions = visibleFooterActions();\n @if (_visibleFooterActions.length) {\n <div class=\"sd-select-footer-actions\">\n @for (action of _visibleFooterActions; track action) {\n <ng-container *ngTemplateOutlet=\"action.templateRef; context: footerActionContext()\"> </ng-container>\n }\n </div>\n }\n </mat-select>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\n }\n\n <!-- why: <mat-error> ph\u1EA3i c\u00F3 id \u1ED4N \u0110\u1ECANH. MatFormField t\u1EF1 n\u1ED1i id n\u00E0y v\u00E0o aria-describedby\n c\u1EE7a <mat-select> (v\u00E0 host binding c\u1EE7a MatSelect lo aria-invalid), nh\u01B0ng ch\u1EC9 khi id\n t\u1ED3n t\u1EA1i \u2014 id auto-gen c\u1EE7a Material \u0111\u1ED5i theo t\u1EEBng instance n\u00EAn test/AT kh\u00F4ng b\u00E1m \u0111\u01B0\u1EE3c. -->\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n } @else if (_labelTop && _helperText) {\n <mat-hint [id]=\"hintId\">{{ _helperText }}</mat-hint>\n }\n\n @if (_normalizedValue?.length && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n } @else {\n <sd-icon class=\"cursor-pointer sd-suffix-icon\" matSuffix name=\"keyboard_arrow_down\"></sd-icon>\n }\n </mat-form-field>\n } @else {\n <mat-form-field\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [class.sd-label-top]=\"_labelTop\"\n [appearance]=\"_appearance!\"\n [floatLabel]=\"_floatLabel\">\n @if (_appearance && _label && !_labelTop) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <mat-select\n #select\n [aria-labelledby]=\"_labelTop ? labelId : null\"\n [formControl]=\"formControl\"\n [placeholder]=\"_placeholder\"\n (selectionChange)=\"onSelectionChange($event)\"\n disableOptionCentering=\"true\"\n [panelWidth]=\"calculatedPanelWidth()\"\n [panelClass]=\"'sd-select-panel'\"\n [class.sd-selected]=\"!_required && _normalizedValue !== undefined && _normalizedValue !== null\"\n [required]=\"_required\"\n (openedChange)=\"onOpenedChange($event)\"\n [attr.data-autoId]=\"_autoId\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-loading]=\"dataLoading()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n matTooltipClass=\"sd-multiline-tooltip\"\n [matTooltipDisabled]=\"!formControl.disabled || !_normalizedValue?.length\"\n [matTooltip]=\"_tooltip || ''\">\n <mat-select-trigger>\n @if (sdSelectedTemplate(); as _selTpl) {\n <ng-container\n *ngTemplateOutlet=\"\n _selTpl;\n context: {\n $implicit: _selectedItems[0],\n item: _selectedItems[0],\n items: _selectedItems,\n display: _display,\n multiple: false,\n }\n \">\n </ng-container>\n } @else {\n {{ _display }}\n }\n </mat-select-trigger>\n\n @if (filtered()) {\n <div class=\"c-filter-input-container\">\n <div class=\"filter-input-wrapper\">\n <sd-icon name=\"search\" aria-hidden=\"true\"></sd-icon>\n <!-- why: B\u1ECE aria-hidden \u2014 \u0111\u00E2y l\u00E0 \u00F4 l\u1ECDc TH\u1EACT, ng\u01B0\u1EDDi d\u00F9ng focus v\u00E0 g\u00F5 v\u00E0o \u0111\u01B0\u1EE3c, n\u00EAn\n aria-hidden ch\u1EC9 l\u00E0m screen reader c\u00E2m. Panel kh\u00F4ng c\u00F3 <label> n\u00E0o, n\u00EAn ph\u1EA3i\n t\u1EF1 \u0111\u1EB7t t\u00EAn b\u1EB1ng aria-label, n\u1EBFu kh\u00F4ng AT ch\u1EC9 \u0111\u1ECDc \"edit text\" tr\u1ED1ng tr\u01A1n. -->\n <input\n [formControl]=\"inputControl\"\n matInput\n autocomplete=\"off\"\n class=\"c-search-input\"\n [attr.aria-label]=\"'core.form.select.search' | sdTranslate\"\n (keydown)=\"focusReadRetry($event); $event.stopPropagation()\" />\n </div>\n </div>\n }\n\n @if (!_loading && _readState.status === 'error') {\n <!-- why: MatSelect c\u1EA7n option tr\u1EF1c ti\u1EBFp \u0111\u1EC3 gi\u1EEF panel m\u1EDF khi ch\u1EC9 c\u00F3 l\u1ED7i. -->\n <mat-option disabled class=\"sd-read-state-anchor\" aria-hidden=\"true\"></mat-option>\n }\n @let _filteredItems = filteredItems();\n @if (_filteredItems) {\n @if (!_filteredItems.length && !_loading && _readState.status !== 'error') {\n <mat-option class=\"sd-empty\" disabled>\n <img class=\"sd-image-data-empty\" alt=\"empty-image\" style=\"width: 95px\" />\n </mat-option>\n } @else {\n @let iDefTpl = itemDef()?.templateRef;\n\n @if (_valueField && _displayField) {\n @for (item of _filteredItems; track itemValue(item)) {\n <mat-option [value]=\"itemValue(item)\" [disabled]=\"itemDisabled(item)\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ itemDisplay(item) }}\n }\n </div>\n </mat-option>\n }\n } @else if (!_valueField && !_displayField) {\n @for (item of _filteredItems; track item) {\n <mat-option [value]=\"item\">\n <div>\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl ?? null; context: { item: item }\"> </ng-container>\n } @else {\n {{ item }}\n }\n </div>\n </mat-option>\n }\n }\n }\n }\n\n <ng-container [ngTemplateOutlet]=\"readRegion\"></ng-container>\n\n @if (_loading) {\n <mat-option disabled class=\"sd-loading-option\">\n <mat-spinner diameter=\"24\"></mat-spinner>\n </mat-option>\n }\n\n @let _visibleFooterActions = visibleFooterActions();\n @if (_visibleFooterActions.length) {\n <div class=\"sd-select-footer-actions\">\n @for (action of _visibleFooterActions; track action) {\n <ng-container *ngTemplateOutlet=\"action.templateRef; context: footerActionContext()\"> </ng-container>\n }\n </div>\n }\n </mat-select>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\n }\n\n <!-- why: <mat-error> ph\u1EA3i c\u00F3 id \u1ED4N \u0110\u1ECANH. MatFormField t\u1EF1 n\u1ED1i id n\u00E0y v\u00E0o aria-describedby\n c\u1EE7a <mat-select> (v\u00E0 host binding c\u1EE7a MatSelect lo aria-invalid), nh\u01B0ng ch\u1EC9 khi id\n t\u1ED3n t\u1EA1i \u2014 id auto-gen c\u1EE7a Material \u0111\u1ED5i theo t\u1EEBng instance n\u00EAn test/AT kh\u00F4ng b\u00E1m \u0111\u01B0\u1EE3c. -->\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n } @else if (_labelTop && _helperText) {\n <mat-hint [id]=\"hintId\">{{ _helperText }}</mat-hint>\n }\n\n @if (_normalizedValue !== undefined && _normalizedValue !== null && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n } @else {\n <sd-icon class=\"cursor-pointer sd-suffix-icon\" matSuffix name=\"keyboard_arrow_down\"></sd-icon>\n }\n </mat-form-field>\n }\n </div>\n}\n\n<ng-template #readRegion>\n <!-- why: VALUE/SEARCH gi\u1EEF l\u1ED7i \u0111\u1ED9c l\u1EADp; trong l\u00FAc k\u00EAnh kh\u00E1c \u0111ang \u0111\u1ECDc ch\u1EC9 hi\u1EC3n th\u1ECB loading. -->\n @if (!_loading && _readState.status === 'error') {\n <!-- why: n\u00FAt retry n\u1EB1m ngo\u00E0i mat-option \u0111\u1EC3 kh\u00F4ng tr\u1EDF th\u00E0nh m\u1ED9t l\u1EF1a ch\u1ECDn/form value. -->\n @if (!_hideReadError) {\n <div\n class=\"sd-read-state-region\"\n role=\"presentation\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onReadRegionKeydown($event)\">\n <sd-data-state state=\"error\" compact retryable (sdRetry)=\"retryRead()\">\n @if (dataStateTemplate(); as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n </div>\n }\n }\n</ng-template>\n\n<!-- Virtual scroll branch (D-026, D-030 V1). mat-select is only the shell: it gets the value one way\n ([value] + virtualCompareWith) and never a formControl \u2014 the component owns the value, the keyboard\n over the whole list and aria-activedescendant. Rows are real mat-options inside a CDK viewport; one\n hidden sentinel option keeps the trigger rendered while the selected rows are scrolled away. -->\n<ng-template #virtualField let-multiple>\n <mat-form-field\n [sdTooltip]=\"multiple && _tooltip ? selectionTooltip : ''\"\n sdTooltipPosition=\"top\"\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [class.sd-label-top]=\"_labelTop\"\n [appearance]=\"_appearance!\"\n [floatLabel]=\"_floatLabel\">\n @if (_appearance && _label && !_labelTop) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <mat-select\n #select\n [aria-labelledby]=\"_labelTop ? labelId : null\"\n [multiple]=\"multiple\"\n [value]=\"virtualShellValue()\"\n [compareWith]=\"virtualCompareWith\"\n [errorStateMatcher]=\"virtualErrorStateMatcher\"\n [disabled]=\"formControl.disabled\"\n [placeholder]=\"_placeholder\"\n disableOptionCentering=\"true\"\n [panelWidth]=\"calculatedPanelWidth()\"\n [panelClass]=\"multiple ? virtualPanelClass.multiple : virtualPanelClass.single\"\n [class.sd-selected]=\"!_required && _hasValue\"\n [required]=\"_required\"\n (openedChange)=\"onOpenedChange($event)\"\n (blur)=\"onVirtualBlur()\"\n [attr.data-autoId]=\"_autoId\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-loading]=\"dataLoading()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n matTooltipClass=\"sd-multiline-tooltip\"\n [matTooltipDisabled]=\"multiple || !formControl.disabled || !_normalizedValue?.length\"\n [matTooltip]=\"multiple ? '' : _tooltip || ''\">\n <mat-select-trigger>\n @if (sdSelectedTemplate(); as _selTpl) {\n <ng-container *ngTemplateOutlet=\"_selTpl; context: selectedTemplateContext()\"></ng-container>\n } @else if (multiple) {\n <div class=\"sd-trigger-text\">\n {{ _display }}\n </div>\n } @else {\n {{ _display }}\n }\n </mat-select-trigger>\n\n @if (filtered()) {\n <div class=\"c-filter-input-container\">\n <div class=\"filter-input-wrapper\">\n <sd-icon name=\"search\" aria-hidden=\"true\"></sd-icon>\n <input\n [formControl]=\"inputControl\"\n matInput\n autocomplete=\"off\"\n class=\"c-search-input\"\n [attr.aria-label]=\"'core.form.select.search' | sdTranslate\"\n [attr.aria-activedescendant]=\"virtualActiveDescendant()\"\n (keydown)=\"focusReadRetry($event); onVirtualSearchKeydown($event); $event.stopPropagation()\" />\n </div>\n </div>\n }\n\n @if (multiple && selectAllVisible()) {\n @let _selectAllState = selectAllState();\n <div\n class=\"sd-select-all-row\"\n role=\"checkbox\"\n tabindex=\"0\"\n [attr.aria-checked]=\"_selectAllState === 'indeterminate' ? 'mixed' : _selectAllState === 'checked'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-select-all' : null\"\n (click)=\"toggleSelectAll()\"\n (keydown.enter)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown.space)=\"toggleSelectAll(); $event.preventDefault()\"\n (keydown)=\"$event.stopPropagation()\">\n <mat-pseudo-checkbox class=\"mat-mdc-option-pseudo-checkbox\" [state]=\"_selectAllState\" aria-hidden=\"true\"></mat-pseudo-checkbox>\n <span class=\"mdc-list-item__primary-text\">{{ 'core.form.select.selectAll' | sdTranslate }}</span>\n </div>\n }\n\n @if (!_loading && _readState.status === 'error') {\n <mat-option disabled class=\"sd-read-state-anchor\" aria-hidden=\"true\"></mat-option>\n }\n @let _virtualItems = filteredItems();\n @if (!_virtualItems.length && !_loading && _readState.status !== 'error') {\n <mat-option class=\"sd-empty\" disabled>\n <img class=\"sd-image-data-empty\" alt=\"empty-image\" style=\"width: 95px\" />\n </mat-option>\n } @else if (_virtualItems.length && virtualRenderable()) {\n @let iDefTpl = itemDef()?.templateRef;\n @let _itemSize = itemSize();\n <!-- why: templateCacheSize 0 \u2014 a recycled mat-option would carry the previous row's selected\n state until Material re-syncs; fresh options always start clean. -->\n <cdk-virtual-scroll-viewport\n class=\"sd-select-virtual-viewport\"\n [itemSize]=\"_itemSize\"\n [minBufferPx]=\"_itemSize * 5\"\n [maxBufferPx]=\"_itemSize * 10\"\n [style.height.px]=\"virtualViewportHeight()\">\n <mat-option\n *cdkVirtualFor=\"let item of _virtualItems; let i = index; trackBy: virtualTrackBy; templateCacheSize: 0\"\n [id]=\"virtualOptionId(i)\"\n [value]=\"itemValue(item)\"\n [disabled]=\"itemDisabled(item)\"\n [class.sd-virtual-active]=\"i === virtualActiveIndex()\"\n [style.height.px]=\"_itemSize\">\n <div class=\"sd-select-virtual-label\">\n @if (iDefTpl) {\n <ng-container *ngTemplateOutlet=\"iDefTpl; context: { item: item }\"></ng-container>\n } @else {\n {{ itemDisplay(item) }}\n }\n </div>\n </mat-option>\n </cdk-virtual-scroll-viewport>\n }\n\n <ng-container [ngTemplateOutlet]=\"readRegion\"></ng-container>\n\n @if (_loading) {\n <mat-option disabled class=\"sd-loading-option\">\n <mat-spinner diameter=\"24\"></mat-spinner>\n </mat-option>\n }\n\n <!-- why: declared after the rows, so a rendered row wins over the sentinel in virtualCompareWith. -->\n <mat-option class=\"sd-virtual-sentinel\" [value]=\"virtualSentinel\" disabled aria-hidden=\"true\"></mat-option>\n\n @let _visibleFooterActions = visibleFooterActions();\n @if (_visibleFooterActions.length) {\n <div class=\"sd-select-footer-actions\">\n @for (action of _visibleFooterActions; track action) {\n <ng-container *ngTemplateOutlet=\"action.templateRef; context: footerActionContext()\"> </ng-container>\n }\n </div>\n }\n </mat-select>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" matSuffix>{{ _errorMessage }}</span>\n }\n\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n } @else if (_labelTop && _helperText) {\n <mat-hint [id]=\"hintId\">{{ _helperText }}</mat-hint>\n }\n\n @if (_hasValue && !_required && !formControl.disabled && !_bare) {\n @let _clearLabel = 'core.form.select.clear' | sdTranslate;\n <button type=\"button\" class=\"sd-clear-btn\" matSuffix (click)=\"clear($event)\" [title]=\"_clearLabel\" [attr.aria-label]=\"_clearLabel\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n } @else {\n <sd-icon class=\"cursor-pointer sd-suffix-icon\" matSuffix name=\"keyboard_arrow_down\"></sd-icon>\n }\n </mat-form-field>\n</ng-template>\n", styles: ["@charset \"UTF-8\";.text-primary{color:var(--sd-primary)!important}.bg-primary{background:var(--sd-primary)!important}.border-primary{border-color:var(--sd-primary)!important}.text-primary-light{color:var(--sd-primary-light)!important}.bg-primary-light{background:var(--sd-primary-light)!important}.border-primary-light{border-color:var(--sd-primary-light)!important}.text-primary-dark{color:var(--sd-primary-dark)!important}.bg-primary-dark{background:var(--sd-primary-dark)!important}.border-primary-dark{border-color:var(--sd-primary-dark)!important}.text-primary-contrast{color:var(--sd-primary-contrast)!important}.bg-primary-contrast{background:var(--sd-primary-contrast)!important}.border-primary-contrast{border-color:var(--sd-primary-contrast)!important}.text-secondary{color:var(--sd-secondary)!important}.bg-secondary{background:var(--sd-secondary)!important}.border-secondary{border-color:var(--sd-secondary)!important}.text-secondary-light{color:var(--sd-secondary-light)!important}.bg-secondary-light{background:var(--sd-secondary-light)!important}.border-secondary-light{border-color:var(--sd-secondary-light)!important}.text-secondary-dark{color:var(--sd-secondary-dark)!important}.bg-secondary-dark{background:var(--sd-secondary-dark)!important}.border-secondary-dark{border-color:var(--sd-secondary-dark)!important}.text-secondary-contrast{color:var(--sd-secondary-contrast)!important}.bg-secondary-contrast{background:var(--sd-secondary-contrast)!important}.border-secondary-contrast{border-color:var(--sd-secondary-contrast)!important}.text-info{color:var(--sd-info)!important}.bg-info{background:var(--sd-info)!important}.border-info{border-color:var(--sd-info)!important}.text-info-light{color:var(--sd-info-light)!important}.bg-info-light{background:var(--sd-info-light)!important}.border-info-light{border-color:var(--sd-info-light)!important}.text-info-dark{color:var(--sd-info-dark)!important}.bg-info-dark{background:var(--sd-info-dark)!important}.border-info-dark{border-color:var(--sd-info-dark)!important}.text-info-contrast{color:var(--sd-info-contrast)!important}.bg-info-contrast{background:var(--sd-info-contrast)!important}.border-info-contrast{border-color:var(--sd-info-contrast)!important}.text-success{color:var(--sd-success)!important}.bg-success{background:var(--sd-success)!important}.border-success{border-color:var(--sd-success)!important}.text-success-light{color:var(--sd-success-light)!important}.bg-success-light{background:var(--sd-success-light)!important}.border-success-light{border-color:var(--sd-success-light)!important}.text-success-dark{color:var(--sd-success-dark)!important}.bg-success-dark{background:var(--sd-success-dark)!important}.border-success-dark{border-color:var(--sd-success-dark)!important}.text-success-contrast{color:var(--sd-success-contrast)!important}.bg-success-contrast{background:var(--sd-success-contrast)!important}.border-success-contrast{border-color:var(--sd-success-contrast)!important}.text-warning{color:var(--sd-warning)!important}.bg-warning{background:var(--sd-warning)!important}.border-warning{border-color:var(--sd-warning)!important}.text-warning-light{color:var(--sd-warning-light)!important}.bg-warning-light{background:var(--sd-warning-light)!important}.border-warning-light{border-color:var(--sd-warning-light)!important}.text-warning-dark{color:var(--sd-warning-dark)!important}.bg-warning-dark{background:var(--sd-warning-dark)!important}.border-warning-dark{border-color:var(--sd-warning-dark)!important}.text-warning-contrast{color:var(--sd-warning-contrast)!important}.bg-warning-contrast{background:var(--sd-warning-contrast)!important}.border-warning-contrast{border-color:var(--sd-warning-contrast)!important}.text-error{color:var(--sd-error)!important}.bg-error{background:var(--sd-error)!important}.border-error{border-color:var(--sd-error)!important}.text-error-light{color:var(--sd-error-light)!important}.bg-error-light{background:var(--sd-error-light)!important}.border-error-light{border-color:var(--sd-error-light)!important}.text-error-dark{color:var(--sd-error-dark)!important}.bg-error-dark{background:var(--sd-error-dark)!important}.border-error-dark{border-color:var(--sd-error-dark)!important}.text-error-contrast{color:var(--sd-error-contrast)!important}.bg-error-contrast{background:var(--sd-error-contrast)!important}.border-error-contrast{border-color:var(--sd-error-contrast)!important}.text-surface{color:var(--sd-surface)!important}.bg-surface{background:var(--sd-surface)!important}.border-surface{border-color:var(--sd-surface)!important}.text-surface-muted{color:var(--sd-surface-muted)!important}.bg-surface-muted{background:var(--sd-surface-muted)!important}.border-surface-muted{border-color:var(--sd-surface-muted)!important}.text-text{color:var(--sd-text)!important}.bg-text{background:var(--sd-text)!important}.border-text{border-color:var(--sd-text)!important}.text-text-secondary{color:var(--sd-text-secondary)!important}.bg-text-secondary{background:var(--sd-text-secondary)!important}.border-text-secondary{border-color:var(--sd-text-secondary)!important}.text-text-muted{color:var(--sd-text-muted)!important}.bg-text-muted{background:var(--sd-text-muted)!important}.border-text-muted{border-color:var(--sd-text-muted)!important}.text-border{color:var(--sd-border)!important}.bg-border{background:var(--sd-border)!important}.border-border{border-color:var(--sd-border)!important}.text-border-strong{color:var(--sd-border-strong)!important}.bg-border-strong{background:var(--sd-border-strong)!important}.border-border-strong{border-color:var(--sd-border-strong)!important}.text-disabled-bg{color:var(--sd-disabled-bg)!important}.bg-disabled-bg{background:var(--sd-disabled-bg)!important}.border-disabled-bg{border-color:var(--sd-disabled-bg)!important}.text-disabled-text{color:var(--sd-disabled-text)!important}.bg-disabled-text{background:var(--sd-disabled-text)!important}.border-disabled-text{border-color:var(--sd-disabled-text)!important}.text-white{color:#fff!important}.bg-white{background:#fff!important}.border-white{border-color:#fff!important}.text-black{color:#000!important}.bg-black{background:#000!important}.border-black{border-color:#000!important}.text-secondary{color:var(--sd-text-secondary)!important}.text-muted{color:var(--sd-text-muted)!important}.text-body{color:var(--sd-text)!important}.bg-muted{background:var(--sd-surface-muted)!important}:host{display:block;max-width:100%}:host(.sd-has-label){padding-top:4px}:host(.sd-label-top){padding-top:0}:host(.sd-viewed){padding-top:0}::ng-deep .sd-loading-option{min-height:50px!important}::ng-deep .sd-loading-option .mat-pseudo-checkbox{display:none!important}::ng-deep .sd-loading-option .mdc-list-item__primary-text{width:100%;display:flex;justify-content:center;align-items:center}.sd-trigger-text{display:block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host ::ng-deep .mat-mdc-select-value{max-width:100%;overflow:hidden;width:0;min-width:100%}:host ::ng-deep .sd-selected .mat-mdc-select-arrow{display:none}:host ::ng-deep .mat-mdc-select-arrow{display:none!important}:host ::ng-deep .custom-arrow{pointer-events:none;position:absolute;right:1rem;top:50%;transform:translateY(-50%);display:flex;align-items:center}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-disabled-bg)}:host ::ng-deep .mat-mdc-form-field mat-select.mat-mdc-select-disabled .mat-mdc-select-value{color:var(--sd-disabled-text)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}::ng-deep .sd-select-panel .mat-mdc-option.sd-empty .mat-pseudo-checkbox{display:none}::ng-deep .sd-select-panel .mat-mdc-option{min-height:36px!important;padding:8px 12px!important}::ng-deep .sd-select-panel .c-filter-input-container{position:sticky;top:0;background-color:var(--sd-select-panel-bg, #ffffff);box-shadow:0 1px 0 0 var(--sd-select-panel-divider, #f2f2f2);padding:8px;margin-bottom:8px;z-index:var(--sd-z-dropdown, 1000)}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper{display:flex;align-items:center;padding:4px 8px;border:1px solid var(--sd-border);border-radius:var(--sd-radius-4, 4px);background-color:var(--sd-select-panel-bg, #ffffff)}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper sd-icon{color:var(--sd-select-icon-muted, #dadada)}::ng-deep .sd-select-panel .c-filter-input-container .filter-input-wrapper .c-search-input{min-width:0;width:100%;background-color:var(--sd-select-panel-bg, #ffffff);border:none;outline:none;flex:1;padding:4px}::ng-deep .sd-select-panel .sd-select-footer-actions{position:sticky;bottom:0;z-index:var(--sd-z-dropdown, 1000);display:flex;flex-direction:column;gap:4px;border-top:1px solid var(--sd-select-panel-divider, #f2f2f2);background-color:var(--sd-select-panel-bg, #ffffff)}::ng-deep .sd-select-panel .sd-select-all-row{display:flex;align-items:center;justify-content:flex-start;min-height:36px;padding:8px 12px;cursor:pointer;-webkit-user-select:none;user-select:none;border-bottom:1px solid var(--sd-border, #f2f2f2)}::ng-deep .sd-select-panel .sd-select-all-row:hover,::ng-deep .sd-select-panel .sd-select-all-row:focus-visible{background-color:var(--mat-option-hover-state-layer-color, rgba(0, 0, 0, .04));outline:none}::ng-deep .sd-select-panel .sd-select-all-row .mdc-list-item__primary-text{font-size:var(--sd-font-size-14, 14px);white-space:normal}::ng-deep .sd-multiline-tooltip{white-space:pre-line}::ng-deep .mat-mdc-select-panel.sd-select-panel{padding:0}::ng-deep .mat-mdc-select-panel.sd-select-panel .mat-mdc-option.mdc-list-item--disabled.sd-empty .mdc-list-item__primary-text{opacity:.8;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px}::ng-deep .sd-select-panel .mat-pseudo-checkbox-minimal{transform:scale(.7);transform-origin:center right}::ng-deep .sd-select-panel.sd-multiple .mat-pseudo-checkbox{transform:scale(.75);margin-right:8px!important}::ng-deep .sd-select-panel.sd-multiple .mdc-list-item__primary-text{font-size:var(--sd-font-size-14, 14px);white-space:normal}::ng-deep .mat-mdc-select-panel.sd-select-panel{max-width:90vw!important}::ng-deep .mat-mdc-select-panel.sd-select-panel .mat-mdc-option .mdc-list-item__primary-text{white-space:normal;word-break:break-word;line-height:1.4}:host(.sd-bare){display:inline-flex;align-items:center}:host(.sd-bare){position:relative}.sd-inline-view{cursor:pointer;display:inline-flex;align-items:center;width:100%;padding:1px 6px;border-radius:var(--sd-radius-4, 4px);background-color:#0000000a;transition:background-color .15s ease}.sd-inline-view:hover{background-color:#00000014}.sd-inline-view .sd-inline-clear{display:none;align-items:center;margin-left:4px;padding:0;border:0;background:transparent;cursor:pointer;line-height:0;color:var(--sd-text-secondary, #6b7280);transition:color .15s ease}.sd-inline-view .sd-inline-clear sd-icon{font-size:var(--sd-font-size-16, 16px);width:16px;height:16px}.sd-inline-view .sd-inline-clear:hover{color:var(--sd-error, #b32626)}.sd-inline-view:hover .sd-inline-clear{display:inline-flex}.sd-inline-editor{position:absolute;inset:0;opacity:0;pointer-events:none}.sd-inline-editor ::ng-deep *{pointer-events:none!important}:host(.sd-bare) ::ng-deep .mat-mdc-form-field{width:auto}:host(.sd-bare) ::ng-deep .mat-mdc-text-field-wrapper{padding:0;background:transparent}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-flex{padding:0;align-items:center}:host(.sd-bare) ::ng-deep .mdc-notched-outline{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}:host(.sd-bare) ::ng-deep .mat-mdc-select-arrow-wrapper{display:none}.sd-select-tooltip{white-space:pre-line}::ng-deep .sd-select-panel .sd-read-state-anchor{display:none}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual{max-height:none;overflow:hidden}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .sd-select-virtual-viewport{width:100%}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .sd-select-virtual-viewport .mat-mdc-option{min-height:0!important;padding-top:0!important;padding-bottom:0!important;box-sizing:border-box}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .sd-select-virtual-viewport .mat-mdc-option .mdc-list-item__primary-text,::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .sd-select-virtual-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:normal}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .mat-mdc-option.sd-virtual-active{background-color:var(--mat-option-focus-state-layer-color, rgba(0, 0, 0, .12))}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .mat-mdc-option.mat-mdc-option-active:not(.sd-virtual-active):not(:hover){background-color:transparent}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-select-virtual .sd-virtual-sentinel{display:none!important}::ng-deep .sd-select-panel .sd-read-state-region{container:sd-read-panel/inline-size;box-sizing:border-box;width:100%;min-width:0;text-align:center}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact{display:flex;flex-direction:column;align-items:center;min-height:120px;padding:20px 16px;text-align:center}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__symbol{margin:0 0 8px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__message{max-width:100%}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__actions{justify-content:center}@container sd-read-panel (max-width: 220px){::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact{padding:8px 10px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__symbol{width:24px;height:24px;margin-bottom:4px}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__message{line-height:var(--sd-line-height-18, 18px)}::ng-deep .sd-select-panel .sd-read-state-region .sd-data-state.sd-data-state--compact .sd-data-state__actions{margin-top:6px}}\n"] }]
|
|
1510
|
+
}], ctorParameters: () => [], propDecorators: { matInputRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatInput), { isSignal: true }] }], selectRef: [{ type: i0.ViewChild, args: ['select', { isSignal: true }] }], selectElement: [{ type: i0.ViewChild, args: ['select', { ...{ read: ElementRef }, isSignal: true }] }], virtualViewport: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }] }], sdLabelTemplate: [{ type: i0.ContentChild, args: ['sdLabel', { isSignal: true }] }], sdValueTemplate: [{ type: i0.ContentChild, args: ['sdValue', { isSignal: true }] }], sdSelectedTemplate: [{ type: i0.ContentChild, args: ['sdSelected', { isSignal: true }] }], itemDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdItemDefDefDirective), { isSignal: true }] }], sdViewDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdViewDefDirective), { isSignal: true }] }], footerActions: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdSelectFooterActionDirective), { isSignal: true }] }], autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], displayField: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayField", required: false }] }], disabledField: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledField", required: false }] }], cacheChecksum: [{ type: i0.Input, args: [{ isSignal: true, alias: "cacheChecksum", required: false }] }], limit: [{ type: i0.Input, args: [{ isSignal: true, alias: "limit", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], itemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemSize", required: false }] }], hyperlink: [{ type: i0.Input, args: [{ isSignal: true, alias: "hyperlink", required: false }] }], minWidthPanel: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidthPanel", required: false }] }], hideInlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideInlineError", required: false }] }], hideReadError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideReadError", required: false }] }], dataStateTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdDataStateTemplateDirective), { isSignal: true }] }], sdReadStateChange: [{ type: i0.Output, args: ["sdReadStateChange"] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], viewed: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewed", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showSelectAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSelectAll", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], validator: [{ type: i0.Input, args: [{ isSignal: true, alias: "validator", required: false }] }], inlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineError", required: false }] }], appearanceInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }], labelPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPlacement", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], valueModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }], sdSelection: [{ type: i0.Output, args: ["sdSelection"] }] } });
|
|
1020
1511
|
|
|
1021
1512
|
/**
|
|
1022
1513
|
* Generated bundle index. Do not edit.
|