@sd-angular/core 19.0.0-beta.7 → 19.0.0-beta.71

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 (237) hide show
  1. package/README.md +686 -33
  2. package/assets/scss/ckeditor5.scss +61 -4
  3. package/assets/scss/core/bootstrap.scss +17 -0
  4. package/assets/scss/core/form.scss +32 -6
  5. package/assets/scss/core/grid.scss +40 -0
  6. package/assets/scss/sd-core.scss +1 -0
  7. package/assets/scss/themes/material-theme.scss +82 -40
  8. package/components/anchor-v2/src/components/anchor-item-v2/anchor-item-v2.component.d.ts +5 -5
  9. package/components/anchor-v2/src/models/sd-anchor-v2.model.d.ts +3 -3
  10. package/components/avatar/index.d.ts +1 -0
  11. package/components/avatar/src/avatar.component.d.ts +19 -0
  12. package/components/badge/src/badge.component.d.ts +77 -19
  13. package/components/button/src/button.component.d.ts +30 -28
  14. package/components/code-editor/index.d.ts +1 -0
  15. package/components/code-editor/src/code-editor.component.d.ts +25 -0
  16. package/components/document-builder/index.d.ts +1 -0
  17. package/components/document-builder/src/document-builder.component.d.ts +12 -41
  18. package/components/document-builder/src/document-builder.model.d.ts +14 -11
  19. package/components/document-builder/src/plugins/block-space/block-space.plugin.d.ts +9 -0
  20. package/components/document-builder/src/plugins/ck-comment/ck-comment.plugin.d.ts +44 -0
  21. package/components/document-builder/src/plugins/ck-comment/ck-comment.plugin.model.d.ts +57 -0
  22. package/components/document-builder/src/plugins/heading/heading.plugin.d.ts +1 -0
  23. package/components/document-builder/src/plugins/highlight-range/highlight-range.plugin.d.ts +4 -0
  24. package/components/document-builder/src/plugins/image-custom/image-custom.plugin.d.ts +31 -0
  25. package/components/document-builder/src/plugins/index.d.ts +7 -2
  26. package/components/document-builder/src/plugins/page-orientation/page-orientation.plugin.d.ts +2 -2
  27. package/components/document-builder/src/plugins/paste-handler/filters/bookmark.d.ts +14 -0
  28. package/components/document-builder/src/plugins/paste-handler/filters/br.d.ts +15 -0
  29. package/components/document-builder/src/plugins/paste-handler/filters/image.d.ts +25 -0
  30. package/components/document-builder/src/plugins/paste-handler/filters/list.d.ts +29 -0
  31. package/components/document-builder/src/plugins/paste-handler/filters/parse.d.ts +35 -0
  32. package/components/document-builder/src/plugins/paste-handler/filters/removeboldwrapper.d.ts +15 -0
  33. package/components/document-builder/src/plugins/paste-handler/filters/removegooglesheetstag.d.ts +15 -0
  34. package/components/document-builder/src/plugins/paste-handler/filters/removeinvalidtablewidth.d.ts +15 -0
  35. package/components/document-builder/src/plugins/paste-handler/filters/removemsattributes.d.ts +15 -0
  36. package/components/document-builder/src/plugins/paste-handler/filters/removestyleblock.d.ts +15 -0
  37. package/components/document-builder/src/plugins/paste-handler/filters/removexmlns.d.ts +15 -0
  38. package/components/document-builder/src/plugins/paste-handler/filters/replacemsfootnotes.d.ts +54 -0
  39. package/components/document-builder/src/plugins/paste-handler/filters/replacetabswithinprewithspaces.d.ts +24 -0
  40. package/components/document-builder/src/plugins/paste-handler/filters/space.d.ts +27 -0
  41. package/components/document-builder/src/plugins/paste-handler/filters/table.d.ts +16 -0
  42. package/components/document-builder/src/plugins/paste-handler/filters/utils.d.ts +25 -0
  43. package/components/document-builder/src/plugins/paste-handler/index.d.ts +35 -0
  44. package/components/document-builder/src/plugins/paste-handler/normalizers/googledocsnormalizer.d.ts +31 -0
  45. package/components/document-builder/src/plugins/paste-handler/normalizers/googlesheetsnormalizer.d.ts +31 -0
  46. package/components/document-builder/src/plugins/paste-handler/normalizers/mswordnormalizer.d.ts +29 -0
  47. package/components/document-builder/src/plugins/paste-handler/types.d.ts +30 -0
  48. package/components/document-builder/src/plugins/table-custom/index.d.ts +34 -0
  49. package/components/document-builder/src/plugins/variable/variable.plugin.d.ts +39 -0
  50. package/components/index.d.ts +4 -0
  51. package/components/mini-editor/index.d.ts +2 -0
  52. package/components/mini-editor/src/mini-editor.component.d.ts +90 -0
  53. package/components/mini-editor/src/mini-editor.model.d.ts +44 -0
  54. package/components/modal/index.d.ts +1 -1
  55. package/components/modal/src/modal.component.d.ts +24 -0
  56. package/components/section/index.d.ts +1 -0
  57. package/components/section/src/section-item/section-item.component.d.ts +7 -0
  58. package/components/section/src/section.component.d.ts +11 -11
  59. package/components/side-drawer/src/side-drawer.component.d.ts +11 -24
  60. package/components/tab-router/src/components/tab-router-item/tab-router-item.component.d.ts +4 -1
  61. package/components/tab-router/src/components/tab-router-outlet/tab-router-outlet.component.d.ts +3 -15
  62. package/components/table/src/components/column-filter/column-filter.component.d.ts +3 -3
  63. package/components/table/src/components/desktop-cell/desktop-cell.component.d.ts +21 -9
  64. package/components/table/src/components/desktop-cell-view/desktop-cell-view.component.d.ts +21 -7
  65. package/components/table/src/components/external-filter/external-filter.component.d.ts +1 -1
  66. package/components/table/src/components/selector-action/action-filter.pipe.d.ts +11 -10
  67. package/components/table/src/components/selector-action/selector-action.component.d.ts +5 -3
  68. package/components/table/src/directives/index.d.ts +2 -0
  69. package/components/table/src/directives/sd-table-column-filter-def.directive.d.ts +9 -0
  70. package/components/table/src/directives/sticky-shadow.directive.d.ts +17 -0
  71. package/components/table/src/models/table-column.model.d.ts +38 -34
  72. package/components/table/src/models/table-command.model.d.ts +7 -3
  73. package/components/table/src/models/table-item.model.d.ts +5 -4
  74. package/components/table/src/models/table-option-config.model.d.ts +5 -0
  75. package/components/table/src/models/table-option-export.model.d.ts +3 -2
  76. package/components/table/src/models/table-option-selector.model.d.ts +11 -10
  77. package/components/table/src/models/table-option.model.d.ts +9 -8
  78. package/components/table/src/services/index.d.ts +3 -0
  79. package/components/table/src/services/table-export/table-export.service.d.ts +26 -0
  80. package/components/table/src/services/table-filter/table-filter.model.d.ts +6 -5
  81. package/components/table/src/services/table-format/table-format.service.d.ts +16 -0
  82. package/components/table/src/table.component.d.ts +39 -53
  83. package/components/upload-file/src/configurations/upload-file.configuration.d.ts +1 -1
  84. package/components/upload-file/src/services/upload-file.service.d.ts +0 -1
  85. package/components/upload-file/src/upload-file.component.d.ts +49 -54
  86. package/components/view/index.d.ts +1 -0
  87. package/components/view/src/view.component.d.ts +16 -0
  88. package/components/workflow/src/models/form-generic-component.model.d.ts +5 -4
  89. package/components/workflow/src/models/index.d.ts +1 -0
  90. package/directives/index.d.ts +2 -0
  91. package/directives/src/sd-href.directive.d.ts +9 -0
  92. package/directives/src/sd-tooltip.directive.d.ts +26 -0
  93. package/fesm2022/sd-angular-core-components-anchor-v2.mjs +15 -15
  94. package/fesm2022/sd-angular-core-components-anchor-v2.mjs.map +1 -1
  95. package/fesm2022/sd-angular-core-components-avatar.mjs +103 -0
  96. package/fesm2022/sd-angular-core-components-avatar.mjs.map +1 -0
  97. package/fesm2022/sd-angular-core-components-badge.mjs +101 -91
  98. package/fesm2022/sd-angular-core-components-badge.mjs.map +1 -1
  99. package/fesm2022/sd-angular-core-components-button.mjs +70 -96
  100. package/fesm2022/sd-angular-core-components-button.mjs.map +1 -1
  101. package/fesm2022/sd-angular-core-components-code-editor.mjs +127 -0
  102. package/fesm2022/sd-angular-core-components-code-editor.mjs.map +1 -0
  103. package/fesm2022/sd-angular-core-components-document-builder.mjs +4006 -611
  104. package/fesm2022/sd-angular-core-components-document-builder.mjs.map +1 -1
  105. package/fesm2022/sd-angular-core-components-history.mjs +1 -1
  106. package/fesm2022/sd-angular-core-components-history.mjs.map +1 -1
  107. package/fesm2022/sd-angular-core-components-import-excel.mjs +1 -1
  108. package/fesm2022/sd-angular-core-components-import-excel.mjs.map +1 -1
  109. package/fesm2022/sd-angular-core-components-mini-editor.mjs +326 -0
  110. package/fesm2022/sd-angular-core-components-mini-editor.mjs.map +1 -0
  111. package/fesm2022/sd-angular-core-components-modal.mjs +57 -91
  112. package/fesm2022/sd-angular-core-components-modal.mjs.map +1 -1
  113. package/fesm2022/sd-angular-core-components-preview.mjs +1 -1
  114. package/fesm2022/sd-angular-core-components-preview.mjs.map +1 -1
  115. package/fesm2022/sd-angular-core-components-quick-action.mjs +2 -2
  116. package/fesm2022/sd-angular-core-components-quick-action.mjs.map +1 -1
  117. package/fesm2022/sd-angular-core-components-section.mjs +41 -43
  118. package/fesm2022/sd-angular-core-components-section.mjs.map +1 -1
  119. package/fesm2022/sd-angular-core-components-side-drawer.mjs +78 -84
  120. package/fesm2022/sd-angular-core-components-side-drawer.mjs.map +1 -1
  121. package/fesm2022/sd-angular-core-components-tab-router.mjs +152 -226
  122. package/fesm2022/sd-angular-core-components-tab-router.mjs.map +1 -1
  123. package/fesm2022/sd-angular-core-components-table.mjs +1188 -1185
  124. package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
  125. package/fesm2022/sd-angular-core-components-upload-file.mjs +339 -444
  126. package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
  127. package/fesm2022/sd-angular-core-components-view.mjs +45 -0
  128. package/fesm2022/sd-angular-core-components-view.mjs.map +1 -0
  129. package/fesm2022/sd-angular-core-components-workflow.mjs +47 -57
  130. package/fesm2022/sd-angular-core-components-workflow.mjs.map +1 -1
  131. package/fesm2022/sd-angular-core-components.mjs +4 -0
  132. package/fesm2022/sd-angular-core-components.mjs.map +1 -1
  133. package/fesm2022/sd-angular-core-directives.mjs +286 -27
  134. package/fesm2022/sd-angular-core-directives.mjs.map +1 -1
  135. package/fesm2022/sd-angular-core-forms-autocomplete.mjs +289 -363
  136. package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
  137. package/fesm2022/sd-angular-core-forms-chip-calendar.mjs +170 -189
  138. package/fesm2022/sd-angular-core-forms-chip-calendar.mjs.map +1 -1
  139. package/fesm2022/sd-angular-core-forms-chip.mjs +184 -194
  140. package/fesm2022/sd-angular-core-forms-chip.mjs.map +1 -1
  141. package/fesm2022/sd-angular-core-forms-date-range.mjs +180 -242
  142. package/fesm2022/sd-angular-core-forms-date-range.mjs.map +1 -1
  143. package/fesm2022/sd-angular-core-forms-date.mjs +178 -270
  144. package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
  145. package/fesm2022/sd-angular-core-forms-datetime.mjs +177 -285
  146. package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
  147. package/fesm2022/sd-angular-core-forms-input-number.mjs +210 -337
  148. package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
  149. package/fesm2022/sd-angular-core-forms-input.mjs +169 -286
  150. package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
  151. package/fesm2022/sd-angular-core-forms-radio.mjs +3 -2
  152. package/fesm2022/sd-angular-core-forms-radio.mjs.map +1 -1
  153. package/fesm2022/sd-angular-core-forms-select.mjs +390 -447
  154. package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
  155. package/fesm2022/sd-angular-core-forms-textarea.mjs +167 -226
  156. package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
  157. package/fesm2022/sd-angular-core-modules-keycloak.mjs +126 -0
  158. package/fesm2022/sd-angular-core-modules-keycloak.mjs.map +1 -0
  159. package/fesm2022/sd-angular-core-modules-layout.mjs +454 -453
  160. package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
  161. package/fesm2022/sd-angular-core-modules.mjs +1 -1
  162. package/fesm2022/sd-angular-core-services-api.mjs +5 -10
  163. package/fesm2022/sd-angular-core-services-api.mjs.map +1 -1
  164. package/fesm2022/sd-angular-core-services-confirm.mjs +5 -7
  165. package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
  166. package/fesm2022/sd-angular-core-services-docx.mjs +173 -0
  167. package/fesm2022/sd-angular-core-services-docx.mjs.map +1 -0
  168. package/fesm2022/sd-angular-core-services-notify.mjs +2 -2
  169. package/fesm2022/sd-angular-core-services-notify.mjs.map +1 -1
  170. package/fesm2022/sd-angular-core-services.mjs +1 -0
  171. package/fesm2022/sd-angular-core-services.mjs.map +1 -1
  172. package/fesm2022/sd-angular-core-utilities-extensions.mjs +21 -45
  173. package/fesm2022/sd-angular-core-utilities-extensions.mjs.map +1 -1
  174. package/fesm2022/sd-angular-core-utilities-models.mjs +15 -1
  175. package/fesm2022/sd-angular-core-utilities-models.mjs.map +1 -1
  176. package/forms/autocomplete/src/autocomplete.component.d.ts +55 -55
  177. package/forms/chip/src/chip.component.d.ts +37 -40
  178. package/forms/chip-calendar/src/chip-calendar.component.d.ts +37 -38
  179. package/forms/date/src/date.component.d.ts +48 -46
  180. package/forms/date-range/src/date-range.component.d.ts +35 -34
  181. package/forms/datetime/src/datetime.component.d.ts +48 -49
  182. package/forms/input/src/input.component.d.ts +54 -57
  183. package/forms/input-number/src/input-number.component.d.ts +53 -54
  184. package/forms/select/src/select.component.d.ts +67 -64
  185. package/forms/textarea/src/textarea.component.d.ts +40 -43
  186. package/modules/index.d.ts +1 -1
  187. package/modules/keycloak/index.d.ts +4 -0
  188. package/modules/keycloak/keycloak.configuration.d.ts +11 -0
  189. package/modules/keycloak/keycloak.interceptor.d.ts +2 -0
  190. package/modules/keycloak/keycloak.module.d.ts +18 -0
  191. package/modules/keycloak/keycloak.service.d.ts +14 -0
  192. package/modules/layout/components/layout-main/layout-main.component.d.ts +7 -12
  193. package/modules/layout/components/page/page.component.d.ts +5 -7
  194. package/modules/layout/components/sidebar-v1/components/sidebar/sidebar.component.d.ts +22 -29
  195. package/modules/layout/components/sidebar-v1/components/user/user.component.d.ts +11 -17
  196. package/modules/layout/components/sidebar-v1/main.component.d.ts +14 -14
  197. package/modules/layout/configurations/layout.configuration.d.ts +46 -3
  198. package/modules/layout/modules/forbidden/pages/root/root.component.d.ts +3 -8
  199. package/modules/layout/modules/home/components/home-page/home-page.component.d.ts +2 -5
  200. package/modules/layout/modules/not-found/pages/root/root.component.d.ts +3 -8
  201. package/modules/layout/pipes/high-light-search.pipe.d.ts +1 -1
  202. package/modules/layout/services/index.d.ts +1 -0
  203. package/modules/layout/services/layout.service.d.ts +10 -0
  204. package/modules/layout/services/menu/menu.model.d.ts +2 -0
  205. package/modules/layout/services/storage/storage.service.d.ts +0 -3
  206. package/package.json +87 -64
  207. package/sd-angular-core-19.0.0-beta.71.tgz +0 -0
  208. package/services/api/src/api.model.d.ts +6 -1
  209. package/services/confirm/src/lib/confirm.service.d.ts +1 -0
  210. package/services/docx/index.d.ts +1 -0
  211. package/services/docx/src/lib/docx.model.d.ts +9 -0
  212. package/services/docx/src/lib/docx.service.d.ts +13 -0
  213. package/services/docx/src/public-api.d.ts +2 -0
  214. package/services/index.d.ts +1 -0
  215. package/services/notify/index.d.ts +1 -0
  216. package/services/notify/src/notify.model.d.ts +1 -1
  217. package/services/notify/src/notify.service.d.ts +5 -5
  218. package/utilities/extensions/src/string.extension.d.ts +2 -0
  219. package/utilities/extensions/src/utility.extension.d.ts +1 -0
  220. package/utilities/models/index.d.ts +3 -0
  221. package/utilities/models/src/filter.model.d.ts +17 -4
  222. package/utilities/models/src/icon.model.d.ts +2 -0
  223. package/utilities/models/src/nested-key-of.model.d.ts +5 -0
  224. package/utilities/models/src/order.model.d.ts +2 -1
  225. package/utilities/models/src/paging.model.d.ts +2 -1
  226. package/utilities/models/src/pattern.model.d.ts +1 -1
  227. package/utilities/models/src/unwrap-signal.model.d.ts +6 -0
  228. package/components/document-builder/src/plugins/comment/comment.plugin.d.ts +0 -4
  229. package/components/document-builder/src/plugins/table-fit/table-fit.plugin.d.ts +0 -4
  230. package/components/modal/src/modal/modal.component.d.ts +0 -31
  231. package/fesm2022/sd-angular-core-modules-oidc.mjs +0 -127
  232. package/fesm2022/sd-angular-core-modules-oidc.mjs.map +0 -1
  233. package/modules/oidc/dynamic-sts.loader.d.ts +0 -11
  234. package/modules/oidc/index.d.ts +0 -2
  235. package/modules/oidc/oidc.configuration.d.ts +0 -11
  236. package/modules/oidc/oidc.module.d.ts +0 -14
  237. package/sd-angular-core-19.0.0-beta.7.tgz +0 -0
@@ -1,21 +1,24 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Pipe, EventEmitter, ContentChild, ViewChild, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { Pipe, inject, ChangeDetectorRef, input, booleanAttribute, output, contentChild, effect, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { ENTER, COMMA } from '@angular/cdk/keycodes';
4
4
  import * as i1 from '@angular/common';
5
5
  import { CommonModule } from '@angular/common';
6
6
  import * as i2 from '@angular/forms';
7
- import { NgForm, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
+ import { FormControl, NgForm, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
8
  import { MatAutocompleteModule } from '@angular/material/autocomplete';
9
- import * as i5 from '@angular/material/chips';
9
+ import * as i6 from '@angular/material/chips';
10
10
  import { MatChipsModule } from '@angular/material/chips';
11
11
  import { MatFormFieldModule } from '@angular/material/form-field';
12
- import * as i4 from '@angular/material/icon';
12
+ import * as i5 from '@angular/material/icon';
13
13
  import { MatIconModule } from '@angular/material/icon';
14
14
  import * as i3 from '@angular/material/input';
15
15
  import { MatInputModule } from '@angular/material/input';
16
16
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
17
+ import * as i4 from '@angular/material/tooltip';
17
18
  import { MatTooltipModule } from '@angular/material/tooltip';
19
+ import { SdView } from '@sd-angular/core/components/view';
18
20
  import { SdViewDefDirective, SdLabelDefDirective } from '@sd-angular/core/forms/directives';
21
+ import { SdLabel } from '@sd-angular/core/forms/label';
19
22
  import { SdFormControl } from '@sd-angular/core/forms/models';
20
23
  import { Subscription } from 'rxjs';
21
24
  import * as uuid from 'uuid';
@@ -38,7 +41,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
38
41
  }]
39
42
  }], ctorParameters: () => [] });
40
43
 
41
- class SdChipErrotStateMatcher {
44
+ class SdChipErrorStateMatcher {
42
45
  formControl;
43
46
  constructor(formControl) {
44
47
  this.formControl = formControl;
@@ -49,216 +52,249 @@ class SdChipErrotStateMatcher {
49
52
  }
50
53
  }
51
54
  class SdChip {
52
- ref;
53
- autoId;
54
- set _autoId(val) {
55
- if (!val) {
56
- return;
57
- }
58
- this.autoId = `forms-chip-${val}`;
59
- }
55
+ #ref = inject(ChangeDetectorRef);
56
+ #subscription = new Subscription();
60
57
  #name = uuid.v4();
61
- set _name(val) {
62
- if (val) {
63
- this.#name = val;
64
- }
65
- }
66
- appearance = 'outline';
58
+ #form;
59
+ // Signals - inputs
60
+ autoId = input();
61
+ name = input();
62
+ appearance = input('outline');
63
+ floatLabel = input('auto');
64
+ size = input('md');
65
+ form = input();
66
+ label = input('');
67
+ placeholder = input();
68
+ removable = input(true);
69
+ hideInlineError = input(false, { transform: booleanAttribute });
70
+ model = input();
71
+ required = input(false, { transform: booleanAttribute });
72
+ min = input(0);
73
+ max = input(0);
74
+ addable = input(true, { transform: booleanAttribute });
75
+ disabled = input(false, { transform: booleanAttribute });
76
+ viewed = input(false, { transform: booleanAttribute });
77
+ hyperlink = input();
78
+ // Signals - outputs
79
+ modelChange = output();
80
+ sdChange = output();
81
+ // Template properties
82
+ input;
83
+ sdViewDef = contentChild(SdViewDefDirective);
84
+ sdLabelDef = contentChild(SdLabelDefDirective);
85
+ sdLabelTemplate = contentChild('sdLabel');
86
+ sdValueTemplate = contentChild('sdValue');
87
+ // Local states
88
+ #isBlurring = false;
89
+ isFocused = false;
90
+ #inputControl = new FormControl();
91
+ #formControl = new SdFormControl();
92
+ #matcher;
67
93
  separatorKeysCodes = [ENTER, COMMA];
68
94
  selectable = true;
69
- size = 'md';
70
- #form;
71
- set form(val) {
72
- if (val) {
73
- if (val instanceof NgForm) {
74
- this.#form = val.form;
95
+ constructor() {
96
+ // Update form reference
97
+ effect(() => {
98
+ const formInput = this.form();
99
+ if (formInput) {
100
+ if (formInput instanceof NgForm) {
101
+ this.#form = formInput.form;
102
+ }
103
+ else {
104
+ this.#form = formInput;
105
+ }
106
+ }
107
+ });
108
+ // Update validators
109
+ effect(() => {
110
+ this.required();
111
+ this.min();
112
+ this.max();
113
+ this.#updateValidator();
114
+ });
115
+ // Update model
116
+ effect(() => {
117
+ const values = this.model();
118
+ if (Array.isArray(values)) {
119
+ this.#formControl.setValue(values);
120
+ }
121
+ });
122
+ // Handle disabled state
123
+ effect(() => {
124
+ const isDisabled = this.disabled();
125
+ if (isDisabled) {
126
+ this.#formControl.disable();
127
+ this.#inputControl.disable();
75
128
  }
76
129
  else {
77
- this.#form = val;
130
+ this.#formControl.enable();
131
+ this.#inputControl.enable();
78
132
  }
79
- }
80
- }
81
- addable = true;
82
- set _addable(val) {
83
- this.addable = val === '' || !!val;
84
- }
85
- label = '';
86
- placeholder;
87
- removable = true;
88
- set _removable(val) {
89
- this.removable = val === '' || val;
90
- }
91
- hideInlineError = false;
92
- set _hideInlineError(val) {
93
- this.hideInlineError = val === '' || !!val;
94
- }
95
- // Model
96
- set model(values) {
97
- if (!Array.isArray(values)) {
98
- values = [];
99
- }
100
- this.formControl.setValue(values);
101
- }
102
- // Validator
103
- required = false;
104
- set _required(val) {
105
- this.required = val === '' || !!val;
106
- this.#updateValidator();
133
+ });
134
+ // Setup auto id and name
135
+ effect(() => {
136
+ const autoIdVal = this.autoId();
137
+ if (autoIdVal) {
138
+ // autoId is just for form association, no further processing needed
139
+ }
140
+ });
141
+ effect(() => {
142
+ const nameVal = this.name();
143
+ if (nameVal) {
144
+ this.#name = nameVal;
145
+ }
146
+ });
147
+ this.#matcher = new SdChipErrorStateMatcher(this.#formControl);
107
148
  }
108
- min;
109
- set pMin(val) {
110
- this.min = +val || 0;
111
- this.#updateValidator();
149
+ get formControl() {
150
+ return this.#formControl;
112
151
  }
113
- max;
114
- set pMax(val) {
115
- this.max = +val || 0;
116
- this.#updateValidator();
152
+ get inputControl() {
153
+ return this.#inputControl;
117
154
  }
118
- modelChange = new EventEmitter();
119
- // Optional
120
- set disabled(val) {
121
- val = val === '' || val;
122
- if (val) {
123
- this.formControl.disable();
124
- this.inputControl.disable();
125
- }
126
- else {
127
- this.formControl.enable();
128
- this.inputControl.enable();
129
- }
155
+ get errorTooltipMessage() {
156
+ const errors = this.#formControl.errors;
157
+ if (!errors)
158
+ return undefined;
159
+ if (errors['required'])
160
+ return 'Vui lòng nhập thông tin';
161
+ if (errors['minlength'])
162
+ return `Vui lòng nhập ít nhất ${this.min()} giá trị`;
163
+ if (errors['maxlength'])
164
+ return `Vui lòng nhập tối đa ${this.max()} giá trị`;
165
+ return undefined;
130
166
  }
131
- sdChange = new EventEmitter();
132
- input;
133
- sdView;
134
- sdLabelDef;
135
- isBlurring = false;
136
- isFocused = false;
137
- inputControl = new FormControl();
138
- formControl = new SdFormControl();
139
- matcher = new SdChipErrotStateMatcher(this.formControl);
140
- #subscription = new Subscription();
141
- constructor(ref) {
142
- this.ref = ref;
167
+ get matcher() {
168
+ return this.#matcher;
143
169
  }
144
170
  ngAfterViewInit() {
145
- this.#subscription.add(this.formControl.sdChanges.subscribe(() => {
146
- this.ref.markForCheck();
171
+ this.#subscription.add(this.#formControl.sdChanges.subscribe(() => {
172
+ this.#ref.markForCheck();
147
173
  }));
148
- this.#form?.addControl(this.#name, this.formControl);
174
+ this.#form?.addControl(this.#name, this.#formControl);
149
175
  }
150
176
  ngOnDestroy() {
151
177
  this.#form?.removeControl(this.#name);
152
178
  this.#subscription.unsubscribe();
153
179
  }
154
180
  #updateValidator = () => {
155
- this.formControl.clearValidators();
156
- this.formControl.clearAsyncValidators();
181
+ this.#formControl.clearValidators();
182
+ this.#formControl.clearAsyncValidators();
157
183
  const validators = [];
158
184
  const asyncValidators = [];
159
- if (this.required) {
185
+ if (this.required()) {
160
186
  validators.push(Validators.required);
161
187
  }
162
- if (this.min > 0) {
163
- validators.push(Validators.minLength(this.min));
188
+ if (this.min() > 0) {
189
+ validators.push(Validators.minLength(this.min()));
164
190
  }
165
- if (this.max > 0) {
166
- validators.push(Validators.maxLength(this.max));
191
+ if (this.max() > 0) {
192
+ validators.push(Validators.maxLength(this.max()));
167
193
  }
168
- this.formControl.setValidators(validators);
169
- this.formControl.setAsyncValidators(asyncValidators);
170
- this.formControl.updateValueAndValidity();
194
+ this.#formControl.setValidators(validators);
195
+ this.#formControl.setAsyncValidators(asyncValidators);
196
+ this.#formControl.updateValueAndValidity();
171
197
  };
172
- onAdd = (event) => {
198
+ #add = (event) => {
173
199
  const value = (event.value ?? '').toString().trim();
174
- const values = this.formControl.value ?? [];
175
- if (value && this.addable && !values.includes(value)) {
200
+ const values = this.#formControl.value ?? [];
201
+ if (value && this.addable() && !values.includes(value)) {
176
202
  values.push(value);
177
- this.formControl.setValue(values);
178
- this.modelChange.emit(this.formControl.value);
179
- this.sdChange.emit(this.formControl.value);
203
+ this.#formControl.setValue(values);
204
+ this.modelChange.emit(this.#formControl.value);
205
+ this.sdChange.emit(this.#formControl.value);
180
206
  }
181
207
  this.input.nativeElement.value = '';
182
- this.inputControl.setValue('');
208
+ this.#inputControl.setValue('');
183
209
  };
184
- onClickChip = ($event, item) => {
210
+ #clickChip = ($event, item) => {
185
211
  $event.stopPropagation();
186
212
  $event.stopImmediatePropagation();
187
- if (!this.formControl.disabled) {
188
- this.focus();
213
+ if (!this.#formControl.disabled) {
214
+ this.#focus();
189
215
  }
190
216
  };
191
- onRemove = (item) => {
192
- const values = this.formControl.value ?? [];
217
+ #remove = (item) => {
218
+ const values = this.#formControl.value ?? [];
193
219
  if (typeof item === 'string' || typeof item === 'number') {
194
- this.formControl.setValue(values.filter(value => item !== value));
195
- this.modelChange.emit(this.formControl.value);
196
- this.sdChange.emit(this.formControl.value);
220
+ this.#formControl.setValue(values.filter(value => item !== value));
221
+ this.modelChange.emit(this.#formControl.value);
222
+ this.sdChange.emit(this.#formControl.value);
197
223
  }
198
- this.inputControl.setValue('');
199
- this.focus();
224
+ this.#inputControl.setValue('');
225
+ this.#focus();
200
226
  };
201
- onSelect = (event) => {
227
+ #select = (event) => {
202
228
  const item = event.option.value;
203
- const values = this.formControl.value ?? [];
229
+ const values = this.#formControl.value ?? [];
204
230
  if (item) {
205
231
  if (typeof item === 'string' || typeof item === 'number') {
206
232
  if (!values.includes(item)) {
207
233
  values.push(item);
208
- this.formControl.setValue(values);
209
- this.modelChange.emit(this.formControl.value);
210
- this.sdChange.emit(this.formControl.value);
234
+ this.#formControl.setValue(values);
235
+ this.modelChange.emit(this.#formControl.value);
236
+ this.sdChange.emit(this.#formControl.value);
211
237
  }
212
238
  }
213
239
  this.input.nativeElement.value = '';
214
- this.inputControl.setValue('', {
240
+ this.#inputControl.setValue('', {
215
241
  emitEvent: false,
216
242
  });
217
243
  }
218
244
  };
219
- onFocus = () => {
245
+ #onFocus = () => {
220
246
  this.isFocused = true;
221
- this.isBlurring = false;
222
- this.inputControl.setValue('');
247
+ this.#isBlurring = false;
248
+ this.#inputControl.setValue('');
223
249
  };
224
- onBlur = () => {
225
- this.isBlurring = true;
250
+ #onBlur = () => {
251
+ this.#isBlurring = true;
226
252
  setTimeout(() => {
227
- if (this.isBlurring) {
253
+ if (this.#isBlurring) {
228
254
  this.isFocused = false;
229
- this.inputControl.setValue('', {
255
+ this.#inputControl.setValue('', {
230
256
  emitEvent: false,
231
257
  });
232
- this.ref.detectChanges();
258
+ this.#ref.detectChanges();
233
259
  }
234
260
  }, 150);
235
261
  };
236
- onClick = () => {
237
- if (this.sdView?.templateRef) {
238
- if (!this.formControl.disabled && !this.isFocused) {
239
- this.focus();
262
+ #onClick = () => {
263
+ if (this.sdViewDef()?.templateRef) {
264
+ if (!this.#formControl.disabled && !this.isFocused) {
265
+ this.#focus();
240
266
  }
241
267
  }
242
268
  };
243
- focus = () => {
269
+ #focus = () => {
244
270
  this.isFocused = true;
245
- this.isBlurring = false;
271
+ this.#isBlurring = false;
246
272
  setTimeout(() => {
247
273
  if (this.isFocused) {
248
274
  this.input?.nativeElement?.focus();
249
275
  }
250
276
  }, 100);
251
277
  };
252
- onClear = ($event) => {
278
+ #clear = ($event) => {
253
279
  $event?.stopPropagation();
254
- this.inputControl.setValue('');
255
- this.formControl.setValue([]);
256
- this.modelChange.emit(this.formControl.value);
257
- this.sdChange.emit(this.formControl.value);
258
- this.ref.detectChanges();
280
+ this.#inputControl.setValue('');
281
+ this.#formControl.setValue([]);
282
+ this.modelChange.emit(this.#formControl.value);
283
+ this.sdChange.emit(this.#formControl.value);
284
+ this.#ref.detectChanges();
259
285
  };
260
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdChip, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
261
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdChip, isStandalone: true, selector: "sd-chip", inputs: { _autoId: ["autoId", "_autoId"], _name: ["name", "_name"], appearance: "appearance", size: "size", form: "form", _addable: ["addable", "_addable"], label: "label", placeholder: "placeholder", _removable: ["removable", "_removable"], _hideInlineError: ["hideInlineError", "_hideInlineError"], model: "model", _required: ["required", "_required"], pMin: ["min", "pMin"], pMax: ["max", "pMax"], disabled: "disabled" }, outputs: { modelChange: "modelChange", sdChange: "sdChange" }, queries: [{ propertyName: "sdView", first: true, predicate: SdViewDefDirective, descendants: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "@let labelTemplate = sdLabelDef?.templateRef;\r\n@let viewTemplate = sdView?.templateRef;\r\n\r\n@if (!appearance && labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\r\n}\r\n@if (!appearance && label && !labelTemplate) {\r\n <div class=\"d-block mb-0 T14M\">{{ label }} <span class=\"text-danger mb-2\" *ngIf=\"required\">*</span></div>\r\n}\r\n<div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"viewTemplate\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (keydown.enter)=\"onClick()\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\">\r\n @if (viewTemplate && !isFocused) {\r\n <ng-container *ngTemplateOutlet=\"viewTemplate; context: { value: formControl.value }\"></ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"size === 'md'\"\r\n [class.sd-sm]=\"size === 'sm'\"\r\n [class.hide-inline-error]=\"hideInlineError\"\r\n [appearance]=\"appearance\">\r\n @if (appearance && label) {\r\n <mat-label>{{ label }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"size === 'md'\" [class.sd-sm]=\"size === 'sm'\">\r\n @for (item of formControl.value; track $index) {\r\n @if (item) {\r\n <mat-chip-row\r\n [class.sd-md]=\"size === 'md'\"\r\n [class.sd-sm]=\"size === 'sm'\"\r\n [removable]=\"removable\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\">\r\n <span>{{ item }}</span>\r\n @if (!inputControl.disabled && item | sdRemovableChip: removable) {\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n }\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [placeholder]=\"placeholder || label\"\r\n [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"onAdd($event)\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"required\"\r\n matInput\r\n [attr.data-autoId]=\"autoId\"\r\n #input />\r\n </mat-chip-grid>\r\n @if (formControl.errors?.['required'] && !hideInlineError) {\r\n <mat-error>{{ 'Vui l\u00F2ng nh\u1EADp th\u00F4ng tin' }}</mat-error>\r\n }\r\n @if (formControl.errors?.['minlength'] && !hideInlineError) {\r\n <mat-error>{{ 'Vui l\u00F2ng nh\u1EADp \u00EDt nh\u1EA5t ' + min + ' gi\u00E1 tr\u1ECB' }} </mat-error>\r\n }\r\n @if (formControl.errors?.['maxlength'] && !hideInlineError) {\r\n <mat-error>{{ 'Vui l\u00F2ng nh\u1EADp t\u1ED1i \u0111a ' + max + ' gi\u00E1 tr\u1ECB' }} </mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n</div>\r\n", styles: [":host{padding-top:5px;display:block}.sd-chip-input{margin-top:0!important}: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:#ebecf0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { 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"], 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: "pipe", type: SdRemovableChipPipe, name: "sdRemovableChip" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
286
+ // Public method to expose private methods for template
287
+ onAdd = (event) => this.#add(event);
288
+ onClickChip = (event, item) => this.#clickChip(event, item);
289
+ onRemove = (item) => this.#remove(item);
290
+ onSelect = (event) => this.#select(event);
291
+ onFocus = () => this.#onFocus();
292
+ onBlur = () => this.#onBlur();
293
+ onClick = () => this.#onClick();
294
+ focus = () => this.#focus();
295
+ onClear = ($event) => this.#clear($event);
296
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
297
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdChip, isStandalone: true, selector: "sd-chip", inputs: { autoId: { classPropertyName: "autoId", 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 }, 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 }, model: { classPropertyName: "model", publicName: "model", 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 }, addable: { classPropertyName: "addable", publicName: "addable", 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 } }, outputs: { modelChange: "modelChange", sdChange: "sdChange" }, 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: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "@let _lbl = label();\r\n@let _app = appearance();\r\n@let _req = required();\r\n@let _viewed = viewed();\r\n@let _hideErr = hideInlineError();\r\n@let _viewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _viewDef?.templateRef) || undefined;\r\n@let _errMsg = errorTooltipMessage;\r\n\r\n@if (_viewed) {\r\n <sd-view\r\n [label]=\"_lbl\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if (!_app && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if (!_app && _lbl && !_labelTemplate) {\r\n <sd-label [label]=\"_lbl\" [required]=\"_req\"></sd-label>\r\n }\r\n\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_viewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (keydown.enter)=\"onClick()\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\">\r\n @if (_viewDef?.templateRef && !isFocused) {\r\n <ng-container *ngTemplateOutlet=\"_viewDef!.templateRef; context: { value: formControl.value }\"></ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"size() === 'md'\"\r\n [class.sd-sm]=\"size() === 'sm'\"\r\n [class.hide-inline-error]=\"_hideErr\"\r\n [appearance]=\"_app\"\r\n [floatLabel]=\"floatLabel()\">\r\n @if (_app && _lbl) {\r\n <mat-label>{{ _lbl }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"size() === 'md'\" [class.sd-sm]=\"size() === 'sm'\">\r\n @for (item of formControl.value; track $index) {\r\n @if (item) {\r\n <mat-chip-row\r\n [class.sd-md]=\"size() === 'md'\"\r\n [class.sd-sm]=\"size() === 'sm'\"\r\n [removable]=\"removable()\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\">\r\n <span>{{ item }}</span>\r\n @if (!inputControl.disabled && item | sdRemovableChip: removable()) {\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n }\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [placeholder]=\"placeholder() || _lbl\"\r\n [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"onAdd($event)\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"_req\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n #input />\r\n </mat-chip-grid>\r\n @if (_hideErr && _errMsg && formControl.touched) {\r\n <mat-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errMsg\" matTooltipPosition=\"above\"> error </mat-icon>\r\n }\r\n\r\n @if (!_hideErr && _errMsg && formControl.touched) {\r\n <mat-error>{{ _errMsg }}</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{padding-top:5px;display:block}.sd-chip-input{margin-top:0!important}: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:#ebecf0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i6.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i6.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i6.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i6.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate"] }, { kind: "pipe", type: SdRemovableChipPipe, name: "sdRemovableChip" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
262
298
  }
263
299
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdChip, decorators: [{
264
300
  type: Component,
@@ -273,59 +309,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
273
309
  MatIconModule,
274
310
  MatProgressSpinnerModule,
275
311
  MatChipsModule,
312
+ SdLabel,
313
+ SdView,
276
314
  SdRemovableChipPipe,
277
- ], template: "@let labelTemplate = sdLabelDef?.templateRef;\r\n@let viewTemplate = sdView?.templateRef;\r\n\r\n@if (!appearance && labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"labelTemplate\"></ng-container>\r\n}\r\n@if (!appearance && label && !labelTemplate) {\r\n <div class=\"d-block mb-0 T14M\">{{ label }} <span class=\"text-danger mb-2\" *ngIf=\"required\">*</span></div>\r\n}\r\n<div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"viewTemplate\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (keydown.enter)=\"onClick()\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\">\r\n @if (viewTemplate && !isFocused) {\r\n <ng-container *ngTemplateOutlet=\"viewTemplate; context: { value: formControl.value }\"></ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"size === 'md'\"\r\n [class.sd-sm]=\"size === 'sm'\"\r\n [class.hide-inline-error]=\"hideInlineError\"\r\n [appearance]=\"appearance\">\r\n @if (appearance && label) {\r\n <mat-label>{{ label }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"size === 'md'\" [class.sd-sm]=\"size === 'sm'\">\r\n @for (item of formControl.value; track $index) {\r\n @if (item) {\r\n <mat-chip-row\r\n [class.sd-md]=\"size === 'md'\"\r\n [class.sd-sm]=\"size === 'sm'\"\r\n [removable]=\"removable\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\">\r\n <span>{{ item }}</span>\r\n @if (!inputControl.disabled && item | sdRemovableChip: removable) {\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n }\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [placeholder]=\"placeholder || label\"\r\n [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"onAdd($event)\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"required\"\r\n matInput\r\n [attr.data-autoId]=\"autoId\"\r\n #input />\r\n </mat-chip-grid>\r\n @if (formControl.errors?.['required'] && !hideInlineError) {\r\n <mat-error>{{ 'Vui l\u00F2ng nh\u1EADp th\u00F4ng tin' }}</mat-error>\r\n }\r\n @if (formControl.errors?.['minlength'] && !hideInlineError) {\r\n <mat-error>{{ 'Vui l\u00F2ng nh\u1EADp \u00EDt nh\u1EA5t ' + min + ' gi\u00E1 tr\u1ECB' }} </mat-error>\r\n }\r\n @if (formControl.errors?.['maxlength'] && !hideInlineError) {\r\n <mat-error>{{ 'Vui l\u00F2ng nh\u1EADp t\u1ED1i \u0111a ' + max + ' gi\u00E1 tr\u1ECB' }} </mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n</div>\r\n", styles: [":host{padding-top:5px;display:block}.sd-chip-input{margin-top:0!important}: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:#ebecf0}\n"] }]
278
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { _autoId: [{
279
- type: Input,
280
- args: ['autoId']
281
- }], _name: [{
282
- type: Input,
283
- args: ['name']
284
- }], appearance: [{
285
- type: Input
286
- }], size: [{
287
- type: Input
288
- }], form: [{
289
- type: Input
290
- }], _addable: [{
291
- type: Input,
292
- args: ['addable']
293
- }], label: [{
294
- type: Input
295
- }], placeholder: [{
296
- type: Input
297
- }], _removable: [{
298
- type: Input,
299
- args: ['removable']
300
- }], _hideInlineError: [{
301
- type: Input,
302
- args: ['hideInlineError']
303
- }], model: [{
304
- type: Input
305
- }], _required: [{
306
- type: Input,
307
- args: ['required']
308
- }], pMin: [{
309
- type: Input,
310
- args: ['min']
311
- }], pMax: [{
312
- type: Input,
313
- args: ['max']
314
- }], modelChange: [{
315
- type: Output
316
- }], disabled: [{
317
- type: Input
318
- }], sdChange: [{
319
- type: Output
320
- }], input: [{
315
+ ], template: "@let _lbl = label();\r\n@let _app = appearance();\r\n@let _req = required();\r\n@let _viewed = viewed();\r\n@let _hideErr = hideInlineError();\r\n@let _viewDef = sdViewDef();\r\n@let _labelTemplate = (sdLabelTemplate() ?? sdLabelDef()?.templateRef) || undefined;\r\n@let _valueTemplate = (sdValueTemplate() ?? _viewDef?.templateRef) || undefined;\r\n@let _errMsg = errorTooltipMessage;\r\n\r\n@if (_viewed) {\r\n <sd-view\r\n [label]=\"_lbl\"\r\n [labelTemplate]=\"_labelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"_valueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if (!_app && _labelTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_labelTemplate\"></ng-container>\r\n }\r\n @if (!_app && _lbl && !_labelTemplate) {\r\n <sd-label [label]=\"_lbl\" [required]=\"_req\"></sd-label>\r\n }\r\n\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!_viewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (keydown.enter)=\"onClick()\"\r\n tabindex=\"0\"\r\n (click)=\"onClick()\">\r\n @if (_viewDef?.templateRef && !isFocused) {\r\n <ng-container *ngTemplateOutlet=\"_viewDef!.templateRef; context: { value: formControl.value }\"></ng-container>\r\n } @else {\r\n <mat-form-field\r\n [class.sd-md]=\"size() === 'md'\"\r\n [class.sd-sm]=\"size() === 'sm'\"\r\n [class.hide-inline-error]=\"_hideErr\"\r\n [appearance]=\"_app\"\r\n [floatLabel]=\"floatLabel()\">\r\n @if (_app && _lbl) {\r\n <mat-label>{{ _lbl }}</mat-label>\r\n }\r\n <mat-chip-grid [formControl]=\"formControl\" #chipList [class.sd-md]=\"size() === 'md'\" [class.sd-sm]=\"size() === 'sm'\">\r\n @for (item of formControl.value; track $index) {\r\n @if (item) {\r\n <mat-chip-row\r\n [class.sd-md]=\"size() === 'md'\"\r\n [class.sd-sm]=\"size() === 'sm'\"\r\n [removable]=\"removable()\"\r\n (removed)=\"onRemove(item)\"\r\n [disabled]=\"inputControl.disabled\"\r\n (click)=\"onClickChip($event, item)\">\r\n <span>{{ item }}</span>\r\n @if (!inputControl.disabled && item | sdRemovableChip: removable()) {\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n }\r\n </mat-chip-row>\r\n }\r\n }\r\n <input\r\n class=\"sd-chip-input\"\r\n [formControl]=\"inputControl\"\r\n [placeholder]=\"placeholder() || _lbl\"\r\n [matChipInputFor]=\"chipList\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n (matChipInputTokenEnd)=\"onAdd($event)\"\r\n autocomplete=\"off\"\r\n [errorStateMatcher]=\"matcher\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"_req\"\r\n matInput\r\n [attr.data-autoId]=\"autoId()\"\r\n #input />\r\n </mat-chip-grid>\r\n @if (_hideErr && _errMsg && formControl.touched) {\r\n <mat-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errMsg\" matTooltipPosition=\"above\"> error </mat-icon>\r\n }\r\n\r\n @if (!_hideErr && _errMsg && formControl.touched) {\r\n <mat-error>{{ _errMsg }}</mat-error>\r\n }\r\n </mat-form-field>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{padding-top:5px;display:block}.sd-chip-input{margin-top:0!important}: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:#ebecf0}\n"] }]
316
+ }], ctorParameters: () => [], propDecorators: { input: [{
321
317
  type: ViewChild,
322
318
  args: ['input']
323
- }], sdView: [{
324
- type: ContentChild,
325
- args: [SdViewDefDirective]
326
- }], sdLabelDef: [{
327
- type: ContentChild,
328
- args: [SdLabelDefDirective]
329
319
  }] } });
330
320
 
331
321
  /**