@sdcorejs/angular 22.3.1 → 22.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 +166 -11
  19. package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
  20. package/fesm2022/sdcorejs-angular-components-badge.mjs +590 -24
  21. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  22. package/fesm2022/sdcorejs-angular-components-button.mjs +35 -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 +1906 -0
  29. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -0
  30. package/fesm2022/sdcorejs-angular-components-editor.mjs +461 -757
  31. package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
  32. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +69 -37
  33. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
  34. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +2192 -1179
  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 +182 -284
  47. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
  48. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +1 -316
  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 +274 -44
  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 +202 -43
  63. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  64. package/fesm2022/sdcorejs-angular-components-table.mjs +581 -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 +498 -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 +480 -126
  84. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  85. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +82 -13
  86. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  87. package/fesm2022/sdcorejs-angular-forms-date.mjs +77 -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 +90 -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 +46 -5
  98. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  99. package/fesm2022/sdcorejs-angular-forms-input.mjs +56 -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 +71 -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-BrJfOTWy.mjs +509 -0
  122. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-BrJfOTWy.mjs.map +1 -0
  123. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-DQYXx2nr.mjs +232 -0
  124. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-DQYXx2nr.mjs.map +1 -0
  125. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-Cjg3Dfq1.mjs +294 -0
  126. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-Cjg3Dfq1.mjs.map +1 -0
  127. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DpXg2yI7.mjs +1556 -0
  128. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-DpXg2yI7.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 +1908 -46
  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,78 +1,131 @@
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: "22.1.5", ngImport: i0, type: SdRemovableChipPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
41
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.5", ngImport: i0, type: SdRemovableChipPipe, isStandalone: true, name: "sdRemovableChip" });
51
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ɵSdChipCalendarHeader, deps: null, target: i0.ɵɵFactoryTarget.Component });
52
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.5", 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: "22.1.5", ngImport: i0, type: SdRemovableChipPipe, decorators: [{
44
- type: Pipe,
45
- args: [{
46
- name: 'sdRemovableChip',
47
- }]
48
- }], ctorParameters: () => [] });
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", 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, /* @ts-ignore */
73
- ...(ngDevMode ? [{ debugName: "menuTrigger" }] : /* istanbul ignore next */ []));
74
102
  calendar = viewChild(MatCalendar, /* @ts-ignore */
75
103
  ...(ngDevMode ? [{ debugName: "calendar" }] : /* istanbul ignore next */ []));
104
+ // why: query signal không đặt được trên field ES private (#).
105
+ field = viewChild(MatFormField, /* @ts-ignore */
106
+ ...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
107
+ /** Header of the popup calendar (handoff 3 · 2). */
108
+ calendarHeader = ɵSdChipCalendarHeader;
109
+ panelId = `sd-chip-calendar-panel-${Utilities.generateUuid()}`;
110
+ /** Whether the popup is open. */
111
+ isOpen = signal(false, /* @ts-ignore */
112
+ ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
113
+ /** Month the popup opened at (4.2), fixed for one opening. */
114
+ openAt = signal(null, /* @ts-ignore */
115
+ ...(ngDevMode ? [{ debugName: "openAt" }] : /* istanbul ignore next */ []));
116
+ /**
117
+ * The popup hangs from the field box (the outline), like the select panel. Read in `open()`: `_textField` of
118
+ * `MatFormField` is a view query, and read too early the origin falls back to the whole field with its subscript row.
119
+ */
120
+ overlayOrigin = signal(undefined, /* @ts-ignore */
121
+ ...(ngDevMode ? [{ debugName: "overlayOrigin" }] : /* istanbul ignore next */ []));
122
+ // 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ỗ.
123
+ positions = [
124
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 6 },
125
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -6 },
126
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 6 },
127
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -6 },
128
+ ];
76
129
  autoIdInput = input(undefined, { ...(ngDevMode ? { debugName: "autoIdInput" } : /* istanbul ignore next */ {}), alias: 'autoId',
77
130
  transform: (v) => v ?? undefined });
78
131
  autoId = computed(() => (this.autoIdInput() ? `forms-chip-calendar-${this.autoIdInput()}` : undefined), /* @ts-ignore */
@@ -128,20 +181,63 @@ class SdChipCalendar {
128
181
  } });
129
182
  label = input('', { ...(ngDevMode ? { debugName: "label" } : /* istanbul ignore next */ {}), transform: (v) => v ?? '' });
130
183
  placeholder = input(undefined, { ...(ngDevMode ? { debugName: "placeholder" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
184
+ /**
185
+ * `true` / `false` for every chip, or a predicate. The predicate receives the normalised `yyyy/MM/dd` day and is
186
+ * applied on every removal path: the ✕ button, Backspace / Delete on a chip, pressing the day again in the
187
+ * calendar and clearing.
188
+ */
131
189
  removable = input(true, { ...(ngDevMode ? { debugName: "removable" } : /* istanbul ignore next */ {}), transform: (v) => v ?? true });
132
190
  hideInlineError = input(false, { ...(ngDevMode ? { debugName: "hideInlineError" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
133
191
  required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
192
+ /** Fewest days to pick; > 0 adds `Validators.minLength`. Replaces `min`. */
193
+ minCount = input(undefined, { ...(ngDevMode ? { debugName: "minCount" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
194
+ /** Most days to pick; > 0 adds `Validators.maxLength` and blocks picking more in the calendar (4.3). Replaces `max`. */
195
+ maxCount = input(undefined, { ...(ngDevMode ? { debugName: "maxCount" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
196
+ /** @deprecated Use `minCount`; `minCount` wins when both are set. */
134
197
  min = input(0, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: (v) => v ?? 0 });
198
+ /** @deprecated Use `maxCount`; `maxCount` wins when both are set. */
135
199
  max = input(0, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: (v) => v ?? 0 });
200
+ /** Earliest day that can be picked; same reading as `minDate` of `<sd-date>` (`'TODAY'` = today in the zone). */
201
+ minDate = input(null, /* @ts-ignore */
202
+ ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
203
+ /** Latest day that can be picked; same reading as `maxDate` of `<sd-date>`. */
204
+ maxDate = input(null, /* @ts-ignore */
205
+ ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
206
+ /** `false` makes a day unpickable. A chosen day stays removable even when the filter refuses it. Name of `mat-calendar`. */
207
+ dateFilter = input(null, /* @ts-ignore */
208
+ ...(ngDevMode ? [{ debugName: "dateFilter" }] : /* istanbul ignore next */ []));
209
+ /** Month the popup opens at; without it, the chosen day nearest to today, else today (4.2). */
210
+ startAt = input(null, /* @ts-ignore */
211
+ ...(ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []));
212
+ /** Shows “Xoá hết” in the popup (and the clear button of the field). Off by default, like `clearable` of `<sd-date>`. */
213
+ clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
214
+ /**
215
+ * Chips shown while the popup is closed; the rest fold into a “+N” button that opens it. `null` shows them all.
216
+ * `2` is the suggestion inside `<sd-table>` filters.
217
+ */
218
+ maxVisible = input(null, /* @ts-ignore */
219
+ ...(ngDevMode ? [{ debugName: "maxVisible" }] : /* istanbul ignore next */ []));
220
+ /** Date format of the chips and of the viewed text, in Angular `DatePipe` syntax. */
221
+ displayFormat = input('dd/MM/yyyy', { ...(ngDevMode ? { debugName: "displayFormat" } : /* istanbul ignore next */ {}), transform: (v) => v || 'dd/MM/yyyy' });
136
222
  disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
137
223
  /** Display mode: `false` edit · `true` static view · `'inline'` interactive (disabled `'inline'` → static). */
138
224
  viewed = input(false, { ...(ngDevMode ? { debugName: "viewed" } : /* istanbul ignore next */ {}), transform: sdViewedTransform });
225
+ /**
226
+ * String form of each day when the value leaves the component, same contract as `<sd-date>`: `undefined` →
227
+ * `yyyy/MM/dd`, `'ISOString'` / `'UTCString'` → the start of the day (in `ISdCoreConfiguration.timeZone` when
228
+ * configured). Display is not affected.
229
+ */
230
+ transform = input(/* @ts-ignore */
231
+ ...(ngDevMode ? [undefined, { debugName: "transform" }] : /* istanbul ignore next */ []));
139
232
  // why: tri-state viewed — `'inline'` keeps it interactive; disabled `'inline'` falls back to static.
140
233
  #viewedState = sdViewedInline(this.viewed, undefined, this.disabled);
141
234
  /** `true` when the static view should render (`viewed===true`, or disabled `'inline'`). */
142
235
  isViewed = this.#viewedState.isViewed;
143
236
  hyperlink = input(undefined, { ...(ngDevMode ? { debugName: "hyperlink" } : /* istanbul ignore next */ {}), transform: (v) => v ?? undefined });
144
- // Two-way model
237
+ /**
238
+ * Two-way model. Read wide (each item `string | number | Date`, like `<sd-date>`), written back only on a user
239
+ * action, as `string[]`. A model from the parent is never rewritten.
240
+ */
145
241
  model = model(undefined, /* @ts-ignore */
146
242
  ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
147
243
  // Outputs (modelChange auto-generated by model() signal)
@@ -158,14 +254,22 @@ class SdChipCalendar {
158
254
  ...(ngDevMode ? [{ debugName: "sdValueTemplate" }] : /* istanbul ignore next */ []));
159
255
  isFocused = false;
160
256
  #inputControl = new FormControl();
257
+ /** Holds the normalised days (`yyyy/MM/dd`, no duplicates, model order); the parent form gets this control
258
+ * unless a `transform` is set. */
161
259
  #formControl = new SdFormControl();
162
260
  // why: `min`/`max` là validator do CHÍNH component sở hữu; `required` đi qua option riêng của
163
261
  // connector. Connector chỉ add/remove đúng phần này nên validator do consumer tự gắn vào
164
262
  // `formControl` public không bị xoá — trước đây `clearValidators()` + `setValidators()` xoá sạch.
263
+ /** `minCount`, else the deprecated `min`. */
264
+ effectiveMinCount = computed(() => this.minCount() ?? this.min() ?? 0, /* @ts-ignore */
265
+ ...(ngDevMode ? [{ debugName: "effectiveMinCount" }] : /* istanbul ignore next */ []));
266
+ /** `maxCount`, else the deprecated `max`. */
267
+ effectiveMaxCount = computed(() => this.maxCount() ?? this.max() ?? 0, /* @ts-ignore */
268
+ ...(ngDevMode ? [{ debugName: "effectiveMaxCount" }] : /* istanbul ignore next */ []));
165
269
  #validators = computed(() => {
166
270
  const validators = [];
167
- const min = this.min();
168
- const max = this.max();
271
+ const min = this.effectiveMinCount();
272
+ const max = this.effectiveMaxCount();
169
273
  if (min > 0)
170
274
  validators.push(Validators.minLength(min));
171
275
  if (max > 0)
@@ -173,32 +277,129 @@ class SdChipCalendar {
173
277
  return validators;
174
278
  }, /* @ts-ignore */
175
279
  ...(ngDevMode ? [{ debugName: "#validators" }] : /* istanbul ignore next */ []));
280
+ /**
281
+ * why: with a `transform` the model holds ISO / RFC-1123 strings while the control keeps `yyyy/MM/dd`. Like
282
+ * `<sd-date>`, the parent form then gets a control that carries the model, so `form.value` equals `modelChange`.
283
+ */
284
+ #modelFacing = _sdModelFacingControl({
285
+ active: computed(() => !!this.transform()),
286
+ model: this.model,
287
+ writeModel: value => this.#writeModel(value),
288
+ source: computed(() => this.#formControl),
289
+ modelEquals: (left, right) => this.#modelsEqual(left, right),
290
+ });
176
291
  #formConnector = _sdFormControlConnector({
177
292
  form: this.form,
178
293
  name: computed(() => this.name() || this.#name),
179
294
  control: computed(() => this.#formControl),
295
+ registeredControl: this.#modelFacing.registered,
296
+ model: this.model,
297
+ writeModel: value => this.#writeModel(value),
298
+ modelToControl: value => this.#days(value),
299
+ controlToModel: days => this.#serializeDays(days),
300
+ modelEquals: (left, right) => this.#modelsEqual(left, right),
301
+ controlEquals: sameDays,
180
302
  validators: this.#validators,
181
303
  required: this.required,
182
304
  });
183
305
  #matcher;
184
- separatorKeysCodes = [ENTER, COMMA];
306
+ #fullDate = computed(() => new Intl.DateTimeFormat(this.#i18n.locale(), FULL_DATE), /* @ts-ignore */
307
+ ...(ngDevMode ? [{ debugName: "#fullDate" }] : /* istanbul ignore next */ []));
308
+ /** Chosen days, normalised (`yyyy/MM/dd`, model order). */
309
+ days = computed(() => this.#days(this.model()) ?? [], /* @ts-ignore */
310
+ ...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
311
+ /** `maxCount` reached: unchosen days are disabled and the popup says so (4.3). */
312
+ full = computed(() => {
313
+ const max = this.effectiveMaxCount();
314
+ return max > 0 && this.days().length >= max;
315
+ }, /* @ts-ignore */
316
+ ...(ngDevMode ? [{ debugName: "full" }] : /* istanbul ignore next */ []));
317
+ /** At least one chosen day may be removed (enables “Xoá hết”). */
318
+ hasRemovable = computed(() => {
319
+ void this.removable();
320
+ return this.days().some(day => this.isRemovable(day));
321
+ }, /* @ts-ignore */
322
+ ...(ngDevMode ? [{ debugName: "hasRemovable" }] : /* istanbul ignore next */ []));
323
+ /** Chosen days by date (B2). Display only: the model keeps its order. `yyyy/MM/dd` sorts as text in date order. */
324
+ sortedDays = computed(() => [...this.days()].sort(), /* @ts-ignore */
325
+ ...(ngDevMode ? [{ debugName: "sortedDays" }] : /* istanbul ignore next */ []));
326
+ /** Chips on screen: all while the popup is open, else at most `maxVisible` (B3). */
327
+ visibleDays = computed(() => {
328
+ const days = this.sortedDays();
329
+ const max = this.maxVisible();
330
+ if (this.isOpen() || max === null || max === undefined || max < 0 || days.length <= max)
331
+ return days;
332
+ return days.slice(0, max);
333
+ }, /* @ts-ignore */
334
+ ...(ngDevMode ? [{ debugName: "visibleDays" }] : /* istanbul ignore next */ []));
335
+ /** Icon sizes of the chips and suffix buttons for the current size. */
336
+ iconSizes = computed(() => FIELD_ICONS[this.size() === 'sm' || this.size() === 'lg' ? this.size() : 'md'], /* @ts-ignore */
337
+ ...(ngDevMode ? [{ debugName: "iconSizes" }] : /* istanbul ignore next */ []));
338
+ /** Days folded into “+N”. */
339
+ hiddenCount = computed(() => this.sortedDays().length - this.visibleDays().length, /* @ts-ignore */
340
+ ...(ngDevMode ? [{ debugName: "hiddenCount" }] : /* istanbul ignore next */ []));
341
+ /** Viewed text: days by date in `displayFormat`, joined by “, ” (C3). */
342
+ viewText = computed(() => this.sortedDays()
343
+ .map(day => this.formatDay(day))
344
+ .join(', '), /* @ts-ignore */
345
+ ...(ngDevMode ? [{ debugName: "viewText" }] : /* istanbul ignore next */ []));
346
+ /** Placeholder while no day is chosen: the input, else “Chọn ngày” — no longer the label (B1). Empty once there are chips. */
347
+ effectivePlaceholder = computed(() => this.days().length ? '' : this.placeholder() || this.#i18n.t('core.form.chip-calendar.placeholder'), /* @ts-ignore */
348
+ ...(ngDevMode ? [{ debugName: "effectivePlaceholder" }] : /* istanbul ignore next */ []));
349
+ resolvedMinDate = computed(() => this.#toDate(this.minDate()), /* @ts-ignore */
350
+ ...(ngDevMode ? [{ debugName: "resolvedMinDate" }] : /* istanbul ignore next */ []));
351
+ resolvedMaxDate = computed(() => this.#toDate(this.maxDate()), /* @ts-ignore */
352
+ ...(ngDevMode ? [{ debugName: "resolvedMaxDate" }] : /* istanbul ignore next */ []));
353
+ /**
354
+ * `dateFilter` handed to `mat-calendar` (4.1): a chosen day is pickable exactly when it may be removed (even against the
355
+ * consumer filter), an unchosen one when the limit is not reached and the consumer filter allows it. A new function on
356
+ * every change makes `mat-calendar` render its cells again.
357
+ */
358
+ calendarFilter = computed(() => {
359
+ const chosen = new Set(this.days());
360
+ const full = this.full();
361
+ const consumer = this.dateFilter();
362
+ void this.removable();
363
+ return (date) => {
364
+ if (!date)
365
+ return false;
366
+ const day = DateUtilities.toFormat(date, 'yyyy/MM/dd');
367
+ if (chosen.has(day))
368
+ return this.isRemovable(day);
369
+ return !full && (!consumer || consumer(date));
370
+ };
371
+ }, /* @ts-ignore */
372
+ ...(ngDevMode ? [{ debugName: "calendarFilter" }] : /* istanbul ignore next */ []));
373
+ /** Cell classes: `sd-chip-calendar-selected`, plus `sd-chip-calendar-locked` for a chosen day that cannot go. */
374
+ calendarDateClass = computed(() => {
375
+ const chosen = new Set(this.days());
376
+ void this.removable();
377
+ return (date, view = 'month') => {
378
+ if (view !== 'month')
379
+ return '';
380
+ const day = DateUtilities.toFormat(date, 'yyyy/MM/dd');
381
+ if (!chosen.has(day))
382
+ return '';
383
+ return this.isRemovable(day) ? 'sd-chip-calendar-selected' : 'sd-chip-calendar-selected sd-chip-calendar-locked';
384
+ };
385
+ }, /* @ts-ignore */
386
+ ...(ngDevMode ? [{ debugName: "calendarDateClass" }] : /* istanbul ignore next */ []));
185
387
  constructor() {
186
- effect(() => {
187
- const values = this.model();
188
- if (Array.isArray(values)) {
189
- this.#formControl.setValue(values);
190
- }
191
- });
192
388
  effect(() => {
193
389
  const isDisabled = this.disabled();
194
- if (isDisabled) {
195
- this.#formControl.disable();
196
- this.#inputControl.disable();
390
+ // why: `enable()` / `disable()` phát `valueChanges`; connector sẽ coi đó là thao tác và ghi model (đã
391
+ // transform) ngược lên cha. Chỉ đổi khi trạng thái thật sự khác, và không phát event.
392
+ if (isDisabled !== this.#formControl.disabled) {
393
+ if (isDisabled)
394
+ this.#formControl.disable({ emitEvent: false });
395
+ else
396
+ this.#formControl.enable({ emitEvent: false });
397
+ this.#ref.markForCheck();
197
398
  }
198
- else {
199
- this.#formControl.enable();
399
+ if (isDisabled)
400
+ this.#inputControl.disable();
401
+ else
200
402
  this.#inputControl.enable();
201
- }
202
403
  });
203
404
  effect(() => {
204
405
  const nameVal = this.name();
@@ -206,7 +407,15 @@ class SdChipCalendar {
206
407
  this.#name = nameVal;
207
408
  }
208
409
  });
209
- this.#matcher = new SdChipCalendarErrorStateMatcher(this.#formControl);
410
+ effect(() => {
411
+ if ((this.min() > 0 || this.max() > 0) && !this.#warnedDeprecated && isDevMode()) {
412
+ this.#warnedDeprecated = true;
413
+ console.warn('[sd-chip-calendar] `min` / `max` are deprecated; use `minCount` / `maxCount`.');
414
+ }
415
+ });
416
+ // why: `submitted` của form cha không phải signal; submit phải vẽ lại lỗi dưới OnPush.
417
+ this.#parentForm?.ngSubmit.pipe(takeUntilDestroyed(inject(DestroyRef))).subscribe(() => this.#ref.markForCheck());
418
+ this.#matcher = { isErrorState: (_control, form) => this.#errorGate(form) };
210
419
  }
211
420
  get formControl() {
212
421
  return this.#formControl;
@@ -223,8 +432,8 @@ class SdChipCalendar {
223
432
  errorMessage = computed(() => {
224
433
  void this.#state();
225
434
  void this.required();
226
- const min = this.min();
227
- const max = this.max();
435
+ const min = this.effectiveMinCount();
436
+ const max = this.effectiveMaxCount();
228
437
  const errors = this.#formControl.errors;
229
438
  if (!errors)
230
439
  return undefined;
@@ -240,6 +449,97 @@ class SdChipCalendar {
240
449
  get matcher() {
241
450
  return this.#matcher;
242
451
  }
452
+ /**
453
+ * The one place that decides whether the error shows (A4): `ErrorStateMatcher`, `<mat-error>`, `aria-invalid` and
454
+ * the `hideInlineError` icon all read it. Invalid and touched, or the parent form was submitted; a selection that
455
+ * is still too short while the user picks (dirty only) shows nothing.
456
+ */
457
+ isErrorShown() {
458
+ return !!this.errorMessage() && this.#errorGate();
459
+ }
460
+ #errorGate(form) {
461
+ const control = this.#formControl;
462
+ return control.invalid && (control.touched || !!(form ?? this.#parentForm)?.submitted);
463
+ }
464
+ /** Whether `day` (`yyyy/MM/dd`) may be removed, per `removable`. */
465
+ isRemovable(day) {
466
+ const removable = this.removable();
467
+ return typeof removable === 'function' ? !!removable(day) : removable;
468
+ }
469
+ /** Accessible name of a chip: the full date in the current locale, plus the locked note. */
470
+ chipLabel(day) {
471
+ const full = this.#fullDate().format(dayToDate(day));
472
+ return this.isRemovable(day) ? full : `${full}, ${this.#i18n.t('core.form.chip-calendar.locked')}`;
473
+ }
474
+ /** A chip day in `displayFormat` (Angular `DatePipe` / `formatDate` syntax, as the chips used before). */
475
+ formatDay(day) {
476
+ return formatDate(dayToDate(day), this.displayFormat(), this.#locale);
477
+ }
478
+ /** Accessible name of the ✕ button of a chip. */
479
+ removeLabel(day) {
480
+ return this.#i18n.t('core.form.chip-calendar.remove', { date: this.#fullDate().format(dayToDate(day)) });
481
+ }
482
+ /** Opens the popup at the month of 4.2. No-op when disabled, viewed or already open. */
483
+ open() {
484
+ if (this.#formControl.disabled || this.isViewed() || this.isOpen())
485
+ return;
486
+ this.openAt.set(this.#firstMonth());
487
+ this.overlayOrigin.set(this.field()?.getConnectedOverlayOrigin());
488
+ this.isOpen.set(true);
489
+ this.#ref.markForCheck();
490
+ }
491
+ /** Closes the popup and marks the field touched (A4); `returnFocus` puts focus back on the input (Esc, “Xong”). */
492
+ close(returnFocus = false) {
493
+ if (!this.isOpen())
494
+ return;
495
+ this.isOpen.set(false);
496
+ this.isFocused = false;
497
+ this.#formConnector.markAsTouched();
498
+ this.#ref.markForCheck();
499
+ if (returnFocus)
500
+ this.input()?.nativeElement.focus();
501
+ }
502
+ /** Focus goes to the active day of the grid once the panel is attached. */
503
+ onAttach() {
504
+ this.#timers.schedule(() => this.calendar()?.focusActiveCell(), 0);
505
+ }
506
+ onOverlayKeydown(event) {
507
+ if (event.key === 'Escape' || event.key === 'Esc') {
508
+ event.preventDefault();
509
+ this.close(true);
510
+ }
511
+ }
512
+ /** A click outside closes; a click on the field itself is left to the field (it keeps the popup open). */
513
+ onOutsideClick(event) {
514
+ const target = event.target;
515
+ if (target && this.#host.contains(target))
516
+ return;
517
+ this.close();
518
+ }
519
+ /** Click on the empty part of the field or on the input opens the popup; chips stop the click (3 · 2). */
520
+ onFieldClick() {
521
+ this.open();
522
+ }
523
+ /** Calendar button of the suffix: opens or closes the popup without the field click opening it again. */
524
+ onToggleClick(event) {
525
+ event.stopPropagation();
526
+ if (this.isOpen())
527
+ this.close();
528
+ else
529
+ this.open();
530
+ }
531
+ /** “+N” opens the popup, where every chip shows. */
532
+ onMoreClick(event) {
533
+ event.stopPropagation();
534
+ this.open();
535
+ }
536
+ /** Enter, Space, ArrowDown and Alt+ArrowDown on the input open the popup. */
537
+ onInputKeydown(event) {
538
+ if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {
539
+ event.preventDefault();
540
+ this.open();
541
+ }
542
+ }
243
543
  ngAfterViewInit() {
244
544
  this.#subscription.add(this.#formControl.sdChanges.subscribe(() => {
245
545
  this.#ref.markForCheck();
@@ -248,6 +548,89 @@ class SdChipCalendar {
248
548
  ngOnDestroy() {
249
549
  this.#subscription.unsubscribe();
250
550
  }
551
+ /** Normalised days of a model: one `yyyy/MM/dd` per calendar day, model order, unreadable items skipped. */
552
+ #days(value) {
553
+ if (!Array.isArray(value))
554
+ return null;
555
+ const zone = this.#zoned ? this.#dateTime : null;
556
+ const days = [];
557
+ let unreadable = false;
558
+ for (const item of value) {
559
+ const day = _sdNormalizeCalendarDay(item, zone);
560
+ if (!day) {
561
+ unreadable = true;
562
+ continue;
563
+ }
564
+ if (!days.includes(day))
565
+ days.push(day);
566
+ }
567
+ if (unreadable && !this.#warnedUnreadable && isDevMode()) {
568
+ this.#warnedUnreadable = true;
569
+ console.warn('[sd-chip-calendar] Skipped model items that are not dates:', value);
570
+ }
571
+ return days;
572
+ }
573
+ /** Days → the model written back: `yyyy/MM/dd`, or the start of each day per `transform` (like `<sd-date>`). */
574
+ #serializeDays(days) {
575
+ if (!days)
576
+ return days;
577
+ const transform = this.transform();
578
+ if (!transform)
579
+ return [...days];
580
+ return days.map(day => {
581
+ const startOfDay = sdLocalStartOfDay(dayToDate(day));
582
+ return sdSerializeTemporalValue(this.#zoned ? this.#dateTime.fromWallClock(startOfDay) : startOfDay, transform) ?? day;
583
+ });
584
+ }
585
+ /**
586
+ * 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
587
+ * 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.
588
+ */
589
+ #modelsEqual(left, right) {
590
+ if (this.transform())
591
+ return sameDays(left, right);
592
+ return sameDays(this.#days(left), this.#days(right));
593
+ }
594
+ #writeModel(value) {
595
+ this.model.set(value);
596
+ this.sdChange.emit(value ? value : []);
597
+ }
598
+ #currentDays() {
599
+ const value = this.#formControl.value;
600
+ return Array.isArray(value) ? value : [];
601
+ }
602
+ /** Today as a local-midnight carrier: in the configured zone, else the machine's. */
603
+ #today() {
604
+ return this.#zoned ? this.#dateTime.today() : sdLocalStartOfDay(new Date());
605
+ }
606
+ /** `minDate` / `maxDate` / `startAt` → local-midnight carrier, read like a model item. */
607
+ #toDate(value) {
608
+ if (value === 'TODAY')
609
+ return this.#today();
610
+ const day = _sdNormalizeCalendarDay(value, this.#zoned ? this.#dateTime : null);
611
+ return day ? dayToDate(day) : null;
612
+ }
613
+ /** 4.2: `startAt`; else the chosen day nearest to today (a later one on a tie); else today. */
614
+ #firstMonth() {
615
+ const start = this.#toDate(this.startAt());
616
+ if (start)
617
+ return start;
618
+ const today = this.#today().getTime();
619
+ let best = null;
620
+ for (const day of this.days()) {
621
+ const date = dayToDate(day);
622
+ const distance = Math.abs(date.getTime() - today);
623
+ const bestDistance = best ? Math.abs(best.getTime() - today) : Infinity;
624
+ if (distance < bestDistance || (distance === bestDistance && best !== null && date > best))
625
+ best = date;
626
+ }
627
+ return best ?? this.#today();
628
+ }
629
+ /** Every user action ends here: a new array of days, written once (the connector writes the model). */
630
+ #commit(next) {
631
+ this.#formControl.setValue(next);
632
+ this.#ref.markForCheck();
633
+ }
251
634
  #clickChip = (event, item) => {
252
635
  event.stopPropagation();
253
636
  event.stopImmediatePropagation();
@@ -255,41 +638,16 @@ class SdChipCalendar {
255
638
  this.#focus();
256
639
  }
257
640
  };
258
- #remove = (item) => {
259
- const values = this.#formControl.value ?? [];
260
- if (typeof item === 'string') {
261
- // why: `filter` đã trả mảng mới nên reference đổi → `model.set` phát `modelChange`.
262
- const next = values.filter(value => item !== value);
263
- this.#formControl.setValue(next);
264
- this.model.set(next);
265
- this.sdChange.emit(next);
641
+ #remove = (day) => {
642
+ if (typeof day === 'string' && this.isRemovable(day)) {
643
+ const days = this.#currentDays();
644
+ // why: `filter` đã trả mảng mới nên reference đổi → model ghi một lần.
645
+ if (days.includes(day))
646
+ this.#commit(days.filter(value => value !== day));
266
647
  }
267
648
  this.#inputControl.setValue('');
268
649
  this.#focus();
269
650
  };
270
- #select = (event) => {
271
- const item = event.option.value;
272
- const values = this.#formControl.value ?? [];
273
- if (item) {
274
- if (typeof item === 'string' || typeof item === 'number') {
275
- if (!values.includes(item)) {
276
- // why: PHẢI tạo mảng MỚI. `values` là chính mảng của consumer (model đi thẳng vào
277
- // formControl), nên `push` vừa sửa trộm mảng của họ, vừa giữ nguyên reference —
278
- // `model()` dùng equality Object.is nên `model.set(sameRef)` KHÔNG phát `modelChange`.
279
- const next = [...values, item];
280
- this.#formControl.setValue(next);
281
- this.model.set(next);
282
- this.sdChange.emit(next);
283
- }
284
- }
285
- const inputEl = this.input();
286
- if (inputEl)
287
- inputEl.nativeElement.value = '';
288
- this.#inputControl.setValue('', {
289
- emitEvent: false,
290
- });
291
- }
292
- };
293
651
  #onClick = () => {
294
652
  if (this.sdViewDef()?.templateRef) {
295
653
  if (!this.#formControl.disabled && !this.isFocused) {
@@ -299,7 +657,6 @@ class SdChipCalendar {
299
657
  };
300
658
  #focus = () => {
301
659
  this.isFocused = true;
302
- this.#isBlurring = false;
303
660
  // why: vẫn 100ms như cũ — chỉ scope handle theo DestroyRef.
304
661
  this.#timers.schedule(() => {
305
662
  if (this.isFocused) {
@@ -307,44 +664,39 @@ class SdChipCalendar {
307
664
  }
308
665
  }, 100);
309
666
  };
667
+ /** Removes every day the predicate allows; kept days stay. One change, none when nothing goes. */
310
668
  #clear = (evt) => {
311
669
  evt?.stopPropagation();
312
670
  this.#inputControl.setValue('');
313
- this.#formControl.setValue([]);
314
- this.model.set(this.#formControl.value);
315
- this.sdChange.emit(this.#formControl.value);
671
+ const days = this.#currentDays();
672
+ const kept = days.filter(day => !this.isRemovable(day));
673
+ if (kept.length !== days.length)
674
+ this.#commit(kept);
316
675
  this.#ref.detectChanges();
317
676
  };
318
677
  #selectDate = (date) => {
319
- const value = DateUtilities.toFormat(date, 'yyyy/MM/dd');
320
- const values = this.#formControl.value ?? [];
321
- if (value) {
322
- // 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
323
- // `push` thẳng vào mảng của consumer: reference không đổi nên `model.set` im lặng
324
- // (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.
325
- const next = values.includes(value) ? values.filter(date => value !== date) : [...values, value];
326
- this.#formControl.setValue(next);
327
- this.model.set(next);
328
- this.sdChange.emit(next);
329
- this.calendar()?.updateTodaysDate();
330
- this.#ref.markForCheck();
678
+ // 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ố.
679
+ const day = DateUtilities.toFormat(date, 'yyyy/MM/dd');
680
+ if (!day)
681
+ return;
682
+ const days = this.#currentDays();
683
+ if (days.includes(day)) {
684
+ // A1: bấm lại ngày đã chọn chỉ bỏ khi predicate cho phép.
685
+ if (this.isRemovable(day))
686
+ this.#commit(days.filter(value => value !== day));
331
687
  }
332
- };
333
- #closeCalendar = () => {
334
- this.isFocused = false;
335
- this.input()?.nativeElement?.blur();
336
- };
337
- #dateClass = (cellDate) => {
338
- const dates = this.#formControl.value || [];
339
- if (Array.isArray(dates)) {
340
- const selected = dates.some(date => date === DateUtilities.toFormat(cellDate, 'yyyy/MM/dd'));
341
- return selected ? 'sd-chip-calendar-selected-date' : '';
688
+ else {
689
+ this.#commit([...days, day]);
690
+ }
691
+ // 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.
692
+ const calendar = this.calendar();
693
+ if (calendar && date) {
694
+ calendar.activeDate = date;
695
+ this.#timers.schedule(() => this.calendar()?.focusActiveCell(), 0);
342
696
  }
343
- return '';
344
697
  };
345
698
  onClickChip = (event, item) => this.#clickChip(event, item);
346
699
  onRemove = (item) => this.#remove(item);
347
- onSelect = (event) => this.#select(event);
348
700
  onClick = () => this.#onClick();
349
701
  /**
350
702
  * why: khi `sdViewDef` đang hiển thị thì bên trong KHÔNG còn phần tử nào focus được, nên
@@ -358,10 +710,12 @@ class SdChipCalendar {
358
710
  };
359
711
  onClear = (evt) => this.#clear(evt);
360
712
  onSelectDate = (date) => this.#selectDate(date);
361
- onCloseCalendar = () => this.#closeCalendar();
362
- dateClass = (cellDate) => this.#dateClass(cellDate);
713
+ /** Closes the popup without moving focus (outside click); marks the field touched. */
714
+ onCloseCalendar = () => this.close();
715
+ /** Classes of a month-view cell; see `calendarDateClass`. */
716
+ dateClass = (cellDate) => this.calendarDateClass()(cellDate);
363
717
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdChipCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
364
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", 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();\n@let _appearance = appearance();\n@let _required = required();\n@let _isViewed = isViewed();\n@let _hideInlineError = hideInlineError();\n@let _sdViewDef = sdViewDef();\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\n@let _errorMessage = errorMessage();\n@let _size = size();\n@let _removable = removable();\n@let _labelTop = labelPlacement() === 'top';\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\n@let _errorVisible = !!_errorMessage && formControl.touched;\n@let _showInlineError = !_hideInlineError && _errorVisible;\n@let _viewTemplate = _sdViewDef?.templateRef;\n\n@if (_isViewed) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"_labelTemplate\"\n [value]=\"formControl.value\"\n [display]=\"formControl.value\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"_valueTemplate\">\n </sd-view>\n} @else {\n @if ((!_appearance || _labelTop) && _labelTemplate) {\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\n }\n @if ((!_appearance || _labelTop) && _label && !_labelTemplate) {\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\n }\n\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>)\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:\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\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\n role=\"button\" + tabindex=\"0\" + keydown Enter/Space; div ngo\u00E0i kh\u00F4ng c\u00F2n handler n\u00E0o. -->\n <div\n class=\"d-flex align-items-center\"\n [class.sd-view]=\"!!_viewTemplate\"\n [class.c-focused]=\"isFocused\"\n [class.c-disabled]=\"formControl.disabled\">\n @if (_viewTemplate && !isFocused) {\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\n s\u1EBD ghi \u0111\u00E8 v\u00E0 l\u00E0m AT \u0111\u1ECDc kh\u00E1c ch\u1EEF tr\u00EAn m\u00E0n h\u00ECnh. -->\n <div\n class=\"sd-chip-calendar__view-trigger\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClick()\"\n (keydown.enter)=\"onViewKeydown($event)\"\n (keydown.space)=\"onViewKeydown($event)\">\n <ng-container *ngTemplateOutlet=\"_viewTemplate; context: { value: formControl.value }\"></ng-container>\n </div>\n } @else {\n <mat-form-field\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [class.sd-label-top]=\"_labelTop\"\n [appearance]=\"_appearance\"\n [floatLabel]=\"floatLabel()\">\n @if (_appearance && _label && !_labelTop) {\n <mat-label>{{ _label }}</mat-label>\n }\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"_size === 'md'\" [class.sd-sm]=\"_size === 'sm'\">\n @for (item of formControl.value; track item) {\n @if (item) {\n <mat-chip-row\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [removable]=\"_removable\"\n (removed)=\"onRemove(item)\"\n [disabled]=\"inputControl.disabled\"\n (click)=\"onClickChip($event, item)\"\n [value]=\"item\">\n <span>{{ item | date: 'dd/MM/yyyy' }}</span>\n @if (!inputControl.disabled && item | sdRemovableChip: _removable) {\n <sd-icon matChipRemove name=\"cancel\"></sd-icon>\n }\n </mat-chip-row>\n }\n }\n\n <input\n class=\"sd-chip-input\"\n [formControl]=\"inputControl\"\n [id]=\"inputId\"\n [placeholder]=\"placeholder() || (_labelTop ? '' : _label)\"\n [matChipInputFor]=\"chipList\"\n autocomplete=\"off\"\n [errorStateMatcher]=\"matcher\"\n [matMenuTriggerFor]=\"calendarMenu\"\n [required]=\"_required\"\n matInput\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-count]=\"dataCount()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n [attr.aria-invalid]=\"_errorVisible ? 'true' : null\"\n [attr.aria-describedby]=\"_errorMessage ? errorId : null\"\n readonly\n #input />\n </mat-chip-grid>\n\n <mat-menu #calendarMenu=\"matMenu\" overlapTrigger=\"false\" (closed)=\"onCloseCalendar()\">\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,\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\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\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. -->\n <div style=\"width: 280px\" role=\"presentation\" (click)=\"$event.stopPropagation()\">\n <mat-calendar (selectedChange)=\"onSelectDate($event)\" [dateClass]=\"dateClass\"> </mat-calendar>\n </div>\n </mat-menu>\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" [id]=\"errorId\" matSuffix>{{ _errorMessage }}</span>\n\n }\n\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n }\n </mat-form-field>\n }\n </div>\n}\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]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: 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 });
718
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", 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();\n@let _appearance = appearance();\n@let _required = required();\n@let _isViewed = isViewed();\n@let _hideInlineError = hideInlineError();\n@let _sdViewDef = sdViewDef();\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\n@let _errorMessage = errorMessage();\n@let _size = size();\n@let _labelTop = labelPlacement() === 'top';\n@let _icons = iconSizes();\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\n@let _errorVisible = isErrorShown();\n@let _showInlineError = !_hideInlineError && _errorVisible;\n@let _viewTemplate = _sdViewDef?.templateRef;\n\n@if (_isViewed) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"_labelTemplate\"\n [value]=\"formControl.value\"\n [display]=\"viewText()\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"_valueTemplate\">\n </sd-view>\n} @else {\n @if ((!_appearance || _labelTop) && _labelTemplate) {\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\n }\n @if ((!_appearance || _labelTop) && _label && !_labelTemplate) {\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\n }\n\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>)\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:\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\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\n role=\"button\" + tabindex=\"0\" + keydown Enter/Space; div ngo\u00E0i kh\u00F4ng c\u00F2n handler n\u00E0o. -->\n <div\n class=\"d-flex align-items-center\"\n [class.sd-view]=\"!!_viewTemplate\"\n [class.c-focused]=\"isFocused\"\n [class.c-disabled]=\"formControl.disabled\">\n @if (_viewTemplate && !isFocused) {\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\n s\u1EBD ghi \u0111\u00E8 v\u00E0 l\u00E0m AT \u0111\u1ECDc kh\u00E1c ch\u1EEF tr\u00EAn m\u00E0n h\u00ECnh. -->\n <div\n class=\"sd-chip-calendar__view-trigger\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClick()\"\n (keydown.enter)=\"onViewKeydown($event)\"\n (keydown.space)=\"onViewKeydown($event)\">\n <ng-container *ngTemplateOutlet=\"_viewTemplate; context: { value: formControl.value }\"></ng-container>\n </div>\n } @else {\n <mat-form-field\n class=\"sd-chip-calendar-field\"\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.sd-lg]=\"_size === 'lg'\"\n [class.sd-chip-calendar-field--open]=\"isOpen()\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [class.sd-label-top]=\"_labelTop\"\n [appearance]=\"_appearance\"\n [floatLabel]=\"floatLabel()\"\n (click)=\"onFieldClick()\">\n @if (_appearance && _label && !_labelTop) {\n <mat-label>{{ _label }}</mat-label>\n }\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"_size === 'md'\" [class.sd-sm]=\"_size === 'sm'\">\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\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). -->\n @for (item of visibleDays(); track item) {\n @let _itemRemovable = isRemovable(item);\n <mat-chip-row\n class=\"sd-chip-calendar__chip\"\n [class.sd-chip-calendar__chip--locked]=\"!_itemRemovable\"\n [removable]=\"_itemRemovable\"\n [aria-label]=\"chipLabel(item)\"\n (removed)=\"onRemove(item)\"\n [disabled]=\"inputControl.disabled\"\n (click)=\"onClickChip($event, item)\"\n [value]=\"item\">\n <span class=\"sd-chip-calendar__chip-text\">{{ formatDay(item) }}</span>\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]). -->\n @if (!inputControl.disabled && _itemRemovable) {\n <sd-icon matChipRemove name=\"close\" [size]=\"_icons.chip\" [ariaLabel]=\"removeLabel(item)\"></sd-icon>\n }\n @if (!inputControl.disabled && !_itemRemovable) {\n <sd-icon\n class=\"sd-chip-calendar__lock\"\n name=\"lock\"\n [size]=\"_icons.chip\"\n [matTooltip]=\"'core.form.chip-calendar.locked' | sdTranslate\"></sd-icon>\n }\n </mat-chip-row>\n }\n @if (hiddenCount() > 0) {\n <button\n type=\"button\"\n class=\"sd-chip-calendar__more\"\n [attr.aria-label]=\"'core.form.chip-calendar.more' | sdTranslate: { count: hiddenCount() }\"\n [attr.data-autoid]=\"autoId() ? autoId() + '-more' : null\"\n (click)=\"onMoreClick($event)\">\n +{{ hiddenCount() }}\n </button>\n }\n\n <input\n class=\"sd-chip-input\"\n [formControl]=\"inputControl\"\n [id]=\"inputId\"\n [placeholder]=\"effectivePlaceholder()\"\n [matChipInputFor]=\"chipList\"\n autocomplete=\"off\"\n [errorStateMatcher]=\"matcher\"\n [required]=\"_required\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (keydown)=\"onInputKeydown($event)\"\n matInput\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-count]=\"dataCount()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n [attr.aria-invalid]=\"_errorVisible ? 'true' : null\"\n [attr.aria-describedby]=\"_errorMessage ? errorId : null\"\n readonly\n #input />\n </mat-chip-grid>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" [id]=\"errorId\" matSuffix>{{ _errorMessage }}</span>\n }\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. -->\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. -->\n @if (!formControl.disabled && clearable() && !_required && hasRemovable()) {\n <button\n type=\"button\"\n matSuffix\n class=\"sd-clear-btn sd-chip-calendar__suffix\"\n [class.sd-hover]=\"!isOpen()\"\n [attr.aria-label]=\"'core.form.chip-calendar.clear' | sdTranslate\"\n [attr.data-autoid]=\"autoId() ? autoId() + '-clear' : null\"\n (click)=\"onClear($event)\">\n <sd-icon name=\"close\" [size]=\"_icons.clear\"></sd-icon>\n </button>\n }\n @if (!formControl.disabled) {\n <button\n type=\"button\"\n matSuffix\n class=\"sd-chip-calendar__open sd-chip-calendar__suffix\"\n [class.sd-chip-calendar__open--active]=\"isOpen()\"\n data-chip-calendar-open\n [attr.aria-label]=\"'core.form.date.open-picker' | sdTranslate\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n [attr.data-autoid]=\"autoId() ? autoId() + '-open' : null\"\n (click)=\"onToggleClick($event)\">\n <sd-icon name=\"calendar_month\" [size]=\"_icons.open\"></sd-icon>\n </button>\n }\n\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n }\n </mat-form-field>\n\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\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:\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. -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayPush]=\"true\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n cdkConnectedOverlayPanelClass=\"sd-chip-calendar-pane\"\n (attach)=\"onAttach()\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (overlayKeydown)=\"onOverlayKeydown($event)\">\n @let _days = days();\n @let _maxCount = effectiveMaxCount();\n @let _full = full();\n <div\n class=\"sd-chip-calendar-panel\"\n role=\"dialog\"\n cdkTrapFocus\n [id]=\"panelId\"\n [attr.aria-label]=\"_label || ('core.form.chip-calendar.dialog-label' | sdTranslate)\"\n [attr.data-autoid]=\"autoId() ? autoId() + '-panel' : null\">\n <div class=\"sd-chip-calendar-panel__head\">\n <div class=\"sd-chip-calendar-panel__summary\">\n <span class=\"sd-chip-calendar-panel__count\">{{\n 'core.form.chip-calendar.selected-count' | sdTranslate: { count: _days.length }\n }}</span>\n <span class=\"sd-chip-calendar-panel__limit\">\n {{\n _maxCount > 0\n ? ('core.form.chip-calendar.max-count' | sdTranslate: { max: _maxCount })\n : ('core.form.chip-calendar.no-limit' | sdTranslate)\n }}\n </span>\n </div>\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. -->\n <p class=\"sd-chip-calendar-panel__full\" aria-live=\"polite\">\n @if (_full) {\n {{ 'core.form.chip-calendar.full' | sdTranslate: { max: _maxCount } }}\n }\n </p>\n </div>\n\n <mat-calendar\n [headerComponent]=\"calendarHeader\"\n [startAt]=\"openAt()\"\n [minDate]=\"resolvedMinDate()\"\n [maxDate]=\"resolvedMaxDate()\"\n [dateFilter]=\"calendarFilter()\"\n [dateClass]=\"calendarDateClass()\"\n (selectedChange)=\"onSelectDate($event)\">\n </mat-calendar>\n\n <div class=\"sd-chip-calendar-panel__footer\">\n @if (clearable()) {\n <sd-button\n data-chip-calendar-clear-all\n type=\"text\"\n color=\"primary\"\n size=\"sm\"\n [disabled]=\"!hasRemovable()\"\n [autoId]=\"autoId() ? autoId() + '-clear-all' : undefined\"\n [title]=\"'core.form.chip-calendar.clear-all' | sdTranslate\"\n (click)=\"onClear()\"></sd-button>\n } @else {\n <span></span>\n }\n <sd-button\n data-chip-calendar-done\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n [autoId]=\"autoId() ? autoId() + '-done' : undefined\"\n [title]=\"'core.form.chip-calendar.done' | sdTranslate\"\n (click)=\"close(true)\"></sd-button>\n </div>\n </div>\n </ng-template>\n }\n </div>\n}\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]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: 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 });
365
719
  }
366
720
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdChipCalendar, decorators: [{
367
721
  type: Component,
@@ -377,17 +731,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
377
731
  MatInputModule,
378
732
  MatTooltipModule,
379
733
  MatFormFieldModule,
380
- MatAutocompleteModule,
381
- MatProgressSpinnerModule,
382
734
  MatChipsModule,
383
735
  MatDatepickerModule,
384
736
  MatNativeDateModule,
385
- MatMenuModule,
737
+ OverlayModule,
738
+ A11yModule,
739
+ SdButton,
740
+ SdTranslatePipe,
386
741
  SdLabel,
387
742
  SdView,
388
- SdRemovableChipPipe,
389
- ], template: "@let _label = label();\n@let _appearance = appearance();\n@let _required = required();\n@let _isViewed = isViewed();\n@let _hideInlineError = hideInlineError();\n@let _sdViewDef = sdViewDef();\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\n@let _errorMessage = errorMessage();\n@let _size = size();\n@let _removable = removable();\n@let _labelTop = labelPlacement() === 'top';\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\n@let _errorVisible = !!_errorMessage && formControl.touched;\n@let _showInlineError = !_hideInlineError && _errorVisible;\n@let _viewTemplate = _sdViewDef?.templateRef;\n\n@if (_isViewed) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"_labelTemplate\"\n [value]=\"formControl.value\"\n [display]=\"formControl.value\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"_valueTemplate\">\n </sd-view>\n} @else {\n @if ((!_appearance || _labelTop) && _labelTemplate) {\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\n }\n @if ((!_appearance || _labelTop) && _label && !_labelTemplate) {\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\n }\n\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>)\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:\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\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\n role=\"button\" + tabindex=\"0\" + keydown Enter/Space; div ngo\u00E0i kh\u00F4ng c\u00F2n handler n\u00E0o. -->\n <div\n class=\"d-flex align-items-center\"\n [class.sd-view]=\"!!_viewTemplate\"\n [class.c-focused]=\"isFocused\"\n [class.c-disabled]=\"formControl.disabled\">\n @if (_viewTemplate && !isFocused) {\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\n s\u1EBD ghi \u0111\u00E8 v\u00E0 l\u00E0m AT \u0111\u1ECDc kh\u00E1c ch\u1EEF tr\u00EAn m\u00E0n h\u00ECnh. -->\n <div\n class=\"sd-chip-calendar__view-trigger\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClick()\"\n (keydown.enter)=\"onViewKeydown($event)\"\n (keydown.space)=\"onViewKeydown($event)\">\n <ng-container *ngTemplateOutlet=\"_viewTemplate; context: { value: formControl.value }\"></ng-container>\n </div>\n } @else {\n <mat-form-field\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [class.sd-label-top]=\"_labelTop\"\n [appearance]=\"_appearance\"\n [floatLabel]=\"floatLabel()\">\n @if (_appearance && _label && !_labelTop) {\n <mat-label>{{ _label }}</mat-label>\n }\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"_size === 'md'\" [class.sd-sm]=\"_size === 'sm'\">\n @for (item of formControl.value; track item) {\n @if (item) {\n <mat-chip-row\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [removable]=\"_removable\"\n (removed)=\"onRemove(item)\"\n [disabled]=\"inputControl.disabled\"\n (click)=\"onClickChip($event, item)\"\n [value]=\"item\">\n <span>{{ item | date: 'dd/MM/yyyy' }}</span>\n @if (!inputControl.disabled && item | sdRemovableChip: _removable) {\n <sd-icon matChipRemove name=\"cancel\"></sd-icon>\n }\n </mat-chip-row>\n }\n }\n\n <input\n class=\"sd-chip-input\"\n [formControl]=\"inputControl\"\n [id]=\"inputId\"\n [placeholder]=\"placeholder() || (_labelTop ? '' : _label)\"\n [matChipInputFor]=\"chipList\"\n autocomplete=\"off\"\n [errorStateMatcher]=\"matcher\"\n [matMenuTriggerFor]=\"calendarMenu\"\n [required]=\"_required\"\n matInput\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-count]=\"dataCount()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n [attr.aria-invalid]=\"_errorVisible ? 'true' : null\"\n [attr.aria-describedby]=\"_errorMessage ? errorId : null\"\n readonly\n #input />\n </mat-chip-grid>\n\n <mat-menu #calendarMenu=\"matMenu\" overlapTrigger=\"false\" (closed)=\"onCloseCalendar()\">\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,\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\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\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. -->\n <div style=\"width: 280px\" role=\"presentation\" (click)=\"$event.stopPropagation()\">\n <mat-calendar (selectedChange)=\"onSelectDate($event)\" [dateClass]=\"dateClass\"> </mat-calendar>\n </div>\n </mat-menu>\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" [id]=\"errorId\" matSuffix>{{ _errorMessage }}</span>\n\n }\n\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n }\n </mat-form-field>\n }\n </div>\n}\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"] }]
390
- }], 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 }] }] } });
743
+ ], template: "@let _label = label();\n@let _appearance = appearance();\n@let _required = required();\n@let _isViewed = isViewed();\n@let _hideInlineError = hideInlineError();\n@let _sdViewDef = sdViewDef();\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\n@let _valueTemplate = (sdValueTemplate() ?? _sdViewDef?.templateRef) || undefined;\n@let _errorMessage = errorMessage();\n@let _size = size();\n@let _labelTop = labelPlacement() === 'top';\n@let _icons = iconSizes();\n<!-- why: m\u1ED9t c\u1ED5ng gate duy nh\u1EA5t cho <mat-error>, aria-invalid v\u00E0 aria-describedby. -->\n@let _errorVisible = isErrorShown();\n@let _showInlineError = !_hideInlineError && _errorVisible;\n@let _viewTemplate = _sdViewDef?.templateRef;\n\n@if (_isViewed) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"_labelTemplate\"\n [value]=\"formControl.value\"\n [display]=\"viewText()\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"_valueTemplate\">\n </sd-view>\n} @else {\n @if ((!_appearance || _labelTop) && _labelTemplate) {\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\n }\n @if ((!_appearance || _labelTop) && _label && !_labelTemplate) {\n <sd-label [label]=\"_label\" [required]=\"_required\" [for]=\"_labelTop ? inputId : null\"></sd-label>\n }\n\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>)\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:\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\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\n role=\"button\" + tabindex=\"0\" + keydown Enter/Space; div ngo\u00E0i kh\u00F4ng c\u00F2n handler n\u00E0o. -->\n <div\n class=\"d-flex align-items-center\"\n [class.sd-view]=\"!!_viewTemplate\"\n [class.c-focused]=\"isFocused\"\n [class.c-disabled]=\"formControl.disabled\">\n @if (_viewTemplate && !isFocused) {\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\n s\u1EBD ghi \u0111\u00E8 v\u00E0 l\u00E0m AT \u0111\u1ECDc kh\u00E1c ch\u1EEF tr\u00EAn m\u00E0n h\u00ECnh. -->\n <div\n class=\"sd-chip-calendar__view-trigger\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClick()\"\n (keydown.enter)=\"onViewKeydown($event)\"\n (keydown.space)=\"onViewKeydown($event)\">\n <ng-container *ngTemplateOutlet=\"_viewTemplate; context: { value: formControl.value }\"></ng-container>\n </div>\n } @else {\n <mat-form-field\n class=\"sd-chip-calendar-field\"\n [class.sd-md]=\"_size === 'md'\"\n [class.sd-sm]=\"_size === 'sm'\"\n [class.sd-lg]=\"_size === 'lg'\"\n [class.sd-chip-calendar-field--open]=\"isOpen()\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [class.sd-label-top]=\"_labelTop\"\n [appearance]=\"_appearance\"\n [floatLabel]=\"floatLabel()\"\n (click)=\"onFieldClick()\">\n @if (_appearance && _label && !_labelTop) {\n <mat-label>{{ _label }}</mat-label>\n }\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"_size === 'md'\" [class.sd-sm]=\"_size === 'sm'\">\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\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). -->\n @for (item of visibleDays(); track item) {\n @let _itemRemovable = isRemovable(item);\n <mat-chip-row\n class=\"sd-chip-calendar__chip\"\n [class.sd-chip-calendar__chip--locked]=\"!_itemRemovable\"\n [removable]=\"_itemRemovable\"\n [aria-label]=\"chipLabel(item)\"\n (removed)=\"onRemove(item)\"\n [disabled]=\"inputControl.disabled\"\n (click)=\"onClickChip($event, item)\"\n [value]=\"item\">\n <span class=\"sd-chip-calendar__chip-text\">{{ formatDay(item) }}</span>\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]). -->\n @if (!inputControl.disabled && _itemRemovable) {\n <sd-icon matChipRemove name=\"close\" [size]=\"_icons.chip\" [ariaLabel]=\"removeLabel(item)\"></sd-icon>\n }\n @if (!inputControl.disabled && !_itemRemovable) {\n <sd-icon\n class=\"sd-chip-calendar__lock\"\n name=\"lock\"\n [size]=\"_icons.chip\"\n [matTooltip]=\"'core.form.chip-calendar.locked' | sdTranslate\"></sd-icon>\n }\n </mat-chip-row>\n }\n @if (hiddenCount() > 0) {\n <button\n type=\"button\"\n class=\"sd-chip-calendar__more\"\n [attr.aria-label]=\"'core.form.chip-calendar.more' | sdTranslate: { count: hiddenCount() }\"\n [attr.data-autoid]=\"autoId() ? autoId() + '-more' : null\"\n (click)=\"onMoreClick($event)\">\n +{{ hiddenCount() }}\n </button>\n }\n\n <input\n class=\"sd-chip-input\"\n [formControl]=\"inputControl\"\n [id]=\"inputId\"\n [placeholder]=\"effectivePlaceholder()\"\n [matChipInputFor]=\"chipList\"\n autocomplete=\"off\"\n [errorStateMatcher]=\"matcher\"\n [required]=\"_required\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (keydown)=\"onInputKeydown($event)\"\n matInput\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-count]=\"dataCount()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n [attr.aria-invalid]=\"_errorVisible ? 'true' : null\"\n [attr.aria-describedby]=\"_errorMessage ? errorId : null\"\n readonly\n #input />\n </mat-chip-grid>\n\n @if (_hideInlineError && _errorVisible) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n @if (_hideInlineError && _errorVisible) {\n <span class=\"sd-visually-hidden\" [id]=\"errorId\" matSuffix>{{ _errorMessage }}</span>\n }\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. -->\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. -->\n @if (!formControl.disabled && clearable() && !_required && hasRemovable()) {\n <button\n type=\"button\"\n matSuffix\n class=\"sd-clear-btn sd-chip-calendar__suffix\"\n [class.sd-hover]=\"!isOpen()\"\n [attr.aria-label]=\"'core.form.chip-calendar.clear' | sdTranslate\"\n [attr.data-autoid]=\"autoId() ? autoId() + '-clear' : null\"\n (click)=\"onClear($event)\">\n <sd-icon name=\"close\" [size]=\"_icons.clear\"></sd-icon>\n </button>\n }\n @if (!formControl.disabled) {\n <button\n type=\"button\"\n matSuffix\n class=\"sd-chip-calendar__open sd-chip-calendar__suffix\"\n [class.sd-chip-calendar__open--active]=\"isOpen()\"\n data-chip-calendar-open\n [attr.aria-label]=\"'core.form.date.open-picker' | sdTranslate\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n [attr.data-autoid]=\"autoId() ? autoId() + '-open' : null\"\n (click)=\"onToggleClick($event)\">\n <sd-icon name=\"calendar_month\" [size]=\"_icons.open\"></sd-icon>\n </button>\n }\n\n @if (_showInlineError) {\n <mat-error [id]=\"errorId\">{{ _errorMessage }}</mat-error>\n }\n </mat-form-field>\n\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\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:\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. -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin()!\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayPush]=\"true\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n cdkConnectedOverlayPanelClass=\"sd-chip-calendar-pane\"\n (attach)=\"onAttach()\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (overlayKeydown)=\"onOverlayKeydown($event)\">\n @let _days = days();\n @let _maxCount = effectiveMaxCount();\n @let _full = full();\n <div\n class=\"sd-chip-calendar-panel\"\n role=\"dialog\"\n cdkTrapFocus\n [id]=\"panelId\"\n [attr.aria-label]=\"_label || ('core.form.chip-calendar.dialog-label' | sdTranslate)\"\n [attr.data-autoid]=\"autoId() ? autoId() + '-panel' : null\">\n <div class=\"sd-chip-calendar-panel__head\">\n <div class=\"sd-chip-calendar-panel__summary\">\n <span class=\"sd-chip-calendar-panel__count\">{{\n 'core.form.chip-calendar.selected-count' | sdTranslate: { count: _days.length }\n }}</span>\n <span class=\"sd-chip-calendar-panel__limit\">\n {{\n _maxCount > 0\n ? ('core.form.chip-calendar.max-count' | sdTranslate: { max: _maxCount })\n : ('core.form.chip-calendar.no-limit' | sdTranslate)\n }}\n </span>\n </div>\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. -->\n <p class=\"sd-chip-calendar-panel__full\" aria-live=\"polite\">\n @if (_full) {\n {{ 'core.form.chip-calendar.full' | sdTranslate: { max: _maxCount } }}\n }\n </p>\n </div>\n\n <mat-calendar\n [headerComponent]=\"calendarHeader\"\n [startAt]=\"openAt()\"\n [minDate]=\"resolvedMinDate()\"\n [maxDate]=\"resolvedMaxDate()\"\n [dateFilter]=\"calendarFilter()\"\n [dateClass]=\"calendarDateClass()\"\n (selectedChange)=\"onSelectDate($event)\">\n </mat-calendar>\n\n <div class=\"sd-chip-calendar-panel__footer\">\n @if (clearable()) {\n <sd-button\n data-chip-calendar-clear-all\n type=\"text\"\n color=\"primary\"\n size=\"sm\"\n [disabled]=\"!hasRemovable()\"\n [autoId]=\"autoId() ? autoId() + '-clear-all' : undefined\"\n [title]=\"'core.form.chip-calendar.clear-all' | sdTranslate\"\n (click)=\"onClear()\"></sd-button>\n } @else {\n <span></span>\n }\n <sd-button\n data-chip-calendar-done\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n [autoId]=\"autoId() ? autoId() + '-done' : undefined\"\n [title]=\"'core.form.chip-calendar.done' | sdTranslate\"\n (click)=\"close(true)\"></sd-button>\n </div>\n </div>\n </ng-template>\n }\n </div>\n}\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"] }]
744
+ }], 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 }] }] } });
391
745
 
392
746
  /**
393
747
  * Generated bundle index. Do not edit.