@sd-angular/core 19.0.0-beta.35 → 19.0.0-beta.36
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/fesm2022/sd-angular-core-components-table.mjs +2 -2
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs +75 -67
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date-range.mjs +145 -245
- package/fesm2022/sd-angular-core-forms-date-range.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +79 -67
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/forms/autocomplete/src/autocomplete.component.d.ts +8 -8
- package/forms/date-range/src/date-range.component.d.ts +28 -33
- package/forms/select/src/select.component.d.ts +6 -6
- package/package.json +36 -36
- package/sd-angular-core-19.0.0-beta.36.tgz +0 -0
- package/sd-angular-core-19.0.0-beta.35.tgz +0 -0
|
@@ -1,232 +1,188 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, ContentChild, Output, Input, ViewChild, Inject, Optional, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
1
|
import * as i1 from '@angular/common';
|
|
4
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
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 { FormControl,
|
|
6
|
+
import { FormControl, Validators, NgForm, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
7
7
|
import { provideMomentDateAdapter } from '@angular/material-moment-adapter';
|
|
8
8
|
import { MatNativeDateModule } from '@angular/material/core';
|
|
9
9
|
import * as i6 from '@angular/material/datepicker';
|
|
10
|
-
import {
|
|
10
|
+
import { MatDateRangePicker, MatDatepickerModule } from '@angular/material/datepicker';
|
|
11
11
|
import * as i5 from '@angular/material/form-field';
|
|
12
12
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
13
13
|
import * as i3 from '@angular/material/icon';
|
|
14
14
|
import { MatIconModule } from '@angular/material/icon';
|
|
15
|
+
import * as i4 from '@angular/material/tooltip';
|
|
16
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
15
17
|
import { SdLabelDefDirective } from '@sd-angular/core/forms/directives';
|
|
16
18
|
import { SD_FORM_CONFIGURATION } from '@sd-angular/core/forms/models';
|
|
17
|
-
import {
|
|
19
|
+
import { SdLabel } from '@sd-angular/core/forms/label';
|
|
20
|
+
import { SdUtilities, DateUtilities } from '@sd-angular/core/utilities/extensions';
|
|
18
21
|
import moment from 'moment';
|
|
19
22
|
import * as uuid from 'uuid';
|
|
20
|
-
import { SdLabel } from '@sd-angular/core/forms/label';
|
|
21
|
-
import * as i4 from '@angular/material/tooltip';
|
|
22
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
23
23
|
|
|
24
|
+
/* eslint-disable @angular-eslint/no-input-rename */
|
|
25
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
24
26
|
class SdDateRange {
|
|
25
|
-
cdRef;
|
|
26
|
-
formConfig;
|
|
27
|
-
picker;
|
|
28
|
-
autoId;
|
|
29
|
-
set _autoId(val) {
|
|
30
|
-
if (!val) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
this.autoId = `forms-date-range-${val}`;
|
|
34
|
-
}
|
|
35
27
|
id1 = `I${uuid.v4()}`;
|
|
36
28
|
id2 = `I${uuid.v4()}`;
|
|
37
|
-
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
#c1 = uuid.v4();
|
|
30
|
+
#c2 = uuid.v4();
|
|
31
|
+
// ==========================================
|
|
32
|
+
// 1. SIGNAL QUERIES
|
|
33
|
+
// ==========================================
|
|
34
|
+
picker = viewChild(MatDateRangePicker);
|
|
35
|
+
sdLabelDef = contentChild(SdLabelDefDirective);
|
|
36
|
+
// ==========================================
|
|
37
|
+
// 2. INJECTS
|
|
38
|
+
// ==========================================
|
|
39
|
+
cdRef = inject(ChangeDetectorRef);
|
|
40
|
+
formConfig = inject(SD_FORM_CONFIGURATION, { optional: true });
|
|
41
|
+
// ==========================================
|
|
42
|
+
// 3. SIGNAL INPUTS & MODEL
|
|
43
|
+
// ==========================================
|
|
44
|
+
autoIdInput = input(undefined, { alias: 'autoId' });
|
|
45
|
+
autoId = computed(() => this.autoIdInput() ? `forms-date-range-${this.autoIdInput()}` : undefined);
|
|
46
|
+
name = input(uuid.v4());
|
|
47
|
+
size = input('md');
|
|
48
|
+
// Chấp nhận mọi kiểu Form cha truyền vào để giải quyết lỗi "Type FormGroup<{}> is not assignable..."
|
|
49
|
+
form = input();
|
|
50
|
+
label = input();
|
|
51
|
+
helperText = input();
|
|
52
|
+
hideInlineError = input(false, { transform: booleanAttribute });
|
|
53
|
+
required = input(false, { transform: booleanAttribute });
|
|
54
|
+
disabled = input(false, { transform: booleanAttribute });
|
|
55
|
+
appearanceInput = input(undefined, { alias: 'appearance' });
|
|
56
|
+
appearance = computed(() => this.appearanceInput() ?? this.formConfig?.appearance ?? 'outline');
|
|
57
|
+
minInput = input(undefined, { alias: 'min' });
|
|
58
|
+
resolvedMin = computed(() => this.#parseDateBoundary(this.minInput()));
|
|
59
|
+
maxInput = input(undefined, { alias: 'max' });
|
|
60
|
+
resolvedMax = computed(() => this.#parseDateBoundary(this.maxInput()));
|
|
61
|
+
valueModel = model(undefined, { alias: 'model' });
|
|
62
|
+
// ==========================================
|
|
63
|
+
// 4. SIGNAL OUTPUTS
|
|
64
|
+
// ==========================================
|
|
65
|
+
sdChange = output();
|
|
66
|
+
// ==========================================
|
|
67
|
+
// 5. INTERNAL STATE & STREAMS
|
|
68
|
+
// ==========================================
|
|
69
|
+
isMobileOrTablet = SdUtilities.isMobile();
|
|
47
70
|
formControl = new FormControl();
|
|
48
|
-
set _form(val) {
|
|
49
|
-
if (val) {
|
|
50
|
-
if (val instanceof NgForm) {
|
|
51
|
-
this.#form = val.form;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
this.#form = val;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
set disabled(val) {
|
|
59
|
-
val = val === '' || !!val;
|
|
60
|
-
if (val) {
|
|
61
|
-
this.formControl.disable();
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
this.formControl.enable();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
required = false;
|
|
68
|
-
set _required(val) {
|
|
69
|
-
this.required = val === '' || !!val;
|
|
70
|
-
if (this.required) {
|
|
71
|
-
this.formControl.setValidators([Validators.required]);
|
|
72
|
-
this.control1.setValidators([Validators.required]);
|
|
73
|
-
this.control2.setValidators([Validators.required]);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
this.formControl.clearValidators();
|
|
77
|
-
this.control1.clearValidators();
|
|
78
|
-
this.control2.clearValidators();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
label;
|
|
82
|
-
set _label(label) {
|
|
83
|
-
this.label = label;
|
|
84
|
-
}
|
|
85
|
-
helperText;
|
|
86
|
-
set _helperText(val) {
|
|
87
|
-
this.helperText = val;
|
|
88
|
-
}
|
|
89
|
-
hideInlineError = false;
|
|
90
|
-
set _hideInlineError(val) {
|
|
91
|
-
this.hideInlineError = val === '' || !!val;
|
|
92
|
-
}
|
|
93
|
-
min;
|
|
94
|
-
set _min(val) {
|
|
95
|
-
if (val === 'TODAY') {
|
|
96
|
-
this.min = new Date();
|
|
97
|
-
}
|
|
98
|
-
else if (val && DateUtilities.isDate(val)) {
|
|
99
|
-
this.min = new Date(val);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
this.min = null;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
max;
|
|
106
|
-
set _max(val) {
|
|
107
|
-
if (val === 'TODAY') {
|
|
108
|
-
this.max = new Date();
|
|
109
|
-
}
|
|
110
|
-
else if (val && DateUtilities.isDate(val)) {
|
|
111
|
-
this.max = new Date(val);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
this.max = null;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
#model;
|
|
118
|
-
set model(val) {
|
|
119
|
-
const from = DateUtilities.isDate(val?.from) ? DateUtilities.toFormat(val?.from, 'yyyy/MM/dd') : null;
|
|
120
|
-
const to = DateUtilities.isDate(val?.to) ? DateUtilities.toFormat(val?.to, 'yyyy/MM/dd') : null;
|
|
121
|
-
if (this.#model?.from !== from && this.#model?.to !== to) {
|
|
122
|
-
this.#model = {
|
|
123
|
-
from,
|
|
124
|
-
to,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
else if (this.#model?.from !== from) {
|
|
128
|
-
this.#model = {
|
|
129
|
-
...this.#model,
|
|
130
|
-
from,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
else if (this.#model?.to !== to) {
|
|
134
|
-
this.#model = {
|
|
135
|
-
...this.#model,
|
|
136
|
-
to,
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
// Form chỉ nhận moment nên cần format lại trước khi gán vào form
|
|
140
|
-
const value = {
|
|
141
|
-
from: DateUtilities.isDate(this.#model?.from) ? moment(DateUtilities.toFormat(this.#model?.from, 'yyyy/MM/dd'), 'YYYY/MM/DD') : null,
|
|
142
|
-
to: DateUtilities.isDate(this.#model?.to) ? moment(DateUtilities.toFormat(this.#model?.to, 'yyyy/MM/dd'), 'YYYY/MM/DD') : null,
|
|
143
|
-
};
|
|
144
|
-
this.control1.setValue(value.from);
|
|
145
|
-
this.control2.setValue(value.to);
|
|
146
|
-
}
|
|
147
|
-
modelChange = new EventEmitter();
|
|
148
|
-
sdChange = new EventEmitter();
|
|
149
|
-
sdLabelDef;
|
|
150
71
|
control1 = new FormControl();
|
|
151
|
-
#c1 = uuid.v4();
|
|
152
72
|
control2 = new FormControl();
|
|
153
|
-
#c2 = uuid.v4();
|
|
154
73
|
#isFocus = false;
|
|
155
74
|
#isModelChange = false;
|
|
156
75
|
#isSdChangeEmittedByEnter = false;
|
|
157
76
|
#isSdChangeEmittedByClear = false;
|
|
158
|
-
constructor(
|
|
159
|
-
this.cdRef = cdRef;
|
|
160
|
-
this.formConfig = formConfig;
|
|
161
|
-
this.isMobileOrTablet = SdUtilities.isMobile();
|
|
77
|
+
constructor() {
|
|
162
78
|
this.cdRef.markForCheck();
|
|
79
|
+
// EFFECT 1: Sync model thay đổi từ bên ngoài vào control1 và control2
|
|
80
|
+
effect(() => {
|
|
81
|
+
const val = this.valueModel();
|
|
82
|
+
untracked(() => {
|
|
83
|
+
const fromStr = DateUtilities.isDate(val?.from) ? DateUtilities.toFormat(val?.from, 'yyyy/MM/dd') : null;
|
|
84
|
+
const toStr = DateUtilities.isDate(val?.to) ? DateUtilities.toFormat(val?.to, 'yyyy/MM/dd') : null;
|
|
85
|
+
// Chỉ set value nếu có sự khác biệt (tránh loop)
|
|
86
|
+
const currentFrom = this.control1.value ? DateUtilities.toFormat(this.control1.value.toDate(), 'yyyy/MM/dd') : null;
|
|
87
|
+
const currentTo = this.control2.value ? DateUtilities.toFormat(this.control2.value.toDate(), 'yyyy/MM/dd') : null;
|
|
88
|
+
if (fromStr !== currentFrom) {
|
|
89
|
+
this.control1.setValue(fromStr ? moment(fromStr, 'YYYY/MM/DD') : null, { emitEvent: false });
|
|
90
|
+
}
|
|
91
|
+
if (toStr !== currentTo) {
|
|
92
|
+
this.control2.setValue(toStr ? moment(toStr, 'YYYY/MM/DD') : null, { emitEvent: false });
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
// EFFECT 2: Sync Disable
|
|
97
|
+
effect(() => {
|
|
98
|
+
if (this.disabled()) {
|
|
99
|
+
this.formControl.disable({ emitEvent: false });
|
|
100
|
+
this.control1.disable({ emitEvent: false });
|
|
101
|
+
this.control2.disable({ emitEvent: false });
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this.formControl.enable({ emitEvent: false });
|
|
105
|
+
this.control1.enable({ emitEvent: false });
|
|
106
|
+
this.control2.enable({ emitEvent: false });
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
// EFFECT 3: Sync Required
|
|
110
|
+
effect(() => {
|
|
111
|
+
const isReq = this.required();
|
|
112
|
+
untracked(() => {
|
|
113
|
+
if (isReq) {
|
|
114
|
+
this.formControl.setValidators([Validators.required]);
|
|
115
|
+
this.control1.setValidators([Validators.required]);
|
|
116
|
+
this.control2.setValidators([Validators.required]);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this.formControl.clearValidators();
|
|
120
|
+
this.control1.clearValidators();
|
|
121
|
+
this.control2.clearValidators();
|
|
122
|
+
}
|
|
123
|
+
this.formControl.updateValueAndValidity({ emitEvent: false });
|
|
124
|
+
this.control1.updateValueAndValidity({ emitEvent: false });
|
|
125
|
+
this.control2.updateValueAndValidity({ emitEvent: false });
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
ngOnInit() {
|
|
130
|
+
const formGroup = this.form() instanceof NgForm ? this.form().form : this.form();
|
|
131
|
+
formGroup?.addControl(this.#c1, this.control1);
|
|
132
|
+
formGroup?.addControl(this.#c2, this.control2);
|
|
133
|
+
formGroup?.addControl(this.name(), this.formControl);
|
|
163
134
|
}
|
|
164
135
|
ngOnDestroy() {
|
|
165
|
-
this
|
|
166
|
-
|
|
167
|
-
|
|
136
|
+
const formGroup = this.form() instanceof NgForm ? this.form().form : this.form();
|
|
137
|
+
formGroup?.removeControl(this.#c1);
|
|
138
|
+
formGroup?.removeControl(this.#c2);
|
|
139
|
+
formGroup?.removeControl(this.name());
|
|
168
140
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
141
|
+
#parseDateBoundary(val) {
|
|
142
|
+
if (val === 'TODAY')
|
|
143
|
+
return new Date();
|
|
144
|
+
if (val && DateUtilities.isDate(val))
|
|
145
|
+
return new Date(val);
|
|
146
|
+
return null;
|
|
174
147
|
}
|
|
175
148
|
onStartChange = (event) => {
|
|
176
|
-
|
|
177
|
-
if (!this.#isFocus) {
|
|
149
|
+
if (!this.#isFocus)
|
|
178
150
|
this.#emit();
|
|
179
|
-
}
|
|
180
151
|
};
|
|
181
152
|
onEndChange = (event) => {
|
|
182
|
-
|
|
183
|
-
if (!this.#isFocus) {
|
|
153
|
+
if (!this.#isFocus)
|
|
184
154
|
this.#emit();
|
|
185
|
-
}
|
|
186
155
|
};
|
|
187
156
|
#emit = () => {
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
this.formControl.setValue({
|
|
198
|
-
from: this.control1.value,
|
|
199
|
-
to: this.control2.value,
|
|
200
|
-
});
|
|
201
|
-
this.modelChange.emit(this.#model);
|
|
157
|
+
const from = this.control1.value?.toDate() || null;
|
|
158
|
+
const to = this.control2.value?.toDate() || null;
|
|
159
|
+
const currentModel = this.valueModel();
|
|
160
|
+
const newFrom = DateUtilities.isDate(from) ? DateUtilities.toFormat(from, 'yyyy/MM/dd') : null;
|
|
161
|
+
const newTo = DateUtilities.isDate(to) ? DateUtilities.toFormat(to, 'yyyy/MM/dd') : null;
|
|
162
|
+
if (newFrom !== currentModel?.from || newTo !== currentModel?.to) {
|
|
163
|
+
const nextModel = { from: newFrom, to: newTo };
|
|
164
|
+
this.formControl.setValue({ from: this.control1.value, to: this.control2.value }, { emitEvent: false });
|
|
165
|
+
this.valueModel.set(nextModel);
|
|
202
166
|
this.#isModelChange = true;
|
|
203
167
|
this.cdRef.markForCheck();
|
|
204
168
|
}
|
|
205
169
|
};
|
|
206
170
|
clear = () => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
};
|
|
211
|
-
this.
|
|
212
|
-
|
|
213
|
-
});
|
|
214
|
-
this.control2.setValue(null, {
|
|
215
|
-
emitEvent: false,
|
|
216
|
-
});
|
|
217
|
-
this.formControl.setValue(this.#model);
|
|
218
|
-
this.modelChange.emit(this.#model);
|
|
219
|
-
this.sdChange.emit(this.#model);
|
|
171
|
+
const emptyModel = { from: null, to: null };
|
|
172
|
+
this.control1.setValue(null, { emitEvent: false });
|
|
173
|
+
this.control2.setValue(null, { emitEvent: false });
|
|
174
|
+
this.formControl.setValue(emptyModel, { emitEvent: false });
|
|
175
|
+
this.valueModel.set(emptyModel);
|
|
176
|
+
this.sdChange.emit(emptyModel);
|
|
220
177
|
this.#isSdChangeEmittedByClear = true;
|
|
221
178
|
this.cdRef.markForCheck();
|
|
222
179
|
};
|
|
223
180
|
onEnter = () => {
|
|
224
181
|
this.#emit();
|
|
225
|
-
this.sdChange.emit(this
|
|
182
|
+
this.sdChange.emit(this.valueModel());
|
|
226
183
|
this.#isSdChangeEmittedByEnter = true;
|
|
227
184
|
};
|
|
228
185
|
onFocus = () => {
|
|
229
|
-
// Reset data đảm bảo chỉ có luồng focus hoạt động chính xác
|
|
230
186
|
this.#isFocus = true;
|
|
231
187
|
this.#isModelChange = false;
|
|
232
188
|
this.#isSdChangeEmittedByEnter = false;
|
|
@@ -235,30 +191,25 @@ class SdDateRange {
|
|
|
235
191
|
onBlur = () => {
|
|
236
192
|
this.#isFocus = false;
|
|
237
193
|
this.#emit();
|
|
238
|
-
// NOTE:
|
|
239
|
-
// 1. setTimeout ném vào queue để đảm bảo người dùng không focus tiếp vào input còn lại thì mới sdChange
|
|
240
|
-
// 2. Trước đó đã từng emit sdChange bằng nút Enter hoặc ấn nút Clear thì blur input sẽ không cần emit nữa
|
|
241
194
|
setTimeout(() => {
|
|
242
195
|
if (!this.#isFocus && this.#isModelChange && !(this.#isSdChangeEmittedByEnter || this.#isSdChangeEmittedByClear)) {
|
|
243
|
-
this.sdChange.emit(this
|
|
196
|
+
this.sdChange.emit(this.valueModel());
|
|
244
197
|
}
|
|
245
198
|
});
|
|
246
199
|
};
|
|
247
200
|
onClosePicker = () => {
|
|
248
|
-
this.sdChange.emit(this
|
|
201
|
+
this.sdChange.emit(this.valueModel());
|
|
249
202
|
};
|
|
250
203
|
onOpenPicker = (event) => {
|
|
251
204
|
event.stopPropagation();
|
|
252
205
|
if (!this.formControl.disabled) {
|
|
253
|
-
this.picker
|
|
206
|
+
this.picker()?.open();
|
|
254
207
|
}
|
|
255
208
|
};
|
|
256
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdDateRange, deps: [
|
|
257
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdDateRange, isStandalone: true, selector: "sd-date-range", inputs: {
|
|
209
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdDateRange, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
210
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdDateRange, isStandalone: true, selector: "sd-date-range", 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 }, 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 }, appearanceInput: { classPropertyName: "appearanceInput", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, minInput: { classPropertyName: "minInput", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, maxInput: { classPropertyName: "maxInput", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, valueModel: { classPropertyName: "valueModel", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueModel: "modelChange", sdChange: "sdChange" }, providers: [
|
|
258
211
|
provideMomentDateAdapter({
|
|
259
|
-
parse: {
|
|
260
|
-
dateInput: 'DD/MM/YYYY',
|
|
261
|
-
},
|
|
212
|
+
parse: { dateInput: 'DD/MM/YYYY' },
|
|
262
213
|
display: {
|
|
263
214
|
dateInput: 'DD/MM/YYYY',
|
|
264
215
|
monthYearLabel: 'MMM YYYY',
|
|
@@ -266,15 +217,13 @@ class SdDateRange {
|
|
|
266
217
|
monthYearA11yLabel: 'MMMM YYYY',
|
|
267
218
|
},
|
|
268
219
|
}),
|
|
269
|
-
], queries: [{ propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true }], viewQueries: [{ propertyName: "picker", first: true, predicate: MatDateRangePicker, descendants: true }], ngImport: i0, template: "@if (!appearance && sdLabelDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef?.templateRef!\"> </ng-container>\r\n}\r\n@if (!appearance && label && !sdLabelDef?.templateRef) {\r\n <sd-label [label]=\"label\" [required]=\"required\"></sd-label>\r\n}\r\n<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 <mat-date-range-input [max]=\"max\" [min]=\"min\" [rangePicker]=\"picker\" [disabled]=\"formControl.disabled\" [required]=\"required\">\r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id1\"\r\n autocomplete=\"off\"\r\n autocorrect=\"off\"\r\n matStartDate\r\n [formControl]=\"control1\"\r\n [placeholder]=\"formControl.disabled ? '' : 'T\u1EEB'\"\r\n (dateInput)=\"onStartChange($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keyup.enter)=\"onEnter()\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-autoId]=\"autoId + '-from'\" />\r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id2\"\r\n [autocomplete]=\"id2\"\r\n autocorrect=\"off\"\r\n matEndDate\r\n [formControl]=\"control2\"\r\n [placeholder]=\"formControl.disabled ? '' : '\u0111\u1EBFn'\"\r\n (dateInput)=\"onEndChange($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keyup.enter)=\"onEnter()\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-autoId]=\"autoId + '-to'\" />\r\n </mat-date-range-input>\r\n @if (control1.value || control2.value) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear()\" matSuffix>cancel </mat-icon>\r\n }\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"onOpenPicker($event)\" matSuffix>today</mat-icon>\r\n <mat-date-range-picker [touchUi]=\"isMobileOrTablet\" (closed)=\"onClosePicker()\" #picker></mat-date-range-picker>\r\n @if (\r\n (formControl.errors?.['required'] && formControl.touched) ||\r\n (control1.errors?.['required'] && control1.touched) ||\r\n (control2.errors?.['required'] && control2.touched)\r\n ) {\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</mat-form-field>\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-start-date:disabled,:host ::ng-deep .mat-mdc-form-field input.mat-mdc-end-date: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}:host ::ng-deep .sd-md mat-date-range-input{padding-top:12px;font-size:14px}:host ::ng-deep .sd-sm mat-date-range-input{padding-top:4px;font-size:14px}\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: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i6.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i6.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i6.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i6.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
220
|
+
], queries: [{ propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "picker", first: true, predicate: MatDateRangePicker, descendants: true, isSignal: true }], ngImport: i0, template: "@let lblDef = sdLabelDef();\r\n@let lbl = label();\r\n@let app = appearance();\r\n@let req = required();\r\n@let hideErr = hideInlineError();\r\n@let hText = helperText();\r\n@let minD = resolvedMin();\r\n@let maxD = resolvedMax();\r\n@let sz = size();\r\n\r\n@if (!app && lblDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"lblDef!.templateRef\"> </ng-container>\r\n}\r\n@if (!app && lbl && !lblDef?.templateRef) {\r\n <sd-label [label]=\"lbl\" [required]=\"req\"></sd-label>\r\n}\r\n\r\n<mat-form-field\r\n [class.sd-md]=\"sz === 'md'\"\r\n [class.sd-sm]=\"sz === '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 <mat-date-range-input [max]=\"maxD\" [min]=\"minD\" [rangePicker]=\"picker\" [disabled]=\"formControl.disabled\" [required]=\"req\">\r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id1\"\r\n autocomplete=\"off\"\r\n autocorrect=\"off\"\r\n matStartDate\r\n [formControl]=\"control1\"\r\n [placeholder]=\"formControl.disabled ? '' : 'T\u1EEB'\"\r\n (dateInput)=\"onStartChange($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keyup.enter)=\"onEnter()\"\r\n [attr.data-qclabel]=\"lbl\"\r\n [attr.data-autoId]=\"autoId() + '-from'\" />\r\n \r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id2\"\r\n [autocomplete]=\"id2\"\r\n autocorrect=\"off\"\r\n matEndDate\r\n [formControl]=\"control2\"\r\n [placeholder]=\"formControl.disabled ? '' : '\u0111\u1EBFn'\"\r\n (dateInput)=\"onEndChange($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keyup.enter)=\"onEnter()\"\r\n [attr.data-qclabel]=\"lbl\"\r\n [attr.data-autoId]=\"autoId() + '-to'\" />\r\n </mat-date-range-input>\r\n \r\n @if (control1.value || control2.value) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear()\" matSuffix>cancel</mat-icon>\r\n }\r\n \r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"onOpenPicker($event)\" matSuffix>today</mat-icon>\r\n \r\n <mat-date-range-picker [touchUi]=\"isMobileOrTablet\" (closed)=\"onClosePicker()\" #picker></mat-date-range-picker>\r\n \r\n @if (\r\n (formControl.errors?.['required'] && formControl.touched) ||\r\n (control1.errors?.['required'] && control1.touched) ||\r\n (control2.errors?.['required'] && control2.touched)\r\n ) {\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</mat-form-field>", 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-start-date:disabled,:host ::ng-deep .mat-mdc-form-field input.mat-mdc-end-date: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}:host ::ng-deep .sd-md mat-date-range-input{padding-top:12px;font-size:14px}:host ::ng-deep .sd-sm mat-date-range-input{padding-top:4px;font-size:14px}\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: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i6.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i6.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i6.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i6.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "component", type: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
270
221
|
}
|
|
271
222
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdDateRange, decorators: [{
|
|
272
223
|
type: Component,
|
|
273
224
|
args: [{ selector: 'sd-date-range', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
274
225
|
provideMomentDateAdapter({
|
|
275
|
-
parse: {
|
|
276
|
-
dateInput: 'DD/MM/YYYY',
|
|
277
|
-
},
|
|
226
|
+
parse: { dateInput: 'DD/MM/YYYY' },
|
|
278
227
|
display: {
|
|
279
228
|
dateInput: 'DD/MM/YYYY',
|
|
280
229
|
monthYearLabel: 'MMM YYYY',
|
|
@@ -292,57 +241,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
292
241
|
MatDatepickerModule,
|
|
293
242
|
MatNativeDateModule,
|
|
294
243
|
SdLabel,
|
|
295
|
-
], template: "@if (!
|
|
296
|
-
}], ctorParameters: () => [
|
|
297
|
-
type: Inject,
|
|
298
|
-
args: [SD_FORM_CONFIGURATION]
|
|
299
|
-
}, {
|
|
300
|
-
type: Optional
|
|
301
|
-
}] }], propDecorators: { picker: [{
|
|
302
|
-
type: ViewChild,
|
|
303
|
-
args: [MatDateRangePicker]
|
|
304
|
-
}], _autoId: [{
|
|
305
|
-
type: Input,
|
|
306
|
-
args: ['autoId']
|
|
307
|
-
}], name: [{
|
|
308
|
-
type: Input
|
|
309
|
-
}], appearance: [{
|
|
310
|
-
type: Input
|
|
311
|
-
}], size: [{
|
|
312
|
-
type: Input
|
|
313
|
-
}], _form: [{
|
|
314
|
-
type: Input,
|
|
315
|
-
args: ['form']
|
|
316
|
-
}], disabled: [{
|
|
317
|
-
type: Input
|
|
318
|
-
}], _required: [{
|
|
319
|
-
type: Input,
|
|
320
|
-
args: ['required']
|
|
321
|
-
}], _label: [{
|
|
322
|
-
type: Input,
|
|
323
|
-
args: ['label']
|
|
324
|
-
}], _helperText: [{
|
|
325
|
-
type: Input,
|
|
326
|
-
args: ['helperText']
|
|
327
|
-
}], _hideInlineError: [{
|
|
328
|
-
type: Input,
|
|
329
|
-
args: ['hideInlineError']
|
|
330
|
-
}], _min: [{
|
|
331
|
-
type: Input,
|
|
332
|
-
args: ['min']
|
|
333
|
-
}], _max: [{
|
|
334
|
-
type: Input,
|
|
335
|
-
args: ['max']
|
|
336
|
-
}], model: [{
|
|
337
|
-
type: Input
|
|
338
|
-
}], modelChange: [{
|
|
339
|
-
type: Output
|
|
340
|
-
}], sdChange: [{
|
|
341
|
-
type: Output
|
|
342
|
-
}], sdLabelDef: [{
|
|
343
|
-
type: ContentChild,
|
|
344
|
-
args: [SdLabelDefDirective]
|
|
345
|
-
}] } });
|
|
244
|
+
], template: "@let lblDef = sdLabelDef();\r\n@let lbl = label();\r\n@let app = appearance();\r\n@let req = required();\r\n@let hideErr = hideInlineError();\r\n@let hText = helperText();\r\n@let minD = resolvedMin();\r\n@let maxD = resolvedMax();\r\n@let sz = size();\r\n\r\n@if (!app && lblDef?.templateRef) {\r\n <ng-container *ngTemplateOutlet=\"lblDef!.templateRef\"> </ng-container>\r\n}\r\n@if (!app && lbl && !lblDef?.templateRef) {\r\n <sd-label [label]=\"lbl\" [required]=\"req\"></sd-label>\r\n}\r\n\r\n<mat-form-field\r\n [class.sd-md]=\"sz === 'md'\"\r\n [class.sd-sm]=\"sz === '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 <mat-date-range-input [max]=\"maxD\" [min]=\"minD\" [rangePicker]=\"picker\" [disabled]=\"formControl.disabled\" [required]=\"req\">\r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id1\"\r\n autocomplete=\"off\"\r\n autocorrect=\"off\"\r\n matStartDate\r\n [formControl]=\"control1\"\r\n [placeholder]=\"formControl.disabled ? '' : 'T\u1EEB'\"\r\n (dateInput)=\"onStartChange($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keyup.enter)=\"onEnter()\"\r\n [attr.data-qclabel]=\"lbl\"\r\n [attr.data-autoId]=\"autoId() + '-from'\" />\r\n \r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id2\"\r\n [autocomplete]=\"id2\"\r\n autocorrect=\"off\"\r\n matEndDate\r\n [formControl]=\"control2\"\r\n [placeholder]=\"formControl.disabled ? '' : '\u0111\u1EBFn'\"\r\n (dateInput)=\"onEndChange($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keyup.enter)=\"onEnter()\"\r\n [attr.data-qclabel]=\"lbl\"\r\n [attr.data-autoId]=\"autoId() + '-to'\" />\r\n </mat-date-range-input>\r\n \r\n @if (control1.value || control2.value) {\r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"clear()\" matSuffix>cancel</mat-icon>\r\n }\r\n \r\n <mat-icon class=\"pointer sd-suffix-icon\" (click)=\"onOpenPicker($event)\" matSuffix>today</mat-icon>\r\n \r\n <mat-date-range-picker [touchUi]=\"isMobileOrTablet\" (closed)=\"onClosePicker()\" #picker></mat-date-range-picker>\r\n \r\n @if (\r\n (formControl.errors?.['required'] && formControl.touched) ||\r\n (control1.errors?.['required'] && control1.touched) ||\r\n (control2.errors?.['required'] && control2.touched)\r\n ) {\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</mat-form-field>", 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-start-date:disabled,:host ::ng-deep .mat-mdc-form-field input.mat-mdc-end-date: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}:host ::ng-deep .sd-md mat-date-range-input{padding-top:12px;font-size:14px}:host ::ng-deep .sd-sm mat-date-range-input{padding-top:4px;font-size:14px}\n"] }]
|
|
245
|
+
}], ctorParameters: () => [] });
|
|
346
246
|
|
|
347
247
|
/**
|
|
348
248
|
* Generated bundle index. Do not edit.
|