@sd-angular/core 19.0.0-beta.4 → 19.0.0-beta.40
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/assets/scss/ckeditor5.scss +60 -2
- package/assets/scss/core/bootstrap.scss +17 -0
- package/assets/scss/core/grid.scss +40 -0
- package/assets/scss/sd-core.scss +1 -0
- package/components/avatar/index.d.ts +1 -0
- package/components/avatar/src/avatar.component.d.ts +15 -0
- package/components/badge/src/badge.component.d.ts +77 -19
- package/components/button/src/button.component.d.ts +26 -28
- package/components/document-builder/index.d.ts +1 -0
- package/components/document-builder/src/document-builder.component.d.ts +20 -37
- package/components/document-builder/src/document-builder.model.d.ts +11 -10
- package/components/document-builder/src/plugins/block-space/block-space.plugin.d.ts +9 -0
- package/components/document-builder/src/plugins/ck-comment/ck-comment.plugin.d.ts +43 -0
- package/components/document-builder/src/plugins/ck-comment/ck-comment.plugin.model.d.ts +50 -0
- package/components/document-builder/src/plugins/heading/heading.plugin.d.ts +5 -0
- package/components/document-builder/src/plugins/highlight-range/highlight-range.plugin.d.ts +4 -0
- package/components/document-builder/src/plugins/image-custom/image-custom.plugin.d.ts +31 -0
- package/components/document-builder/src/plugins/{image-upload.plugin.d.ts → image-upload/image-upload.plugin.d.ts} +0 -4
- package/components/document-builder/src/plugins/index.d.ts +11 -5
- package/components/document-builder/src/plugins/{page-orientation.plugin.d.ts → page-orientation/page-orientation.plugin.d.ts} +2 -2
- package/components/document-builder/src/plugins/paste-handler/filters/bookmark.d.ts +14 -0
- package/components/document-builder/src/plugins/paste-handler/filters/br.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/image.d.ts +25 -0
- package/components/document-builder/src/plugins/paste-handler/filters/list.d.ts +29 -0
- package/components/document-builder/src/plugins/paste-handler/filters/parse.d.ts +35 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removeboldwrapper.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removegooglesheetstag.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removeinvalidtablewidth.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removemsattributes.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removestyleblock.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/removexmlns.d.ts +15 -0
- package/components/document-builder/src/plugins/paste-handler/filters/replacemsfootnotes.d.ts +54 -0
- package/components/document-builder/src/plugins/paste-handler/filters/replacetabswithinprewithspaces.d.ts +24 -0
- package/components/document-builder/src/plugins/paste-handler/filters/space.d.ts +27 -0
- package/components/document-builder/src/plugins/paste-handler/filters/table.d.ts +16 -0
- package/components/document-builder/src/plugins/paste-handler/filters/utils.d.ts +25 -0
- package/components/document-builder/src/plugins/paste-handler/index.d.ts +35 -0
- package/components/document-builder/src/plugins/paste-handler/normalizers/googledocsnormalizer.d.ts +31 -0
- package/components/document-builder/src/plugins/paste-handler/normalizers/googlesheetsnormalizer.d.ts +31 -0
- package/components/document-builder/src/plugins/paste-handler/normalizers/mswordnormalizer.d.ts +29 -0
- package/components/document-builder/src/plugins/paste-handler/types.d.ts +30 -0
- package/components/document-builder/src/plugins/table-custom/index.d.ts +34 -0
- package/components/index.d.ts +3 -0
- package/components/mini-editor/index.d.ts +2 -0
- package/components/mini-editor/src/mini-editor.component.d.ts +90 -0
- package/components/mini-editor/src/mini-editor.model.d.ts +42 -0
- package/components/side-drawer/src/side-drawer.component.d.ts +1 -2
- package/components/table/src/components/selector-action/action-filter.pipe.d.ts +11 -10
- package/components/table/src/directives/index.d.ts +2 -0
- package/components/table/src/directives/sd-table-column-filter-def.directive.d.ts +9 -0
- package/components/table/src/directives/sticky-shadow.directive.d.ts +17 -0
- package/components/table/src/models/table-column.model.d.ts +32 -32
- package/components/table/src/models/table-command.model.d.ts +7 -3
- package/components/table/src/models/table-item.model.d.ts +5 -3
- package/components/table/src/models/table-option-export.model.d.ts +3 -2
- package/components/table/src/models/table-option-selector.model.d.ts +11 -10
- package/components/table/src/models/table-option.model.d.ts +10 -8
- package/components/table/src/services/table-filter/table-filter.model.d.ts +2 -2
- package/components/table/src/table.component.d.ts +33 -35
- package/components/view/index.d.ts +1 -0
- package/components/view/src/view.component.d.ts +16 -0
- package/components/workflow/src/models/index.d.ts +1 -0
- package/directives/index.d.ts +1 -0
- package/directives/src/sd-href.directive.d.ts +9 -0
- package/fesm2022/sd-angular-core-components-avatar.mjs +90 -0
- package/fesm2022/sd-angular-core-components-avatar.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-badge.mjs +102 -91
- package/fesm2022/sd-angular-core-components-badge.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-button.mjs +64 -96
- package/fesm2022/sd-angular-core-components-button.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-document-builder.mjs +3860 -963
- package/fesm2022/sd-angular-core-components-document-builder.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-history.mjs +1 -1
- package/fesm2022/sd-angular-core-components-history.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-import-excel.mjs +1 -1
- package/fesm2022/sd-angular-core-components-import-excel.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-mini-editor.mjs +326 -0
- package/fesm2022/sd-angular-core-components-mini-editor.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-preview.mjs +1 -1
- package/fesm2022/sd-angular-core-components-preview.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-side-drawer.mjs +21 -8
- package/fesm2022/sd-angular-core-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-tab-router.mjs +1 -1
- package/fesm2022/sd-angular-core-components-tab-router.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-table.mjs +724 -472
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-upload-file.mjs +1 -1
- package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-view.mjs +45 -0
- package/fesm2022/sd-angular-core-components-view.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-workflow.mjs +33 -43
- package/fesm2022/sd-angular-core-components-workflow.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components.mjs +3 -0
- package/fesm2022/sd-angular-core-components.mjs.map +1 -1
- package/fesm2022/sd-angular-core-directives.mjs +80 -27
- package/fesm2022/sd-angular-core-directives.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs +211 -357
- 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-date.mjs +137 -271
- package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs +138 -276
- package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs +174 -336
- package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs +130 -283
- package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-radio.mjs +5 -2
- package/fesm2022/sd-angular-core-forms-radio.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +241 -416
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-textarea.mjs +133 -226
- package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-keycloak.mjs +126 -0
- package/fesm2022/sd-angular-core-modules-keycloak.mjs.map +1 -0
- package/fesm2022/sd-angular-core-modules-layout.mjs +54 -19
- package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules.mjs +1 -1
- package/fesm2022/sd-angular-core-pipes.mjs +21 -1
- package/fesm2022/sd-angular-core-pipes.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-confirm.mjs +2 -2
- package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-docx.mjs +173 -0
- package/fesm2022/sd-angular-core-services-docx.mjs.map +1 -0
- package/fesm2022/sd-angular-core-services-notify.mjs +2 -2
- package/fesm2022/sd-angular-core-services-notify.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services.mjs +1 -0
- package/fesm2022/sd-angular-core-services.mjs.map +1 -1
- package/fesm2022/sd-angular-core-utilities-extensions.mjs +10 -6
- package/fesm2022/sd-angular-core-utilities-extensions.mjs.map +1 -1
- package/fesm2022/sd-angular-core-utilities-models.mjs +15 -1
- package/fesm2022/sd-angular-core-utilities-models.mjs.map +1 -1
- package/forms/autocomplete/src/autocomplete.component.d.ts +50 -56
- package/forms/date/src/date.component.d.ts +41 -45
- package/forms/date-range/src/date-range.component.d.ts +28 -33
- package/forms/datetime/src/datetime.component.d.ts +41 -45
- package/forms/input/src/input.component.d.ts +46 -56
- package/forms/input-number/src/input-number.component.d.ts +47 -54
- package/forms/select/src/select.component.d.ts +50 -58
- package/forms/textarea/src/textarea.component.d.ts +34 -41
- package/modules/index.d.ts +1 -1
- package/modules/keycloak/index.d.ts +4 -0
- package/modules/keycloak/keycloak.configuration.d.ts +11 -0
- package/modules/keycloak/keycloak.interceptor.d.ts +2 -0
- package/modules/keycloak/keycloak.module.d.ts +18 -0
- package/modules/keycloak/keycloak.service.d.ts +14 -0
- package/modules/layout/components/sidebar-v1/components/sidebar/sidebar.component.d.ts +1 -0
- package/modules/layout/components/sidebar-v1/components/user/user.component.d.ts +5 -2
- package/modules/layout/configurations/layout.configuration.d.ts +3 -0
- package/modules/layout/services/storage/storage.service.d.ts +1 -0
- package/package.json +89 -71
- package/pipes/index.d.ts +1 -0
- package/pipes/src/empty.pipe.d.ts +7 -0
- package/sd-angular-core-19.0.0-beta.40.tgz +0 -0
- package/services/confirm/src/lib/confirm.service.d.ts +1 -0
- package/services/docx/index.d.ts +1 -0
- package/services/docx/src/lib/docx.model.d.ts +9 -0
- package/services/docx/src/lib/docx.service.d.ts +13 -0
- package/services/docx/src/public-api.d.ts +2 -0
- package/services/index.d.ts +1 -0
- package/utilities/extensions/src/string.extension.d.ts +2 -0
- package/utilities/models/index.d.ts +3 -0
- package/utilities/models/src/filter.model.d.ts +14 -2
- package/utilities/models/src/icon.model.d.ts +2 -0
- package/utilities/models/src/nested-key-of.model.d.ts +5 -0
- package/utilities/models/src/pattern.model.d.ts +1 -1
- package/utilities/models/src/unwrap-signal.model.d.ts +6 -0
- package/components/document-builder/src/plugins/comment.plugin.d.ts +0 -4
- package/components/document-builder/src/plugins/table-fit.plugin.d.ts +0 -4
- package/fesm2022/sd-angular-core-modules-oidc.mjs +0 -127
- package/fesm2022/sd-angular-core-modules-oidc.mjs.map +0 -1
- package/modules/oidc/dynamic-sts.loader.d.ts +0 -11
- package/modules/oidc/index.d.ts +0 -2
- package/modules/oidc/oidc.configuration.d.ts +0 -11
- package/modules/oidc/oidc.module.d.ts +0 -14
- /package/components/document-builder/src/plugins/{variable.plugin.d.ts → variable/variable.plugin.d.ts} +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
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 {
|
|
7
|
-
import { MatDatepicker } from '@angular/material/datepicker';
|
|
6
|
+
import { Validators, NgForm, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
7
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
9
8
|
import * as i4 from '@angular/material/icon';
|
|
10
9
|
import { MatIconModule } from '@angular/material/icon';
|
|
@@ -14,181 +13,137 @@ import * as i5 from '@angular/material/tooltip';
|
|
|
14
13
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
15
14
|
import { provideMomentDatetimeAdapter } from '@ng-matero/extensions-moment-adapter';
|
|
16
15
|
import * as i6 from '@ng-matero/extensions/datetimepicker';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
16
|
+
import { MtxDatetimepicker, MtxDatetimepickerModule } from '@ng-matero/extensions/datetimepicker';
|
|
17
|
+
import { SdView } from '@sd-angular/core/components/view';
|
|
18
|
+
import { SdViewDefDirective } from '@sd-angular/core/forms/directives';
|
|
19
|
+
import { SdLabel } from '@sd-angular/core/forms/label';
|
|
20
|
+
import { SD_FORM_CONFIGURATION, SdFormControl } from '@sd-angular/core/forms/models';
|
|
21
|
+
import { SdUtilities, DateUtilities } from '@sd-angular/core/utilities/extensions';
|
|
21
22
|
import moment from 'moment';
|
|
22
23
|
import { Subscription } from 'rxjs';
|
|
23
24
|
import * as uuid from 'uuid';
|
|
24
25
|
|
|
25
26
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
26
27
|
/* eslint-disable @angular-eslint/no-input-rename */
|
|
27
|
-
// eslint-disable-next-line @angular-eslint/component-class-suffix
|
|
28
28
|
class SdDatetime {
|
|
29
|
-
ref;
|
|
30
|
-
formConfig;
|
|
31
|
-
datetimePicker;
|
|
32
29
|
id = `I${uuid.v4()}`;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
30
|
+
// ==========================================
|
|
31
|
+
// 1. SIGNAL QUERIES
|
|
32
|
+
// ==========================================
|
|
33
|
+
inputRef = viewChild('input');
|
|
34
|
+
datetimePicker = viewChild(MtxDatetimepicker);
|
|
35
|
+
sdLabelTemplate = contentChild('sdLabel');
|
|
36
|
+
sdValueTemplate = contentChild('sdValue');
|
|
37
|
+
sdViewDef = contentChild(SdViewDefDirective);
|
|
38
|
+
// ==========================================
|
|
39
|
+
// 2. INJECTS
|
|
40
|
+
// ==========================================
|
|
41
|
+
ref = inject(ChangeDetectorRef);
|
|
42
|
+
formConfig = inject(SD_FORM_CONFIGURATION, { optional: true });
|
|
43
|
+
// ==========================================
|
|
44
|
+
// 3. SIGNAL INPUTS & MODEL
|
|
45
|
+
// ==========================================
|
|
46
|
+
autoIdInput = input(undefined, { alias: 'autoId' });
|
|
47
|
+
autoId = computed(() => this.autoIdInput() ? `forms-datetime-${this.autoIdInput()}` : undefined);
|
|
48
|
+
name = input(uuid.v4());
|
|
49
|
+
size = input('md');
|
|
50
|
+
// Chấp nhận mọi loại Form cha truyền xuống (FormGroup<{}>, FormGroup<any>, NgForm...)
|
|
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();
|
|
54
80
|
formControl = new SdFormControl();
|
|
55
|
-
min;
|
|
56
|
-
set _min(val) {
|
|
57
|
-
if (val === 'TODAY') {
|
|
58
|
-
this.min = new Date();
|
|
59
|
-
}
|
|
60
|
-
else if (val && DateUtilities.isDate(val)) {
|
|
61
|
-
this.min = new Date(val);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
this.min = null;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
max;
|
|
68
|
-
set _max(val) {
|
|
69
|
-
if (val === 'TODAY') {
|
|
70
|
-
this.max = new Date();
|
|
71
|
-
}
|
|
72
|
-
else if (val && DateUtilities.isDate(val)) {
|
|
73
|
-
this.max = new Date(val);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
this.max = null;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
size = 'md';
|
|
80
|
-
#form;
|
|
81
|
-
set form(val) {
|
|
82
|
-
if (val) {
|
|
83
|
-
if (val instanceof NgForm) {
|
|
84
|
-
this.#form = val.form;
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
this.#form = val;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
set disabled(val) {
|
|
92
|
-
val = val === '' || val;
|
|
93
|
-
if (val) {
|
|
94
|
-
this.formControl.disable();
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
this.formControl.enable();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
required = false;
|
|
101
|
-
set _required(val) {
|
|
102
|
-
this.required = val === '' || !!val;
|
|
103
|
-
if (this.required) {
|
|
104
|
-
this.formControl.setValidators([Validators.required]);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
this.formControl.clearValidators();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
inlineError;
|
|
111
|
-
set _inlineError(val) {
|
|
112
|
-
this.inlineError = val;
|
|
113
|
-
// this.#updateValidator();
|
|
114
|
-
if (this.inlineError) {
|
|
115
|
-
this.formControl.setValidators([this.customInlineErrorValidator()]);
|
|
116
|
-
this.formControl.updateValueAndValidity();
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
this.formControl.clearValidators();
|
|
120
|
-
this.formControl.updateValueAndValidity();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
label;
|
|
124
|
-
set _label(val) {
|
|
125
|
-
this.label = val;
|
|
126
|
-
}
|
|
127
|
-
helperText;
|
|
128
|
-
set _helperText(val) {
|
|
129
|
-
this.helperText = val;
|
|
130
|
-
}
|
|
131
|
-
placeholder;
|
|
132
|
-
set minDate(val) {
|
|
133
|
-
if (DateUtilities.isDate(val)) {
|
|
134
|
-
this.min = new Date(val);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
this.min = null;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
set maxDate(val) {
|
|
141
|
-
if (DateUtilities.isDate(val)) {
|
|
142
|
-
this.max = new Date(val);
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
this.max = null;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
sdChange = new EventEmitter();
|
|
149
|
-
sdFocus = new EventEmitter();
|
|
150
|
-
set model(val) {
|
|
151
|
-
if (!DateUtilities.isDate(val)) {
|
|
152
|
-
val = null;
|
|
153
|
-
}
|
|
154
|
-
val = DateUtilities.toFormat(val, 'yyyy/MM/dd HH:mm');
|
|
155
|
-
if (this.#date !== val) {
|
|
156
|
-
this.#date = val;
|
|
157
|
-
const date = DateUtilities.isDate(this.#date)
|
|
158
|
-
? moment(DateUtilities.toFormat(this.#date, 'yyyy/MM/dd HH:mm'), 'YYYY/MM/DD HH:mm')
|
|
159
|
-
: null;
|
|
160
|
-
this.formControl.setValue(date);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
modelChange = new EventEmitter();
|
|
164
|
-
#subscription = new Subscription();
|
|
165
|
-
sdViewDef;
|
|
166
|
-
sdLabelDef;
|
|
167
|
-
input;
|
|
168
|
-
datePicker;
|
|
169
81
|
isFocused = false;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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 HH:mm');
|
|
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 HH:mm'), 'YYYY/MM/DD HH:mm')
|
|
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
|
+
});
|
|
178
124
|
}
|
|
179
125
|
ngOnInit() {
|
|
180
|
-
this.appearance = this.appearance || this.formConfig?.appearance;
|
|
181
126
|
this.#subscription.add(this.formControl.sdChanges.subscribe(() => {
|
|
182
|
-
// this.formControl.updateValueAndValidity();
|
|
183
127
|
this.ref.markForCheck();
|
|
184
128
|
}));
|
|
185
|
-
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 Datetime
|
|
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;
|
|
186
144
|
}
|
|
187
|
-
// Hàm tạo Validators tùy chỉnh cho inlineError
|
|
188
145
|
customInlineErrorValidator() {
|
|
189
|
-
return () => {
|
|
190
|
-
return { inlineError: true };
|
|
191
|
-
};
|
|
146
|
+
return () => ({ inlineError: true });
|
|
192
147
|
}
|
|
193
148
|
onFocus = () => {
|
|
194
149
|
this.isFocused = true;
|
|
@@ -198,38 +153,30 @@ class SdDatetime {
|
|
|
198
153
|
this.isFocused = false;
|
|
199
154
|
};
|
|
200
155
|
onClick = () => {
|
|
201
|
-
if (this.sdViewDef?.templateRef) {
|
|
156
|
+
if (this.sdViewDef()?.templateRef) {
|
|
202
157
|
if (!this.formControl.disabled && !this.isFocused) {
|
|
203
158
|
this.focus();
|
|
204
159
|
}
|
|
205
160
|
}
|
|
206
161
|
};
|
|
207
162
|
blur = () => {
|
|
208
|
-
this.
|
|
163
|
+
this.inputRef()?.nativeElement?.blur();
|
|
209
164
|
};
|
|
210
165
|
focus = () => {
|
|
211
166
|
this.isFocused = true;
|
|
212
167
|
setTimeout(() => {
|
|
213
|
-
this.
|
|
214
|
-
this.
|
|
215
|
-
//
|
|
168
|
+
this.inputRef()?.nativeElement?.focus();
|
|
169
|
+
this.datetimePicker()?.open();
|
|
216
170
|
}, 100);
|
|
217
171
|
};
|
|
218
172
|
focusInputElement() {
|
|
219
|
-
this.
|
|
173
|
+
this.inputRef()?.nativeElement?.focus();
|
|
220
174
|
}
|
|
221
|
-
isValid;
|
|
222
175
|
onKeyDown = (event) => {
|
|
223
176
|
const key = event.keyCode || event.charCode;
|
|
224
|
-
|
|
225
|
-
if (key ===
|
|
226
|
-
isShift = true;
|
|
227
|
-
}
|
|
228
|
-
// cho phép copy parse
|
|
229
|
-
if (event.ctrlKey && (key === 67 || key === 86)) {
|
|
177
|
+
const isShift = key === 16;
|
|
178
|
+
if (event.ctrlKey && (key === 67 || key === 86))
|
|
230
179
|
return true;
|
|
231
|
-
}
|
|
232
|
-
// Allow only Numeric Keys.
|
|
233
180
|
if (((key >= 48 && key <= 57) ||
|
|
234
181
|
key === 8 ||
|
|
235
182
|
key <= 37 ||
|
|
@@ -238,18 +185,16 @@ class SdDatetime {
|
|
|
238
185
|
key === 191 ||
|
|
239
186
|
key === 186 ||
|
|
240
187
|
key === 59) &&
|
|
241
|
-
isShift
|
|
188
|
+
!isShift) {
|
|
242
189
|
return true;
|
|
243
190
|
}
|
|
244
|
-
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
191
|
+
return false;
|
|
247
192
|
};
|
|
248
193
|
onConfirmInput = (event) => {
|
|
249
194
|
const currentVal = event.target.value;
|
|
250
195
|
const formControl = this.formControl;
|
|
251
|
-
|
|
252
|
-
|
|
196
|
+
const regexToMinutes = /^([1-9]|([012][0-9])|(3[01]))\/([0]{0,1}[1-9]|1[012])\/\d\d\d\d [012]{0,1}[0-9]:[0-6][0-9]$/g;
|
|
197
|
+
const regexToSecond = /^([1-9]|([012][0-9])|(3[01]))\/([0]{0,1}[1-9]|1[012])\/\d\d\d\d [012]{0,1}[0-9]:[0-6][0-9]:[0-6][0-9]$/g;
|
|
253
198
|
if (currentVal && !(regexToMinutes.test(currentVal) || regexToSecond.test(currentVal))) {
|
|
254
199
|
setTimeout(() => {
|
|
255
200
|
formControl.markAsDirty();
|
|
@@ -264,30 +209,13 @@ class SdDatetime {
|
|
|
264
209
|
}, 0);
|
|
265
210
|
}
|
|
266
211
|
};
|
|
267
|
-
// onChangeBackup = (_: any) => {
|
|
268
|
-
// // Ép kiểu
|
|
269
|
-
// const event: MtxDatetimepickerInputEvent<Moment> = _;
|
|
270
|
-
// const value = DateUtilities.toFormat(event.value?.toDate(), 'yyyy/MM/dd HH:mm:ss');
|
|
271
|
-
// this.input?.nativeElement?.focus();
|
|
272
|
-
// if (!this.isValid) {
|
|
273
|
-
// if (this.#date !== value) {
|
|
274
|
-
// this.modelChange.emit(value);
|
|
275
|
-
// this.sdChange.emit(value);
|
|
276
|
-
// }
|
|
277
|
-
// } else {
|
|
278
|
-
// this.isValid = false;
|
|
279
|
-
// this.formControl.setValue(null);
|
|
280
|
-
// this.modelChange.emit(null);
|
|
281
|
-
// this.sdChange.emit(null);
|
|
282
|
-
// }
|
|
283
|
-
// };
|
|
284
212
|
onChange = (_) => {
|
|
285
|
-
// Ép kiểu
|
|
286
213
|
const event = _;
|
|
214
|
+
// Giữ nguyên logic format cũ theo yêu cầu hệ thống
|
|
287
215
|
const value = DateUtilities.toFormat(event.value?.toDate(), 'yyyy/MM/dd HH:mm:ss');
|
|
288
|
-
this.
|
|
216
|
+
this.inputRef()?.nativeElement?.focus();
|
|
289
217
|
if (this.#date !== value) {
|
|
290
|
-
this.
|
|
218
|
+
this.valueModel.set(value);
|
|
291
219
|
this.sdChange.emit(value);
|
|
292
220
|
}
|
|
293
221
|
};
|
|
@@ -295,12 +223,12 @@ class SdDatetime {
|
|
|
295
223
|
$event?.stopPropagation();
|
|
296
224
|
if (this.formControl.value) {
|
|
297
225
|
this.formControl.setValue(null);
|
|
298
|
-
this.
|
|
226
|
+
this.valueModel.set(null);
|
|
299
227
|
this.sdChange.emit(null);
|
|
300
228
|
}
|
|
301
229
|
};
|
|
302
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdDatetime, deps: [
|
|
303
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdDatetime, isStandalone: true, selector: "sd-datetime", inputs: {
|
|
230
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdDatetime, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
231
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SdDatetime, isStandalone: true, selector: "sd-datetime", 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
232
|
provideMomentDatetimeAdapter({
|
|
305
233
|
parse: {
|
|
306
234
|
dateInput: 'DD/MM/YYYY',
|
|
@@ -318,7 +246,7 @@ class SdDatetime {
|
|
|
318
246
|
popupHeaderDateLabel: 'MMM DD, ddd',
|
|
319
247
|
},
|
|
320
248
|
}),
|
|
321
|
-
], queries: [{ propertyName: "sdViewDef", first: true, predicate: SdViewDefDirective, descendants: true }, { propertyName: "sdLabelDef", first: true, predicate: SdLabelDefDirective, descendants: true }], viewQueries: [{ propertyName: "datetimePicker", first: true, predicate: MtxDatetimepicker, descendants: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "datePicker", first: true, predicate: MatDatepicker, descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"!appearance && sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef?.templateRef ?? null\"> </ng-container>\r\n</ng-container>\r\n<span *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\"\r\n >{{ label }} <span class=\"text-error mb-2\" *ngIf=\"required\">*</span></span\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 && !datetimePicker?.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-datetime-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 || 'outline'\">\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 <mtx-datetimepicker #datetimePicker [type]=\"'datetime'\" [mode]=\"'auto'\">\r\n <!-- @if (actionButtons) {\r\n <mtx-datetimepicker-actions>\r\n <button mat-button mtxDatetimepickerClear>Clear</button>\r\n <button mat-button mtxDatetimepickerCancel>Cancel</button>\r\n <button mat-raised-button mtxDatetimepickerApply>Apply</button>\r\n </mtx-datetimepicker-actions>\r\n } -->\r\n </mtx-datetimepicker>\r\n <input\r\n aria-hidden=\"true\"\r\n [attr.data-autoId]=\"autoId\"\r\n [mtxDatetimepicker]=\"datetimePicker\"\r\n [id]=\"id\"\r\n (blur)=\"onConfirmInput($event)\"\r\n (keyup.enter)=\"onConfirmInput($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 [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 matInput />\r\n <mtx-datetimepicker-toggle [for]=\"datetimePicker\" matSuffix></mtx-datetimepicker-toggle>\r\n <mat-error *ngIf=\"formControl?.errors?.['required'] && formControl?.touched\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ 'Vui l\u00F2ng nh\u1EADp th\u00F4ng tin' }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.['matDatepickerMin'] && formControl?.touched && !isFocused\">\r\n <ng-container *ngIf=\"!hideInlineError\"\r\n >{{ 'Ng\u00E0y nh\u1ECF nh\u1EA5t' }}:\r\n <strong>{{ min | date: 'dd/MM/yyyy HH:mm' }}</strong>\r\n </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.['matDatepickerMax'] && formControl?.touched && !isFocused\">\r\n <ng-container *ngIf=\"!hideInlineError\"\r\n >{{ 'Ng\u00E0y l\u1EDBn nh\u1EA5t' }}:\r\n <strong>{{ max | date: 'dd/MM/yyyy HH:mm' }}</strong>\r\n </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.['matDatetimePickerParse'] && formControl?.touched && !isFocused\">\r\n <ng-container *ngIf=\"!hideInlineError\"\r\n >{{ 'Parse error' }}:\r\n <strong>{{ formControl.errors?.['matDatetimePickerParse']?.text }}</strong>\r\n </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.['customValidator'] && formControl?.touched && !hideInlineError\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ formControl.errors?.['customValidator'] }} </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.['date'] && formControl?.touched && !hideInlineError\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ formControl.errors?.['date'] }} </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.errors?.['inlineError'] && formControl?.touched && !hideInlineError\">\r\n <ng-container *ngIf=\"!hideInlineError\">{{ inlineError }}</ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n }\r\n</div>\r\n", 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)}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "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: MtxDatetimepickerModule }, { kind: "component", type: i6.MtxDatetimepicker, selector: "mtx-datetimepicker", inputs: ["multiYearSelector", "twelvehour", "showWeekNumbers", "startView", "mode", "timeInterval", "preventSameDateTimeSelection", "calendarHeaderComponent", "panelClass", "opened", "color", "startAt", "type", "touchUi", "timeInput", "timeInputAutoFocus", "disabled", "xPosition", "yPosition", "restoreFocus"], outputs: ["selectedChanged", "opened", "closed", "viewChanged"], exportAs: ["mtxDatetimepicker"] }, { kind: "component", type: i6.MtxDatetimepickerToggle, selector: "mtx-datetimepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["mtxDatetimepickerToggle"] }, { kind: "directive", type: i6.MtxDatetimepickerInput, selector: "input[mtxDatetimepicker]", inputs: ["mtxDatetimepicker", "mtxDatetimepickerFilter", "value", "min", "max", "disabled"], outputs: ["dateChange", "dateInput"], exportAs: ["mtxDatetimepickerInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
249
|
+
], 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 }], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, isSignal: true }, { propertyName: "datetimePicker", first: true, predicate: MtxDatetimepicker, 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@let inlErr = inlineError();\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 HH:mm'\"\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 && !datetimePicker()?.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-datetime-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 || 'outline'\">\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 <mtx-datetimepicker #datetimePicker [type]=\"'datetime'\" [mode]=\"'auto'\"></mtx-datetimepicker>\r\n \r\n <input\r\n aria-hidden=\"true\"\r\n [attr.data-autoId]=\"autoId()\"\r\n [mtxDatetimepicker]=\"datetimePicker\"\r\n [id]=\"id\"\r\n (blur)=\"onConfirmInput($event)\"\r\n (keyup.enter)=\"onConfirmInput($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 [placeholder]=\"placeholder() || lbl || ''\"\r\n [min]=\"minD\"\r\n [max]=\"maxD\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n #input\r\n matInput />\r\n \r\n <mtx-datetimepicker-toggle [for]=\"datetimePicker\" matSuffix></mtx-datetimepicker-toggle>\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\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 HH:mm' }}</strong>\r\n }\r\n </mat-error>\r\n }\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 HH:mm' }}</strong>\r\n }\r\n </mat-error>\r\n }\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\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\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\r\n @if (formControl.errors?.['inlineError'] && formControl.touched) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ inlErr }}\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)}.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: MtxDatetimepickerModule }, { kind: "component", type: i6.MtxDatetimepicker, selector: "mtx-datetimepicker", inputs: ["multiYearSelector", "twelvehour", "showWeekNumbers", "startView", "mode", "timeInterval", "preventSameDateTimeSelection", "calendarHeaderComponent", "panelClass", "opened", "color", "startAt", "type", "touchUi", "timeInput", "timeInputAutoFocus", "disabled", "xPosition", "yPosition", "restoreFocus"], outputs: ["selectedChanged", "opened", "closed", "viewChanged"], exportAs: ["mtxDatetimepicker"] }, { kind: "component", type: i6.MtxDatetimepickerToggle, selector: "mtx-datetimepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["mtxDatetimepickerToggle"] }, { kind: "directive", type: i6.MtxDatetimepickerInput, selector: "input[mtxDatetimepicker]", inputs: ["mtxDatetimepicker", "mtxDatetimepickerFilter", "value", "min", "max", "disabled"], outputs: ["dateChange", "dateInput"], exportAs: ["mtxDatetimepickerInput"] }, { 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 });
|
|
322
250
|
}
|
|
323
251
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SdDatetime, decorators: [{
|
|
324
252
|
type: Component,
|
|
@@ -349,76 +277,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
|
|
|
349
277
|
MatTooltipModule,
|
|
350
278
|
MatFormFieldModule,
|
|
351
279
|
MtxDatetimepickerModule,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
type:
|
|
355
|
-
|
|
356
|
-
}, {
|
|
357
|
-
type: Optional
|
|
358
|
-
}] }], propDecorators: { datetimePicker: [{
|
|
359
|
-
type: ViewChild,
|
|
360
|
-
args: [MtxDatetimepicker]
|
|
361
|
-
}], _autoId: [{
|
|
362
|
-
type: Input,
|
|
363
|
-
args: ['autoId']
|
|
364
|
-
}], name: [{
|
|
365
|
-
type: Input
|
|
366
|
-
}], appearance: [{
|
|
367
|
-
type: Input
|
|
368
|
-
}], _hideInlineError: [{
|
|
369
|
-
type: Input,
|
|
370
|
-
args: ['hideInlineError']
|
|
371
|
-
}], _min: [{
|
|
372
|
-
type: Input,
|
|
373
|
-
args: ['min']
|
|
374
|
-
}], _max: [{
|
|
375
|
-
type: Input,
|
|
376
|
-
args: ['max']
|
|
377
|
-
}], size: [{
|
|
378
|
-
type: Input
|
|
379
|
-
}], form: [{
|
|
380
|
-
type: Input
|
|
381
|
-
}], disabled: [{
|
|
382
|
-
type: Input
|
|
383
|
-
}], _required: [{
|
|
384
|
-
type: Input,
|
|
385
|
-
args: ['required']
|
|
386
|
-
}], _inlineError: [{
|
|
387
|
-
type: Input,
|
|
388
|
-
args: ['inlineError']
|
|
389
|
-
}], _label: [{
|
|
390
|
-
type: Input,
|
|
391
|
-
args: ['label']
|
|
392
|
-
}], _helperText: [{
|
|
393
|
-
type: Input,
|
|
394
|
-
args: ['helperText']
|
|
395
|
-
}], placeholder: [{
|
|
396
|
-
type: Input
|
|
397
|
-
}], minDate: [{
|
|
398
|
-
type: Input
|
|
399
|
-
}], maxDate: [{
|
|
400
|
-
type: Input
|
|
401
|
-
}], sdChange: [{
|
|
402
|
-
type: Output
|
|
403
|
-
}], sdFocus: [{
|
|
404
|
-
type: Output
|
|
405
|
-
}], model: [{
|
|
406
|
-
type: Input
|
|
407
|
-
}], modelChange: [{
|
|
408
|
-
type: Output
|
|
409
|
-
}], sdViewDef: [{
|
|
410
|
-
type: ContentChild,
|
|
411
|
-
args: [SdViewDefDirective]
|
|
412
|
-
}], sdLabelDef: [{
|
|
413
|
-
type: ContentChild,
|
|
414
|
-
args: [SdLabelDefDirective]
|
|
415
|
-
}], input: [{
|
|
416
|
-
type: ViewChild,
|
|
417
|
-
args: ['input']
|
|
418
|
-
}], datePicker: [{
|
|
419
|
-
type: ViewChild,
|
|
420
|
-
args: [MatDatepicker]
|
|
421
|
-
}] } });
|
|
280
|
+
SdLabel,
|
|
281
|
+
SdView
|
|
282
|
+
], 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@let inlErr = inlineError();\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 HH:mm'\"\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 && !datetimePicker()?.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-datetime-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 || 'outline'\">\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 <mtx-datetimepicker #datetimePicker [type]=\"'datetime'\" [mode]=\"'auto'\"></mtx-datetimepicker>\r\n \r\n <input\r\n aria-hidden=\"true\"\r\n [attr.data-autoId]=\"autoId()\"\r\n [mtxDatetimepicker]=\"datetimePicker\"\r\n [id]=\"id\"\r\n (blur)=\"onConfirmInput($event)\"\r\n (keyup.enter)=\"onConfirmInput($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 [placeholder]=\"placeholder() || lbl || ''\"\r\n [min]=\"minD\"\r\n [max]=\"maxD\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n #input\r\n matInput />\r\n \r\n <mtx-datetimepicker-toggle [for]=\"datetimePicker\" matSuffix></mtx-datetimepicker-toggle>\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\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 HH:mm' }}</strong>\r\n }\r\n </mat-error>\r\n }\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 HH:mm' }}</strong>\r\n }\r\n </mat-error>\r\n }\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\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\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\r\n @if (formControl.errors?.['inlineError'] && formControl.touched) {\r\n <mat-error>\r\n @if (!hideErr) {\r\n {{ inlErr }}\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)}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}\n"] }]
|
|
283
|
+
}], ctorParameters: () => [] });
|
|
422
284
|
|
|
423
285
|
/**
|
|
424
286
|
* Generated bundle index. Do not edit.
|