@sd-angular/core 19.0.0-beta.4 → 19.0.0-beta.41

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 (177) hide show
  1. package/assets/scss/ckeditor5.scss +60 -2
  2. package/assets/scss/core/bootstrap.scss +17 -0
  3. package/assets/scss/core/grid.scss +40 -0
  4. package/assets/scss/sd-core.scss +1 -0
  5. package/components/avatar/index.d.ts +1 -0
  6. package/components/avatar/src/avatar.component.d.ts +15 -0
  7. package/components/badge/src/badge.component.d.ts +77 -19
  8. package/components/button/src/button.component.d.ts +26 -28
  9. package/components/document-builder/index.d.ts +1 -0
  10. package/components/document-builder/src/document-builder.component.d.ts +20 -37
  11. package/components/document-builder/src/document-builder.model.d.ts +11 -10
  12. package/components/document-builder/src/plugins/block-space/block-space.plugin.d.ts +9 -0
  13. package/components/document-builder/src/plugins/ck-comment/ck-comment.plugin.d.ts +43 -0
  14. package/components/document-builder/src/plugins/ck-comment/ck-comment.plugin.model.d.ts +50 -0
  15. package/components/document-builder/src/plugins/heading/heading.plugin.d.ts +5 -0
  16. package/components/document-builder/src/plugins/highlight-range/highlight-range.plugin.d.ts +4 -0
  17. package/components/document-builder/src/plugins/image-custom/image-custom.plugin.d.ts +31 -0
  18. package/components/document-builder/src/plugins/{image-upload.plugin.d.ts → image-upload/image-upload.plugin.d.ts} +0 -4
  19. package/components/document-builder/src/plugins/index.d.ts +11 -5
  20. package/components/document-builder/src/plugins/{page-orientation.plugin.d.ts → page-orientation/page-orientation.plugin.d.ts} +2 -2
  21. package/components/document-builder/src/plugins/paste-handler/filters/bookmark.d.ts +14 -0
  22. package/components/document-builder/src/plugins/paste-handler/filters/br.d.ts +15 -0
  23. package/components/document-builder/src/plugins/paste-handler/filters/image.d.ts +25 -0
  24. package/components/document-builder/src/plugins/paste-handler/filters/list.d.ts +29 -0
  25. package/components/document-builder/src/plugins/paste-handler/filters/parse.d.ts +35 -0
  26. package/components/document-builder/src/plugins/paste-handler/filters/removeboldwrapper.d.ts +15 -0
  27. package/components/document-builder/src/plugins/paste-handler/filters/removegooglesheetstag.d.ts +15 -0
  28. package/components/document-builder/src/plugins/paste-handler/filters/removeinvalidtablewidth.d.ts +15 -0
  29. package/components/document-builder/src/plugins/paste-handler/filters/removemsattributes.d.ts +15 -0
  30. package/components/document-builder/src/plugins/paste-handler/filters/removestyleblock.d.ts +15 -0
  31. package/components/document-builder/src/plugins/paste-handler/filters/removexmlns.d.ts +15 -0
  32. package/components/document-builder/src/plugins/paste-handler/filters/replacemsfootnotes.d.ts +54 -0
  33. package/components/document-builder/src/plugins/paste-handler/filters/replacetabswithinprewithspaces.d.ts +24 -0
  34. package/components/document-builder/src/plugins/paste-handler/filters/space.d.ts +27 -0
  35. package/components/document-builder/src/plugins/paste-handler/filters/table.d.ts +16 -0
  36. package/components/document-builder/src/plugins/paste-handler/filters/utils.d.ts +25 -0
  37. package/components/document-builder/src/plugins/paste-handler/index.d.ts +35 -0
  38. package/components/document-builder/src/plugins/paste-handler/normalizers/googledocsnormalizer.d.ts +31 -0
  39. package/components/document-builder/src/plugins/paste-handler/normalizers/googlesheetsnormalizer.d.ts +31 -0
  40. package/components/document-builder/src/plugins/paste-handler/normalizers/mswordnormalizer.d.ts +29 -0
  41. package/components/document-builder/src/plugins/paste-handler/types.d.ts +30 -0
  42. package/components/document-builder/src/plugins/table-custom/index.d.ts +34 -0
  43. package/components/index.d.ts +3 -0
  44. package/components/mini-editor/index.d.ts +2 -0
  45. package/components/mini-editor/src/mini-editor.component.d.ts +90 -0
  46. package/components/mini-editor/src/mini-editor.model.d.ts +42 -0
  47. package/components/side-drawer/src/side-drawer.component.d.ts +1 -2
  48. package/components/table/src/components/selector-action/action-filter.pipe.d.ts +11 -10
  49. package/components/table/src/directives/index.d.ts +2 -0
  50. package/components/table/src/directives/sd-table-column-filter-def.directive.d.ts +9 -0
  51. package/components/table/src/directives/sticky-shadow.directive.d.ts +17 -0
  52. package/components/table/src/models/table-column.model.d.ts +32 -32
  53. package/components/table/src/models/table-command.model.d.ts +7 -3
  54. package/components/table/src/models/table-item.model.d.ts +5 -3
  55. package/components/table/src/models/table-option-export.model.d.ts +3 -2
  56. package/components/table/src/models/table-option-selector.model.d.ts +11 -10
  57. package/components/table/src/models/table-option.model.d.ts +10 -8
  58. package/components/table/src/services/table-filter/table-filter.model.d.ts +2 -2
  59. package/components/table/src/table.component.d.ts +33 -35
  60. package/components/view/index.d.ts +1 -0
  61. package/components/view/src/view.component.d.ts +16 -0
  62. package/components/workflow/src/models/index.d.ts +1 -0
  63. package/directives/index.d.ts +1 -0
  64. package/directives/src/sd-href.directive.d.ts +9 -0
  65. package/fesm2022/sd-angular-core-components-avatar.mjs +90 -0
  66. package/fesm2022/sd-angular-core-components-avatar.mjs.map +1 -0
  67. package/fesm2022/sd-angular-core-components-badge.mjs +102 -91
  68. package/fesm2022/sd-angular-core-components-badge.mjs.map +1 -1
  69. package/fesm2022/sd-angular-core-components-button.mjs +64 -96
  70. package/fesm2022/sd-angular-core-components-button.mjs.map +1 -1
  71. package/fesm2022/sd-angular-core-components-document-builder.mjs +3860 -963
  72. package/fesm2022/sd-angular-core-components-document-builder.mjs.map +1 -1
  73. package/fesm2022/sd-angular-core-components-history.mjs +1 -1
  74. package/fesm2022/sd-angular-core-components-history.mjs.map +1 -1
  75. package/fesm2022/sd-angular-core-components-import-excel.mjs +1 -1
  76. package/fesm2022/sd-angular-core-components-import-excel.mjs.map +1 -1
  77. package/fesm2022/sd-angular-core-components-mini-editor.mjs +326 -0
  78. package/fesm2022/sd-angular-core-components-mini-editor.mjs.map +1 -0
  79. package/fesm2022/sd-angular-core-components-preview.mjs +1 -1
  80. package/fesm2022/sd-angular-core-components-preview.mjs.map +1 -1
  81. package/fesm2022/sd-angular-core-components-side-drawer.mjs +21 -8
  82. package/fesm2022/sd-angular-core-components-side-drawer.mjs.map +1 -1
  83. package/fesm2022/sd-angular-core-components-tab-router.mjs +1 -1
  84. package/fesm2022/sd-angular-core-components-tab-router.mjs.map +1 -1
  85. package/fesm2022/sd-angular-core-components-table.mjs +724 -472
  86. package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
  87. package/fesm2022/sd-angular-core-components-upload-file.mjs +1 -1
  88. package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
  89. package/fesm2022/sd-angular-core-components-view.mjs +45 -0
  90. package/fesm2022/sd-angular-core-components-view.mjs.map +1 -0
  91. package/fesm2022/sd-angular-core-components-workflow.mjs +33 -43
  92. package/fesm2022/sd-angular-core-components-workflow.mjs.map +1 -1
  93. package/fesm2022/sd-angular-core-components.mjs +3 -0
  94. package/fesm2022/sd-angular-core-components.mjs.map +1 -1
  95. package/fesm2022/sd-angular-core-directives.mjs +80 -27
  96. package/fesm2022/sd-angular-core-directives.mjs.map +1 -1
  97. package/fesm2022/sd-angular-core-forms-autocomplete.mjs +257 -361
  98. package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
  99. package/fesm2022/sd-angular-core-forms-date-range.mjs +145 -245
  100. package/fesm2022/sd-angular-core-forms-date-range.mjs.map +1 -1
  101. package/fesm2022/sd-angular-core-forms-date.mjs +137 -271
  102. package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
  103. package/fesm2022/sd-angular-core-forms-datetime.mjs +138 -276
  104. package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
  105. package/fesm2022/sd-angular-core-forms-input-number.mjs +174 -336
  106. package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
  107. package/fesm2022/sd-angular-core-forms-input.mjs +130 -283
  108. package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
  109. package/fesm2022/sd-angular-core-forms-radio.mjs +5 -2
  110. package/fesm2022/sd-angular-core-forms-radio.mjs.map +1 -1
  111. package/fesm2022/sd-angular-core-forms-select.mjs +303 -419
  112. package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
  113. package/fesm2022/sd-angular-core-forms-textarea.mjs +133 -226
  114. package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
  115. package/fesm2022/sd-angular-core-modules-keycloak.mjs +126 -0
  116. package/fesm2022/sd-angular-core-modules-keycloak.mjs.map +1 -0
  117. package/fesm2022/sd-angular-core-modules-layout.mjs +54 -19
  118. package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
  119. package/fesm2022/sd-angular-core-modules.mjs +1 -1
  120. package/fesm2022/sd-angular-core-pipes.mjs +21 -1
  121. package/fesm2022/sd-angular-core-pipes.mjs.map +1 -1
  122. package/fesm2022/sd-angular-core-services-confirm.mjs +2 -2
  123. package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
  124. package/fesm2022/sd-angular-core-services-docx.mjs +173 -0
  125. package/fesm2022/sd-angular-core-services-docx.mjs.map +1 -0
  126. package/fesm2022/sd-angular-core-services-notify.mjs +2 -2
  127. package/fesm2022/sd-angular-core-services-notify.mjs.map +1 -1
  128. package/fesm2022/sd-angular-core-services.mjs +1 -0
  129. package/fesm2022/sd-angular-core-services.mjs.map +1 -1
  130. package/fesm2022/sd-angular-core-utilities-extensions.mjs +10 -6
  131. package/fesm2022/sd-angular-core-utilities-extensions.mjs.map +1 -1
  132. package/fesm2022/sd-angular-core-utilities-models.mjs +15 -1
  133. package/fesm2022/sd-angular-core-utilities-models.mjs.map +1 -1
  134. package/forms/autocomplete/src/autocomplete.component.d.ts +51 -56
  135. package/forms/date/src/date.component.d.ts +41 -45
  136. package/forms/date-range/src/date-range.component.d.ts +28 -33
  137. package/forms/datetime/src/datetime.component.d.ts +41 -45
  138. package/forms/input/src/input.component.d.ts +46 -56
  139. package/forms/input-number/src/input-number.component.d.ts +47 -54
  140. package/forms/select/src/select.component.d.ts +54 -58
  141. package/forms/textarea/src/textarea.component.d.ts +34 -41
  142. package/modules/index.d.ts +1 -1
  143. package/modules/keycloak/index.d.ts +4 -0
  144. package/modules/keycloak/keycloak.configuration.d.ts +11 -0
  145. package/modules/keycloak/keycloak.interceptor.d.ts +2 -0
  146. package/modules/keycloak/keycloak.module.d.ts +18 -0
  147. package/modules/keycloak/keycloak.service.d.ts +14 -0
  148. package/modules/layout/components/sidebar-v1/components/sidebar/sidebar.component.d.ts +1 -0
  149. package/modules/layout/components/sidebar-v1/components/user/user.component.d.ts +5 -2
  150. package/modules/layout/configurations/layout.configuration.d.ts +3 -0
  151. package/modules/layout/services/storage/storage.service.d.ts +1 -0
  152. package/package.json +96 -78
  153. package/pipes/index.d.ts +1 -0
  154. package/pipes/src/empty.pipe.d.ts +7 -0
  155. package/sd-angular-core-19.0.0-beta.41.tgz +0 -0
  156. package/services/confirm/src/lib/confirm.service.d.ts +1 -0
  157. package/services/docx/index.d.ts +1 -0
  158. package/services/docx/src/lib/docx.model.d.ts +9 -0
  159. package/services/docx/src/lib/docx.service.d.ts +13 -0
  160. package/services/docx/src/public-api.d.ts +2 -0
  161. package/services/index.d.ts +1 -0
  162. package/utilities/extensions/src/string.extension.d.ts +2 -0
  163. package/utilities/models/index.d.ts +3 -0
  164. package/utilities/models/src/filter.model.d.ts +14 -2
  165. package/utilities/models/src/icon.model.d.ts +2 -0
  166. package/utilities/models/src/nested-key-of.model.d.ts +5 -0
  167. package/utilities/models/src/pattern.model.d.ts +1 -1
  168. package/utilities/models/src/unwrap-signal.model.d.ts +6 -0
  169. package/components/document-builder/src/plugins/comment.plugin.d.ts +0 -4
  170. package/components/document-builder/src/plugins/table-fit.plugin.d.ts +0 -4
  171. package/fesm2022/sd-angular-core-modules-oidc.mjs +0 -127
  172. package/fesm2022/sd-angular-core-modules-oidc.mjs.map +0 -1
  173. package/modules/oidc/dynamic-sts.loader.d.ts +0 -11
  174. package/modules/oidc/index.d.ts +0 -2
  175. package/modules/oidc/oidc.configuration.d.ts +0 -11
  176. package/modules/oidc/oidc.module.d.ts +0 -14
  177. /package/components/document-builder/src/plugins/{variable.plugin.d.ts → variable/variable.plugin.d.ts} +0 -0
@@ -1,7 +1,7 @@
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
6
  import { NgForm, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
7
  import { MatButtonModule } from '@angular/material/button';
@@ -13,218 +13,153 @@ 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
23
 
23
- /* eslint-disable @typescript-eslint/no-explicit-any */
24
- /* eslint-disable @angular-eslint/no-input-rename */
25
- // eslint-disable-next-line @angular-eslint/component-class-suffix
26
24
  class SdInput {
27
- ref;
28
- formConfig;
29
25
  id = `I${uuid.v4()}`;
30
- autoId;
31
- set _autoId(val) {
32
- if (!val) {
33
- return;
34
- }
35
- this.autoId = `forms-input-${val}`;
36
- }
37
- #name = uuid.v4();
38
- set _name(val) {
39
- if (val) {
40
- this.#name = val;
41
- }
42
- }
43
- appearance = 'outline';
44
- size = 'md';
45
- #form;
46
- set _form(val) {
47
- if (val) {
48
- if (val instanceof NgForm) {
49
- this.#form = val.form;
50
- }
51
- else {
52
- this.#form = val;
53
- }
54
- }
55
- }
56
- label;
57
- set _label(val) {
58
- this.label = val;
59
- }
60
- helperText;
61
- set _helperText(val) {
62
- this.helperText = val;
63
- }
64
- placeholder;
65
- set _placeholder(val) {
66
- this.placeholder = val;
67
- }
68
- type = 'text';
69
- hideInlineError = false;
70
- set _hideInlineError(val) {
71
- this.hideInlineError = val === '' || val;
72
- }
73
- #blurOnEnter = false;
74
- set _blurOnEnter(val) {
75
- this.#blurOnEnter = val === '' || val;
76
- }
77
- #model;
78
- set model(value) {
79
- if (this.#model !== value) {
80
- this.#model = value;
81
- this.formControl.setValue(value, {
82
- emitEvent: false,
83
- });
84
- }
85
- }
86
- modelChange = new EventEmitter();
87
- // Validator
88
- required = false;
89
- set _required(val) {
90
- this.required = val === '' || !!val;
91
- this.#updateValidator();
92
- }
93
- readonly = false;
94
- set _readonly(val) {
95
- this.readonly = val === '' || val;
96
- }
97
- minlength;
98
- set _minlength(val) {
99
- if (val === undefined || val === null) {
100
- this.minlength = undefined;
101
- }
102
- else {
103
- this.minlength = +val;
104
- }
105
- this.#updateValidator();
106
- }
107
- maxlength;
108
- set _maxlength(val) {
109
- if (val === undefined || val === null) {
110
- this.maxlength = undefined;
111
- }
112
- else {
113
- this.maxlength = +val;
114
- }
115
- this.#updateValidator();
116
- }
117
- #pattern;
118
- set _pattern(val) {
119
- const pattern = SdPatternCommons.find(e => e.type === val);
120
- if (pattern) {
121
- this.#pattern = pattern.regex;
122
- this.patternErrorMessage = pattern.errorMessage;
123
- }
124
- else {
125
- this.#pattern = val ?? undefined;
126
- }
127
- this.#updateValidator();
128
- }
129
- patternErrorMessage;
130
- set _patternErrorMessage(val) {
131
- this.patternErrorMessage = val ?? this.patternErrorMessage;
132
- }
133
- #validator;
134
- set _validator(value) {
135
- this.#validator = value;
136
- this.#updateValidator();
137
- }
138
- inlineError;
139
- set _inlineError(val) {
140
- this.inlineError = val;
141
- this.#updateValidator();
142
- }
143
- // Optional
144
- set disabled(val) {
145
- val = val === '' || val;
146
- if (val) {
147
- this.formControl.disable();
148
- }
149
- else {
150
- this.formControl.enable();
151
- }
152
- }
153
- viewed = false;
154
- set _viewed(val) {
155
- this.viewed = val === '' || !!val;
156
- }
157
- hyperlink;
158
- tooltip;
159
- sdChange = new EventEmitter();
160
- sdFocus = new EventEmitter();
161
- 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
+ size = input('md');
48
+ // Chấp nhận mọi loại Form cha truyền xuống (FormGroup<{}>, FormGroup<any>, NgForm...)
49
+ form = input();
50
+ label = input();
51
+ helperText = input();
52
+ placeholder = input();
53
+ type = input('text');
54
+ hideInlineError = input(false, { transform: booleanAttribute });
55
+ blurOnEnter = input(false, { transform: booleanAttribute });
56
+ required = input(false, { transform: booleanAttribute });
57
+ readonly = input(false, { transform: booleanAttribute });
58
+ disabled = input(false, { transform: booleanAttribute });
59
+ viewed = input(false, { transform: booleanAttribute });
60
+ minlength = input(undefined, { transform: v => (v == null ? undefined : Number(v)) });
61
+ maxlength = input(undefined, { transform: v => (v == null ? undefined : Number(v)) });
62
+ pattern = input();
63
+ patternErrorMessage = input();
64
+ resolvedPattern = computed(() => {
65
+ const val = this.pattern();
66
+ const patternObj = SdPatternCommons.find(e => e.type === val);
67
+ return patternObj ? patternObj.regex : (val ?? undefined);
68
+ });
69
+ resolvedPatternErrorMsg = computed(() => {
70
+ const val = this.pattern();
71
+ const patternObj = SdPatternCommons.find(e => e.type === val);
72
+ return this.patternErrorMessage() ?? (patternObj ? patternObj.errorMessage : undefined);
73
+ });
74
+ validator = input();
75
+ inlineError = input();
76
+ hyperlink = input();
77
+ tooltip = input();
78
+ valueModel = model(undefined, { alias: 'model' });
79
+ // ==========================================
80
+ // 4. SIGNAL OUTPUTS (Thay thế @Output)
81
+ // ==========================================
82
+ sdChange = output();
83
+ sdFocus = output(); // Đổi sang void vì không truyền data
84
+ sdBlur = output();
85
+ keyupEnter = output();
86
+ // 🚨 GIỮ LẠI EVENT_EMITTER DUY NHẤT VÌ CẦN CHECK OBSERVERED
162
87
  sdFocusForceBlur = new EventEmitter();
163
- keyupEnter = new EventEmitter();
164
- control;
165
- sdSuffixDef;
166
- sdLabelDef;
167
- sdViewDef;
168
88
  formControl = new SdFormControl();
169
89
  #subscription = new Subscription();
170
90
  isFocused = false;
171
- constructor(ref, formConfig) {
172
- this.ref = ref;
173
- this.formConfig = formConfig;
91
+ constructor() {
92
+ effect(() => {
93
+ const val = this.valueModel();
94
+ untracked(() => {
95
+ if (this.formControl.value !== val) {
96
+ this.formControl.setValue(val, { emitEvent: false });
97
+ }
98
+ });
99
+ });
100
+ effect(() => {
101
+ if (this.disabled()) {
102
+ this.formControl.disable({ emitEvent: false });
103
+ }
104
+ else {
105
+ this.formControl.enable({ emitEvent: false });
106
+ }
107
+ });
108
+ effect(() => {
109
+ const req = this.required();
110
+ const min = this.minlength();
111
+ const max = this.maxlength();
112
+ const pat = this.resolvedPattern();
113
+ const inl = this.inlineError();
114
+ const val = this.validator();
115
+ untracked(() => {
116
+ this.#updateValidator(req, min, max, pat, inl, val);
117
+ });
118
+ });
174
119
  }
175
120
  ngOnInit() {
176
- this.appearance = this.appearance || this.formConfig?.appearance;
177
121
  this.#subscription.add(this.formControl.sdChanges.subscribe(() => {
178
- this.ref.markForCheck();
122
+ this.#ref.markForCheck();
179
123
  }));
180
124
  }
181
125
  ngAfterViewInit() {
182
126
  this.#subscription.add(this.formControl.valueChanges.subscribe(this.#onChange));
183
- this.#form?.addControl(this.#name, this.formControl);
184
- this.ref.detectChanges();
127
+ const formGroup = this.form() instanceof NgForm ? this.form().form : this.form();
128
+ formGroup?.addControl(this.name(), this.formControl);
129
+ this.#ref.detectChanges();
185
130
  }
186
131
  ngOnDestroy() {
187
- this.#form?.removeControl(this.#name);
132
+ const formGroup = this.form() instanceof NgForm ? this.form().form : this.form();
133
+ formGroup?.removeControl(this.name());
188
134
  this.#subscription.unsubscribe();
189
135
  }
190
136
  reValidate = () => {
191
137
  this.formControl.updateValueAndValidity();
192
138
  };
193
- #updateValidator = () => {
194
- this.formControl.clearValidators();
195
- this.formControl.clearAsyncValidators();
139
+ #updateValidator = (req, min, max, pat, inl, val) => {
196
140
  const validators = [];
197
141
  const asyncValidators = [];
198
- if (this.required) {
142
+ if (req)
199
143
  validators.push(Validators.required);
200
- }
201
- if (this.minlength !== undefined && this.minlength > 0) {
202
- validators.push(Validators.minLength(this.minlength));
203
- }
204
- if (this.maxlength !== undefined && this.maxlength > 0) {
205
- validators.push(Validators.maxLength(this.maxlength));
206
- }
207
- if (this.#pattern) {
208
- validators.push(Validators.pattern(this.#pattern));
209
- }
210
- if (this.inlineError) {
144
+ if (min && min > 0)
145
+ validators.push(Validators.minLength(min));
146
+ if (max && max > 0)
147
+ validators.push(Validators.maxLength(max));
148
+ if (pat)
149
+ validators.push(Validators.pattern(pat));
150
+ if (inl)
211
151
  validators.push(this.customInlineErrorValidator());
212
- }
213
- if (this.#validator) {
214
- asyncValidators.push(HandleSdCustomValidator(this.#validator));
215
- }
216
- this.formControl.setValidators(validators);
217
- this.formControl.setAsyncValidators(asyncValidators);
218
- this.formControl.updateValueAndValidity();
152
+ if (val)
153
+ asyncValidators.push(HandleSdCustomValidator(val));
154
+ this.formControl.setValidators(validators.length ? validators : null);
155
+ this.formControl.setAsyncValidators(asyncValidators.length ? asyncValidators : null);
156
+ this.formControl.updateValueAndValidity({ emitEvent: false });
219
157
  };
220
- // Hàm tạo Validators tùy chỉnh cho inlineError
221
158
  customInlineErrorValidator() {
222
- return () => {
223
- return { inlineError: true };
224
- };
159
+ return () => ({ inlineError: true });
225
160
  }
226
161
  #onChange = () => {
227
- this.modelChange.emit(this.formControl.value);
162
+ this.valueModel.set(this.formControl.value);
228
163
  this.sdChange.emit(this.formControl.value);
229
164
  };
230
165
  onKeyupEnter = () => {
@@ -233,14 +168,14 @@ class SdInput {
233
168
  this.formControl.setValue(val.trim());
234
169
  }
235
170
  this.keyupEnter.emit(this.formControl.value);
236
- if (this.#blurOnEnter) {
171
+ if (this.blurOnEnter()) {
237
172
  this.blur();
238
173
  }
239
174
  };
240
175
  onFocus = () => {
241
176
  this.isFocused = true;
242
- this.sdFocus.emit();
243
- if (this.sdFocusForceBlur.observers?.length > 0) {
177
+ this.sdFocus.emit(); // Gọi .emit() y hệt như cũ
178
+ if (this.sdFocusForceBlur.observed) {
244
179
  this.blur();
245
180
  this.sdFocusForceBlur.emit();
246
181
  }
@@ -254,7 +189,8 @@ class SdInput {
254
189
  this.sdBlur.emit(this.formControl.value);
255
190
  };
256
191
  onClick = () => {
257
- if (this.sdViewDef?.templateRef) {
192
+ // 🚨 GỌI SIGNAL: Phải thêm () vào sdViewDef
193
+ if (this.sdViewDef()?.templateRef) {
258
194
  if (!this.formControl.disabled && !this.isFocused) {
259
195
  this.focus();
260
196
  }
@@ -262,16 +198,18 @@ class SdInput {
262
198
  };
263
199
  blur = () => {
264
200
  this.isFocused = false;
265
- this.control?.nativeElement?.blur();
201
+ // 🚨 GỌI SIGNAL: Phải thêm () vào control
202
+ this.control()?.nativeElement?.blur();
266
203
  };
267
204
  focus = () => {
268
205
  this.isFocused = true;
269
206
  setTimeout(() => {
270
- this.control?.nativeElement?.focus();
207
+ // 🚨 GỌI SIGNAL: Phải thêm () vào control
208
+ this.control()?.nativeElement?.focus();
271
209
  }, 100);
272
210
  };
273
- 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 });
274
- 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 }}</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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
211
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
212
+ 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 }, 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 \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 });
275
213
  }
276
214
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdInput, decorators: [{
277
215
  type: Component,
@@ -285,101 +223,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
285
223
  MatTooltipModule,
286
224
  MatButtonModule,
287
225
  SdLabel,
288
- ], 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 }}</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"] }]
289
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
290
- type: Inject,
291
- args: [SD_FORM_CONFIGURATION]
292
- }, {
293
- type: Optional
294
- }] }], propDecorators: { _autoId: [{
295
- type: Input,
296
- args: ['autoId']
297
- }], _name: [{
298
- type: Input,
299
- args: ['name']
300
- }], appearance: [{
301
- type: Input
302
- }], size: [{
303
- type: Input
304
- }], _form: [{
305
- type: Input,
306
- args: ['form']
307
- }], _label: [{
308
- type: Input,
309
- args: ['label']
310
- }], _helperText: [{
311
- type: Input,
312
- args: ['helperText']
313
- }], _placeholder: [{
314
- type: Input,
315
- args: ['placeholder']
316
- }], type: [{
317
- type: Input
318
- }], _hideInlineError: [{
319
- type: Input,
320
- args: ['hideInlineError']
321
- }], _blurOnEnter: [{
322
- type: Input,
323
- args: ['blurOnEnter']
324
- }], model: [{
325
- type: Input
326
- }], modelChange: [{
327
- type: Output
328
- }], _required: [{
329
- type: Input,
330
- args: ['required']
331
- }], _readonly: [{
332
- type: Input,
333
- args: ['readonly']
334
- }], _minlength: [{
335
- type: Input,
336
- args: ['minlength']
337
- }], _maxlength: [{
338
- type: Input,
339
- args: ['maxlength']
340
- }], _pattern: [{
341
- type: Input,
342
- args: ['pattern']
343
- }], _patternErrorMessage: [{
344
- type: Input,
345
- args: ['patternErrorMessage']
346
- }], _validator: [{
347
- type: Input,
348
- args: ['validator']
349
- }], _inlineError: [{
350
- type: Input,
351
- args: ['inlineError']
352
- }], disabled: [{
353
- type: Input
354
- }], _viewed: [{
355
- type: Input,
356
- args: ['viewed']
357
- }], hyperlink: [{
358
- type: Input
359
- }], tooltip: [{
360
- type: Input
361
- }], sdChange: [{
362
- type: Output
363
- }], sdFocus: [{
364
- type: Output
365
- }], sdBlur: [{
366
- type: Output
367
- }], sdFocusForceBlur: [{
368
- type: Output
369
- }], keyupEnter: [{
226
+ SdView,
227
+ ], 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 \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"] }]
228
+ }], ctorParameters: () => [], propDecorators: { sdFocusForceBlur: [{
370
229
  type: Output
371
- }], control: [{
372
- type: ViewChild,
373
- args: ['control']
374
- }], sdSuffixDef: [{
375
- type: ContentChild,
376
- args: [SdSuffixDefDirective]
377
- }], sdLabelDef: [{
378
- type: ContentChild,
379
- args: [SdLabelDefDirective]
380
- }], sdViewDef: [{
381
- type: ContentChild,
382
- args: [SdViewDefDirective]
383
230
  }] } });
384
231
  function backendErrorValidator(backendErrorMessage) {
385
232
  return (control) => {