@sdcorejs/angular 20.0.11 → 20.1.0
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/README.md +32 -23
- package/assets/STYLE-GUIDE.md +58 -72
- package/assets/scss/core/color.scss +56 -45
- package/assets/scss/core/form.scss +20 -8
- package/assets/scss/core/utilities/_base.scss +3 -3
- package/assets/scss/core/utilities/_border.scss +1 -1
- package/assets/scss/themes/default.scss +46 -32
- package/assets/scss/themes/material-theme.scss +8 -87
- package/components/badge/index.d.ts +2 -2
- package/components/button/index.d.ts +1 -1
- package/components/modal/index.d.ts +1 -1
- package/components/section/index.d.ts +1 -5
- package/components/side-drawer/index.d.ts +1 -1
- package/components/table/index.d.ts +0 -2
- package/fesm2022/sdcorejs-angular-components-anchor.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs +8 -8
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-badge.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-document-builder.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-document-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-editor.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +17 -14
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +24 -5
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-org-chart.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-preview.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-section.mjs +7 -11
- package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-splitter.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-stepper.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +9 -9
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-view.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +468 -344
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-label.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-label.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +11 -9
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +84 -3
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
- package/forms/datetime/index.d.ts +4 -4
- package/package.json +1 -1
- package/services/confirm/index.d.ts +49 -1
|
@@ -1,331 +1,483 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import * as i4 from '@angular/common';
|
|
1
|
+
import { Platform } from '@angular/cdk/platform';
|
|
2
|
+
import * as i5 from '@angular/common';
|
|
4
3
|
import { CommonModule } from '@angular/common';
|
|
5
4
|
import * as i0 from '@angular/core';
|
|
6
|
-
import {
|
|
5
|
+
import { InjectionToken, Injectable, makeEnvironmentProviders, input, output, computed, signal, ChangeDetectionStrategy, Component, inject, ViewContainerRef, viewChild, ViewEncapsulation, ElementRef, forwardRef, HostListener, Directive, contentChild, ChangeDetectorRef, booleanAttribute, model, effect, untracked } from '@angular/core';
|
|
7
6
|
import * as i1$1 from '@angular/forms';
|
|
8
|
-
import { NgForm, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
7
|
+
import { NG_VALUE_ACCESSOR, NgForm, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import * as i1 from '@angular/material/button';
|
|
9
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
10
|
+
import { DateAdapter, NativeDateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
11
11
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
12
|
-
import * as
|
|
12
|
+
import * as i3 from '@angular/material/input';
|
|
13
13
|
import { MatInputModule } from '@angular/material/input';
|
|
14
|
-
import * as
|
|
14
|
+
import * as i4 from '@angular/material/tooltip';
|
|
15
15
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
16
16
|
import { SdView } from '@sdcorejs/angular/components/view';
|
|
17
17
|
import { SdViewDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
18
18
|
import { SdLabel } from '@sdcorejs/angular/forms/label';
|
|
19
19
|
import { SD_FORM_CONFIGURATION, sdFormControlState, sdViewedTransform, sdViewedInline, SdFormControl, SdInlineErrorValidator } from '@sdcorejs/angular/forms/models';
|
|
20
20
|
import { sdIsEmpty, sdSerializeDataValue } from '@sdcorejs/angular/utilities/data-state';
|
|
21
|
-
import {
|
|
21
|
+
import { I18nService, TranslatePipe } from '@sdcorejs/angular/i18n';
|
|
22
22
|
import { DateUtilities } from '@sdcorejs/angular/utilities/extensions';
|
|
23
23
|
import { Utilities, BrowserUtilities } from '@sdcorejs/utils/fns';
|
|
24
|
-
import {
|
|
25
|
-
import { enUS } from 'date-fns/locale';
|
|
24
|
+
import { parse, isValid } from 'date-fns';
|
|
26
25
|
import { Subscription } from 'rxjs';
|
|
27
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
28
|
-
import * as i1 from '@angular/material/datepicker';
|
|
29
|
-
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
30
26
|
import { SdIcon } from '@sdcorejs/angular/modules/icon';
|
|
27
|
+
import * as i2 from '@angular/material/icon';
|
|
28
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
29
|
+
import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
|
30
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
31
|
+
import { MatCalendar } from '@angular/material/datepicker';
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return;
|
|
55
|
-
if (unit === 'h') {
|
|
56
|
-
const next = (this.hours() + delta + 24) % 24;
|
|
57
|
-
this.hours.set(next);
|
|
58
|
-
}
|
|
59
|
-
else if (unit === 'm') {
|
|
60
|
-
const next = (this.minutes() + delta + 60) % 60;
|
|
61
|
-
this.minutes.set(next);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
const next = (this.seconds() + delta + 60) % 60;
|
|
65
|
-
this.seconds.set(next);
|
|
33
|
+
class SdDateAdapter extends DateAdapter {
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const SD_DATE_FORMATS = new InjectionToken('sd-date-formats');
|
|
37
|
+
|
|
38
|
+
const SD_DATETIME_DEFAULT_OPTIONS = new InjectionToken('sd-datetime-default-options');
|
|
39
|
+
|
|
40
|
+
class SdNativeDateAdapter extends NativeDateAdapter {
|
|
41
|
+
// Nếu displayFormat là string chứa token thời gian (h/H/m/s), dùng Intl để render đầy đủ ngày+giờ
|
|
42
|
+
// Lý do: NativeDateAdapter.format() chỉ nhận Intl.DateTimeFormatOptions, không hiểu chuỗi pattern
|
|
43
|
+
format(date, displayFormat) {
|
|
44
|
+
if (typeof displayFormat === 'string' && /[hHms]/.test(displayFormat)) {
|
|
45
|
+
const opts = {
|
|
46
|
+
year: 'numeric',
|
|
47
|
+
month: 'numeric',
|
|
48
|
+
day: 'numeric',
|
|
49
|
+
hour: 'numeric',
|
|
50
|
+
minute: '2-digit',
|
|
51
|
+
...(/s/.test(displayFormat) ? { second: '2-digit' } : {}),
|
|
52
|
+
hour12: /a/i.test(displayFormat),
|
|
53
|
+
};
|
|
54
|
+
return new Intl.DateTimeFormat(this.locale, opts).format(date);
|
|
66
55
|
}
|
|
56
|
+
return super.format(date, displayFormat);
|
|
67
57
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.hours.set(num);
|
|
76
|
-
else if (unit === 'm')
|
|
77
|
-
this.minutes.set(num);
|
|
78
|
-
else
|
|
79
|
-
this.seconds.set(num);
|
|
58
|
+
getHour(date) { return date.getHours(); }
|
|
59
|
+
getMinute(date) { return date.getMinutes(); }
|
|
60
|
+
getSecond(date) { return date.getSeconds(); }
|
|
61
|
+
setHour(date, hour) {
|
|
62
|
+
const c = new Date(date);
|
|
63
|
+
c.setHours(hour);
|
|
64
|
+
return c;
|
|
80
65
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
this._buf[unit] = '';
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const max = unit === 'h' ? 23 : 59;
|
|
94
|
-
const num = Math.min(parseInt(raw.slice(-2), 10), max);
|
|
95
|
-
this._commitUnit(unit, num);
|
|
96
|
-
this._buf[unit] = '';
|
|
66
|
+
setMinute(date, minute) {
|
|
67
|
+
const c = new Date(date);
|
|
68
|
+
c.setMinutes(minute);
|
|
69
|
+
return c;
|
|
70
|
+
}
|
|
71
|
+
setSecond(date, second) {
|
|
72
|
+
const c = new Date(date);
|
|
73
|
+
c.setSeconds(second);
|
|
74
|
+
return c;
|
|
97
75
|
}
|
|
98
|
-
|
|
99
|
-
|
|
76
|
+
createDatetime(year, month, date, hour, minute, second) {
|
|
77
|
+
if (month < 0 || month > 11)
|
|
78
|
+
throw Error(`month ${month} out of range [0,11]`);
|
|
79
|
+
if (hour < 0 || hour > 23)
|
|
80
|
+
throw Error(`hour ${hour} out of range [0,23]`);
|
|
81
|
+
if (minute < 0 || minute > 59)
|
|
82
|
+
throw Error(`minute ${minute} out of range [0,59]`);
|
|
83
|
+
if (second < 0 || second > 59)
|
|
84
|
+
throw Error(`second ${second} out of range [0,59]`);
|
|
85
|
+
return new Date(year, month, date, hour, minute, second);
|
|
86
|
+
}
|
|
87
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdNativeDateAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
88
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdNativeDateAdapter });
|
|
89
|
+
}
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdNativeDateAdapter, decorators: [{
|
|
91
|
+
type: Injectable
|
|
92
|
+
}] });
|
|
93
|
+
|
|
94
|
+
// Native adapter uses Intl-format objects, not pattern strings. We mirror Material's
|
|
95
|
+
// MAT_NATIVE_DATE_FORMATS shape for date-only entries and pass through datetimeInput
|
|
96
|
+
// as a sentinel; the adapter's `format()` override (if any) interprets it.
|
|
97
|
+
const SD_NATIVE_DATE_FORMATS = {
|
|
98
|
+
parse: {
|
|
99
|
+
dateInput: 'shortDate',
|
|
100
|
+
datetimeInput: 'short',
|
|
101
|
+
timeInput: 'shortTime',
|
|
102
|
+
},
|
|
103
|
+
display: {
|
|
104
|
+
dateInput: 'shortDate',
|
|
105
|
+
datetimeInput: 'short',
|
|
106
|
+
timeInput: 'shortTime',
|
|
107
|
+
monthYearLabel: { year: 'numeric', month: 'short' },
|
|
108
|
+
dateA11yLabel: { year: 'numeric', month: 'long', day: 'numeric' },
|
|
109
|
+
monthYearA11yLabel: { year: 'numeric', month: 'long' },
|
|
110
|
+
popupHeaderDateLabel: { weekday: 'short', month: 'short', day: 'numeric' },
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
function provideSdNativeDateAdapter(formats = SD_NATIVE_DATE_FORMATS) {
|
|
115
|
+
const providers = [
|
|
116
|
+
Platform,
|
|
117
|
+
SdNativeDateAdapter,
|
|
118
|
+
{ provide: DateAdapter, useExisting: SdNativeDateAdapter, deps: [MAT_DATE_LOCALE, Platform] },
|
|
119
|
+
{ provide: SdDateAdapter, useExisting: SdNativeDateAdapter },
|
|
120
|
+
{ provide: MAT_DATE_FORMATS, useValue: formats },
|
|
121
|
+
{ provide: SD_DATE_FORMATS, useValue: formats },
|
|
122
|
+
];
|
|
123
|
+
return makeEnvironmentProviders(providers);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
class SdTimeSpinner {
|
|
127
|
+
value = input(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
128
|
+
showSeconds = input(false, ...(ngDevMode ? [{ debugName: "showSeconds" }] : []));
|
|
129
|
+
stepMinute = input(1, ...(ngDevMode ? [{ debugName: "stepMinute" }] : []));
|
|
130
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
131
|
+
valueChange = output();
|
|
132
|
+
hour = computed(() => this.value()?.getHours() ?? 0, ...(ngDevMode ? [{ debugName: "hour" }] : []));
|
|
133
|
+
minute = computed(() => this.value()?.getMinutes() ?? 0, ...(ngDevMode ? [{ debugName: "minute" }] : []));
|
|
134
|
+
second = computed(() => this.value()?.getSeconds() ?? 0, ...(ngDevMode ? [{ debugName: "second" }] : []));
|
|
135
|
+
_focusedUnit = signal(null, ...(ngDevMode ? [{ debugName: "_focusedUnit" }] : []));
|
|
136
|
+
/** Display string for each column: unpadded while focused (so the user can type freely), padded to 2 digits otherwise. */
|
|
137
|
+
displayHour = computed(() => this._focusedUnit() === 'hour' ? String(this.hour()) : String(this.hour()).padStart(2, '0'), ...(ngDevMode ? [{ debugName: "displayHour" }] : []));
|
|
138
|
+
displayMinute = computed(() => this._focusedUnit() === 'minute' ? String(this.minute()) : String(this.minute()).padStart(2, '0'), ...(ngDevMode ? [{ debugName: "displayMinute" }] : []));
|
|
139
|
+
displaySecond = computed(() => this._focusedUnit() === 'second' ? String(this.second()) : String(this.second()).padStart(2, '0'), ...(ngDevMode ? [{ debugName: "displaySecond" }] : []));
|
|
140
|
+
setFocus(unit) { this._focusedUnit.set(unit); }
|
|
141
|
+
clearFocus() { this._focusedUnit.set(null); }
|
|
142
|
+
stepHourUp() { this.#step('hour', +1); }
|
|
143
|
+
stepHourDown() { this.#step('hour', -1); }
|
|
144
|
+
stepMinuteUp() { this.#step('minute', +this.stepMinute()); }
|
|
145
|
+
stepMinuteDown() { this.#step('minute', -this.stepMinute()); }
|
|
146
|
+
stepSecondUp() { this.#step('second', +1); }
|
|
147
|
+
stepSecondDown() { this.#step('second', -1); }
|
|
148
|
+
// delta ขึ้น/ลง พร้อม wrap-around เพื่อให้ 23+1=0, 0-1=23 เป็นต้น
|
|
149
|
+
#step(unit, delta) {
|
|
100
150
|
if (this.disabled())
|
|
101
151
|
return;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
152
|
+
const base = this.value() ?? new Date(2026, 0, 1, 0, 0, 0);
|
|
153
|
+
const next = new Date(base);
|
|
154
|
+
if (unit === 'hour')
|
|
155
|
+
next.setHours(this.#wrap(base.getHours() + delta, 24));
|
|
156
|
+
if (unit === 'minute')
|
|
157
|
+
next.setMinutes(this.#wrap(base.getMinutes() + delta, 60));
|
|
158
|
+
if (unit === 'second')
|
|
159
|
+
next.setSeconds(this.#wrap(base.getSeconds() + delta, 60));
|
|
160
|
+
this.valueChange.emit(next);
|
|
105
161
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
162
|
+
// modulo ที่รองรับค่าลบ: ((v % mod) + mod) % mod
|
|
163
|
+
#wrap(v, mod) {
|
|
164
|
+
return ((v % mod) + mod) % mod;
|
|
165
|
+
}
|
|
166
|
+
onHourInput(raw) { this.#setUnit('hour', raw, 0, 23); }
|
|
167
|
+
onMinuteInput(raw) { this.#setUnit('minute', raw, 0, 59); }
|
|
168
|
+
onSecondInput(raw) { this.#setUnit('second', raw, 0, 59); }
|
|
169
|
+
onDigitKeyDown(event) {
|
|
170
|
+
// Allow control keys and modifier shortcuts (Ctrl/Cmd + A/C/V/X)
|
|
171
|
+
if ((event.ctrlKey || event.metaKey) && /^[acvx]$/i.test(event.key))
|
|
114
172
|
return;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
173
|
+
const allowed = new Set([
|
|
174
|
+
'Backspace', 'Delete', 'Tab', 'Enter', 'Escape',
|
|
175
|
+
'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown',
|
|
176
|
+
'Home', 'End',
|
|
177
|
+
]);
|
|
178
|
+
if (allowed.has(event.key))
|
|
119
179
|
return;
|
|
120
|
-
|
|
121
|
-
if (event.key
|
|
180
|
+
// Block any non-digit
|
|
181
|
+
if (!/^\d$/.test(event.key))
|
|
122
182
|
event.preventDefault();
|
|
123
|
-
|
|
124
|
-
|
|
183
|
+
}
|
|
184
|
+
// Strip non-digits, clamp to [min, max] แล้ว emit เสมอ (ยกเว้น empty string)
|
|
185
|
+
#setUnit(unit, raw, min, max) {
|
|
186
|
+
if (this.disabled())
|
|
125
187
|
return;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const max = unit === 'h' ? 23 : 59;
|
|
130
|
-
// Chữ số đầu tối đa để còn có thể nhập chữ số 2 hợp lệ:
|
|
131
|
-
// giờ → max first digit = 2 (vd '3x' không hợp lệ vì max 23)
|
|
132
|
-
// phút/giây → max first digit = 5
|
|
133
|
-
const maxFirstDigit = unit === 'h' ? 2 : 5;
|
|
134
|
-
const buf = this._buf[unit] + event.key;
|
|
135
|
-
const el = event.target;
|
|
136
|
-
if (buf.length === 1) {
|
|
137
|
-
const d = parseInt(event.key, 10);
|
|
138
|
-
if (d > maxFirstDigit) {
|
|
139
|
-
// Chữ số đầu không thể là hàng chục hợp lệ → commit ngay dạng 0X
|
|
140
|
-
const num = Math.min(d, max);
|
|
141
|
-
this._commitUnit(unit, num);
|
|
142
|
-
el.value = this.pad(num);
|
|
143
|
-
this._buf[unit] = '';
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
// Chờ chữ số thứ 2 — hiển thị ký tự đơn tạm thời
|
|
147
|
-
this._buf[unit] = event.key;
|
|
148
|
-
el.value = event.key;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
// Đã có 2 chữ số → commit
|
|
153
|
-
const num = Math.min(parseInt(buf, 10), max);
|
|
154
|
-
this._commitUnit(unit, num);
|
|
155
|
-
el.value = this.pad(num);
|
|
156
|
-
this._buf[unit] = '';
|
|
157
|
-
}
|
|
188
|
+
// Strip non-digits and parse
|
|
189
|
+
const cleaned = (raw ?? '').replace(/\D/g, '').slice(0, 2);
|
|
190
|
+
if (cleaned === '')
|
|
158
191
|
return;
|
|
159
|
-
|
|
160
|
-
if (
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
// Khi blur: commit buffer dở (nếu có) + chuẩn hóa hiển thị.
|
|
175
|
-
onBlur(unit, event) {
|
|
176
|
-
if (this._buf[unit]) {
|
|
177
|
-
const max = unit === 'h' ? 23 : 59;
|
|
178
|
-
const num = Math.min(parseInt(this._buf[unit], 10), max);
|
|
179
|
-
this._commitUnit(unit, num);
|
|
180
|
-
this._buf[unit] = '';
|
|
181
|
-
}
|
|
182
|
-
const el = event.target;
|
|
183
|
-
if (unit === 'h')
|
|
184
|
-
el.value = this.pad(this.hours());
|
|
185
|
-
else if (unit === 'm')
|
|
186
|
-
el.value = this.pad(this.minutes());
|
|
187
|
-
else
|
|
188
|
-
el.value = this.pad(this.seconds());
|
|
189
|
-
}
|
|
190
|
-
// Chọn toàn bộ text khi focus + reset buffer.
|
|
191
|
-
onFocus(unit, event) {
|
|
192
|
-
this._buf[unit] = '';
|
|
193
|
-
event.target.select();
|
|
192
|
+
const v = Number.parseInt(cleaned, 10);
|
|
193
|
+
if (Number.isNaN(v))
|
|
194
|
+
return;
|
|
195
|
+
// Clamp to [min, max] (e.g. typing 25 for hour → 23; 99 for minute → 59)
|
|
196
|
+
const clamped = Math.min(Math.max(v, min), max);
|
|
197
|
+
const base = this.value() ?? new Date(2026, 0, 1, 0, 0, 0);
|
|
198
|
+
const next = new Date(base);
|
|
199
|
+
if (unit === 'hour')
|
|
200
|
+
next.setHours(clamped);
|
|
201
|
+
if (unit === 'minute')
|
|
202
|
+
next.setMinutes(clamped);
|
|
203
|
+
if (unit === 'second')
|
|
204
|
+
next.setSeconds(clamped);
|
|
205
|
+
this.valueChange.emit(next);
|
|
194
206
|
}
|
|
195
207
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdTimeSpinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
196
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdTimeSpinner, isStandalone: true, selector: "sd-time-spinner", inputs: {
|
|
208
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdTimeSpinner, isStandalone: true, selector: "sd-time-spinner", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, stepMinute: { classPropertyName: "stepMinute", publicName: "stepMinute", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "sd-time-spinner" }, ngImport: i0, template: "<div class=\"sd-time-spinner__columns\">\n <!-- hour -->\n <div class=\"sd-time-spinner__col\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepHourUp()\" aria-label=\"Increment hour\">\n <mat-icon>keyboard_arrow_up</mat-icon>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n class=\"sd-time-spinner__digits\"\n [value]=\"displayHour()\"\n [disabled]=\"disabled()\"\n (focus)=\"setFocus('hour')\"\n (blur)=\"clearFocus()\"\n (keydown)=\"onDigitKeyDown($event)\"\n (input)=\"onHourInput($any($event.target).value)\"\n aria-label=\"Hour (0-23)\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepHourDown()\" aria-label=\"Decrement hour\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </div>\n\n <span class=\"sd-time-spinner__sep\">:</span>\n\n <!-- minute -->\n <div class=\"sd-time-spinner__col\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepMinuteUp()\" aria-label=\"Increment minute\">\n <mat-icon>keyboard_arrow_up</mat-icon>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n class=\"sd-time-spinner__digits\"\n [value]=\"displayMinute()\"\n [disabled]=\"disabled()\"\n (focus)=\"setFocus('minute')\"\n (blur)=\"clearFocus()\"\n (keydown)=\"onDigitKeyDown($event)\"\n (input)=\"onMinuteInput($any($event.target).value)\"\n aria-label=\"Minute (0-59)\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepMinuteDown()\" aria-label=\"Decrement minute\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </div>\n\n @if (showSeconds()) {\n <span class=\"sd-time-spinner__sep\">:</span>\n <!-- second -->\n <div class=\"sd-time-spinner__col\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepSecondUp()\" aria-label=\"Increment second\">\n <mat-icon>keyboard_arrow_up</mat-icon>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n class=\"sd-time-spinner__digits\"\n [value]=\"displaySecond()\"\n [disabled]=\"disabled()\"\n (focus)=\"setFocus('second')\"\n (blur)=\"clearFocus()\"\n (keydown)=\"onDigitKeyDown($event)\"\n (input)=\"onSecondInput($any($event.target).value)\"\n aria-label=\"Second (0-59)\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepSecondDown()\" aria-label=\"Decrement second\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </div>\n }\n</div>\n", styles: [":host{display:flex;align-items:center;justify-content:center;gap:4px;padding:6px 12px;font-variant-numeric:tabular-nums}.sd-time-spinner__columns{display:flex;align-items:center;justify-content:center;gap:4px}.sd-time-spinner__col{display:flex;flex-direction:column;align-items:center;gap:2px}.sd-time-spinner__col button.mat-mdc-icon-button{width:32px;height:20px;padding:0;min-width:0;line-height:1}.sd-time-spinner__col button.mat-mdc-icon-button .mat-mdc-button-touch-target{width:32px;height:20px}.sd-time-spinner__col button.mat-mdc-icon-button .mat-icon{font-size:18px;width:18px;height:18px;line-height:18px}.sd-time-spinner__digits{-moz-appearance:textfield;width:44px;height:36px;border:1.5px solid transparent;border-radius:6px;background:transparent;text-align:center;font-size:20px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums;outline:none;cursor:text;transition:border-color .15s ease,background-color .15s ease}.sd-time-spinner__digits::-webkit-outer-spin-button,.sd-time-spinner__digits::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.sd-time-spinner__digits:hover:not(:focus){background:#0000000a}.sd-time-spinner__digits:focus{border-color:var(--mat-sys-primary, #1976d2);background:#fff}.sd-time-spinner__digits:disabled{cursor:not-allowed;opacity:.5}.sd-time-spinner__sep{font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;padding-bottom:2px;color:var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
197
209
|
}
|
|
198
210
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdTimeSpinner, decorators: [{
|
|
199
211
|
type: Component,
|
|
200
|
-
args: [{ selector: 'sd-time-spinner', standalone: true, imports: [CommonModule,
|
|
201
|
-
}], propDecorators: {
|
|
212
|
+
args: [{ selector: 'sd-time-spinner', standalone: true, imports: [CommonModule, MatButtonModule, MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'sd-time-spinner' }, template: "<div class=\"sd-time-spinner__columns\">\n <!-- hour -->\n <div class=\"sd-time-spinner__col\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepHourUp()\" aria-label=\"Increment hour\">\n <mat-icon>keyboard_arrow_up</mat-icon>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n class=\"sd-time-spinner__digits\"\n [value]=\"displayHour()\"\n [disabled]=\"disabled()\"\n (focus)=\"setFocus('hour')\"\n (blur)=\"clearFocus()\"\n (keydown)=\"onDigitKeyDown($event)\"\n (input)=\"onHourInput($any($event.target).value)\"\n aria-label=\"Hour (0-23)\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepHourDown()\" aria-label=\"Decrement hour\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </div>\n\n <span class=\"sd-time-spinner__sep\">:</span>\n\n <!-- minute -->\n <div class=\"sd-time-spinner__col\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepMinuteUp()\" aria-label=\"Increment minute\">\n <mat-icon>keyboard_arrow_up</mat-icon>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n class=\"sd-time-spinner__digits\"\n [value]=\"displayMinute()\"\n [disabled]=\"disabled()\"\n (focus)=\"setFocus('minute')\"\n (blur)=\"clearFocus()\"\n (keydown)=\"onDigitKeyDown($event)\"\n (input)=\"onMinuteInput($any($event.target).value)\"\n aria-label=\"Minute (0-59)\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepMinuteDown()\" aria-label=\"Decrement minute\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </div>\n\n @if (showSeconds()) {\n <span class=\"sd-time-spinner__sep\">:</span>\n <!-- second -->\n <div class=\"sd-time-spinner__col\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepSecondUp()\" aria-label=\"Increment second\">\n <mat-icon>keyboard_arrow_up</mat-icon>\n </button>\n <input\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=\"2\"\n class=\"sd-time-spinner__digits\"\n [value]=\"displaySecond()\"\n [disabled]=\"disabled()\"\n (focus)=\"setFocus('second')\"\n (blur)=\"clearFocus()\"\n (keydown)=\"onDigitKeyDown($event)\"\n (input)=\"onSecondInput($any($event.target).value)\"\n aria-label=\"Second (0-59)\">\n <button mat-icon-button [disabled]=\"disabled()\" (click)=\"stepSecondDown()\" aria-label=\"Decrement second\">\n <mat-icon>keyboard_arrow_down</mat-icon>\n </button>\n </div>\n }\n</div>\n", styles: [":host{display:flex;align-items:center;justify-content:center;gap:4px;padding:6px 12px;font-variant-numeric:tabular-nums}.sd-time-spinner__columns{display:flex;align-items:center;justify-content:center;gap:4px}.sd-time-spinner__col{display:flex;flex-direction:column;align-items:center;gap:2px}.sd-time-spinner__col button.mat-mdc-icon-button{width:32px;height:20px;padding:0;min-width:0;line-height:1}.sd-time-spinner__col button.mat-mdc-icon-button .mat-mdc-button-touch-target{width:32px;height:20px}.sd-time-spinner__col button.mat-mdc-icon-button .mat-icon{font-size:18px;width:18px;height:18px;line-height:18px}.sd-time-spinner__digits{-moz-appearance:textfield;width:44px;height:36px;border:1.5px solid transparent;border-radius:6px;background:transparent;text-align:center;font-size:20px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums;outline:none;cursor:text;transition:border-color .15s ease,background-color .15s ease}.sd-time-spinner__digits::-webkit-outer-spin-button,.sd-time-spinner__digits::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.sd-time-spinner__digits:hover:not(:focus){background:#0000000a}.sd-time-spinner__digits:focus{border-color:var(--mat-sys-primary, #1976d2);background:#fff}.sd-time-spinner__digits:disabled{cursor:not-allowed;opacity:.5}.sd-time-spinner__sep{font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none;padding-bottom:2px;color:var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6))}\n"] }]
|
|
213
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], stepMinute: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepMinute", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
202
214
|
|
|
203
|
-
/**
|
|
204
|
-
* Datetime picker popup — Calendar (Angular Material) + Time Spinner + Footer.
|
|
205
|
-
*
|
|
206
|
-
* Component này được render trong CDK Overlay từ `sd-datetime`.
|
|
207
|
-
* Phát event `confirmed`/`cancelled` khi user thao tác trên footer.
|
|
208
|
-
*/
|
|
209
215
|
class SdDatetimePicker {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
+
adapter = inject(SdDateAdapter);
|
|
217
|
+
overlay = inject(Overlay);
|
|
218
|
+
vcr = inject(ViewContainerRef);
|
|
219
|
+
showSeconds = input(false, ...(ngDevMode ? [{ debugName: "showSeconds" }] : []));
|
|
220
|
+
stepMinute = input(1, ...(ngDevMode ? [{ debugName: "stepMinute" }] : []));
|
|
221
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
216
222
|
minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : []));
|
|
217
223
|
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : []));
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
queueMicrotask(() => this.#hydrateFromInput());
|
|
239
|
-
}
|
|
240
|
-
#hydrateFromInput() {
|
|
241
|
-
const init = this.initialValue();
|
|
242
|
-
// Clone bằng new Date(getTime()) để không chia sẻ reference với caller.
|
|
243
|
-
const d = init instanceof Date && isValid(init) ? new Date(init.getTime()) : new Date();
|
|
244
|
-
this.selectedDate.set(d);
|
|
245
|
-
this.hours.set(d.getHours());
|
|
246
|
-
this.minutes.set(d.getMinutes());
|
|
247
|
-
this.seconds.set(d.getSeconds());
|
|
224
|
+
startAt = input(null, ...(ngDevMode ? [{ debugName: "startAt" }] : []));
|
|
225
|
+
applied = output();
|
|
226
|
+
cleared = output();
|
|
227
|
+
closed = output();
|
|
228
|
+
_selected = signal(null, ...(ngDevMode ? [{ debugName: "_selected" }] : []));
|
|
229
|
+
_opened = signal(false, ...(ngDevMode ? [{ debugName: "_opened" }] : []));
|
|
230
|
+
selected = computed(() => this._selected(), ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
231
|
+
opened = computed(() => this._opened(), ...(ngDevMode ? [{ debugName: "opened" }] : []));
|
|
232
|
+
disabledEffective = computed(() => this.disabled() || this._inputDisabled(), ...(ngDevMode ? [{ debugName: "disabledEffective" }] : []));
|
|
233
|
+
panelTemplate = viewChild.required('panel');
|
|
234
|
+
overlayRef = null;
|
|
235
|
+
anchorEl = null;
|
|
236
|
+
_inputDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_inputDisabled" }] : []));
|
|
237
|
+
/** Anchor the overlay to a specific input element (set by the input directive). */
|
|
238
|
+
setAnchor(el) { this.anchorEl = el; }
|
|
239
|
+
/** Sync disabled state from the ControlValueAccessor input directive. */
|
|
240
|
+
setInputDisabledState(isDisabled) {
|
|
241
|
+
this._inputDisabled.set(isDisabled);
|
|
242
|
+
if (isDisabled)
|
|
243
|
+
this.close();
|
|
248
244
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
// ==========================================
|
|
252
|
-
/** Khi user chọn ngày trên MatCalendar. */
|
|
253
|
-
onDateSelected(date) {
|
|
254
|
-
if (!date)
|
|
245
|
+
open() {
|
|
246
|
+
if (this.disabledEffective() || this._opened())
|
|
255
247
|
return;
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
248
|
+
const anchor = this.anchorEl ?? document.body;
|
|
249
|
+
const position = this.overlay.position()
|
|
250
|
+
.flexibleConnectedTo(anchor)
|
|
251
|
+
.withPositions([
|
|
252
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
253
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
254
|
+
])
|
|
255
|
+
.withFlexibleDimensions(false)
|
|
256
|
+
.withPush(true);
|
|
257
|
+
this.overlayRef = this.overlay.create(new OverlayConfig({
|
|
258
|
+
positionStrategy: position,
|
|
259
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
260
|
+
hasBackdrop: true,
|
|
261
|
+
backdropClass: 'cdk-overlay-backdrop',
|
|
262
|
+
panelClass: 'sd-datetime-picker__overlay',
|
|
263
|
+
}));
|
|
264
|
+
this.overlayRef.attach(new TemplatePortal(this.panelTemplate(), this.vcr));
|
|
265
|
+
// Khi click vào backdrop thì đóng picker lại
|
|
266
|
+
this.overlayRef.backdropClick().subscribe(() => this.close());
|
|
267
|
+
this._opened.set(true);
|
|
260
268
|
}
|
|
261
|
-
|
|
262
|
-
if (this.
|
|
269
|
+
close() {
|
|
270
|
+
if (!this._opened())
|
|
263
271
|
return;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
this.confirmed.emit(result);
|
|
272
|
+
this.overlayRef?.dispose();
|
|
273
|
+
this.overlayRef = null;
|
|
274
|
+
this._opened.set(false);
|
|
275
|
+
this.closed.emit();
|
|
269
276
|
}
|
|
270
|
-
|
|
271
|
-
|
|
277
|
+
select(value) { this._selected.set(value); }
|
|
278
|
+
apply() {
|
|
279
|
+
const v = this._selected();
|
|
280
|
+
if (v != null)
|
|
281
|
+
this.applied.emit(v);
|
|
282
|
+
this.close();
|
|
272
283
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const now = new Date();
|
|
278
|
-
this.selectedDate.set(now);
|
|
279
|
-
this.hours.set(now.getHours());
|
|
280
|
-
this.minutes.set(now.getMinutes());
|
|
281
|
-
this.seconds.set(now.getSeconds());
|
|
284
|
+
clear() {
|
|
285
|
+
this._selected.set(null);
|
|
286
|
+
this.cleared.emit();
|
|
287
|
+
this.close();
|
|
282
288
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
const v = this.minDate();
|
|
286
|
-
if (v === null || v === undefined)
|
|
287
|
-
return null;
|
|
288
|
-
if (v instanceof Date)
|
|
289
|
-
return isValid(v) ? v : null;
|
|
290
|
-
const d = new Date(v);
|
|
291
|
-
return isValid(d) ? d : null;
|
|
292
|
-
}
|
|
293
|
-
get _maxDate() {
|
|
294
|
-
const v = this.maxDate();
|
|
295
|
-
if (v === null || v === undefined)
|
|
296
|
-
return null;
|
|
297
|
-
if (v instanceof Date)
|
|
298
|
-
return isValid(v) ? v : null;
|
|
299
|
-
const d = new Date(v);
|
|
300
|
-
return isValid(d) ? d : null;
|
|
289
|
+
now() {
|
|
290
|
+
this._selected.set(new Date());
|
|
301
291
|
}
|
|
292
|
+
ngOnDestroy() { this.overlayRef?.dispose(); }
|
|
302
293
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
303
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
294
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.25", type: SdDatetimePicker, isStandalone: true, selector: "sd-datetime-picker", inputs: { showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, stepMinute: { classPropertyName: "stepMinute", publicName: "stepMinute", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { applied: "applied", cleared: "cleared", closed: "closed" }, host: { classAttribute: "sd-datetime-picker" }, viewQueries: [{ propertyName: "panelTemplate", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #panel>\n <div class=\"sd-datetime-picker__panel\" role=\"dialog\" aria-label=\"Datetime picker\">\n <mat-calendar\n [selected]=\"$any(selected())\"\n [minDate]=\"$any(minDate())\"\n [maxDate]=\"$any(maxDate())\"\n [startAt]=\"$any(startAt())\"\n (selectedChange)=\"select($any($event))\">\n </mat-calendar>\n\n <sd-time-spinner\n [value]=\"$any(selected())\"\n [showSeconds]=\"showSeconds()\"\n [stepMinute]=\"stepMinute()\"\n [disabled]=\"disabled()\"\n (valueChange)=\"select($any($event))\">\n </sd-time-spinner>\n\n <ng-content select=\"sd-datetime-picker-actions\">\n <!-- Fallback: default actions when consumer does not project custom content -->\n <div class=\"sd-datetime-picker__default-actions\">\n <button mat-button type=\"button\" class=\"sd-datetime-picker__default-now\" (click)=\"now()\">\n <mat-icon>schedule</mat-icon>\n Now\n </button>\n <button mat-button type=\"button\" (click)=\"close()\">Cancel</button>\n <button mat-flat-button type=\"button\" (click)=\"apply()\">Apply</button>\n </div>\n </ng-content>\n </div>\n</ng-template>\n", styles: [":host{display:block;font-family:inherit}.sd-datetime-picker__panel{display:flex;flex-direction:column;width:320px;background:var(--mat-sys-surface-container, #fff);border-radius:12px;box-shadow:0 10px 24px #0000001f,0 2px 6px #0000000f;overflow:hidden;animation:sd-picker-enter .18s ease-out}@keyframes sd-picker-enter{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.sd-datetime-picker__panel mat-calendar{display:block;padding:4px 8px 0}.sd-datetime-picker__panel mat-calendar .mat-calendar-header{padding:4px 4px 0}.sd-datetime-picker__panel mat-calendar .mat-calendar-content{padding:0 8px 8px}.sd-datetime-picker__panel sd-time-spinner{border-top:1px solid var(--mat-sys-outline-variant, rgba(0, 0, 0, .08))}.sd-datetime-picker__default-actions{display:flex;align-items:center;gap:4px;padding:8px 12px 12px;border-top:1px solid var(--mat-sys-outline-variant, rgba(0, 0, 0, .08))}.sd-datetime-picker__default-actions .sd-datetime-picker__default-now{margin-right:auto}.sd-datetime-picker__default-actions button.mat-mdc-button,.sd-datetime-picker__default-actions button.mat-mdc-unelevated-button,.sd-datetime-picker__default-actions button.mat-mdc-raised-button{height:32px;min-height:32px;padding:0 12px;font-size:13px;line-height:1}.sd-datetime-picker__default-actions .sd-datetime-picker__default-now .mat-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:middle}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: MatCalendar, selector: "mat-calendar", inputs: ["headerComponent", "startAt", "startView", "selected", "minDate", "maxDate", "dateFilter", "dateClass", "comparisonStart", "comparisonEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedChange", "yearSelected", "monthSelected", "viewChanged", "_userSelection", "_userDragDrop"], exportAs: ["matCalendar"] }, { kind: "component", type: SdTimeSpinner, selector: "sd-time-spinner", inputs: ["value", "showSeconds", "stepMinute", "disabled"], outputs: ["valueChange"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
304
295
|
}
|
|
305
296
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePicker, decorators: [{
|
|
306
297
|
type: Component,
|
|
307
|
-
args: [{ selector: 'sd-datetime-picker', standalone: true, imports: [CommonModule,
|
|
308
|
-
}],
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
298
|
+
args: [{ selector: 'sd-datetime-picker', standalone: true, imports: [CommonModule, MatCalendar, SdTimeSpinner, MatButtonModule, MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { class: 'sd-datetime-picker' }, template: "<ng-template #panel>\n <div class=\"sd-datetime-picker__panel\" role=\"dialog\" aria-label=\"Datetime picker\">\n <mat-calendar\n [selected]=\"$any(selected())\"\n [minDate]=\"$any(minDate())\"\n [maxDate]=\"$any(maxDate())\"\n [startAt]=\"$any(startAt())\"\n (selectedChange)=\"select($any($event))\">\n </mat-calendar>\n\n <sd-time-spinner\n [value]=\"$any(selected())\"\n [showSeconds]=\"showSeconds()\"\n [stepMinute]=\"stepMinute()\"\n [disabled]=\"disabled()\"\n (valueChange)=\"select($any($event))\">\n </sd-time-spinner>\n\n <ng-content select=\"sd-datetime-picker-actions\">\n <!-- Fallback: default actions when consumer does not project custom content -->\n <div class=\"sd-datetime-picker__default-actions\">\n <button mat-button type=\"button\" class=\"sd-datetime-picker__default-now\" (click)=\"now()\">\n <mat-icon>schedule</mat-icon>\n Now\n </button>\n <button mat-button type=\"button\" (click)=\"close()\">Cancel</button>\n <button mat-flat-button type=\"button\" (click)=\"apply()\">Apply</button>\n </div>\n </ng-content>\n </div>\n</ng-template>\n", styles: [":host{display:block;font-family:inherit}.sd-datetime-picker__panel{display:flex;flex-direction:column;width:320px;background:var(--mat-sys-surface-container, #fff);border-radius:12px;box-shadow:0 10px 24px #0000001f,0 2px 6px #0000000f;overflow:hidden;animation:sd-picker-enter .18s ease-out}@keyframes sd-picker-enter{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.sd-datetime-picker__panel mat-calendar{display:block;padding:4px 8px 0}.sd-datetime-picker__panel mat-calendar .mat-calendar-header{padding:4px 4px 0}.sd-datetime-picker__panel mat-calendar .mat-calendar-content{padding:0 8px 8px}.sd-datetime-picker__panel sd-time-spinner{border-top:1px solid var(--mat-sys-outline-variant, rgba(0, 0, 0, .08))}.sd-datetime-picker__default-actions{display:flex;align-items:center;gap:4px;padding:8px 12px 12px;border-top:1px solid var(--mat-sys-outline-variant, rgba(0, 0, 0, .08))}.sd-datetime-picker__default-actions .sd-datetime-picker__default-now{margin-right:auto}.sd-datetime-picker__default-actions button.mat-mdc-button,.sd-datetime-picker__default-actions button.mat-mdc-unelevated-button,.sd-datetime-picker__default-actions button.mat-mdc-raised-button{height:32px;min-height:32px;padding:0 12px;font-size:13px;line-height:1}.sd-datetime-picker__default-actions .sd-datetime-picker__default-now .mat-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:middle}\n"] }]
|
|
299
|
+
}], propDecorators: { showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], stepMinute: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepMinute", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], startAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "startAt", required: false }] }], applied: [{ type: i0.Output, args: ["applied"] }], cleared: [{ type: i0.Output, args: ["cleared"] }], closed: [{ type: i0.Output, args: ["closed"] }], panelTemplate: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
300
|
+
|
|
301
|
+
class SdDatetimePickerInput {
|
|
302
|
+
adapter = inject(SdDateAdapter);
|
|
303
|
+
formats = inject(SD_DATE_FORMATS);
|
|
304
|
+
elementRef = inject(ElementRef);
|
|
305
|
+
picker = input.required(...(ngDevMode ? [{ debugName: "picker", alias: 'sdDatetimePicker' }] : [{ alias: 'sdDatetimePicker' }]));
|
|
306
|
+
isDisabled = false;
|
|
307
|
+
onChange = () => { };
|
|
308
|
+
onTouched = () => { };
|
|
309
|
+
subs = new Subscription();
|
|
310
|
+
ngOnInit() {
|
|
311
|
+
const p = this.picker();
|
|
312
|
+
p.setAnchor(this.elementRef.nativeElement);
|
|
313
|
+
p.setInputDisabledState(this.isDisabled);
|
|
314
|
+
this.subs.add(p.applied.subscribe((value) => {
|
|
315
|
+
this.onChange(value);
|
|
316
|
+
this.writeValue(value);
|
|
317
|
+
}));
|
|
318
|
+
this.subs.add(p.cleared.subscribe(() => {
|
|
319
|
+
this.onChange(null);
|
|
320
|
+
this.writeValue(null);
|
|
321
|
+
}));
|
|
322
|
+
}
|
|
323
|
+
ngOnDestroy() {
|
|
324
|
+
this.subs.unsubscribe();
|
|
325
|
+
}
|
|
326
|
+
// ControlValueAccessor
|
|
327
|
+
writeValue(value) {
|
|
328
|
+
const el = this.elementRef.nativeElement;
|
|
329
|
+
el.value = value == null
|
|
330
|
+
? ''
|
|
331
|
+
: this.adapter.format(value, this.formats.display.datetimeInput);
|
|
332
|
+
// Sync picker's internal selected state — guard for early calls before ngOnInit
|
|
333
|
+
try {
|
|
334
|
+
if (value != null) {
|
|
335
|
+
this.picker().select(value);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
catch {
|
|
339
|
+
// picker signal not yet available (before view init); ignore
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
registerOnChange(fn) { this.onChange = fn; }
|
|
343
|
+
registerOnTouched(fn) { this.onTouched = fn; }
|
|
344
|
+
setDisabledState(isDisabled) {
|
|
345
|
+
this.isDisabled = isDisabled;
|
|
346
|
+
try {
|
|
347
|
+
this.picker().setInputDisabledState(isDisabled);
|
|
348
|
+
}
|
|
349
|
+
catch {
|
|
350
|
+
// picker signal not yet available (before view init); ngOnInit will sync it.
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
onBlur() { this.onTouched(); }
|
|
354
|
+
onInput(raw) {
|
|
355
|
+
const parsed = this.adapter.parse(raw, this.formats.parse.datetimeInput);
|
|
356
|
+
this.onChange(parsed);
|
|
357
|
+
}
|
|
358
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
359
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.25", type: SdDatetimePickerInput, isStandalone: true, selector: "input[sdDatetimePicker]", inputs: { picker: { classPropertyName: "picker", publicName: "sdDatetimePicker", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "blur": "onBlur()", "input": "onInput($event.target.value)" }, properties: { "attr.aria-haspopup": "\"dialog\"", "disabled": "isDisabled || null" } }, providers: [
|
|
360
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SdDatetimePickerInput), multi: true },
|
|
361
|
+
], ngImport: i0 });
|
|
362
|
+
}
|
|
363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerInput, decorators: [{
|
|
364
|
+
type: Directive,
|
|
365
|
+
args: [{
|
|
366
|
+
selector: 'input[sdDatetimePicker]',
|
|
367
|
+
standalone: true,
|
|
368
|
+
providers: [
|
|
369
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SdDatetimePickerInput), multi: true },
|
|
370
|
+
],
|
|
371
|
+
host: {
|
|
372
|
+
'[attr.aria-haspopup]': '"dialog"',
|
|
373
|
+
'[disabled]': 'isDisabled || null',
|
|
374
|
+
},
|
|
375
|
+
}]
|
|
376
|
+
}], propDecorators: { picker: [{ type: i0.Input, args: [{ isSignal: true, alias: "sdDatetimePicker", required: true }] }], onBlur: [{
|
|
377
|
+
type: HostListener,
|
|
378
|
+
args: ['blur']
|
|
379
|
+
}], onInput: [{
|
|
380
|
+
type: HostListener,
|
|
381
|
+
args: ['input', ['$event.target.value']]
|
|
312
382
|
}] } });
|
|
313
383
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
};
|
|
384
|
+
class SdDatetimePickerToggle {
|
|
385
|
+
target = input.required(...(ngDevMode ? [{ debugName: "target", alias: 'sdDatetimePickerToggle' }] : [{ alias: 'sdDatetimePickerToggle' }]));
|
|
386
|
+
onClick() {
|
|
387
|
+
const p = this.target();
|
|
388
|
+
if (p.disabledEffective())
|
|
389
|
+
return;
|
|
390
|
+
if (p.opened()) {
|
|
391
|
+
p.close();
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
p.open();
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerToggle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
398
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.25", type: SdDatetimePickerToggle, isStandalone: true, selector: "button[sdDatetimePickerToggle]", inputs: { target: { classPropertyName: "target", publicName: "sdDatetimePickerToggle", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "onClick()" }, properties: { "disabled": "target().disabledEffective() || null", "attr.aria-disabled": "target().disabledEffective()" } }, ngImport: i0 });
|
|
399
|
+
}
|
|
400
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerToggle, decorators: [{
|
|
401
|
+
type: Directive,
|
|
402
|
+
args: [{
|
|
403
|
+
selector: 'button[sdDatetimePickerToggle]',
|
|
404
|
+
standalone: true,
|
|
405
|
+
host: {
|
|
406
|
+
'type': 'button',
|
|
407
|
+
'[disabled]': 'target().disabledEffective() || null',
|
|
408
|
+
'[attr.aria-disabled]': 'target().disabledEffective()',
|
|
409
|
+
},
|
|
410
|
+
}]
|
|
411
|
+
}], propDecorators: { target: [{ type: i0.Input, args: [{ isSignal: true, alias: "sdDatetimePickerToggle", required: true }] }], onClick: [{
|
|
412
|
+
type: HostListener,
|
|
413
|
+
args: ['click']
|
|
414
|
+
}] } });
|
|
415
|
+
|
|
416
|
+
class SdDatetimePickerActions {
|
|
417
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
418
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: SdDatetimePickerActions, isStandalone: true, selector: "sd-datetime-picker-actions", host: { classAttribute: "sd-datetime-picker-actions" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host{display:flex;align-items:center;gap:4px;padding:8px 12px 12px;border-top:1px solid var(--mat-sys-outline-variant, rgba(0, 0, 0, .08))}:host ::ng-deep button[sdDatetimePickerNow]{margin-right:auto}:host ::ng-deep button.mat-mdc-button,:host ::ng-deep button.mat-mdc-unelevated-button,:host ::ng-deep button.mat-mdc-raised-button{height:32px;min-height:32px;padding:0 12px;font-size:13px;line-height:1}:host ::ng-deep button[sdDatetimePickerNow] .mat-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:middle}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
419
|
+
}
|
|
420
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerActions, decorators: [{
|
|
421
|
+
type: Component,
|
|
422
|
+
args: [{ selector: 'sd-datetime-picker-actions', standalone: true, template: `<ng-content></ng-content>`, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'sd-datetime-picker-actions' }, styles: [":host{display:flex;align-items:center;gap:4px;padding:8px 12px 12px;border-top:1px solid var(--mat-sys-outline-variant, rgba(0, 0, 0, .08))}:host ::ng-deep button[sdDatetimePickerNow]{margin-right:auto}:host ::ng-deep button.mat-mdc-button,:host ::ng-deep button.mat-mdc-unelevated-button,:host ::ng-deep button.mat-mdc-raised-button{height:32px;min-height:32px;padding:0 12px;font-size:13px;line-height:1}:host ::ng-deep button[sdDatetimePickerNow] .mat-icon{font-size:16px;width:16px;height:16px;margin-right:4px;vertical-align:middle}\n"] }]
|
|
423
|
+
}] });
|
|
424
|
+
|
|
425
|
+
class SdDatetimePickerApply {
|
|
426
|
+
picker = inject(SdDatetimePicker);
|
|
427
|
+
onClick() { this.picker.apply(); }
|
|
428
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerApply, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
429
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: SdDatetimePickerApply, isStandalone: true, selector: "button[sdDatetimePickerApply]", host: { attributes: { "type": "button" }, listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
430
|
+
}
|
|
431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerApply, decorators: [{
|
|
432
|
+
type: Directive,
|
|
433
|
+
args: [{
|
|
434
|
+
selector: 'button[sdDatetimePickerApply]',
|
|
435
|
+
standalone: true,
|
|
436
|
+
host: { 'type': 'button' },
|
|
437
|
+
}]
|
|
438
|
+
}], propDecorators: { onClick: [{
|
|
439
|
+
type: HostListener,
|
|
440
|
+
args: ['click']
|
|
441
|
+
}] } });
|
|
442
|
+
|
|
443
|
+
class SdDatetimePickerCancel {
|
|
444
|
+
picker = inject(SdDatetimePicker);
|
|
445
|
+
onClick() { this.picker.close(); }
|
|
446
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerCancel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
447
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: SdDatetimePickerCancel, isStandalone: true, selector: "button[sdDatetimePickerCancel]", host: { attributes: { "type": "button" }, listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
448
|
+
}
|
|
449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerCancel, decorators: [{
|
|
450
|
+
type: Directive,
|
|
451
|
+
args: [{
|
|
452
|
+
selector: 'button[sdDatetimePickerCancel]',
|
|
453
|
+
standalone: true,
|
|
454
|
+
host: { 'type': 'button' },
|
|
455
|
+
}]
|
|
456
|
+
}], propDecorators: { onClick: [{
|
|
457
|
+
type: HostListener,
|
|
458
|
+
args: ['click']
|
|
459
|
+
}] } });
|
|
460
|
+
|
|
461
|
+
class SdDatetimePickerNow {
|
|
462
|
+
picker = inject(SdDatetimePicker);
|
|
463
|
+
onClick() { this.picker.now(); }
|
|
464
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerNow, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
465
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: SdDatetimePickerNow, isStandalone: true, selector: "button[sdDatetimePickerNow]", host: { attributes: { "type": "button" }, listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
466
|
+
}
|
|
467
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetimePickerNow, decorators: [{
|
|
468
|
+
type: Directive,
|
|
469
|
+
args: [{
|
|
470
|
+
selector: 'button[sdDatetimePickerNow]',
|
|
471
|
+
standalone: true,
|
|
472
|
+
host: { 'type': 'button' },
|
|
473
|
+
}]
|
|
474
|
+
}], propDecorators: { onClick: [{
|
|
475
|
+
type: HostListener,
|
|
476
|
+
args: ['click']
|
|
477
|
+
}] } });
|
|
478
|
+
|
|
479
|
+
// Internal M3 material datetime picker API surface used by <sd-datetime>.
|
|
480
|
+
|
|
329
481
|
/**
|
|
330
482
|
* Thử parse `value` theo lần lượt nhiều format; trả về Date đầu tiên hợp lệ.
|
|
331
483
|
* date-fns không hỗ trợ multi-format parse như moment(value, [fmt1, fmt2], true).
|
|
@@ -344,6 +496,7 @@ class SdDatetime {
|
|
|
344
496
|
// 1. SIGNAL QUERIES
|
|
345
497
|
// ==========================================
|
|
346
498
|
inputRef = viewChild('input', ...(ngDevMode ? [{ debugName: "inputRef" }] : []));
|
|
499
|
+
dateTimePicker = viewChild(SdDatetimePicker, ...(ngDevMode ? [{ debugName: "dateTimePicker" }] : []));
|
|
347
500
|
sdLabelTemplate = contentChild('sdLabel', ...(ngDevMode ? [{ debugName: "sdLabelTemplate" }] : []));
|
|
348
501
|
sdValueTemplate = contentChild('sdValue', ...(ngDevMode ? [{ debugName: "sdValueTemplate" }] : []));
|
|
349
502
|
sdViewDef = contentChild(SdViewDefDirective, ...(ngDevMode ? [{ debugName: "sdViewDef" }] : []));
|
|
@@ -351,9 +504,7 @@ class SdDatetime {
|
|
|
351
504
|
// 2. INJECTS
|
|
352
505
|
// ==========================================
|
|
353
506
|
ref = inject(ChangeDetectorRef);
|
|
354
|
-
overlay = inject(Overlay);
|
|
355
507
|
elementRef = inject(ElementRef);
|
|
356
|
-
injector = inject(Injector);
|
|
357
508
|
formConfig = inject(SD_FORM_CONFIGURATION, { optional: true });
|
|
358
509
|
#i18n = inject(I18nService);
|
|
359
510
|
// ==========================================
|
|
@@ -490,11 +641,10 @@ class SdDatetime {
|
|
|
490
641
|
formControl = new SdFormControl();
|
|
491
642
|
isFocused = false;
|
|
492
643
|
isValid;
|
|
493
|
-
/** State popup — true khi đang mở. */
|
|
494
|
-
pickerOpened =
|
|
644
|
+
/** State popup — true khi picker package đang mở. */
|
|
645
|
+
pickerOpened = computed(() => this.dateTimePicker()?.opened() ?? false, ...(ngDevMode ? [{ debugName: "pickerOpened" }] : []));
|
|
495
646
|
#date;
|
|
496
647
|
#subscription = new Subscription();
|
|
497
|
-
#overlayRef = null;
|
|
498
648
|
constructor() {
|
|
499
649
|
// EFFECT 1: Sync model thay đổi từ bên ngoài → cập nhật hiển thị
|
|
500
650
|
effect(() => {
|
|
@@ -546,76 +696,34 @@ class SdDatetime {
|
|
|
546
696
|
const formGroup = this.form();
|
|
547
697
|
formGroup?.removeControl(this.name());
|
|
548
698
|
this.#subscription.unsubscribe();
|
|
549
|
-
this.#closeOverlay();
|
|
550
699
|
}
|
|
551
700
|
// ==========================================
|
|
552
|
-
// 6. POPUP MANAGEMENT —
|
|
701
|
+
// 6. POPUP MANAGEMENT — internal M3 material datetime picker
|
|
553
702
|
// ==========================================
|
|
554
703
|
/** Mở popup chọn datetime, neo vào input. */
|
|
555
704
|
open() {
|
|
556
705
|
if (this.formControl.disabled || this.pickerOpened())
|
|
557
706
|
return;
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
565
|
-
{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },
|
|
566
|
-
{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },
|
|
567
|
-
])
|
|
568
|
-
.withFlexibleDimensions(false)
|
|
569
|
-
.withPush(true);
|
|
570
|
-
const overlayConfig = new OverlayConfig({
|
|
571
|
-
positionStrategy,
|
|
572
|
-
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
573
|
-
hasBackdrop: true,
|
|
574
|
-
backdropClass: 'sd-datetime-backdrop',
|
|
575
|
-
panelClass: 'sd-datetime-overlay-panel',
|
|
576
|
-
});
|
|
577
|
-
this.#overlayRef = this.overlay.create(overlayConfig);
|
|
578
|
-
const portal = new ComponentPortal(SdDatetimePicker, null, this.injector);
|
|
579
|
-
const ref = this.#overlayRef.attach(portal);
|
|
580
|
-
// Đẩy state hiện tại vào popup
|
|
581
|
-
ref.setInput('initialValue', this.#currentValueAsDate());
|
|
582
|
-
ref.setInput('minDate', this.resolvedMin());
|
|
583
|
-
ref.setInput('maxDate', this.resolvedMax());
|
|
584
|
-
ref.setInput('showSeconds', this.showSeconds());
|
|
585
|
-
// Subscribe events từ popup
|
|
586
|
-
ref.instance.confirmed.subscribe((value) => this.#onPickerConfirm(value));
|
|
587
|
-
ref.instance.cancelled.subscribe(() => this.#onPickerCancel());
|
|
588
|
-
// Đóng khi click backdrop
|
|
589
|
-
this.#overlayRef.backdropClick().subscribe(() => this.#onPickerCancel());
|
|
590
|
-
this.pickerOpened.set(true);
|
|
707
|
+
const picker = this.dateTimePicker();
|
|
708
|
+
if (!picker)
|
|
709
|
+
return;
|
|
710
|
+
picker.setAnchor(this.inputRef()?.nativeElement ?? this.elementRef.nativeElement);
|
|
711
|
+
picker.select(this.#currentValueAsDate() ?? new Date());
|
|
712
|
+
picker.open();
|
|
591
713
|
this.ref.markForCheck();
|
|
592
714
|
}
|
|
593
715
|
/** Đóng popup (public — gọi từ template nếu cần). */
|
|
594
716
|
close() {
|
|
595
|
-
this
|
|
717
|
+
this.dateTimePicker()?.close();
|
|
596
718
|
}
|
|
597
|
-
|
|
598
|
-
if (this.#overlayRef) {
|
|
599
|
-
this.#overlayRef.dispose();
|
|
600
|
-
this.#overlayRef = null;
|
|
601
|
-
}
|
|
602
|
-
if (this.pickerOpened()) {
|
|
603
|
-
this.pickerOpened.set(false);
|
|
604
|
-
this.ref.markForCheck();
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
#onPickerConfirm(value) {
|
|
719
|
+
onPickerConfirm(value) {
|
|
608
720
|
const fmt = this.showSeconds() ? 'yyyy/MM/dd HH:mm:ss' : 'yyyy/MM/dd HH:mm:00';
|
|
609
|
-
// value giờ là native Date
|
|
721
|
+
// value giờ là native Date từ package M3, không cần .toDate() như Moment.
|
|
610
722
|
const stored = DateUtilities.toFormat(value, fmt);
|
|
611
723
|
if (this.#date !== stored) {
|
|
612
724
|
this.valueModel.set(stored);
|
|
613
725
|
this.sdChange.emit(stored);
|
|
614
726
|
}
|
|
615
|
-
this.#closeOverlay();
|
|
616
|
-
}
|
|
617
|
-
#onPickerCancel() {
|
|
618
|
-
this.#closeOverlay();
|
|
619
727
|
}
|
|
620
728
|
/** Lấy giá trị hiện tại dưới dạng native Date để truyền vào popup. */
|
|
621
729
|
#currentValueAsDate() {
|
|
@@ -735,28 +843,44 @@ class SdDatetime {
|
|
|
735
843
|
};
|
|
736
844
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetime, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
737
845
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", 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 }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", 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 }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", 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" }, host: { properties: { "class.sd-bare": "isInline()", "class.sd-viewed": "isViewed() || isInline()", "class.sd-has-label": "!!label()" } }, providers: [
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
], 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 }], ngImport: i0, template: "@let _label = label();\n@let _appearance = appearance();\n@let _hideInlineError = hideInlineError();\n@let _errorMessage = errorMessage();\n@let _helperText = helperText();\n@let _required = required();\n@let _isInline = isInline();\n@let _bare = _isInline;\n@let _hasValue = !!formControl.value;\n\n@let _resolvedMin = resolvedMin();\n@let _resolvedMax = resolvedMax();\n\n@let _viewedDate = viewedDate();\n@if (isViewed()) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_viewedDate\"\n [display]=\"_viewedDate | date: (showSeconds() ? 'dd/MM/yyyy HH:mm:ss' : 'dd/MM/yyyy HH:mm')\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\">\n </sd-view>\n} @else {\n @if (_isInline) {\n <!-- why: inline \u2014 sd-view l\u00E0 \"m\u1EB7t\" + trigger; datetime editor render \u1EA9n (.sd-inline-editor) ch\u1EC9 \u0111\u1EC3 m\u1EDF overlay. -->\n <span class=\"sd-inline-view\" role=\"button\" tabindex=\"0\" (click)=\"enterInlineEdit()\" (keydown.enter)=\"enterInlineEdit()\">\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_viewedDate\"\n [display]=\"_viewedDate | date: (showSeconds() ? 'dd/MM/yyyy HH:mm:ss' : 'dd/MM/yyyy HH:mm')\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\">\n </sd-view>\n @if (clearable() && _hasValue && !_required && !formControl.disabled) {\n <button type=\"button\" class=\"sd-inline-clear\" (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </span>\n }\n @if (!_appearance) {\n <ng-content select=\"[sdLabel]\">\n @if (_label) {\n <sd-label [label]=\"_label\" [required]=\"_required\"></sd-label>\n }\n </ng-content>\n }\n\n <div\n class=\"d-flex align-items-center\"\n [class.sd-inline-editor]=\"_isInline\"\n [class.c-focused]=\"isFocused\"\n [class.c-disabled]=\"formControl.disabled\"\n (click)=\"onClick()\"\n aria-hidden=\"true\">\n <mat-form-field\n class=\"c-form-field-datetime-input\"\n [class.sd-md]=\"size() === 'md'\"\n [class.sd-sm]=\"size() === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [appearance]=\"_appearance || 'outline'\"\n [floatLabel]=\"floatLabel()\">\n @if (_appearance && _label) {\n <mat-label style=\"display: inline-block\">\n <div class=\"d-flex align-items-center gap-4\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </div>\n </mat-label>\n }\n\n <input\n aria-hidden=\"true\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n [id]=\"id\"\n (blur)=\"onConfirmInput($event)\"\n (keyup.enter)=\"onConfirmInput($event)\"\n (keydown)=\"onKeyDown($event)\"\n [autocomplete]=\"id\"\n autocorrect=\"off\"\n [formControl]=\"formControl\"\n [required]=\"_required\"\n [placeholder]=\"placeholder() || _label || ''\"\n [min]=\"_resolvedMin\"\n [max]=\"_resolvedMax\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n #input\n matInput />\n\n @if (_hideInlineError && _errorMessage && formControl.touched) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n\n @if (!_hideInlineError && _errorMessage && formControl.touched) {\n <mat-error>{{ _errorMessage }}</mat-error>\n }\n\n @if (formControl.value && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn sd-hover\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n\n <span class=\"cursor-pointer sd-suffix-icon\" (click)=\"!formControl.disabled && open()\" matSuffix\n ><svg fill=\"currentColor\" viewBox=\"0 0 24 24\" fill=\"currentColor\" focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\"></path></svg\n ></span>\n </mat-form-field>\n </div>\n}\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{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-viewed){padding-top:0}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}:host(.sd-bare){position:relative}.sd-inline-view{cursor:pointer;display:inline-flex;align-items:center;width:100%;padding:1px 6px;border-radius:4px;background-color:#0000000a;transition:background-color .15s ease}.sd-inline-view:hover{background-color:#00000014}.sd-inline-view .sd-inline-clear{display:none;align-items:center;margin-left:4px;padding:0;border:0;background:transparent;cursor:pointer;line-height:0;color:var(--sd-text-secondary, #6b7280);transition:color .15s ease}.sd-inline-view .sd-inline-clear sd-icon{font-size:16px;width:16px;height:16px}.sd-inline-view .sd-inline-clear:hover{color:var(--sd-error, #b32626)}.sd-inline-view:hover .sd-inline-clear{display:inline-flex}.sd-inline-editor{position:absolute;inset:0;opacity:0;pointer-events:none}.sd-inline-editor ::ng-deep *{pointer-events:none!important}:host(.sd-bare){display:inline-flex;align-items:center}:host(.sd-bare) ::ng-deep .mat-mdc-form-field{width:auto}:host(.sd-bare) ::ng-deep .mat-mdc-text-field-wrapper{padding:0;background:transparent}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-flex{padding:0;align-items:center}:host(.sd-bare) ::ng-deep .mdc-notched-outline{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.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: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.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: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatFormFieldModule }, { 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", "selectedItems"] }, { kind: "pipe", type: i4.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
846
|
+
Platform,
|
|
847
|
+
SdNativeDateAdapter,
|
|
848
|
+
{ provide: MAT_DATE_LOCALE, useValue: 'en-US' },
|
|
849
|
+
{ provide: DateAdapter, useExisting: SdNativeDateAdapter },
|
|
850
|
+
{ provide: SdDateAdapter, useExisting: SdNativeDateAdapter },
|
|
851
|
+
{ provide: MAT_DATE_FORMATS, useValue: SD_NATIVE_DATE_FORMATS },
|
|
852
|
+
{ provide: SD_DATE_FORMATS, useValue: SD_NATIVE_DATE_FORMATS },
|
|
853
|
+
], 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: SdDatetimePicker, descendants: true, isSignal: true }], ngImport: i0, template: "@let _label = label();\n@let _appearance = appearance();\n@let _hideInlineError = hideInlineError();\n@let _errorMessage = errorMessage();\n@let _helperText = helperText();\n@let _required = required();\n@let _isInline = isInline();\n@let _bare = _isInline;\n@let _hasValue = !!formControl.value;\n\n@let _resolvedMin = resolvedMin();\n@let _resolvedMax = resolvedMax();\n\n@let _viewedDate = viewedDate();\n@if (isViewed()) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_viewedDate\"\n [display]=\"_viewedDate | date: (showSeconds() ? 'dd/MM/yyyy HH:mm:ss' : 'dd/MM/yyyy HH:mm')\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\">\n </sd-view>\n} @else {\n @if (_isInline) {\n <!-- why: inline \u2014 sd-view l\u00E0 \"m\u1EB7t\" + trigger; datetime editor render \u1EA9n (.sd-inline-editor) ch\u1EC9 \u0111\u1EC3 m\u1EDF overlay. -->\n <span class=\"sd-inline-view\" role=\"button\" tabindex=\"0\" (click)=\"enterInlineEdit()\" (keydown.enter)=\"enterInlineEdit()\">\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_viewedDate\"\n [display]=\"_viewedDate | date: (showSeconds() ? 'dd/MM/yyyy HH:mm:ss' : 'dd/MM/yyyy HH:mm')\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\">\n </sd-view>\n @if (clearable() && _hasValue && !_required && !formControl.disabled) {\n <button type=\"button\" class=\"sd-inline-clear\" (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </span>\n }\n @if (!_appearance) {\n <ng-content select=\"[sdLabel]\">\n @if (_label) {\n <sd-label [label]=\"_label\" [required]=\"_required\"></sd-label>\n }\n </ng-content>\n }\n\n <div\n class=\"d-flex align-items-center\"\n [class.sd-inline-editor]=\"_isInline\"\n [class.c-focused]=\"isFocused\"\n [class.c-disabled]=\"formControl.disabled\"\n (click)=\"onClick()\"\n aria-hidden=\"true\">\n <mat-form-field\n class=\"c-form-field-datetime-input\"\n [class.sd-md]=\"size() === 'md'\"\n [class.sd-sm]=\"size() === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [appearance]=\"_appearance || 'outline'\"\n [floatLabel]=\"floatLabel()\">\n @if (_appearance && _label) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <input\n aria-hidden=\"true\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n [id]=\"id\"\n (blur)=\"onConfirmInput($event)\"\n (keyup.enter)=\"onConfirmInput($event)\"\n (keydown)=\"onKeyDown($event)\"\n [autocomplete]=\"id\"\n autocorrect=\"off\"\n [formControl]=\"formControl\"\n [required]=\"_required\"\n [placeholder]=\"placeholder() || _label || ''\"\n [min]=\"_resolvedMin\"\n [max]=\"_resolvedMax\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n #input\n matInput />\n\n @if (_hideInlineError && _errorMessage && formControl.touched) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n\n @if (!_hideInlineError && _errorMessage && formControl.touched) {\n <mat-error>{{ _errorMessage }}</mat-error>\n }\n\n @if (formControl.value && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn sd-hover\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n\n <span class=\"cursor-pointer sd-suffix-icon\" (click)=\"!formControl.disabled && open()\" matSuffix\n ><svg fill=\"currentColor\" viewBox=\"0 0 24 24\" fill=\"currentColor\" focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\"></path></svg\n ></span>\n </mat-form-field>\n\n <sd-datetime-picker\n [showSeconds]=\"showSeconds()\"\n [disabled]=\"formControl.disabled\"\n [minDate]=\"_resolvedMin\"\n [maxDate]=\"_resolvedMax\"\n [startAt]=\"_viewedDate\"\n (applied)=\"onPickerConfirm($event)\">\n <sd-datetime-picker-actions>\n <button mat-button type=\"button\" sdDatetimePickerNow>\n <sd-icon name=\"schedule\"></sd-icon>\n <span>{{ 'core.form.datetime.now' | translate }}</span>\n </button>\n <button mat-button type=\"button\" sdDatetimePickerCancel>{{ 'core.common.cancel' | translate }}</button>\n <button mat-flat-button type=\"button\" sdDatetimePickerApply>{{ 'core.form.datetime.confirm' | translate }}</button>\n </sd-datetime-picker-actions>\n </sd-datetime-picker>\n </div>\n}\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-primary-contrast{color:var(--sd-primary-contrast)!important}.bg-primary-contrast{background:var(--sd-primary-contrast)!important}.border-primary-contrast{border-color:var(--sd-primary-contrast)!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-secondary-contrast{color:var(--sd-secondary-contrast)!important}.bg-secondary-contrast{background:var(--sd-secondary-contrast)!important}.border-secondary-contrast{border-color:var(--sd-secondary-contrast)!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-info-contrast{color:var(--sd-info-contrast)!important}.bg-info-contrast{background:var(--sd-info-contrast)!important}.border-info-contrast{border-color:var(--sd-info-contrast)!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-success-contrast{color:var(--sd-success-contrast)!important}.bg-success-contrast{background:var(--sd-success-contrast)!important}.border-success-contrast{border-color:var(--sd-success-contrast)!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-warning-contrast{color:var(--sd-warning-contrast)!important}.bg-warning-contrast{background:var(--sd-warning-contrast)!important}.border-warning-contrast{border-color:var(--sd-warning-contrast)!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-error-contrast{color:var(--sd-error-contrast)!important}.bg-error-contrast{background:var(--sd-error-contrast)!important}.border-error-contrast{border-color:var(--sd-error-contrast)!important}.text-surface{color:var(--sd-surface)!important}.bg-surface{background:var(--sd-surface)!important}.border-surface{border-color:var(--sd-surface)!important}.text-surface-muted{color:var(--sd-surface-muted)!important}.bg-surface-muted{background:var(--sd-surface-muted)!important}.border-surface-muted{border-color:var(--sd-surface-muted)!important}.text-text{color:var(--sd-text)!important}.bg-text{background:var(--sd-text)!important}.border-text{border-color:var(--sd-text)!important}.text-text-secondary{color:var(--sd-text-secondary)!important}.bg-text-secondary{background:var(--sd-text-secondary)!important}.border-text-secondary{border-color:var(--sd-text-secondary)!important}.text-text-muted{color:var(--sd-text-muted)!important}.bg-text-muted{background:var(--sd-text-muted)!important}.border-text-muted{border-color:var(--sd-text-muted)!important}.text-border{color:var(--sd-border)!important}.bg-border{background:var(--sd-border)!important}.border-border{border-color:var(--sd-border)!important}.text-border-strong{color:var(--sd-border-strong)!important}.bg-border-strong{background:var(--sd-border-strong)!important}.border-border-strong{border-color:var(--sd-border-strong)!important}.text-disabled-bg{color:var(--sd-disabled-bg)!important}.bg-disabled-bg{background:var(--sd-disabled-bg)!important}.border-disabled-bg{border-color:var(--sd-disabled-bg)!important}.text-disabled-text{color:var(--sd-disabled-text)!important}.bg-disabled-text{background:var(--sd-disabled-text)!important}.border-disabled-text{border-color:var(--sd-disabled-text)!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}.text-secondary{color:var(--sd-text-secondary)!important}.text-muted{color:var(--sd-text-muted)!important}.text-body{color:var(--sd-text)!important}.bg-muted{background:var(--sd-surface-muted)!important}:host{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-viewed){padding-top:0}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-disabled-bg)}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-disabled-text)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}:host(.sd-bare){position:relative}.sd-inline-view{cursor:pointer;display:inline-flex;align-items:center;width:100%;padding:1px 6px;border-radius:4px;background-color:#0000000a;transition:background-color .15s ease}.sd-inline-view:hover{background-color:#00000014}.sd-inline-view .sd-inline-clear{display:none;align-items:center;margin-left:4px;padding:0;border:0;background:transparent;cursor:pointer;line-height:0;color:var(--sd-text-secondary, #6b7280);transition:color .15s ease}.sd-inline-view .sd-inline-clear sd-icon{font-size:16px;width:16px;height:16px}.sd-inline-view .sd-inline-clear:hover{color:var(--sd-error, #b32626)}.sd-inline-view:hover .sd-inline-clear{display:inline-flex}.sd-inline-editor{position:absolute;inset:0;opacity:0;pointer-events:none}.sd-inline-editor ::ng-deep *{pointer-events:none!important}:host(.sd-bare){display:inline-flex;align-items:center}:host(.sd-bare) ::ng-deep .mat-mdc-form-field{width:auto}:host(.sd-bare) ::ng-deep .mat-mdc-text-field-wrapper{padding:0;background:transparent}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-flex{padding:0;align-items:center}:host(.sd-bare) ::ng-deep .mdc-notched-outline{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.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: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { 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: 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: SdLabel, selector: "sd-label", inputs: ["label", "description", "required", "helperText"] }, { kind: "component", type: SdView, selector: "sd-view", inputs: ["label", "value", "display", "hyperlink", "labelTemplate", "valueTemplate", "selectedItems"] }, { kind: "component", type: SdDatetimePicker, selector: "sd-datetime-picker", inputs: ["showSeconds", "stepMinute", "disabled", "minDate", "maxDate", "startAt"], outputs: ["applied", "cleared", "closed"] }, { kind: "component", type: SdDatetimePickerActions, selector: "sd-datetime-picker-actions" }, { kind: "directive", type: SdDatetimePickerApply, selector: "button[sdDatetimePickerApply]" }, { kind: "directive", type: SdDatetimePickerCancel, selector: "button[sdDatetimePickerCancel]" }, { kind: "directive", type: SdDatetimePickerNow, selector: "button[sdDatetimePickerNow]" }, { kind: "pipe", type: i5.DatePipe, name: "date" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
742
854
|
}
|
|
743
855
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdDatetime, decorators: [{
|
|
744
856
|
type: Component,
|
|
745
857
|
args: [{ selector: 'sd-datetime', changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class.sd-bare]': 'isInline()', '[class.sd-viewed]': 'isViewed() || isInline()', '[class.sd-has-label]': '!!label()' }, providers: [
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
858
|
+
Platform,
|
|
859
|
+
SdNativeDateAdapter,
|
|
860
|
+
{ provide: MAT_DATE_LOCALE, useValue: 'en-US' },
|
|
861
|
+
{ provide: DateAdapter, useExisting: SdNativeDateAdapter },
|
|
862
|
+
{ provide: SdDateAdapter, useExisting: SdNativeDateAdapter },
|
|
863
|
+
{ provide: MAT_DATE_FORMATS, useValue: SD_NATIVE_DATE_FORMATS },
|
|
864
|
+
{ provide: SD_DATE_FORMATS, useValue: SD_NATIVE_DATE_FORMATS },
|
|
865
|
+
], standalone: true, imports: [
|
|
866
|
+
SdIcon,
|
|
750
867
|
CommonModule,
|
|
751
868
|
FormsModule,
|
|
752
869
|
ReactiveFormsModule,
|
|
870
|
+
MatButtonModule,
|
|
753
871
|
MatInputModule,
|
|
754
872
|
MatTooltipModule,
|
|
755
873
|
MatFormFieldModule,
|
|
756
874
|
SdLabel,
|
|
757
875
|
SdView,
|
|
758
|
-
], template: "@let _label = label();\n@let _appearance = appearance();\n@let _hideInlineError = hideInlineError();\n@let _errorMessage = errorMessage();\n@let _helperText = helperText();\n@let _required = required();\n@let _isInline = isInline();\n@let _bare = _isInline;\n@let _hasValue = !!formControl.value;\n\n@let _resolvedMin = resolvedMin();\n@let _resolvedMax = resolvedMax();\n\n@let _viewedDate = viewedDate();\n@if (isViewed()) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_viewedDate\"\n [display]=\"_viewedDate | date: (showSeconds() ? 'dd/MM/yyyy HH:mm:ss' : 'dd/MM/yyyy HH:mm')\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\">\n </sd-view>\n} @else {\n @if (_isInline) {\n <!-- why: inline \u2014 sd-view l\u00E0 \"m\u1EB7t\" + trigger; datetime editor render \u1EA9n (.sd-inline-editor) ch\u1EC9 \u0111\u1EC3 m\u1EDF overlay. -->\n <span class=\"sd-inline-view\" role=\"button\" tabindex=\"0\" (click)=\"enterInlineEdit()\" (keydown.enter)=\"enterInlineEdit()\">\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_viewedDate\"\n [display]=\"_viewedDate | date: (showSeconds() ? 'dd/MM/yyyy HH:mm:ss' : 'dd/MM/yyyy HH:mm')\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\">\n </sd-view>\n @if (clearable() && _hasValue && !_required && !formControl.disabled) {\n <button type=\"button\" class=\"sd-inline-clear\" (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </span>\n }\n @if (!_appearance) {\n <ng-content select=\"[sdLabel]\">\n @if (_label) {\n <sd-label [label]=\"_label\" [required]=\"_required\"></sd-label>\n }\n </ng-content>\n }\n\n <div\n class=\"d-flex align-items-center\"\n [class.sd-inline-editor]=\"_isInline\"\n [class.c-focused]=\"isFocused\"\n [class.c-disabled]=\"formControl.disabled\"\n (click)=\"onClick()\"\n aria-hidden=\"true\">\n <mat-form-field\n class=\"c-form-field-datetime-input\"\n [class.sd-md]=\"size() === 'md'\"\n [class.sd-sm]=\"size() === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [appearance]=\"_appearance || 'outline'\"\n [floatLabel]=\"floatLabel()\">\n @if (_appearance && _label) {\n <mat-label style=\"display: inline-block\">\n <div class=\"d-flex align-items-center gap-4\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </div>\n </mat-label>\n }\n\n <input\n aria-hidden=\"true\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n [id]=\"id\"\n (blur)=\"onConfirmInput($event)\"\n (keyup.enter)=\"onConfirmInput($event)\"\n (keydown)=\"onKeyDown($event)\"\n [autocomplete]=\"id\"\n autocorrect=\"off\"\n [formControl]=\"formControl\"\n [required]=\"_required\"\n [placeholder]=\"placeholder() || _label || ''\"\n [min]=\"_resolvedMin\"\n [max]=\"_resolvedMax\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n #input\n matInput />\n\n @if (_hideInlineError && _errorMessage && formControl.touched) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n\n @if (!_hideInlineError && _errorMessage && formControl.touched) {\n <mat-error>{{ _errorMessage }}</mat-error>\n }\n\n @if (formControl.value && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn sd-hover\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n\n <span class=\"cursor-pointer sd-suffix-icon\" (click)=\"!formControl.disabled && open()\" matSuffix\n ><svg fill=\"currentColor\" viewBox=\"0 0 24 24\" fill=\"currentColor\" focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\"></path></svg\n ></span>\n </mat-form-field>\n </div>\n}\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{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-viewed){padding-top:0}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-black100)}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-black400)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}:host(.sd-bare){position:relative}.sd-inline-view{cursor:pointer;display:inline-flex;align-items:center;width:100%;padding:1px 6px;border-radius:4px;background-color:#0000000a;transition:background-color .15s ease}.sd-inline-view:hover{background-color:#00000014}.sd-inline-view .sd-inline-clear{display:none;align-items:center;margin-left:4px;padding:0;border:0;background:transparent;cursor:pointer;line-height:0;color:var(--sd-text-secondary, #6b7280);transition:color .15s ease}.sd-inline-view .sd-inline-clear sd-icon{font-size:16px;width:16px;height:16px}.sd-inline-view .sd-inline-clear:hover{color:var(--sd-error, #b32626)}.sd-inline-view:hover .sd-inline-clear{display:inline-flex}.sd-inline-editor{position:absolute;inset:0;opacity:0;pointer-events:none}.sd-inline-editor ::ng-deep *{pointer-events:none!important}:host(.sd-bare){display:inline-flex;align-items:center}:host(.sd-bare) ::ng-deep .mat-mdc-form-field{width:auto}:host(.sd-bare) ::ng-deep .mat-mdc-text-field-wrapper{padding:0;background:transparent}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-flex{padding:0;align-items:center}:host(.sd-bare) ::ng-deep .mdc-notched-outline{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}\n"] }]
|
|
759
|
-
|
|
876
|
+
TranslatePipe,
|
|
877
|
+
SdDatetimePicker,
|
|
878
|
+
SdDatetimePickerActions,
|
|
879
|
+
SdDatetimePickerApply,
|
|
880
|
+
SdDatetimePickerCancel,
|
|
881
|
+
SdDatetimePickerNow,
|
|
882
|
+
], template: "@let _label = label();\n@let _appearance = appearance();\n@let _hideInlineError = hideInlineError();\n@let _errorMessage = errorMessage();\n@let _helperText = helperText();\n@let _required = required();\n@let _isInline = isInline();\n@let _bare = _isInline;\n@let _hasValue = !!formControl.value;\n\n@let _resolvedMin = resolvedMin();\n@let _resolvedMax = resolvedMax();\n\n@let _viewedDate = viewedDate();\n@if (isViewed()) {\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_viewedDate\"\n [display]=\"_viewedDate | date: (showSeconds() ? 'dd/MM/yyyy HH:mm:ss' : 'dd/MM/yyyy HH:mm')\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\">\n </sd-view>\n} @else {\n @if (_isInline) {\n <!-- why: inline \u2014 sd-view l\u00E0 \"m\u1EB7t\" + trigger; datetime editor render \u1EA9n (.sd-inline-editor) ch\u1EC9 \u0111\u1EC3 m\u1EDF overlay. -->\n <span class=\"sd-inline-view\" role=\"button\" tabindex=\"0\" (click)=\"enterInlineEdit()\" (keydown.enter)=\"enterInlineEdit()\">\n <sd-view\n [label]=\"_label\"\n [labelTemplate]=\"sdLabelTemplate()\"\n [value]=\"_viewedDate\"\n [display]=\"_viewedDate | date: (showSeconds() ? 'dd/MM/yyyy HH:mm:ss' : 'dd/MM/yyyy HH:mm')\"\n [hyperlink]=\"hyperlink()\"\n [valueTemplate]=\"viewTemplate()\">\n </sd-view>\n @if (clearable() && _hasValue && !_required && !formControl.disabled) {\n <button type=\"button\" class=\"sd-inline-clear\" (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n </span>\n }\n @if (!_appearance) {\n <ng-content select=\"[sdLabel]\">\n @if (_label) {\n <sd-label [label]=\"_label\" [required]=\"_required\"></sd-label>\n }\n </ng-content>\n }\n\n <div\n class=\"d-flex align-items-center\"\n [class.sd-inline-editor]=\"_isInline\"\n [class.c-focused]=\"isFocused\"\n [class.c-disabled]=\"formControl.disabled\"\n (click)=\"onClick()\"\n aria-hidden=\"true\">\n <mat-form-field\n class=\"c-form-field-datetime-input\"\n [class.sd-md]=\"size() === 'md'\"\n [class.sd-sm]=\"size() === 'sm'\"\n [class.hide-inline-error]=\"_hideInlineError\"\n [appearance]=\"_appearance || 'outline'\"\n [floatLabel]=\"floatLabel()\">\n @if (_appearance && _label) {\n <mat-label class=\"sd-form-field-label\">\n <span>{{ _label }}</span>\n @if (_helperText) {\n <sd-icon [matTooltip]=\"_helperText\" matTooltipPosition=\"below\" name=\"info\"></sd-icon>\n }\n </mat-label>\n }\n\n <input\n aria-hidden=\"true\"\n [attr.data-autoId]=\"autoId()\"\n [attr.data-disabled]=\"dataDisabled()\"\n [attr.data-invalid]=\"dataInvalid()\"\n [attr.data-empty]=\"dataEmpty()\"\n [attr.data-value]=\"dataValue()\"\n [attr.data-required]=\"dataRequired()\"\n [attr.data-error-message]=\"dataErrorMessage()\"\n [id]=\"id\"\n (blur)=\"onConfirmInput($event)\"\n (keyup.enter)=\"onConfirmInput($event)\"\n (keydown)=\"onKeyDown($event)\"\n [autocomplete]=\"id\"\n autocorrect=\"off\"\n [formControl]=\"formControl\"\n [required]=\"_required\"\n [placeholder]=\"placeholder() || _label || ''\"\n [min]=\"_resolvedMin\"\n [max]=\"_resolvedMax\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n #input\n matInput />\n\n @if (_hideInlineError && _errorMessage && formControl.touched) {\n <sd-icon matSuffix class=\"sd-error-icon\" [matTooltip]=\"_errorMessage\" matTooltipPosition=\"above\" name=\"error\"></sd-icon>\n }\n\n @if (!_hideInlineError && _errorMessage && formControl.touched) {\n <mat-error>{{ _errorMessage }}</mat-error>\n }\n\n @if (formControl.value && !_required && !formControl.disabled && !_bare) {\n <button type=\"button\" class=\"sd-clear-btn sd-hover\" matSuffix (click)=\"clear($event)\" title=\"X\u00F3a\" aria-label=\"X\u00F3a\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n }\n\n <span class=\"cursor-pointer sd-suffix-icon\" (click)=\"!formControl.disabled && open()\" matSuffix\n ><svg fill=\"currentColor\" viewBox=\"0 0 24 24\" fill=\"currentColor\" focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\"></path></svg\n ></span>\n </mat-form-field>\n\n <sd-datetime-picker\n [showSeconds]=\"showSeconds()\"\n [disabled]=\"formControl.disabled\"\n [minDate]=\"_resolvedMin\"\n [maxDate]=\"_resolvedMax\"\n [startAt]=\"_viewedDate\"\n (applied)=\"onPickerConfirm($event)\">\n <sd-datetime-picker-actions>\n <button mat-button type=\"button\" sdDatetimePickerNow>\n <sd-icon name=\"schedule\"></sd-icon>\n <span>{{ 'core.form.datetime.now' | translate }}</span>\n </button>\n <button mat-button type=\"button\" sdDatetimePickerCancel>{{ 'core.common.cancel' | translate }}</button>\n <button mat-flat-button type=\"button\" sdDatetimePickerApply>{{ 'core.form.datetime.confirm' | translate }}</button>\n </sd-datetime-picker-actions>\n </sd-datetime-picker>\n </div>\n}\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-primary-contrast{color:var(--sd-primary-contrast)!important}.bg-primary-contrast{background:var(--sd-primary-contrast)!important}.border-primary-contrast{border-color:var(--sd-primary-contrast)!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-secondary-contrast{color:var(--sd-secondary-contrast)!important}.bg-secondary-contrast{background:var(--sd-secondary-contrast)!important}.border-secondary-contrast{border-color:var(--sd-secondary-contrast)!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-info-contrast{color:var(--sd-info-contrast)!important}.bg-info-contrast{background:var(--sd-info-contrast)!important}.border-info-contrast{border-color:var(--sd-info-contrast)!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-success-contrast{color:var(--sd-success-contrast)!important}.bg-success-contrast{background:var(--sd-success-contrast)!important}.border-success-contrast{border-color:var(--sd-success-contrast)!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-warning-contrast{color:var(--sd-warning-contrast)!important}.bg-warning-contrast{background:var(--sd-warning-contrast)!important}.border-warning-contrast{border-color:var(--sd-warning-contrast)!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-error-contrast{color:var(--sd-error-contrast)!important}.bg-error-contrast{background:var(--sd-error-contrast)!important}.border-error-contrast{border-color:var(--sd-error-contrast)!important}.text-surface{color:var(--sd-surface)!important}.bg-surface{background:var(--sd-surface)!important}.border-surface{border-color:var(--sd-surface)!important}.text-surface-muted{color:var(--sd-surface-muted)!important}.bg-surface-muted{background:var(--sd-surface-muted)!important}.border-surface-muted{border-color:var(--sd-surface-muted)!important}.text-text{color:var(--sd-text)!important}.bg-text{background:var(--sd-text)!important}.border-text{border-color:var(--sd-text)!important}.text-text-secondary{color:var(--sd-text-secondary)!important}.bg-text-secondary{background:var(--sd-text-secondary)!important}.border-text-secondary{border-color:var(--sd-text-secondary)!important}.text-text-muted{color:var(--sd-text-muted)!important}.bg-text-muted{background:var(--sd-text-muted)!important}.border-text-muted{border-color:var(--sd-text-muted)!important}.text-border{color:var(--sd-border)!important}.bg-border{background:var(--sd-border)!important}.border-border{border-color:var(--sd-border)!important}.text-border-strong{color:var(--sd-border-strong)!important}.bg-border-strong{background:var(--sd-border-strong)!important}.border-border-strong{border-color:var(--sd-border-strong)!important}.text-disabled-bg{color:var(--sd-disabled-bg)!important}.bg-disabled-bg{background:var(--sd-disabled-bg)!important}.border-disabled-bg{border-color:var(--sd-disabled-bg)!important}.text-disabled-text{color:var(--sd-disabled-text)!important}.bg-disabled-text{background:var(--sd-disabled-text)!important}.border-disabled-text{border-color:var(--sd-disabled-text)!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}.text-secondary{color:var(--sd-text-secondary)!important}.text-muted{color:var(--sd-text-muted)!important}.text-body{color:var(--sd-text)!important}.bg-muted{background:var(--sd-surface-muted)!important}:host{display:block}:host(.sd-has-label){padding-top:4px}:host(.sd-viewed){padding-top:0}:host ::ng-deep .mat-mdc-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-mdc-text-field-wrapper{background:var(--sd-disabled-bg)}:host ::ng-deep .mat-mdc-form-field input.mat-mdc-input-element:disabled{color:var(--sd-disabled-text)!important}:host ::ng-deep .mat-mdc-form-field .mat-mdc-placeholder-required{color:var(--sd-error)}:host(.sd-bare){position:relative}.sd-inline-view{cursor:pointer;display:inline-flex;align-items:center;width:100%;padding:1px 6px;border-radius:4px;background-color:#0000000a;transition:background-color .15s ease}.sd-inline-view:hover{background-color:#00000014}.sd-inline-view .sd-inline-clear{display:none;align-items:center;margin-left:4px;padding:0;border:0;background:transparent;cursor:pointer;line-height:0;color:var(--sd-text-secondary, #6b7280);transition:color .15s ease}.sd-inline-view .sd-inline-clear sd-icon{font-size:16px;width:16px;height:16px}.sd-inline-view .sd-inline-clear:hover{color:var(--sd-error, #b32626)}.sd-inline-view:hover .sd-inline-clear{display:inline-flex}.sd-inline-editor{position:absolute;inset:0;opacity:0;pointer-events:none}.sd-inline-editor ::ng-deep *{pointer-events:none!important}:host(.sd-bare){display:inline-flex;align-items:center}:host(.sd-bare) ::ng-deep .mat-mdc-form-field{width:auto}:host(.sd-bare) ::ng-deep .mat-mdc-text-field-wrapper{padding:0;background:transparent}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-flex{padding:0;align-items:center}:host(.sd-bare) ::ng-deep .mdc-notched-outline{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-subscript-wrapper{display:none}:host(.sd-bare) ::ng-deep .mat-mdc-form-field-infix{padding:0;min-height:0;width:auto;border:0;display:inline-flex;align-items:center}\n"] }]
|
|
883
|
+
}], ctorParameters: () => [], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], dateTimePicker: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdDatetimePicker), { isSignal: true }] }], sdLabelTemplate: [{ type: i0.ContentChild, args: ['sdLabel', { isSignal: true }] }], sdValueTemplate: [{ type: i0.ContentChild, args: ['sdValue', { isSignal: true }] }], sdViewDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdViewDefDirective), { isSignal: true }] }], autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hideInlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideInlineError", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], viewed: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewed", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], inlineError: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineError", required: false }] }], hyperlink: [{ type: i0.Input, args: [{ isSignal: true, alias: "hyperlink", required: false }] }], appearanceInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }], minInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], minDateInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], maxDateInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], valueModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }, { type: i0.Output, args: ["modelChange"] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }], sdFocus: [{ type: i0.Output, args: ["sdFocus"] }] } });
|
|
760
884
|
|
|
761
885
|
/**
|
|
762
886
|
* Generated bundle index. Do not edit.
|