@sd-angular/core 19.0.0-beta.32 → 19.0.0-beta.34

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 (34) hide show
  1. package/components/view/src/view.component.d.ts +11 -11
  2. package/fesm2022/sd-angular-core-components-table.mjs +4 -4
  3. package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
  4. package/fesm2022/sd-angular-core-components-view.mjs +28 -40
  5. package/fesm2022/sd-angular-core-components-view.mjs.map +1 -1
  6. package/fesm2022/sd-angular-core-components-workflow.mjs +22 -22
  7. package/fesm2022/sd-angular-core-components-workflow.mjs.map +1 -1
  8. package/fesm2022/sd-angular-core-forms-autocomplete.mjs +165 -327
  9. package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
  10. package/fesm2022/sd-angular-core-forms-date.mjs +134 -279
  11. package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
  12. package/fesm2022/sd-angular-core-forms-datetime.mjs +132 -289
  13. package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
  14. package/fesm2022/sd-angular-core-forms-input-number.mjs +161 -337
  15. package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
  16. package/fesm2022/sd-angular-core-forms-input.mjs +126 -286
  17. package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
  18. package/fesm2022/sd-angular-core-forms-select.mjs +205 -400
  19. package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
  20. package/fesm2022/sd-angular-core-forms-textarea.mjs +120 -226
  21. package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
  22. package/fesm2022/sd-angular-core-modules-layout.mjs +1 -1
  23. package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
  24. package/fesm2022/sd-angular-core-services-confirm.mjs +1 -1
  25. package/forms/autocomplete/src/autocomplete.component.d.ts +44 -51
  26. package/forms/date/src/date.component.d.ts +40 -46
  27. package/forms/datetime/src/datetime.component.d.ts +39 -47
  28. package/forms/input/src/input.component.d.ts +44 -55
  29. package/forms/input-number/src/input-number.component.d.ts +45 -53
  30. package/forms/select/src/select.component.d.ts +47 -56
  31. package/forms/textarea/src/textarea.component.d.ts +33 -40
  32. package/package.json +39 -39
  33. package/sd-angular-core-19.0.0-beta.34.tgz +0 -0
  34. package/sd-angular-core-19.0.0-beta.32.tgz +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, Input, Output, Inject, Optional, Component } from '@angular/core';
4
+ import { viewChild, contentChild, inject, ChangeDetectorRef, input, computed, booleanAttribute, model, output, effect, untracked, 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 * as i3 from '@angular/material/form-field';
@@ -13,7 +13,7 @@ import { MatInputModule } from '@angular/material/input';
13
13
  import * as i6 from '@angular/material/tooltip';
14
14
  import { MatTooltipModule } from '@angular/material/tooltip';
15
15
  import { SdViewDefDirective, SdLabelDefDirective, SdSuffixDefDirective } from '@sd-angular/core/forms/directives';
16
- import { SdFormControl, SD_FORM_CONFIGURATION } from '@sd-angular/core/forms/models';
16
+ import { SD_FORM_CONFIGURATION, SdFormControl } from '@sd-angular/core/forms/models';
17
17
  import { NumberUtilities } from '@sd-angular/core/utilities/extensions';
18
18
  import { Subscription } from 'rxjs';
19
19
  import * as uuid from 'uuid';
@@ -23,133 +23,110 @@ import { SdEmptyPipe } from '@sd-angular/core/pipes';
23
23
  /* eslint-disable @typescript-eslint/no-explicit-any */
24
24
  /* eslint-disable @angular-eslint/no-input-rename */
25
25
  class SdTextarea {
26
- ref;
27
- formConfig;
28
26
  id = `I${uuid.v4()}`;
29
- autoId;
30
- set _autoId(val) {
31
- if (!val) {
32
- return;
33
- }
34
- this.autoId = `forms-textarea-${val}`;
35
- }
36
- #name = uuid.v4();
37
- set name(val) {
38
- if (val) {
39
- this.#name = val;
40
- }
41
- }
42
- size = 'md';
43
- appearance = 'outline';
44
- #form;
45
- set form(val) {
46
- if (val) {
47
- if (val instanceof NgForm) {
48
- this.#form = val.form;
49
- }
50
- else {
51
- this.#form = val;
52
- }
53
- }
54
- }
55
- label;
56
- set _label(val) {
57
- this.label = val;
58
- }
59
- helperText;
60
- set _helperText(val) {
61
- this.helperText = val;
62
- }
63
- placeholder = '';
64
- rows = 5;
65
- set model(value) {
66
- if (this.formControl.value !== value) {
67
- this.formControl.setValue(value);
68
- }
69
- }
70
- modelChange = new EventEmitter();
71
- sdChange = new EventEmitter();
72
- // Optional
73
- hideInlineError = false;
74
- set _hideInlineError(val) {
75
- this.hideInlineError = val === '' || !!val;
76
- }
77
- required = false;
78
- set _required(val) {
79
- this.required = val === '' || !!val;
80
- this.#updateValidator();
81
- }
82
- maxlength = null;
83
- set _maxlength(val) {
84
- if (val !== undefined && val !== null) {
85
- this.maxlength = +val;
86
- this.#updateValidator();
87
- }
88
- else {
89
- this.maxlength = null;
90
- this.#updateValidator();
91
- }
92
- }
93
- #pattern;
94
- set pattern(val) {
95
- this.#pattern = val;
96
- this.#updateValidator();
97
- }
98
- #validator;
99
- set validator(validator) {
100
- this.#validator = validator;
101
- this.#updateValidator();
102
- }
103
- inlineError;
104
- set _inlineError(val) {
105
- this.inlineError = val;
106
- this.#updateValidator();
107
- }
108
- set disabled(val) {
109
- val = val === '' || val;
110
- if (val) {
111
- this.formControl.disable();
112
- }
113
- else {
114
- this.formControl.enable();
115
- }
116
- }
117
- viewed = false;
118
- set _viewed(val) {
119
- this.viewed = val === '' || !!val;
120
- }
121
- #autoHeight = false;
122
- set _autoHeight(val) {
123
- this.#autoHeight = val === '' || val;
124
- }
125
- textarea;
126
- sdViewDef;
127
- sdLabelDef;
128
- sdSuffixDef;
129
- isFocused = false;
27
+ // ==========================================
28
+ // 1. SIGNAL QUERIES
29
+ // ==========================================
30
+ textareaRef = viewChild('textarea');
31
+ sdViewDef = contentChild(SdViewDefDirective);
32
+ sdLabelDef = contentChild(SdLabelDefDirective);
33
+ sdSuffixDef = contentChild(SdSuffixDefDirective);
34
+ // ==========================================
35
+ // 2. INJECTS
36
+ // ==========================================
37
+ ref = inject(ChangeDetectorRef);
38
+ formConfig = inject(SD_FORM_CONFIGURATION, { optional: true });
39
+ // ==========================================
40
+ // 3. SIGNAL INPUTS & MODEL
41
+ // ==========================================
42
+ autoIdInput = input(undefined, { alias: 'autoId' });
43
+ autoId = computed(() => this.autoIdInput() ? `forms-textarea-${this.autoIdInput()}` : undefined);
44
+ name = input(uuid.v4());
45
+ size = input('md');
46
+ form = input();
47
+ label = input();
48
+ helperText = input();
49
+ placeholder = input('');
50
+ rows = input(5);
51
+ hideInlineError = input(false, { transform: booleanAttribute });
52
+ required = input(false, { transform: booleanAttribute });
53
+ disabled = input(false, { transform: booleanAttribute });
54
+ viewed = input(false, { transform: booleanAttribute });
55
+ autoHeight = input(false, { transform: booleanAttribute });
56
+ maxlength = input(null, {
57
+ transform: (v) => (v != null && NumberUtilities.isPositiveInteger(Number(v))) ? Number(v) : null
58
+ });
59
+ pattern = input();
60
+ validator = input();
61
+ inlineError = input();
62
+ appearanceInput = input(undefined, { alias: 'appearance' });
63
+ appearance = computed(() => this.appearanceInput() ?? this.formConfig?.appearance ?? 'outline');
64
+ valueModel = model(undefined, { alias: 'model' });
65
+ // ==========================================
66
+ // 4. SIGNAL OUTPUTS
67
+ // ==========================================
68
+ sdChange = output();
69
+ // ==========================================
70
+ // 5. INTERNAL STATE & STREAMS
71
+ // ==========================================
130
72
  formControl = new SdFormControl();
131
73
  #subscription = new Subscription();
132
- constructor(ref, formConfig) {
133
- this.ref = ref;
134
- this.formConfig = formConfig;
74
+ isFocused = false;
75
+ constructor() {
76
+ // EFFECT 1: Sync model thay đổi từ bên ngoài
77
+ effect(() => {
78
+ const val = this.valueModel();
79
+ untracked(() => {
80
+ if (this.formControl.value !== val) {
81
+ this.formControl.setValue(val, { emitEvent: false });
82
+ // [IMPROVE] Cập nhật chiều cao khi value đổi từ bên ngoài
83
+ if (this.autoHeight())
84
+ this.#adjustHeight();
85
+ }
86
+ });
87
+ });
88
+ // EFFECT 2: Sync Disable
89
+ effect(() => {
90
+ if (this.disabled())
91
+ this.formControl.disable({ emitEvent: false });
92
+ else
93
+ this.formControl.enable({ emitEvent: false });
94
+ });
95
+ // EFFECT 3: Update Validators
96
+ effect(() => {
97
+ const req = this.required();
98
+ const maxLen = this.maxlength();
99
+ const pat = this.pattern();
100
+ const val = this.validator();
101
+ const inl = this.inlineError();
102
+ untracked(() => this.#updateValidator(req, maxLen, pat, val, inl));
103
+ });
135
104
  }
136
105
  ngOnInit() {
137
- this.appearance = this.appearance || this.formConfig?.appearance;
138
- this.#subscription.add(this.formControl.sdChanges.subscribe(() => {
139
- this.ref.markForCheck();
140
- }));
106
+ this.#subscription.add(this.formControl.sdChanges.subscribe(() => this.ref.markForCheck()));
141
107
  this.#subscription.add(this.formControl.valueChanges.subscribe(this.#onChange));
142
- this.#form?.addControl(this.#name, this.formControl);
108
+ const formGroup = this.form() instanceof NgForm ? this.form().form : this.form();
109
+ formGroup?.addControl(this.name(), this.formControl);
143
110
  }
144
111
  ngAfterViewInit() {
145
- if (this.#autoHeight) {
146
- this.textarea?.nativeElement?.setAttribute('style', `height: ${this.textarea?.nativeElement?.scrollHeight}px;overflow-y:hidden;`);
112
+ if (this.autoHeight()) {
113
+ setTimeout(() => this.#adjustHeight(), 0);
147
114
  }
148
115
  }
149
116
  ngOnDestroy() {
150
- this.#form?.removeControl(this.#name);
117
+ const formGroup = this.form() instanceof NgForm ? this.form().form : this.form();
118
+ formGroup?.removeControl(this.name());
151
119
  this.#subscription.unsubscribe();
152
120
  }
121
+ // Hàm private tính toán chiều cao mượt mà
122
+ #adjustHeight() {
123
+ const el = this.textareaRef()?.nativeElement;
124
+ if (el) {
125
+ el.style.height = 'auto';
126
+ el.style.overflowY = 'hidden';
127
+ el.style.height = `${el.scrollHeight}px`;
128
+ }
129
+ }
153
130
  onFocus = () => {
154
131
  this.isFocused = true;
155
132
  };
@@ -161,58 +138,49 @@ class SdTextarea {
161
138
  }
162
139
  };
163
140
  onClick = () => {
164
- if (this.sdViewDef?.templateRef) {
141
+ if (this.sdViewDef()?.templateRef) {
165
142
  if (!this.formControl.disabled && !this.isFocused) {
166
143
  this.focus();
167
144
  }
168
145
  }
169
146
  };
170
147
  blur = () => {
171
- this.textarea?.nativeElement?.blur();
148
+ this.textareaRef()?.nativeElement?.blur();
172
149
  };
173
150
  focus = () => {
174
151
  this.isFocused = true;
175
152
  setTimeout(() => {
176
- this.textarea?.nativeElement?.focus();
153
+ this.textareaRef()?.nativeElement?.focus();
177
154
  }, 100);
178
155
  };
179
156
  #onChange = (value) => {
180
- if (this.#autoHeight) {
181
- this.textarea.nativeElement.style.height = 'auto';
182
- this.textarea.nativeElement.style.height = this.textarea.nativeElement.scrollHeight + 'px';
157
+ if (this.autoHeight()) {
158
+ this.#adjustHeight();
183
159
  }
184
- this.modelChange.emit(value);
160
+ this.valueModel.set(value);
185
161
  this.sdChange.emit(value);
186
162
  };
187
- #updateValidator = () => {
163
+ #updateValidator = (req, maxLen, pat, val, inl) => {
188
164
  this.formControl.clearValidators();
189
165
  this.formControl.clearAsyncValidators();
190
166
  const validators = [];
191
167
  const asyncValidators = [];
192
- if (this.required) {
168
+ if (req)
193
169
  validators.push(Validators.required);
194
- }
195
- if (NumberUtilities.isPositiveInteger(this.maxlength)) {
196
- validators.push(Validators.maxLength(this.maxlength));
197
- }
198
- if (this.#pattern) {
199
- validators.push(Validators.pattern(this.#pattern));
200
- }
201
- if (this.#validator) {
202
- asyncValidators.push(this.#customValidator(this.#validator));
203
- }
204
- if (this.inlineError) {
170
+ if (maxLen != null)
171
+ validators.push(Validators.maxLength(maxLen));
172
+ if (pat)
173
+ validators.push(Validators.pattern(pat));
174
+ if (val)
175
+ asyncValidators.push(this.#customValidator(val));
176
+ if (inl)
205
177
  validators.push(this.customInlineErrorValidator());
206
- }
207
- this.formControl.setValidators(validators);
208
- this.formControl.setAsyncValidators(asyncValidators);
209
- this.formControl.updateValueAndValidity();
178
+ this.formControl.setValidators(validators.length ? validators : null);
179
+ this.formControl.setAsyncValidators(asyncValidators.length ? asyncValidators : null);
180
+ this.formControl.updateValueAndValidity({ emitEvent: false });
210
181
  };
211
- // Hàm tạo Validators tùy chỉnh cho inlineError
212
182
  customInlineErrorValidator() {
213
- return () => {
214
- return { inlineError: true };
215
- };
183
+ return () => ({ inlineError: true });
216
184
  }
217
185
  #customValidator = (func) => {
218
186
  return async (c) => {
@@ -221,25 +189,19 @@ class SdTextarea {
221
189
  const result = func(value);
222
190
  if (result instanceof Promise) {
223
191
  const message = await result;
224
- if (message) {
225
- return {
226
- customValidator: message,
227
- };
228
- }
192
+ if (message)
193
+ return { customValidator: message };
229
194
  return null;
230
195
  }
231
- if (result) {
232
- return {
233
- customValidator: result,
234
- };
235
- }
196
+ if (result)
197
+ return { customValidator: result };
236
198
  return null;
237
199
  }
238
200
  return null;
239
201
  };
240
202
  };
241
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdTextarea, deps: [{ token: i0.ChangeDetectorRef }, { token: SD_FORM_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
242
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdTextarea, isStandalone: true, selector: "sd-textarea", inputs: { _autoId: ["autoId", "_autoId"], name: "name", size: "size", appearance: "appearance", form: "form", _label: ["label", "_label"], _helperText: ["helperText", "_helperText"], placeholder: "placeholder", rows: "rows", model: "model", _hideInlineError: ["hideInlineError", "_hideInlineError"], _required: ["required", "_required"], _maxlength: ["maxlength", "_maxlength"], pattern: "pattern", validator: "validator", _inlineError: ["inlineError", "_inlineError"], disabled: "disabled", _viewed: ["viewed", "_viewed"], _autoHeight: ["autoHeight", "_autoHeight"] }, outputs: { modelChange: "modelChange", sdChange: "sdChange" }, queries: [{ propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true }, { propertyName: "sdSuffixDef", first: true, predicate: SdSuffixDefDirective, descendants: true }], viewQueries: [{ propertyName: "textarea", first: true, predicate: ["textarea"], 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=\"T14R text-black400\">{{ label }}</div>\r\n }\r\n <div class=\"T14M\">{{ formControl.value | sdEmpty}}</div>\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 [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=\"above\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n <textarea\r\n matInput\r\n [placeholder]=\"placeholder || label || ''\"\r\n [formControl]=\"formControl\"\r\n [required]=\"required\"\r\n autocomplete=\"off\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [rows]=\"rows\"\r\n [attr.data-autoId]=\"autoId\"\r\n spellcheck=\"false\"\r\n #textarea>\r\n </textarea>\r\n\r\n @if (maxlength && !formControl.disabled) {\r\n <span matSuffix>{{ formControl.value?.length || 0 }}/{{ maxlength }}</span>\r\n }\r\n <mat-error *ngIf=\"formControl.touched && formControl.errors?.['required']\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ 'Vui l\u00F2ng nh\u1EADp th\u00F4ng tin' }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.touched && formControl.errors?.['maxlength']\">\r\n <ng-container *ngIf=\"!hideInlineError\"\r\n >{{ 'S\u1ED1 k\u00FD t\u1EF1 t\u1ED1i \u0111a: ' }} <strong>{{ maxlength }}</strong>\r\n </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.touched && formControl.errors?.['pattern']\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ '\u0110\u1ECBnh d\u1EA1ng kh\u00F4ng h\u1EE3p l\u1EC7' }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.touched && formControl.errors?.['customValidator']\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ formControl.errors?.['customValidator'] }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.touched && formControl.errors?.['inlineError']\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ inlineError }}</ng-container>\r\n </mat-error>\r\n </mat-form-field>\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{padding-top:5px;display:block}:host ::ng-deep textarea.mat-mdc-input-element{resize:none}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline .mdc-text-field--disabled{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field textarea.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}\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: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "pipe", type: SdEmptyPipe, name: "sdEmpty" }] });
203
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdTextarea, deps: [], target: i0.ɵɵFactoryTarget.Component });
204
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdTextarea, isStandalone: true, selector: "sd-textarea", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", 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 }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, hideInlineError: { classPropertyName: "hideInlineError", publicName: "hideInlineError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, viewed: { classPropertyName: "viewed", publicName: "viewed", isSignal: true, isRequired: false, transformFunction: null }, autoHeight: { classPropertyName: "autoHeight", publicName: "autoHeight", 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 }, validator: { classPropertyName: "validator", publicName: "validator", isSignal: true, isRequired: false, transformFunction: null }, inlineError: { classPropertyName: "inlineError", publicName: "inlineError", isSignal: true, isRequired: false, transformFunction: null }, appearanceInput: { classPropertyName: "appearanceInput", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, valueModel: { classPropertyName: "valueModel", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueModel: "modelChange", sdChange: "sdChange" }, queries: [{ propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }, { propertyName: "sdSuffixDef", first: true, predicate: SdSuffixDefDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "textareaRef", first: true, predicate: ["textarea"], 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 lblDef = sdLabelDef();\r\n@let hText = helperText();\r\n@let req = required();\r\n@let maxLen = maxlength();\r\n\r\n@if (viewed()) {\r\n @if (lblDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"lblDef!.templateRef\"> </ng-container>\r\n } @else if (lbl) {\r\n <div class=\"T14R text-black400\">{{ lbl }}</div>\r\n }\r\n <div class=\"T14M\">{{ formControl.value | sdEmpty }}</div>\r\n} @else {\r\n @if (!app && lblDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"lblDef!.templateRef\"> </ng-container>\r\n }\r\n @if (!app && lbl && !lblDef?.templateRef) {\r\n <sd-label [label]=\"lbl\" [required]=\"req\"></sd-label>\r\n }\r\n \r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"viewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n \r\n @if (viewDef?.templateRef && !isFocused) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n viewDef!.templateRef;\r\n context: { value: formControl.value }\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]=\"hideErr\"\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=\"above\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n \r\n <textarea\r\n matInput\r\n [placeholder]=\"placeholder() || lbl || ''\"\r\n [formControl]=\"formControl\"\r\n [required]=\"req\"\r\n autocomplete=\"off\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [rows]=\"rows()\"\r\n [attr.data-autoId]=\"autoId()\"\r\n spellcheck=\"false\"\r\n #textarea>\r\n </textarea>\r\n\r\n @if (maxLen !== null && !formControl.disabled) {\r\n <span matSuffix>{{ formControl.value?.length || 0 }}/{{ maxLen }}</span>\r\n }\r\n\r\n @if (formControl.touched && 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.touched && formControl.errors?.['maxlength']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'S\u1ED1 k\u00FD t\u1EF1 t\u1ED1i \u0111a: ' }} <strong>{{ maxLen }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.touched && formControl.errors?.['pattern']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ '\u0110\u1ECBnh d\u1EA1ng kh\u00F4ng h\u1EE3p l\u1EC7' }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.touched && 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.touched && 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 </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{padding-top:5px;display:block}:host ::ng-deep textarea.mat-mdc-input-element{resize:none}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline .mdc-text-field--disabled{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field textarea.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}\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: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "pipe", type: SdEmptyPipe, name: "sdEmpty" }] });
243
205
  }
244
206
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdTextarea, decorators: [{
245
207
  type: Component,
@@ -253,76 +215,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
253
215
  MatTooltipModule,
254
216
  SdLabel,
255
217
  SdEmptyPipe,
256
- ], 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=\"T14R text-black400\">{{ label }}</div>\r\n }\r\n <div class=\"T14M\">{{ formControl.value | sdEmpty}}</div>\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 [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=\"above\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n <textarea\r\n matInput\r\n [placeholder]=\"placeholder || label || ''\"\r\n [formControl]=\"formControl\"\r\n [required]=\"required\"\r\n autocomplete=\"off\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [rows]=\"rows\"\r\n [attr.data-autoId]=\"autoId\"\r\n spellcheck=\"false\"\r\n #textarea>\r\n </textarea>\r\n\r\n @if (maxlength && !formControl.disabled) {\r\n <span matSuffix>{{ formControl.value?.length || 0 }}/{{ maxlength }}</span>\r\n }\r\n <mat-error *ngIf=\"formControl.touched && formControl.errors?.['required']\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ 'Vui l\u00F2ng nh\u1EADp th\u00F4ng tin' }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.touched && formControl.errors?.['maxlength']\">\r\n <ng-container *ngIf=\"!hideInlineError\"\r\n >{{ 'S\u1ED1 k\u00FD t\u1EF1 t\u1ED1i \u0111a: ' }} <strong>{{ maxlength }}</strong>\r\n </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.touched && formControl.errors?.['pattern']\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ '\u0110\u1ECBnh d\u1EA1ng kh\u00F4ng h\u1EE3p l\u1EC7' }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.touched && formControl.errors?.['customValidator']\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ formControl.errors?.['customValidator'] }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.touched && formControl.errors?.['inlineError']\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ inlineError }}</ng-container>\r\n </mat-error>\r\n </mat-form-field>\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{padding-top:5px;display:block}:host ::ng-deep textarea.mat-mdc-input-element{resize:none}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline .mdc-text-field--disabled{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field textarea.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}\n"] }]
257
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
258
- type: Inject,
259
- args: [SD_FORM_CONFIGURATION]
260
- }, {
261
- type: Optional
262
- }] }], propDecorators: { _autoId: [{
263
- type: Input,
264
- args: ['autoId']
265
- }], name: [{
266
- type: Input
267
- }], size: [{
268
- type: Input
269
- }], appearance: [{
270
- type: Input
271
- }], form: [{
272
- type: Input
273
- }], _label: [{
274
- type: Input,
275
- args: ['label']
276
- }], _helperText: [{
277
- type: Input,
278
- args: ['helperText']
279
- }], placeholder: [{
280
- type: Input
281
- }], rows: [{
282
- type: Input
283
- }], model: [{
284
- type: Input
285
- }], modelChange: [{
286
- type: Output
287
- }], sdChange: [{
288
- type: Output
289
- }], _hideInlineError: [{
290
- type: Input,
291
- args: ['hideInlineError']
292
- }], _required: [{
293
- type: Input,
294
- args: ['required']
295
- }], _maxlength: [{
296
- type: Input,
297
- args: ['maxlength']
298
- }], pattern: [{
299
- type: Input
300
- }], validator: [{
301
- type: Input
302
- }], _inlineError: [{
303
- type: Input,
304
- args: ['inlineError']
305
- }], disabled: [{
306
- type: Input
307
- }], _viewed: [{
308
- type: Input,
309
- args: ['viewed']
310
- }], _autoHeight: [{
311
- type: Input,
312
- args: ['autoHeight']
313
- }], textarea: [{
314
- type: ViewChild,
315
- args: ['textarea']
316
- }], sdViewDef: [{
317
- type: ContentChild,
318
- args: [SdViewDefDirective]
319
- }], sdLabelDef: [{
320
- type: ContentChild,
321
- args: [SdLabelDefDirective]
322
- }], sdSuffixDef: [{
323
- type: ContentChild,
324
- args: [SdSuffixDefDirective]
325
- }] } });
218
+ ], template: "@let lbl = label();\r\n@let app = appearance();\r\n@let hideErr = hideInlineError();\r\n@let viewDef = sdViewDef();\r\n@let lblDef = sdLabelDef();\r\n@let hText = helperText();\r\n@let req = required();\r\n@let maxLen = maxlength();\r\n\r\n@if (viewed()) {\r\n @if (lblDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"lblDef!.templateRef\"> </ng-container>\r\n } @else if (lbl) {\r\n <div class=\"T14R text-black400\">{{ lbl }}</div>\r\n }\r\n <div class=\"T14M\">{{ formControl.value | sdEmpty }}</div>\r\n} @else {\r\n @if (!app && lblDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"lblDef!.templateRef\"> </ng-container>\r\n }\r\n @if (!app && lbl && !lblDef?.templateRef) {\r\n <sd-label [label]=\"lbl\" [required]=\"req\"></sd-label>\r\n }\r\n \r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"viewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n \r\n @if (viewDef?.templateRef && !isFocused) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n viewDef!.templateRef;\r\n context: { value: formControl.value }\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]=\"hideErr\"\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=\"above\">info_outline</mat-icon>\r\n }\r\n </div>\r\n </mat-label>\r\n }\r\n \r\n <textarea\r\n matInput\r\n [placeholder]=\"placeholder() || lbl || ''\"\r\n [formControl]=\"formControl\"\r\n [required]=\"req\"\r\n autocomplete=\"off\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [rows]=\"rows()\"\r\n [attr.data-autoId]=\"autoId()\"\r\n spellcheck=\"false\"\r\n #textarea>\r\n </textarea>\r\n\r\n @if (maxLen !== null && !formControl.disabled) {\r\n <span matSuffix>{{ formControl.value?.length || 0 }}/{{ maxLen }}</span>\r\n }\r\n\r\n @if (formControl.touched && 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.touched && formControl.errors?.['maxlength']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'S\u1ED1 k\u00FD t\u1EF1 t\u1ED1i \u0111a: ' }} <strong>{{ maxLen }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.touched && formControl.errors?.['pattern']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ '\u0110\u1ECBnh d\u1EA1ng kh\u00F4ng h\u1EE3p l\u1EC7' }}\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.touched && 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.touched && 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 </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{padding-top:5px;display:block}:host ::ng-deep textarea.mat-mdc-input-element{resize:none}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline .mdc-text-field--disabled{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field textarea.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}\n"] }]
219
+ }], ctorParameters: () => [] });
326
220
 
327
221
  /**
328
222
  * Generated bundle index. Do not edit.