@sdcorejs/angular 21.3.1 → 21.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/assets/STYLE-GUIDE.md +25 -5
  2. package/assets/THEME.md +237 -5
  3. package/assets/licenses/tiptap-oss-NOTICES.txt +332 -0
  4. package/assets/scss/ckeditor5.scss +2 -88
  5. package/assets/scss/core/_control.scss +39 -0
  6. package/assets/scss/core/form.scss +156 -45
  7. package/assets/scss/core/view.scss +24 -0
  8. package/assets/scss/editor-content.scss +173 -0
  9. package/assets/scss/sd-core.scss +1 -0
  10. package/assets/scss/themes/_component-tokens.scss +93 -31
  11. package/assets/scss/themes/_material-tokens.scss +112 -0
  12. package/assets/scss/themes/_presets.scss +25 -0
  13. package/assets/scss/themes/_scales.scss +10 -0
  14. package/assets/scss/themes/_semantic.scss +13 -0
  15. package/assets/scss/themes/default.scss +8 -2
  16. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +5 -5
  17. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
  18. package/fesm2022/sdcorejs-angular-components-avatar.mjs +142 -11
  19. package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
  20. package/fesm2022/sdcorejs-angular-components-badge.mjs +542 -24
  21. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  22. package/fesm2022/sdcorejs-angular-components-button.mjs +31 -3
  23. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  24. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +5 -20
  25. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
  26. package/fesm2022/sdcorejs-angular-components-data-state.mjs +1 -1
  27. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
  28. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1872 -0
  29. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -0
  30. package/fesm2022/sdcorejs-angular-components-editor.mjs +457 -756
  31. package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
  32. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +68 -37
  33. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
  34. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +2115 -1156
  35. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  36. package/fesm2022/sdcorejs-angular-components-history.mjs +5 -2
  37. package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
  38. package/fesm2022/sdcorejs-angular-components-image-editor.mjs +1 -1
  39. package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -1
  40. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +21 -6
  41. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  42. package/fesm2022/sdcorejs-angular-components-inform.mjs +1 -1
  43. package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
  44. package/fesm2022/sdcorejs-angular-components-kanban.mjs +12 -2
  45. package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -1
  46. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +177 -283
  47. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
  48. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +1 -308
  49. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
  50. package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
  51. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  52. package/fesm2022/sdcorejs-angular-components-operator.mjs +260 -43
  53. package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
  54. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +12 -12
  55. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  56. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
  57. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  58. package/fesm2022/sdcorejs-angular-components-section.mjs +2 -2
  59. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  60. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  61. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  62. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +192 -42
  63. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  64. package/fesm2022/sdcorejs-angular-components-table.mjs +564 -110
  65. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  66. package/fesm2022/sdcorejs-angular-components-tree.mjs +1 -1
  67. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  68. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +1 -1
  69. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  70. package/fesm2022/sdcorejs-angular-components-view.mjs +2 -2
  71. package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
  72. package/fesm2022/sdcorejs-angular-components-window.mjs +484 -0
  73. package/fesm2022/sdcorejs-angular-components-window.mjs.map +1 -0
  74. package/fesm2022/sdcorejs-angular-components.mjs +1 -0
  75. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  76. package/fesm2022/sdcorejs-angular-configurations.mjs.map +1 -1
  77. package/fesm2022/sdcorejs-angular-directives.mjs +18 -1
  78. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  79. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +15 -2
  80. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  81. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +2 -2
  82. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
  83. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +454 -125
  84. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  85. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +75 -13
  86. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  87. package/fesm2022/sdcorejs-angular-forms-date.mjs +71 -18
  88. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  89. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +75 -16
  90. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  91. package/fesm2022/sdcorejs-angular-forms-directives.mjs +82 -2
  92. package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
  93. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
  94. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
  95. package/fesm2022/sdcorejs-angular-forms-input-color.mjs +1 -1
  96. package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
  97. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +40 -5
  98. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  99. package/fesm2022/sdcorejs-angular-forms-input.mjs +50 -7
  100. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  101. package/fesm2022/sdcorejs-angular-forms-models.mjs +88 -5
  102. package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
  103. package/fesm2022/sdcorejs-angular-forms-radio.mjs +2 -2
  104. package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
  105. package/fesm2022/sdcorejs-angular-forms-segmented.mjs +5 -4
  106. package/fesm2022/sdcorejs-angular-forms-segmented.mjs.map +1 -1
  107. package/fesm2022/sdcorejs-angular-forms-select.mjs +63 -15
  108. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  109. package/fesm2022/sdcorejs-angular-forms-switch.mjs +2 -2
  110. package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
  111. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +2 -2
  112. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  113. package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
  114. package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
  115. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
  116. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
  117. package/fesm2022/sdcorejs-angular-i18n.mjs +1535 -22
  118. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  119. package/fesm2022/sdcorejs-angular-interceptors.mjs +1 -1
  120. package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
  121. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-MlNJ6DDc.mjs +478 -0
  122. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-MlNJ6DDc.mjs.map +1 -0
  123. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-_PcU75h9.mjs +214 -0
  124. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-_PcU75h9.mjs.map +1 -0
  125. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-qcvv7QK6.mjs +277 -0
  126. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-qcvv7QK6.mjs.map +1 -0
  127. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs +1556 -0
  128. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-B1fYY5yX.mjs.map +1 -0
  129. package/fesm2022/sdcorejs-angular-modules-generic.mjs +2 -0
  130. package/fesm2022/sdcorejs-angular-modules-generic.mjs.map +1 -0
  131. package/fesm2022/sdcorejs-angular-modules-icon.mjs +96 -3
  132. package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
  133. package/fesm2022/sdcorejs-angular-modules-layout.mjs +1825 -62
  134. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  135. package/fesm2022/sdcorejs-angular-modules.mjs +1 -0
  136. package/fesm2022/sdcorejs-angular-modules.mjs.map +1 -1
  137. package/fesm2022/sdcorejs-angular-pipes.mjs +27 -7
  138. package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
  139. package/fesm2022/sdcorejs-angular-services-confirm.mjs +1 -1
  140. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  141. package/fesm2022/sdcorejs-angular-services-date-time.mjs +143 -0
  142. package/fesm2022/sdcorejs-angular-services-date-time.mjs.map +1 -0
  143. package/fesm2022/sdcorejs-angular-services-storage.mjs +44 -8
  144. package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
  145. package/fesm2022/sdcorejs-angular-services.mjs +1 -0
  146. package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
  147. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs +4 -0
  148. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs.map +1 -1
  149. package/fesm2022/sdcorejs-angular-utilities-theme.mjs +10 -0
  150. package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -1
  151. package/package.json +40 -7
  152. package/types/sdcorejs-angular-components-avatar.d.ts +67 -2
  153. package/types/sdcorejs-angular-components-badge.d.ts +188 -6
  154. package/types/sdcorejs-angular-components-button.d.ts +20 -1
  155. package/types/sdcorejs-angular-components-ckeditor-styles.d.ts +3 -18
  156. package/types/sdcorejs-angular-components-editor-engine.d.ts +246 -0
  157. package/types/sdcorejs-angular-components-editor.d.ts +20 -17
  158. package/types/sdcorejs-angular-components-file-explorer.d.ts +4 -2
  159. package/types/sdcorejs-angular-components-form-generic.d.ts +246 -35
  160. package/types/sdcorejs-angular-components-mini-editor.d.ts +33 -70
  161. package/types/sdcorejs-angular-components-modal-resizable.d.ts +1 -124
  162. package/types/sdcorejs-angular-components-operator.d.ts +137 -8
  163. package/types/sdcorejs-angular-components-tab-router.d.ts +31 -18
  164. package/types/sdcorejs-angular-components-table.d.ts +84 -6
  165. package/types/sdcorejs-angular-components-window.d.ts +81 -0
  166. package/types/sdcorejs-angular-components.d.ts +1 -0
  167. package/types/sdcorejs-angular-configurations.d.ts +8 -1
  168. package/types/sdcorejs-angular-forms-autocomplete.d.ts +5 -0
  169. package/types/sdcorejs-angular-forms-chip-calendar.d.ts +163 -18
  170. package/types/sdcorejs-angular-forms-date-range.d.ts +24 -2
  171. package/types/sdcorejs-angular-forms-date.d.ts +23 -2
  172. package/types/sdcorejs-angular-forms-directives.d.ts +47 -2
  173. package/types/sdcorejs-angular-forms-input-number.d.ts +23 -2
  174. package/types/sdcorejs-angular-forms-input.d.ts +23 -2
  175. package/types/sdcorejs-angular-forms-models.d.ts +38 -3
  176. package/types/sdcorejs-angular-forms-select.d.ts +32 -2
  177. package/types/sdcorejs-angular-i18n.d.ts +302 -2
  178. package/types/sdcorejs-angular-modules-generic.d.ts +316 -0
  179. package/types/sdcorejs-angular-modules-icon.d.ts +37 -6
  180. package/types/sdcorejs-angular-modules-layout.d.ts +536 -86
  181. package/types/sdcorejs-angular-modules.d.ts +1 -0
  182. package/types/sdcorejs-angular-pipes.d.ts +2 -0
  183. package/types/sdcorejs-angular-services-date-time.d.ts +57 -0
  184. package/types/sdcorejs-angular-services-storage.d.ts +8 -1
  185. package/types/sdcorejs-angular-services.d.ts +1 -0
  186. package/types/sdcorejs-angular-utilities-read-state.d.ts +2 -0
  187. package/types/sdcorejs-angular-utilities-theme.d.ts +1 -1
@@ -1,76 +1,126 @@
1
- import { ENTER, COMMA } from '@angular/cdk/keycodes';
1
+ import * as i8 from '@angular/cdk/a11y';
2
+ import { A11yModule } from '@angular/cdk/a11y';
3
+ import * as i7 from '@angular/cdk/overlay';
4
+ import { OverlayModule } from '@angular/cdk/overlay';
2
5
  import * as i1 from '@angular/common';
3
- import { CommonModule } from '@angular/common';
6
+ import { formatDate, CommonModule } from '@angular/common';
4
7
  import * as i0 from '@angular/core';
5
- import { Pipe, inject, ChangeDetectorRef, viewChild, input, computed, booleanAttribute, model, output, contentChild, effect, ChangeDetectionStrategy, Component } from '@angular/core';
8
+ import { inject, ChangeDetectionStrategy, Component, ChangeDetectorRef, ElementRef, LOCALE_ID, viewChild, signal, input, computed, booleanAttribute, model, output, contentChild, effect, isDevMode, DestroyRef } from '@angular/core';
9
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
10
  import { Utilities, DateUtilities } from '@sdcorejs/utils/fns';
7
11
  import * as i2 from '@angular/forms';
8
- import { NgForm, FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
- import { MatAutocompleteModule } from '@angular/material/autocomplete';
12
+ import { FormGroupDirective, NgForm, FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
10
13
  import * as i5 from '@angular/material/chips';
11
14
  import { MatChipsModule } from '@angular/material/chips';
12
15
  import { MatNativeDateModule } from '@angular/material/core';
13
16
  import * as i6 from '@angular/material/datepicker';
14
- import { MatCalendar, MatDatepickerModule } from '@angular/material/datepicker';
15
- import { MatFormFieldModule } from '@angular/material/form-field';
17
+ import { MatCalendarHeader, MatCalendar, MatDatepickerModule } from '@angular/material/datepicker';
18
+ import { MatFormField, MatFormFieldModule } from '@angular/material/form-field';
16
19
  import * as i3 from '@angular/material/input';
17
20
  import { MatInputModule } from '@angular/material/input';
18
- import * as i7 from '@angular/material/menu';
19
- import { MatMenuTrigger, MatMenuModule } from '@angular/material/menu';
20
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
21
21
  import * as i4 from '@angular/material/tooltip';
22
22
  import { MatTooltipModule } from '@angular/material/tooltip';
23
+ import { SdButton } from '@sdcorejs/angular/components/button';
23
24
  import { SdView } from '@sdcorejs/angular/components/view';
24
25
  import { SdViewDefDirective, SdLabelDefDirective } from '@sdcorejs/angular/forms/directives';
25
26
  import { SdLabel } from '@sdcorejs/angular/forms/label';
26
- import { ɵsdTimerScope as _sdTimerScope, sdFormControlState, sdViewedTransform, sdViewedInline, SdFormControl, ɵsdFormControlConnector as _sdFormControlConnector } from '@sdcorejs/angular/forms/models';
27
- import { I18nService } from '@sdcorejs/angular/i18n';
27
+ import { ɵsdTimerScope as _sdTimerScope, sdFormControlState, sdViewedTransform, sdViewedInline, SdFormControl, ɵsdModelFacingControl as _sdModelFacingControl, ɵsdFormControlConnector as _sdFormControlConnector, ɵsdNormalizeCalendarDay as _sdNormalizeCalendarDay, sdLocalStartOfDay, sdSerializeTemporalValue } from '@sdcorejs/angular/forms/models';
28
+ import { I18nService, SdTranslatePipe } from '@sdcorejs/angular/i18n';
29
+ import { SdDateTimeService } from '@sdcorejs/angular/services/date-time';
28
30
  import { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';
29
31
  import { Subscription } from 'rxjs';
30
32
  import { SdIcon } from '@sdcorejs/angular/modules/icon';
31
33
 
32
- class SdRemovableChipPipe {
33
- constructor() { }
34
- transform(item, removable) {
35
- if (typeof removable === 'boolean') {
36
- return removable;
37
- }
38
- return removable(item);
34
+ /**
35
+ * Header of the `<sd-chip-calendar>` popup (design handoff 3 · 2): previous button, period label, next button, in that
36
+ * tab order. Extends Material's header for the paging rules, the min/max limits and the `MatDatepickerIntl` labels;
37
+ * only the markup and the month label change. The month label is the current locale's long month and year
38
+ * (`Intl.DateTimeFormat`), capitalised; the year and multi-year views keep Material's labels.
39
+ *
40
+ * Internal (`ɵ`): not covered by SemVer.
41
+ */
42
+ class ɵSdChipCalendarHeader extends MatCalendarHeader {
43
+ #i18n = inject(I18nService);
44
+ /** Visible period text: "Tháng 10 năm 2026" in month view, Material's text in the other views. */
45
+ get periodText() {
46
+ if (this.calendar.currentView !== 'month')
47
+ return this.periodButtonText;
48
+ const text = new Intl.DateTimeFormat(this.#i18n.locale(), { month: 'long', year: 'numeric' }).format(this.calendar.activeDate);
49
+ return text.charAt(0).toLocaleUpperCase(this.#i18n.locale()) + text.slice(1);
39
50
  }
40
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdRemovableChipPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
41
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.17", ngImport: i0, type: SdRemovableChipPipe, isStandalone: true, name: "sdRemovableChip" });
51
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ɵSdChipCalendarHeader, deps: null, target: i0.ɵɵFactoryTarget.Component });
52
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: ɵSdChipCalendarHeader, isStandalone: true, selector: "sd-chip-calendar-header", usesInheritance: true, ngImport: i0, template: "<!-- why: th\u1EE9 t\u1EF1 DOM = th\u1EE9 t\u1EF1 Tab c\u1EE7a th\u00F4ng s\u1ED1 (tr\u01B0\u1EDBc, nh\u00E3n, sau). Nh\u00E3n m\u00F4 t\u1EA3 n\u1EB1m trong v\u00F9ng aria-live \u1EA9n nh\u01B0 header\n m\u1EB7c \u0111\u1ECBnh c\u1EE7a Material, \u0111\u1EC3 screen reader \u0111\u1ECDc k\u1EF3 m\u1EDBi khi chuy\u1EC3n th\u00E1ng. -->\n<div class=\"sd-chip-calendar-header\">\n <span [id]=\"_periodButtonLabelId\" class=\"sd-visually-hidden\" aria-live=\"polite\">{{ periodButtonDescription }}</span>\n <button\n type=\"button\"\n class=\"sd-chip-calendar-header__nav\"\n data-chip-calendar-previous\n [disabled]=\"!previousEnabled()\"\n [attr.aria-label]=\"prevButtonLabel\"\n (click)=\"previousClicked()\">\n <sd-icon name=\"chevron_left\" size=\"20px\" aria-hidden=\"true\" />\n </button>\n <button\n type=\"button\"\n class=\"sd-chip-calendar-header__period\"\n data-chip-calendar-period\n [attr.aria-label]=\"periodButtonLabel\"\n [attr.aria-describedby]=\"_periodButtonLabelId\"\n (click)=\"currentPeriodClicked()\">\n <span aria-hidden=\"true\">{{ periodText }}</span>\n </button>\n <button\n type=\"button\"\n class=\"sd-chip-calendar-header__nav\"\n data-chip-calendar-next\n [disabled]=\"!nextEnabled()\"\n [attr.aria-label]=\"nextButtonLabel\"\n (click)=\"nextClicked()\">\n <sd-icon name=\"chevron_right\" size=\"20px\" aria-hidden=\"true\" />\n </button>\n</div>\n", styles: [".sd-chip-calendar-header{display:flex;align-items:center;justify-content:space-between;height:40px;margin-top:4px}.sd-chip-calendar-header__nav,.sd-chip-calendar-header__period{display:inline-flex;align-items:center;justify-content:center;margin:0;border:0;border-radius:8px;background:transparent;font:inherit;cursor:pointer}.sd-chip-calendar-header__nav:hover:not(:disabled),.sd-chip-calendar-header__period:hover:not(:disabled){background:color-mix(in srgb,var(--sd-text) 5%,transparent)}.sd-chip-calendar-header__nav:focus-visible,.sd-chip-calendar-header__period:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color);outline-offset:1px}.sd-chip-calendar-header__nav:disabled,.sd-chip-calendar-header__period:disabled{color:var(--sd-disabled-text);cursor:default}.sd-chip-calendar-header__nav{width:32px;height:32px;padding:0;color:var(--sd-text-secondary)}.sd-chip-calendar-header__period{height:32px;padding:0 8px;color:var(--sd-text);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600)}.sd-visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}@media(prefers-reduced-motion:no-preference){.sd-chip-calendar-header__nav,.sd-chip-calendar-header__period{transition:background-color var(--sd-duration-fast, .12s) ease}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
42
53
  }
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdRemovableChipPipe, decorators: [{
44
- type: Pipe,
45
- args: [{
46
- name: 'sdRemovableChip',
47
- }]
48
- }], ctorParameters: () => [] });
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: ɵSdChipCalendarHeader, decorators: [{
55
+ type: Component,
56
+ args: [{ selector: 'sd-chip-calendar-header', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdIcon], template: "<!-- why: th\u1EE9 t\u1EF1 DOM = th\u1EE9 t\u1EF1 Tab c\u1EE7a th\u00F4ng s\u1ED1 (tr\u01B0\u1EDBc, nh\u00E3n, sau). Nh\u00E3n m\u00F4 t\u1EA3 n\u1EB1m trong v\u00F9ng aria-live \u1EA9n nh\u01B0 header\n m\u1EB7c \u0111\u1ECBnh c\u1EE7a Material, \u0111\u1EC3 screen reader \u0111\u1ECDc k\u1EF3 m\u1EDBi khi chuy\u1EC3n th\u00E1ng. -->\n<div class=\"sd-chip-calendar-header\">\n <span [id]=\"_periodButtonLabelId\" class=\"sd-visually-hidden\" aria-live=\"polite\">{{ periodButtonDescription }}</span>\n <button\n type=\"button\"\n class=\"sd-chip-calendar-header__nav\"\n data-chip-calendar-previous\n [disabled]=\"!previousEnabled()\"\n [attr.aria-label]=\"prevButtonLabel\"\n (click)=\"previousClicked()\">\n <sd-icon name=\"chevron_left\" size=\"20px\" aria-hidden=\"true\" />\n </button>\n <button\n type=\"button\"\n class=\"sd-chip-calendar-header__period\"\n data-chip-calendar-period\n [attr.aria-label]=\"periodButtonLabel\"\n [attr.aria-describedby]=\"_periodButtonLabelId\"\n (click)=\"currentPeriodClicked()\">\n <span aria-hidden=\"true\">{{ periodText }}</span>\n </button>\n <button\n type=\"button\"\n class=\"sd-chip-calendar-header__nav\"\n data-chip-calendar-next\n [disabled]=\"!nextEnabled()\"\n [attr.aria-label]=\"nextButtonLabel\"\n (click)=\"nextClicked()\">\n <sd-icon name=\"chevron_right\" size=\"20px\" aria-hidden=\"true\" />\n </button>\n</div>\n", styles: [".sd-chip-calendar-header{display:flex;align-items:center;justify-content:space-between;height:40px;margin-top:4px}.sd-chip-calendar-header__nav,.sd-chip-calendar-header__period{display:inline-flex;align-items:center;justify-content:center;margin:0;border:0;border-radius:8px;background:transparent;font:inherit;cursor:pointer}.sd-chip-calendar-header__nav:hover:not(:disabled),.sd-chip-calendar-header__period:hover:not(:disabled){background:color-mix(in srgb,var(--sd-text) 5%,transparent)}.sd-chip-calendar-header__nav:focus-visible,.sd-chip-calendar-header__period:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color);outline-offset:1px}.sd-chip-calendar-header__nav:disabled,.sd-chip-calendar-header__period:disabled{color:var(--sd-disabled-text);cursor:default}.sd-chip-calendar-header__nav{width:32px;height:32px;padding:0;color:var(--sd-text-secondary)}.sd-chip-calendar-header__period{height:32px;padding:0 8px;color:var(--sd-text);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600)}.sd-visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}@media(prefers-reduced-motion:no-preference){.sd-chip-calendar-header__nav,.sd-chip-calendar-header__period{transition:background-color var(--sd-duration-fast, .12s) ease}}\n"] }]
57
+ }] });
49
58
 
50
- class SdChipCalendarErrorStateMatcher {
51
- formControl;
52
- constructor(formControl) {
53
- this.formControl = formControl;
54
- }
55
- isErrorState(control, form) {
56
- const isSubmitted = form && form.submitted;
57
- return !!(this.formControl?.invalid && (this.formControl?.dirty || this.formControl?.touched || isSubmitted));
58
- }
59
+ /**
60
+ * Icon sizes of the field by size (handoff 2 · Kích thước): chip ✕ / lock, clear button, calendar button.
61
+ * The chip icons are one step below the handoff table (14 / 16 / 18px looked heavy next to the 13–14px date).
62
+ */
63
+ const FIELD_ICONS = {
64
+ sm: { chip: '12px', clear: '16px', open: '18px' },
65
+ md: { chip: '14px', clear: '18px', open: '20px' },
66
+ lg: { chip: '16px', clear: '20px', open: '22px' },
67
+ };
68
+ const FULL_DATE = { day: 'numeric', month: 'long', year: 'numeric' };
69
+ /** Same days in the same order. */
70
+ function sameDays(left, right) {
71
+ if (left === right)
72
+ return true;
73
+ if (!left || !right || left.length !== right.length)
74
+ return false;
75
+ return left.every((value, index) => Object.is(value, right[index]));
76
+ }
77
+ /** `yyyy/MM/dd` → local midnight of that day (the carrier `mat-calendar` and `Intl` work with). */
78
+ function dayToDate(day) {
79
+ const [year, month, date] = day.split('/').map(Number);
80
+ return new Date(year, month - 1, date);
59
81
  }
60
82
  class SdChipCalendar {
61
83
  #ref = inject(ChangeDetectorRef);
62
84
  #i18n = inject(I18nService);
85
+ #dateTime = inject(SdDateTimeService);
86
+ #zoned = this.#dateTime.timeZone !== 'local';
87
+ // why: lỗi phải hiện khi form cha đã submit dù field chưa chạm (A4). NgForm / FormGroupDirective tổ tiên
88
+ // giữ cờ `submitted`; MatInput cũng lấy đúng hai directive này cho ErrorStateMatcher.
89
+ #parentForm = inject(FormGroupDirective, { optional: true }) ?? inject(NgForm, { optional: true });
90
+ #host = inject(ElementRef).nativeElement;
91
+ #locale = inject(LOCALE_ID);
63
92
  // why: focus hoãn 100ms; handle phải bị clear khi destroy, nếu không timer vẫn chạm
64
93
  // input của view đã tháo.
65
94
  #timers = _sdTimerScope();
66
95
  #subscription = new Subscription();
67
96
  #name = Utilities.generateUuid();
68
- #isBlurring = false;
97
+ #warnedUnreadable = false;
98
+ #warnedDeprecated = false;
69
99
  /** why: id ổn định của <mat-error> để ô nhập chip trỏ `aria-describedby` sang — thông báo
70
100
  * lỗi phải đọc được từ chính control, không chỉ hiện ra màn hình. */
71
101
  errorId = `sd-chip-calendar-error-${Utilities.generateUuid()}`;
72
- menuTrigger = viewChild(MatMenuTrigger, ...(ngDevMode ? [{ debugName: "menuTrigger" }] : /* istanbul ignore next */ []));
73
102
  calendar = viewChild(MatCalendar, ...(ngDevMode ? [{ debugName: "calendar" }] : /* istanbul ignore next */ []));
103
+ // why: query signal không đặt được trên field ES private (#).
104
+ field = viewChild(MatFormField, ...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
105
+ /** Header of the popup calendar (handoff 3 · 2). */
106
+ calendarHeader = ɵSdChipCalendarHeader;
107
+ panelId = `sd-chip-calendar-panel-${Utilities.generateUuid()}`;
108
+ /** Whether the popup is open. */
109
+ isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
110
+ /** Month the popup opened at (4.2), fixed for one opening. */
111
+ openAt = signal(null, ...(ngDevMode ? [{ debugName: "openAt" }] : /* istanbul ignore next */ []));
112
+ /**
113
+ * The popup hangs from the field box (the outline), like the select panel. Read in `open()`: `_textField` of
114
+ * `MatFormField` is a view query, and read too early the origin falls back to the whole field with its subscript row.
115
+ */
116
+ overlayOrigin = signal(undefined, ...(ngDevMode ? [{ debugName: "overlayOrigin" }] : /* istanbul ignore next */ []));
117
+ // why: cách khung ô 6px như panel sd-select / menu operator / badge picker (quyết định 3 của PLAN); lật lên khi thiếu chỗ.
118
+ positions = [
119
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 6 },
120
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -6 },
121
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 6 },
122
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -6 },
123
+ ];
74
124
  autoIdInput = input(undefined, { ...(ngDevMode ? { debugName: "autoIdInput" } : /* istanbul ignore next */ {}), alias: 'autoId',
75
125
  transform: (v) => v ?? undefined });
76
126
  autoId = computed(() => (this.autoIdInput() ? `forms-chip-calendar-${this.autoIdInput()}` : undefined), ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
@@ -118,20 +168,57 @@ class SdChipCalendar {
118
168
  } });
119
169
  label = input('', { ...(ngDevMode ? { debugName: "label" } : /* istanbul ignore next */ {}), transform: (v) => v ?? '' });
120
170
  placeholder = input(undefined, { ...(ngDevMode ? { debugName: "placeholder" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
171
+ /**
172
+ * `true` / `false` for every chip, or a predicate. The predicate receives the normalised `yyyy/MM/dd` day and is
173
+ * applied on every removal path: the ✕ button, Backspace / Delete on a chip, pressing the day again in the
174
+ * calendar and clearing.
175
+ */
121
176
  removable = input(true, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: (v) => v ?? true });
122
177
  hideInlineError = input(false, { ...(ngDevMode ? { debugName: "hideInlineError" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
123
178
  required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
179
+ /** Fewest days to pick; > 0 adds `Validators.minLength`. Replaces `min`. */
180
+ minCount = input(undefined, { ...(ngDevMode ? { debugName: "minCount" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
181
+ /** Most days to pick; > 0 adds `Validators.maxLength` and blocks picking more in the calendar (4.3). Replaces `max`. */
182
+ maxCount = input(undefined, { ...(ngDevMode ? { debugName: "maxCount" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
183
+ /** @deprecated Use `minCount`; `minCount` wins when both are set. */
124
184
  min = input(0, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: (v) => v ?? 0 });
185
+ /** @deprecated Use `maxCount`; `maxCount` wins when both are set. */
125
186
  max = input(0, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: (v) => v ?? 0 });
187
+ /** Earliest day that can be picked; same reading as `minDate` of `<sd-date>` (`'TODAY'` = today in the zone). */
188
+ minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
189
+ /** Latest day that can be picked; same reading as `maxDate` of `<sd-date>`. */
190
+ maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
191
+ /** `false` makes a day unpickable. A chosen day stays removable even when the filter refuses it. Name of `mat-calendar`. */
192
+ dateFilter = input(null, ...(ngDevMode ? [{ debugName: "dateFilter" }] : /* istanbul ignore next */ []));
193
+ /** Month the popup opens at; without it, the chosen day nearest to today, else today (4.2). */
194
+ startAt = input(null, ...(ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []));
195
+ /** Shows “Xoá hết” in the popup (and the clear button of the field). Off by default, like `clearable` of `<sd-date>`. */
196
+ clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
197
+ /**
198
+ * Chips shown while the popup is closed; the rest fold into a “+N” button that opens it. `null` shows them all.
199
+ * `2` is the suggestion inside `<sd-table>` filters.
200
+ */
201
+ maxVisible = input(null, ...(ngDevMode ? [{ debugName: "maxVisible" }] : /* istanbul ignore next */ []));
202
+ /** Date format of the chips and of the viewed text, in Angular `DatePipe` syntax. */
203
+ displayFormat = input('dd/MM/yyyy', { ...(ngDevMode ? { debugName: "displayFormat" } : /* istanbul ignore next */ {}), transform: (v) => v || 'dd/MM/yyyy' });
126
204
  disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
127
205
  /** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */
128
206
  viewed = input(false, { ...(ngDevMode ? { debugName: "viewed" } : /* istanbul ignore next */ {}), transform: sdViewedTransform });
207
+ /**
208
+ * String form of each day when the value leaves the component, same contract as `<sd-date>`: `undefined` →
209
+ * `yyyy/MM/dd`, `'ISOString'` / `'UTCString'` → the start of the day (in `ISdCoreConfiguration.timeZone` when
210
+ * configured). Display is not affected.
211
+ */
212
+ transform = input(...(ngDevMode ? [undefined, { debugName: "transform" }] : /* istanbul ignore next */ []));
129
213
  // why: tri-state viewed — `'inline'` keeps it interactive; disabled `'inline'` falls back to static.
130
214
  #viewedState = sdViewedInline(this.viewed, undefined, this.disabled);
131
215
  /** `true` when the static view should render (`viewed===true`, or disabled `'inline'`). */
132
216
  isViewed = this.#viewedState.isViewed;
133
217
  hyperlink = input(undefined, { ...(ngDevMode ? { debugName: "hyperlink" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
134
- // Two-way model
218
+ /**
219
+ * Two-way model. Read wide (each item `string | number | Date`, like `<sd-date>`), written back only on a user
220
+ * action, as `string[]`. A model from the parent is never rewritten.
221
+ */
135
222
  model = model(undefined, ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
136
223
  // Outputs (modelChange auto-generated by model() signal)
137
224
  sdChange = output();
@@ -142,46 +229,135 @@ class SdChipCalendar {
142
229
  sdValueTemplate = contentChild('sdValue', ...(ngDevMode ? [{ debugName: "sdValueTemplate" }] : /* istanbul ignore next */ []));
143
230
  isFocused = false;
144
231
  #inputControl = new FormControl();
232
+ /** Holds the normalised days (`yyyy/MM/dd`, no duplicates, model order); the parent form gets this control
233
+ * unless a `transform` is set. */
145
234
  #formControl = new SdFormControl();
146
235
  // why: `min`/`max` là validator do CHÍNH component sở hữu; `required` đi qua option riêng của
147
236
  // connector. Connector chỉ add/remove đúng phần này nên validator do consumer tự gắn vào
148
237
  // `formControl` public không bị xoá — trước đây `clearValidators()` + `setValidators()` xoá sạch.
238
+ /** `minCount`, else the deprecated `min`. */
239
+ effectiveMinCount = computed(() => this.minCount() ?? this.min() ?? 0, ...(ngDevMode ? [{ debugName: "effectiveMinCount" }] : /* istanbul ignore next */ []));
240
+ /** `maxCount`, else the deprecated `max`. */
241
+ effectiveMaxCount = computed(() => this.maxCount() ?? this.max() ?? 0, ...(ngDevMode ? [{ debugName: "effectiveMaxCount" }] : /* istanbul ignore next */ []));
149
242
  #validators = computed(() => {
150
243
  const validators = [];
151
- const min = this.min();
152
- const max = this.max();
244
+ const min = this.effectiveMinCount();
245
+ const max = this.effectiveMaxCount();
153
246
  if (min > 0)
154
247
  validators.push(Validators.minLength(min));
155
248
  if (max > 0)
156
249
  validators.push(Validators.maxLength(max));
157
250
  return validators;
158
251
  }, ...(ngDevMode ? [{ debugName: "#validators" }] : /* istanbul ignore next */ []));
252
+ /**
253
+ * why: with a `transform` the model holds ISO / RFC-1123 strings while the control keeps `yyyy/MM/dd`. Like
254
+ * `<sd-date>`, the parent form then gets a control that carries the model, so `form.value` equals `modelChange`.
255
+ */
256
+ #modelFacing = _sdModelFacingControl({
257
+ active: computed(() => !!this.transform()),
258
+ model: this.model,
259
+ writeModel: value => this.#writeModel(value),
260
+ source: computed(() => this.#formControl),
261
+ modelEquals: (left, right) => this.#modelsEqual(left, right),
262
+ });
159
263
  #formConnector = _sdFormControlConnector({
160
264
  form: this.form,
161
265
  name: computed(() => this.name() || this.#name),
162
266
  control: computed(() => this.#formControl),
267
+ registeredControl: this.#modelFacing.registered,
268
+ model: this.model,
269
+ writeModel: value => this.#writeModel(value),
270
+ modelToControl: value => this.#days(value),
271
+ controlToModel: days => this.#serializeDays(days),
272
+ modelEquals: (left, right) => this.#modelsEqual(left, right),
273
+ controlEquals: sameDays,
163
274
  validators: this.#validators,
164
275
  required: this.required,
165
276
  });
166
277
  #matcher;
167
- separatorKeysCodes = [ENTER, COMMA];
278
+ #fullDate = computed(() => new Intl.DateTimeFormat(this.#i18n.locale(), FULL_DATE), ...(ngDevMode ? [{ debugName: "#fullDate" }] : /* istanbul ignore next */ []));
279
+ /** Chosen days, normalised (`yyyy/MM/dd`, model order). */
280
+ days = computed(() => this.#days(this.model()) ?? [], ...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
281
+ /** `maxCount` reached: unchosen days are disabled and the popup says so (4.3). */
282
+ full = computed(() => {
283
+ const max = this.effectiveMaxCount();
284
+ return max > 0 && this.days().length >= max;
285
+ }, ...(ngDevMode ? [{ debugName: "full" }] : /* istanbul ignore next */ []));
286
+ /** At least one chosen day may be removed (enables “Xoá hết”). */
287
+ hasRemovable = computed(() => {
288
+ void this.removable();
289
+ return this.days().some(day => this.isRemovable(day));
290
+ }, ...(ngDevMode ? [{ debugName: "hasRemovable" }] : /* istanbul ignore next */ []));
291
+ /** Chosen days by date (B2). Display only: the model keeps its order. `yyyy/MM/dd` sorts as text in date order. */
292
+ sortedDays = computed(() => [...this.days()].sort(), ...(ngDevMode ? [{ debugName: "sortedDays" }] : /* istanbul ignore next */ []));
293
+ /** Chips on screen: all while the popup is open, else at most `maxVisible` (B3). */
294
+ visibleDays = computed(() => {
295
+ const days = this.sortedDays();
296
+ const max = this.maxVisible();
297
+ if (this.isOpen() || max === null || max === undefined || max < 0 || days.length <= max)
298
+ return days;
299
+ return days.slice(0, max);
300
+ }, ...(ngDevMode ? [{ debugName: "visibleDays" }] : /* istanbul ignore next */ []));
301
+ /** Icon sizes of the chips and suffix buttons for the current size. */
302
+ iconSizes = computed(() => FIELD_ICONS[this.size() === 'sm' || this.size() === 'lg' ? this.size() : 'md'], ...(ngDevMode ? [{ debugName: "iconSizes" }] : /* istanbul ignore next */ []));
303
+ /** Days folded into “+N”. */
304
+ hiddenCount = computed(() => this.sortedDays().length - this.visibleDays().length, ...(ngDevMode ? [{ debugName: "hiddenCount" }] : /* istanbul ignore next */ []));
305
+ /** Viewed text: days by date in `displayFormat`, joined by “, ” (C3). */
306
+ viewText = computed(() => this.sortedDays()
307
+ .map(day => this.formatDay(day))
308
+ .join(', '), ...(ngDevMode ? [{ debugName: "viewText" }] : /* istanbul ignore next */ []));
309
+ /** Placeholder while no day is chosen: the input, else “Chọn ngày” — no longer the label (B1). Empty once there are chips. */
310
+ effectivePlaceholder = computed(() => this.days().length ? '' : this.placeholder() || this.#i18n.t('core.form.chip-calendar.placeholder'), ...(ngDevMode ? [{ debugName: "effectivePlaceholder" }] : /* istanbul ignore next */ []));
311
+ resolvedMinDate = computed(() => this.#toDate(this.minDate()), ...(ngDevMode ? [{ debugName: "resolvedMinDate" }] : /* istanbul ignore next */ []));
312
+ resolvedMaxDate = computed(() => this.#toDate(this.maxDate()), ...(ngDevMode ? [{ debugName: "resolvedMaxDate" }] : /* istanbul ignore next */ []));
313
+ /**
314
+ * `dateFilter` handed to `mat-calendar` (4.1): a chosen day is pickable exactly when it may be removed (even against the
315
+ * consumer filter), an unchosen one when the limit is not reached and the consumer filter allows it. A new function on
316
+ * every change makes `mat-calendar` render its cells again.
317
+ */
318
+ calendarFilter = computed(() => {
319
+ const chosen = new Set(this.days());
320
+ const full = this.full();
321
+ const consumer = this.dateFilter();
322
+ void this.removable();
323
+ return (date) => {
324
+ if (!date)
325
+ return false;
326
+ const day = DateUtilities.toFormat(date, 'yyyy/MM/dd');
327
+ if (chosen.has(day))
328
+ return this.isRemovable(day);
329
+ return !full && (!consumer || consumer(date));
330
+ };
331
+ }, ...(ngDevMode ? [{ debugName: "calendarFilter" }] : /* istanbul ignore next */ []));
332
+ /** Cell classes: `sd-chip-calendar-selected`, plus `sd-chip-calendar-locked` for a chosen day that cannot go. */
333
+ calendarDateClass = computed(() => {
334
+ const chosen = new Set(this.days());
335
+ void this.removable();
336
+ return (date, view = 'month') => {
337
+ if (view !== 'month')
338
+ return '';
339
+ const day = DateUtilities.toFormat(date, 'yyyy/MM/dd');
340
+ if (!chosen.has(day))
341
+ return '';
342
+ return this.isRemovable(day) ? 'sd-chip-calendar-selected' : 'sd-chip-calendar-selected sd-chip-calendar-locked';
343
+ };
344
+ }, ...(ngDevMode ? [{ debugName: "calendarDateClass" }] : /* istanbul ignore next */ []));
168
345
  constructor() {
169
- effect(() => {
170
- const values = this.model();
171
- if (Array.isArray(values)) {
172
- this.#formControl.setValue(values);
173
- }
174
- });
175
346
  effect(() => {
176
347
  const isDisabled = this.disabled();
177
- if (isDisabled) {
178
- this.#formControl.disable();
179
- this.#inputControl.disable();
348
+ // why: `enable()` / `disable()` phát `valueChanges`; connector sẽ coi đó là thao tác và ghi model (đã
349
+ // transform) ngược lên cha. Chỉ đổi khi trạng thái thật sự khác, và không phát event.
350
+ if (isDisabled !== this.#formControl.disabled) {
351
+ if (isDisabled)
352
+ this.#formControl.disable({ emitEvent: false });
353
+ else
354
+ this.#formControl.enable({ emitEvent: false });
355
+ this.#ref.markForCheck();
180
356
  }
181
- else {
182
- this.#formControl.enable();
357
+ if (isDisabled)
358
+ this.#inputControl.disable();
359
+ else
183
360
  this.#inputControl.enable();
184
- }
185
361
  });
186
362
  effect(() => {
187
363
  const nameVal = this.name();
@@ -189,7 +365,15 @@ class SdChipCalendar {
189
365
  this.#name = nameVal;
190
366
  }
191
367
  });
192
- this.#matcher = new SdChipCalendarErrorStateMatcher(this.#formControl);
368
+ effect(() => {
369
+ if ((this.min() > 0 || this.max() > 0) && !this.#warnedDeprecated && isDevMode()) {
370
+ this.#warnedDeprecated = true;
371
+ console.warn('[sd-chip-calendar] `min` / `max` are deprecated; use `minCount` / `maxCount`.');
372
+ }
373
+ });
374
+ // why: `submitted` của form cha không phải signal; submit phải vẽ lại lỗi dưới OnPush.
375
+ this.#parentForm?.ngSubmit.pipe(takeUntilDestroyed(inject(DestroyRef))).subscribe(() => this.#ref.markForCheck());
376
+ this.#matcher = { isErrorState: (_control, form) => this.#errorGate(form) };
193
377
  }
194
378
  get formControl() {
195
379
  return this.#formControl;
@@ -206,8 +390,8 @@ class SdChipCalendar {
206
390
  errorMessage = computed(() => {
207
391
  void this.#state();
208
392
  void this.required();
209
- const min = this.min();
210
- const max = this.max();
393
+ const min = this.effectiveMinCount();
394
+ const max = this.effectiveMaxCount();
211
395
  const errors = this.#formControl.errors;
212
396
  if (!errors)
213
397
  return undefined;
@@ -222,6 +406,97 @@ class SdChipCalendar {
222
406
  get matcher() {
223
407
  return this.#matcher;
224
408
  }
409
+ /**
410
+ * The one place that decides whether the error shows (A4): `ErrorStateMatcher`, `<mat-error>`, `aria-invalid` and
411
+ * the `hideInlineError` icon all read it. Invalid and touched, or the parent form was submitted; a selection that
412
+ * is still too short while the user picks (dirty only) shows nothing.
413
+ */
414
+ isErrorShown() {
415
+ return !!this.errorMessage() && this.#errorGate();
416
+ }
417
+ #errorGate(form) {
418
+ const control = this.#formControl;
419
+ return control.invalid && (control.touched || !!(form ?? this.#parentForm)?.submitted);
420
+ }
421
+ /** Whether `day` (`yyyy/MM/dd`) may be removed, per `removable`. */
422
+ isRemovable(day) {
423
+ const removable = this.removable();
424
+ return typeof removable === 'function' ? !!removable(day) : removable;
425
+ }
426
+ /** Accessible name of a chip: the full date in the current locale, plus the locked note. */
427
+ chipLabel(day) {
428
+ const full = this.#fullDate().format(dayToDate(day));
429
+ return this.isRemovable(day) ? full : `${full}, ${this.#i18n.t('core.form.chip-calendar.locked')}`;
430
+ }
431
+ /** A chip day in `displayFormat` (Angular `DatePipe` / `formatDate` syntax, as the chips used before). */
432
+ formatDay(day) {
433
+ return formatDate(dayToDate(day), this.displayFormat(), this.#locale);
434
+ }
435
+ /** Accessible name of the ✕ button of a chip. */
436
+ removeLabel(day) {
437
+ return this.#i18n.t('core.form.chip-calendar.remove', { date: this.#fullDate().format(dayToDate(day)) });
438
+ }
439
+ /** Opens the popup at the month of 4.2. No-op when disabled, viewed or already open. */
440
+ open() {
441
+ if (this.#formControl.disabled || this.isViewed() || this.isOpen())
442
+ return;
443
+ this.openAt.set(this.#firstMonth());
444
+ this.overlayOrigin.set(this.field()?.getConnectedOverlayOrigin());
445
+ this.isOpen.set(true);
446
+ this.#ref.markForCheck();
447
+ }
448
+ /** Closes the popup and marks the field touched (A4); `returnFocus` puts focus back on the input (Esc, “Xong”). */
449
+ close(returnFocus = false) {
450
+ if (!this.isOpen())
451
+ return;
452
+ this.isOpen.set(false);
453
+ this.isFocused = false;
454
+ this.#formConnector.markAsTouched();
455
+ this.#ref.markForCheck();
456
+ if (returnFocus)
457
+ this.input()?.nativeElement.focus();
458
+ }
459
+ /** Focus goes to the active day of the grid once the panel is attached. */
460
+ onAttach() {
461
+ this.#timers.schedule(() => this.calendar()?.focusActiveCell(), 0);
462
+ }
463
+ onOverlayKeydown(event) {
464
+ if (event.key === 'Escape' || event.key === 'Esc') {
465
+ event.preventDefault();
466
+ this.close(true);
467
+ }
468
+ }
469
+ /** A click outside closes; a click on the field itself is left to the field (it keeps the popup open). */
470
+ onOutsideClick(event) {
471
+ const target = event.target;
472
+ if (target && this.#host.contains(target))
473
+ return;
474
+ this.close();
475
+ }
476
+ /** Click on the empty part of the field or on the input opens the popup; chips stop the click (3 · 2). */
477
+ onFieldClick() {
478
+ this.open();
479
+ }
480
+ /** Calendar button of the suffix: opens or closes the popup without the field click opening it again. */
481
+ onToggleClick(event) {
482
+ event.stopPropagation();
483
+ if (this.isOpen())
484
+ this.close();
485
+ else
486
+ this.open();
487
+ }
488
+ /** “+N” opens the popup, where every chip shows. */
489
+ onMoreClick(event) {
490
+ event.stopPropagation();
491
+ this.open();
492
+ }
493
+ /** Enter, Space, ArrowDown and Alt+ArrowDown on the input open the popup. */
494
+ onInputKeydown(event) {
495
+ if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {
496
+ event.preventDefault();
497
+ this.open();
498
+ }
499
+ }
225
500
  ngAfterViewInit() {
226
501
  this.#subscription.add(this.#formControl.sdChanges.subscribe(() => {
227
502
  this.#ref.markForCheck();
@@ -230,6 +505,89 @@ class SdChipCalendar {
230
505
  ngOnDestroy() {
231
506
  this.#subscription.unsubscribe();
232
507
  }
508
+ /** Normalised days of a model: one `yyyy/MM/dd` per calendar day, model order, unreadable items skipped. */
509
+ #days(value) {
510
+ if (!Array.isArray(value))
511
+ return null;
512
+ const zone = this.#zoned ? this.#dateTime : null;
513
+ const days = [];
514
+ let unreadable = false;
515
+ for (const item of value) {
516
+ const day = _sdNormalizeCalendarDay(item, zone);
517
+ if (!day) {
518
+ unreadable = true;
519
+ continue;
520
+ }
521
+ if (!days.includes(day))
522
+ days.push(day);
523
+ }
524
+ if (unreadable && !this.#warnedUnreadable && isDevMode()) {
525
+ this.#warnedUnreadable = true;
526
+ console.warn('[sd-chip-calendar] Skipped model items that are not dates:', value);
527
+ }
528
+ return days;
529
+ }
530
+ /** Days → the model written back: `yyyy/MM/dd`, or the start of each day per `transform` (like `<sd-date>`). */
531
+ #serializeDays(days) {
532
+ if (!days)
533
+ return days;
534
+ const transform = this.transform();
535
+ if (!transform)
536
+ return [...days];
537
+ return days.map(day => {
538
+ const startOfDay = sdLocalStartOfDay(dayToDate(day));
539
+ return sdSerializeTemporalValue(this.#zoned ? this.#dateTime.fromWallClock(startOfDay) : startOfDay, transform) ?? day;
540
+ });
541
+ }
542
+ /**
543
+ * why: không có transform thì so theo ngày, để `[Date]` từ cha và `['yyyy/MM/dd']` của chính ta là một (không ghi
544
+ * ngược model của cha). Có transform thì so nguyên văn, như sd-date: đổi transform rồi thao tác phải ra chuỗi mới.
545
+ */
546
+ #modelsEqual(left, right) {
547
+ if (this.transform())
548
+ return sameDays(left, right);
549
+ return sameDays(this.#days(left), this.#days(right));
550
+ }
551
+ #writeModel(value) {
552
+ this.model.set(value);
553
+ this.sdChange.emit(value ? value : []);
554
+ }
555
+ #currentDays() {
556
+ const value = this.#formControl.value;
557
+ return Array.isArray(value) ? value : [];
558
+ }
559
+ /** Today as a local-midnight carrier: in the configured zone, else the machine's. */
560
+ #today() {
561
+ return this.#zoned ? this.#dateTime.today() : sdLocalStartOfDay(new Date());
562
+ }
563
+ /** `minDate` / `maxDate` / `startAt` → local-midnight carrier, read like a model item. */
564
+ #toDate(value) {
565
+ if (value === 'TODAY')
566
+ return this.#today();
567
+ const day = _sdNormalizeCalendarDay(value, this.#zoned ? this.#dateTime : null);
568
+ return day ? dayToDate(day) : null;
569
+ }
570
+ /** 4.2: `startAt`; else the chosen day nearest to today (a later one on a tie); else today. */
571
+ #firstMonth() {
572
+ const start = this.#toDate(this.startAt());
573
+ if (start)
574
+ return start;
575
+ const today = this.#today().getTime();
576
+ let best = null;
577
+ for (const day of this.days()) {
578
+ const date = dayToDate(day);
579
+ const distance = Math.abs(date.getTime() - today);
580
+ const bestDistance = best ? Math.abs(best.getTime() - today) : Infinity;
581
+ if (distance < bestDistance || (distance === bestDistance && best !== null && date > best))
582
+ best = date;
583
+ }
584
+ return best ?? this.#today();
585
+ }
586
+ /** Every user action ends here: a new array of days, written once (the connector writes the model). */
587
+ #commit(next) {
588
+ this.#formControl.setValue(next);
589
+ this.#ref.markForCheck();
590
+ }
233
591
  #clickChip = (event, item) => {
234
592
  event.stopPropagation();
235
593
  event.stopImmediatePropagation();
@@ -237,41 +595,16 @@ class SdChipCalendar {
237
595
  this.#focus();
238
596
  }
239
597
  };
240
- #remove = (item) => {
241
- const values = this.#formControl.value ?? [];
242
- if (typeof item === 'string') {
243
- // why: `filter` đã trả mảng mới nên reference đổi → `model.set` phát `modelChange`.
244
- const next = values.filter(value => item !== value);
245
- this.#formControl.setValue(next);
246
- this.model.set(next);
247
- this.sdChange.emit(next);
598
+ #remove = (day) => {
599
+ if (typeof day === 'string' && this.isRemovable(day)) {
600
+ const days = this.#currentDays();
601
+ // why: `filter` đã trả mảng mới nên reference đổi → model ghi một lần.
602
+ if (days.includes(day))
603
+ this.#commit(days.filter(value => value !== day));
248
604
  }
249
605
  this.#inputControl.setValue('');
250
606
  this.#focus();
251
607
  };
252
- #select = (event) => {
253
- const item = event.option.value;
254
- const values = this.#formControl.value ?? [];
255
- if (item) {
256
- if (typeof item === 'string' || typeof item === 'number') {
257
- if (!values.includes(item)) {
258
- // why: PHẢI tạo mảng MỚI. `values` là chính mảng của consumer (model đi thẳng vào
259
- // formControl), nên `push` vừa sửa trộm mảng của họ, vừa giữ nguyên reference —
260
- // `model()` dùng equality Object.is nên `model.set(sameRef)` KHÔNG phát `modelChange`.
261
- const next = [...values, item];
262
- this.#formControl.setValue(next);
263
- this.model.set(next);
264
- this.sdChange.emit(next);
265
- }
266
- }
267
- const inputEl = this.input();
268
- if (inputEl)
269
- inputEl.nativeElement.value = '';
270
- this.#inputControl.setValue('', {
271
- emitEvent: false,
272
- });
273
- }
274
- };
275
608
  #onClick = () => {
276
609
  if (this.sdViewDef()?.templateRef) {
277
610
  if (!this.#formControl.disabled && !this.isFocused) {
@@ -281,7 +614,6 @@ class SdChipCalendar {
281
614
  };
282
615
  #focus = () => {
283
616
  this.isFocused = true;
284
- this.#isBlurring = false;
285
617
  // why: vẫn 100ms như cũ — chỉ scope handle theo DestroyRef.
286
618
  this.#timers.schedule(() => {
287
619
  if (this.isFocused) {
@@ -289,44 +621,39 @@ class SdChipCalendar {
289
621
  }
290
622
  }, 100);
291
623
  };
624
+ /** Removes every day the predicate allows; kept days stay. One change, none when nothing goes. */
292
625
  #clear = (evt) => {
293
626
  evt?.stopPropagation();
294
627
  this.#inputControl.setValue('');
295
- this.#formControl.setValue([]);
296
- this.model.set(this.#formControl.value);
297
- this.sdChange.emit(this.#formControl.value);
628
+ const days = this.#currentDays();
629
+ const kept = days.filter(day => !this.isRemovable(day));
630
+ if (kept.length !== days.length)
631
+ this.#commit(kept);
298
632
  this.#ref.detectChanges();
299
633
  };
300
634
  #selectDate = (date) => {
301
- const value = DateUtilities.toFormat(date, 'yyyy/MM/dd');
302
- const values = this.#formControl.value ?? [];
303
- if (value) {
304
- // why: toggle ngày — cả nhánh thêm lẫn nhánh bỏ đều dựng mảng MỚI. Nhánh thêm trước đây
305
- // `push` thẳng vào mảng của consumer: reference không đổi nên `model.set` im lặng
306
- // (Object.is) → `[(model)]` không nhận ngày vừa chọn, mà mảng gốc lại bị sửa trộm.
307
- const next = values.includes(value) ? values.filter(date => value !== date) : [...values, value];
308
- this.#formControl.setValue(next);
309
- this.model.set(next);
310
- this.sdChange.emit(next);
311
- this.calendar()?.updateTodaysDate();
312
- this.#ref.markForCheck();
635
+ // why: ô lịch là ngày lịch (nửa đêm local của native adapter), không phải instant → chỉ đọc chữ số.
636
+ const day = DateUtilities.toFormat(date, 'yyyy/MM/dd');
637
+ if (!day)
638
+ return;
639
+ const days = this.#currentDays();
640
+ if (days.includes(day)) {
641
+ // A1: bấm lại ngày đã chọn chỉ bỏ khi predicate cho phép.
642
+ if (this.isRemovable(day))
643
+ this.#commit(days.filter(value => value !== day));
313
644
  }
314
- };
315
- #closeCalendar = () => {
316
- this.isFocused = false;
317
- this.input()?.nativeElement?.blur();
318
- };
319
- #dateClass = (cellDate) => {
320
- const dates = this.#formControl.value || [];
321
- if (Array.isArray(dates)) {
322
- const selected = dates.some(date => date === DateUtilities.toFormat(cellDate, 'yyyy/MM/dd'));
323
- return selected ? 'sd-chip-calendar-selected-date' : '';
645
+ else {
646
+ this.#commit([...days, day]);
647
+ }
648
+ // why: dateFilter mới làm mat-calendar dựng lại ô; giữ ô vừa bấm là ô active và trả focus về nó cho bàn phím.
649
+ const calendar = this.calendar();
650
+ if (calendar && date) {
651
+ calendar.activeDate = date;
652
+ this.#timers.schedule(() => this.calendar()?.focusActiveCell(), 0);
324
653
  }
325
- return '';
326
654
  };
327
655
  onClickChip = (event, item) => this.#clickChip(event, item);
328
656
  onRemove = (item) => this.#remove(item);
329
- onSelect = (event) => this.#select(event);
330
657
  onClick = () => this.#onClick();
331
658
  /**
332
659
  * why: khi `sdViewDef` đang hiển thị thì bên trong KHÔNG còn phần tử nào focus được, nên
@@ -340,10 +667,12 @@ class SdChipCalendar {
340
667
  };
341
668
  onClear = (evt) => this.#clear(evt);
342
669
  onSelectDate = (date) => this.#selectDate(date);
343
- onCloseCalendar = () => this.#closeCalendar();
344
- dateClass = (cellDate) => this.#dateClass(cellDate);
670
+ /** Closes the popup without moving focus (outside click); marks the field touched. */
671
+ onCloseCalendar = () => this.close();
672
+ /** Classes of a month-view cell; see `calendarDateClass`. */
673
+ dateClass = (cellDate) => this.calendarDateClass()(cellDate);
345
674
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdChipCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
346
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdChipCalendar, isStandalone: true, selector: "sd-chip-calendar", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, labelPlacement: { classPropertyName: "labelPlacement", publicName: "labelPlacement", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, hideInlineError: { classPropertyName: "hideInlineError", publicName: "hideInlineError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", 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 }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", sdChange: "sdChange" }, host: { properties: { "class.sd-has-label": "!!label()", "class.sd-viewed": "isViewed()", "class.sd-label-top": "labelPlacement() === 'top'" } }, queries: [{ propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true, isSignal: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "menuTrigger", first: true, predicate: MatMenuTrigger, descendants: true, isSignal: true }, { propertyName: "calendar", first: true, predicate: MatCalendar, descendants: true, isSignal: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _label = label();\r\n@let _appearance = appearance();\r\n@let _required = required();\r\n@let _isViewed = isViewed();\r\n@let _hideInlineError = hideInlineError();\r\n@let _sdViewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\r\n@let _errorMessage = errorMessage();\r\n@let _size = size();\r\n@let _removable = removable();\r\n@let _labelTop = labelPlacement() === 'top';\r\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\r\n@let _errorVisible = !!_errorMessage && formControl.touched;\r\n@let _showInlineError = !_hideInlineError && _errorVisible;\r\n@let _viewTemplate = _sdViewDef?.templateRef;\r\n\r\n@if (_isViewed) {\r\n <sd-view\r\n [label]=\"_label\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if ((!_appearance || _labelTop) && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if ((!_appearance || _labelTop) && _label && !_labelTemplate) {\r\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\r\n }\r\n\r\n <!-- why: div ch\u1EC9 l\u00E0 h\u1ED9p layout \u2014 aria-hidden=\"true\" c\u0169 \u1EA9n C\u1EA2 c\u00E2y con (chip, \u00F4 nh\u1EADp, <mat-error>)\r\n kh\u1ECFi accessibility tree. \u1EDE \u0111\u00E2y (click) KH\u00D4NG ph\u1EA3i ti\u1EC7n \u00EDch chu\u1ED9t th\u1EEBa nh\u01B0 c\u00E1c control kh\u00E1c:\r\n khi sdViewDef \u0111ang hi\u1EC3n th\u1ECB th\u00EC kh\u00F4ng c\u00F3 ph\u1EA7n t\u1EED focus \u0111\u01B0\u1EE3c n\u00E0o b\u00EAn trong, n\u00EAn click l\u00E0 l\u1ED1i\r\n v\u00E0o DUY NH\u1EA4T. V\u00EC v\u1EADy handler \u0111\u01B0\u1EE3c chuy\u1EC3n h\u1EB3n xu\u1ED1ng ph\u1EA7n t\u1EED view v\u00E0 ph\u1EA7n t\u1EED \u0111\u00F3 nh\u1EADn\r\n role=\"button\" + tabindex=\"0\" + keydown Enter/Space; div ngo\u00E0i kh\u00F4ng c\u00F2n handler n\u00E0o. -->\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_viewTemplate\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\">\r\n @if (_viewTemplate && !isFocused) {\r\n <!-- why: KH\u00D4NG \u0111\u1EB7t aria-label \u2014 n\u1ED9i dung sdViewDef ch\u00EDnh l\u00E0 nh\u00E3n nh\u00ECn th\u1EA5y \u0111\u01B0\u1EE3c, aria-label\r\n s\u1EBD ghi \u0111\u00E8 v\u00E0 l\u00E0m AT \u0111\u1ECDc kh\u00E1c ch\u1EEF tr\u00EAn m\u00E0n h\u00ECnh. -->\r\n <div\r\n class=\"sd-chip-calendar__view-trigger\"\r\n role=\"button\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\"\r\n (keydown.enter)=\"onViewKeydown($event)\"\r\n (keydown.space)=\"onViewKeydown($event)\">\r\n <ng-container *ngTemplateOutlet=\"_viewTemplate; context: { value: formControl.value }\"></ng-container>\r\n </div>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [class.hide-inline-error]=\"_hideInlineError\"\r\n [class.sd-label-top]=\"_labelTop\"\r\n [appearance]=\"_appearance\"\r\n [floatLabel]=\"floatLabel()\">\r\n @if (_appearance && _label && !_labelTop) {\r\n <mat-label>{{ _label }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"_size === 'md'\" [class.sd-sm]=\"_size === 'sm'\">\r\n @for (item of formControl.value; track item) {\r\n @if (item) {\r\n <mat-chip-row\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [removable]=\"_removable\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\"\r\n [value]=\"item\">\r\n <span>{{ item | date: 'dd/MM/yyyy' }}</span>\r\n @if (!inputControl.disabled && item | sdRemovableChip: _removable) {\r\n <sd-icon matChipRemove name=\"cancel\"></sd-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n }\r\n\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"placeholder() || (_labelTop ? '' : _label)\"\r\n [matChipInputFor]=\"chipList\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n [matMenuTriggerFor]=\"calendarMenu\"\r\n [required]=\"_required\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n [attr.data-disabled]=\"dataDisabled()\"\r\n [attr.data-empty]=\"dataEmpty()\"\r\n [attr.data-value]=\"dataValue()\"\r\n [attr.data-count]=\"dataCount()\"\r\n [attr.data-required]=\"dataRequired()\"\r\n [attr.data-error-message]=\"dataErrorMessage()\"\r\n [attr.aria-invalid]=\"_errorVisible ? 'true' : null\"\r\n [attr.aria-describedby]=\"_errorMessage ? errorId : null\"\r\n readonly\r\n #input />\r\n </mat-chip-grid>\r\n\r\n <mat-menu #calendarMenu=\"matMenu\" overlapTrigger=\"false\" (closed)=\"onCloseCalendar()\">\r\n <!-- why: aria-hidden=\"true\" \u1EDF \u0111\u00E2y t\u1EEBng \u1EA9n NGUY\u00CAN <mat-calendar> \u2014 t\u1EE9c to\u00E0n b\u1ED9 l\u01B0\u1EDBi ng\u00E0y,\r\n n\u00FAt chuy\u1EC3n th\u00E1ng v\u00E0 \u00F4 ng\u00E0y \u0111ang ch\u1ECDn \u2014 kh\u1ECFi accessibility tree, d\u00F9 l\u1ECBch v\u1EABn nh\u1EADn\r\n focus v\u00E0 \u0111i\u1EC1u h\u01B0\u1EDBng b\u1EB1ng ph\u00EDm m\u0169i t\u00EAn. role=\"presentation\" ch\u1EC9 v\u00F4 hi\u1EC7u ho\u00E1 c\u00E1i div\r\n b\u1ECDc (n\u00F3 ch\u1EC9 t\u1ED3n t\u1EA1i \u0111\u1EC3 ch\u1EB7n n\u1ED5i b\u1ECDt click l\u00E0m \u0111\u00F3ng menu), KH\u00D4NG lan xu\u1ED1ng l\u1ECBch. -->\r\n <div style=\"width: 280px\" role=\"presentation\" (click)=\"$event.stopPropagation()\">\r\n <mat-calendar (selectedChange)=\"onSelectDate($event)\" [dateClass]=\"dateClass\"> </mat-calendar>\r\n </div>\r\n </mat-menu>\r\n @if (_hideInlineError && _errorVisible) {\r\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\r\n @if (_hideInlineError && _errorVisible) {\r\n <span class=\"sd-visually-hidden\" [id]=\"errorId\" matSuffix>{{ _errorMessage }}</span>\r\r\n }\r\n\r\n @if (_showInlineError) {\r\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\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}:host(.sd-has-label){padding-top:4px}:host(.sd-label-top){padding-top:0}:host(.sd-viewed){padding-top:0}:host ::ng-deep .mat-mdc-form-field.no-padding-wrapper .mat-mdc-text-field-wrapper{padding-bottom:0}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip{padding:7px 10px;min-height:26px}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{padding:7px 7px 7px 10px}:host ::ng-deep .mat-mdc-chip-row.sd-sm{--mdc-chip-label-text-size: 12px;--mdc-chip-container-height: 20px}:host ::ng-deep .mat-mdc-chip-set.sd-md{margin-top:10px}:host ::ng-deep .mat-mdc-chip-set.sd-sm{margin-top:2px}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:var(--sd-chip-calendar-bg, #ebecf0)}mat-form-field{width:100%}mat-chip-listbox{display:flex;flex-wrap:wrap;gap:4px}::ng-deep .sd-chip-calendar-selected-date .mat-calendar-body-cell-content{background-color:var(--sd-primary-light)!important;color:var(--sd-primary)!important;border-radius:50%}.sd-chip-calendar__view-trigger{display:flex;align-items:center;width:100%;cursor:pointer}.sd-chip-calendar__view-trigger:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i5.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i5.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i5.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i5.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i6.MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i7.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i7.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { 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: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: SdRemovableChipPipe, name: "sdRemovableChip" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
675
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdChipCalendar, isStandalone: true, selector: "sd-chip-calendar", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, labelPlacement: { classPropertyName: "labelPlacement", publicName: "labelPlacement", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", 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 }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, hideInlineError: { classPropertyName: "hideInlineError", publicName: "hideInlineError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, minCount: { classPropertyName: "minCount", publicName: "minCount", isSignal: true, isRequired: false, transformFunction: null }, maxCount: { classPropertyName: "maxCount", publicName: "maxCount", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, dateFilter: { classPropertyName: "dateFilter", publicName: "dateFilter", isSignal: true, isRequired: false, transformFunction: null }, startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, maxVisible: { classPropertyName: "maxVisible", publicName: "maxVisible", isSignal: true, isRequired: false, transformFunction: null }, displayFormat: { classPropertyName: "displayFormat", publicName: "displayFormat", 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 }, transform: { classPropertyName: "transform", publicName: "transform", isSignal: true, isRequired: false, transformFunction: null }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", sdChange: "sdChange" }, host: { properties: { "class.sd-has-label": "!!label()", "class.sd-viewed": "isViewed()", "class.sd-label-top": "labelPlacement() === 'top'" } }, queries: [{ propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true, isSignal: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "calendar", first: true, predicate: MatCalendar, descendants: true, isSignal: true }, { propertyName: "field", first: true, predicate: MatFormField, descendants: true, isSignal: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _label = label();\r\n@let _appearance = appearance();\r\n@let _required = required();\r\n@let _isViewed = isViewed();\r\n@let _hideInlineError = hideInlineError();\r\n@let _sdViewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\r\n@let _errorMessage = errorMessage();\r\n@let _size = size();\r\n@let _labelTop = labelPlacement() === 'top';\r\n@let _icons = iconSizes();\r\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\r\n@let _errorVisible = isErrorShown();\r\n@let _showInlineError = !_hideInlineError && _errorVisible;\r\n@let _viewTemplate = _sdViewDef?.templateRef;\r\n\r\n@if (_isViewed) {\r\n <sd-view\r\n [label]=\"_label\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"viewText()\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if ((!_appearance || _labelTop) && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if ((!_appearance || _labelTop) && _label && !_labelTemplate) {\r\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\r\n }\r\n\r\n <!-- why: div ch\u1EC9 l\u00E0 h\u1ED9p layout \u2014 aria-hidden=\"true\" c\u0169 \u1EA9n C\u1EA2 c\u00E2y con (chip, \u00F4 nh\u1EADp, <mat-error>)\r\n kh\u1ECFi accessibility tree. \u1EDE \u0111\u00E2y (click) KH\u00D4NG ph\u1EA3i ti\u1EC7n \u00EDch chu\u1ED9t th\u1EEBa nh\u01B0 c\u00E1c control kh\u00E1c:\r\n khi sdViewDef \u0111ang hi\u1EC3n th\u1ECB th\u00EC kh\u00F4ng c\u00F3 ph\u1EA7n t\u1EED focus \u0111\u01B0\u1EE3c n\u00E0o b\u00EAn trong, n\u00EAn click l\u00E0 l\u1ED1i\r\n v\u00E0o DUY NH\u1EA4T. V\u00EC v\u1EADy handler \u0111\u01B0\u1EE3c chuy\u1EC3n h\u1EB3n xu\u1ED1ng ph\u1EA7n t\u1EED view v\u00E0 ph\u1EA7n t\u1EED \u0111\u00F3 nh\u1EADn\r\n role=\"button\" + tabindex=\"0\" + keydown Enter/Space; div ngo\u00E0i kh\u00F4ng c\u00F2n handler n\u00E0o. -->\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_viewTemplate\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\">\r\n @if (_viewTemplate && !isFocused) {\r\n <!-- why: KH\u00D4NG \u0111\u1EB7t aria-label \u2014 n\u1ED9i dung sdViewDef ch\u00EDnh l\u00E0 nh\u00E3n nh\u00ECn th\u1EA5y \u0111\u01B0\u1EE3c, aria-label\r\n s\u1EBD ghi \u0111\u00E8 v\u00E0 l\u00E0m AT \u0111\u1ECDc kh\u00E1c ch\u1EEF tr\u00EAn m\u00E0n h\u00ECnh. -->\r\n <div\r\n class=\"sd-chip-calendar__view-trigger\"\r\n role=\"button\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\"\r\n (keydown.enter)=\"onViewKeydown($event)\"\r\n (keydown.space)=\"onViewKeydown($event)\">\r\n <ng-container *ngTemplateOutlet=\"_viewTemplate; context: { value: formControl.value }\"></ng-container>\r\n </div>\r\n } @else {\r\n <mat-form-field\r\n class=\"sd-chip-calendar-field\"\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [class.sd-lg]=\"_size === 'lg'\"\r\n [class.sd-chip-calendar-field--open]=\"isOpen()\"\r\n [class.hide-inline-error]=\"_hideInlineError\"\r\n [class.sd-label-top]=\"_labelTop\"\r\n [appearance]=\"_appearance\"\r\n [floatLabel]=\"floatLabel()\"\r\n (click)=\"onFieldClick()\">\r\n @if (_appearance && _label && !_labelTop) {\r\n <mat-label>{{ _label }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"_size === 'md'\" [class.sd-sm]=\"_size === 'sm'\">\r\n <!-- why: chip l\u00E0 ng\u00E0y \u0111\u00E3 chu\u1EA9n ho\u00E1 (yyyy/MM/dd), hi\u1EC7n theo ng\u00E0y (B2) v\u00E0 g\u1ED9p \u201C+N\u201D khi popup \u0111\u00F3ng (B3). `removable` \u00E1p\r\n c\u1EA3 cho Backspace / Delete tr\u00EAn chip (A1); chip c\u00F3 t\u00EAn \u0111\u1EA7y \u0111\u1EE7, n\u00FAt \u2715 c\u00F3 t\u00EAn ri\u00EAng (A6). -->\r\n @for (item of visibleDays(); track item) {\r\n @let _itemRemovable = isRemovable(item);\r\n <mat-chip-row\r\n class=\"sd-chip-calendar__chip\"\r\n [class.sd-chip-calendar__chip--locked]=\"!_itemRemovable\"\r\n [removable]=\"_itemRemovable\"\r\n [aria-label]=\"chipLabel(item)\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\"\r\n [value]=\"item\">\r\n <span class=\"sd-chip-calendar__chip-text\">{{ formatDay(item) }}</span>\r\n <!-- why: m\u1ED7i kh\u1ED1i @if m\u1ED9t ph\u1EA7n t\u1EED g\u1ED1c, \u0111\u1EC3 \u2715 \u0111\u01B0\u1EE3c chi\u1EBFu v\u00E0o \u00F4 trailing c\u1EE7a mat-chip-row ([matChipRemove]). -->\r\n @if (!inputControl.disabled && _itemRemovable) {\r\n <sd-icon matChipRemove name=\"close\" [size]=\"_icons.chip\" [ariaLabel]=\"removeLabel(item)\"></sd-icon>\r\n }\r\n @if (!inputControl.disabled && !_itemRemovable) {\r\n <sd-icon\r\n class=\"sd-chip-calendar__lock\"\r\n name=\"lock\"\r\n [size]=\"_icons.chip\"\r\n [matTooltip]=\"'core.form.chip-calendar.locked' | sdTranslate\"></sd-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n @if (hiddenCount() > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"sd-chip-calendar__more\"\r\n [attr.aria-label]=\"'core.form.chip-calendar.more' | sdTranslate: { count: hiddenCount() }\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-more' : null\"\r\n (click)=\"onMoreClick($event)\">\r\n +{{ hiddenCount() }}\r\n </button>\r\n }\r\n\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [matChipInputFor]=\"chipList\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n [required]=\"_required\"\r\n aria-haspopup=\"dialog\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\r\n (keydown)=\"onInputKeydown($event)\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n [attr.data-disabled]=\"dataDisabled()\"\r\n [attr.data-empty]=\"dataEmpty()\"\r\n [attr.data-value]=\"dataValue()\"\r\n [attr.data-count]=\"dataCount()\"\r\n [attr.data-required]=\"dataRequired()\"\r\n [attr.data-error-message]=\"dataErrorMessage()\"\r\n [attr.aria-invalid]=\"_errorVisible ? 'true' : null\"\r\n [attr.aria-describedby]=\"_errorMessage ? errorId : null\"\r\n readonly\r\n #input />\r\n </mat-chip-grid>\r\n\r\n @if (_hideInlineError && _errorVisible) {\r\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\r\n }\r\n @if (_hideInlineError && _errorVisible) {\r\n <span class=\"sd-visually-hidden\" [id]=\"errorId\" matSuffix>{{ _errorMessage }}</span>\r\n }\r\n <!-- Suffix (thi\u1EBFt k\u1EBF 2): n\u00FAt b\u1ECF h\u1EBFt (hover-gated nh\u01B0 sd-date, lu\u00F4n hi\u1EC7n khi popup m\u1EDF) r\u1ED3i n\u00FAt l\u1ECBch. \u1EA8n khi disabled. -->\r\n <!-- why: m\u1ED7i kh\u1ED1i @if m\u1ED9t ph\u1EA7n t\u1EED g\u1ED1c, \u0111\u1EC3 matSuffix \u0111\u01B0\u1EE3c chi\u1EBFu v\u00E0o v\u00F9ng suffix. -->\r\n @if (!formControl.disabled && clearable() && !_required && hasRemovable()) {\r\n <button\r\n type=\"button\"\r\n matSuffix\r\n class=\"sd-clear-btn sd-chip-calendar__suffix\"\r\n [class.sd-hover]=\"!isOpen()\"\r\n [attr.aria-label]=\"'core.form.chip-calendar.clear' | sdTranslate\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-clear' : null\"\r\n (click)=\"onClear($event)\">\r\n <sd-icon name=\"close\" [size]=\"_icons.clear\"></sd-icon>\r\n </button>\r\n }\r\n @if (!formControl.disabled) {\r\n <button\r\n type=\"button\"\r\n matSuffix\r\n class=\"sd-chip-calendar__open sd-chip-calendar__suffix\"\r\n [class.sd-chip-calendar__open--active]=\"isOpen()\"\r\n data-chip-calendar-open\r\n [attr.aria-label]=\"'core.form.date.open-picker' | sdTranslate\"\r\n aria-haspopup=\"dialog\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-open' : null\"\r\n (click)=\"onToggleClick($event)\">\r\n <sd-icon name=\"calendar_month\" [size]=\"_icons.open\"></sd-icon>\r\n </button>\r\n }\r\n\r\n @if (_showInlineError) {\r\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <!-- Popup (thi\u1EBFt k\u1EBF 3): CDK overlay role=\"dialog\" treo d\u01B0\u1EDBi khung \u00F4. Ch\u1ECDn ng\u00E0y kh\u00F4ng \u0111\u00F3ng; \u0111\u00F3ng b\u1EB1ng \u201CXong\u201D, Esc\r\n ho\u1EB7c b\u1EA5m ra ngo\u00E0i. why: mat-menu c\u0169 \u0111\u00F3ng khi Tab v\u00E0 kh\u00F4ng ph\u1EA3i dialog (A3). Kh\u00F4ng aria-hidden \u1EDF \u0111\u00E2u c\u1EA3:\r\n l\u01B0\u1EDBi ng\u00E0y, n\u00FAt chuy\u1EC3n th\u00E1ng v\u00E0 \u00F4 \u0111ang ch\u1ECDn \u0111\u1EC1u ph\u1EA3i \u0111\u1ECDc \u0111\u01B0\u1EE3c. -->\r\n <ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\r\n [cdkConnectedOverlayOpen]=\"isOpen()\"\r\n [cdkConnectedOverlayPositions]=\"positions\"\r\n [cdkConnectedOverlayPush]=\"true\"\r\n [cdkConnectedOverlayViewportMargin]=\"8\"\r\n cdkConnectedOverlayPanelClass=\"sd-chip-calendar-pane\"\r\n (attach)=\"onAttach()\"\r\n (overlayOutsideClick)=\"onOutsideClick($event)\"\r\n (overlayKeydown)=\"onOverlayKeydown($event)\">\r\n @let _days = days();\r\n @let _maxCount = effectiveMaxCount();\r\n @let _full = full();\r\n <div\r\n class=\"sd-chip-calendar-panel\"\r\n role=\"dialog\"\r\n cdkTrapFocus\r\n [id]=\"panelId\"\r\n [attr.aria-label]=\"_label || ('core.form.chip-calendar.dialog-label' | sdTranslate)\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-panel' : null\">\r\n <div class=\"sd-chip-calendar-panel__head\">\r\n <div class=\"sd-chip-calendar-panel__summary\">\r\n <span class=\"sd-chip-calendar-panel__count\">{{\r\n 'core.form.chip-calendar.selected-count' | sdTranslate: { count: _days.length }\r\n }}</span>\r\n <span class=\"sd-chip-calendar-panel__limit\">\r\n {{\r\n _maxCount > 0\r\n ? ('core.form.chip-calendar.max-count' | sdTranslate: { max: _maxCount })\r\n : ('core.form.chip-calendar.no-limit' | sdTranslate)\r\n }}\r\n </span>\r\n </div>\r\n <!-- why: v\u00F9ng live lu\u00F4n c\u00F3 m\u1EB7t (r\u1ED7ng khi ch\u01B0a \u0111\u1EE7) \u0111\u1EC3 screen reader \u0111\u1ECDc c\u00E2u \u201C\u0111\u00E3 \u0111\u1EE7\u201D ngay khi n\u00F3 xu\u1EA5t hi\u1EC7n. -->\r\n <p class=\"sd-chip-calendar-panel__full\" aria-live=\"polite\">\r\n @if (_full) {\r\n {{ 'core.form.chip-calendar.full' | sdTranslate: { max: _maxCount } }}\r\n }\r\n </p>\r\n </div>\r\n\r\n <mat-calendar\r\n [headerComponent]=\"calendarHeader\"\r\n [startAt]=\"openAt()\"\r\n [minDate]=\"resolvedMinDate()\"\r\n [maxDate]=\"resolvedMaxDate()\"\r\n [dateFilter]=\"calendarFilter()\"\r\n [dateClass]=\"calendarDateClass()\"\r\n (selectedChange)=\"onSelectDate($event)\">\r\n </mat-calendar>\r\n\r\n <div class=\"sd-chip-calendar-panel__footer\">\r\n @if (clearable()) {\r\n <sd-button\r\n data-chip-calendar-clear-all\r\n type=\"text\"\r\n color=\"primary\"\r\n size=\"sm\"\r\n [disabled]=\"!hasRemovable()\"\r\n [autoId]=\"autoId() ? autoId() + '-clear-all' : undefined\"\r\n [title]=\"'core.form.chip-calendar.clear-all' | sdTranslate\"\r\n (click)=\"onClear()\"></sd-button>\r\n } @else {\r\n <span></span>\r\n }\r\n <sd-button\r\n data-chip-calendar-done\r\n type=\"fill\"\r\n color=\"primary\"\r\n size=\"sm\"\r\n [autoId]=\"autoId() ? autoId() + '-done' : undefined\"\r\n [title]=\"'core.form.chip-calendar.done' | sdTranslate\"\r\n (click)=\"close(true)\"></sd-button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-label-top){padding-top:0}:host(.sd-viewed){padding-top:0}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:var(--sd-chip-calendar-bg)}mat-form-field{width:100%}.sd-chip-calendar__view-trigger{display:flex;align-items:center;width:100%;cursor:pointer}.sd-chip-calendar__view-trigger:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-chip-calendar-panel{display:flex;flex-direction:column;gap:4px;box-sizing:border-box;width:var(--sd-chip-calendar-panel-width, 296px);padding:12px 8px 8px;border:1px solid color-mix(in srgb,var(--sd-border) 60%,var(--sd-surface));border-radius:var(--sd-panel-radius, 10px);background-color:var(--sd-select-panel-bg, var(--sd-surface));box-shadow:var(--sd-shadow-md, none);color:var(--sd-text);animation:sd-chip-calendar-panel-in var(--sd-duration-fast, .12s) var(--sd-ease-standard, ease-out);--mat-datepicker-calendar-date-text-color: var(--sd-text);--mat-datepicker-calendar-date-hover-state-background-color: color-mix(in srgb, var(--sd-text) 5%, transparent);--mat-datepicker-calendar-date-focus-state-background-color: transparent;--mat-datepicker-calendar-date-today-outline-color: var(--sd-primary);--mat-datepicker-calendar-date-disabled-state-text-color: var(--sd-disabled-text);--mat-datepicker-calendar-date-today-disabled-state-outline-color: transparent;--mat-datepicker-calendar-header-text-color: var(--sd-text-secondary);--mat-datepicker-calendar-header-text-size: var(--sd-font-size-11, 11px);--mat-datepicker-calendar-header-text-weight: var(--sd-font-weight-medium, 500);--mat-datepicker-calendar-header-divider-color: transparent;--mat-datepicker-calendar-text-size: var(--sd-font-size-13, 13px)}@keyframes sd-chip-calendar-panel-in{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.sd-chip-calendar-panel{animation:none}}.sd-chip-calendar-panel__head{padding:0 8px}.sd-chip-calendar-panel__summary{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.sd-chip-calendar-panel__count{font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-semibold, 600)}.sd-chip-calendar-panel__limit{font-size:var(--sd-font-size-12, 12px);color:var(--sd-text-secondary)}.sd-chip-calendar-panel__full{margin:0;font-size:var(--sd-font-size-12, 12px);line-height:16px;color:var(--sd-warning-dark)}.sd-chip-calendar-panel__full:empty{display:none}.sd-chip-calendar-panel__footer{display:flex;align-items:center;justify-content:space-between;margin-top:4px;padding:8px 4px 0;border-top:1px solid var(--sd-select-panel-divider, var(--sd-border))}.sd-chip-calendar-panel ::ng-deep .mat-calendar-content{padding:0}.sd-chip-calendar-panel ::ng-deep .mat-calendar-table-header th{padding:0;line-height:24px}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-label{visibility:hidden}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell-content{font-variant-numeric:tabular-nums}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-selected{--mat-datepicker-calendar-date-hover-state-background-color: var(--sd-primary-600, var(--sd-primary-dark));--mat-datepicker-calendar-date-focus-state-background-color: var(--sd-primary);--mat-datepicker-calendar-date-today-outline-color: transparent}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-selected>.mat-calendar-body-cell-content{background-color:var(--sd-primary);color:var(--sd-primary-contrast);font-weight:var(--sd-font-weight-semibold, 600)}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-locked{--mat-datepicker-calendar-date-disabled-state-text-color: var(--sd-primary-dark);--mat-datepicker-calendar-date-hover-state-background-color: var(--sd-primary-light);--mat-datepicker-calendar-date-focus-state-background-color: var(--sd-primary-light)}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-locked>.mat-calendar-body-cell-content{background-color:var(--sd-primary-light);color:var(--sd-primary-dark)}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell:focus-visible>.mat-calendar-body-cell-content{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color);outline-offset:1px}@media(forced-colors:active){.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-selected>.mat-calendar-body-cell-content{forced-color-adjust:none;background-color:Highlight;color:HighlightText}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-locked>.mat-calendar-body-cell-content{forced-color-adjust:auto;border:1px solid GrayText;background-color:Canvas;color:GrayText}}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field{--sd-chip-calendar-field-height: var(--sd-control-height-md, 40px);--sd-chip-calendar-chip-height: 24px;--sd-chip-calendar-chip-font-size: var(--sd-font-size-13, 13px);--sd-chip-calendar-chip-padding: 8px;--sd-chip-calendar-suffix-size: 28px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field.sd-sm{--sd-chip-calendar-field-height: var(--sd-control-height-sm, 32px);--sd-chip-calendar-chip-height: 20px;--sd-chip-calendar-chip-font-size: var(--sd-font-size-12, 12px);--sd-chip-calendar-suffix-size: 24px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field.sd-lg{--sd-chip-calendar-field-height: var(--sd-control-height-lg, 48px);--sd-chip-calendar-chip-height: 28px;--sd-chip-calendar-chip-font-size: var(--sd-font-size-14, 14px);--sd-chip-calendar-chip-padding: 10px;--sd-chip-calendar-suffix-size: 32px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field{--mat-form-field-container-height: var(--sd-chip-calendar-field-height)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mat-mdc-form-field-infix{min-height:var(--sd-chip-calendar-field-height);padding-top:calc((var(--sd-chip-calendar-field-height) - var(--sd-chip-calendar-chip-height)) / 2);padding-bottom:calc((var(--sd-chip-calendar-field-height) - var(--sd-chip-calendar-chip-height)) / 2);border-top-width:0}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mdc-evolution-chip-set__chips{gap:4px;margin:0}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mat-mdc-chip-set .mdc-evolution-chip{margin:0}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mat-mdc-form-field-infix input.mat-mdc-chip-input.mat-mdc-input-element{flex:1 1 0;min-width:0;height:var(--sd-chip-calendar-chip-height);margin:0}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row{--mdc-chip-container-height: var(--sd-chip-calendar-chip-height);--mat-chip-container-height: var(--sd-chip-calendar-chip-height);--mdc-chip-container-shape-radius: var(--sd-radius-6, 6px);--mat-chip-container-shape-radius: var(--sd-radius-6, 6px);--mdc-chip-outline-width: 1px;--mat-chip-outline-width: 1px;--mdc-chip-outline-color: var(--sd-border);--mat-chip-outline-color: var(--sd-border);--mdc-chip-elevated-container-color: var(--sd-surface);--mat-chip-elevated-container-color: var(--sd-surface);--mdc-chip-label-text-color: var(--sd-text);--mat-chip-label-text-color: var(--sd-text);--mdc-chip-label-text-size: var(--sd-chip-calendar-chip-font-size);--mat-chip-label-text-size: var(--sd-chip-calendar-chip-font-size);--mdc-chip-label-text-weight: var(--sd-font-weight-regular, 400);--mat-chip-label-text-weight: var(--sd-font-weight-regular, 400);--mdc-chip-with-trailing-icon-trailing-icon-color: var(--sd-text-secondary);--mat-chip-with-trailing-icon-trailing-icon-color: var(--sd-text-secondary);--mdc-chip-trailing-action-state-layer-color: transparent;--mat-chip-trailing-action-state-layer-color: transparent;--mdc-chip-selected-trailing-action-state-layer-color: transparent;--mat-chip-selected-trailing-action-state-layer-color: transparent}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mdc-evolution-chip__action--primary{padding-left:var(--sd-chip-calendar-chip-padding);padding-right:2px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mdc-evolution-chip__action--trailing{padding-left:0;padding-right:3px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .sd-chip-calendar__chip-text{font-variant-numeric:tabular-nums;white-space:nowrap}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mat-mdc-chip-remove,:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mat-mdc-chip-remove .mat-icon{width:var(--sd-icon-size);height:var(--sd-icon-size);font-size:var(--sd-icon-size);line-height:var(--sd-icon-size)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mat-mdc-chip-remove{position:relative;box-sizing:content-box;margin-right:3px;padding:2px;border-radius:50%;color:var(--sd-text-secondary);opacity:1}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mat-mdc-chip-remove:hover{background-color:var(--sd-surface-muted);color:var(--sd-text)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip--locked.mat-mdc-chip-row{--mdc-chip-elevated-container-color: var(--sd-chip-calendar-chip-locked-bg);--mat-chip-elevated-container-color: var(--sd-chip-calendar-chip-locked-bg)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip--locked.mat-mdc-chip-row .mdc-evolution-chip__text-label{display:inline-flex;align-items:center}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip--locked.mat-mdc-chip-row .mdc-evolution-chip__action--primary{padding-right:3px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__lock{box-sizing:content-box;margin-left:2px;padding:2px;color:var(--sd-text-muted)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__more{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--sd-chip-calendar-chip-height);padding:0 8px;border:0;border-radius:var(--sd-radius-6, 6px);background-color:var(--sd-surface-muted);color:var(--sd-text-secondary);font:inherit;font-size:var(--sd-chip-calendar-chip-font-size);font-weight:var(--sd-font-weight-medium, 500);cursor:pointer}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__more:hover{background-color:var(--sd-chip-calendar-more-hover-bg)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__more:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color);outline-offset:1px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__suffix.sd-clear-btn,:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open{width:var(--sd-chip-calendar-suffix-size);height:var(--sd-chip-calendar-suffix-size)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open{display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:var(--sd-radius-6, 6px);background:transparent;color:var(--sd-text-secondary);cursor:pointer}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open:hover{background-color:color-mix(in srgb,var(--sd-text) 5%,transparent)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color);outline-offset:1px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open--active{color:var(--sd-primary)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field.sd-chip-calendar-field--open{--mdc-outlined-text-field-outline-color: var(--sd-primary);--mat-form-field-outlined-outline-color: var(--sd-primary);--mdc-outlined-text-field-hover-outline-color: var(--sd-primary);--mat-form-field-outlined-hover-outline-color: var(--sd-primary);--mdc-outlined-text-field-label-text-color: var(--sd-primary);--mat-form-field-outlined-label-text-color: var(--sd-primary);--mdc-outlined-text-field-hover-label-text-color: var(--sd-primary);--mat-form-field-outlined-hover-label-text-color: var(--sd-primary)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field.sd-chip-calendar-field--open .mat-mdc-text-field-wrapper{box-shadow:var(--sd-control-ring, none)}@media(pointer:coarse){:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mat-mdc-chip-remove:after{content:\"\";position:absolute;inset:50% auto auto 50%;width:24px;height:24px;transform:translate(-50%,-50%)}}@media(prefers-reduced-motion:no-preference){:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__more,:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open,:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mat-mdc-chip-remove{transition:background-color var(--sd-duration-fast, .12s) ease}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i5.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i5.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled", "readonly", "matChipInputDisabledInteractive"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i5.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i5.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i6.MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i7.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i8.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { 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: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
347
676
  }
348
677
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdChipCalendar, decorators: [{
349
678
  type: Component,
@@ -359,17 +688,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
359
688
  MatInputModule,
360
689
  MatTooltipModule,
361
690
  MatFormFieldModule,
362
- MatAutocompleteModule,
363
- MatProgressSpinnerModule,
364
691
  MatChipsModule,
365
692
  MatDatepickerModule,
366
693
  MatNativeDateModule,
367
- MatMenuModule,
694
+ OverlayModule,
695
+ A11yModule,
696
+ SdButton,
697
+ SdTranslatePipe,
368
698
  SdLabel,
369
699
  SdView,
370
- SdRemovableChipPipe,
371
- ], template: "@let _label = label();\r\n@let _appearance = appearance();\r\n@let _required = required();\r\n@let _isViewed = isViewed();\r\n@let _hideInlineError = hideInlineError();\r\n@let _sdViewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\r\n@let _errorMessage = errorMessage();\r\n@let _size = size();\r\n@let _removable = removable();\r\n@let _labelTop = labelPlacement() === 'top';\r\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\r\n@let _errorVisible = !!_errorMessage && formControl.touched;\r\n@let _showInlineError = !_hideInlineError && _errorVisible;\r\n@let _viewTemplate = _sdViewDef?.templateRef;\r\n\r\n@if (_isViewed) {\r\n <sd-view\r\n [label]=\"_label\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if ((!_appearance || _labelTop) && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if ((!_appearance || _labelTop) && _label && !_labelTemplate) {\r\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\r\n }\r\n\r\n <!-- why: div ch\u1EC9 l\u00E0 h\u1ED9p layout \u2014 aria-hidden=\"true\" c\u0169 \u1EA9n C\u1EA2 c\u00E2y con (chip, \u00F4 nh\u1EADp, <mat-error>)\r\n kh\u1ECFi accessibility tree. \u1EDE \u0111\u00E2y (click) KH\u00D4NG ph\u1EA3i ti\u1EC7n \u00EDch chu\u1ED9t th\u1EEBa nh\u01B0 c\u00E1c control kh\u00E1c:\r\n khi sdViewDef \u0111ang hi\u1EC3n th\u1ECB th\u00EC kh\u00F4ng c\u00F3 ph\u1EA7n t\u1EED focus \u0111\u01B0\u1EE3c n\u00E0o b\u00EAn trong, n\u00EAn click l\u00E0 l\u1ED1i\r\n v\u00E0o DUY NH\u1EA4T. V\u00EC v\u1EADy handler \u0111\u01B0\u1EE3c chuy\u1EC3n h\u1EB3n xu\u1ED1ng ph\u1EA7n t\u1EED view v\u00E0 ph\u1EA7n t\u1EED \u0111\u00F3 nh\u1EADn\r\n role=\"button\" + tabindex=\"0\" + keydown Enter/Space; div ngo\u00E0i kh\u00F4ng c\u00F2n handler n\u00E0o. -->\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_viewTemplate\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\">\r\n @if (_viewTemplate && !isFocused) {\r\n <!-- why: KH\u00D4NG \u0111\u1EB7t aria-label \u2014 n\u1ED9i dung sdViewDef ch\u00EDnh l\u00E0 nh\u00E3n nh\u00ECn th\u1EA5y \u0111\u01B0\u1EE3c, aria-label\r\n s\u1EBD ghi \u0111\u00E8 v\u00E0 l\u00E0m AT \u0111\u1ECDc kh\u00E1c ch\u1EEF tr\u00EAn m\u00E0n h\u00ECnh. -->\r\n <div\r\n class=\"sd-chip-calendar__view-trigger\"\r\n role=\"button\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\"\r\n (keydown.enter)=\"onViewKeydown($event)\"\r\n (keydown.space)=\"onViewKeydown($event)\">\r\n <ng-container *ngTemplateOutlet=\"_viewTemplate; context: { value: formControl.value }\"></ng-container>\r\n </div>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [class.hide-inline-error]=\"_hideInlineError\"\r\n [class.sd-label-top]=\"_labelTop\"\r\n [appearance]=\"_appearance\"\r\n [floatLabel]=\"floatLabel()\">\r\n @if (_appearance && _label && !_labelTop) {\r\n <mat-label>{{ _label }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"_size === 'md'\" [class.sd-sm]=\"_size === 'sm'\">\r\n @for (item of formControl.value; track item) {\r\n @if (item) {\r\n <mat-chip-row\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [removable]=\"_removable\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\"\r\n [value]=\"item\">\r\n <span>{{ item | date: 'dd/MM/yyyy' }}</span>\r\n @if (!inputControl.disabled && item | sdRemovableChip: _removable) {\r\n <sd-icon matChipRemove name=\"cancel\"></sd-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n }\r\n\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"placeholder() || (_labelTop ? '' : _label)\"\r\n [matChipInputFor]=\"chipList\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n [matMenuTriggerFor]=\"calendarMenu\"\r\n [required]=\"_required\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n [attr.data-disabled]=\"dataDisabled()\"\r\n [attr.data-empty]=\"dataEmpty()\"\r\n [attr.data-value]=\"dataValue()\"\r\n [attr.data-count]=\"dataCount()\"\r\n [attr.data-required]=\"dataRequired()\"\r\n [attr.data-error-message]=\"dataErrorMessage()\"\r\n [attr.aria-invalid]=\"_errorVisible ? 'true' : null\"\r\n [attr.aria-describedby]=\"_errorMessage ? errorId : null\"\r\n readonly\r\n #input />\r\n </mat-chip-grid>\r\n\r\n <mat-menu #calendarMenu=\"matMenu\" overlapTrigger=\"false\" (closed)=\"onCloseCalendar()\">\r\n <!-- why: aria-hidden=\"true\" \u1EDF \u0111\u00E2y t\u1EEBng \u1EA9n NGUY\u00CAN <mat-calendar> \u2014 t\u1EE9c to\u00E0n b\u1ED9 l\u01B0\u1EDBi ng\u00E0y,\r\n n\u00FAt chuy\u1EC3n th\u00E1ng v\u00E0 \u00F4 ng\u00E0y \u0111ang ch\u1ECDn \u2014 kh\u1ECFi accessibility tree, d\u00F9 l\u1ECBch v\u1EABn nh\u1EADn\r\n focus v\u00E0 \u0111i\u1EC1u h\u01B0\u1EDBng b\u1EB1ng ph\u00EDm m\u0169i t\u00EAn. role=\"presentation\" ch\u1EC9 v\u00F4 hi\u1EC7u ho\u00E1 c\u00E1i div\r\n b\u1ECDc (n\u00F3 ch\u1EC9 t\u1ED3n t\u1EA1i \u0111\u1EC3 ch\u1EB7n n\u1ED5i b\u1ECDt click l\u00E0m \u0111\u00F3ng menu), KH\u00D4NG lan xu\u1ED1ng l\u1ECBch. -->\r\n <div style=\"width: 280px\" role=\"presentation\" (click)=\"$event.stopPropagation()\">\r\n <mat-calendar (selectedChange)=\"onSelectDate($event)\" [dateClass]=\"dateClass\"> </mat-calendar>\r\n </div>\r\n </mat-menu>\r\n @if (_hideInlineError && _errorVisible) {\r\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\r\n @if (_hideInlineError && _errorVisible) {\r\n <span class=\"sd-visually-hidden\" [id]=\"errorId\" matSuffix>{{ _errorMessage }}</span>\r\r\n }\r\n\r\n @if (_showInlineError) {\r\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\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}:host(.sd-has-label){padding-top:4px}:host(.sd-label-top){padding-top:0}:host(.sd-viewed){padding-top:0}:host ::ng-deep .mat-mdc-form-field.no-padding-wrapper .mat-mdc-text-field-wrapper{padding-bottom:0}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip{padding:7px 10px;min-height:26px}:host ::ng-deep mat-form-field.c-md .mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{padding:7px 7px 7px 10px}:host ::ng-deep .mat-mdc-chip-row.sd-sm{--mdc-chip-label-text-size: 12px;--mdc-chip-container-height: 20px}:host ::ng-deep .mat-mdc-chip-set.sd-md{margin-top:10px}:host ::ng-deep .mat-mdc-chip-set.sd-sm{margin-top:2px}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:var(--sd-chip-calendar-bg, #ebecf0)}mat-form-field{width:100%}mat-chip-listbox{display:flex;flex-wrap:wrap;gap:4px}::ng-deep .sd-chip-calendar-selected-date .mat-calendar-body-cell-content{background-color:var(--sd-primary-light)!important;color:var(--sd-primary)!important;border-radius:50%}.sd-chip-calendar__view-trigger{display:flex;align-items:center;width:100%;cursor:pointer}.sd-chip-calendar__view-trigger:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}\n"] }]
372
- }], ctorParameters: () => [], propDecorators: { menuTrigger: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatMenuTrigger), { isSignal: true }] }], calendar: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatCalendar), { isSignal: true }] }], autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], labelPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPlacement", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", 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 }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], hideInlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideInlineError", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], viewed: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewed", required: false }] }], hyperlink: [{ type: i0.Input, args: [{ isSignal: true, alias: "hyperlink", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }], input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], sdViewDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdViewDefDirective), { isSignal: true }] }], sdLabelDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdLabelDefDirective), { isSignal: true }] }], sdLabelTemplate: [{ type: i0.ContentChild, args: ['sdLabel', { isSignal: true }] }], sdValueTemplate: [{ type: i0.ContentChild, args: ['sdValue', { isSignal: true }] }] } });
700
+ ], template: "@let _label = label();\r\n@let _appearance = appearance();\r\n@let _required = required();\r\n@let _isViewed = isViewed();\r\n@let _hideInlineError = hideInlineError();\r\n@let _sdViewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\r\n@let _errorMessage = errorMessage();\r\n@let _size = size();\r\n@let _labelTop = labelPlacement() === 'top';\r\n@let _icons = iconSizes();\r\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\r\n@let _errorVisible = isErrorShown();\r\n@let _showInlineError = !_hideInlineError && _errorVisible;\r\n@let _viewTemplate = _sdViewDef?.templateRef;\r\n\r\n@if (_isViewed) {\r\n <sd-view\r\n [label]=\"_label\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"viewText()\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if ((!_appearance || _labelTop) && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if ((!_appearance || _labelTop) && _label && !_labelTemplate) {\r\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\r\n }\r\n\r\n <!-- why: div ch\u1EC9 l\u00E0 h\u1ED9p layout \u2014 aria-hidden=\"true\" c\u0169 \u1EA9n C\u1EA2 c\u00E2y con (chip, \u00F4 nh\u1EADp, <mat-error>)\r\n kh\u1ECFi accessibility tree. \u1EDE \u0111\u00E2y (click) KH\u00D4NG ph\u1EA3i ti\u1EC7n \u00EDch chu\u1ED9t th\u1EEBa nh\u01B0 c\u00E1c control kh\u00E1c:\r\n khi sdViewDef \u0111ang hi\u1EC3n th\u1ECB th\u00EC kh\u00F4ng c\u00F3 ph\u1EA7n t\u1EED focus \u0111\u01B0\u1EE3c n\u00E0o b\u00EAn trong, n\u00EAn click l\u00E0 l\u1ED1i\r\n v\u00E0o DUY NH\u1EA4T. V\u00EC v\u1EADy handler \u0111\u01B0\u1EE3c chuy\u1EC3n h\u1EB3n xu\u1ED1ng ph\u1EA7n t\u1EED view v\u00E0 ph\u1EA7n t\u1EED \u0111\u00F3 nh\u1EADn\r\n role=\"button\" + tabindex=\"0\" + keydown Enter/Space; div ngo\u00E0i kh\u00F4ng c\u00F2n handler n\u00E0o. -->\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_viewTemplate\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\">\r\n @if (_viewTemplate && !isFocused) {\r\n <!-- why: KH\u00D4NG \u0111\u1EB7t aria-label \u2014 n\u1ED9i dung sdViewDef ch\u00EDnh l\u00E0 nh\u00E3n nh\u00ECn th\u1EA5y \u0111\u01B0\u1EE3c, aria-label\r\n s\u1EBD ghi \u0111\u00E8 v\u00E0 l\u00E0m AT \u0111\u1ECDc kh\u00E1c ch\u1EEF tr\u00EAn m\u00E0n h\u00ECnh. -->\r\n <div\r\n class=\"sd-chip-calendar__view-trigger\"\r\n role=\"button\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\"\r\n (keydown.enter)=\"onViewKeydown($event)\"\r\n (keydown.space)=\"onViewKeydown($event)\">\r\n <ng-container *ngTemplateOutlet=\"_viewTemplate; context: { value: formControl.value }\"></ng-container>\r\n </div>\r\n } @else {\r\n <mat-form-field\r\n class=\"sd-chip-calendar-field\"\r\n [class.sd-md]=\"_size === 'md'\"\r\n [class.sd-sm]=\"_size === 'sm'\"\r\n [class.sd-lg]=\"_size === 'lg'\"\r\n [class.sd-chip-calendar-field--open]=\"isOpen()\"\r\n [class.hide-inline-error]=\"_hideInlineError\"\r\n [class.sd-label-top]=\"_labelTop\"\r\n [appearance]=\"_appearance\"\r\n [floatLabel]=\"floatLabel()\"\r\n (click)=\"onFieldClick()\">\r\n @if (_appearance && _label && !_labelTop) {\r\n <mat-label>{{ _label }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"_size === 'md'\" [class.sd-sm]=\"_size === 'sm'\">\r\n <!-- why: chip l\u00E0 ng\u00E0y \u0111\u00E3 chu\u1EA9n ho\u00E1 (yyyy/MM/dd), hi\u1EC7n theo ng\u00E0y (B2) v\u00E0 g\u1ED9p \u201C+N\u201D khi popup \u0111\u00F3ng (B3). `removable` \u00E1p\r\n c\u1EA3 cho Backspace / Delete tr\u00EAn chip (A1); chip c\u00F3 t\u00EAn \u0111\u1EA7y \u0111\u1EE7, n\u00FAt \u2715 c\u00F3 t\u00EAn ri\u00EAng (A6). -->\r\n @for (item of visibleDays(); track item) {\r\n @let _itemRemovable = isRemovable(item);\r\n <mat-chip-row\r\n class=\"sd-chip-calendar__chip\"\r\n [class.sd-chip-calendar__chip--locked]=\"!_itemRemovable\"\r\n [removable]=\"_itemRemovable\"\r\n [aria-label]=\"chipLabel(item)\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\"\r\n [value]=\"item\">\r\n <span class=\"sd-chip-calendar__chip-text\">{{ formatDay(item) }}</span>\r\n <!-- why: m\u1ED7i kh\u1ED1i @if m\u1ED9t ph\u1EA7n t\u1EED g\u1ED1c, \u0111\u1EC3 \u2715 \u0111\u01B0\u1EE3c chi\u1EBFu v\u00E0o \u00F4 trailing c\u1EE7a mat-chip-row ([matChipRemove]). -->\r\n @if (!inputControl.disabled && _itemRemovable) {\r\n <sd-icon matChipRemove name=\"close\" [size]=\"_icons.chip\" [ariaLabel]=\"removeLabel(item)\"></sd-icon>\r\n }\r\n @if (!inputControl.disabled && !_itemRemovable) {\r\n <sd-icon\r\n class=\"sd-chip-calendar__lock\"\r\n name=\"lock\"\r\n [size]=\"_icons.chip\"\r\n [matTooltip]=\"'core.form.chip-calendar.locked' | sdTranslate\"></sd-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n @if (hiddenCount() > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"sd-chip-calendar__more\"\r\n [attr.aria-label]=\"'core.form.chip-calendar.more' | sdTranslate: { count: hiddenCount() }\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-more' : null\"\r\n (click)=\"onMoreClick($event)\">\r\n +{{ hiddenCount() }}\r\n </button>\r\n }\r\n\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [id]=\"inputId\"\r\n [placeholder]=\"effectivePlaceholder()\"\r\n [matChipInputFor]=\"chipList\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n [required]=\"_required\"\r\n aria-haspopup=\"dialog\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\r\n (keydown)=\"onInputKeydown($event)\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n [attr.data-disabled]=\"dataDisabled()\"\r\n [attr.data-empty]=\"dataEmpty()\"\r\n [attr.data-value]=\"dataValue()\"\r\n [attr.data-count]=\"dataCount()\"\r\n [attr.data-required]=\"dataRequired()\"\r\n [attr.data-error-message]=\"dataErrorMessage()\"\r\n [attr.aria-invalid]=\"_errorVisible ? 'true' : null\"\r\n [attr.aria-describedby]=\"_errorMessage ? errorId : null\"\r\n readonly\r\n #input />\r\n </mat-chip-grid>\r\n\r\n @if (_hideInlineError && _errorVisible) {\r\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\r\n }\r\n @if (_hideInlineError && _errorVisible) {\r\n <span class=\"sd-visually-hidden\" [id]=\"errorId\" matSuffix>{{ _errorMessage }}</span>\r\n }\r\n <!-- Suffix (thi\u1EBFt k\u1EBF 2): n\u00FAt b\u1ECF h\u1EBFt (hover-gated nh\u01B0 sd-date, lu\u00F4n hi\u1EC7n khi popup m\u1EDF) r\u1ED3i n\u00FAt l\u1ECBch. \u1EA8n khi disabled. -->\r\n <!-- why: m\u1ED7i kh\u1ED1i @if m\u1ED9t ph\u1EA7n t\u1EED g\u1ED1c, \u0111\u1EC3 matSuffix \u0111\u01B0\u1EE3c chi\u1EBFu v\u00E0o v\u00F9ng suffix. -->\r\n @if (!formControl.disabled && clearable() && !_required && hasRemovable()) {\r\n <button\r\n type=\"button\"\r\n matSuffix\r\n class=\"sd-clear-btn sd-chip-calendar__suffix\"\r\n [class.sd-hover]=\"!isOpen()\"\r\n [attr.aria-label]=\"'core.form.chip-calendar.clear' | sdTranslate\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-clear' : null\"\r\n (click)=\"onClear($event)\">\r\n <sd-icon name=\"close\" [size]=\"_icons.clear\"></sd-icon>\r\n </button>\r\n }\r\n @if (!formControl.disabled) {\r\n <button\r\n type=\"button\"\r\n matSuffix\r\n class=\"sd-chip-calendar__open sd-chip-calendar__suffix\"\r\n [class.sd-chip-calendar__open--active]=\"isOpen()\"\r\n data-chip-calendar-open\r\n [attr.aria-label]=\"'core.form.date.open-picker' | sdTranslate\"\r\n aria-haspopup=\"dialog\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-open' : null\"\r\n (click)=\"onToggleClick($event)\">\r\n <sd-icon name=\"calendar_month\" [size]=\"_icons.open\"></sd-icon>\r\n </button>\r\n }\r\n\r\n @if (_showInlineError) {\r\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\r\n }\r\n </mat-form-field>\r\n\r\n <!-- Popup (thi\u1EBFt k\u1EBF 3): CDK overlay role=\"dialog\" treo d\u01B0\u1EDBi khung \u00F4. Ch\u1ECDn ng\u00E0y kh\u00F4ng \u0111\u00F3ng; \u0111\u00F3ng b\u1EB1ng \u201CXong\u201D, Esc\r\n ho\u1EB7c b\u1EA5m ra ngo\u00E0i. why: mat-menu c\u0169 \u0111\u00F3ng khi Tab v\u00E0 kh\u00F4ng ph\u1EA3i dialog (A3). Kh\u00F4ng aria-hidden \u1EDF \u0111\u00E2u c\u1EA3:\r\n l\u01B0\u1EDBi ng\u00E0y, n\u00FAt chuy\u1EC3n th\u00E1ng v\u00E0 \u00F4 \u0111ang ch\u1ECDn \u0111\u1EC1u ph\u1EA3i \u0111\u1ECDc \u0111\u01B0\u1EE3c. -->\r\n <ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\r\n [cdkConnectedOverlayOpen]=\"isOpen()\"\r\n [cdkConnectedOverlayPositions]=\"positions\"\r\n [cdkConnectedOverlayPush]=\"true\"\r\n [cdkConnectedOverlayViewportMargin]=\"8\"\r\n cdkConnectedOverlayPanelClass=\"sd-chip-calendar-pane\"\r\n (attach)=\"onAttach()\"\r\n (overlayOutsideClick)=\"onOutsideClick($event)\"\r\n (overlayKeydown)=\"onOverlayKeydown($event)\">\r\n @let _days = days();\r\n @let _maxCount = effectiveMaxCount();\r\n @let _full = full();\r\n <div\r\n class=\"sd-chip-calendar-panel\"\r\n role=\"dialog\"\r\n cdkTrapFocus\r\n [id]=\"panelId\"\r\n [attr.aria-label]=\"_label || ('core.form.chip-calendar.dialog-label' | sdTranslate)\"\r\n [attr.data-autoid]=\"autoId() ? autoId() + '-panel' : null\">\r\n <div class=\"sd-chip-calendar-panel__head\">\r\n <div class=\"sd-chip-calendar-panel__summary\">\r\n <span class=\"sd-chip-calendar-panel__count\">{{\r\n 'core.form.chip-calendar.selected-count' | sdTranslate: { count: _days.length }\r\n }}</span>\r\n <span class=\"sd-chip-calendar-panel__limit\">\r\n {{\r\n _maxCount > 0\r\n ? ('core.form.chip-calendar.max-count' | sdTranslate: { max: _maxCount })\r\n : ('core.form.chip-calendar.no-limit' | sdTranslate)\r\n }}\r\n </span>\r\n </div>\r\n <!-- why: v\u00F9ng live lu\u00F4n c\u00F3 m\u1EB7t (r\u1ED7ng khi ch\u01B0a \u0111\u1EE7) \u0111\u1EC3 screen reader \u0111\u1ECDc c\u00E2u \u201C\u0111\u00E3 \u0111\u1EE7\u201D ngay khi n\u00F3 xu\u1EA5t hi\u1EC7n. -->\r\n <p class=\"sd-chip-calendar-panel__full\" aria-live=\"polite\">\r\n @if (_full) {\r\n {{ 'core.form.chip-calendar.full' | sdTranslate: { max: _maxCount } }}\r\n }\r\n </p>\r\n </div>\r\n\r\n <mat-calendar\r\n [headerComponent]=\"calendarHeader\"\r\n [startAt]=\"openAt()\"\r\n [minDate]=\"resolvedMinDate()\"\r\n [maxDate]=\"resolvedMaxDate()\"\r\n [dateFilter]=\"calendarFilter()\"\r\n [dateClass]=\"calendarDateClass()\"\r\n (selectedChange)=\"onSelectDate($event)\">\r\n </mat-calendar>\r\n\r\n <div class=\"sd-chip-calendar-panel__footer\">\r\n @if (clearable()) {\r\n <sd-button\r\n data-chip-calendar-clear-all\r\n type=\"text\"\r\n color=\"primary\"\r\n size=\"sm\"\r\n [disabled]=\"!hasRemovable()\"\r\n [autoId]=\"autoId() ? autoId() + '-clear-all' : undefined\"\r\n [title]=\"'core.form.chip-calendar.clear-all' | sdTranslate\"\r\n (click)=\"onClear()\"></sd-button>\r\n } @else {\r\n <span></span>\r\n }\r\n <sd-button\r\n data-chip-calendar-done\r\n type=\"fill\"\r\n color=\"primary\"\r\n size=\"sm\"\r\n [autoId]=\"autoId() ? autoId() + '-done' : undefined\"\r\n [title]=\"'core.form.chip-calendar.done' | sdTranslate\"\r\n (click)=\"close(true)\"></sd-button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-label-top){padding-top:0}:host(.sd-viewed){padding-top:0}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:var(--sd-chip-calendar-bg)}mat-form-field{width:100%}.sd-chip-calendar__view-trigger{display:flex;align-items:center;width:100%;cursor:pointer}.sd-chip-calendar__view-trigger:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-chip-calendar-panel{display:flex;flex-direction:column;gap:4px;box-sizing:border-box;width:var(--sd-chip-calendar-panel-width, 296px);padding:12px 8px 8px;border:1px solid color-mix(in srgb,var(--sd-border) 60%,var(--sd-surface));border-radius:var(--sd-panel-radius, 10px);background-color:var(--sd-select-panel-bg, var(--sd-surface));box-shadow:var(--sd-shadow-md, none);color:var(--sd-text);animation:sd-chip-calendar-panel-in var(--sd-duration-fast, .12s) var(--sd-ease-standard, ease-out);--mat-datepicker-calendar-date-text-color: var(--sd-text);--mat-datepicker-calendar-date-hover-state-background-color: color-mix(in srgb, var(--sd-text) 5%, transparent);--mat-datepicker-calendar-date-focus-state-background-color: transparent;--mat-datepicker-calendar-date-today-outline-color: var(--sd-primary);--mat-datepicker-calendar-date-disabled-state-text-color: var(--sd-disabled-text);--mat-datepicker-calendar-date-today-disabled-state-outline-color: transparent;--mat-datepicker-calendar-header-text-color: var(--sd-text-secondary);--mat-datepicker-calendar-header-text-size: var(--sd-font-size-11, 11px);--mat-datepicker-calendar-header-text-weight: var(--sd-font-weight-medium, 500);--mat-datepicker-calendar-header-divider-color: transparent;--mat-datepicker-calendar-text-size: var(--sd-font-size-13, 13px)}@keyframes sd-chip-calendar-panel-in{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.sd-chip-calendar-panel{animation:none}}.sd-chip-calendar-panel__head{padding:0 8px}.sd-chip-calendar-panel__summary{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.sd-chip-calendar-panel__count{font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-semibold, 600)}.sd-chip-calendar-panel__limit{font-size:var(--sd-font-size-12, 12px);color:var(--sd-text-secondary)}.sd-chip-calendar-panel__full{margin:0;font-size:var(--sd-font-size-12, 12px);line-height:16px;color:var(--sd-warning-dark)}.sd-chip-calendar-panel__full:empty{display:none}.sd-chip-calendar-panel__footer{display:flex;align-items:center;justify-content:space-between;margin-top:4px;padding:8px 4px 0;border-top:1px solid var(--sd-select-panel-divider, var(--sd-border))}.sd-chip-calendar-panel ::ng-deep .mat-calendar-content{padding:0}.sd-chip-calendar-panel ::ng-deep .mat-calendar-table-header th{padding:0;line-height:24px}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-label{visibility:hidden}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell-content{font-variant-numeric:tabular-nums}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-selected{--mat-datepicker-calendar-date-hover-state-background-color: var(--sd-primary-600, var(--sd-primary-dark));--mat-datepicker-calendar-date-focus-state-background-color: var(--sd-primary);--mat-datepicker-calendar-date-today-outline-color: transparent}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-selected>.mat-calendar-body-cell-content{background-color:var(--sd-primary);color:var(--sd-primary-contrast);font-weight:var(--sd-font-weight-semibold, 600)}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-locked{--mat-datepicker-calendar-date-disabled-state-text-color: var(--sd-primary-dark);--mat-datepicker-calendar-date-hover-state-background-color: var(--sd-primary-light);--mat-datepicker-calendar-date-focus-state-background-color: var(--sd-primary-light)}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-locked>.mat-calendar-body-cell-content{background-color:var(--sd-primary-light);color:var(--sd-primary-dark)}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell:focus-visible>.mat-calendar-body-cell-content{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color);outline-offset:1px}@media(forced-colors:active){.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-selected>.mat-calendar-body-cell-content{forced-color-adjust:none;background-color:Highlight;color:HighlightText}.sd-chip-calendar-panel ::ng-deep .mat-calendar-body-cell.sd-chip-calendar-locked>.mat-calendar-body-cell-content{forced-color-adjust:auto;border:1px solid GrayText;background-color:Canvas;color:GrayText}}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field{--sd-chip-calendar-field-height: var(--sd-control-height-md, 40px);--sd-chip-calendar-chip-height: 24px;--sd-chip-calendar-chip-font-size: var(--sd-font-size-13, 13px);--sd-chip-calendar-chip-padding: 8px;--sd-chip-calendar-suffix-size: 28px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field.sd-sm{--sd-chip-calendar-field-height: var(--sd-control-height-sm, 32px);--sd-chip-calendar-chip-height: 20px;--sd-chip-calendar-chip-font-size: var(--sd-font-size-12, 12px);--sd-chip-calendar-suffix-size: 24px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field.sd-lg{--sd-chip-calendar-field-height: var(--sd-control-height-lg, 48px);--sd-chip-calendar-chip-height: 28px;--sd-chip-calendar-chip-font-size: var(--sd-font-size-14, 14px);--sd-chip-calendar-chip-padding: 10px;--sd-chip-calendar-suffix-size: 32px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field{--mat-form-field-container-height: var(--sd-chip-calendar-field-height)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mat-mdc-form-field-infix{min-height:var(--sd-chip-calendar-field-height);padding-top:calc((var(--sd-chip-calendar-field-height) - var(--sd-chip-calendar-chip-height)) / 2);padding-bottom:calc((var(--sd-chip-calendar-field-height) - var(--sd-chip-calendar-chip-height)) / 2);border-top-width:0}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mdc-evolution-chip-set__chips{gap:4px;margin:0}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mat-mdc-chip-set .mdc-evolution-chip{margin:0}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mat-mdc-form-field-infix input.mat-mdc-chip-input.mat-mdc-input-element{flex:1 1 0;min-width:0;height:var(--sd-chip-calendar-chip-height);margin:0}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row{--mdc-chip-container-height: var(--sd-chip-calendar-chip-height);--mat-chip-container-height: var(--sd-chip-calendar-chip-height);--mdc-chip-container-shape-radius: var(--sd-radius-6, 6px);--mat-chip-container-shape-radius: var(--sd-radius-6, 6px);--mdc-chip-outline-width: 1px;--mat-chip-outline-width: 1px;--mdc-chip-outline-color: var(--sd-border);--mat-chip-outline-color: var(--sd-border);--mdc-chip-elevated-container-color: var(--sd-surface);--mat-chip-elevated-container-color: var(--sd-surface);--mdc-chip-label-text-color: var(--sd-text);--mat-chip-label-text-color: var(--sd-text);--mdc-chip-label-text-size: var(--sd-chip-calendar-chip-font-size);--mat-chip-label-text-size: var(--sd-chip-calendar-chip-font-size);--mdc-chip-label-text-weight: var(--sd-font-weight-regular, 400);--mat-chip-label-text-weight: var(--sd-font-weight-regular, 400);--mdc-chip-with-trailing-icon-trailing-icon-color: var(--sd-text-secondary);--mat-chip-with-trailing-icon-trailing-icon-color: var(--sd-text-secondary);--mdc-chip-trailing-action-state-layer-color: transparent;--mat-chip-trailing-action-state-layer-color: transparent;--mdc-chip-selected-trailing-action-state-layer-color: transparent;--mat-chip-selected-trailing-action-state-layer-color: transparent}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mdc-evolution-chip__action--primary{padding-left:var(--sd-chip-calendar-chip-padding);padding-right:2px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mdc-evolution-chip__action--trailing{padding-left:0;padding-right:3px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .sd-chip-calendar__chip-text{font-variant-numeric:tabular-nums;white-space:nowrap}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mat-mdc-chip-remove,:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mat-mdc-chip-remove .mat-icon{width:var(--sd-icon-size);height:var(--sd-icon-size);font-size:var(--sd-icon-size);line-height:var(--sd-icon-size)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mat-mdc-chip-remove{position:relative;box-sizing:content-box;margin-right:3px;padding:2px;border-radius:50%;color:var(--sd-text-secondary);opacity:1}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip.mat-mdc-chip-row .mat-mdc-chip-remove:hover{background-color:var(--sd-surface-muted);color:var(--sd-text)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip--locked.mat-mdc-chip-row{--mdc-chip-elevated-container-color: var(--sd-chip-calendar-chip-locked-bg);--mat-chip-elevated-container-color: var(--sd-chip-calendar-chip-locked-bg)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip--locked.mat-mdc-chip-row .mdc-evolution-chip__text-label{display:inline-flex;align-items:center}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__chip--locked.mat-mdc-chip-row .mdc-evolution-chip__action--primary{padding-right:3px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__lock{box-sizing:content-box;margin-left:2px;padding:2px;color:var(--sd-text-muted)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__more{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--sd-chip-calendar-chip-height);padding:0 8px;border:0;border-radius:var(--sd-radius-6, 6px);background-color:var(--sd-surface-muted);color:var(--sd-text-secondary);font:inherit;font-size:var(--sd-chip-calendar-chip-font-size);font-weight:var(--sd-font-weight-medium, 500);cursor:pointer}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__more:hover{background-color:var(--sd-chip-calendar-more-hover-bg)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__more:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color);outline-offset:1px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__suffix.sd-clear-btn,:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open{width:var(--sd-chip-calendar-suffix-size);height:var(--sd-chip-calendar-suffix-size)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open{display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:var(--sd-radius-6, 6px);background:transparent;color:var(--sd-text-secondary);cursor:pointer}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open:hover{background-color:color-mix(in srgb,var(--sd-text) 5%,transparent)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color);outline-offset:1px}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open--active{color:var(--sd-primary)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field.sd-chip-calendar-field--open{--mdc-outlined-text-field-outline-color: var(--sd-primary);--mat-form-field-outlined-outline-color: var(--sd-primary);--mdc-outlined-text-field-hover-outline-color: var(--sd-primary);--mat-form-field-outlined-hover-outline-color: var(--sd-primary);--mdc-outlined-text-field-label-text-color: var(--sd-primary);--mat-form-field-outlined-label-text-color: var(--sd-primary);--mdc-outlined-text-field-hover-label-text-color: var(--sd-primary);--mat-form-field-outlined-hover-label-text-color: var(--sd-primary)}:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field.sd-chip-calendar-field--open .mat-mdc-text-field-wrapper{box-shadow:var(--sd-control-ring, none)}@media(pointer:coarse){:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mat-mdc-chip-remove:after{content:\"\";position:absolute;inset:50% auto auto 50%;width:24px;height:24px;transform:translate(-50%,-50%)}}@media(prefers-reduced-motion:no-preference){:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__more,:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .sd-chip-calendar__open,:host ::ng-deep .mat-mdc-form-field.sd-chip-calendar-field .mat-mdc-chip-remove{transition:background-color var(--sd-duration-fast, .12s) ease}}\n"] }]
701
+ }], ctorParameters: () => [], propDecorators: { calendar: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatCalendar), { isSignal: true }] }], field: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatFormField), { isSignal: true }] }], autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], labelPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPlacement", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", 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 }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], hideInlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideInlineError", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], minCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "minCount", required: false }] }], maxCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCount", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], dateFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateFilter", required: false }] }], startAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "startAt", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], maxVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisible", required: false }] }], displayFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayFormat", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], viewed: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewed", required: false }] }], transform: [{ type: i0.Input, args: [{ isSignal: true, alias: "transform", required: false }] }], hyperlink: [{ type: i0.Input, args: [{ isSignal: true, alias: "hyperlink", required: false }] }], model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }], input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], sdViewDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdViewDefDirective), { isSignal: true }] }], sdLabelDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdLabelDefDirective), { isSignal: true }] }], sdLabelTemplate: [{ type: i0.ContentChild, args: ['sdLabel', { isSignal: true }] }], sdValueTemplate: [{ type: i0.ContentChild, args: ['sdValue', { isSignal: true }] }] } });
373
702
 
374
703
  /**
375
704
  * Generated bundle index. Do not edit.