@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.
- package/components/view/src/view.component.d.ts +11 -11
- package/fesm2022/sd-angular-core-components-table.mjs +4 -4
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-view.mjs +28 -40
- package/fesm2022/sd-angular-core-components-view.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-workflow.mjs +22 -22
- package/fesm2022/sd-angular-core-components-workflow.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs +165 -327
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs +134 -279
- package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs +132 -289
- package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs +161 -337
- package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs +126 -286
- package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +205 -400
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-textarea.mjs +120 -226
- package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-layout.mjs +1 -1
- package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-confirm.mjs +1 -1
- package/forms/autocomplete/src/autocomplete.component.d.ts +44 -51
- package/forms/date/src/date.component.d.ts +40 -46
- package/forms/datetime/src/datetime.component.d.ts +39 -47
- package/forms/input/src/input.component.d.ts +44 -55
- package/forms/input-number/src/input-number.component.d.ts +45 -53
- package/forms/select/src/select.component.d.ts +47 -56
- package/forms/textarea/src/textarea.component.d.ts +33 -40
- package/package.json +56 -56
- package/sd-angular-core-19.0.0-beta.33.tgz +0 -0
- package/sd-angular-core-19.0.0-beta.32.tgz +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
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 {
|
|
4
|
+
import { viewChild, contentChild, inject, ChangeDetectorRef, input, computed, booleanAttribute, model, output, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
5
|
import * as i2 from '@angular/forms';
|
|
6
|
-
import {
|
|
6
|
+
import { Validators, NgForm, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
7
7
|
import { provideMomentDateAdapter } from '@angular/material-moment-adapter';
|
|
8
8
|
import * as i6 from '@angular/material/datepicker';
|
|
9
|
-
import {
|
|
9
|
+
import { MatDatepicker, MatDatepickerModule } from '@angular/material/datepicker';
|
|
10
10
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
11
|
import * as i4 from '@angular/material/icon';
|
|
12
12
|
import { MatIconModule } from '@angular/material/icon';
|
|
@@ -17,183 +17,133 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
|
|
17
17
|
import { SdView } from '@sd-angular/core/components/view';
|
|
18
18
|
import { SdViewDefDirective, SdLabelDefDirective } from '@sd-angular/core/forms/directives';
|
|
19
19
|
import { SdLabel } from '@sd-angular/core/forms/label';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
20
|
+
import { SD_FORM_CONFIGURATION, SdFormControl } from '@sd-angular/core/forms/models';
|
|
21
|
+
import { SdUtilities, DateUtilities } from '@sd-angular/core/utilities/extensions';
|
|
22
22
|
import moment from 'moment';
|
|
23
23
|
import { Subscription } from 'rxjs';
|
|
24
24
|
import * as uuid from 'uuid';
|
|
25
25
|
|
|
26
26
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
27
27
|
/* eslint-disable @angular-eslint/no-input-rename */
|
|
28
|
-
// eslint-disable-next-line @angular-eslint/component-class-suffix
|
|
29
28
|
class SdDate {
|
|
30
|
-
ref;
|
|
31
|
-
formConfig;
|
|
32
|
-
sdLabelTemplate;
|
|
33
|
-
sdValueTemplate;
|
|
34
29
|
id = `I${uuid.v4()}`;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
30
|
+
// ==========================================
|
|
31
|
+
// 1. SIGNAL QUERIES
|
|
32
|
+
// ==========================================
|
|
33
|
+
inputRef = viewChild('input');
|
|
34
|
+
datePicker = viewChild(MatDatepicker);
|
|
35
|
+
sdLabelTemplate = contentChild('sdLabel');
|
|
36
|
+
sdValueTemplate = contentChild('sdValue');
|
|
37
|
+
sdViewDef = contentChild(SdViewDefDirective);
|
|
38
|
+
sdLabelDef = contentChild(SdLabelDefDirective);
|
|
39
|
+
// ==========================================
|
|
40
|
+
// 2. INJECTS
|
|
41
|
+
// ==========================================
|
|
42
|
+
ref = inject(ChangeDetectorRef);
|
|
43
|
+
formConfig = inject(SD_FORM_CONFIGURATION, { optional: true });
|
|
44
|
+
// ==========================================
|
|
45
|
+
// 3. SIGNAL INPUTS & MODEL
|
|
46
|
+
// ==========================================
|
|
47
|
+
autoIdInput = input(undefined, { alias: 'autoId' });
|
|
48
|
+
autoId = computed(() => this.autoIdInput() ? `forms-date-${this.autoIdInput()}` : undefined);
|
|
49
|
+
name = input(uuid.v4());
|
|
50
|
+
size = input('md');
|
|
51
|
+
form = input();
|
|
52
|
+
label = input();
|
|
53
|
+
helperText = input();
|
|
54
|
+
placeholder = input();
|
|
55
|
+
hideInlineError = input(false, { transform: booleanAttribute });
|
|
56
|
+
required = input(false, { transform: booleanAttribute });
|
|
57
|
+
disabled = input(false, { transform: booleanAttribute });
|
|
58
|
+
viewed = input(false, { transform: booleanAttribute });
|
|
59
|
+
inlineError = input();
|
|
60
|
+
hyperlink = input();
|
|
61
|
+
appearanceInput = input(undefined, { alias: 'appearance' });
|
|
62
|
+
appearance = computed(() => this.appearanceInput() ?? this.formConfig?.appearance ?? 'outline');
|
|
63
|
+
// Xử lý thông minh Gom min/minDate và max/maxDate
|
|
64
|
+
minInput = input(undefined, { alias: 'min' });
|
|
65
|
+
minDateInput = input(undefined, { alias: 'minDate' });
|
|
66
|
+
resolvedMin = computed(() => this.#parseDateBoundary(this.minInput() ?? this.minDateInput()));
|
|
67
|
+
maxInput = input(undefined, { alias: 'max' });
|
|
68
|
+
maxDateInput = input(undefined, { alias: 'maxDate' });
|
|
69
|
+
resolvedMax = computed(() => this.#parseDateBoundary(this.maxInput() ?? this.maxDateInput()));
|
|
70
|
+
valueModel = model(undefined, { alias: 'model' });
|
|
71
|
+
// ==========================================
|
|
72
|
+
// 4. SIGNAL OUTPUTS
|
|
73
|
+
// ==========================================
|
|
74
|
+
sdChange = output();
|
|
75
|
+
sdFocus = output();
|
|
76
|
+
// ==========================================
|
|
77
|
+
// 5. INTERNAL STATE & STREAMS
|
|
78
|
+
// ==========================================
|
|
79
|
+
isMobileOrTablet = SdUtilities.isMobile();
|
|
56
80
|
formControl = new SdFormControl();
|
|
57
|
-
min;
|
|
58
|
-
set _min(val) {
|
|
59
|
-
if (val === 'TODAY') {
|
|
60
|
-
this.min = new Date();
|
|
61
|
-
}
|
|
62
|
-
else if (val && DateUtilities.isDate(val)) {
|
|
63
|
-
this.min = new Date(val);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
this.min = null;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
max;
|
|
70
|
-
set _max(val) {
|
|
71
|
-
if (val === 'TODAY') {
|
|
72
|
-
this.max = new Date();
|
|
73
|
-
}
|
|
74
|
-
else if (val && DateUtilities.isDate(val)) {
|
|
75
|
-
this.max = new Date(val);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
this.max = null;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
size = 'md';
|
|
82
|
-
#form;
|
|
83
|
-
set form(val) {
|
|
84
|
-
if (val) {
|
|
85
|
-
if (val instanceof NgForm) {
|
|
86
|
-
this.#form = val.form;
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
this.#form = val;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
set disabled(val) {
|
|
94
|
-
val = val === '' || !!val;
|
|
95
|
-
if (val) {
|
|
96
|
-
this.formControl.disable();
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
this.formControl.enable();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
viewed = false;
|
|
103
|
-
set _viewed(val) {
|
|
104
|
-
this.viewed = val === '' || !!val;
|
|
105
|
-
}
|
|
106
|
-
hyperlink;
|
|
107
|
-
required = false;
|
|
108
|
-
set _required(val) {
|
|
109
|
-
this.required = val === '' || !!val;
|
|
110
|
-
if (this.required) {
|
|
111
|
-
this.formControl.setValidators([Validators.required]);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
this.formControl.clearValidators();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
inlineError;
|
|
118
|
-
set _inlineError(val) {
|
|
119
|
-
this.inlineError = val;
|
|
120
|
-
// this.#updateValidator();
|
|
121
|
-
if (this.inlineError) {
|
|
122
|
-
this.formControl.setValidators([this.customInlineErrorValidator()]);
|
|
123
|
-
this.formControl.updateValueAndValidity();
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
this.formControl.clearValidators();
|
|
127
|
-
this.formControl.updateValueAndValidity();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
label;
|
|
131
|
-
set _label(val) {
|
|
132
|
-
this.label = val;
|
|
133
|
-
}
|
|
134
|
-
helperText;
|
|
135
|
-
set _helperText(val) {
|
|
136
|
-
this.helperText = val;
|
|
137
|
-
}
|
|
138
|
-
placeholder;
|
|
139
|
-
set minDate(val) {
|
|
140
|
-
if (DateUtilities.isDate(val)) {
|
|
141
|
-
this.min = new Date(val);
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
this.min = null;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
set maxDate(val) {
|
|
148
|
-
if (DateUtilities.isDate(val)) {
|
|
149
|
-
this.max = new Date(val);
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
this.max = null;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
sdChange = new EventEmitter();
|
|
156
|
-
sdFocus = new EventEmitter();
|
|
157
|
-
set model(val) {
|
|
158
|
-
if (!DateUtilities.isDate(val)) {
|
|
159
|
-
val = null;
|
|
160
|
-
}
|
|
161
|
-
val = DateUtilities.toFormat(val, 'yyyy/MM/dd');
|
|
162
|
-
if (this.#date !== val) {
|
|
163
|
-
this.#date = val;
|
|
164
|
-
const date = DateUtilities.isDate(this.#date) ? moment(DateUtilities.toFormat(this.#date, 'yyyy/MM/dd'), 'YYYY/MM/DD') : null;
|
|
165
|
-
this.formControl.setValue(date);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
modelChange = new EventEmitter();
|
|
169
|
-
#subscription = new Subscription();
|
|
170
|
-
sdViewDef;
|
|
171
|
-
sdLabelDef;
|
|
172
|
-
input;
|
|
173
|
-
datePicker;
|
|
174
81
|
isFocused = false;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
82
|
+
isValid;
|
|
83
|
+
#date;
|
|
84
|
+
#subscription = new Subscription();
|
|
85
|
+
constructor() {
|
|
86
|
+
// EFFECT 1: Sync model thay đổi từ bên ngoài (String/Date -> Moment)
|
|
87
|
+
effect(() => {
|
|
88
|
+
let val = this.valueModel();
|
|
89
|
+
untracked(() => {
|
|
90
|
+
if (!DateUtilities.isDate(val)) {
|
|
91
|
+
val = null;
|
|
92
|
+
}
|
|
93
|
+
val = DateUtilities.toFormat(val, 'yyyy/MM/dd');
|
|
94
|
+
if (this.#date !== val) {
|
|
95
|
+
this.#date = val;
|
|
96
|
+
const dateObj = DateUtilities.isDate(this.#date)
|
|
97
|
+
? moment(DateUtilities.toFormat(this.#date, 'yyyy/MM/dd'), 'YYYY/MM/DD')
|
|
98
|
+
: null;
|
|
99
|
+
this.formControl.setValue(dateObj, { emitEvent: false });
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
// EFFECT 2: Sync Disable
|
|
104
|
+
effect(() => {
|
|
105
|
+
if (this.disabled())
|
|
106
|
+
this.formControl.disable({ emitEvent: false });
|
|
107
|
+
else
|
|
108
|
+
this.formControl.enable({ emitEvent: false });
|
|
109
|
+
});
|
|
110
|
+
// EFFECT 3: Update Validators
|
|
111
|
+
effect(() => {
|
|
112
|
+
const req = this.required();
|
|
113
|
+
const inl = this.inlineError();
|
|
114
|
+
untracked(() => {
|
|
115
|
+
const validators = [];
|
|
116
|
+
if (req)
|
|
117
|
+
validators.push(Validators.required);
|
|
118
|
+
if (inl)
|
|
119
|
+
validators.push(this.customInlineErrorValidator());
|
|
120
|
+
this.formControl.setValidators(validators.length ? validators : null);
|
|
121
|
+
this.formControl.updateValueAndValidity({ emitEvent: false });
|
|
122
|
+
});
|
|
123
|
+
});
|
|
183
124
|
}
|
|
184
125
|
ngOnInit() {
|
|
185
|
-
this.appearance = this.appearance || this.formConfig?.appearance;
|
|
186
126
|
this.#subscription.add(this.formControl.sdChanges.subscribe(() => {
|
|
187
|
-
// this.formControl.updateValueAndValidity();
|
|
188
127
|
this.ref.markForCheck();
|
|
189
128
|
}));
|
|
190
|
-
this
|
|
129
|
+
const formGroup = this.form() instanceof NgForm ? this.form().form : this.form();
|
|
130
|
+
formGroup?.addControl(this.name(), this.formControl);
|
|
131
|
+
}
|
|
132
|
+
ngOnDestroy() {
|
|
133
|
+
const formGroup = this.form() instanceof NgForm ? this.form().form : this.form();
|
|
134
|
+
formGroup?.removeControl(this.name());
|
|
135
|
+
this.#subscription.unsubscribe();
|
|
136
|
+
}
|
|
137
|
+
// Hàm private tái sử dụng cho parse Min/Max Date
|
|
138
|
+
#parseDateBoundary(val) {
|
|
139
|
+
if (val === 'TODAY')
|
|
140
|
+
return new Date();
|
|
141
|
+
if (val && DateUtilities.isDate(val))
|
|
142
|
+
return new Date(val);
|
|
143
|
+
return null;
|
|
191
144
|
}
|
|
192
|
-
// Hàm tạo Validators tùy chỉnh cho inlineError
|
|
193
145
|
customInlineErrorValidator() {
|
|
194
|
-
return () => {
|
|
195
|
-
return { inlineError: true };
|
|
196
|
-
};
|
|
146
|
+
return () => ({ inlineError: true });
|
|
197
147
|
}
|
|
198
148
|
onFocus = () => {
|
|
199
149
|
this.isFocused = true;
|
|
@@ -203,38 +153,30 @@ class SdDate {
|
|
|
203
153
|
this.isFocused = false;
|
|
204
154
|
};
|
|
205
155
|
onClick = () => {
|
|
206
|
-
if (this.sdViewDef?.templateRef) {
|
|
156
|
+
if (this.sdViewDef()?.templateRef) {
|
|
207
157
|
if (!this.formControl.disabled && !this.isFocused) {
|
|
208
158
|
this.focus();
|
|
209
159
|
}
|
|
210
160
|
}
|
|
211
161
|
};
|
|
212
162
|
blur = () => {
|
|
213
|
-
this.
|
|
163
|
+
this.inputRef()?.nativeElement?.blur();
|
|
214
164
|
};
|
|
215
165
|
focus = () => {
|
|
216
166
|
this.isFocused = true;
|
|
217
167
|
setTimeout(() => {
|
|
218
|
-
this.
|
|
219
|
-
this.datePicker?.open();
|
|
220
|
-
//
|
|
168
|
+
this.inputRef()?.nativeElement?.focus();
|
|
169
|
+
this.datePicker()?.open();
|
|
221
170
|
}, 100);
|
|
222
171
|
};
|
|
223
172
|
focusInputElement() {
|
|
224
|
-
this.
|
|
173
|
+
this.inputRef()?.nativeElement?.focus();
|
|
225
174
|
}
|
|
226
|
-
isValid;
|
|
227
175
|
onKeyDown = (event) => {
|
|
228
176
|
const key = event.keyCode || event.charCode;
|
|
229
|
-
|
|
230
|
-
if (key ===
|
|
231
|
-
isShift = true;
|
|
232
|
-
}
|
|
233
|
-
// cho phép copy parse
|
|
234
|
-
if (event.ctrlKey && (key === 67 || key === 86)) {
|
|
177
|
+
const isShift = key === 16;
|
|
178
|
+
if (event.ctrlKey && (key === 67 || key === 86))
|
|
235
179
|
return true;
|
|
236
|
-
}
|
|
237
|
-
// Allow only Numeric Keys.
|
|
238
180
|
if (((key >= 48 && key <= 57) ||
|
|
239
181
|
key === 8 ||
|
|
240
182
|
key <= 37 ||
|
|
@@ -243,12 +185,10 @@ class SdDate {
|
|
|
243
185
|
key === 191 ||
|
|
244
186
|
key === 186 ||
|
|
245
187
|
key === 59) &&
|
|
246
|
-
isShift
|
|
188
|
+
!isShift) {
|
|
247
189
|
return true;
|
|
248
190
|
}
|
|
249
|
-
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
191
|
+
return false;
|
|
252
192
|
};
|
|
253
193
|
onKeyup = (event) => {
|
|
254
194
|
const currentVal = event.target.value;
|
|
@@ -259,10 +199,7 @@ class SdDate {
|
|
|
259
199
|
this.isValid = true;
|
|
260
200
|
formControl.markAsDirty();
|
|
261
201
|
formControl.markAsTouched();
|
|
262
|
-
formControl.setErrors({
|
|
263
|
-
...formControl.errors,
|
|
264
|
-
date: `Sai định dạng`,
|
|
265
|
-
});
|
|
202
|
+
formControl.setErrors({ ...formControl.errors, date: `Sai định dạng` });
|
|
266
203
|
}, 0);
|
|
267
204
|
}
|
|
268
205
|
else {
|
|
@@ -274,20 +211,18 @@ class SdDate {
|
|
|
274
211
|
}
|
|
275
212
|
};
|
|
276
213
|
onChange = (event) => {
|
|
277
|
-
// const value = event.value?.toDate();
|
|
278
|
-
//
|
|
279
214
|
const value = DateUtilities.toFormat(event.value?.toDate(), 'yyyy/MM/dd');
|
|
280
|
-
this.
|
|
215
|
+
this.inputRef()?.nativeElement?.focus();
|
|
281
216
|
if (!this.isValid) {
|
|
282
217
|
if (this.#date !== value) {
|
|
283
|
-
this.
|
|
218
|
+
this.valueModel.set(value);
|
|
284
219
|
this.sdChange.emit(value);
|
|
285
220
|
}
|
|
286
221
|
}
|
|
287
222
|
else {
|
|
288
223
|
this.isValid = false;
|
|
289
224
|
this.formControl.setValue(null);
|
|
290
|
-
this.
|
|
225
|
+
this.valueModel.set(null);
|
|
291
226
|
this.sdChange.emit(null);
|
|
292
227
|
}
|
|
293
228
|
};
|
|
@@ -295,16 +230,14 @@ class SdDate {
|
|
|
295
230
|
$event?.stopPropagation();
|
|
296
231
|
if (this.formControl.value) {
|
|
297
232
|
this.formControl.setValue(null);
|
|
298
|
-
this.
|
|
233
|
+
this.valueModel.set(null);
|
|
299
234
|
this.sdChange.emit(null);
|
|
300
235
|
}
|
|
301
236
|
};
|
|
302
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdDate, deps: [
|
|
303
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdDate, isStandalone: true, selector: "sd-date", inputs: {
|
|
237
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdDate, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
238
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdDate, isStandalone: true, selector: "sd-date", 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 }, 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 }, 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 }, minInput: { classPropertyName: "minInput", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, minDateInput: { classPropertyName: "minDateInput", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxInput: { classPropertyName: "maxInput", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, maxDateInput: { classPropertyName: "maxDateInput", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, valueModel: { classPropertyName: "valueModel", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueModel: "modelChange", sdChange: "sdChange", sdFocus: "sdFocus" }, providers: [
|
|
304
239
|
provideMomentDateAdapter({
|
|
305
|
-
parse: {
|
|
306
|
-
dateInput: 'DD/MM/YYYY',
|
|
307
|
-
},
|
|
240
|
+
parse: { dateInput: 'DD/MM/YYYY' },
|
|
308
241
|
display: {
|
|
309
242
|
dateInput: 'DD/MM/YYYY',
|
|
310
243
|
monthYearLabel: 'MMM YYYY',
|
|
@@ -312,15 +245,13 @@ class SdDate {
|
|
|
312
245
|
monthYearA11yLabel: 'MMMM YYYY',
|
|
313
246
|
},
|
|
314
247
|
}),
|
|
315
|
-
], 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: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "datePicker", first: true, predicate: MatDatepicker, 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 | date: 'dd/MM/yyyy'\"\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 <!-- Th\u00EAm area-hidden=true \u0111\u1EC3 kh\u00F4ng b\u1ECB c\u1EA3nh b\u00E1o g\u1EAFn s\u1EF1 ki\u1EC7n click th\u1EBB div -->\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 && !datePicker?.opened) {\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=\"c-form-field-date-input\"\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 matInput\r\n (keyup)=\"onKeyup($event)\"\r\n (keydown)=\"onKeyDown($event)\"\r\n (dateChange)=\"onChange($event)\"\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [formControl]=\"formControl\"\r\n [required]=\"required\"\r\n [matDatepicker]=\"picker2\"\r\n [placeholder]=\"placeholder || label || ''\"\r\n [min]=\"min\"\r\n [max]=\"max\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [attr.data-autoId]=\"autoId\"\r\n #input\r\n [maxLength]=\"10\" />\r\n @if (formControl.value && !required && !formControl.disabled) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear($event)\" matSuffix>cancel </mat-icon>\r\n }\r\n\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"!formControl.disabled && picker2.open()\" #btn matSuffix>today </mat-icon>\r\n\r\n <mat-datepicker #picker2 [touchUi]=\"isMobileOrTablet\"></mat-datepicker>\r\n\r\n @if (formControl.errors?.['required'] && formControl.touched) {\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 @if (formControl.errors?.['matDatepickerMin'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Ng\u00E0y nh\u1ECF nh\u1EA5t' }}: <strong>{{ min | date: 'dd/MM/yyyy' }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['matDatepickerMax'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Ng\u00E0y l\u1EDBn nh\u1EA5t' }}: <strong>{{ max | date: 'dd/MM/yyyy' }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['matDatetimePickerParse'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Parse error' }}: <strong>{{ formControl.errors?.['matDatetimePickerParse']?.text }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['customValidator'] && formControl.touched) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['date'] && formControl.touched) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ formControl.errors?.['date'] }}\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['inlineError'] && formControl.touched) {\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}\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 .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)}:host ::ng-deep .mat-mdc-form-field-icon-suffix{display:flex}.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: "pipe", type: i1.DatePipe, name: "date" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i6.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i6.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
248
|
+
], 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: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, isSignal: true }, { propertyName: "datePicker", first: true, predicate: MatDatepicker, descendants: true, isSignal: true }], ngImport: i0, template: "@let lbl = label();\r\n@let app = appearance();\r\n@let hideErr = hideInlineError();\r\n@let viewDef = sdViewDef();\r\n@let hText = helperText();\r\n@let req = required();\r\n\r\n@let minD = resolvedMin();\r\n@let maxD = resolvedMax();\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 | date: 'dd/MM/yyyy'\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"sdValueTemplate()\">\r\n </sd-view>\r\n} @else {\r\n @if (!app) {\r\n <ng-content select=\"[sdLabel]\">\r\n @if (lbl) {\r\n <sd-label [label]=\"lbl\" [required]=\"req\"></sd-label>\r\n }\r\n </ng-content>\r\n }\r\n \r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"viewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n \r\n @if (viewDef?.templateRef && !isFocused && !datePicker()?.opened) {\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=\"c-form-field-date-input\"\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 matInput\r\n (keyup)=\"onKeyup($event)\"\r\n (keydown)=\"onKeyDown($event)\"\r\n (dateChange)=\"onChange($event)\"\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [formControl]=\"formControl\"\r\n [required]=\"req\"\r\n [matDatepicker]=\"picker\"\r\n [placeholder]=\"placeholder() || lbl || ''\"\r\n [min]=\"minD\"\r\n [max]=\"maxD\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [attr.data-autoId]=\"autoId()\"\r\n #input\r\n [maxLength]=\"10\" />\r\n \r\n @if (formControl.value && !req && !formControl.disabled) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear($event)\" matSuffix>cancel</mat-icon>\r\n }\r\n\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"!formControl.disabled && picker.open()\" #btn matSuffix>today</mat-icon>\r\n\r\n <mat-datepicker #picker [touchUi]=\"isMobileOrTablet\"></mat-datepicker>\r\n\r\n @if (formControl.errors?.['required'] && formControl.touched) {\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 @if (formControl.errors?.['matDatepickerMin'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Ng\u00E0y nh\u1ECF nh\u1EA5t' }}: <strong>{{ minD | date: 'dd/MM/yyyy' }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['matDatepickerMax'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Ng\u00E0y l\u1EDBn nh\u1EA5t' }}: <strong>{{ maxD | date: 'dd/MM/yyyy' }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['matDatetimePickerParse'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Parse error' }}: <strong>{{ formControl.errors?.['matDatetimePickerParse']?.text }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['customValidator'] && formControl.touched) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['date'] && formControl.touched) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ formControl.errors?.['date'] }}\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['inlineError'] && formControl.touched) {\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 .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)}:host ::ng-deep .mat-mdc-form-field-icon-suffix{display:flex}.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: "pipe", type: i1.DatePipe, name: "date" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i6.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i6.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
316
249
|
}
|
|
317
250
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdDate, decorators: [{
|
|
318
251
|
type: Component,
|
|
319
252
|
args: [{ selector: 'sd-date', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
320
253
|
provideMomentDateAdapter({
|
|
321
|
-
parse: {
|
|
322
|
-
dateInput: 'DD/MM/YYYY',
|
|
323
|
-
},
|
|
254
|
+
parse: { dateInput: 'DD/MM/YYYY' },
|
|
324
255
|
display: {
|
|
325
256
|
dateInput: 'DD/MM/YYYY',
|
|
326
257
|
monthYearLabel: 'MMM YYYY',
|
|
@@ -339,84 +270,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
339
270
|
MatDatepickerModule,
|
|
340
271
|
SdLabel,
|
|
341
272
|
SdView
|
|
342
|
-
], 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 | date: 'dd/MM/yyyy'\"\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 <!-- Th\u00EAm area-hidden=true \u0111\u1EC3 kh\u00F4ng b\u1ECB c\u1EA3nh b\u00E1o g\u1EAFn s\u1EF1 ki\u1EC7n click th\u1EBB div -->\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 && !datePicker?.opened) {\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=\"c-form-field-date-input\"\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 matInput\r\n (keyup)=\"onKeyup($event)\"\r\n (keydown)=\"onKeyDown($event)\"\r\n (dateChange)=\"onChange($event)\"\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [formControl]=\"formControl\"\r\n [required]=\"required\"\r\n [matDatepicker]=\"picker2\"\r\n [placeholder]=\"placeholder || label || ''\"\r\n [min]=\"min\"\r\n [max]=\"max\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [attr.data-autoId]=\"autoId\"\r\n #input\r\n [maxLength]=\"10\" />\r\n @if (formControl.value && !required && !formControl.disabled) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear($event)\" matSuffix>cancel </mat-icon>\r\n }\r\n\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"!formControl.disabled && picker2.open()\" #btn matSuffix>today </mat-icon>\r\n\r\n <mat-datepicker #picker2 [touchUi]=\"isMobileOrTablet\"></mat-datepicker>\r\n\r\n @if (formControl.errors?.['required'] && formControl.touched) {\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 @if (formControl.errors?.['matDatepickerMin'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Ng\u00E0y nh\u1ECF nh\u1EA5t' }}: <strong>{{ min | date: 'dd/MM/yyyy' }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['matDatepickerMax'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Ng\u00E0y l\u1EDBn nh\u1EA5t' }}: <strong>{{ max | date: 'dd/MM/yyyy' }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['matDatetimePickerParse'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ 'Parse error' }}: <strong>{{ formControl.errors?.['matDatetimePickerParse']?.text }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['customValidator'] && formControl.touched) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['date'] && formControl.touched) {\r\n <mat-error>\r\n @if (!hideInlineError) {\r\n {{ formControl.errors?.['date'] }}\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['inlineError'] && formControl.touched) {\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}\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 .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)}:host ::ng-deep .mat-mdc-form-field-icon-suffix{display:flex}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}\n"] }]
|
|
343
|
-
}], ctorParameters: () => [
|
|
344
|
-
type: Inject,
|
|
345
|
-
args: [SD_FORM_CONFIGURATION]
|
|
346
|
-
}, {
|
|
347
|
-
type: Optional
|
|
348
|
-
}] }], propDecorators: { sdLabelTemplate: [{
|
|
349
|
-
type: ContentChild,
|
|
350
|
-
args: ['sdLabel']
|
|
351
|
-
}], sdValueTemplate: [{
|
|
352
|
-
type: ContentChild,
|
|
353
|
-
args: ['sdValue']
|
|
354
|
-
}], _autoId: [{
|
|
355
|
-
type: Input,
|
|
356
|
-
args: ['autoId']
|
|
357
|
-
}], name: [{
|
|
358
|
-
type: Input
|
|
359
|
-
}], appearance: [{
|
|
360
|
-
type: Input
|
|
361
|
-
}], _hideInlineError: [{
|
|
362
|
-
type: Input,
|
|
363
|
-
args: ['hideInlineError']
|
|
364
|
-
}], _min: [{
|
|
365
|
-
type: Input,
|
|
366
|
-
args: ['min']
|
|
367
|
-
}], _max: [{
|
|
368
|
-
type: Input,
|
|
369
|
-
args: ['max']
|
|
370
|
-
}], size: [{
|
|
371
|
-
type: Input
|
|
372
|
-
}], form: [{
|
|
373
|
-
type: Input
|
|
374
|
-
}], disabled: [{
|
|
375
|
-
type: Input
|
|
376
|
-
}], _viewed: [{
|
|
377
|
-
type: Input,
|
|
378
|
-
args: ['viewed']
|
|
379
|
-
}], hyperlink: [{
|
|
380
|
-
type: Input
|
|
381
|
-
}], _required: [{
|
|
382
|
-
type: Input,
|
|
383
|
-
args: ['required']
|
|
384
|
-
}], _inlineError: [{
|
|
385
|
-
type: Input,
|
|
386
|
-
args: ['inlineError']
|
|
387
|
-
}], _label: [{
|
|
388
|
-
type: Input,
|
|
389
|
-
args: ['label']
|
|
390
|
-
}], _helperText: [{
|
|
391
|
-
type: Input,
|
|
392
|
-
args: ['helperText']
|
|
393
|
-
}], placeholder: [{
|
|
394
|
-
type: Input
|
|
395
|
-
}], minDate: [{
|
|
396
|
-
type: Input
|
|
397
|
-
}], maxDate: [{
|
|
398
|
-
type: Input
|
|
399
|
-
}], sdChange: [{
|
|
400
|
-
type: Output
|
|
401
|
-
}], sdFocus: [{
|
|
402
|
-
type: Output
|
|
403
|
-
}], model: [{
|
|
404
|
-
type: Input
|
|
405
|
-
}], modelChange: [{
|
|
406
|
-
type: Output
|
|
407
|
-
}], sdViewDef: [{
|
|
408
|
-
type: ContentChild,
|
|
409
|
-
args: [SdViewDefDirective]
|
|
410
|
-
}], sdLabelDef: [{
|
|
411
|
-
type: ContentChild,
|
|
412
|
-
args: [SdLabelDefDirective]
|
|
413
|
-
}], input: [{
|
|
414
|
-
type: ViewChild,
|
|
415
|
-
args: ['input']
|
|
416
|
-
}], datePicker: [{
|
|
417
|
-
type: ViewChild,
|
|
418
|
-
args: [MatDatepicker]
|
|
419
|
-
}] } });
|
|
273
|
+
], template: "@let lbl = label();\r\n@let app = appearance();\r\n@let hideErr = hideInlineError();\r\n@let viewDef = sdViewDef();\r\n@let hText = helperText();\r\n@let req = required();\r\n\r\n@let minD = resolvedMin();\r\n@let maxD = resolvedMax();\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 | date: 'dd/MM/yyyy'\"\r\n [hyperlink]=\"hyperlink()\"\r\n [valueTemplate]=\"sdValueTemplate()\">\r\n </sd-view>\r\n} @else {\r\n @if (!app) {\r\n <ng-content select=\"[sdLabel]\">\r\n @if (lbl) {\r\n <sd-label [label]=\"lbl\" [required]=\"req\"></sd-label>\r\n }\r\n </ng-content>\r\n }\r\n \r\n <div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"viewDef?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\"\r\n aria-hidden=\"true\">\r\n \r\n @if (viewDef?.templateRef && !isFocused && !datePicker()?.opened) {\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=\"c-form-field-date-input\"\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 matInput\r\n (keyup)=\"onKeyup($event)\"\r\n (keydown)=\"onKeyDown($event)\"\r\n (dateChange)=\"onChange($event)\"\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [formControl]=\"formControl\"\r\n [required]=\"req\"\r\n [matDatepicker]=\"picker\"\r\n [placeholder]=\"placeholder() || lbl || ''\"\r\n [min]=\"minD\"\r\n [max]=\"maxD\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [attr.data-autoId]=\"autoId()\"\r\n #input\r\n [maxLength]=\"10\" />\r\n \r\n @if (formControl.value && !req && !formControl.disabled) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear($event)\" matSuffix>cancel</mat-icon>\r\n }\r\n\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"!formControl.disabled && picker.open()\" #btn matSuffix>today</mat-icon>\r\n\r\n <mat-datepicker #picker [touchUi]=\"isMobileOrTablet\"></mat-datepicker>\r\n\r\n @if (formControl.errors?.['required'] && formControl.touched) {\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 @if (formControl.errors?.['matDatepickerMin'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Ng\u00E0y nh\u1ECF nh\u1EA5t' }}: <strong>{{ minD | date: 'dd/MM/yyyy' }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['matDatepickerMax'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Ng\u00E0y l\u1EDBn nh\u1EA5t' }}: <strong>{{ maxD | date: 'dd/MM/yyyy' }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['matDatetimePickerParse'] && formControl.touched && !isFocused) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ 'Parse error' }}: <strong>{{ formControl.errors?.['matDatetimePickerParse']?.text }}</strong>\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['customValidator'] && formControl.touched) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ formControl.errors?.['customValidator'] }}\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['date'] && formControl.touched) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ formControl.errors?.['date'] }}\r\n }\r\n </mat-error>\r\n }\r\n @if (formControl.errors?.['inlineError'] && formControl.touched) {\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 .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)}:host ::ng-deep .mat-mdc-form-field-icon-suffix{display:flex}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}\n"] }]
|
|
274
|
+
}], ctorParameters: () => [] });
|
|
420
275
|
|
|
421
276
|
/**
|
|
422
277
|
* Generated bundle index. Do not edit.
|