@sdcorejs/angular 22.2.15 → 22.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- 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/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 +10 -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 +108 -52
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +6191 -6611
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-highlight.mjs +66 -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 +2158 -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 +11 -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-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 +144 -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 +13 -7
- 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 +2 -2
- 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 +2 -2
- 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 +2 -0
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +100 -13
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +154 -6
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +20 -4
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +20 -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 +18 -7
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +18 -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 +20 -4
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +31 -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-select.mjs +509 -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 +21 -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-i18n.mjs +1430 -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 +198 -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 +109 -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/package.json +14 -2
- package/types/sdcorejs-angular-components-breadcrumb.d.ts +2 -1
- package/types/sdcorejs-angular-components-data-state.d.ts +6 -2
- package/types/sdcorejs-angular-components-file-explorer.d.ts +3 -0
- package/types/sdcorejs-angular-components-form-generic.d.ts +897 -835
- package/types/sdcorejs-angular-components-highlight.d.ts +27 -0
- package/types/sdcorejs-angular-components-image-editor.d.ts +478 -0
- package/types/sdcorejs-angular-components-inform.d.ts +5 -2
- package/types/sdcorejs-angular-components-mini-editor.d.ts +1 -1
- package/types/sdcorejs-angular-components-preview.d.ts +51 -2
- package/types/sdcorejs-angular-components-query-builder.d.ts +1 -1
- package/types/sdcorejs-angular-components-section.d.ts +5 -1
- package/types/sdcorejs-angular-components-table.d.ts +6 -0
- package/types/sdcorejs-angular-components.d.ts +2 -0
- package/types/sdcorejs-angular-directives.d.ts +8 -0
- package/types/sdcorejs-angular-forms-autocomplete.d.ts +19 -1
- package/types/sdcorejs-angular-forms-chip-calendar.d.ts +13 -2
- package/types/sdcorejs-angular-forms-chip.d.ts +13 -2
- package/types/sdcorejs-angular-forms-date.d.ts +7 -2
- package/types/sdcorejs-angular-forms-datetime.d.ts +7 -2
- package/types/sdcorejs-angular-forms-inline-text.d.ts +1 -1
- package/types/sdcorejs-angular-forms-input-number.d.ts +12 -2
- package/types/sdcorejs-angular-forms-input.d.ts +21 -5
- package/types/sdcorejs-angular-forms-label.d.ts +16 -1
- package/types/sdcorejs-angular-forms-models.d.ts +16 -1
- package/types/sdcorejs-angular-forms-select.d.ts +66 -4
- package/types/sdcorejs-angular-forms-textarea.d.ts +9 -2
- package/types/sdcorejs-angular-i18n.d.ts +285 -54
- package/types/sdcorejs-angular-modules-auth.d.ts +3 -3
- package/types/sdcorejs-angular-modules-icon.d.ts +11 -1
- package/types/sdcorejs-angular-modules-layout.d.ts +2 -2
- package/types/sdcorejs-angular-modules-permission.d.ts +3 -2
- package/types/sdcorejs-angular-services-api.d.ts +49 -2
- package/types/sdcorejs-angular-services-confirm.d.ts +15 -0
- package/types/sdcorejs-angular-services-notify.d.ts +8 -0
- package/types/sdcorejs-angular-utilities-extensions.d.ts +68 -1
- package/types/sdcorejs-angular-utilities-theme.d.ts +25 -0
- package/types/sdcorejs-angular-utilities.d.ts +1 -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';
|
|
@@ -44,11 +48,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
44
48
|
}]
|
|
45
49
|
}], propDecorators: { when: [{ type: i0.Input, args: [{ isSignal: true, alias: "when", required: false }] }] } });
|
|
46
50
|
|
|
51
|
+
/**
|
|
52
|
+
* why (D-030 V1): value of the single hidden option of the virtual branch. `mat-select` renders its
|
|
53
|
+
* trigger — and so our labels — only while at least one option is selected, but with virtual scrolling
|
|
54
|
+
* most selected options are not rendered. `virtualCompareWith` lets this option stand in for them; it is
|
|
55
|
+
* disabled, hidden, and never reaches the model.
|
|
56
|
+
*/
|
|
57
|
+
const SD_SELECT_VIRTUAL_SENTINEL = Symbol('sd-select-virtual-sentinel');
|
|
58
|
+
/** Rows the virtual viewport shows at most before it scrolls. */
|
|
59
|
+
const SD_SELECT_VIRTUAL_ROWS = 6;
|
|
60
|
+
/** Same step as Material's key manager (`withPageUpDown()`). */
|
|
61
|
+
const SD_SELECT_VIRTUAL_PAGE = 10;
|
|
62
|
+
/** Same window as Material's typeahead (`withTypeAhead()`). */
|
|
63
|
+
const SD_SELECT_TYPEAHEAD_MS = 200;
|
|
64
|
+
const SD_SELECT_VIRTUAL_NAV_KEYS = new Set(['ArrowDown', 'ArrowUp', 'PageDown', 'PageUp', 'Home', 'End']);
|
|
65
|
+
/**
|
|
66
|
+
* why (D-026): the only code in sd-select that touches a Material internal for virtual scrolling —
|
|
67
|
+
* `MatSelect._keyManager`. It keeps Material's active option on the row the component made active, so
|
|
68
|
+
* the trigger's `aria-activedescendant` and Material's own Enter/Tab handling point at that row. Only the
|
|
69
|
+
* active item changes: no styles and no `change` event (which would make Material scroll its panel).
|
|
70
|
+
* Covered by select.virtual-scroll.spec.ts.
|
|
71
|
+
*/
|
|
72
|
+
class SdSelectVirtualAdapter {
|
|
73
|
+
select;
|
|
74
|
+
constructor(select) {
|
|
75
|
+
this.select = select;
|
|
76
|
+
}
|
|
77
|
+
setActive(option) {
|
|
78
|
+
const manager = this.select()?._keyManager;
|
|
79
|
+
if (!manager || manager.activeItem === (option ?? null))
|
|
80
|
+
return;
|
|
81
|
+
if (option)
|
|
82
|
+
manager.updateActiveItem(option);
|
|
83
|
+
else
|
|
84
|
+
manager.updateActiveItem(-1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
47
87
|
class SdSelect {
|
|
48
88
|
id = `I${Utilities.generateUuid()}`;
|
|
49
89
|
/** why: id ổn định của <mat-error> để control trỏ `aria-describedby` sang — thông báo lỗi
|
|
50
90
|
* phải đọc được từ chính control, không chỉ hiện ra màn hình. */
|
|
51
91
|
errorId = `${this.id}-error`;
|
|
92
|
+
/** id của nhãn/helper khi `labelPlacement='top'` — `mat-select` trỏ `aria-labelledby` sang nhãn. */
|
|
93
|
+
labelId = `${this.id}-label`;
|
|
94
|
+
hintId = `${this.id}-hint`;
|
|
52
95
|
// ==========================================
|
|
53
96
|
// 1. SIGNAL QUERIES & INJECTS
|
|
54
97
|
// ==========================================
|
|
@@ -56,6 +99,9 @@ class SdSelect {
|
|
|
56
99
|
...(ngDevMode ? [{ debugName: "matInputRef" }] : /* istanbul ignore next */ []));
|
|
57
100
|
selectRef = viewChild('select', /* @ts-ignore */
|
|
58
101
|
...(ngDevMode ? [{ debugName: "selectRef" }] : /* istanbul ignore next */ []));
|
|
102
|
+
selectElement = viewChild('select', { ...(ngDevMode ? { debugName: "selectElement" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
103
|
+
virtualViewport = viewChild(CdkVirtualScrollViewport, /* @ts-ignore */
|
|
104
|
+
...(ngDevMode ? [{ debugName: "virtualViewport" }] : /* istanbul ignore next */ []));
|
|
59
105
|
sdLabelTemplate = contentChild('sdLabel', /* @ts-ignore */
|
|
60
106
|
...(ngDevMode ? [{ debugName: "sdLabelTemplate" }] : /* istanbul ignore next */ []));
|
|
61
107
|
sdValueTemplate = contentChild('sdValue', /* @ts-ignore */
|
|
@@ -90,6 +136,9 @@ class SdSelect {
|
|
|
90
136
|
// why: focus/mở panel + focus ô search đều hoãn 100ms; handle phải bị clear khi destroy,
|
|
91
137
|
// nếu không callback vẫn chạm selectRef/matInputRef của view đã tháo.
|
|
92
138
|
#timers = _sdTimerScope();
|
|
139
|
+
#liveAnnouncer = inject(LiveAnnouncer);
|
|
140
|
+
#dir = inject(Directionality, { optional: true });
|
|
141
|
+
#virtualAdapter = new SdSelectVirtualAdapter(() => this.selectRef());
|
|
93
142
|
// ==========================================
|
|
94
143
|
// 2. SIGNAL INPUTS & MODEL
|
|
95
144
|
// ==========================================
|
|
@@ -156,6 +205,14 @@ class SdSelect {
|
|
|
156
205
|
...(ngDevMode ? [undefined, { debugName: "cacheChecksum" }] : /* istanbul ignore next */ []));
|
|
157
206
|
limit = input(50, /* @ts-ignore */
|
|
158
207
|
...(ngDevMode ? [{ debugName: "limit" }] : /* istanbul ignore next */ []));
|
|
208
|
+
/**
|
|
209
|
+
* Virtual scrolling for long lists (opt-in, default `false`). When on, the panel renders only the rows
|
|
210
|
+
* in view, array items are no longer cut by `limit`, and the component — not `mat-select` — owns the
|
|
211
|
+
* value. See sd-select.md, "Virtual scroll".
|
|
212
|
+
*/
|
|
213
|
+
virtualScroll = input(false, { ...(ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
214
|
+
/** Fixed row height in px for the virtual viewport. Default 36 = the panel's compact option row. */
|
|
215
|
+
itemSize = input(36, { ...(ngDevMode ? { debugName: "itemSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
159
216
|
hyperlink = input(/* @ts-ignore */
|
|
160
217
|
...(ngDevMode ? [undefined, { debugName: "hyperlink" }] : /* istanbul ignore next */ []));
|
|
161
218
|
minWidthPanel = input('auto', { ...(ngDevMode ? { debugName: "minWidthPanel" } : /* istanbul ignore next */ {}), transform: value => value ?? 'auto' });
|
|
@@ -228,6 +285,9 @@ class SdSelect {
|
|
|
228
285
|
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
229
286
|
floatLabel = input('auto', /* @ts-ignore */
|
|
230
287
|
...(ngDevMode ? [{ debugName: "floatLabel" }] : /* istanbul ignore next */ []));
|
|
288
|
+
/** `'float'` (mặc định) hoặc `'top'` — nhãn tĩnh phía trên, helper text dưới control. */
|
|
289
|
+
labelPlacement = input('float', /* @ts-ignore */
|
|
290
|
+
...(ngDevMode ? [{ debugName: "labelPlacement" }] : /* istanbul ignore next */ []));
|
|
231
291
|
// Mở rộng kiểu dữ liệu cho phép nhận Signal từ bên ngoài truyền vào
|
|
232
292
|
items = input(/* @ts-ignore */
|
|
233
293
|
...(ngDevMode ? [undefined, { debugName: "items" }] : /* istanbul ignore next */ []));
|
|
@@ -289,6 +349,8 @@ class SdSelect {
|
|
|
289
349
|
checksum: this.cacheChecksum(),
|
|
290
350
|
valueField: this.valueField(),
|
|
291
351
|
displayField: this.displayField(),
|
|
352
|
+
// why: switching virtualScroll re-runs the pipeline, since only the non-virtual list is cut at `limit`.
|
|
353
|
+
virtualScroll: this.virtualScroll(),
|
|
292
354
|
}))).pipe(map(context => context.items));
|
|
293
355
|
#valueModel$ = toObservable(this.valueModel);
|
|
294
356
|
filteredItems = signal([], /* @ts-ignore */
|
|
@@ -311,6 +373,70 @@ class SdSelect {
|
|
|
311
373
|
...(ngDevMode ? [{ debugName: "#footerFnVisibility" }] : /* istanbul ignore next */ []));
|
|
312
374
|
visibleFooterActions = computed(() => this.footerActions().filter(action => this.shouldRenderFooterAction(action)), /* @ts-ignore */
|
|
313
375
|
...(ngDevMode ? [{ debugName: "visibleFooterActions" }] : /* istanbul ignore next */ []));
|
|
376
|
+
// ==========================================
|
|
377
|
+
// VIRTUAL SCROLL (opt-in) — D-026: the component owns the value; D-030 V1: Material shell + one sentinel
|
|
378
|
+
// ==========================================
|
|
379
|
+
/** Value bound one-way to the virtual shell; the shell never writes it back (no `formControl` on it). */
|
|
380
|
+
virtualShellValue = computed(() => {
|
|
381
|
+
const value = this.normalizedValue();
|
|
382
|
+
if (this.multiple())
|
|
383
|
+
return Array.isArray(value) ? value : [];
|
|
384
|
+
return value ?? null;
|
|
385
|
+
}, /* @ts-ignore */
|
|
386
|
+
...(ngDevMode ? [{ debugName: "virtualShellValue" }] : /* istanbul ignore next */ []));
|
|
387
|
+
virtualSentinel = SD_SELECT_VIRTUAL_SENTINEL;
|
|
388
|
+
virtualPanelClass = {
|
|
389
|
+
single: ['sd-select-panel', 'sd-select-virtual'],
|
|
390
|
+
multiple: ['sd-select-panel', 'sd-multiple', 'sd-select-virtual'],
|
|
391
|
+
};
|
|
392
|
+
/** A rendered option matches its own value; the sentinel matches any value whose option is not rendered. */
|
|
393
|
+
virtualCompareWith = (optionValue, value) => value != null && (optionValue === value || optionValue === SD_SELECT_VIRTUAL_SENTINEL);
|
|
394
|
+
/** The virtual shell cannot see `formControl`, so the component supplies Material's error state. */
|
|
395
|
+
virtualErrorStateMatcher = {
|
|
396
|
+
isErrorState: (_control, form) => !!(this.formControl.invalid && (this.formControl.touched || form?.submitted)),
|
|
397
|
+
};
|
|
398
|
+
/** Same rule as the non-virtual template: rows render when both fields are set, or neither. */
|
|
399
|
+
virtualRenderable = computed(() => !this.valueField() === !this.displayField(), /* @ts-ignore */
|
|
400
|
+
...(ngDevMode ? [{ debugName: "virtualRenderable" }] : /* istanbul ignore next */ []));
|
|
401
|
+
virtualViewportHeight = computed(() => Math.min(this.filteredItems().length, SD_SELECT_VIRTUAL_ROWS) * this.itemSize(), /* @ts-ignore */
|
|
402
|
+
...(ngDevMode ? [{ debugName: "virtualViewportHeight" }] : /* istanbul ignore next */ []));
|
|
403
|
+
virtualTrackBy = (_index, item) => this.itemValue(item);
|
|
404
|
+
/** Stable id per row index: aria-activedescendant targets and finds the rendered option by it. */
|
|
405
|
+
virtualOptionId = (index) => `${this.id}-option-${index}`;
|
|
406
|
+
/** Context of `#sdSelected` in the virtual branch — the same shape as the non-virtual templates. */
|
|
407
|
+
selectedTemplateContext = computed(() => {
|
|
408
|
+
const items = this.selectedItems();
|
|
409
|
+
const display = this.display();
|
|
410
|
+
return this.multiple()
|
|
411
|
+
? { $implicit: items, item: items, items, display, multiple: true }
|
|
412
|
+
: { $implicit: items[0], item: items[0], items, display, multiple: false };
|
|
413
|
+
}, /* @ts-ignore */
|
|
414
|
+
...(ngDevMode ? [{ debugName: "selectedTemplateContext" }] : /* istanbul ignore next */ []));
|
|
415
|
+
/** Row the keyboard made active, tracked by value so re-sorting the list keeps it. */
|
|
416
|
+
#virtualActiveKey = signal(null, /* @ts-ignore */
|
|
417
|
+
...(ngDevMode ? [{ debugName: "#virtualActiveKey" }] : /* istanbul ignore next */ []));
|
|
418
|
+
/** Index of the active row in the full filtered list, or -1. */
|
|
419
|
+
virtualActiveIndex = computed(() => {
|
|
420
|
+
const key = this.#virtualActiveKey();
|
|
421
|
+
if (!key || !this.virtualScroll())
|
|
422
|
+
return -1;
|
|
423
|
+
return this.filteredItems().findIndex(item => this.itemValue(item) === key.value);
|
|
424
|
+
}, /* @ts-ignore */
|
|
425
|
+
...(ngDevMode ? [{ debugName: "virtualActiveIndex" }] : /* istanbul ignore next */ []));
|
|
426
|
+
#virtualRange = signal({ start: 0, end: 0 }, /* @ts-ignore */
|
|
427
|
+
...(ngDevMode ? [{ debugName: "#virtualRange" }] : /* istanbul ignore next */ []));
|
|
428
|
+
/** `aria-activedescendant` of the search box: the active row, only while it is rendered. */
|
|
429
|
+
virtualActiveDescendant = computed(() => {
|
|
430
|
+
const index = this.virtualActiveIndex();
|
|
431
|
+
const range = this.#virtualRange();
|
|
432
|
+
return index >= range.start && index < range.end ? this.virtualOptionId(index) : null;
|
|
433
|
+
}, /* @ts-ignore */
|
|
434
|
+
...(ngDevMode ? [{ debugName: "virtualActiveDescendant" }] : /* istanbul ignore next */ []));
|
|
435
|
+
/** Labels folded like the search box (no diacritics, lower case), computed once per list for typeahead. */
|
|
436
|
+
#virtualLabels = computed(() => this.filteredItems().map(item => StringUtilities.changeAliasLowerCase(this.itemDisplay(item))), /* @ts-ignore */
|
|
437
|
+
...(ngDevMode ? [{ debugName: "#virtualLabels" }] : /* istanbul ignore next */ []));
|
|
438
|
+
#typeahead = '';
|
|
439
|
+
#typeaheadAt = 0;
|
|
314
440
|
normalizedValue = computed(() => {
|
|
315
441
|
const val = this.valueModel();
|
|
316
442
|
if (this.multiple() && val !== undefined && val !== null && !Array.isArray(val)) {
|
|
@@ -524,6 +650,42 @@ class SdSelect {
|
|
|
524
650
|
this.#ref.markForCheck();
|
|
525
651
|
});
|
|
526
652
|
});
|
|
653
|
+
// Virtual scroll wiring. Each effect removes its listener when the virtual branch goes away.
|
|
654
|
+
effect(onCleanup => {
|
|
655
|
+
const select = this.selectRef();
|
|
656
|
+
if (!select || !this.virtualScroll())
|
|
657
|
+
return;
|
|
658
|
+
const selections = select.optionSelectionChanges.subscribe(this.#onVirtualOptionSelection);
|
|
659
|
+
// why: Material re-syncs its selection in a microtask queued when the options change (and moves its
|
|
660
|
+
// active option there); queue after it so Material's active option points back at ours.
|
|
661
|
+
const options = select.options.changes.subscribe(() => Promise.resolve().then(() => this.#syncVirtualKeyManager()));
|
|
662
|
+
onCleanup(() => {
|
|
663
|
+
selections.unsubscribe();
|
|
664
|
+
options.unsubscribe();
|
|
665
|
+
});
|
|
666
|
+
});
|
|
667
|
+
effect(onCleanup => {
|
|
668
|
+
const element = this.selectElement()?.nativeElement;
|
|
669
|
+
if (!element || !this.virtualScroll())
|
|
670
|
+
return;
|
|
671
|
+
// why: capture phase on the trigger runs before MatSelect's own keydown listener on the same element.
|
|
672
|
+
element.addEventListener('keydown', this.#onVirtualTriggerKeydown, true);
|
|
673
|
+
onCleanup(() => element.removeEventListener('keydown', this.#onVirtualTriggerKeydown, true));
|
|
674
|
+
});
|
|
675
|
+
effect(onCleanup => {
|
|
676
|
+
const viewport = this.virtualViewport();
|
|
677
|
+
if (!viewport)
|
|
678
|
+
return;
|
|
679
|
+
this.#virtualRange.set(viewport.getRenderedRange());
|
|
680
|
+
const range = viewport.renderedRangeStream.subscribe(value => this.#virtualRange.set(value));
|
|
681
|
+
onCleanup(() => range.unsubscribe());
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
ngDoCheck() {
|
|
685
|
+
// why: MatSelect refreshes its error state in its own ngDoCheck only when it has an NgControl; the
|
|
686
|
+
// virtual shell has none, so refresh it at the same cadence here.
|
|
687
|
+
if (this.virtualScroll())
|
|
688
|
+
this.selectRef()?.updateErrorState();
|
|
527
689
|
}
|
|
528
690
|
ngOnInit() {
|
|
529
691
|
this.formControl.valueChanges.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(val => {
|
|
@@ -629,7 +791,7 @@ class SdSelect {
|
|
|
629
791
|
}), filter((items) => items !== undefined),
|
|
630
792
|
// why: selectedItems và display cùng dùng một request VALUE, kể cả khi retry.
|
|
631
793
|
shareReplay({ bufferSize: 1, refCount: true }));
|
|
632
|
-
const filteredItems$ = allItems$.pipe(map(this.#
|
|
794
|
+
const filteredItems$ = allItems$.pipe(map(this.#visibleItems));
|
|
633
795
|
const display$ = selectedItems$.pipe(map(items => items?.map(item => (this.displayField() ? this.itemDisplay(item) : item))?.join(', ') || ''));
|
|
634
796
|
filteredItems$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(val => {
|
|
635
797
|
this.filteredItems.set(val || []);
|
|
@@ -644,6 +806,8 @@ class SdSelect {
|
|
|
644
806
|
this.#ref.markForCheck();
|
|
645
807
|
});
|
|
646
808
|
}
|
|
809
|
+
/** Rows the panel shows: the non-virtual list is cut at `limit`; the virtual list is not (D-026). */
|
|
810
|
+
#visibleItems = (allItems) => (this.virtualScroll() ? allItems : this.#pageReadItems(allItems));
|
|
647
811
|
#pageReadItems = (allItems) => {
|
|
648
812
|
const limit = this.limit();
|
|
649
813
|
const val = this.valueModel();
|
|
@@ -873,7 +1037,7 @@ class SdSelect {
|
|
|
873
1037
|
const items = await this.#loadItems(request.args.searchText, request.loader, true);
|
|
874
1038
|
if (!request.valid() || !items)
|
|
875
1039
|
return;
|
|
876
|
-
this.filteredItems.set(this.#
|
|
1040
|
+
this.filteredItems.set(this.#visibleItems(items));
|
|
877
1041
|
}
|
|
878
1042
|
this.#syncReadLoading();
|
|
879
1043
|
};
|
|
@@ -965,6 +1129,16 @@ class SdSelect {
|
|
|
965
1129
|
this.focus();
|
|
966
1130
|
}
|
|
967
1131
|
};
|
|
1132
|
+
/**
|
|
1133
|
+
* Bấm nhãn rời (`labelPlacement='top'`) focus `mat-select` — như `<label for>` với input gốc.
|
|
1134
|
+
* 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
|
|
1135
|
+
* mở panel (hành vi giống select gốc).
|
|
1136
|
+
*/
|
|
1137
|
+
onLabelClick = () => {
|
|
1138
|
+
if (this.formControl.disabled)
|
|
1139
|
+
return;
|
|
1140
|
+
this.selectRef()?.focus();
|
|
1141
|
+
};
|
|
968
1142
|
focus = () => {
|
|
969
1143
|
this.focused.set(true);
|
|
970
1144
|
this.updatePanelWidth();
|
|
@@ -1004,8 +1178,15 @@ class SdSelect {
|
|
|
1004
1178
|
// why: vẫn 100ms như cũ — chỉ scope handle theo DestroyRef.
|
|
1005
1179
|
this.#timers.schedule(() => this.matInputRef()?.focus(), 100);
|
|
1006
1180
|
this.#hashedValue = Utilities.hash({ value: this.formControl.value });
|
|
1181
|
+
if (this.virtualScroll())
|
|
1182
|
+
this.#onVirtualOpened();
|
|
1007
1183
|
}
|
|
1008
1184
|
else {
|
|
1185
|
+
// why: the non-virtual shell marks the control touched through its value accessor when it closes.
|
|
1186
|
+
if (this.virtualScroll()) {
|
|
1187
|
+
this.formControl.markAsTouched();
|
|
1188
|
+
this.#virtualActiveKey.set(null);
|
|
1189
|
+
}
|
|
1009
1190
|
this.focused.set(false);
|
|
1010
1191
|
const hashedValue = Utilities.hash({ value: this.formControl.value });
|
|
1011
1192
|
if (this.#hashedValue !== hashedValue) {
|
|
@@ -1030,12 +1211,332 @@ class SdSelect {
|
|
|
1030
1211
|
this.#hashedValue = undefined;
|
|
1031
1212
|
}
|
|
1032
1213
|
};
|
|
1214
|
+
// ==========================================
|
|
1215
|
+
// VIRTUAL SCROLL — selection, keyboard, active row
|
|
1216
|
+
// ==========================================
|
|
1217
|
+
/** Mirrors MatSelect._onBlur: a blur while the panel is open is focus moving into the panel. */
|
|
1218
|
+
onVirtualBlur = () => {
|
|
1219
|
+
if (!this.selectRef()?.panelOpen)
|
|
1220
|
+
this.formControl.markAsTouched();
|
|
1221
|
+
};
|
|
1222
|
+
/** Keys in the search box: rows move with the arrows/Page/Home/End, Enter chooses the active row. */
|
|
1223
|
+
onVirtualSearchKeydown = (event) => {
|
|
1224
|
+
if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey)
|
|
1225
|
+
return;
|
|
1226
|
+
if (SD_SELECT_VIRTUAL_NAV_KEYS.has(event.key)) {
|
|
1227
|
+
// why: the search box only filters, so Home/End move through the rows instead of the caret (the
|
|
1228
|
+
// MUI autocomplete default) — otherwise nothing past the first screen of 10,000 rows is reachable.
|
|
1229
|
+
event.preventDefault();
|
|
1230
|
+
this.#moveVirtualActive(event.key);
|
|
1231
|
+
}
|
|
1232
|
+
else if (event.key === 'Enter' && this.virtualActiveIndex() >= 0) {
|
|
1233
|
+
event.preventDefault();
|
|
1234
|
+
this.#commitVirtualIndex(this.virtualActiveIndex());
|
|
1235
|
+
}
|
|
1236
|
+
};
|
|
1237
|
+
/** Keys on the trigger. Material's own handling only reaches the rendered rows, so the list-wide keys are ours. */
|
|
1238
|
+
#onVirtualTriggerKeydown = (event) => {
|
|
1239
|
+
const select = this.selectRef();
|
|
1240
|
+
if (!select || select.disabled || event.defaultPrevented)
|
|
1241
|
+
return;
|
|
1242
|
+
const modified = event.altKey || event.ctrlKey || event.metaKey;
|
|
1243
|
+
const printable = event.key.length === 1 && event.key !== ' ' && !modified;
|
|
1244
|
+
let handled = false;
|
|
1245
|
+
if (select.panelOpen) {
|
|
1246
|
+
if (SD_SELECT_VIRTUAL_NAV_KEYS.has(event.key) && !modified) {
|
|
1247
|
+
const previous = this.virtualActiveIndex();
|
|
1248
|
+
const index = this.#moveVirtualActive(event.key);
|
|
1249
|
+
// Material: Shift + arrow in a multiple select also toggles the row it lands on.
|
|
1250
|
+
if (this.multiple() && event.shiftKey && event.key.startsWith('Arrow') && index !== previous)
|
|
1251
|
+
this.#commitVirtualIndex(index);
|
|
1252
|
+
handled = true;
|
|
1253
|
+
}
|
|
1254
|
+
else if ((event.key === 'Enter' || (event.key === ' ' && !this.#isTyping())) && !modified && this.virtualActiveIndex() >= 0) {
|
|
1255
|
+
this.#commitVirtualIndex(this.virtualActiveIndex());
|
|
1256
|
+
handled = true;
|
|
1257
|
+
}
|
|
1258
|
+
else if (this.multiple() && event.ctrlKey && event.key.toLowerCase() === 'a' && !this.#isTyping()) {
|
|
1259
|
+
// Material: Ctrl + A selects every option, or clears them when all are selected — here over the whole list.
|
|
1260
|
+
this.#toggleAllVirtual();
|
|
1261
|
+
handled = true;
|
|
1262
|
+
}
|
|
1263
|
+
else if (printable) {
|
|
1264
|
+
this.#typeaheadVirtual(event.key, false);
|
|
1265
|
+
handled = true;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
else if (!this.multiple() && !modified) {
|
|
1269
|
+
// Closed single select: Material changes the value with these keys, but only among the rendered rows.
|
|
1270
|
+
if (SD_SELECT_VIRTUAL_NAV_KEYS.has(event.key) || event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
1271
|
+
this.#stepClosedVirtual(event.key);
|
|
1272
|
+
handled = true;
|
|
1273
|
+
}
|
|
1274
|
+
else if (printable) {
|
|
1275
|
+
this.#typeaheadVirtual(event.key, true);
|
|
1276
|
+
handled = true;
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
if (handled) {
|
|
1280
|
+
event.preventDefault();
|
|
1281
|
+
event.stopImmediatePropagation();
|
|
1282
|
+
}
|
|
1283
|
+
};
|
|
1284
|
+
/** A click (or Material's own keyboard selection) on a rendered row. */
|
|
1285
|
+
#onVirtualOptionSelection = (event) => {
|
|
1286
|
+
const option = event.source;
|
|
1287
|
+
if (!event.isUserInput || option.value === SD_SELECT_VIRTUAL_SENTINEL)
|
|
1288
|
+
return;
|
|
1289
|
+
this.#virtualActiveKey.set({ value: option.value });
|
|
1290
|
+
if (this.multiple()) {
|
|
1291
|
+
this.#toggleVirtualValue(option.value, option.selected);
|
|
1292
|
+
}
|
|
1293
|
+
else if (option.selected) {
|
|
1294
|
+
// Material closes the panel and focuses the trigger itself after a single-select user choice.
|
|
1295
|
+
this.clearSearch();
|
|
1296
|
+
this.#commitVirtualValue(option.value);
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
#onVirtualOpened = () => {
|
|
1300
|
+
// why: the viewport was created while the panel was detached (size 0). After the search box is cleared
|
|
1301
|
+
// (a zero-delay search) measure it and bring the selected row — or the first enabled one — into view,
|
|
1302
|
+
// like Material does for its active option.
|
|
1303
|
+
this.#timers.schedule(() => {
|
|
1304
|
+
this.virtualViewport()?.checkViewportSize();
|
|
1305
|
+
const items = this.filteredItems();
|
|
1306
|
+
let index = -1;
|
|
1307
|
+
if (this.multiple()) {
|
|
1308
|
+
const selected = new Set(this.#virtualValues());
|
|
1309
|
+
index = items.findIndex(item => selected.has(this.itemValue(item)));
|
|
1310
|
+
}
|
|
1311
|
+
else {
|
|
1312
|
+
index = this.#virtualSelectedIndex();
|
|
1313
|
+
}
|
|
1314
|
+
if (index < 0)
|
|
1315
|
+
index = items.findIndex(item => !this.itemDisabled(item));
|
|
1316
|
+
if (index >= 0)
|
|
1317
|
+
this.#activateVirtual(index);
|
|
1318
|
+
}, 0);
|
|
1319
|
+
};
|
|
1320
|
+
/** Moves the active row like Material's open-panel key manager (no wrap; disabled rows stay reachable). */
|
|
1321
|
+
#moveVirtualActive = (key) => {
|
|
1322
|
+
const count = this.filteredItems().length;
|
|
1323
|
+
const current = this.virtualActiveIndex();
|
|
1324
|
+
if (!count)
|
|
1325
|
+
return current;
|
|
1326
|
+
let target;
|
|
1327
|
+
switch (key) {
|
|
1328
|
+
case 'Home':
|
|
1329
|
+
target = 0;
|
|
1330
|
+
break;
|
|
1331
|
+
case 'End':
|
|
1332
|
+
target = count - 1;
|
|
1333
|
+
break;
|
|
1334
|
+
case 'PageDown':
|
|
1335
|
+
target = current + SD_SELECT_VIRTUAL_PAGE;
|
|
1336
|
+
break;
|
|
1337
|
+
case 'PageUp':
|
|
1338
|
+
target = current - SD_SELECT_VIRTUAL_PAGE;
|
|
1339
|
+
break;
|
|
1340
|
+
case 'ArrowDown':
|
|
1341
|
+
target = current + 1;
|
|
1342
|
+
break;
|
|
1343
|
+
default:
|
|
1344
|
+
// ArrowUp with no active row does nothing, as in Material.
|
|
1345
|
+
if (current < 0)
|
|
1346
|
+
return current;
|
|
1347
|
+
target = current - 1;
|
|
1348
|
+
}
|
|
1349
|
+
const index = Math.min(count - 1, Math.max(0, target));
|
|
1350
|
+
this.#activateVirtual(index);
|
|
1351
|
+
return index;
|
|
1352
|
+
};
|
|
1353
|
+
#activateVirtual = (index) => {
|
|
1354
|
+
const item = this.filteredItems()[index];
|
|
1355
|
+
if (item === undefined)
|
|
1356
|
+
return;
|
|
1357
|
+
this.#virtualActiveKey.set({ value: this.itemValue(item) });
|
|
1358
|
+
this.#scrollVirtualIntoView(index);
|
|
1359
|
+
// The row may render only after the viewport scrolls; the options subscription syncs again then.
|
|
1360
|
+
this.#syncVirtualKeyManager();
|
|
1361
|
+
};
|
|
1362
|
+
/** Scrolls the least distance that shows the whole row (Material's `_getOptionScrollPosition` rule). */
|
|
1363
|
+
#scrollVirtualIntoView = (index) => {
|
|
1364
|
+
const viewport = this.virtualViewport();
|
|
1365
|
+
if (!viewport)
|
|
1366
|
+
return;
|
|
1367
|
+
const size = this.itemSize();
|
|
1368
|
+
const top = index * size;
|
|
1369
|
+
const offset = viewport.measureScrollOffset();
|
|
1370
|
+
const height = viewport.getViewportSize() || this.virtualViewportHeight();
|
|
1371
|
+
if (top < offset)
|
|
1372
|
+
viewport.scrollToOffset(top);
|
|
1373
|
+
else if (top + size > offset + height)
|
|
1374
|
+
viewport.scrollToOffset(top + size - height);
|
|
1375
|
+
};
|
|
1376
|
+
#syncVirtualKeyManager = () => {
|
|
1377
|
+
const select = this.selectRef();
|
|
1378
|
+
if (!select?.panelOpen || !this.virtualScroll())
|
|
1379
|
+
return;
|
|
1380
|
+
const index = this.virtualActiveIndex();
|
|
1381
|
+
const id = index >= 0 ? this.virtualOptionId(index) : null;
|
|
1382
|
+
this.#virtualAdapter.setActive(id ? select.options.find(option => option.id === id) : undefined);
|
|
1383
|
+
};
|
|
1384
|
+
/** Chooses row `index`: toggles it in a multiple select; sets it and closes the panel in a single one. */
|
|
1385
|
+
#commitVirtualIndex = (index) => {
|
|
1386
|
+
const item = this.filteredItems()[index];
|
|
1387
|
+
// A disabled row can be active (ARIA listbox) but not chosen — same as a disabled mat-option.
|
|
1388
|
+
if (item === undefined || this.itemDisabled(item))
|
|
1389
|
+
return;
|
|
1390
|
+
const value = this.itemValue(item);
|
|
1391
|
+
this.#virtualActiveKey.set({ value });
|
|
1392
|
+
if (this.multiple()) {
|
|
1393
|
+
this.#toggleVirtualValue(value, !this.#virtualValues().includes(value));
|
|
1394
|
+
return;
|
|
1395
|
+
}
|
|
1396
|
+
this.clearSearch();
|
|
1397
|
+
this.#commitVirtualValue(value);
|
|
1398
|
+
const select = this.selectRef();
|
|
1399
|
+
select?.close();
|
|
1400
|
+
select?.focus();
|
|
1401
|
+
};
|
|
1402
|
+
#toggleVirtualValue = (value, selected) => {
|
|
1403
|
+
const current = this.#virtualValues();
|
|
1404
|
+
if (current.includes(value) === selected)
|
|
1405
|
+
return;
|
|
1406
|
+
const next = selected ? [...current, value] : current.filter(entry => entry !== value);
|
|
1407
|
+
this.#commitVirtualValue(this.#orderByList(next));
|
|
1408
|
+
};
|
|
1409
|
+
#toggleAllVirtual = () => {
|
|
1410
|
+
const enabled = this.filteredItems()
|
|
1411
|
+
.filter(item => !this.itemDisabled(item))
|
|
1412
|
+
.map(item => this.itemValue(item));
|
|
1413
|
+
const current = this.#virtualValues();
|
|
1414
|
+
const selected = new Set(current);
|
|
1415
|
+
if (enabled.some(value => !selected.has(value))) {
|
|
1416
|
+
this.#commitVirtualValue(this.#orderByList([...current, ...enabled.filter(value => !selected.has(value))]));
|
|
1417
|
+
}
|
|
1418
|
+
else {
|
|
1419
|
+
const scope = new Set(enabled);
|
|
1420
|
+
this.#commitVirtualValue(current.filter(value => !scope.has(value)));
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
#virtualValues = () => {
|
|
1424
|
+
const value = this.normalizedValue();
|
|
1425
|
+
return Array.isArray(value) ? value : [];
|
|
1426
|
+
};
|
|
1427
|
+
#virtualSelectedIndex = () => {
|
|
1428
|
+
const value = this.normalizedValue();
|
|
1429
|
+
if (value === undefined || value === null)
|
|
1430
|
+
return -1;
|
|
1431
|
+
return this.filteredItems().findIndex(item => this.itemValue(item) === value);
|
|
1432
|
+
};
|
|
1433
|
+
/** The order the non-virtual branch emits: the order of the (pinned) filtered list; unknown values last. */
|
|
1434
|
+
#orderByList = (values) => {
|
|
1435
|
+
const position = new Map();
|
|
1436
|
+
this.filteredItems().forEach((item, index) => {
|
|
1437
|
+
const value = this.itemValue(item);
|
|
1438
|
+
if (!position.has(value))
|
|
1439
|
+
position.set(value, index);
|
|
1440
|
+
});
|
|
1441
|
+
return values
|
|
1442
|
+
.map((value, index) => ({ value, index, position: position.get(value) ?? Number.MAX_SAFE_INTEGER }))
|
|
1443
|
+
.sort((a, b) => a.position - b.position || a.index - b.index)
|
|
1444
|
+
.map(entry => entry.value);
|
|
1445
|
+
};
|
|
1446
|
+
#commitVirtualValue = (next) => {
|
|
1447
|
+
// why: same rules as toggleSelectAll — setValue with its event (async validator kept) and the `!==`
|
|
1448
|
+
// guard so one choice emits one valueChanges.
|
|
1449
|
+
if (this.formControl.value !== next)
|
|
1450
|
+
this.formControl.setValue(next);
|
|
1451
|
+
this.#onChange(next);
|
|
1452
|
+
};
|
|
1453
|
+
/** Closed single select: steps the value through the whole list, skipping disabled rows like Material. */
|
|
1454
|
+
#stepClosedVirtual = (key) => {
|
|
1455
|
+
const items = this.filteredItems();
|
|
1456
|
+
const count = items.length;
|
|
1457
|
+
if (!count)
|
|
1458
|
+
return;
|
|
1459
|
+
const rtl = this.#dir?.value === 'rtl';
|
|
1460
|
+
const direction = key === 'ArrowLeft' ? (rtl ? 'ArrowDown' : 'ArrowUp') : key === 'ArrowRight' ? (rtl ? 'ArrowUp' : 'ArrowDown') : key;
|
|
1461
|
+
const current = this.#virtualSelectedIndex();
|
|
1462
|
+
const scan = (start, step) => {
|
|
1463
|
+
for (let index = start; index >= 0 && index < count; index += step)
|
|
1464
|
+
if (!this.itemDisabled(items[index]))
|
|
1465
|
+
return index;
|
|
1466
|
+
return -1;
|
|
1467
|
+
};
|
|
1468
|
+
let target;
|
|
1469
|
+
switch (direction) {
|
|
1470
|
+
case 'ArrowDown':
|
|
1471
|
+
target = scan(current + 1, 1);
|
|
1472
|
+
break;
|
|
1473
|
+
case 'ArrowUp':
|
|
1474
|
+
target = current < 0 ? -1 : scan(current - 1, -1);
|
|
1475
|
+
break;
|
|
1476
|
+
case 'Home':
|
|
1477
|
+
target = scan(0, 1);
|
|
1478
|
+
break;
|
|
1479
|
+
case 'End':
|
|
1480
|
+
target = scan(count - 1, -1);
|
|
1481
|
+
break;
|
|
1482
|
+
case 'PageDown':
|
|
1483
|
+
target = scan(Math.min(count - 1, current + SD_SELECT_VIRTUAL_PAGE), -1);
|
|
1484
|
+
break;
|
|
1485
|
+
default:
|
|
1486
|
+
target = scan(Math.max(0, current - SD_SELECT_VIRTUAL_PAGE), 1);
|
|
1487
|
+
}
|
|
1488
|
+
if (target >= 0 && target !== current)
|
|
1489
|
+
this.#selectClosedVirtual(target);
|
|
1490
|
+
};
|
|
1491
|
+
#selectClosedVirtual = (index) => {
|
|
1492
|
+
const item = this.filteredItems()[index];
|
|
1493
|
+
this.clearSearch();
|
|
1494
|
+
this.#commitVirtualValue(this.itemValue(item));
|
|
1495
|
+
// Material announces the new value itself when a closed select changes; do the same.
|
|
1496
|
+
this.#liveAnnouncer.announce(this.itemDisplay(item), 10000);
|
|
1497
|
+
};
|
|
1498
|
+
#isTyping = () => !!this.#typeahead && performance.now() - this.#typeaheadAt <= SD_SELECT_TYPEAHEAD_MS;
|
|
1499
|
+
/**
|
|
1500
|
+
* Typeahead over the whole list, folded like the search box. Unlike Material's (debounced, rendered rows
|
|
1501
|
+
* only) it moves on every key: a longer prefix keeps the current row if it still matches.
|
|
1502
|
+
*/
|
|
1503
|
+
#typeaheadVirtual = (char, commit) => {
|
|
1504
|
+
const now = performance.now();
|
|
1505
|
+
if (now - this.#typeaheadAt > SD_SELECT_TYPEAHEAD_MS)
|
|
1506
|
+
this.#typeahead = '';
|
|
1507
|
+
this.#typeahead += char;
|
|
1508
|
+
this.#typeaheadAt = now;
|
|
1509
|
+
const query = StringUtilities.changeAliasLowerCase(this.#typeahead);
|
|
1510
|
+
const labels = this.#virtualLabels();
|
|
1511
|
+
const count = labels.length;
|
|
1512
|
+
if (!query || !count)
|
|
1513
|
+
return;
|
|
1514
|
+
const start = commit ? this.#virtualSelectedIndex() : this.virtualActiveIndex();
|
|
1515
|
+
const first = start < 0 ? 0 : this.#typeahead.length > 1 ? start : start + 1;
|
|
1516
|
+
for (let step = 0; step < count; step++) {
|
|
1517
|
+
const index = (first + step) % count;
|
|
1518
|
+
if (commit && this.itemDisabled(this.filteredItems()[index]))
|
|
1519
|
+
continue;
|
|
1520
|
+
if (!labels[index].startsWith(query))
|
|
1521
|
+
continue;
|
|
1522
|
+
if (commit)
|
|
1523
|
+
this.#selectClosedVirtual(index);
|
|
1524
|
+
else
|
|
1525
|
+
this.#activateVirtual(index);
|
|
1526
|
+
return;
|
|
1527
|
+
}
|
|
1528
|
+
};
|
|
1033
1529
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1034
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", 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 .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}::ng-deep .sd-loading-option{min-height:50px!important}.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]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[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 });
|
|
1530
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", 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 .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}::ng-deep .sd-loading-option{min-height:50px!important}.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]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[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 });
|
|
1035
1531
|
}
|
|
1036
1532
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSelect, decorators: [{
|
|
1037
1533
|
type: Component,
|
|
1038
|
-
args: [{ selector: 'sd-select', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, host: {
|
|
1534
|
+
args: [{ selector: 'sd-select', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, host: {
|
|
1535
|
+
'[class.sd-bare]': 'isInline()',
|
|
1536
|
+
'[class.sd-viewed]': 'isViewed() || isInline()',
|
|
1537
|
+
'[class.sd-has-label]': '!!label()',
|
|
1538
|
+
'[class.sd-label-top]': "labelPlacement() === 'top'",
|
|
1539
|
+
}, imports: [
|
|
1039
1540
|
SdDataState,
|
|
1040
1541
|
SdDataStateTemplateDirective,
|
|
1041
1542
|
SdTooltipDirective,
|
|
@@ -1053,8 +1554,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
1053
1554
|
SdView,
|
|
1054
1555
|
SdSelectFooterActionDirective,
|
|
1055
1556
|
SdTranslatePipe,
|
|
1056
|
-
], 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 .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}::ng-deep .sd-loading-option{min-height:50px!important}.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"] }]
|
|
1057
|
-
}], 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"] }] } });
|
|
1557
|
+
ScrollingModule,
|
|
1558
|
+
], 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 .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}::ng-deep .sd-loading-option{min-height:50px!important}.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"] }]
|
|
1559
|
+
}], 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"] }] } });
|
|
1058
1560
|
|
|
1059
1561
|
/**
|
|
1060
1562
|
* Generated bundle index. Do not edit.
|