@sd-angular/core 19.0.0-beta.6 → 19.0.0-beta.60

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 (219) hide show
  1. package/README.md +686 -33
  2. package/assets/scss/ckeditor5.scss +60 -2
  3. package/assets/scss/core/bootstrap.scss +17 -0
  4. package/assets/scss/core/form.scss +4 -1
  5. package/assets/scss/core/grid.scss +40 -0
  6. package/assets/scss/sd-core.scss +1 -0
  7. package/components/avatar/index.d.ts +1 -0
  8. package/components/avatar/src/avatar.component.d.ts +19 -0
  9. package/components/badge/src/badge.component.d.ts +77 -19
  10. package/components/button/src/button.component.d.ts +30 -28
  11. package/components/code-editor/index.d.ts +1 -0
  12. package/components/code-editor/src/code-editor.component.d.ts +25 -0
  13. package/components/document-builder/index.d.ts +1 -0
  14. package/components/document-builder/src/document-builder.component.d.ts +12 -41
  15. package/components/document-builder/src/document-builder.model.d.ts +14 -11
  16. package/components/document-builder/src/plugins/block-space/block-space.plugin.d.ts +9 -0
  17. package/components/document-builder/src/plugins/ck-comment/ck-comment.plugin.d.ts +44 -0
  18. package/components/document-builder/src/plugins/ck-comment/ck-comment.plugin.model.d.ts +57 -0
  19. package/components/document-builder/src/plugins/heading/heading.plugin.d.ts +1 -0
  20. package/components/document-builder/src/plugins/highlight-range/highlight-range.plugin.d.ts +4 -0
  21. package/components/document-builder/src/plugins/image-custom/image-custom.plugin.d.ts +31 -0
  22. package/components/document-builder/src/plugins/index.d.ts +7 -2
  23. package/components/document-builder/src/plugins/page-orientation/page-orientation.plugin.d.ts +2 -2
  24. package/components/document-builder/src/plugins/paste-handler/filters/bookmark.d.ts +14 -0
  25. package/components/document-builder/src/plugins/paste-handler/filters/br.d.ts +15 -0
  26. package/components/document-builder/src/plugins/paste-handler/filters/image.d.ts +25 -0
  27. package/components/document-builder/src/plugins/paste-handler/filters/list.d.ts +29 -0
  28. package/components/document-builder/src/plugins/paste-handler/filters/parse.d.ts +35 -0
  29. package/components/document-builder/src/plugins/paste-handler/filters/removeboldwrapper.d.ts +15 -0
  30. package/components/document-builder/src/plugins/paste-handler/filters/removegooglesheetstag.d.ts +15 -0
  31. package/components/document-builder/src/plugins/paste-handler/filters/removeinvalidtablewidth.d.ts +15 -0
  32. package/components/document-builder/src/plugins/paste-handler/filters/removemsattributes.d.ts +15 -0
  33. package/components/document-builder/src/plugins/paste-handler/filters/removestyleblock.d.ts +15 -0
  34. package/components/document-builder/src/plugins/paste-handler/filters/removexmlns.d.ts +15 -0
  35. package/components/document-builder/src/plugins/paste-handler/filters/replacemsfootnotes.d.ts +54 -0
  36. package/components/document-builder/src/plugins/paste-handler/filters/replacetabswithinprewithspaces.d.ts +24 -0
  37. package/components/document-builder/src/plugins/paste-handler/filters/space.d.ts +27 -0
  38. package/components/document-builder/src/plugins/paste-handler/filters/table.d.ts +16 -0
  39. package/components/document-builder/src/plugins/paste-handler/filters/utils.d.ts +25 -0
  40. package/components/document-builder/src/plugins/paste-handler/index.d.ts +35 -0
  41. package/components/document-builder/src/plugins/paste-handler/normalizers/googledocsnormalizer.d.ts +31 -0
  42. package/components/document-builder/src/plugins/paste-handler/normalizers/googlesheetsnormalizer.d.ts +31 -0
  43. package/components/document-builder/src/plugins/paste-handler/normalizers/mswordnormalizer.d.ts +29 -0
  44. package/components/document-builder/src/plugins/paste-handler/types.d.ts +30 -0
  45. package/components/document-builder/src/plugins/table-custom/index.d.ts +34 -0
  46. package/components/document-builder/src/plugins/variable/variable.plugin.d.ts +39 -0
  47. package/components/index.d.ts +4 -0
  48. package/components/mini-editor/index.d.ts +2 -0
  49. package/components/mini-editor/src/mini-editor.component.d.ts +90 -0
  50. package/components/mini-editor/src/mini-editor.model.d.ts +44 -0
  51. package/components/section/src/section.component.d.ts +10 -11
  52. package/components/side-drawer/src/side-drawer.component.d.ts +11 -24
  53. package/components/tab-router/src/components/tab-router-item/tab-router-item.component.d.ts +4 -1
  54. package/components/tab-router/src/components/tab-router-outlet/tab-router-outlet.component.d.ts +3 -15
  55. package/components/table/src/components/column-filter/column-filter.component.d.ts +3 -3
  56. package/components/table/src/components/desktop-cell/desktop-cell.component.d.ts +12 -2
  57. package/components/table/src/components/desktop-cell-view/desktop-cell-view.component.d.ts +12 -2
  58. package/components/table/src/components/external-filter/external-filter.component.d.ts +1 -1
  59. package/components/table/src/components/selector-action/action-filter.pipe.d.ts +11 -10
  60. package/components/table/src/components/selector-action/selector-action.component.d.ts +5 -3
  61. package/components/table/src/directives/index.d.ts +2 -0
  62. package/components/table/src/directives/sd-table-column-filter-def.directive.d.ts +9 -0
  63. package/components/table/src/directives/sticky-shadow.directive.d.ts +17 -0
  64. package/components/table/src/models/table-column.model.d.ts +34 -34
  65. package/components/table/src/models/table-command.model.d.ts +7 -3
  66. package/components/table/src/models/table-item.model.d.ts +5 -4
  67. package/components/table/src/models/table-option-config.model.d.ts +5 -0
  68. package/components/table/src/models/table-option-export.model.d.ts +3 -2
  69. package/components/table/src/models/table-option-selector.model.d.ts +11 -10
  70. package/components/table/src/models/table-option.model.d.ts +10 -9
  71. package/components/table/src/services/index.d.ts +3 -0
  72. package/components/table/src/services/table-export/table-export.service.d.ts +26 -0
  73. package/components/table/src/services/table-filter/table-filter.model.d.ts +5 -4
  74. package/components/table/src/services/table-format/table-format.service.d.ts +16 -0
  75. package/components/table/src/table.component.d.ts +39 -53
  76. package/components/upload-file/src/configurations/upload-file.configuration.d.ts +1 -1
  77. package/components/upload-file/src/services/upload-file.service.d.ts +0 -1
  78. package/components/upload-file/src/upload-file.component.d.ts +49 -54
  79. package/components/view/index.d.ts +1 -0
  80. package/components/view/src/view.component.d.ts +16 -0
  81. package/components/workflow/src/models/form-generic-component.model.d.ts +5 -4
  82. package/components/workflow/src/models/index.d.ts +1 -0
  83. package/directives/index.d.ts +1 -0
  84. package/directives/src/sd-href.directive.d.ts +9 -0
  85. package/fesm2022/sd-angular-core-components-avatar.mjs +103 -0
  86. package/fesm2022/sd-angular-core-components-avatar.mjs.map +1 -0
  87. package/fesm2022/sd-angular-core-components-badge.mjs +101 -91
  88. package/fesm2022/sd-angular-core-components-badge.mjs.map +1 -1
  89. package/fesm2022/sd-angular-core-components-button.mjs +70 -96
  90. package/fesm2022/sd-angular-core-components-button.mjs.map +1 -1
  91. package/fesm2022/sd-angular-core-components-code-editor.mjs +129 -0
  92. package/fesm2022/sd-angular-core-components-code-editor.mjs.map +1 -0
  93. package/fesm2022/sd-angular-core-components-document-builder.mjs +3994 -608
  94. package/fesm2022/sd-angular-core-components-document-builder.mjs.map +1 -1
  95. package/fesm2022/sd-angular-core-components-history.mjs +1 -1
  96. package/fesm2022/sd-angular-core-components-history.mjs.map +1 -1
  97. package/fesm2022/sd-angular-core-components-import-excel.mjs +1 -1
  98. package/fesm2022/sd-angular-core-components-import-excel.mjs.map +1 -1
  99. package/fesm2022/sd-angular-core-components-mini-editor.mjs +326 -0
  100. package/fesm2022/sd-angular-core-components-mini-editor.mjs.map +1 -0
  101. package/fesm2022/sd-angular-core-components-preview.mjs +1 -1
  102. package/fesm2022/sd-angular-core-components-preview.mjs.map +1 -1
  103. package/fesm2022/sd-angular-core-components-section.mjs +24 -42
  104. package/fesm2022/sd-angular-core-components-section.mjs.map +1 -1
  105. package/fesm2022/sd-angular-core-components-side-drawer.mjs +78 -84
  106. package/fesm2022/sd-angular-core-components-side-drawer.mjs.map +1 -1
  107. package/fesm2022/sd-angular-core-components-tab-router.mjs +152 -226
  108. package/fesm2022/sd-angular-core-components-tab-router.mjs.map +1 -1
  109. package/fesm2022/sd-angular-core-components-table.mjs +1129 -1131
  110. package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
  111. package/fesm2022/sd-angular-core-components-upload-file.mjs +339 -444
  112. package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
  113. package/fesm2022/sd-angular-core-components-view.mjs +45 -0
  114. package/fesm2022/sd-angular-core-components-view.mjs.map +1 -0
  115. package/fesm2022/sd-angular-core-components-workflow.mjs +47 -57
  116. package/fesm2022/sd-angular-core-components-workflow.mjs.map +1 -1
  117. package/fesm2022/sd-angular-core-components.mjs +4 -0
  118. package/fesm2022/sd-angular-core-components.mjs.map +1 -1
  119. package/fesm2022/sd-angular-core-directives.mjs +80 -27
  120. package/fesm2022/sd-angular-core-directives.mjs.map +1 -1
  121. package/fesm2022/sd-angular-core-forms-autocomplete.mjs +274 -364
  122. package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
  123. package/fesm2022/sd-angular-core-forms-chip-calendar.mjs +5 -2
  124. package/fesm2022/sd-angular-core-forms-chip-calendar.mjs.map +1 -1
  125. package/fesm2022/sd-angular-core-forms-chip.mjs +5 -2
  126. package/fesm2022/sd-angular-core-forms-chip.mjs.map +1 -1
  127. package/fesm2022/sd-angular-core-forms-date-range.mjs +160 -245
  128. package/fesm2022/sd-angular-core-forms-date-range.mjs.map +1 -1
  129. package/fesm2022/sd-angular-core-forms-date.mjs +153 -273
  130. package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
  131. package/fesm2022/sd-angular-core-forms-datetime.mjs +152 -288
  132. package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
  133. package/fesm2022/sd-angular-core-forms-input-number.mjs +191 -338
  134. package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
  135. package/fesm2022/sd-angular-core-forms-input.mjs +149 -287
  136. package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
  137. package/fesm2022/sd-angular-core-forms-radio.mjs +3 -2
  138. package/fesm2022/sd-angular-core-forms-radio.mjs.map +1 -1
  139. package/fesm2022/sd-angular-core-forms-select.mjs +375 -448
  140. package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
  141. package/fesm2022/sd-angular-core-forms-textarea.mjs +138 -227
  142. package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
  143. package/fesm2022/sd-angular-core-modules-keycloak.mjs +126 -0
  144. package/fesm2022/sd-angular-core-modules-keycloak.mjs.map +1 -0
  145. package/fesm2022/sd-angular-core-modules-layout.mjs +454 -453
  146. package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
  147. package/fesm2022/sd-angular-core-modules.mjs +1 -1
  148. package/fesm2022/sd-angular-core-services-api.mjs +5 -10
  149. package/fesm2022/sd-angular-core-services-api.mjs.map +1 -1
  150. package/fesm2022/sd-angular-core-services-confirm.mjs +2 -2
  151. package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
  152. package/fesm2022/sd-angular-core-services-docx.mjs +173 -0
  153. package/fesm2022/sd-angular-core-services-docx.mjs.map +1 -0
  154. package/fesm2022/sd-angular-core-services-notify.mjs +2 -2
  155. package/fesm2022/sd-angular-core-services-notify.mjs.map +1 -1
  156. package/fesm2022/sd-angular-core-services.mjs +1 -0
  157. package/fesm2022/sd-angular-core-services.mjs.map +1 -1
  158. package/fesm2022/sd-angular-core-utilities-extensions.mjs +21 -45
  159. package/fesm2022/sd-angular-core-utilities-extensions.mjs.map +1 -1
  160. package/fesm2022/sd-angular-core-utilities-models.mjs +15 -1
  161. package/fesm2022/sd-angular-core-utilities-models.mjs.map +1 -1
  162. package/forms/autocomplete/src/autocomplete.component.d.ts +50 -55
  163. package/forms/chip/src/chip.component.d.ts +3 -2
  164. package/forms/chip-calendar/src/chip-calendar.component.d.ts +3 -2
  165. package/forms/date/src/date.component.d.ts +43 -46
  166. package/forms/date-range/src/date-range.component.d.ts +30 -34
  167. package/forms/datetime/src/datetime.component.d.ts +43 -49
  168. package/forms/input/src/input.component.d.ts +48 -57
  169. package/forms/input-number/src/input-number.component.d.ts +48 -54
  170. package/forms/select/src/select.component.d.ts +62 -64
  171. package/forms/textarea/src/textarea.component.d.ts +36 -42
  172. package/modules/index.d.ts +1 -1
  173. package/modules/keycloak/index.d.ts +4 -0
  174. package/modules/keycloak/keycloak.configuration.d.ts +11 -0
  175. package/modules/keycloak/keycloak.interceptor.d.ts +2 -0
  176. package/modules/keycloak/keycloak.module.d.ts +18 -0
  177. package/modules/keycloak/keycloak.service.d.ts +14 -0
  178. package/modules/layout/components/layout-main/layout-main.component.d.ts +7 -12
  179. package/modules/layout/components/page/page.component.d.ts +5 -7
  180. package/modules/layout/components/sidebar-v1/components/sidebar/sidebar.component.d.ts +22 -29
  181. package/modules/layout/components/sidebar-v1/components/user/user.component.d.ts +11 -17
  182. package/modules/layout/components/sidebar-v1/main.component.d.ts +14 -14
  183. package/modules/layout/configurations/layout.configuration.d.ts +46 -3
  184. package/modules/layout/modules/forbidden/pages/root/root.component.d.ts +3 -8
  185. package/modules/layout/modules/home/components/home-page/home-page.component.d.ts +2 -5
  186. package/modules/layout/modules/not-found/pages/root/root.component.d.ts +3 -8
  187. package/modules/layout/pipes/high-light-search.pipe.d.ts +1 -1
  188. package/modules/layout/services/index.d.ts +1 -0
  189. package/modules/layout/services/layout.service.d.ts +10 -0
  190. package/modules/layout/services/menu/menu.model.d.ts +2 -0
  191. package/modules/layout/services/storage/storage.service.d.ts +0 -3
  192. package/package.json +93 -70
  193. package/sd-angular-core-19.0.0-beta.60.tgz +0 -0
  194. package/services/api/src/api.model.d.ts +6 -1
  195. package/services/confirm/src/lib/confirm.service.d.ts +1 -0
  196. package/services/docx/index.d.ts +1 -0
  197. package/services/docx/src/lib/docx.model.d.ts +9 -0
  198. package/services/docx/src/lib/docx.service.d.ts +13 -0
  199. package/services/docx/src/public-api.d.ts +2 -0
  200. package/services/index.d.ts +1 -0
  201. package/services/notify/index.d.ts +1 -0
  202. package/services/notify/src/notify.model.d.ts +1 -1
  203. package/services/notify/src/notify.service.d.ts +5 -5
  204. package/utilities/extensions/src/string.extension.d.ts +2 -0
  205. package/utilities/extensions/src/utility.extension.d.ts +1 -0
  206. package/utilities/models/index.d.ts +3 -0
  207. package/utilities/models/src/filter.model.d.ts +14 -2
  208. package/utilities/models/src/icon.model.d.ts +2 -0
  209. package/utilities/models/src/nested-key-of.model.d.ts +5 -0
  210. package/utilities/models/src/pattern.model.d.ts +1 -1
  211. package/utilities/models/src/unwrap-signal.model.d.ts +6 -0
  212. package/components/document-builder/src/plugins/comment/comment.plugin.d.ts +0 -4
  213. package/components/document-builder/src/plugins/table-fit/table-fit.plugin.d.ts +0 -4
  214. package/fesm2022/sd-angular-core-modules-oidc.mjs +0 -127
  215. package/fesm2022/sd-angular-core-modules-oidc.mjs.map +0 -1
  216. package/modules/oidc/dynamic-sts.loader.d.ts +0 -11
  217. package/modules/oidc/index.d.ts +0 -2
  218. package/modules/oidc/oidc.configuration.d.ts +0 -11
  219. package/modules/oidc/oidc.module.d.ts +0 -14
@@ -1,9 +1,9 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { EventEmitter, ContentChild, ViewChild, Output, Input, Inject, Optional, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { viewChild, contentChild, input, computed, inject, ChangeDetectorRef, booleanAttribute, model, output, EventEmitter, effect, untracked, Output, ChangeDetectionStrategy, Component } from '@angular/core';
5
5
  import * as i2 from '@angular/forms';
6
- import { NgForm, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
6
+ import { NgForm, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
7
  import { MatButtonModule } from '@angular/material/button';
8
8
  import * as i3 from '@angular/material/form-field';
9
9
  import { MatFormFieldModule } from '@angular/material/form-field';
@@ -13,220 +13,171 @@ import * as i4 from '@angular/material/input';
13
13
  import { MatInputModule } from '@angular/material/input';
14
14
  import * as i6 from '@angular/material/tooltip';
15
15
  import { MatTooltipModule } from '@angular/material/tooltip';
16
- import { SdSuffixDefDirective, SdLabelDefDirective, SdViewDefDirective } from '@sd-angular/core/forms/directives';
17
- import { SdFormControl, HandleSdCustomValidator, SD_FORM_CONFIGURATION } from '@sd-angular/core/forms/models';
16
+ import { SdView } from '@sd-angular/core/components/view';
17
+ import { SdSuffixDefDirective, SdViewDefDirective } from '@sd-angular/core/forms/directives';
18
+ import { SdLabel } from '@sd-angular/core/forms/label';
19
+ import { SD_FORM_CONFIGURATION, SdFormControl, HandleSdCustomValidator } from '@sd-angular/core/forms/models';
18
20
  import { SdPatternCommons } from '@sd-angular/core/utilities/models';
19
21
  import { Subscription } from 'rxjs';
20
22
  import * as uuid from 'uuid';
21
- import { SdLabel } from '@sd-angular/core/forms/label';
22
- import { SdEmptyPipe } from '@sd-angular/core/pipes';
23
23
 
24
- /* eslint-disable @typescript-eslint/no-explicit-any */
25
- /* eslint-disable @angular-eslint/no-input-rename */
26
- // eslint-disable-next-line @angular-eslint/component-class-suffix
27
24
  class SdInput {
28
- ref;
29
- formConfig;
30
25
  id = `I${uuid.v4()}`;
31
- autoId;
32
- set _autoId(val) {
33
- if (!val) {
34
- return;
35
- }
36
- this.autoId = `forms-input-${val}`;
37
- }
38
- #name = uuid.v4();
39
- set _name(val) {
40
- if (val) {
41
- this.#name = val;
42
- }
43
- }
44
- appearance = 'outline';
45
- size = 'md';
46
- #form;
47
- set _form(val) {
48
- if (val) {
49
- if (val instanceof NgForm) {
50
- this.#form = val.form;
51
- }
52
- else {
53
- this.#form = val;
54
- }
55
- }
56
- }
57
- label;
58
- set _label(val) {
59
- this.label = val;
60
- }
61
- helperText;
62
- set _helperText(val) {
63
- this.helperText = val;
64
- }
65
- placeholder;
66
- set _placeholder(val) {
67
- this.placeholder = val;
68
- }
69
- type = 'text';
70
- hideInlineError = false;
71
- set _hideInlineError(val) {
72
- this.hideInlineError = val === '' || val;
73
- }
74
- #blurOnEnter = false;
75
- set _blurOnEnter(val) {
76
- this.#blurOnEnter = val === '' || val;
77
- }
78
- #model;
79
- set model(value) {
80
- if (this.#model !== value) {
81
- this.#model = value;
82
- this.formControl.setValue(value, {
83
- emitEvent: false,
84
- });
85
- }
86
- }
87
- modelChange = new EventEmitter();
88
- // Validator
89
- required = false;
90
- set _required(val) {
91
- this.required = val === '' || !!val;
92
- this.#updateValidator();
93
- }
94
- readonly = false;
95
- set _readonly(val) {
96
- this.readonly = val === '' || val;
97
- }
98
- minlength;
99
- set _minlength(val) {
100
- if (val === undefined || val === null) {
101
- this.minlength = undefined;
102
- }
103
- else {
104
- this.minlength = +val;
105
- }
106
- this.#updateValidator();
107
- }
108
- maxlength;
109
- set _maxlength(val) {
110
- if (val === undefined || val === null) {
111
- this.maxlength = undefined;
112
- }
113
- else {
114
- this.maxlength = +val;
115
- }
116
- this.#updateValidator();
117
- }
118
- #pattern;
119
- set _pattern(val) {
120
- const pattern = SdPatternCommons.find(e => e.type === val);
121
- if (pattern) {
122
- this.#pattern = pattern.regex;
123
- this.patternErrorMessage = pattern.errorMessage;
124
- }
125
- else {
126
- this.#pattern = val ?? undefined;
127
- }
128
- this.#updateValidator();
129
- }
130
- patternErrorMessage;
131
- set _patternErrorMessage(val) {
132
- this.patternErrorMessage = val ?? this.patternErrorMessage;
133
- }
134
- #validator;
135
- set _validator(value) {
136
- this.#validator = value;
137
- this.#updateValidator();
138
- }
139
- inlineError;
140
- set _inlineError(val) {
141
- this.inlineError = val;
142
- this.#updateValidator();
143
- }
144
- // Optional
145
- set disabled(val) {
146
- val = val === '' || val;
147
- if (val) {
148
- this.formControl.disable();
149
- }
150
- else {
151
- this.formControl.enable();
152
- }
153
- }
154
- viewed = false;
155
- set _viewed(val) {
156
- this.viewed = val === '' || !!val;
157
- }
158
- hyperlink;
159
- tooltip;
160
- sdChange = new EventEmitter();
161
- sdFocus = new EventEmitter();
162
- sdBlur = new EventEmitter();
26
+ // ==========================================
27
+ // 1. SIGNAL QUERIES (Thay thế @ViewChild / @ContentChild)
28
+ // ==========================================
29
+ control = viewChild('control');
30
+ sdLabelTemplate = contentChild('sdLabel');
31
+ sdValueTemplate = contentChild('sdValue');
32
+ sdSuffixDef = contentChild(SdSuffixDefDirective);
33
+ sdViewDef = contentChild(SdViewDefDirective);
34
+ // ==========================================
35
+ // 2. SIGNAL INPUTS & MODEL
36
+ // ==========================================
37
+ autoIdInput = input(undefined, { alias: 'autoId' });
38
+ autoId = computed(() => (this.autoIdInput() ? `forms-input-${this.autoIdInput()}` : undefined));
39
+ name = input(uuid.v4());
40
+ // ==========================================
41
+ // 3. INJECT (Thay thế Constructor DI)
42
+ // ==========================================
43
+ #ref = inject(ChangeDetectorRef);
44
+ #formConfig = inject(SD_FORM_CONFIGURATION, { optional: true });
45
+ appearanceInput = input(undefined, { alias: 'appearance' });
46
+ appearance = computed(() => this.appearanceInput() ?? this.#formConfig?.appearance ?? 'outline');
47
+ floatLabel = input('auto');
48
+ size = input('md');
49
+ // Ghi (TransformT): any (để không bị lỗi typing khi cha truyền vào)
50
+ form = input(undefined, {
51
+ transform: (val) => {
52
+ if (!val)
53
+ return undefined;
54
+ // Nếu cha truyền vào NgForm (template-driven) -> Bóc lấy FormGroup bên trong
55
+ if (val instanceof NgForm)
56
+ return val.form;
57
+ // Nếu cha truyền sẵn FormGroup (reactive) -> Lấy luôn
58
+ if (val instanceof FormGroup)
59
+ return val;
60
+ // Fallback an toàn phòng trường hợp cha truyền 1 object chứa form
61
+ if (val?.form instanceof FormGroup)
62
+ return val.form;
63
+ return undefined;
64
+ },
65
+ });
66
+ label = input();
67
+ helperText = input();
68
+ placeholder = input();
69
+ type = input('text');
70
+ hideInlineError = input(false, { transform: booleanAttribute });
71
+ blurOnEnter = input(false, { transform: booleanAttribute });
72
+ required = input(false, { transform: booleanAttribute });
73
+ readonly = input(false, { transform: booleanAttribute });
74
+ disabled = input(false, { transform: booleanAttribute });
75
+ viewed = input(false, { transform: booleanAttribute });
76
+ minlength = input(undefined, { transform: v => (v == null ? undefined : Number(v)) });
77
+ maxlength = input(undefined, { transform: v => (v == null ? undefined : Number(v)) });
78
+ pattern = input();
79
+ patternErrorMessage = input();
80
+ resolvedPattern = computed(() => {
81
+ const val = this.pattern();
82
+ const patternObj = SdPatternCommons.find(e => e.type === val);
83
+ return patternObj ? patternObj.regex : (val ?? undefined);
84
+ });
85
+ resolvedPatternErrorMsg = computed(() => {
86
+ const val = this.pattern();
87
+ const patternObj = SdPatternCommons.find(e => e.type === val);
88
+ return this.patternErrorMessage() ?? (patternObj ? patternObj.errorMessage : undefined);
89
+ });
90
+ validator = input();
91
+ inlineError = input();
92
+ hyperlink = input();
93
+ tooltip = input();
94
+ valueModel = model(undefined, { alias: 'model' });
95
+ // ==========================================
96
+ // 4. SIGNAL OUTPUTS (Thay thế @Output)
97
+ // ==========================================
98
+ sdChange = output();
99
+ sdFocus = output(); // Đổi sang void vì không truyền data
100
+ sdBlur = output();
101
+ keyupEnter = output();
102
+ // 🚨 GIỮ LẠI EVENT_EMITTER DUY NHẤT VÌ CẦN CHECK OBSERVERED
163
103
  sdFocusForceBlur = new EventEmitter();
164
- keyupEnter = new EventEmitter();
165
- control;
166
- sdSuffixDef;
167
- sdLabelDef;
168
- sdViewDef;
169
104
  formControl = new SdFormControl();
170
105
  #subscription = new Subscription();
171
106
  isFocused = false;
172
- constructor(ref, formConfig) {
173
- this.ref = ref;
174
- this.formConfig = formConfig;
107
+ constructor() {
108
+ effect(() => {
109
+ const val = this.valueModel();
110
+ untracked(() => {
111
+ if (this.formControl.value !== val) {
112
+ this.formControl.setValue(val, { emitEvent: false });
113
+ }
114
+ });
115
+ });
116
+ effect(() => {
117
+ if (this.disabled()) {
118
+ this.formControl.disable({ emitEvent: false });
119
+ }
120
+ else {
121
+ this.formControl.enable({ emitEvent: false });
122
+ }
123
+ });
124
+ effect(() => {
125
+ const req = this.required();
126
+ const min = this.minlength();
127
+ const max = this.maxlength();
128
+ const pat = this.resolvedPattern();
129
+ const inl = this.inlineError();
130
+ const val = this.validator();
131
+ untracked(() => {
132
+ this.#updateValidator(req, min, max, pat, inl, val);
133
+ });
134
+ });
175
135
  }
176
136
  ngOnInit() {
177
- this.appearance = this.appearance || this.formConfig?.appearance;
178
137
  this.#subscription.add(this.formControl.sdChanges.subscribe(() => {
179
- this.ref.markForCheck();
138
+ this.#ref.markForCheck();
180
139
  }));
181
140
  }
182
141
  ngAfterViewInit() {
183
142
  this.#subscription.add(this.formControl.valueChanges.subscribe(this.#onChange));
184
- this.#form?.addControl(this.#name, this.formControl);
185
- this.ref.detectChanges();
143
+ const formGroup = this.form();
144
+ formGroup?.addControl(this.name(), this.formControl);
145
+ this.#ref.detectChanges();
186
146
  }
187
147
  ngOnDestroy() {
188
- this.#form?.removeControl(this.#name);
148
+ const formGroup = this.form();
149
+ formGroup?.removeControl(this.name());
189
150
  this.#subscription.unsubscribe();
190
151
  }
191
152
  reValidate = () => {
192
153
  this.formControl.updateValueAndValidity();
193
154
  };
194
- #updateValidator = () => {
195
- this.formControl.clearValidators();
196
- this.formControl.clearAsyncValidators();
155
+ #updateValidator = (req, min, max, pat, inl, val) => {
197
156
  const validators = [];
198
157
  const asyncValidators = [];
199
- if (this.required) {
158
+ if (req)
200
159
  validators.push(Validators.required);
201
- }
202
- if (this.minlength !== undefined && this.minlength > 0) {
203
- validators.push(Validators.minLength(this.minlength));
204
- }
205
- if (this.maxlength !== undefined && this.maxlength > 0) {
206
- validators.push(Validators.maxLength(this.maxlength));
207
- }
208
- if (this.#pattern) {
209
- validators.push(Validators.pattern(this.#pattern));
210
- }
211
- if (this.inlineError) {
160
+ if (min && min > 0)
161
+ validators.push(Validators.minLength(min));
162
+ if (max && max > 0)
163
+ validators.push(Validators.maxLength(max));
164
+ if (pat)
165
+ validators.push(Validators.pattern(pat));
166
+ if (inl)
212
167
  validators.push(this.customInlineErrorValidator());
213
- }
214
- if (this.#validator) {
215
- asyncValidators.push(HandleSdCustomValidator(this.#validator));
216
- }
217
- this.formControl.setValidators(validators);
218
- this.formControl.setAsyncValidators(asyncValidators);
219
- this.formControl.updateValueAndValidity();
168
+ if (val)
169
+ asyncValidators.push(HandleSdCustomValidator(val));
170
+ this.formControl.setValidators(validators.length ? validators : null);
171
+ this.formControl.setAsyncValidators(asyncValidators.length ? asyncValidators : null);
172
+ this.formControl.updateValueAndValidity({ emitEvent: false });
220
173
  };
221
- // Hàm tạo Validators tùy chỉnh cho inlineError
222
174
  customInlineErrorValidator() {
223
- return () => {
224
- return { inlineError: true };
225
- };
175
+ return () => ({ inlineError: true });
226
176
  }
227
177
  #onChange = () => {
228
- this.modelChange.emit(this.formControl.value);
229
- this.sdChange.emit(this.formControl.value);
178
+ const value = this.formControl.value ?? '';
179
+ this.valueModel.set(value);
180
+ this.sdChange.emit(value);
230
181
  };
231
182
  onKeyupEnter = () => {
232
183
  const val = (this.formControl.value ?? '').toString();
@@ -234,14 +185,14 @@ class SdInput {
234
185
  this.formControl.setValue(val.trim());
235
186
  }
236
187
  this.keyupEnter.emit(this.formControl.value);
237
- if (this.#blurOnEnter) {
188
+ if (this.blurOnEnter()) {
238
189
  this.blur();
239
190
  }
240
191
  };
241
192
  onFocus = () => {
242
193
  this.isFocused = true;
243
- this.sdFocus.emit();
244
- if (this.sdFocusForceBlur.observers?.length > 0) {
194
+ this.sdFocus.emit(); // Gọi .emit() y hệt như cũ
195
+ if (this.sdFocusForceBlur.observed) {
245
196
  this.blur();
246
197
  this.sdFocusForceBlur.emit();
247
198
  }
@@ -255,7 +206,8 @@ class SdInput {
255
206
  this.sdBlur.emit(this.formControl.value);
256
207
  };
257
208
  onClick = () => {
258
- if (this.sdViewDef?.templateRef) {
209
+ // 🚨 GỌI SIGNAL: Phải thêm () vào sdViewDef
210
+ if (this.sdViewDef()?.templateRef) {
259
211
  if (!this.formControl.disabled && !this.isFocused) {
260
212
  this.focus();
261
213
  }
@@ -263,16 +215,18 @@ class SdInput {
263
215
  };
264
216
  blur = () => {
265
217
  this.isFocused = false;
266
- this.control?.nativeElement?.blur();
218
+ // 🚨 GỌI SIGNAL: Phải thêm () vào control
219
+ this.control()?.nativeElement?.blur();
267
220
  };
268
221
  focus = () => {
269
222
  this.isFocused = true;
270
223
  setTimeout(() => {
271
- this.control?.nativeElement?.focus();
224
+ // 🚨 GỌI SIGNAL: Phải thêm () vào control
225
+ this.control()?.nativeElement?.focus();
272
226
  }, 100);
273
227
  };
274
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdInput, deps: [{ token: i0.ChangeDetectorRef }, { token: SD_FORM_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
275
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdInput, isStandalone: true, selector: "sd-input", inputs: { _autoId: ["autoId", "_autoId"], _name: ["name", "_name"], appearance: "appearance", size: "size", _form: ["form", "_form"], _label: ["label", "_label"], _helperText: ["helperText", "_helperText"], _placeholder: ["placeholder", "_placeholder"], type: "type", _hideInlineError: ["hideInlineError", "_hideInlineError"], _blurOnEnter: ["blurOnEnter", "_blurOnEnter"], model: "model", _required: ["required", "_required"], _readonly: ["readonly", "_readonly"], _minlength: ["minlength", "_minlength"], _maxlength: ["maxlength", "_maxlength"], _pattern: ["pattern", "_pattern"], _patternErrorMessage: ["patternErrorMessage", "_patternErrorMessage"], _validator: ["validator", "_validator"], _inlineError: ["inlineError", "_inlineError"], disabled: "disabled", _viewed: ["viewed", "_viewed"], hyperlink: "hyperlink", tooltip: "tooltip" }, outputs: { modelChange: "modelChange", sdChange: "sdChange", sdFocus: "sdFocus", sdBlur: "sdBlur", sdFocusForceBlur: "sdFocusForceBlur", keyupEnter: "keyupEnter" }, queries: [{ propertyName: "sdSuffixDef", first: true, predicate: SdSuffixDefDirective, descendants: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true }, { propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true }], viewQueries: [{ propertyName: "control", first: true, predicate: ["control"], descendants: true }], ngImport: i0, template: "@if (viewed) {\r\n @if (sdLabelDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef!.templateRef\"> </ng-container>\r\n } @else if (label) {\r\n <div class=\"text-secondary\">{{ label }}</div>\r\n }\r\n @if (hyperlink) {\r\n <!-- N\u1EBFu c\u00F3 hyperlink th\u00EC d\u00F9ng th\u1EBB a -->\r\n <a [href]=\"hyperlink\">{{ formControl.value }}</a>\r\n } @else {\r\n <!-- Ngo\u00E0i ra d\u00F9ng th\u1EBB m\u1EB7c \u0111\u1ECBnh -->\r\n <div class=\"T16M\">{{ formControl.value | sdEmpty }}</div>\r\n }\r\n} @else {\r\n @if (!appearance && sdLabelDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef!.templateRef\"> </ng-container>\r\n }\r\n @if (!appearance && label && !sdLabelDef?.templateRef) {\r\n <sd-label [label]=\"label\" [required]=\"required\"></sd-label>\r\n }\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!sdViewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n @if (sdViewDef?.templateRef && !isFocused) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n sdViewDef!.templateRef;\r\n context: {\r\n value: formControl.value\r\n }\r\n \">\r\n </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 [class.sd-form-tooltip]=\"!!tooltip\"\r\n [appearance]=\"appearance\">\r\n @if (appearance && label) {\r\n <mat-label style=\"display: inline-block\">\r\n <div style=\"display: flex; align-items: center; gap: 4px\">\r\n <span>{{ label }}</span>\r\n @if (helperText) {\r\n <mat-icon [matTooltip]=\"helperText\" matTooltipPosition=\"below\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id\"\r\n [formControl]=\"formControl\"\r\n [type]=\"type\"\r\n #control\r\n matInput\r\n [placeholder]=\"placeholder || label || ''\"\r\n (keyup.enter)=\"onKeyupEnter()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"required\"\r\n [readonly]=\"readonly\"\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [step]=\"1\"\r\n [attr.data-autoId]=\"autoId\" />\r\n @if (maxlength && !formControl.disabled) {\r\n <span matSuffix>{{ formControl.value?.length || 0 }}/{{ maxlength }}</span>\r\n }\r\n @if (sdSuffixDef?.templateRef) {\r\n <ng-container matSuffix>\r\n <ng-container *ngTemplateOutlet=\"sdSuffixDef!.templateRef\"></ng-container>\r\n </ng-container>\r\n }\r\n @if (formControl.errors?.['required']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Vui l\u00F2ng nh\u1EADp th\u00F4ng tin' }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['maxlength']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'S\u1ED1 k\u00FD t\u1EF1 t\u1ED1i \u0111a: ' }} {{ maxlength }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['pattern']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ patternErrorMessage || '\u0110\u1ECBnh d\u1EA1ng kh\u00F4ng h\u1EE3p l\u1EC7' }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['customValidator']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['inlineError']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ inlineError }}\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n <div *ngIf=\"tooltip\" class=\"sd-tooltip\">\r\n <mat-icon (click)=\"sdTooltip.toggle()\" [matTooltip]=\"formControl.value || tooltip\" matSuffix #sdTooltip=\"matTooltip\">info</mat-icon>\r\n </div>\r\n }\r\n </div>\r\n}\r\n", styles: [".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-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-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-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-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-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-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!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}:host ::ng-deep .mat-mdc-form-field.sd-form-tooltip{width:calc(100% - 30px)}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}.sd-tooltip{display:inline-block;text-align:center;margin:auto;width:30px}:host{padding-top:5px;display:block}.sd-md:hover .btn-copy{visibility:visible}\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: MatFormFieldModule }, { 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: MatInputModule }, { kind: "directive", type: i4.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: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "pipe", type: SdEmptyPipe, name: "sdEmpty" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
228
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
229
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdInput, isStandalone: true, selector: "sd-input", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, appearanceInput: { classPropertyName: "appearanceInput", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, hideInlineError: { classPropertyName: "hideInlineError", publicName: "hideInlineError", isSignal: true, isRequired: false, transformFunction: null }, blurOnEnter: { classPropertyName: "blurOnEnter", publicName: "blurOnEnter", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", 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 }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "pattern", isSignal: true, isRequired: false, transformFunction: null }, patternErrorMessage: { classPropertyName: "patternErrorMessage", publicName: "patternErrorMessage", isSignal: true, isRequired: false, transformFunction: null }, validator: { classPropertyName: "validator", publicName: "validator", isSignal: true, isRequired: false, transformFunction: null }, inlineError: { classPropertyName: "inlineError", publicName: "inlineError", isSignal: true, isRequired: false, transformFunction: null }, hyperlink: { classPropertyName: "hyperlink", publicName: "hyperlink", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, valueModel: { classPropertyName: "valueModel", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueModel: "modelChange", sdChange: "sdChange", sdFocus: "sdFocus", sdBlur: "sdBlur", keyupEnter: "keyupEnter", sdFocusForceBlur: "sdFocusForceBlur" }, queries: [{ propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true, isSignal: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true, isSignal: true }, { propertyName: "sdSuffixDef", first: true, predicate: SdSuffixDefDirective, descendants: true, isSignal: true }, { propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "control", first: true, predicate: ["control"], descendants: true, isSignal: true }], ngImport: i0, template: "@let lbl = label();\r\n@let app = appearance();\r\n@let hideErr = hideInlineError();\r\n@let viewDef = sdViewDef();\r\n@let hText = helperText();\r\n@let ttip = tooltip();\r\n@let maxLen = maxlength();\r\n@let req = required();\r\n\r\n@if (viewed()) {\r\n <sd-view\r\n [label]=\"lbl\"\r\n [labelTemplate]=\"sdLabelTemplate()\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"sdValueTemplate()\">\r\n </sd-view>\r\n} @else {\r\n @if (!app) {\r\n <ng-content select=\"[sdLabel]\">\r\n @if (lbl) {\r\n <sd-label [label]=\"lbl\" [required]=\"req\"></sd-label>\r\n }\r\n </ng-content>\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 (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n \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 [class.sd-form-tooltip]=\"!!ttip\"\r\n [appearance]=\"app!\"\r\n [floatLabel]=\"floatLabel()\">\r\n \r\n @if (app && lbl) {\r\n <mat-label style=\"display: inline-block\">\r\n <div style=\"display: flex; align-items: center; gap: 4px\">\r\n <span>{{ lbl }}</span>\r\n @if (hText) {\r\n <mat-icon [matTooltip]=\"hText\" matTooltipPosition=\"below\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n \r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id\"\r\n [formControl]=\"formControl\"\r\n [type]=\"type()\"\r\n #control\r\n matInput\r\n [placeholder]=\"placeholder() || lbl || ''\"\r\n (keyup.enter)=\"onKeyupEnter()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"req\"\r\n [readonly]=\"readonly()\"\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [step]=\"1\"\r\n [attr.data-autoId]=\"autoId()\" />\r\n\r\n @if (maxLen && !formControl.disabled) {\r\n <span matSuffix>{{ formControl.value?.length || 0 }}/{{ maxLen }}</span>\r\n }\r\n\r\n @if (sdSuffixDef()?.templateRef; as suffixRef) {\r\n <ng-container matSuffix>\r\n <ng-container *ngTemplateOutlet=\"suffixRef\"></ng-container>\r\n </ng-container>\r\n }\r\n\r\n @if (formControl.errors?.['required']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Vui l\u00F2ng nh\u1EADp th\u00F4ng tin' }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['maxlength']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'S\u1ED1 k\u00FD t\u1EF1 t\u1ED1i \u0111a: ' }} {{ maxLen }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['pattern']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ resolvedPatternErrorMsg() || '\u0110\u1ECBnh d\u1EA1ng kh\u00F4ng h\u1EE3p l\u1EC7' }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['customValidator']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['inlineError']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ inlineError() }}\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n \r\n @if (ttip) {\r\n <div class=\"sd-tooltip\">\r\n <mat-icon (click)=\"sdTooltip.toggle()\" [matTooltip]=\"formControl.value || ttip\" matSuffix #sdTooltip=\"matTooltip\">info</mat-icon>\r\n </div>\r\n }\r\n }\r\n </div>\r\n}", styles: [".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-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-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-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-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-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-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!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}:host ::ng-deep .mat-mdc-form-field.sd-form-tooltip{width:calc(100% - 30px)}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}.sd-tooltip{display:inline-block;text-align:center;margin:auto;width:30px}:host{padding-top:5px;display:block}.sd-md:hover .btn-copy{visibility:visible}\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: MatFormFieldModule }, { 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: MatInputModule }, { kind: "directive", type: i4.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: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
276
230
  }
277
231
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdInput, decorators: [{
278
232
  type: Component,
@@ -286,102 +240,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
286
240
  MatTooltipModule,
287
241
  MatButtonModule,
288
242
  SdLabel,
289
- SdEmptyPipe,
290
- ], template: "@if (viewed) {\r\n @if (sdLabelDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef!.templateRef\"> </ng-container>\r\n } @else if (label) {\r\n <div class=\"text-secondary\">{{ label }}</div>\r\n }\r\n @if (hyperlink) {\r\n <!-- N\u1EBFu c\u00F3 hyperlink th\u00EC d\u00F9ng th\u1EBB a -->\r\n <a [href]=\"hyperlink\">{{ formControl.value }}</a>\r\n } @else {\r\n <!-- Ngo\u00E0i ra d\u00F9ng th\u1EBB m\u1EB7c \u0111\u1ECBnh -->\r\n <div class=\"T16M\">{{ formControl.value | sdEmpty }}</div>\r\n }\r\n} @else {\r\n @if (!appearance && sdLabelDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef!.templateRef\"> </ng-container>\r\n }\r\n @if (!appearance && label && !sdLabelDef?.templateRef) {\r\n <sd-label [label]=\"label\" [required]=\"required\"></sd-label>\r\n }\r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"!!sdViewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n @if (sdViewDef?.templateRef && !isFocused) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n sdViewDef!.templateRef;\r\n context: {\r\n value: formControl.value\r\n }\r\n \">\r\n </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 [class.sd-form-tooltip]=\"!!tooltip\"\r\n [appearance]=\"appearance\">\r\n @if (appearance && label) {\r\n <mat-label style=\"display: inline-block\">\r\n <div style=\"display: flex; align-items: center; gap: 4px\">\r\n <span>{{ label }}</span>\r\n @if (helperText) {\r\n <mat-icon [matTooltip]=\"helperText\" matTooltipPosition=\"below\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id\"\r\n [formControl]=\"formControl\"\r\n [type]=\"type\"\r\n #control\r\n matInput\r\n [placeholder]=\"placeholder || label || ''\"\r\n (keyup.enter)=\"onKeyupEnter()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"required\"\r\n [readonly]=\"readonly\"\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [step]=\"1\"\r\n [attr.data-autoId]=\"autoId\" />\r\n @if (maxlength && !formControl.disabled) {\r\n <span matSuffix>{{ formControl.value?.length || 0 }}/{{ maxlength }}</span>\r\n }\r\n @if (sdSuffixDef?.templateRef) {\r\n <ng-container matSuffix>\r\n <ng-container *ngTemplateOutlet=\"sdSuffixDef!.templateRef\"></ng-container>\r\n </ng-container>\r\n }\r\n @if (formControl.errors?.['required']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Vui l\u00F2ng nh\u1EADp th\u00F4ng tin' }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['maxlength']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'S\u1ED1 k\u00FD t\u1EF1 t\u1ED1i \u0111a: ' }} {{ maxlength }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['pattern']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ patternErrorMessage || '\u0110\u1ECBnh d\u1EA1ng kh\u00F4ng h\u1EE3p l\u1EC7' }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['customValidator']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['inlineError']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ inlineError }}\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n <div *ngIf=\"tooltip\" class=\"sd-tooltip\">\r\n <mat-icon (click)=\"sdTooltip.toggle()\" [matTooltip]=\"formControl.value || tooltip\" matSuffix #sdTooltip=\"matTooltip\">info</mat-icon>\r\n </div>\r\n }\r\n </div>\r\n}\r\n", styles: [".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-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-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-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-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-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-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!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}:host ::ng-deep .mat-mdc-form-field.sd-form-tooltip{width:calc(100% - 30px)}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}.sd-tooltip{display:inline-block;text-align:center;margin:auto;width:30px}:host{padding-top:5px;display:block}.sd-md:hover .btn-copy{visibility:visible}\n"] }]
291
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
292
- type: Inject,
293
- args: [SD_FORM_CONFIGURATION]
294
- }, {
295
- type: Optional
296
- }] }], propDecorators: { _autoId: [{
297
- type: Input,
298
- args: ['autoId']
299
- }], _name: [{
300
- type: Input,
301
- args: ['name']
302
- }], appearance: [{
303
- type: Input
304
- }], size: [{
305
- type: Input
306
- }], _form: [{
307
- type: Input,
308
- args: ['form']
309
- }], _label: [{
310
- type: Input,
311
- args: ['label']
312
- }], _helperText: [{
313
- type: Input,
314
- args: ['helperText']
315
- }], _placeholder: [{
316
- type: Input,
317
- args: ['placeholder']
318
- }], type: [{
319
- type: Input
320
- }], _hideInlineError: [{
321
- type: Input,
322
- args: ['hideInlineError']
323
- }], _blurOnEnter: [{
324
- type: Input,
325
- args: ['blurOnEnter']
326
- }], model: [{
327
- type: Input
328
- }], modelChange: [{
329
- type: Output
330
- }], _required: [{
331
- type: Input,
332
- args: ['required']
333
- }], _readonly: [{
334
- type: Input,
335
- args: ['readonly']
336
- }], _minlength: [{
337
- type: Input,
338
- args: ['minlength']
339
- }], _maxlength: [{
340
- type: Input,
341
- args: ['maxlength']
342
- }], _pattern: [{
343
- type: Input,
344
- args: ['pattern']
345
- }], _patternErrorMessage: [{
346
- type: Input,
347
- args: ['patternErrorMessage']
348
- }], _validator: [{
349
- type: Input,
350
- args: ['validator']
351
- }], _inlineError: [{
352
- type: Input,
353
- args: ['inlineError']
354
- }], disabled: [{
355
- type: Input
356
- }], _viewed: [{
357
- type: Input,
358
- args: ['viewed']
359
- }], hyperlink: [{
360
- type: Input
361
- }], tooltip: [{
362
- type: Input
363
- }], sdChange: [{
364
- type: Output
365
- }], sdFocus: [{
366
- type: Output
367
- }], sdBlur: [{
368
- type: Output
369
- }], sdFocusForceBlur: [{
370
- type: Output
371
- }], keyupEnter: [{
243
+ SdView,
244
+ ], template: "@let lbl = label();\r\n@let app = appearance();\r\n@let hideErr = hideInlineError();\r\n@let viewDef = sdViewDef();\r\n@let hText = helperText();\r\n@let ttip = tooltip();\r\n@let maxLen = maxlength();\r\n@let req = required();\r\n\r\n@if (viewed()) {\r\n <sd-view\r\n [label]=\"lbl\"\r\n [labelTemplate]=\"sdLabelTemplate()\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"sdValueTemplate()\">\r\n </sd-view>\r\n} @else {\r\n @if (!app) {\r\n <ng-content select=\"[sdLabel]\">\r\n @if (lbl) {\r\n <sd-label [label]=\"lbl\" [required]=\"req\"></sd-label>\r\n }\r\n </ng-content>\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 (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n \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 [class.sd-form-tooltip]=\"!!ttip\"\r\n [appearance]=\"app!\"\r\n [floatLabel]=\"floatLabel()\">\r\n \r\n @if (app && lbl) {\r\n <mat-label style=\"display: inline-block\">\r\n <div style=\"display: flex; align-items: center; gap: 4px\">\r\n <span>{{ lbl }}</span>\r\n @if (hText) {\r\n <mat-icon [matTooltip]=\"hText\" matTooltipPosition=\"below\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n \r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id\"\r\n [formControl]=\"formControl\"\r\n [type]=\"type()\"\r\n #control\r\n matInput\r\n [placeholder]=\"placeholder() || lbl || ''\"\r\n (keyup.enter)=\"onKeyupEnter()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [required]=\"req\"\r\n [readonly]=\"readonly()\"\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [step]=\"1\"\r\n [attr.data-autoId]=\"autoId()\" />\r\n\r\n @if (maxLen && !formControl.disabled) {\r\n <span matSuffix>{{ formControl.value?.length || 0 }}/{{ maxLen }}</span>\r\n }\r\n\r\n @if (sdSuffixDef()?.templateRef; as suffixRef) {\r\n <ng-container matSuffix>\r\n <ng-container *ngTemplateOutlet=\"suffixRef\"></ng-container>\r\n </ng-container>\r\n }\r\n\r\n @if (formControl.errors?.['required']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Vui l\u00F2ng nh\u1EADp th\u00F4ng tin' }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['maxlength']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'S\u1ED1 k\u00FD t\u1EF1 t\u1ED1i \u0111a: ' }} {{ maxLen }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['pattern']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ resolvedPatternErrorMsg() || '\u0110\u1ECBnh d\u1EA1ng kh\u00F4ng h\u1EE3p l\u1EC7' }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['customValidator']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['inlineError']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ inlineError() }}\r\n }\r\n </mat-error>\r\n }\r\n </mat-form-field>\r\n \r\n @if (ttip) {\r\n <div class=\"sd-tooltip\">\r\n <mat-icon (click)=\"sdTooltip.toggle()\" [matTooltip]=\"formControl.value || ttip\" matSuffix #sdTooltip=\"matTooltip\">info</mat-icon>\r\n </div>\r\n }\r\n }\r\n </div>\r\n}", styles: [".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-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-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-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-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-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-light{color:var(--sd-light)!important}.bg-light{background:var(--sd-light)!important}.border-light{border-color:var(--sd-light)!important}.text-dark{color:var(--sd-dark)!important}.bg-dark{background:var(--sd-dark)!important}.border-dark{border-color:var(--sd-dark)!important}.text-black500{color:var(--sd-black500)!important}.bg-black500{background:var(--sd-black500)!important}.border-black500{border-color:var(--sd-black500)!important}.text-black400{color:var(--sd-black400)!important}.bg-black400{background:var(--sd-black400)!important}.border-black400{border-color:var(--sd-black400)!important}.text-black300{color:var(--sd-black300)!important}.bg-black300{background:var(--sd-black300)!important}.border-black300{border-color:var(--sd-black300)!important}.text-black200{color:var(--sd-black200)!important}.bg-black200{background:var(--sd-black200)!important}.border-black200{border-color:var(--sd-black200)!important}.text-black100{color:var(--sd-black100)!important}.bg-black100{background:var(--sd-black100)!important}.border-black100{border-color:var(--sd-black100)!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}:host ::ng-deep .mat-mdc-form-field.sd-form-tooltip{width:calc(100% - 30px)}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}.sd-tooltip{display:inline-block;text-align:center;margin:auto;width:30px}:host{padding-top:5px;display:block}.sd-md:hover .btn-copy{visibility:visible}\n"] }]
245
+ }], ctorParameters: () => [], propDecorators: { sdFocusForceBlur: [{
372
246
  type: Output
373
- }], control: [{
374
- type: ViewChild,
375
- args: ['control']
376
- }], sdSuffixDef: [{
377
- type: ContentChild,
378
- args: [SdSuffixDefDirective]
379
- }], sdLabelDef: [{
380
- type: ContentChild,
381
- args: [SdLabelDefDirective]
382
- }], sdViewDef: [{
383
- type: ContentChild,
384
- args: [SdViewDefDirective]
385
247
  }] } });
386
248
  function backendErrorValidator(backendErrorMessage) {
387
249
  return (control) => {