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

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 +56 -56
  33. package/sd-angular-core-19.0.0-beta.33.tgz +0 -0
  34. package/sd-angular-core-19.0.0-beta.32.tgz +0 -0
@@ -1,32 +1,28 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, ContentChild, ViewChild, Output, Input, Inject, Optional, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import * as i3 from '@angular/forms';
2
+ import { viewChild, contentChild, inject, ChangeDetectorRef, input, computed, booleanAttribute, model, output, EventEmitter, effect, untracked, Output, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import * as i2 from '@angular/forms';
4
4
  import { NgForm, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
5
  import * as uuid from 'uuid';
6
- import * as i2 from '@angular/common';
6
+ import * as i1 from '@angular/common';
7
7
  import { CommonModule } from '@angular/common';
8
8
  import { MatButtonModule } from '@angular/material/button';
9
- import * as i4 from '@angular/material/form-field';
9
+ import * as i3 from '@angular/material/form-field';
10
10
  import { MatFormFieldModule } from '@angular/material/form-field';
11
- import * as i6 from '@angular/material/icon';
11
+ import * as i5 from '@angular/material/icon';
12
12
  import { MatIconModule } from '@angular/material/icon';
13
- import * as i5 from '@angular/material/input';
13
+ import * as i4 from '@angular/material/input';
14
14
  import { MatInputModule } from '@angular/material/input';
15
- import * as i7 from '@angular/material/tooltip';
15
+ import * as i6 from '@angular/material/tooltip';
16
16
  import { MatTooltipModule } from '@angular/material/tooltip';
17
17
  import { SdView } from '@sd-angular/core/components/view';
18
18
  import { SD_CORE_CONFIGURATION } from '@sd-angular/core/configurations';
19
19
  import { SdViewDefDirective, SdSuffixDefDirective } from '@sd-angular/core/forms/directives';
20
20
  import { SdLabel } from '@sd-angular/core/forms/label';
21
- import { SdFormControl, HandleSdCustomValidator, SD_FORM_CONFIGURATION } from '@sd-angular/core/forms/models';
22
- import * as i1 from '@sd-angular/core/pipes';
21
+ import { SD_FORM_CONFIGURATION, SdFormControl, HandleSdCustomValidator } from '@sd-angular/core/forms/models';
23
22
  import { SdFormatNumberPipe } from '@sd-angular/core/pipes';
24
23
  import { NumberUtilities } from '@sd-angular/core/utilities/extensions';
25
24
  import { Subscription } from 'rxjs';
26
25
 
27
- /* eslint-disable @angular-eslint/component-class-suffix */
28
- /* eslint-disable @angular-eslint/no-input-rename */
29
- /* eslint-disable @typescript-eslint/no-explicit-any */
30
26
  class SdInputNumberErrotStateMatcher {
31
27
  formControl;
32
28
  constructor(formControl) {
@@ -38,147 +34,124 @@ class SdInputNumberErrotStateMatcher {
38
34
  }
39
35
  }
40
36
  class SdInputNumber {
41
- ref;
42
- coreConfiguration;
43
- formatNumberPipe;
44
- formConfig;
45
- sdLabelTemplate;
46
- sdValueTemplate;
47
37
  id = `I${uuid.v4()}`;
48
- autoId;
49
- set _autoId(val) {
50
- if (!val) {
51
- return;
52
- }
53
- this.autoId = `forms-input-number-${val}`;
54
- }
55
- #name = uuid.v4();
56
- set name(val) {
57
- if (val) {
58
- this.#name = val;
59
- }
60
- }
61
- size = 'md';
62
- #form;
63
- set form(val) {
64
- if (val) {
65
- if (val instanceof NgForm) {
66
- this.#form = val.form;
67
- }
68
- else {
69
- this.#form = val;
70
- }
71
- }
72
- }
73
- label;
74
- set _label(val) {
75
- this.label = val;
76
- }
77
- helperText;
78
- set _helperText(val) {
79
- this.helperText = val;
80
- }
81
- placeholder;
82
- hideInlineError = false;
83
- set _hideInlineError(val) {
84
- this.hideInlineError = val === '' || val;
85
- }
86
- #blurOnEnter = false;
87
- set _blurOnEnter(val) {
88
- this.#blurOnEnter = val === '' || val;
89
- }
90
- #model;
91
- set model(value) {
92
- if (this.#model !== value) {
93
- this.#model = value;
94
- this.formControl.setValue(this.#model, {
95
- emitEvent: false,
96
- });
97
- if (value || value === 0) {
98
- const val = value.toString().replace(/\./g, this.#decimalSeparator);
99
- this.inputControl.setValue(this.#getValueWithFormat(val), {
100
- emitEvent: false,
101
- });
102
- }
103
- else {
104
- this.inputControl.setValue('', {
105
- emitEvent: false,
106
- });
107
- }
108
- }
109
- }
110
- modelChange = new EventEmitter();
111
- // Validator
112
- required = false;
113
- set _required(val) {
114
- this.required = val === '' || !!val;
115
- this.#updateValidator();
116
- }
117
- type; //negative: chỉ nhập số âm, positive: chỉ số dương
118
- precision = 3; //số chữ số thập phân
119
- readonly = false;
120
- set _readonly(val) {
121
- this.readonly = val === '' || val;
122
- }
123
- min;
124
- set _min(val) {
125
- this.min = val ?? undefined;
126
- this.#updateValidator();
127
- }
128
- max;
129
- set _max(val) {
130
- this.max = val ?? undefined;
131
- this.#updateValidator();
132
- }
133
- #validator;
134
- set validator(validator) {
135
- this.#validator = validator;
136
- this.#updateValidator();
137
- }
138
- inlineError;
139
- set _inlineError(val) {
140
- this.inlineError = val;
141
- this.#updateValidator();
142
- }
143
- set disabled(val) {
144
- val = val === '' || val;
145
- if (val) {
146
- this.inputControl.disable();
147
- this.formControl.disable();
148
- }
149
- else {
150
- this.inputControl.enable();
151
- this.formControl.enable();
152
- }
153
- }
154
- viewed = false;
155
- set _viewed(val) {
156
- this.viewed = val === '' || !!val;
157
- }
158
- hyperlink;
159
- appearance = 'outline';
160
- sdChange = new EventEmitter();
161
- sdFocus = new EventEmitter();
162
- sdBlur = new EventEmitter();
38
+ // ==========================================
39
+ // 1. SIGNAL QUERIES
40
+ // ==========================================
41
+ control = viewChild('control');
42
+ sdLabelTemplate = contentChild('sdLabel');
43
+ sdValueTemplate = contentChild('sdValue');
44
+ sdViewDef = contentChild(SdViewDefDirective);
45
+ sdSuffixDef = contentChild(SdSuffixDefDirective);
46
+ // ==========================================
47
+ // 2. INJECTS
48
+ // ==========================================
49
+ ref = inject(ChangeDetectorRef);
50
+ coreConfiguration = inject(SD_CORE_CONFIGURATION, { optional: true });
51
+ formatNumberPipe = inject(SdFormatNumberPipe);
52
+ formConfig = inject(SD_FORM_CONFIGURATION, { optional: true });
53
+ // ==========================================
54
+ // 3. SIGNAL INPUTS & MODEL
55
+ // ==========================================
56
+ autoIdInput = input(undefined, { alias: 'autoId' });
57
+ autoId = computed(() => (this.autoIdInput() ? `forms-input-number-${this.autoIdInput()}` : undefined));
58
+ name = input(uuid.v4());
59
+ size = input('md');
60
+ form = input();
61
+ label = input();
62
+ helperText = input();
63
+ placeholder = input();
64
+ hideInlineError = input(false, { transform: booleanAttribute });
65
+ blurOnEnter = input(false, { transform: booleanAttribute });
66
+ required = input(false, { transform: booleanAttribute });
67
+ readonly = input(false, { transform: booleanAttribute });
68
+ disabled = input(false, { transform: booleanAttribute });
69
+ viewed = input(false, { transform: booleanAttribute });
70
+ type = input();
71
+ precision = input(3);
72
+ min = input(undefined, { transform: v => (v == null ? undefined : Number(v)) });
73
+ max = input(undefined, { transform: v => (v == null ? undefined : Number(v)) });
74
+ validator = input();
75
+ inlineError = input();
76
+ hyperlink = input();
77
+ appearanceInput = input(undefined, { alias: 'appearance' });
78
+ appearance = computed(() => this.appearanceInput() ?? this.formConfig?.appearance ?? 'outline');
79
+ valueModel = model(undefined, { alias: 'model' });
80
+ // ==========================================
81
+ // 4. SIGNAL OUTPUTS (Giữ lại sdFocusForceBlur)
82
+ // ==========================================
83
+ sdChange = output();
84
+ sdFocus = output();
85
+ sdBlur = output();
86
+ keyupEnter = output();
163
87
  sdFocusForceBlur = new EventEmitter();
164
- keyupEnter = new EventEmitter();
165
- control;
88
+ // ==========================================
89
+ // 5. INTERNAL STATE & COMPUTED
90
+ // ==========================================
166
91
  formControl = new SdFormControl();
167
92
  inputControl = new SdFormControl();
168
93
  #subscription = new Subscription();
169
94
  matcher = new SdInputNumberErrotStateMatcher(this.formControl);
170
95
  #preCompositionValue;
171
- sdViewDef;
172
- sdSuffixDef;
173
96
  isFocused = false;
174
- constructor(ref, coreConfiguration, formatNumberPipe, formConfig) {
175
- this.ref = ref;
176
- this.coreConfiguration = coreConfiguration;
177
- this.formatNumberPipe = formatNumberPipe;
178
- this.formConfig = formConfig;
97
+ // Dùng computed thay cho getter cũ để tận dụng cache
98
+ decimalSeparator = computed(() => (this.coreConfiguration?.format?.number === '1.234.567,89' ? ',' : '.'));
99
+ thousandsSeparator = computed(() => (this.coreConfiguration?.format?.number === '1.234.567,89' ? '.' : ','));
100
+ regexPattern = computed(() => {
101
+ const decimal = this.decimalSeparator();
102
+ const thousand = this.thousandsSeparator();
103
+ const escDecimal = decimal === '.' ? '\\.' : decimal;
104
+ const escThousand = thousand === '.' ? '\\.' : thousand;
105
+ const integerPart = `(([0-9]+(${escThousand}[0-9])?)+)`;
106
+ const decimalPart = this.precision() > 0 ? `(${escDecimal}[0-9]{0,${this.precision()}})?` : '';
107
+ const baseReg = `${integerPart}${decimalPart}$`;
108
+ if (this.type() === 'negative')
109
+ return `[-]${baseReg}`;
110
+ if (!this.type())
111
+ return `[-]?${baseReg}`;
112
+ return baseReg;
113
+ });
114
+ constructor() {
115
+ // EFFECT 1: Sync model thay đổi từ bên ngoài (Parent -> Component)
116
+ effect(() => {
117
+ const val = this.valueModel();
118
+ untracked(() => {
119
+ if (this.formControl.value !== val) {
120
+ this.formControl.setValue(val, { emitEvent: false });
121
+ if (val != null && val !== '') {
122
+ const strVal = val.toString().replace(/\./g, this.decimalSeparator());
123
+ this.inputControl.setValue(this.#getValueWithFormat(strVal), { emitEvent: false });
124
+ }
125
+ else {
126
+ this.inputControl.setValue('', { emitEvent: false });
127
+ }
128
+ }
129
+ });
130
+ });
131
+ // EFFECT 2: Sync Disable
132
+ effect(() => {
133
+ if (this.disabled()) {
134
+ this.inputControl.disable({ emitEvent: false });
135
+ this.formControl.disable({ emitEvent: false });
136
+ }
137
+ else {
138
+ this.inputControl.enable({ emitEvent: false });
139
+ this.formControl.enable({ emitEvent: false });
140
+ }
141
+ });
142
+ // EFFECT 3: Update Validator
143
+ effect(() => {
144
+ const req = this.required();
145
+ const minVal = this.min();
146
+ const maxVal = this.max();
147
+ const val = this.validator();
148
+ const inl = this.inlineError();
149
+ untracked(() => {
150
+ this.#updateValidator(req, minVal, maxVal, val, inl);
151
+ });
152
+ });
179
153
  }
180
154
  ngOnInit() {
181
- this.appearance = this.appearance || this.formConfig?.appearance;
182
155
  this.#subscription.add(this.inputControl.touchChanges.subscribe(() => {
183
156
  this.formControl.markAsTouched();
184
157
  this.ref.markForCheck();
@@ -190,36 +163,6 @@ class SdInputNumber {
190
163
  this.ref.markForCheck();
191
164
  }));
192
165
  }
193
- get #decimalSeparator() {
194
- if (this.coreConfiguration?.format?.number === '1.234.567,89') {
195
- return ',';
196
- }
197
- return '.';
198
- }
199
- get #thousandsSeparator() {
200
- if (this.coreConfiguration?.format?.number === '1.234.567,89') {
201
- return '.';
202
- }
203
- return ',';
204
- }
205
- get #regex() {
206
- const decimal = this.#decimalSeparator;
207
- const thousand = this.#thousandsSeparator;
208
- const escDecimal = decimal === '.' ? '\\.' : decimal;
209
- const escThousand = thousand === '.' ? '\\.' : thousand;
210
- // Phần nguyên: có thể có hoặc không có phân cách hàng nghìn
211
- const integerPart = `(([0-9]+(${escThousand}[0-9])?)+)`; //`([0-9]{1,3}(${escThousand}[0-9]{3})*|[0-9]+)`;
212
- // Phần thập phân: có hoặc không, tùy theo precision
213
- const decimalPart = this.precision > 0 ? `(${escDecimal}[0-9]{0,${this.precision}})?` : '';
214
- let result = `${integerPart}${decimalPart}$`;
215
- if (this.type === 'negative') {
216
- result = `[-]${integerPart}${decimalPart}$`;
217
- }
218
- else if (!this.type) {
219
- result = `[-]?${integerPart}${decimalPart}$`;
220
- }
221
- return result;
222
- }
223
166
  ngAfterViewInit() {
224
167
  this.#subscription.add(this.inputControl.valueChanges.subscribe(() => {
225
168
  const val = this.inputControl.value;
@@ -229,19 +172,23 @@ class SdInputNumber {
229
172
  }
230
173
  const value = this.#toNumber(val);
231
174
  if (!isNaN(value)) {
232
- this.inputControl.setValue(this.#getValueWithFormat(val), {
233
- emitEvent: false,
234
- });
175
+ this.inputControl.setValue(this.#getValueWithFormat(val), { emitEvent: false });
235
176
  this.#onChange(value);
236
177
  }
237
178
  }));
238
- this.#form?.addControl(this.#name, this.formControl);
179
+ const formGroup = this.form() instanceof NgForm ? this.form().form : this.form();
180
+ formGroup?.addControl(this.name(), this.formControl);
239
181
  this.ref.detectChanges();
240
182
  }
183
+ ngOnDestroy() {
184
+ const formGroup = this.form() instanceof NgForm ? this.form().form : this.form();
185
+ formGroup?.removeControl(this.name());
186
+ this.#subscription.unsubscribe();
187
+ }
241
188
  #getValueWithFormat = (value) => {
242
- const arrayNext = value.split(this.#decimalSeparator);
189
+ const arrayNext = value.split(this.decimalSeparator());
243
190
  if (arrayNext.length >= 2) {
244
- return `${this.#formatNumber(arrayNext[0])}${this.#decimalSeparator}${arrayNext[1]}`;
191
+ return `${this.#formatNumber(arrayNext[0])}${this.decimalSeparator()}${arrayNext[1]}`;
245
192
  }
246
193
  return this.#formatNumber(value);
247
194
  };
@@ -255,54 +202,36 @@ class SdInputNumber {
255
202
  };
256
203
  #toNumber = (text) => {
257
204
  const raw = text?.toString() || '';
258
- const value = raw
259
- .split(this.#thousandsSeparator)
260
- .join('') // Xóa dấu phân cách phần nghìn
261
- .replace(this.#decimalSeparator, '.'); // Chuyển dấu phân cách thập phân về dấu .
205
+ const value = raw.split(this.thousandsSeparator()).join('').replace(this.decimalSeparator(), '.');
262
206
  return +value;
263
207
  };
264
- ngOnDestroy() {
265
- this.#form?.removeControl(this.#name);
266
- this.#subscription.unsubscribe();
267
- }
268
208
  reValidate = () => {
269
209
  this.formControl.updateValueAndValidity();
270
210
  };
271
- #updateValidator = () => {
272
- this.formControl.clearValidators();
273
- this.formControl.clearAsyncValidators();
211
+ #updateValidator = (req, minVal, maxVal, val, inl) => {
274
212
  const validators = [];
275
213
  const asyncValidators = [];
276
- if (this.required) {
214
+ if (req)
277
215
  validators.push(Validators.required);
278
- }
279
- if (this.min || this.min === 0) {
280
- validators.push(Validators.min(this.min));
281
- }
282
- if (this.max || this.max === 0) {
283
- validators.push(Validators.max(this.max));
284
- }
285
- if (this.#validator) {
286
- asyncValidators.push(HandleSdCustomValidator(this.#validator));
287
- }
288
- if (this.inlineError) {
216
+ if (minVal != null)
217
+ validators.push(Validators.min(minVal));
218
+ if (maxVal != null)
219
+ validators.push(Validators.max(maxVal));
220
+ if (val)
221
+ asyncValidators.push(HandleSdCustomValidator(val));
222
+ if (inl)
289
223
  validators.push(this.customInlineErrorValidator());
290
- }
291
- this.formControl.setValidators(validators);
292
- this.formControl.setAsyncValidators(asyncValidators);
293
- this.formControl.updateValueAndValidity();
224
+ this.formControl.setValidators(validators.length ? validators : null);
225
+ this.formControl.setAsyncValidators(asyncValidators.length ? asyncValidators : null);
226
+ this.formControl.updateValueAndValidity({ emitEvent: false });
294
227
  };
295
- // Hàm tạo Validators tùy chỉnh cho inlineError
296
228
  customInlineErrorValidator() {
297
- return () => {
298
- return { inlineError: true };
299
- };
229
+ return () => ({ inlineError: true });
300
230
  }
301
231
  #onChange = (value) => {
302
- this.#model = value ?? null;
303
- this.modelChange.emit(this.#model);
304
- this.sdChange.emit(this.#model);
305
- this.formControl.setValue(this.#model);
232
+ this.valueModel.set(value ?? null);
233
+ this.sdChange.emit(value ?? null);
234
+ this.formControl.setValue(value ?? null, { emitEvent: false });
306
235
  };
307
236
  onKeyupEnter = () => {
308
237
  const val = (this.inputControl.value ?? '').toString();
@@ -310,7 +239,7 @@ class SdInputNumber {
310
239
  this.inputControl.setValue(val.trim());
311
240
  }
312
241
  this.keyupEnter.emit(this.inputControl.value);
313
- if (this.#blurOnEnter) {
242
+ if (this.blurOnEnter()) {
314
243
  this.blur();
315
244
  }
316
245
  };
@@ -320,15 +249,12 @@ class SdInputNumber {
320
249
  return;
321
250
  }
322
251
  const key = event.keyCode || event.charCode;
323
- if (key == 8 || key == 46 || key == 37 || key == 39 || key == 35 || key == 36 || key == 9) {
252
+ if (key == 8 || key == 46 || key == 37 || key == 39 || key == 35 || key == 36 || key == 9)
324
253
  return;
325
- }
326
- if (event.ctrlKey && (event.key == 'c' || event.key == 'x' || event.key == 'a')) {
254
+ if (event.ctrlKey && (event.key == 'c' || event.key == 'x' || event.key == 'a'))
327
255
  return;
328
- }
329
- if (event.shiftKey && key == 9) {
256
+ if (event.shiftKey && key == 9)
330
257
  return;
331
- }
332
258
  this.#checkValue(event, event.key);
333
259
  };
334
260
  onPaste(event) {
@@ -337,7 +263,7 @@ class SdInputNumber {
337
263
  }
338
264
  onCompositionEnd(event) {
339
265
  const compositionValue = event.data;
340
- const regExp = new RegExp(`^${this.#regex}`, 'g');
266
+ const regExp = new RegExp(`^${this.regexPattern()}`, 'g');
341
267
  if (compositionValue && !String(compositionValue).match(regExp)) {
342
268
  this.inputControl.setValue(this.#preCompositionValue || '');
343
269
  }
@@ -348,33 +274,22 @@ class SdInputNumber {
348
274
  }
349
275
  #checkValue = (event, nextKey) => {
350
276
  const current = event?.target?.value;
351
- // if(this.maxNumber === +current.toString().replace(/\./g, '').replace(/,/g, '.')){
352
- // event.preventDefault();
353
- // return;
354
- // }
355
277
  const curval_arr = current.split('');
356
278
  curval_arr.splice(event.target.selectionStart, event.target.selectionEnd - event.target.selectionStart, nextKey || '');
357
279
  const newval = curval_arr.join('');
358
- if (this.type !== 'positive' && newval === '-') {
280
+ if (this.type() !== 'positive' && newval === '-')
359
281
  return;
360
- }
361
- const regExp = new RegExp(`^${this.#regex}`, 'g');
282
+ const regExp = new RegExp(`^${this.regexPattern()}`, 'g');
362
283
  if (newval && !String(newval).match(regExp)) {
363
284
  event.preventDefault();
364
285
  return;
365
286
  }
366
- // const value = (newval.toString().replace(/\./g, '').replace(/,/g, '.'));
367
- // if ((this.maxNumber || this.maxNumber === 0) && +value > this.maxNumber) {
368
- // setTimeout(() => {
369
- // this.inputControl.setValue(this.#getValueWithFormat(this.maxNumber.toString().replace(/\./g, ',')));
370
- // }, 10);
371
- // event.preventDefault();
372
- // }
373
287
  };
374
288
  onFocus = () => {
375
289
  this.isFocused = true;
376
290
  this.sdFocus.emit();
377
- if (this.sdFocusForceBlur.observers?.length > 0) {
291
+ // RxJS 7 chuẩn bài
292
+ if (this.sdFocusForceBlur.observed) {
378
293
  this.blur();
379
294
  this.sdFocusForceBlur.emit();
380
295
  }
@@ -382,14 +297,13 @@ class SdInputNumber {
382
297
  onBlur = () => {
383
298
  this.isFocused = false;
384
299
  const val = (this.inputControl.value ?? '').toString();
385
- // If value is empty, set to empty string and emit to model
386
300
  if (!val || val.trim() === '') {
387
301
  this.inputControl.setValue('', { emitEvent: false });
388
302
  this.#onChange(null);
389
303
  this.sdBlur.emit(null);
390
304
  return;
391
305
  }
392
- const arrayValue = val.split(this.#decimalSeparator);
306
+ const arrayValue = val.split(this.decimalSeparator());
393
307
  if (arrayValue.length >= 2 && arrayValue[1] == '') {
394
308
  this.inputControl.setValue(this.#formatNumber(arrayValue[0]));
395
309
  return;
@@ -400,7 +314,7 @@ class SdInputNumber {
400
314
  this.sdBlur.emit(this.formControl.value);
401
315
  };
402
316
  onClick = () => {
403
- if (this.sdViewDef?.templateRef) {
317
+ if (this.sdViewDef()?.templateRef) {
404
318
  if (!this.formControl.disabled && !this.isFocused) {
405
319
  this.focus();
406
320
  }
@@ -408,16 +322,16 @@ class SdInputNumber {
408
322
  };
409
323
  blur = () => {
410
324
  this.isFocused = false;
411
- this.control?.nativeElement?.blur();
325
+ this.control()?.nativeElement?.blur();
412
326
  };
413
327
  focus = () => {
414
328
  this.isFocused = true;
415
329
  setTimeout(() => {
416
- this.control?.nativeElement?.focus();
330
+ this.control()?.nativeElement?.focus();
417
331
  }, 100);
418
332
  };
419
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdInputNumber, deps: [{ token: i0.ChangeDetectorRef }, { token: SD_CORE_CONFIGURATION, optional: true }, { token: i1.SdFormatNumberPipe }, { token: SD_FORM_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
420
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdInputNumber, isStandalone: true, selector: "sd-input-number", inputs: { _autoId: ["autoId", "_autoId"], name: "name", size: "size", form: "form", _label: ["label", "_label"], _helperText: ["helperText", "_helperText"], placeholder: "placeholder", _hideInlineError: ["hideInlineError", "_hideInlineError"], _blurOnEnter: ["blurOnEnter", "_blurOnEnter"], model: "model", _required: ["required", "_required"], type: "type", precision: "precision", _readonly: ["readonly", "_readonly"], _min: ["min", "_min"], _max: ["max", "_max"], validator: "validator", _inlineError: ["inlineError", "_inlineError"], disabled: "disabled", _viewed: ["viewed", "_viewed"], hyperlink: "hyperlink", appearance: "appearance" }, outputs: { modelChange: "modelChange", sdChange: "sdChange", sdFocus: "sdFocus", sdBlur: "sdBlur", sdFocusForceBlur: "sdFocusForceBlur", keyupEnter: "keyupEnter" }, queries: [{ propertyName: "sdLabelTemplate", first: true, predicate: ["sdLabel"], descendants: true }, { propertyName: "sdValueTemplate", first: true, predicate: ["sdValue"], descendants: true }, { propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true }, { propertyName: "sdSuffixDef", first: true, predicate: SdSuffixDefDirective, descendants: true }], viewQueries: [{ propertyName: "control", first: true, predicate: ["control"], descendants: true }], ngImport: i0, template: "@if (viewed) {\r\n <sd-view\r\n [label]=\"label\"\r\n [labelTemplate]=\"sdLabelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value | sdFormatNumber\"\r\n [hyperlink]=\"hyperlink\"\r\n [valueTemplate]=\"sdValueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if (!appearance) {\r\n <ng-content select=\"[sdLabel]\">\r\n @if (label) {\r\n <sd-label [label]=\"label\" [required]=\"required\"></sd-label>\r\n }\r\n </ng-content>\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=\"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]=\"inputControl\"\r\n #control\r\n matInput\r\n [placeholder]=\"placeholder || label || ''\"\r\n [errorStateMatcher]=\"matcher\"\r\n (keyup.enter)=\"onKeyupEnter()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (compositionstart)=\"onCompositionStart($event)\"\r\n (compositionend)=\"onCompositionEnd($event)\"\r\n [required]=\"required\"\r\n [readonly]=\"readonly\"\r\n [autocomplete]=\"id\"\r\n (paste)=\"onPaste($event)\"\r\n autocorrect=\"off\"\r\n [attr.data-autoId]=\"autoId\" />\r\n @if (sdSuffixDef?.templateRef) {\r\n <ng-container matSuffix>\r\n <ng-container [ngTemplateOutlet]=\"sdSuffixDef?.templateRef ?? null\"></ng-container>\r\n </ng-container>\r\n }\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?.['min']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Gi\u00E1 tr\u1ECB kh\u00F4ng \u0111\u01B0\u1EE3c nh\u1ECF h\u01A1n ' }} <strong>{{ min }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['max']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Gi\u00E1 tr\u1ECB kh\u00F4ng \u0111\u01B0\u1EE3c l\u1EDBn h\u01A1n ' }} <strong>{{ max }}</strong>\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 }\r\n </div>\r\n <!-- <sd-popover #error=\"sdPopover\" type=\"danger\" width=\"300px\">\r\n <span *ngIf=\"formControl.errors?.required\">\r\n {{ \"Vui l\u00F2ng nh\u1EADp th\u00F4ng tin\" | sdTranslate }}\r\n </span>\r\n <span *ngIf=\"formControl.errors?.customValidator\">\r\n {{formControl.errors?.customValidator}}\r\n </span>\r\n</sd-popover> -->\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}.btn-copy{visibility:hidden;background:#e9e9e9!important;line-height:26px!important;margin-bottom:3px;font-size:12px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.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: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.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: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.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: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "pipe", type: SdFormatNumberPipe, name: "sdFormatNumber" }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
333
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdInputNumber, deps: [], target: i0.ɵɵFactoryTarget.Component });
334
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdInputNumber, isStandalone: true, selector: "sd-input-number", 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 }, 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 }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, precision: { classPropertyName: "precision", publicName: "precision", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, 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 }, 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", 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: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true, isSignal: true }, { propertyName: "sdSuffixDef", first: true, predicate: SdSuffixDefDirective, 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\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 | sdFormatNumber\"\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]=\"required()\"></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 [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]=\"inputControl\"\r\n #control\r\n matInput\r\n [placeholder]=\"placeholder() || lbl || ''\"\r\n [errorStateMatcher]=\"matcher\"\r\n (keyup.enter)=\"onKeyupEnter()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (compositionstart)=\"onCompositionStart($event)\"\r\n (compositionend)=\"onCompositionEnd($event)\"\r\n [required]=\"required()\"\r\n [readonly]=\"readonly()\"\r\n [autocomplete]=\"id\"\r\n (paste)=\"onPaste($event)\"\r\n autocorrect=\"off\"\r\n [attr.data-autoId]=\"autoId()\" />\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?.['min']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Gi\u00E1 tr\u1ECB kh\u00F4ng \u0111\u01B0\u1EE3c nh\u1ECF h\u01A1n ' }} <strong>{{ min() }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['max']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Gi\u00E1 tr\u1ECB kh\u00F4ng \u0111\u01B0\u1EE3c l\u1EDBn h\u01A1n ' }} <strong>{{ max() }}</strong>\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 </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}.btn-copy{visibility:hidden;background:#e9e9e9!important;line-height:26px!important;margin-bottom:3px;font-size:12px}\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: "pipe", type: SdFormatNumberPipe, name: "sdFormatNumber" }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
421
335
  }
422
336
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdInputNumber, decorators: [{
423
337
  type: Component,
@@ -432,100 +346,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
432
346
  MatButtonModule,
433
347
  SdLabel,
434
348
  SdFormatNumberPipe,
435
- SdView
436
- ], template: "@if (viewed) {\r\n <sd-view\r\n [label]=\"label\"\r\n [labelTemplate]=\"sdLabelTemplate\"\r\n [value]=\"formControl.value\"\r\n [display]=\"formControl.value | sdFormatNumber\"\r\n [hyperlink]=\"hyperlink\"\r\n [valueTemplate]=\"sdValueTemplate\">\r\n </sd-view>\r\n} @else {\r\n @if (!appearance) {\r\n <ng-content select=\"[sdLabel]\">\r\n @if (label) {\r\n <sd-label [label]=\"label\" [required]=\"required\"></sd-label>\r\n }\r\n </ng-content>\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=\"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]=\"inputControl\"\r\n #control\r\n matInput\r\n [placeholder]=\"placeholder || label || ''\"\r\n [errorStateMatcher]=\"matcher\"\r\n (keyup.enter)=\"onKeyupEnter()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (compositionstart)=\"onCompositionStart($event)\"\r\n (compositionend)=\"onCompositionEnd($event)\"\r\n [required]=\"required\"\r\n [readonly]=\"readonly\"\r\n [autocomplete]=\"id\"\r\n (paste)=\"onPaste($event)\"\r\n autocorrect=\"off\"\r\n [attr.data-autoId]=\"autoId\" />\r\n @if (sdSuffixDef?.templateRef) {\r\n <ng-container matSuffix>\r\n <ng-container [ngTemplateOutlet]=\"sdSuffixDef?.templateRef ?? null\"></ng-container>\r\n </ng-container>\r\n }\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?.['min']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Gi\u00E1 tr\u1ECB kh\u00F4ng \u0111\u01B0\u1EE3c nh\u1ECF h\u01A1n ' }} <strong>{{ min }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['max']) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Gi\u00E1 tr\u1ECB kh\u00F4ng \u0111\u01B0\u1EE3c l\u1EDBn h\u01A1n ' }} <strong>{{ max }}</strong>\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 }\r\n </div>\r\n <!-- <sd-popover #error=\"sdPopover\" type=\"danger\" width=\"300px\">\r\n <span *ngIf=\"formControl.errors?.required\">\r\n {{ \"Vui l\u00F2ng nh\u1EADp th\u00F4ng tin\" | sdTranslate }}\r\n </span>\r\n <span *ngIf=\"formControl.errors?.customValidator\">\r\n {{formControl.errors?.customValidator}}\r\n </span>\r\n</sd-popover> -->\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}.btn-copy{visibility:hidden;background:#e9e9e9!important;line-height:26px!important;margin-bottom:3px;font-size:12px}\n"] }]
437
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
438
- type: Inject,
439
- args: [SD_CORE_CONFIGURATION]
440
- }, {
441
- type: Optional
442
- }] }, { type: i1.SdFormatNumberPipe }, { type: undefined, decorators: [{
443
- type: Inject,
444
- args: [SD_FORM_CONFIGURATION]
445
- }, {
446
- type: Optional
447
- }] }], propDecorators: { sdLabelTemplate: [{
448
- type: ContentChild,
449
- args: ['sdLabel']
450
- }], sdValueTemplate: [{
451
- type: ContentChild,
452
- args: ['sdValue']
453
- }], _autoId: [{
454
- type: Input,
455
- args: ['autoId']
456
- }], name: [{
457
- type: Input
458
- }], size: [{
459
- type: Input
460
- }], form: [{
461
- type: Input
462
- }], _label: [{
463
- type: Input,
464
- args: ['label']
465
- }], _helperText: [{
466
- type: Input,
467
- args: ['helperText']
468
- }], placeholder: [{
469
- type: Input
470
- }], _hideInlineError: [{
471
- type: Input,
472
- args: ['hideInlineError']
473
- }], _blurOnEnter: [{
474
- type: Input,
475
- args: ['blurOnEnter']
476
- }], model: [{
477
- type: Input
478
- }], modelChange: [{
479
- type: Output
480
- }], _required: [{
481
- type: Input,
482
- args: ['required']
483
- }], type: [{
484
- type: Input
485
- }], precision: [{
486
- type: Input
487
- }], _readonly: [{
488
- type: Input,
489
- args: ['readonly']
490
- }], _min: [{
491
- type: Input,
492
- args: ['min']
493
- }], _max: [{
494
- type: Input,
495
- args: ['max']
496
- }], validator: [{
497
- type: Input
498
- }], _inlineError: [{
499
- type: Input,
500
- args: ['inlineError']
501
- }], disabled: [{
502
- type: Input
503
- }], _viewed: [{
504
- type: Input,
505
- args: ['viewed']
506
- }], hyperlink: [{
507
- type: Input
508
- }], appearance: [{
509
- type: Input
510
- }], sdChange: [{
511
- type: Output
512
- }], sdFocus: [{
513
- type: Output
514
- }], sdBlur: [{
515
- type: Output
516
- }], sdFocusForceBlur: [{
517
- type: Output
518
- }], keyupEnter: [{
349
+ SdView,
350
+ ], 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\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 | sdFormatNumber\"\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]=\"required()\"></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 [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]=\"inputControl\"\r\n #control\r\n matInput\r\n [placeholder]=\"placeholder() || lbl || ''\"\r\n [errorStateMatcher]=\"matcher\"\r\n (keyup.enter)=\"onKeyupEnter()\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (compositionstart)=\"onCompositionStart($event)\"\r\n (compositionend)=\"onCompositionEnd($event)\"\r\n [required]=\"required()\"\r\n [readonly]=\"readonly()\"\r\n [autocomplete]=\"id\"\r\n (paste)=\"onPaste($event)\"\r\n autocorrect=\"off\"\r\n [attr.data-autoId]=\"autoId()\" />\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?.['min']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Gi\u00E1 tr\u1ECB kh\u00F4ng \u0111\u01B0\u1EE3c nh\u1ECF h\u01A1n ' }} <strong>{{ min() }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n\r\n @if (formControl.errors?.['max']) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Gi\u00E1 tr\u1ECB kh\u00F4ng \u0111\u01B0\u1EE3c l\u1EDBn h\u01A1n ' }} <strong>{{ max() }}</strong>\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 </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}.btn-copy{visibility:hidden;background:#e9e9e9!important;line-height:26px!important;margin-bottom:3px;font-size:12px}\n"] }]
351
+ }], ctorParameters: () => [], propDecorators: { sdFocusForceBlur: [{
519
352
  type: Output
520
- }], control: [{
521
- type: ViewChild,
522
- args: ['control']
523
- }], sdViewDef: [{
524
- type: ContentChild,
525
- args: [SdViewDefDirective]
526
- }], sdSuffixDef: [{
527
- type: ContentChild,
528
- args: [SdSuffixDefDirective]
529
353
  }] } });
530
354
 
531
355
  /**