cmat 0.0.118 → 0.0.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/cmat-components-adapter.mjs +9 -9
- package/fesm2022/cmat-components-breadcrumb.mjs +10 -9
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +6 -6
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-carousel.mjs +16 -16
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +1 -863
- package/fesm2022/cmat-components-chip-input.mjs +11 -11
- package/fesm2022/cmat-components-code-editor.mjs +3 -3
- package/fesm2022/cmat-components-color-picker.mjs +45 -45
- package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +214 -214
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-data-picker.mjs +38 -38
- package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +15 -16
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-date-time-display.mjs +4 -4
- package/fesm2022/cmat-components-drawer.mjs +9 -9
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-empty-state.mjs +4 -4
- package/fesm2022/cmat-components-file-preview.mjs +4 -4
- package/fesm2022/cmat-components-filter-toolbar.mjs +12 -13
- package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
- package/fesm2022/cmat-components-form-actions.mjs +6 -6
- package/fesm2022/cmat-components-fullscreen.mjs +4 -4
- package/fesm2022/cmat-components-highlight.mjs +7 -7
- package/fesm2022/cmat-components-image-viewer.mjs +7 -7
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- package/fesm2022/cmat-components-inline-loading.mjs +3 -3
- package/fesm2022/cmat-components-json-editor.mjs +7 -7
- package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
- package/fesm2022/cmat-components-knob-input.mjs +6 -6
- package/fesm2022/cmat-components-loading-overlay.mjs +5 -5
- package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +4 -4
- package/fesm2022/cmat-components-material-color-picker.mjs +1 -337
- package/fesm2022/cmat-components-material-datetimepicker.mjs +1 -4312
- package/fesm2022/cmat-components-navigation.mjs +1 -3081
- package/fesm2022/cmat-components-opt-input.mjs +1 -542
- package/fesm2022/cmat-components-org-chart.mjs +1 -529
- package/fesm2022/cmat-components-page-header.mjs +4 -4
- package/fesm2022/cmat-components-pagination.mjs +21 -21
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +1 -880
- package/fesm2022/cmat-components-popover.mjs +1 -1022
- package/fesm2022/cmat-components-progress-bar.mjs +4 -4
- package/fesm2022/cmat-components-qrcode.mjs +3 -3
- package/fesm2022/cmat-components-rating.mjs +8 -8
- package/fesm2022/cmat-components-rich-text-editor.mjs +3 -3
- package/fesm2022/cmat-components-select-search.mjs +1 -930
- package/fesm2022/cmat-components-select-table.mjs +39 -39
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +28 -27
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-skeleton.mjs +5 -5
- package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +12 -12
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-status-tag.mjs +6 -6
- package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
- package/fesm2022/cmat-components-table-toolbar.mjs +4 -4
- package/fesm2022/cmat-components-timeline.mjs +19 -19
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +14 -14
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +48 -49
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +8 -8
- package/fesm2022/cmat-components-upload.mjs +17 -17
- package/fesm2022/cmat-components-x6-angular-shape.mjs +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +1 -221
- package/fesm2022/cmat-directives-arrow-cursor.mjs +3 -3
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-data-exporter.mjs +1 -544
- package/fesm2022/cmat-directives-debounce.mjs +1 -163
- package/fesm2022/cmat-directives-digit-only.mjs +6 -6
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +3 -3
- package/fesm2022/cmat-lib-mock-api.mjs +8 -8
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-secure.mjs +6 -6
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-reports.mjs +86 -80
- package/fesm2022/cmat-reports.mjs.map +1 -1
- package/fesm2022/cmat-services-alert.mjs +4 -4
- package/fesm2022/cmat-services-config.mjs +6 -6
- package/fesm2022/cmat-services-confirmation.mjs +1 -185
- package/fesm2022/cmat-services-data.mjs +5 -5
- package/fesm2022/cmat-services-export-as.mjs +4 -4
- package/fesm2022/cmat-services-loading.mjs +6 -6
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs +4 -4
- package/fesm2022/cmat-services-platform.mjs +4 -4
- package/fesm2022/cmat-services-print.mjs +3 -3
- package/fesm2022/cmat-services-splash-screen.mjs +4 -4
- package/fesm2022/cmat-services-title.mjs +6 -6
- package/fesm2022/cmat-services-translation.mjs +4 -4
- package/fesm2022/cmat-services-utils.mjs +7 -7
- package/fesm2022/cmat.mjs +77 -39582
- package/fesm2022/public-api-BE83BHd7.mjs +930 -0
- package/fesm2022/public-api-BE83BHd7.mjs.map +1 -0
- package/fesm2022/public-api-BcmOSkgf.mjs +542 -0
- package/fesm2022/public-api-BcmOSkgf.mjs.map +1 -0
- package/fesm2022/public-api-BmMqKDzm.mjs +4312 -0
- package/fesm2022/public-api-BmMqKDzm.mjs.map +1 -0
- package/fesm2022/public-api-BnRFazGR.mjs +221 -0
- package/fesm2022/public-api-BnRFazGR.mjs.map +1 -0
- package/fesm2022/public-api-C9N9rKkB.mjs +185 -0
- package/fesm2022/public-api-C9N9rKkB.mjs.map +1 -0
- package/fesm2022/public-api-CXmCX9ZQ.mjs +863 -0
- package/fesm2022/public-api-CXmCX9ZQ.mjs.map +1 -0
- package/fesm2022/public-api-CfILyvuV.mjs +880 -0
- package/fesm2022/public-api-CfILyvuV.mjs.map +1 -0
- package/fesm2022/public-api-CgtBw-7O.mjs +163 -0
- package/fesm2022/public-api-CgtBw-7O.mjs.map +1 -0
- package/fesm2022/public-api-DEtzrfqy.mjs +544 -0
- package/fesm2022/public-api-DEtzrfqy.mjs.map +1 -0
- package/fesm2022/public-api-EK51WC1y.mjs +1022 -0
- package/fesm2022/public-api-EK51WC1y.mjs.map +1 -0
- package/fesm2022/public-api-IpTsAgZ4.mjs +3081 -0
- package/fesm2022/public-api-IpTsAgZ4.mjs.map +1 -0
- package/fesm2022/public-api-iRaKIVmd.mjs +338 -0
- package/fesm2022/public-api-iRaKIVmd.mjs.map +1 -0
- package/fesm2022/public-api-nzzDLiDj.mjs +529 -0
- package/fesm2022/public-api-nzzDLiDj.mjs.map +1 -0
- package/fesm2022/{cmat-quill-docx-exporter-D9Eo73Wq.mjs → quill-docx-exporter-D9Eo73Wq.mjs} +1 -1
- package/fesm2022/quill-docx-exporter-D9Eo73Wq.mjs.map +1 -0
- package/package.json +23 -22
- package/types/cmat-components-adapter.d.ts +0 -3
- package/types/cmat-components-breadcrumb.d.ts +1 -4
- package/types/cmat-components-card.d.ts +0 -3
- package/types/cmat-components-carousel.d.ts +0 -3
- package/types/cmat-components-cascade.d.ts +0 -3
- package/types/cmat-components-chip-input.d.ts +3 -6
- package/types/cmat-components-code-editor.d.ts +0 -3
- package/types/cmat-components-color-picker.d.ts +0 -3
- package/types/cmat-components-custom-formly.d.ts +2 -861
- package/types/cmat-components-data-picker.d.ts +6 -9
- package/types/cmat-components-date-range.d.ts +1 -4
- package/types/cmat-components-date-time-display.d.ts +0 -3
- package/types/cmat-components-drawer.d.ts +1 -4
- package/types/cmat-components-empty-state.d.ts +0 -3
- package/types/cmat-components-file-preview.d.ts +0 -3
- package/types/cmat-components-filter-toolbar.d.ts +0 -3
- package/types/cmat-components-form-actions.d.ts +1 -4
- package/types/cmat-components-fullscreen.d.ts +0 -3
- package/types/cmat-components-highlight.d.ts +0 -3
- package/types/cmat-components-image-viewer.d.ts +0 -3
- package/types/cmat-components-inline-loading.d.ts +0 -3
- package/types/cmat-components-json-editor.d.ts +0 -3
- package/types/cmat-components-knob-input.d.ts +1 -4
- package/types/cmat-components-loading-overlay.d.ts +0 -3
- package/types/cmat-components-masonry.d.ts +0 -3
- package/types/cmat-components-material-color-picker.d.ts +1 -4
- package/types/cmat-components-material-datetimepicker.d.ts +2 -840
- package/types/cmat-components-navigation.d.ts +1 -4
- package/types/cmat-components-opt-input.d.ts +2 -117
- package/types/cmat-components-org-chart.d.ts +1 -4
- package/types/cmat-components-page-header.d.ts +1 -4
- package/types/cmat-components-pagination.d.ts +0 -3
- package/types/cmat-components-password-strength.d.ts +2 -205
- package/types/cmat-components-popover.d.ts +2 -274
- package/types/cmat-components-progress-bar.d.ts +0 -3
- package/types/cmat-components-qrcode.d.ts +2 -117
- package/types/cmat-components-rating.d.ts +1 -4
- package/types/cmat-components-rich-text-editor.d.ts +1 -4
- package/types/cmat-components-select-search.d.ts +2 -204
- package/types/cmat-components-select-table.d.ts +3 -6
- package/types/cmat-components-select-tree.d.ts +4 -7
- package/types/cmat-components-skeleton.d.ts +0 -3
- package/types/cmat-components-speed-dial.d.ts +0 -3
- package/types/cmat-components-status-tag.d.ts +2 -5
- package/types/cmat-components-table-toolbar.d.ts +0 -3
- package/types/cmat-components-timeline.d.ts +0 -3
- package/types/cmat-components-toast.d.ts +0 -3
- package/types/cmat-components-transfer-picker.d.ts +2 -5
- package/types/cmat-components-treetable.d.ts +0 -3
- package/types/cmat-components-upload.d.ts +1 -4
- package/types/cmat-components-x6-angular-shape.d.ts +1 -4
- package/types/cmat-directives-animate-on-scroll.d.ts +0 -3
- package/types/cmat-directives-arrow-cursor.d.ts +0 -3
- package/types/cmat-directives-autofocus.d.ts +0 -3
- package/types/cmat-directives-data-exporter.d.ts +1 -4
- package/types/cmat-directives-debounce.d.ts +2 -38
- package/types/cmat-directives-digit-only.d.ts +0 -3
- package/types/cmat-directives-equal-validator.d.ts +1 -4
- package/types/cmat-directives-seamless-auto-scroll.d.ts +1 -4
- package/types/cmat-lib-mock-api.d.ts +1 -4
- package/types/cmat-pipes-bytes.d.ts +0 -3
- package/types/cmat-pipes-date-format.d.ts +0 -3
- package/types/cmat-pipes-find-by-key.d.ts +0 -3
- package/types/cmat-pipes-group-by.d.ts +0 -3
- package/types/cmat-pipes-keys.d.ts +0 -3
- package/types/cmat-pipes-secure.d.ts +1 -4
- package/types/cmat-pipes-uppercase.d.ts +0 -3
- package/types/cmat-reports.d.ts +6 -9
- package/types/cmat-services-alert.d.ts +1 -4
- package/types/cmat-services-config.d.ts +0 -3
- package/types/cmat-services-confirmation.d.ts +2 -40
- package/types/cmat-services-data.d.ts +1 -4
- package/types/cmat-services-export-as.d.ts +1 -4
- package/types/cmat-services-loading.d.ts +1 -4
- package/types/cmat-services-local-storage.d.ts +0 -3
- package/types/cmat-services-media-watcher.d.ts +0 -3
- package/types/cmat-services-platform.d.ts +0 -3
- package/types/cmat-services-print.d.ts +0 -3
- package/types/cmat-services-splash-screen.d.ts +0 -3
- package/types/cmat-services-title.d.ts +0 -3
- package/types/cmat-services-translation.d.ts +1 -4
- package/types/cmat-services-utils.d.ts +2 -5
- package/types/cmat-validators.d.ts +0 -3
- package/types/cmat-version.d.ts +0 -3
- package/types/cmat.d.ts +78 -7686
- package/types/public-api-BFGGDRK3.d.ts +201 -0
- package/types/public-api-BXS379ev.d.ts +202 -0
- package/types/public-api-C4CvABGO.d.ts +114 -0
- package/types/public-api-CSYz4G5Z.d.ts +271 -0
- package/types/public-api-NSrmlKKH.d.ts +114 -0
- package/types/public-api-PfNpHSSm.d.ts +837 -0
- package/types/public-api-f3WtygQS.d.ts +35 -0
- package/types/public-api-nBuSXSMJ.d.ts +858 -0
- package/types/public-api-yYeZrUAV.d.ts +37 -0
- package/fesm2022/cmat-components-cascade.mjs.map +0 -1
- package/fesm2022/cmat-components-custom-formly-quill-docx-exporter-BwwGX2Ie.mjs +0 -294
- package/fesm2022/cmat-components-custom-formly-quill-docx-exporter-BwwGX2Ie.mjs.map +0 -1
- package/fesm2022/cmat-components-material-color-picker.mjs.map +0 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +0 -1
- package/fesm2022/cmat-components-navigation.mjs.map +0 -1
- package/fesm2022/cmat-components-opt-input.mjs.map +0 -1
- package/fesm2022/cmat-components-org-chart.mjs.map +0 -1
- package/fesm2022/cmat-components-password-strength.mjs.map +0 -1
- package/fesm2022/cmat-components-popover.mjs.map +0 -1
- package/fesm2022/cmat-components-select-search.mjs.map +0 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +0 -1
- package/fesm2022/cmat-directives-data-exporter.mjs.map +0 -1
- package/fesm2022/cmat-directives-debounce.mjs.map +0 -1
- package/fesm2022/cmat-quill-docx-exporter-D9Eo73Wq.mjs.map +0 -1
- package/fesm2022/cmat-services-confirmation.mjs.map +0 -1
- package/fesm2022/cmat.mjs.map +0 -1
|
@@ -0,0 +1,4312 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Directive, ElementRef, EventEmitter, Injectable, InjectionToken, Injector, Renderer2, ViewContainerRef, ViewEncapsulation, afterNextRender, computed, contentChild, effect, forwardRef, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
|
+
import { NgClass, NgStyle } from "@angular/common";
|
|
4
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
5
|
+
import { filter, take } from "rxjs/operators";
|
|
6
|
+
import { coerceBooleanProperty, coerceNumberProperty, coerceStringArray } from "@angular/cdk/coercion";
|
|
7
|
+
import * as i1$1 from "@angular/material/button";
|
|
8
|
+
import { MatButtonModule } from "@angular/material/button";
|
|
9
|
+
import { Overlay, OverlayConfig } from "@angular/cdk/overlay";
|
|
10
|
+
import { ComponentPortal } from "@angular/cdk/portal";
|
|
11
|
+
import { NG_VALIDATORS, NG_VALUE_ACCESSOR, Validators } from "@angular/forms";
|
|
12
|
+
import { MatFormField } from "@angular/material/form-field";
|
|
13
|
+
import { MAT_INPUT_VALUE_ACCESSOR } from "@angular/material/input";
|
|
14
|
+
import { Observable, Subject, Subscription, merge, of } from "rxjs";
|
|
15
|
+
import { hasModifierKey } from "@angular/cdk/keycodes";
|
|
16
|
+
import * as i1 from "@angular/cdk/a11y";
|
|
17
|
+
import { A11yModule } from "@angular/cdk/a11y";
|
|
18
|
+
import { CMAT_DATETIME_FORMATS, DatetimeAdapter } from "cmat/components/adapter";
|
|
19
|
+
import { Directionality } from "@angular/cdk/bidi";
|
|
20
|
+
import { _getFocusedElementPierceShadowDom } from "@angular/cdk/platform";
|
|
21
|
+
var CmatDatetimepickerFilterType;
|
|
22
|
+
(function(CmatDatetimepickerFilterType) {
|
|
23
|
+
CmatDatetimepickerFilterType[CmatDatetimepickerFilterType["DATE"] = 0] = "DATE";
|
|
24
|
+
CmatDatetimepickerFilterType[CmatDatetimepickerFilterType["HOUR"] = 1] = "HOUR";
|
|
25
|
+
CmatDatetimepickerFilterType[CmatDatetimepickerFilterType["MINUTE"] = 2] = "MINUTE";
|
|
26
|
+
})(CmatDatetimepickerFilterType || (CmatDatetimepickerFilterType = {}));
|
|
27
|
+
const CLOCK_RADIUS = 50;
|
|
28
|
+
const CLOCK_INNER_RADIUS = 27.5;
|
|
29
|
+
const CLOCK_OUTER_RADIUS = 41.25;
|
|
30
|
+
const CLOCK_TICK_RADIUS = 7.0833;
|
|
31
|
+
var CmatDatetimepickerClockComponent = class CmatDatetimepickerClockComponent {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.userSelection = output();
|
|
34
|
+
this.selectedChange = output();
|
|
35
|
+
this.activeDateChange = output();
|
|
36
|
+
this.dateFilter = input(...ngDevMode ? [void 0, { debugName: "dateFilter" }] : /* istanbul ignore next */ []);
|
|
37
|
+
this.interval = input(1, ...ngDevMode ? [{ debugName: "interval" }] : /* istanbul ignore next */ []);
|
|
38
|
+
this.twelvehour = input(false, ...ngDevMode ? [{ debugName: "twelvehour" }] : /* istanbul ignore next */ []);
|
|
39
|
+
this.minDate = input(null, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
|
|
40
|
+
this.maxDate = input(null, ...ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []);
|
|
41
|
+
this.selected = input(null, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
42
|
+
this.startView = input("hour", ...ngDevMode ? [{ debugName: "startView" }] : /* istanbul ignore next */ []);
|
|
43
|
+
this.activeDate = input.required(...ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []);
|
|
44
|
+
this.hours = signal([], ...ngDevMode ? [{ debugName: "hours" }] : /* istanbul ignore next */ []);
|
|
45
|
+
this.minutes = signal([], ...ngDevMode ? [{ debugName: "minutes" }] : /* istanbul ignore next */ []);
|
|
46
|
+
this.hourView = signal(true, ...ngDevMode ? [{ debugName: "hourView" }] : /* istanbul ignore next */ []);
|
|
47
|
+
this.selectedHour = computed(() => {
|
|
48
|
+
let hour = this._adapter.getHour(this._clampedActiveDate());
|
|
49
|
+
if (this.twelvehour()) {
|
|
50
|
+
if (hour === 0) hour = 24;
|
|
51
|
+
return hour > 12 ? hour - 12 : hour;
|
|
52
|
+
}
|
|
53
|
+
return hour;
|
|
54
|
+
}, ...ngDevMode ? [{ debugName: "selectedHour" }] : /* istanbul ignore next */ []);
|
|
55
|
+
this.selectedMinute = computed(() => {
|
|
56
|
+
return this._adapter.getMinute(this._clampedActiveDate());
|
|
57
|
+
}, ...ngDevMode ? [{ debugName: "selectedMinute" }] : /* istanbul ignore next */ []);
|
|
58
|
+
this._clampedActiveDate = computed(() => {
|
|
59
|
+
const date = this._internalDate();
|
|
60
|
+
if (!date) return this._adapter.today();
|
|
61
|
+
return this._adapter.clampDate(date, this.minDate(), this.maxDate());
|
|
62
|
+
}, ...ngDevMode ? [{ debugName: "_clampedActiveDate" }] : /* istanbul ignore next */ []);
|
|
63
|
+
this.hand = computed(() => {
|
|
64
|
+
const twelvehour = this.twelvehour();
|
|
65
|
+
let deg;
|
|
66
|
+
let radius = CLOCK_OUTER_RADIUS;
|
|
67
|
+
if (this.hourView()) {
|
|
68
|
+
radius = this.selectedHour() > 0 && this.selectedHour() < 13 ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
|
|
69
|
+
if (twelvehour) radius = CLOCK_OUTER_RADIUS;
|
|
70
|
+
deg = Math.round(this.selectedHour() * 30);
|
|
71
|
+
} else deg = Math.round(this.selectedMinute() * 6);
|
|
72
|
+
return {
|
|
73
|
+
"transform": `rotate(${deg}deg)`,
|
|
74
|
+
"height": `${radius}%`,
|
|
75
|
+
"margin-top": `${50 - radius}%`
|
|
76
|
+
};
|
|
77
|
+
}, ...ngDevMode ? [{ debugName: "hand" }] : /* istanbul ignore next */ []);
|
|
78
|
+
this._element = inject(ElementRef);
|
|
79
|
+
this._adapter = inject(DatetimeAdapter);
|
|
80
|
+
this._renderer = inject(Renderer2);
|
|
81
|
+
this._timeChanged = false;
|
|
82
|
+
this._internalDate = signal(null, ...ngDevMode ? [{ debugName: "_internalDate" }] : /* istanbul ignore next */ []);
|
|
83
|
+
this._mouseMoveListener = (event) => {
|
|
84
|
+
this.handleMousemove(event);
|
|
85
|
+
};
|
|
86
|
+
this._mouseUpListener = () => {
|
|
87
|
+
this.handleMouseup();
|
|
88
|
+
};
|
|
89
|
+
effect(() => {
|
|
90
|
+
this.hourView.set(this.startView() !== "minute");
|
|
91
|
+
});
|
|
92
|
+
effect(() => {
|
|
93
|
+
const selectedValue = this.selected();
|
|
94
|
+
if (selectedValue) this._internalDate.set(selectedValue);
|
|
95
|
+
});
|
|
96
|
+
effect(() => {
|
|
97
|
+
this._internalDate.set(this.activeDate());
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
get activeDateValue() {
|
|
101
|
+
return this.activeDate();
|
|
102
|
+
}
|
|
103
|
+
handleMousedown(event) {
|
|
104
|
+
this._timeChanged = false;
|
|
105
|
+
this._setTime(event);
|
|
106
|
+
document.addEventListener("mousemove", this._mouseMoveListener);
|
|
107
|
+
document.addEventListener("touchmove", this._mouseMoveListener);
|
|
108
|
+
document.addEventListener("mouseup", this._mouseUpListener);
|
|
109
|
+
document.addEventListener("touchend", this._mouseUpListener);
|
|
110
|
+
}
|
|
111
|
+
ngAfterContentInit() {
|
|
112
|
+
this._init();
|
|
113
|
+
this._mousedownListener = this._renderer.listen(this._element.nativeElement, "mousedown", (event) => this.handleMousedown(event));
|
|
114
|
+
}
|
|
115
|
+
ngOnDestroy() {
|
|
116
|
+
this._removeDocumentListeners();
|
|
117
|
+
if (this._mousedownListener) this._mousedownListener();
|
|
118
|
+
}
|
|
119
|
+
handleMousemove(event) {
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
this._setTime(event);
|
|
122
|
+
}
|
|
123
|
+
handleMouseup() {
|
|
124
|
+
this._removeDocumentListeners();
|
|
125
|
+
if (this._timeChanged) {
|
|
126
|
+
this.selectedChange.emit(this._clampedActiveDate());
|
|
127
|
+
if (!this.hourView()) this.userSelection.emit();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
_removeDocumentListeners() {
|
|
131
|
+
document.removeEventListener("mousemove", this._mouseMoveListener);
|
|
132
|
+
document.removeEventListener("touchmove", this._mouseMoveListener);
|
|
133
|
+
document.removeEventListener("mouseup", this._mouseUpListener);
|
|
134
|
+
document.removeEventListener("touchend", this._mouseUpListener);
|
|
135
|
+
}
|
|
136
|
+
_init() {
|
|
137
|
+
const hoursList = [];
|
|
138
|
+
const minutesList = [];
|
|
139
|
+
const hourNames = this._adapter.getHourNames();
|
|
140
|
+
const minuteNames = this._adapter.getMinuteNames();
|
|
141
|
+
const currentDate = this._clampedActiveDate();
|
|
142
|
+
if (this.twelvehour()) for (let i = 1; i < hourNames.length / 2 + 1; i++) {
|
|
143
|
+
const radian = i / 6 * Math.PI;
|
|
144
|
+
const radius = CLOCK_OUTER_RADIUS;
|
|
145
|
+
const date = this._adapter.createDatetime(this._adapter.getYear(currentDate), this._adapter.getMonth(currentDate), this._adapter.getDate(currentDate), i + 1, 0);
|
|
146
|
+
const enabled = (!this.minDate() || this._adapter.compareDatetime(date, this.minDate()) >= 0) && (!this.maxDate() || this._adapter.compareDatetime(date, this.maxDate()) <= 0);
|
|
147
|
+
hoursList.push({
|
|
148
|
+
value: i,
|
|
149
|
+
displayValue: i === 0 ? "00" : hourNames[i],
|
|
150
|
+
enabled,
|
|
151
|
+
top: 50 - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
|
|
152
|
+
left: 50 + Math.sin(radian) * radius - CLOCK_TICK_RADIUS
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
else for (let i = 0; i < hourNames.length; i++) {
|
|
156
|
+
const radian = i / 6 * Math.PI;
|
|
157
|
+
const radius = i > 0 && i < 13 ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
|
|
158
|
+
const date = this._adapter.createDatetime(this._adapter.getYear(currentDate), this._adapter.getMonth(currentDate), this._adapter.getDate(currentDate), i, 0);
|
|
159
|
+
const dateFilter = this.dateFilter();
|
|
160
|
+
const enabled = (!this.minDate() || this._adapter.compareDatetime(date, this.minDate(), false) >= 0) && (!this.maxDate() || this._adapter.compareDatetime(date, this.maxDate(), false) <= 0) && (!dateFilter || dateFilter(date, CmatDatetimepickerFilterType.HOUR));
|
|
161
|
+
hoursList.push({
|
|
162
|
+
value: i,
|
|
163
|
+
displayValue: i === 0 ? "00" : hourNames[i],
|
|
164
|
+
enabled,
|
|
165
|
+
top: 50 - Math.cos(radian) * radius - CLOCK_TICK_RADIUS,
|
|
166
|
+
left: 50 + Math.sin(radian) * radius - CLOCK_TICK_RADIUS,
|
|
167
|
+
fontSize: i > 0 && i < 13 ? "" : "80%"
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
for (let i = 0; i < minuteNames.length; i += 5) {
|
|
171
|
+
const radian = i / 30 * Math.PI;
|
|
172
|
+
const date = this._adapter.createDatetime(this._adapter.getYear(currentDate), this._adapter.getMonth(currentDate), this._adapter.getDate(currentDate), this._adapter.getHour(currentDate), i);
|
|
173
|
+
const dateFilter = this.dateFilter();
|
|
174
|
+
const enabled = (!this.minDate() || this._adapter.compareDatetime(date, this.minDate()) >= 0) && (!this.maxDate() || this._adapter.compareDatetime(date, this.maxDate()) <= 0) && (!dateFilter || dateFilter(date, CmatDatetimepickerFilterType.MINUTE));
|
|
175
|
+
minutesList.push({
|
|
176
|
+
value: i,
|
|
177
|
+
displayValue: i === 0 ? "00" : minuteNames[i],
|
|
178
|
+
enabled,
|
|
179
|
+
top: 50 - Math.cos(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS,
|
|
180
|
+
left: 50 + Math.sin(radian) * CLOCK_OUTER_RADIUS - CLOCK_TICK_RADIUS
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
this.hours.set(hoursList);
|
|
184
|
+
this.minutes.set(minutesList);
|
|
185
|
+
}
|
|
186
|
+
_setTime(event) {
|
|
187
|
+
const trigger = this._element.nativeElement;
|
|
188
|
+
const triggerRect = trigger.getBoundingClientRect();
|
|
189
|
+
const width = trigger.offsetWidth;
|
|
190
|
+
const height = trigger.offsetHeight;
|
|
191
|
+
const pageX = event instanceof MouseEvent ? event.pageX : event.touches[0].pageX;
|
|
192
|
+
const pageY = event instanceof MouseEvent ? event.pageY : event.touches[0].pageY;
|
|
193
|
+
const x = width / 2 - (pageX - triggerRect.left - window.scrollX);
|
|
194
|
+
const y = height / 2 - (pageY - triggerRect.top - window.scrollY);
|
|
195
|
+
let radian = Math.atan2(-x, y);
|
|
196
|
+
const interval = this.interval();
|
|
197
|
+
const unit = Math.PI / (this.hourView() ? 6 : interval ? 30 / interval : 30);
|
|
198
|
+
const z = Math.sqrt(x * x + y * y);
|
|
199
|
+
const outer = this.hourView() && z > (width * (41.25 / 100) + width * (27.5 / 100)) / 2;
|
|
200
|
+
if (radian < 0) radian = Math.PI * 2 + radian;
|
|
201
|
+
let value = Math.round(radian / unit);
|
|
202
|
+
let date;
|
|
203
|
+
const currentDate = this._clampedActiveDate();
|
|
204
|
+
if (this.hourView()) {
|
|
205
|
+
if (this.twelvehour()) value = value === 0 ? 12 : value;
|
|
206
|
+
else {
|
|
207
|
+
if (value === 12) value = 0;
|
|
208
|
+
value = outer ? value === 0 ? 12 : value : value === 0 ? 0 : value + 12;
|
|
209
|
+
}
|
|
210
|
+
date = this._adapter.createDatetime(this._adapter.getYear(currentDate), this._adapter.getMonth(currentDate), this._adapter.getDate(currentDate), value, this._adapter.getMinute(currentDate));
|
|
211
|
+
} else {
|
|
212
|
+
const intervalValue = this.interval();
|
|
213
|
+
if (intervalValue) value *= intervalValue;
|
|
214
|
+
if (value === 60) value = 0;
|
|
215
|
+
date = this._adapter.createDatetime(this._adapter.getYear(currentDate), this._adapter.getMonth(currentDate), this._adapter.getDate(currentDate), this._adapter.getHour(currentDate), value);
|
|
216
|
+
}
|
|
217
|
+
this._timeChanged = true;
|
|
218
|
+
this._internalDate.set(date);
|
|
219
|
+
this.activeDateChange.emit(this._clampedActiveDate());
|
|
220
|
+
}
|
|
221
|
+
static {
|
|
222
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
223
|
+
minVersion: "12.0.0",
|
|
224
|
+
version: "22.3.0",
|
|
225
|
+
ngImport: i0,
|
|
226
|
+
type: CmatDatetimepickerClockComponent,
|
|
227
|
+
deps: [],
|
|
228
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
static {
|
|
232
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
233
|
+
minVersion: "17.0.0",
|
|
234
|
+
version: "22.3.0",
|
|
235
|
+
type: CmatDatetimepickerClockComponent,
|
|
236
|
+
isStandalone: true,
|
|
237
|
+
selector: "cmat-datetimepicker-clock",
|
|
238
|
+
inputs: {
|
|
239
|
+
dateFilter: {
|
|
240
|
+
classPropertyName: "dateFilter",
|
|
241
|
+
publicName: "dateFilter",
|
|
242
|
+
isSignal: true,
|
|
243
|
+
isRequired: false,
|
|
244
|
+
transformFunction: null
|
|
245
|
+
},
|
|
246
|
+
interval: {
|
|
247
|
+
classPropertyName: "interval",
|
|
248
|
+
publicName: "interval",
|
|
249
|
+
isSignal: true,
|
|
250
|
+
isRequired: false,
|
|
251
|
+
transformFunction: null
|
|
252
|
+
},
|
|
253
|
+
twelvehour: {
|
|
254
|
+
classPropertyName: "twelvehour",
|
|
255
|
+
publicName: "twelvehour",
|
|
256
|
+
isSignal: true,
|
|
257
|
+
isRequired: false,
|
|
258
|
+
transformFunction: null
|
|
259
|
+
},
|
|
260
|
+
minDate: {
|
|
261
|
+
classPropertyName: "minDate",
|
|
262
|
+
publicName: "minDate",
|
|
263
|
+
isSignal: true,
|
|
264
|
+
isRequired: false,
|
|
265
|
+
transformFunction: null
|
|
266
|
+
},
|
|
267
|
+
maxDate: {
|
|
268
|
+
classPropertyName: "maxDate",
|
|
269
|
+
publicName: "maxDate",
|
|
270
|
+
isSignal: true,
|
|
271
|
+
isRequired: false,
|
|
272
|
+
transformFunction: null
|
|
273
|
+
},
|
|
274
|
+
selected: {
|
|
275
|
+
classPropertyName: "selected",
|
|
276
|
+
publicName: "selected",
|
|
277
|
+
isSignal: true,
|
|
278
|
+
isRequired: false,
|
|
279
|
+
transformFunction: null
|
|
280
|
+
},
|
|
281
|
+
startView: {
|
|
282
|
+
classPropertyName: "startView",
|
|
283
|
+
publicName: "startView",
|
|
284
|
+
isSignal: true,
|
|
285
|
+
isRequired: false,
|
|
286
|
+
transformFunction: null
|
|
287
|
+
},
|
|
288
|
+
activeDate: {
|
|
289
|
+
classPropertyName: "activeDate",
|
|
290
|
+
publicName: "activeDate",
|
|
291
|
+
isSignal: true,
|
|
292
|
+
isRequired: true,
|
|
293
|
+
transformFunction: null
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
outputs: {
|
|
297
|
+
userSelection: "userSelection",
|
|
298
|
+
selectedChange: "selectedChange",
|
|
299
|
+
activeDateChange: "activeDateChange"
|
|
300
|
+
},
|
|
301
|
+
host: {
|
|
302
|
+
attributes: { "role": "clock" },
|
|
303
|
+
classAttribute: "cmat-datetimepicker-clock"
|
|
304
|
+
},
|
|
305
|
+
exportAs: ["cmatDatetimepickerClock"],
|
|
306
|
+
ngImport: i0,
|
|
307
|
+
template: "<div class=\"cmat-datetimepicker-clock-wrapper\">\r\n <div class=\"cmat-datetimepicker-clock-center\"></div>\r\n <div class=\"cmat-datetimepicker-clock-hand\" [ngStyle]=\"hand()\"></div>\r\n <div class=\"cmat-datetimepicker-clock-hours\" [class.active]=\"hourView()\">\r\n @for (item of hours(); track $index) {\r\n <div class=\"cmat-datetimepicker-clock-cell\"\r\n [class.cmat-datetimepicker-clock-cell-disabled]=\"!item.enabled\"\r\n [class.cmat-datetimepicker-clock-cell-selected]=\"selectedHour() === item.value\"\r\n [ngStyle]=\"{'fontSize':item.fontSize,'left':item.left+'%',top:item.top+'%'}\">\r\n {{ item.displayValue }}</div>\r\n }\r\n </div>\r\n <div class=\"cmat-datetimepicker-clock-minutes\" [class.active]=\"!hourView()\">\r\n @for (item of minutes(); track $index) {\r\n <div class=\"cmat-datetimepicker-clock-cell\"\r\n [class.cmat-datetimepicker-clock-cell-disabled]=\"!item.enabled\"\r\n [class.cmat-datetimepicker-clock-cell-selected]=\"selectedMinute() === item.value\" [ngStyle]=\"{'left':item.left+'%','top':item.top+'%'}\">{{ item.displayValue\r\n }}</div>\r\n }\r\n </div>\r\n</div>",
|
|
308
|
+
styles: [".cmat-datetimepicker-clock{position:relative;display:block;min-width:224px;margin:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.cmat-datetimepicker-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%}.cmat-datetimepicker-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%}.cmat-datetimepicker-clock-hand{position:absolute;inset:0;width:1px;margin:0 auto;transform-origin:bottom}.cmat-datetimepicker-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%}.cmat-datetimepicker-clock-hours,.cmat-datetimepicker-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.cmat-datetimepicker-clock-hours.active,.cmat-datetimepicker-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.cmat-datetimepicker-clock-minutes{transform:scale(.8)}.cmat-datetimepicker-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer}.cmat-datetimepicker-clock-cell.cmat-datetimepicker-clock-cell-disabled{pointer-events:none}\n"],
|
|
309
|
+
dependencies: [{
|
|
310
|
+
kind: "directive",
|
|
311
|
+
type: NgStyle,
|
|
312
|
+
selector: "[ngStyle]",
|
|
313
|
+
inputs: ["ngStyle"]
|
|
314
|
+
}],
|
|
315
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
316
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
321
|
+
minVersion: "12.0.0",
|
|
322
|
+
version: "22.3.0",
|
|
323
|
+
ngImport: i0,
|
|
324
|
+
type: CmatDatetimepickerClockComponent,
|
|
325
|
+
decorators: [{
|
|
326
|
+
type: Component,
|
|
327
|
+
args: [{
|
|
328
|
+
selector: "cmat-datetimepicker-clock",
|
|
329
|
+
host: {
|
|
330
|
+
"role": "clock",
|
|
331
|
+
"class": "cmat-datetimepicker-clock"
|
|
332
|
+
},
|
|
333
|
+
encapsulation: ViewEncapsulation.None,
|
|
334
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
335
|
+
exportAs: "cmatDatetimepickerClock",
|
|
336
|
+
imports: [NgStyle],
|
|
337
|
+
template: "<div class=\"cmat-datetimepicker-clock-wrapper\">\r\n <div class=\"cmat-datetimepicker-clock-center\"></div>\r\n <div class=\"cmat-datetimepicker-clock-hand\" [ngStyle]=\"hand()\"></div>\r\n <div class=\"cmat-datetimepicker-clock-hours\" [class.active]=\"hourView()\">\r\n @for (item of hours(); track $index) {\r\n <div class=\"cmat-datetimepicker-clock-cell\"\r\n [class.cmat-datetimepicker-clock-cell-disabled]=\"!item.enabled\"\r\n [class.cmat-datetimepicker-clock-cell-selected]=\"selectedHour() === item.value\"\r\n [ngStyle]=\"{'fontSize':item.fontSize,'left':item.left+'%',top:item.top+'%'}\">\r\n {{ item.displayValue }}</div>\r\n }\r\n </div>\r\n <div class=\"cmat-datetimepicker-clock-minutes\" [class.active]=\"!hourView()\">\r\n @for (item of minutes(); track $index) {\r\n <div class=\"cmat-datetimepicker-clock-cell\"\r\n [class.cmat-datetimepicker-clock-cell-disabled]=\"!item.enabled\"\r\n [class.cmat-datetimepicker-clock-cell-selected]=\"selectedMinute() === item.value\" [ngStyle]=\"{'left':item.left+'%','top':item.top+'%'}\">{{ item.displayValue\r\n }}</div>\r\n }\r\n </div>\r\n</div>",
|
|
338
|
+
styles: [".cmat-datetimepicker-clock{position:relative;display:block;min-width:224px;margin:12px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.cmat-datetimepicker-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%}.cmat-datetimepicker-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%}.cmat-datetimepicker-clock-hand{position:absolute;inset:0;width:1px;margin:0 auto;transform-origin:bottom}.cmat-datetimepicker-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%}.cmat-datetimepicker-clock-hours,.cmat-datetimepicker-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.cmat-datetimepicker-clock-hours.active,.cmat-datetimepicker-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.cmat-datetimepicker-clock-minutes{transform:scale(.8)}.cmat-datetimepicker-clock-cell{position:absolute;display:flex;width:14.1666%;height:14.1666%;justify-content:center;box-sizing:border-box;border-radius:50%;align-items:center;cursor:pointer}.cmat-datetimepicker-clock-cell.cmat-datetimepicker-clock-cell-disabled{pointer-events:none}\n"]
|
|
339
|
+
}]
|
|
340
|
+
}],
|
|
341
|
+
ctorParameters: () => [],
|
|
342
|
+
propDecorators: {
|
|
343
|
+
userSelection: [{
|
|
344
|
+
type: i0.Output,
|
|
345
|
+
args: ["userSelection"]
|
|
346
|
+
}],
|
|
347
|
+
selectedChange: [{
|
|
348
|
+
type: i0.Output,
|
|
349
|
+
args: ["selectedChange"]
|
|
350
|
+
}],
|
|
351
|
+
activeDateChange: [{
|
|
352
|
+
type: i0.Output,
|
|
353
|
+
args: ["activeDateChange"]
|
|
354
|
+
}],
|
|
355
|
+
dateFilter: [{
|
|
356
|
+
type: i0.Input,
|
|
357
|
+
args: [{
|
|
358
|
+
isSignal: true,
|
|
359
|
+
alias: "dateFilter",
|
|
360
|
+
required: false
|
|
361
|
+
}]
|
|
362
|
+
}],
|
|
363
|
+
interval: [{
|
|
364
|
+
type: i0.Input,
|
|
365
|
+
args: [{
|
|
366
|
+
isSignal: true,
|
|
367
|
+
alias: "interval",
|
|
368
|
+
required: false
|
|
369
|
+
}]
|
|
370
|
+
}],
|
|
371
|
+
twelvehour: [{
|
|
372
|
+
type: i0.Input,
|
|
373
|
+
args: [{
|
|
374
|
+
isSignal: true,
|
|
375
|
+
alias: "twelvehour",
|
|
376
|
+
required: false
|
|
377
|
+
}]
|
|
378
|
+
}],
|
|
379
|
+
minDate: [{
|
|
380
|
+
type: i0.Input,
|
|
381
|
+
args: [{
|
|
382
|
+
isSignal: true,
|
|
383
|
+
alias: "minDate",
|
|
384
|
+
required: false
|
|
385
|
+
}]
|
|
386
|
+
}],
|
|
387
|
+
maxDate: [{
|
|
388
|
+
type: i0.Input,
|
|
389
|
+
args: [{
|
|
390
|
+
isSignal: true,
|
|
391
|
+
alias: "maxDate",
|
|
392
|
+
required: false
|
|
393
|
+
}]
|
|
394
|
+
}],
|
|
395
|
+
selected: [{
|
|
396
|
+
type: i0.Input,
|
|
397
|
+
args: [{
|
|
398
|
+
isSignal: true,
|
|
399
|
+
alias: "selected",
|
|
400
|
+
required: false
|
|
401
|
+
}]
|
|
402
|
+
}],
|
|
403
|
+
startView: [{
|
|
404
|
+
type: i0.Input,
|
|
405
|
+
args: [{
|
|
406
|
+
isSignal: true,
|
|
407
|
+
alias: "startView",
|
|
408
|
+
required: false
|
|
409
|
+
}]
|
|
410
|
+
}],
|
|
411
|
+
activeDate: [{
|
|
412
|
+
type: i0.Input,
|
|
413
|
+
args: [{
|
|
414
|
+
isSignal: true,
|
|
415
|
+
alias: "activeDate",
|
|
416
|
+
required: true
|
|
417
|
+
}]
|
|
418
|
+
}]
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
function createMissingDateImplError(provider) {
|
|
422
|
+
return Error(`CmatDatetimepickerComponent: No provider found for ${provider}. You must import one of the following modules at your application root: CMatNativeDatetimeModule or provide a custom implementation.`);
|
|
423
|
+
}
|
|
424
|
+
var CmatDatetimepickerIntl = class CmatDatetimepickerIntl {
|
|
425
|
+
constructor() {
|
|
426
|
+
this.changes = new Subject();
|
|
427
|
+
this.calendarLabel = "日历";
|
|
428
|
+
this.openCalendarLabel = "打开日历";
|
|
429
|
+
this.closeCalendarLabel = "关闭日历";
|
|
430
|
+
this.prevMonthLabel = "上个月";
|
|
431
|
+
this.nextMonthLabel = "下个月";
|
|
432
|
+
this.prevYearLabel = "上一年";
|
|
433
|
+
this.nextYearLabel = "下一年";
|
|
434
|
+
this.prevMultiYearLabel = "过去24年";
|
|
435
|
+
this.nextMultiYearLabel = "未来24年";
|
|
436
|
+
this.switchToMonthViewLabel = "选择月份";
|
|
437
|
+
this.switchToYearViewLabel = "选择年份";
|
|
438
|
+
this.switchToMultiYearViewLabel = "选择年份范围";
|
|
439
|
+
this.startDateLabel = "开始日期";
|
|
440
|
+
this.endDateLabel = "结束日期";
|
|
441
|
+
this.switchToClockHourViewLabel = "选择小时";
|
|
442
|
+
this.switchToClockMinuteViewLabel = "选择分钟";
|
|
443
|
+
this.okLabel = "确认";
|
|
444
|
+
this.cancelLabel = "取消";
|
|
445
|
+
}
|
|
446
|
+
formatYearRange(start, end) {
|
|
447
|
+
return `${start} \u2013 ${end}`;
|
|
448
|
+
}
|
|
449
|
+
formatYearRangeLabel(start, end) {
|
|
450
|
+
return `${start} to ${end}`;
|
|
451
|
+
}
|
|
452
|
+
static {
|
|
453
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
454
|
+
minVersion: "12.0.0",
|
|
455
|
+
version: "22.3.0",
|
|
456
|
+
ngImport: i0,
|
|
457
|
+
type: CmatDatetimepickerIntl,
|
|
458
|
+
deps: [],
|
|
459
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
static {
|
|
463
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
464
|
+
minVersion: "12.0.0",
|
|
465
|
+
version: "22.3.0",
|
|
466
|
+
ngImport: i0,
|
|
467
|
+
type: CmatDatetimepickerIntl,
|
|
468
|
+
providedIn: "root"
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
473
|
+
minVersion: "12.0.0",
|
|
474
|
+
version: "22.3.0",
|
|
475
|
+
ngImport: i0,
|
|
476
|
+
type: CmatDatetimepickerIntl,
|
|
477
|
+
decorators: [{
|
|
478
|
+
type: Injectable,
|
|
479
|
+
args: [{ providedIn: "root" }]
|
|
480
|
+
}]
|
|
481
|
+
});
|
|
482
|
+
var CmatDatetimepickerCalendarCellComponent = class {
|
|
483
|
+
constructor(value, displayValue, ariaLabel, enabled) {
|
|
484
|
+
this.value = value;
|
|
485
|
+
this.displayValue = displayValue;
|
|
486
|
+
this.ariaLabel = ariaLabel;
|
|
487
|
+
this.enabled = enabled;
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
var CmatDatetimepickerCalendarBodyComponent = class CmatDatetimepickerCalendarBodyComponent {
|
|
491
|
+
constructor() {
|
|
492
|
+
this.selectedValueChange = output();
|
|
493
|
+
this.label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
|
|
494
|
+
this.rows = input(...ngDevMode ? [void 0, { debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
495
|
+
this.todayValue = input(...ngDevMode ? [void 0, { debugName: "todayValue" }] : /* istanbul ignore next */ []);
|
|
496
|
+
this.selectedValue = input(...ngDevMode ? [void 0, { debugName: "selectedValue" }] : /* istanbul ignore next */ []);
|
|
497
|
+
this.labelMinRequiredCells = input(0, ...ngDevMode ? [{ debugName: "labelMinRequiredCells" }] : /* istanbul ignore next */ []);
|
|
498
|
+
this.numCols = input(7, ...ngDevMode ? [{ debugName: "numCols" }] : /* istanbul ignore next */ []);
|
|
499
|
+
this.allowDisabledSelection = input(false, ...ngDevMode ? [{ debugName: "allowDisabledSelection" }] : /* istanbul ignore next */ []);
|
|
500
|
+
this.activeCell = input(0, ...ngDevMode ? [{ debugName: "activeCell" }] : /* istanbul ignore next */ []);
|
|
501
|
+
}
|
|
502
|
+
get _firstRowOffset() {
|
|
503
|
+
const rows = this.rows();
|
|
504
|
+
return rows?.length && rows[0].length ? this.numCols() - rows[0].length : 0;
|
|
505
|
+
}
|
|
506
|
+
cellClicked(cell) {
|
|
507
|
+
if (!this.allowDisabledSelection() && !cell.enabled) return;
|
|
508
|
+
this.selectedValueChange.emit(cell.value);
|
|
509
|
+
}
|
|
510
|
+
isActiveCell(rowIndex, colIndex) {
|
|
511
|
+
let cellNumber = rowIndex * this.numCols() + colIndex;
|
|
512
|
+
if (rowIndex) cellNumber -= this._firstRowOffset;
|
|
513
|
+
return cellNumber === this.activeCell();
|
|
514
|
+
}
|
|
515
|
+
static {
|
|
516
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
517
|
+
minVersion: "12.0.0",
|
|
518
|
+
version: "22.3.0",
|
|
519
|
+
ngImport: i0,
|
|
520
|
+
type: CmatDatetimepickerCalendarBodyComponent,
|
|
521
|
+
deps: [],
|
|
522
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
static {
|
|
526
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
527
|
+
minVersion: "17.0.0",
|
|
528
|
+
version: "22.3.0",
|
|
529
|
+
type: CmatDatetimepickerCalendarBodyComponent,
|
|
530
|
+
isStandalone: true,
|
|
531
|
+
selector: "[cmat-datetimepicker-calendar-body]",
|
|
532
|
+
inputs: {
|
|
533
|
+
label: {
|
|
534
|
+
classPropertyName: "label",
|
|
535
|
+
publicName: "label",
|
|
536
|
+
isSignal: true,
|
|
537
|
+
isRequired: false,
|
|
538
|
+
transformFunction: null
|
|
539
|
+
},
|
|
540
|
+
rows: {
|
|
541
|
+
classPropertyName: "rows",
|
|
542
|
+
publicName: "rows",
|
|
543
|
+
isSignal: true,
|
|
544
|
+
isRequired: false,
|
|
545
|
+
transformFunction: null
|
|
546
|
+
},
|
|
547
|
+
todayValue: {
|
|
548
|
+
classPropertyName: "todayValue",
|
|
549
|
+
publicName: "todayValue",
|
|
550
|
+
isSignal: true,
|
|
551
|
+
isRequired: false,
|
|
552
|
+
transformFunction: null
|
|
553
|
+
},
|
|
554
|
+
selectedValue: {
|
|
555
|
+
classPropertyName: "selectedValue",
|
|
556
|
+
publicName: "selectedValue",
|
|
557
|
+
isSignal: true,
|
|
558
|
+
isRequired: false,
|
|
559
|
+
transformFunction: null
|
|
560
|
+
},
|
|
561
|
+
labelMinRequiredCells: {
|
|
562
|
+
classPropertyName: "labelMinRequiredCells",
|
|
563
|
+
publicName: "labelMinRequiredCells",
|
|
564
|
+
isSignal: true,
|
|
565
|
+
isRequired: false,
|
|
566
|
+
transformFunction: null
|
|
567
|
+
},
|
|
568
|
+
numCols: {
|
|
569
|
+
classPropertyName: "numCols",
|
|
570
|
+
publicName: "numCols",
|
|
571
|
+
isSignal: true,
|
|
572
|
+
isRequired: false,
|
|
573
|
+
transformFunction: null
|
|
574
|
+
},
|
|
575
|
+
allowDisabledSelection: {
|
|
576
|
+
classPropertyName: "allowDisabledSelection",
|
|
577
|
+
publicName: "allowDisabledSelection",
|
|
578
|
+
isSignal: true,
|
|
579
|
+
isRequired: false,
|
|
580
|
+
transformFunction: null
|
|
581
|
+
},
|
|
582
|
+
activeCell: {
|
|
583
|
+
classPropertyName: "activeCell",
|
|
584
|
+
publicName: "activeCell",
|
|
585
|
+
isSignal: true,
|
|
586
|
+
isRequired: false,
|
|
587
|
+
transformFunction: null
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
outputs: { selectedValueChange: "selectedValueChange" },
|
|
591
|
+
host: { classAttribute: "cmat-datetimepicker-calendar-body" },
|
|
592
|
+
exportAs: ["cmatDatetimepickerCalendarBody"],
|
|
593
|
+
ngImport: i0,
|
|
594
|
+
template: "@if (_firstRowOffset < labelMinRequiredCells()) {\r\n<tr aria-hidden=\"true\">\r\n <td\r\n class=\"cmat-datetimepicker-calendar-body-label\"\r\n [attr.colspan]=\"numCols()\"\r\n >\r\n {{ label() }}\r\n </td>\r\n</tr>\r\n} @for (row of rows(); track $index; let rowIndex = $index) {\r\n<tr role=\"row\">\r\n @if (rowIndex === 0 && _firstRowOffset) {\r\n <td\r\n aria-hidden=\"true\"\r\n class=\"cmat-datetimepicker-calendar-body-label\"\r\n [attr.colspan]=\"_firstRowOffset\"\r\n >\r\n {{ _firstRowOffset >= labelMinRequiredCells() ? label() : '' }}\r\n </td>\r\n } @for (item of row; track $index; let colIndex = $index) {\r\n <td\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-body-cell\"\r\n [attr.aria-disabled]=\"!item.enabled || null\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [class.cmat-datetimepicker-calendar-body-active]=\"isActiveCell(rowIndex, colIndex)\"\r\n [class.cmat-datetimepicker-calendar-body-disabled]=\"!item.enabled\"\r\n (click)=\"cellClicked(item)\"\r\n >\r\n <div\r\n class=\"cmat-datetimepicker-calendar-body-cell-content\"\r\n [attr.aria-selected]=\"selectedValue() === item.value\"\r\n [class.cmat-datetimepicker-calendar-body-selected]=\"selectedValue() === item.value\"\r\n [class.cmat-datetimepicker-calendar-body-today]=\"todayValue() === item.value\"\r\n >\r\n {{ item.displayValue }}\r\n </div>\r\n </td>\r\n }\r\n</tr>\r\n}\r\n",
|
|
595
|
+
styles: [".cmat-datetimepicker-calendar-body{min-width:224px}.cmat-datetimepicker-calendar-body-label{height:0;line-height:0;text-align:left;padding:calc(14.2857142857% / 2) 4.7142857143%}[dir=rtl] .cmat-datetimepicker-calendar-body-label{text-align:right}.cmat-datetimepicker-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:calc(14.2857142857% / 2) 0;text-align:center;outline:none;cursor:pointer}.cmat-datetimepicker-calendar-body-disabled{cursor:default;pointer-events:none}.cmat-datetimepicker-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid #0000;border-radius:999px}\n"],
|
|
596
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
597
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
602
|
+
minVersion: "12.0.0",
|
|
603
|
+
version: "22.3.0",
|
|
604
|
+
ngImport: i0,
|
|
605
|
+
type: CmatDatetimepickerCalendarBodyComponent,
|
|
606
|
+
decorators: [{
|
|
607
|
+
type: Component,
|
|
608
|
+
args: [{
|
|
609
|
+
selector: "[cmat-datetimepicker-calendar-body]",
|
|
610
|
+
encapsulation: ViewEncapsulation.None,
|
|
611
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
612
|
+
exportAs: "cmatDatetimepickerCalendarBody",
|
|
613
|
+
imports: [],
|
|
614
|
+
host: { "class": "cmat-datetimepicker-calendar-body" },
|
|
615
|
+
template: "@if (_firstRowOffset < labelMinRequiredCells()) {\r\n<tr aria-hidden=\"true\">\r\n <td\r\n class=\"cmat-datetimepicker-calendar-body-label\"\r\n [attr.colspan]=\"numCols()\"\r\n >\r\n {{ label() }}\r\n </td>\r\n</tr>\r\n} @for (row of rows(); track $index; let rowIndex = $index) {\r\n<tr role=\"row\">\r\n @if (rowIndex === 0 && _firstRowOffset) {\r\n <td\r\n aria-hidden=\"true\"\r\n class=\"cmat-datetimepicker-calendar-body-label\"\r\n [attr.colspan]=\"_firstRowOffset\"\r\n >\r\n {{ _firstRowOffset >= labelMinRequiredCells() ? label() : '' }}\r\n </td>\r\n } @for (item of row; track $index; let colIndex = $index) {\r\n <td\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-body-cell\"\r\n [attr.aria-disabled]=\"!item.enabled || null\"\r\n [attr.aria-label]=\"item.ariaLabel\"\r\n [class.cmat-datetimepicker-calendar-body-active]=\"isActiveCell(rowIndex, colIndex)\"\r\n [class.cmat-datetimepicker-calendar-body-disabled]=\"!item.enabled\"\r\n (click)=\"cellClicked(item)\"\r\n >\r\n <div\r\n class=\"cmat-datetimepicker-calendar-body-cell-content\"\r\n [attr.aria-selected]=\"selectedValue() === item.value\"\r\n [class.cmat-datetimepicker-calendar-body-selected]=\"selectedValue() === item.value\"\r\n [class.cmat-datetimepicker-calendar-body-today]=\"todayValue() === item.value\"\r\n >\r\n {{ item.displayValue }}\r\n </div>\r\n </td>\r\n }\r\n</tr>\r\n}\r\n",
|
|
616
|
+
styles: [".cmat-datetimepicker-calendar-body{min-width:224px}.cmat-datetimepicker-calendar-body-label{height:0;line-height:0;text-align:left;padding:calc(14.2857142857% / 2) 4.7142857143%}[dir=rtl] .cmat-datetimepicker-calendar-body-label{text-align:right}.cmat-datetimepicker-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:calc(14.2857142857% / 2) 0;text-align:center;outline:none;cursor:pointer}.cmat-datetimepicker-calendar-body-disabled{cursor:default;pointer-events:none}.cmat-datetimepicker-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;border:1px solid #0000;border-radius:999px}\n"]
|
|
617
|
+
}]
|
|
618
|
+
}],
|
|
619
|
+
propDecorators: {
|
|
620
|
+
selectedValueChange: [{
|
|
621
|
+
type: i0.Output,
|
|
622
|
+
args: ["selectedValueChange"]
|
|
623
|
+
}],
|
|
624
|
+
label: [{
|
|
625
|
+
type: i0.Input,
|
|
626
|
+
args: [{
|
|
627
|
+
isSignal: true,
|
|
628
|
+
alias: "label",
|
|
629
|
+
required: false
|
|
630
|
+
}]
|
|
631
|
+
}],
|
|
632
|
+
rows: [{
|
|
633
|
+
type: i0.Input,
|
|
634
|
+
args: [{
|
|
635
|
+
isSignal: true,
|
|
636
|
+
alias: "rows",
|
|
637
|
+
required: false
|
|
638
|
+
}]
|
|
639
|
+
}],
|
|
640
|
+
todayValue: [{
|
|
641
|
+
type: i0.Input,
|
|
642
|
+
args: [{
|
|
643
|
+
isSignal: true,
|
|
644
|
+
alias: "todayValue",
|
|
645
|
+
required: false
|
|
646
|
+
}]
|
|
647
|
+
}],
|
|
648
|
+
selectedValue: [{
|
|
649
|
+
type: i0.Input,
|
|
650
|
+
args: [{
|
|
651
|
+
isSignal: true,
|
|
652
|
+
alias: "selectedValue",
|
|
653
|
+
required: false
|
|
654
|
+
}]
|
|
655
|
+
}],
|
|
656
|
+
labelMinRequiredCells: [{
|
|
657
|
+
type: i0.Input,
|
|
658
|
+
args: [{
|
|
659
|
+
isSignal: true,
|
|
660
|
+
alias: "labelMinRequiredCells",
|
|
661
|
+
required: false
|
|
662
|
+
}]
|
|
663
|
+
}],
|
|
664
|
+
numCols: [{
|
|
665
|
+
type: i0.Input,
|
|
666
|
+
args: [{
|
|
667
|
+
isSignal: true,
|
|
668
|
+
alias: "numCols",
|
|
669
|
+
required: false
|
|
670
|
+
}]
|
|
671
|
+
}],
|
|
672
|
+
allowDisabledSelection: [{
|
|
673
|
+
type: i0.Input,
|
|
674
|
+
args: [{
|
|
675
|
+
isSignal: true,
|
|
676
|
+
alias: "allowDisabledSelection",
|
|
677
|
+
required: false
|
|
678
|
+
}]
|
|
679
|
+
}],
|
|
680
|
+
activeCell: [{
|
|
681
|
+
type: i0.Input,
|
|
682
|
+
args: [{
|
|
683
|
+
isSignal: true,
|
|
684
|
+
alias: "activeCell",
|
|
685
|
+
required: false
|
|
686
|
+
}]
|
|
687
|
+
}]
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
const DAYS_PER_WEEK = 7;
|
|
691
|
+
var CmatDatetimepickerMonthViewComponent = class CmatDatetimepickerMonthViewComponent {
|
|
692
|
+
constructor() {
|
|
693
|
+
this.userSelection = output();
|
|
694
|
+
this.selectedChange = output();
|
|
695
|
+
this.type = input("date", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
696
|
+
this.dateFilter = input(...ngDevMode ? [void 0, { debugName: "dateFilter" }] : /* istanbul ignore next */ []);
|
|
697
|
+
this.minDate = input(null, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
|
|
698
|
+
this.maxDate = input(null, ...ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []);
|
|
699
|
+
this.selected = input(null, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
700
|
+
this.weeks = signal([], ...ngDevMode ? [{ debugName: "weeks" }] : /* istanbul ignore next */ []);
|
|
701
|
+
this.firstWeekOffset = signal(0, ...ngDevMode ? [{ debugName: "firstWeekOffset" }] : /* istanbul ignore next */ []);
|
|
702
|
+
this.selectedDate = signal(null, ...ngDevMode ? [{ debugName: "selectedDate" }] : /* istanbul ignore next */ []);
|
|
703
|
+
this.todayDate = signal(null, ...ngDevMode ? [{ debugName: "todayDate" }] : /* istanbul ignore next */ []);
|
|
704
|
+
this.calendarState = signal("", ...ngDevMode ? [{ debugName: "calendarState" }] : /* istanbul ignore next */ []);
|
|
705
|
+
this.activeDate = input.required(...ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []);
|
|
706
|
+
this.resolvedActiveDate = computed(() => {
|
|
707
|
+
return this._activeDate() ?? this.adapter.today();
|
|
708
|
+
}, ...ngDevMode ? [{ debugName: "resolvedActiveDate" }] : /* istanbul ignore next */ []);
|
|
709
|
+
this.adapter = inject(DatetimeAdapter, { optional: true });
|
|
710
|
+
this._dateFormats = inject(CMAT_DATETIME_FORMATS, { optional: true });
|
|
711
|
+
this._activeDate = signal(null, ...ngDevMode ? [{ debugName: "_activeDate" }] : /* istanbul ignore next */ []);
|
|
712
|
+
this._elementRef = inject(ElementRef);
|
|
713
|
+
this._calendarAnimationListener = this.calendarStateDone.bind(this);
|
|
714
|
+
if (!this.adapter) throw createMissingDateImplError("CDatetimeAdapter");
|
|
715
|
+
if (!this._dateFormats) throw createMissingDateImplError("CMAT_DATETIME_FORMATS");
|
|
716
|
+
const firstDayOfWeek = this.adapter.getFirstDayOfWeek();
|
|
717
|
+
const narrowWeekdays = this.adapter.getDayOfWeekNames("narrow");
|
|
718
|
+
const weekdays = this.adapter.getDayOfWeekNames("long").map((long, i) => ({
|
|
719
|
+
long,
|
|
720
|
+
narrow: narrowWeekdays[i]
|
|
721
|
+
}));
|
|
722
|
+
this.weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
|
|
723
|
+
this._elementRef.nativeElement.addEventListener("animationend", this._calendarAnimationListener);
|
|
724
|
+
effect(() => {
|
|
725
|
+
const value = this.activeDate();
|
|
726
|
+
const oldActiveDate = this._activeDate();
|
|
727
|
+
this._activeDate.set(value ?? this.adapter.today());
|
|
728
|
+
const newActiveDate = this.resolvedActiveDate();
|
|
729
|
+
untracked(() => {
|
|
730
|
+
if (oldActiveDate && newActiveDate && !this.adapter.sameMonthAndYear(oldActiveDate, newActiveDate)) {
|
|
731
|
+
this._init();
|
|
732
|
+
if (this.adapter.isInNextMonth(oldActiveDate, newActiveDate)) this._changeCalendarState("right");
|
|
733
|
+
else this._changeCalendarState("left");
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
ngAfterContentInit() {
|
|
739
|
+
this._init();
|
|
740
|
+
}
|
|
741
|
+
ngOnDestroy() {
|
|
742
|
+
this._elementRef.nativeElement.removeEventListener("animationend", this._calendarAnimationListener);
|
|
743
|
+
}
|
|
744
|
+
dateSelected(date) {
|
|
745
|
+
const currentDate = this.resolvedActiveDate();
|
|
746
|
+
this.selectedChange.emit(this.adapter.createDatetime(this.adapter.getYear(currentDate), this.adapter.getMonth(currentDate), date, this.adapter.getHour(currentDate), this.adapter.getMinute(currentDate)));
|
|
747
|
+
if (this.type() === "date") this.userSelection.emit();
|
|
748
|
+
}
|
|
749
|
+
calendarStateDone(event) {
|
|
750
|
+
if (event.animationName === "slideCalendarLeft" || event.animationName === "slideCalendarRight") this.calendarState.set("");
|
|
751
|
+
}
|
|
752
|
+
_init() {
|
|
753
|
+
const selectedValue = this.selected();
|
|
754
|
+
this.selectedDate.set(this._getDateInCurrentMonth(selectedValue));
|
|
755
|
+
this.todayDate.set(this._getDateInCurrentMonth(this.adapter.today()));
|
|
756
|
+
const currentDate = this.resolvedActiveDate();
|
|
757
|
+
const firstOfMonth = this.adapter.createDatetime(this.adapter.getYear(currentDate), this.adapter.getMonth(currentDate), 1, this.adapter.getHour(currentDate), this.adapter.getMinute(currentDate));
|
|
758
|
+
this.firstWeekOffset.set((DAYS_PER_WEEK + this.adapter.getDayOfWeek(firstOfMonth) - this.adapter.getFirstDayOfWeek()) % DAYS_PER_WEEK);
|
|
759
|
+
this._createWeekCells();
|
|
760
|
+
}
|
|
761
|
+
_createWeekCells() {
|
|
762
|
+
const currentDate = this.resolvedActiveDate();
|
|
763
|
+
const daysInMonth = this.adapter.getNumDaysInMonth(currentDate);
|
|
764
|
+
const dateNames = this.adapter.getDateNames();
|
|
765
|
+
const weeksList = [[]];
|
|
766
|
+
for (let i = 0, cell = this.firstWeekOffset(); i < daysInMonth; i++, cell++) {
|
|
767
|
+
if (cell === DAYS_PER_WEEK) {
|
|
768
|
+
weeksList.push([]);
|
|
769
|
+
cell = 0;
|
|
770
|
+
}
|
|
771
|
+
const date = this.adapter.createDatetime(this.adapter.getYear(currentDate), this.adapter.getMonth(currentDate), i + 1, this.adapter.getHour(currentDate), this.adapter.getMinute(currentDate));
|
|
772
|
+
const dateFilter = this.dateFilter();
|
|
773
|
+
const enabled = !dateFilter || dateFilter(date);
|
|
774
|
+
const ariaLabel = this.adapter.format(date, this._dateFormats.display.dateA11yLabel);
|
|
775
|
+
weeksList[weeksList.length - 1].push(new CmatDatetimepickerCalendarCellComponent(i + 1, dateNames[i], ariaLabel, enabled));
|
|
776
|
+
}
|
|
777
|
+
this.weeks.set(weeksList);
|
|
778
|
+
}
|
|
779
|
+
_getDateInCurrentMonth(date) {
|
|
780
|
+
if (!date) return null;
|
|
781
|
+
return this.adapter.sameMonthAndYear(date, this.resolvedActiveDate()) ? this.adapter.getDate(date) : null;
|
|
782
|
+
}
|
|
783
|
+
_changeCalendarState(direction) {
|
|
784
|
+
this.calendarState.set(direction);
|
|
785
|
+
}
|
|
786
|
+
static {
|
|
787
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
788
|
+
minVersion: "12.0.0",
|
|
789
|
+
version: "22.3.0",
|
|
790
|
+
ngImport: i0,
|
|
791
|
+
type: CmatDatetimepickerMonthViewComponent,
|
|
792
|
+
deps: [],
|
|
793
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
static {
|
|
797
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
798
|
+
minVersion: "17.0.0",
|
|
799
|
+
version: "22.3.0",
|
|
800
|
+
type: CmatDatetimepickerMonthViewComponent,
|
|
801
|
+
isStandalone: true,
|
|
802
|
+
selector: "cmat-datetimepicker-month-view",
|
|
803
|
+
inputs: {
|
|
804
|
+
type: {
|
|
805
|
+
classPropertyName: "type",
|
|
806
|
+
publicName: "type",
|
|
807
|
+
isSignal: true,
|
|
808
|
+
isRequired: false,
|
|
809
|
+
transformFunction: null
|
|
810
|
+
},
|
|
811
|
+
dateFilter: {
|
|
812
|
+
classPropertyName: "dateFilter",
|
|
813
|
+
publicName: "dateFilter",
|
|
814
|
+
isSignal: true,
|
|
815
|
+
isRequired: false,
|
|
816
|
+
transformFunction: null
|
|
817
|
+
},
|
|
818
|
+
minDate: {
|
|
819
|
+
classPropertyName: "minDate",
|
|
820
|
+
publicName: "minDate",
|
|
821
|
+
isSignal: true,
|
|
822
|
+
isRequired: false,
|
|
823
|
+
transformFunction: null
|
|
824
|
+
},
|
|
825
|
+
maxDate: {
|
|
826
|
+
classPropertyName: "maxDate",
|
|
827
|
+
publicName: "maxDate",
|
|
828
|
+
isSignal: true,
|
|
829
|
+
isRequired: false,
|
|
830
|
+
transformFunction: null
|
|
831
|
+
},
|
|
832
|
+
selected: {
|
|
833
|
+
classPropertyName: "selected",
|
|
834
|
+
publicName: "selected",
|
|
835
|
+
isSignal: true,
|
|
836
|
+
isRequired: false,
|
|
837
|
+
transformFunction: null
|
|
838
|
+
},
|
|
839
|
+
activeDate: {
|
|
840
|
+
classPropertyName: "activeDate",
|
|
841
|
+
publicName: "activeDate",
|
|
842
|
+
isSignal: true,
|
|
843
|
+
isRequired: true,
|
|
844
|
+
transformFunction: null
|
|
845
|
+
}
|
|
846
|
+
},
|
|
847
|
+
outputs: {
|
|
848
|
+
userSelection: "userSelection",
|
|
849
|
+
selectedChange: "selectedChange"
|
|
850
|
+
},
|
|
851
|
+
exportAs: ["cmatDatetimepickerMonthView"],
|
|
852
|
+
ngImport: i0,
|
|
853
|
+
template: "<table class=\"cmat-datetimepicker-calendar-table\">\r\n <thead class=\"cmat-datetimepicker-calendar-table-header\">\r\n <tr>\r\n @for (day of weekdays; track $index) {\r\n <th [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\r\n }\r\n </tr>\r\n <tr>\r\n <th colspan=\"7\" class=\"cmat-calendar-table-header-divider\"></th>\r\n </tr>\r\n </thead>\r\n <tbody class=\"cmat-calendar-slide-animation\" cmat-datetimepicker-calendar-body role=\"grid\"\r\n [ngClass]=\"{\r\n 'left': calendarState()==='left',\r\n 'right': calendarState()==='right'\r\n }\" [activeCell]=\"adapter.getDate(activeDate()) - 1\" [rows]=\"weeks()\"\r\n [selectedValue]=\"selectedDate()\" [todayValue]=\"todayDate()\" (selectedValueChange)=\"dateSelected($event)\">\r\n </tbody>\r\n</table>\r\n",
|
|
854
|
+
styles: [".cmat-calendar-slide-animation.left{animation:slideCalendarLeft .18s}.cmat-calendar-slide-animation.right{animation:slideCalendarRight .18s}@keyframes slideCalendarLeft{0%,50%{transform:translate(100%)}51%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideCalendarRight{0%,50%{transform:translate(-100%)}51%{transform:translate(100%)}to{transform:translate(0)}}\n"],
|
|
855
|
+
dependencies: [{
|
|
856
|
+
kind: "component",
|
|
857
|
+
type: CmatDatetimepickerCalendarBodyComponent,
|
|
858
|
+
selector: "[cmat-datetimepicker-calendar-body]",
|
|
859
|
+
inputs: [
|
|
860
|
+
"label",
|
|
861
|
+
"rows",
|
|
862
|
+
"todayValue",
|
|
863
|
+
"selectedValue",
|
|
864
|
+
"labelMinRequiredCells",
|
|
865
|
+
"numCols",
|
|
866
|
+
"allowDisabledSelection",
|
|
867
|
+
"activeCell"
|
|
868
|
+
],
|
|
869
|
+
outputs: ["selectedValueChange"],
|
|
870
|
+
exportAs: ["cmatDatetimepickerCalendarBody"]
|
|
871
|
+
}, {
|
|
872
|
+
kind: "directive",
|
|
873
|
+
type: NgClass,
|
|
874
|
+
selector: "[ngClass]",
|
|
875
|
+
inputs: ["class", "ngClass"]
|
|
876
|
+
}],
|
|
877
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
878
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
};
|
|
882
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
883
|
+
minVersion: "12.0.0",
|
|
884
|
+
version: "22.3.0",
|
|
885
|
+
ngImport: i0,
|
|
886
|
+
type: CmatDatetimepickerMonthViewComponent,
|
|
887
|
+
decorators: [{
|
|
888
|
+
type: Component,
|
|
889
|
+
args: [{
|
|
890
|
+
selector: "cmat-datetimepicker-month-view",
|
|
891
|
+
encapsulation: ViewEncapsulation.None,
|
|
892
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
893
|
+
exportAs: "cmatDatetimepickerMonthView",
|
|
894
|
+
imports: [CmatDatetimepickerCalendarBodyComponent, NgClass],
|
|
895
|
+
template: "<table class=\"cmat-datetimepicker-calendar-table\">\r\n <thead class=\"cmat-datetimepicker-calendar-table-header\">\r\n <tr>\r\n @for (day of weekdays; track $index) {\r\n <th [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\r\n }\r\n </tr>\r\n <tr>\r\n <th colspan=\"7\" class=\"cmat-calendar-table-header-divider\"></th>\r\n </tr>\r\n </thead>\r\n <tbody class=\"cmat-calendar-slide-animation\" cmat-datetimepicker-calendar-body role=\"grid\"\r\n [ngClass]=\"{\r\n 'left': calendarState()==='left',\r\n 'right': calendarState()==='right'\r\n }\" [activeCell]=\"adapter.getDate(activeDate()) - 1\" [rows]=\"weeks()\"\r\n [selectedValue]=\"selectedDate()\" [todayValue]=\"todayDate()\" (selectedValueChange)=\"dateSelected($event)\">\r\n </tbody>\r\n</table>\r\n",
|
|
896
|
+
styles: [".cmat-calendar-slide-animation.left{animation:slideCalendarLeft .18s}.cmat-calendar-slide-animation.right{animation:slideCalendarRight .18s}@keyframes slideCalendarLeft{0%,50%{transform:translate(100%)}51%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideCalendarRight{0%,50%{transform:translate(-100%)}51%{transform:translate(100%)}to{transform:translate(0)}}\n"]
|
|
897
|
+
}]
|
|
898
|
+
}],
|
|
899
|
+
ctorParameters: () => [],
|
|
900
|
+
propDecorators: {
|
|
901
|
+
userSelection: [{
|
|
902
|
+
type: i0.Output,
|
|
903
|
+
args: ["userSelection"]
|
|
904
|
+
}],
|
|
905
|
+
selectedChange: [{
|
|
906
|
+
type: i0.Output,
|
|
907
|
+
args: ["selectedChange"]
|
|
908
|
+
}],
|
|
909
|
+
type: [{
|
|
910
|
+
type: i0.Input,
|
|
911
|
+
args: [{
|
|
912
|
+
isSignal: true,
|
|
913
|
+
alias: "type",
|
|
914
|
+
required: false
|
|
915
|
+
}]
|
|
916
|
+
}],
|
|
917
|
+
dateFilter: [{
|
|
918
|
+
type: i0.Input,
|
|
919
|
+
args: [{
|
|
920
|
+
isSignal: true,
|
|
921
|
+
alias: "dateFilter",
|
|
922
|
+
required: false
|
|
923
|
+
}]
|
|
924
|
+
}],
|
|
925
|
+
minDate: [{
|
|
926
|
+
type: i0.Input,
|
|
927
|
+
args: [{
|
|
928
|
+
isSignal: true,
|
|
929
|
+
alias: "minDate",
|
|
930
|
+
required: false
|
|
931
|
+
}]
|
|
932
|
+
}],
|
|
933
|
+
maxDate: [{
|
|
934
|
+
type: i0.Input,
|
|
935
|
+
args: [{
|
|
936
|
+
isSignal: true,
|
|
937
|
+
alias: "maxDate",
|
|
938
|
+
required: false
|
|
939
|
+
}]
|
|
940
|
+
}],
|
|
941
|
+
selected: [{
|
|
942
|
+
type: i0.Input,
|
|
943
|
+
args: [{
|
|
944
|
+
isSignal: true,
|
|
945
|
+
alias: "selected",
|
|
946
|
+
required: false
|
|
947
|
+
}]
|
|
948
|
+
}],
|
|
949
|
+
activeDate: [{
|
|
950
|
+
type: i0.Input,
|
|
951
|
+
args: [{
|
|
952
|
+
isSignal: true,
|
|
953
|
+
alias: "activeDate",
|
|
954
|
+
required: true
|
|
955
|
+
}]
|
|
956
|
+
}]
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
var CmatDatetimepickerMultiYearViewComponent = class CmatDatetimepickerMultiYearViewComponent {
|
|
960
|
+
constructor() {
|
|
961
|
+
this.userSelection = output();
|
|
962
|
+
this.selectedChange = output();
|
|
963
|
+
this.type = input("date", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
964
|
+
this.dateFilter = input(...ngDevMode ? [void 0, { debugName: "dateFilter" }] : /* istanbul ignore next */ []);
|
|
965
|
+
this.minDate = input(null, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
|
|
966
|
+
this.maxDate = input(null, ...ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []);
|
|
967
|
+
this.selected = input(null, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
968
|
+
this.years = signal([], ...ngDevMode ? [{ debugName: "years" }] : /* istanbul ignore next */ []);
|
|
969
|
+
this.yearLabel = signal("", ...ngDevMode ? [{ debugName: "yearLabel" }] : /* istanbul ignore next */ []);
|
|
970
|
+
this.todayYear = signal(0, ...ngDevMode ? [{ debugName: "todayYear" }] : /* istanbul ignore next */ []);
|
|
971
|
+
this.selectedYear = signal(null, ...ngDevMode ? [{ debugName: "selectedYear" }] : /* istanbul ignore next */ []);
|
|
972
|
+
this.calendarState = signal("", ...ngDevMode ? [{ debugName: "calendarState" }] : /* istanbul ignore next */ []);
|
|
973
|
+
this.activeDate = input.required(...ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []);
|
|
974
|
+
this.resolvedActiveDate = computed(() => {
|
|
975
|
+
return this._activeDate() ?? this.adapter.today();
|
|
976
|
+
}, ...ngDevMode ? [{ debugName: "resolvedActiveDate" }] : /* istanbul ignore next */ []);
|
|
977
|
+
this.adapter = inject(DatetimeAdapter, { optional: true });
|
|
978
|
+
this._dateFormats = inject(CMAT_DATETIME_FORMATS, { optional: true });
|
|
979
|
+
this._activeDate = signal(null, ...ngDevMode ? [{ debugName: "_activeDate" }] : /* istanbul ignore next */ []);
|
|
980
|
+
this._elementRef = inject(ElementRef);
|
|
981
|
+
this._calendarAnimationListener = this.calendarStateDone.bind(this);
|
|
982
|
+
if (!this.adapter) throw createMissingDateImplError("CDatetimeAdapter");
|
|
983
|
+
if (!this._dateFormats) throw createMissingDateImplError("CMAT_DATETIME_FORMATS");
|
|
984
|
+
this._elementRef.nativeElement.addEventListener("animationend", this._calendarAnimationListener);
|
|
985
|
+
effect(() => {
|
|
986
|
+
const newActiveDate = this.activeDate() ?? this.adapter.today();
|
|
987
|
+
const oldActiveDate = this._previousActiveDate;
|
|
988
|
+
this._activeDate.set(newActiveDate);
|
|
989
|
+
this._previousActiveDate = newActiveDate;
|
|
990
|
+
untracked(() => {
|
|
991
|
+
if (oldActiveDate && newActiveDate && !isSameMultiYearView(this.adapter, oldActiveDate, newActiveDate, this.minDate(), this.maxDate())) {
|
|
992
|
+
this._init();
|
|
993
|
+
if (this.adapter.isInNextMonth(oldActiveDate, newActiveDate)) this._changeCalendarState("right");
|
|
994
|
+
else this._changeCalendarState("left");
|
|
995
|
+
}
|
|
996
|
+
});
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
ngAfterContentInit() {
|
|
1000
|
+
this._init();
|
|
1001
|
+
}
|
|
1002
|
+
ngOnDestroy() {
|
|
1003
|
+
this._elementRef.nativeElement.removeEventListener("animationend", this._calendarAnimationListener);
|
|
1004
|
+
}
|
|
1005
|
+
yearSelected(year) {
|
|
1006
|
+
const currentDate = this.resolvedActiveDate();
|
|
1007
|
+
const month = this.adapter.getMonth(currentDate);
|
|
1008
|
+
const normalizedDate = this.adapter.createDatetime(year, month, 1, 0, 0);
|
|
1009
|
+
this.selectedChange.emit(this.adapter.createDatetime(year, month, Math.min(this.adapter.getDate(currentDate), this.adapter.getNumDaysInMonth(normalizedDate)), this.adapter.getHour(currentDate), this.adapter.getMinute(currentDate)));
|
|
1010
|
+
if (this.type() === "year") this.userSelection.emit();
|
|
1011
|
+
}
|
|
1012
|
+
getActiveCell() {
|
|
1013
|
+
return getActiveOffset(this.adapter, this.resolvedActiveDate(), this.minDate(), this.maxDate());
|
|
1014
|
+
}
|
|
1015
|
+
calendarStateDone(event) {
|
|
1016
|
+
if (event.animationName === "slideCalendarLeft" || event.animationName === "slideCalendarRight") this.calendarState.set("");
|
|
1017
|
+
}
|
|
1018
|
+
_init() {
|
|
1019
|
+
this.todayYear.set(this.adapter.getYear(this.adapter.today()));
|
|
1020
|
+
this.yearLabel.set(this.adapter.getYearName(this.resolvedActiveDate()));
|
|
1021
|
+
const minYearOfPage = this.adapter.getYear(this.resolvedActiveDate()) - getActiveOffset(this.adapter, this.resolvedActiveDate(), this.minDate(), this.maxDate());
|
|
1022
|
+
const yearsList = [];
|
|
1023
|
+
for (let i = 0, row = []; i < 24; i++) {
|
|
1024
|
+
row.push(minYearOfPage + i);
|
|
1025
|
+
if (row.length === 4) {
|
|
1026
|
+
yearsList.push(row.map((year) => this._createCellForYear(year)));
|
|
1027
|
+
row = [];
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
this.years.set(yearsList);
|
|
1031
|
+
}
|
|
1032
|
+
_createCellForYear(year) {
|
|
1033
|
+
const yearName = this.adapter.getYearName(this.adapter.createDate(year, 0, 1));
|
|
1034
|
+
return new CmatDatetimepickerCalendarCellComponent(year, yearName, yearName, this._shouldEnableYear(year));
|
|
1035
|
+
}
|
|
1036
|
+
_shouldEnableYear(year) {
|
|
1037
|
+
if (year === void 0 || year === null || this.maxDate() && year > this.adapter.getYear(this.maxDate()) || this.minDate() && year < this.adapter.getYear(this.minDate())) return false;
|
|
1038
|
+
const dateFilter = this.dateFilter();
|
|
1039
|
+
if (!dateFilter) return true;
|
|
1040
|
+
const firstOfYear = this.adapter.createDate(year, 0, 1);
|
|
1041
|
+
for (let date = firstOfYear; this.adapter.getYear(date) === year; date = this.adapter.addCalendarDays(date, 1)) if (dateFilter(date)) return true;
|
|
1042
|
+
return false;
|
|
1043
|
+
}
|
|
1044
|
+
_changeCalendarState(direction) {
|
|
1045
|
+
this.calendarState.set(direction);
|
|
1046
|
+
}
|
|
1047
|
+
static {
|
|
1048
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1049
|
+
minVersion: "12.0.0",
|
|
1050
|
+
version: "22.3.0",
|
|
1051
|
+
ngImport: i0,
|
|
1052
|
+
type: CmatDatetimepickerMultiYearViewComponent,
|
|
1053
|
+
deps: [],
|
|
1054
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
static {
|
|
1058
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1059
|
+
minVersion: "17.1.0",
|
|
1060
|
+
version: "22.3.0",
|
|
1061
|
+
type: CmatDatetimepickerMultiYearViewComponent,
|
|
1062
|
+
isStandalone: true,
|
|
1063
|
+
selector: "cmat-datetimepicker-multi-year-view",
|
|
1064
|
+
inputs: {
|
|
1065
|
+
type: {
|
|
1066
|
+
classPropertyName: "type",
|
|
1067
|
+
publicName: "type",
|
|
1068
|
+
isSignal: true,
|
|
1069
|
+
isRequired: false,
|
|
1070
|
+
transformFunction: null
|
|
1071
|
+
},
|
|
1072
|
+
dateFilter: {
|
|
1073
|
+
classPropertyName: "dateFilter",
|
|
1074
|
+
publicName: "dateFilter",
|
|
1075
|
+
isSignal: true,
|
|
1076
|
+
isRequired: false,
|
|
1077
|
+
transformFunction: null
|
|
1078
|
+
},
|
|
1079
|
+
minDate: {
|
|
1080
|
+
classPropertyName: "minDate",
|
|
1081
|
+
publicName: "minDate",
|
|
1082
|
+
isSignal: true,
|
|
1083
|
+
isRequired: false,
|
|
1084
|
+
transformFunction: null
|
|
1085
|
+
},
|
|
1086
|
+
maxDate: {
|
|
1087
|
+
classPropertyName: "maxDate",
|
|
1088
|
+
publicName: "maxDate",
|
|
1089
|
+
isSignal: true,
|
|
1090
|
+
isRequired: false,
|
|
1091
|
+
transformFunction: null
|
|
1092
|
+
},
|
|
1093
|
+
selected: {
|
|
1094
|
+
classPropertyName: "selected",
|
|
1095
|
+
publicName: "selected",
|
|
1096
|
+
isSignal: true,
|
|
1097
|
+
isRequired: false,
|
|
1098
|
+
transformFunction: null
|
|
1099
|
+
},
|
|
1100
|
+
activeDate: {
|
|
1101
|
+
classPropertyName: "activeDate",
|
|
1102
|
+
publicName: "activeDate",
|
|
1103
|
+
isSignal: true,
|
|
1104
|
+
isRequired: true,
|
|
1105
|
+
transformFunction: null
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1108
|
+
outputs: {
|
|
1109
|
+
userSelection: "userSelection",
|
|
1110
|
+
selectedChange: "selectedChange"
|
|
1111
|
+
},
|
|
1112
|
+
exportAs: ["cmatDatetimepickerMultiYearView"],
|
|
1113
|
+
ngImport: i0,
|
|
1114
|
+
template: "<table class=\"cmat-datetimepicker-calendar-table\">\r\n <thead class=\"cmat-datetimepicker-calendar-table-header\"></thead>\r\n <tbody class=\"cmat-calendar-slide-animation\" cmat-datetimepicker-calendar-body role=\"grid\"\r\n [ngClass]=\"{\r\n 'left': calendarState()==='left',\r\n 'right': calendarState()==='right'\r\n }\" [activeCell]=\"getActiveCell()\" [numCols]=\"4\" [rows]=\"years()\"\r\n [selectedValue]=\"selectedYear()\" [todayValue]=\"todayYear()\" [allowDisabledSelection]=\"true\"\r\n (selectedValueChange)=\"yearSelected($event)\"></tbody>\r\n</table>\r\n",
|
|
1115
|
+
styles: [".cmat-calendar-slide-animation.left{animation:slideCalendarLeft .18s}.cmat-calendar-slide-animation.right{animation:slideCalendarRight .18s}@keyframes slideCalendarLeft{0%,50%{transform:translate(100%)}51%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideCalendarRight{0%,50%{transform:translate(-100%)}51%{transform:translate(100%)}to{transform:translate(0)}}\n"],
|
|
1116
|
+
dependencies: [{
|
|
1117
|
+
kind: "component",
|
|
1118
|
+
type: CmatDatetimepickerCalendarBodyComponent,
|
|
1119
|
+
selector: "[cmat-datetimepicker-calendar-body]",
|
|
1120
|
+
inputs: [
|
|
1121
|
+
"label",
|
|
1122
|
+
"rows",
|
|
1123
|
+
"todayValue",
|
|
1124
|
+
"selectedValue",
|
|
1125
|
+
"labelMinRequiredCells",
|
|
1126
|
+
"numCols",
|
|
1127
|
+
"allowDisabledSelection",
|
|
1128
|
+
"activeCell"
|
|
1129
|
+
],
|
|
1130
|
+
outputs: ["selectedValueChange"],
|
|
1131
|
+
exportAs: ["cmatDatetimepickerCalendarBody"]
|
|
1132
|
+
}, {
|
|
1133
|
+
kind: "directive",
|
|
1134
|
+
type: NgClass,
|
|
1135
|
+
selector: "[ngClass]",
|
|
1136
|
+
inputs: ["class", "ngClass"]
|
|
1137
|
+
}],
|
|
1138
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1139
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1144
|
+
minVersion: "12.0.0",
|
|
1145
|
+
version: "22.3.0",
|
|
1146
|
+
ngImport: i0,
|
|
1147
|
+
type: CmatDatetimepickerMultiYearViewComponent,
|
|
1148
|
+
decorators: [{
|
|
1149
|
+
type: Component,
|
|
1150
|
+
args: [{
|
|
1151
|
+
selector: "cmat-datetimepicker-multi-year-view",
|
|
1152
|
+
encapsulation: ViewEncapsulation.None,
|
|
1153
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1154
|
+
exportAs: "cmatDatetimepickerMultiYearView",
|
|
1155
|
+
imports: [CmatDatetimepickerCalendarBodyComponent, NgClass],
|
|
1156
|
+
template: "<table class=\"cmat-datetimepicker-calendar-table\">\r\n <thead class=\"cmat-datetimepicker-calendar-table-header\"></thead>\r\n <tbody class=\"cmat-calendar-slide-animation\" cmat-datetimepicker-calendar-body role=\"grid\"\r\n [ngClass]=\"{\r\n 'left': calendarState()==='left',\r\n 'right': calendarState()==='right'\r\n }\" [activeCell]=\"getActiveCell()\" [numCols]=\"4\" [rows]=\"years()\"\r\n [selectedValue]=\"selectedYear()\" [todayValue]=\"todayYear()\" [allowDisabledSelection]=\"true\"\r\n (selectedValueChange)=\"yearSelected($event)\"></tbody>\r\n</table>\r\n",
|
|
1157
|
+
styles: [".cmat-calendar-slide-animation.left{animation:slideCalendarLeft .18s}.cmat-calendar-slide-animation.right{animation:slideCalendarRight .18s}@keyframes slideCalendarLeft{0%,50%{transform:translate(100%)}51%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideCalendarRight{0%,50%{transform:translate(-100%)}51%{transform:translate(100%)}to{transform:translate(0)}}\n"]
|
|
1158
|
+
}]
|
|
1159
|
+
}],
|
|
1160
|
+
ctorParameters: () => [],
|
|
1161
|
+
propDecorators: {
|
|
1162
|
+
userSelection: [{
|
|
1163
|
+
type: i0.Output,
|
|
1164
|
+
args: ["userSelection"]
|
|
1165
|
+
}],
|
|
1166
|
+
selectedChange: [{
|
|
1167
|
+
type: i0.Output,
|
|
1168
|
+
args: ["selectedChange"]
|
|
1169
|
+
}],
|
|
1170
|
+
type: [{
|
|
1171
|
+
type: i0.Input,
|
|
1172
|
+
args: [{
|
|
1173
|
+
isSignal: true,
|
|
1174
|
+
alias: "type",
|
|
1175
|
+
required: false
|
|
1176
|
+
}]
|
|
1177
|
+
}],
|
|
1178
|
+
dateFilter: [{
|
|
1179
|
+
type: i0.Input,
|
|
1180
|
+
args: [{
|
|
1181
|
+
isSignal: true,
|
|
1182
|
+
alias: "dateFilter",
|
|
1183
|
+
required: false
|
|
1184
|
+
}]
|
|
1185
|
+
}],
|
|
1186
|
+
minDate: [{
|
|
1187
|
+
type: i0.Input,
|
|
1188
|
+
args: [{
|
|
1189
|
+
isSignal: true,
|
|
1190
|
+
alias: "minDate",
|
|
1191
|
+
required: false
|
|
1192
|
+
}]
|
|
1193
|
+
}],
|
|
1194
|
+
maxDate: [{
|
|
1195
|
+
type: i0.Input,
|
|
1196
|
+
args: [{
|
|
1197
|
+
isSignal: true,
|
|
1198
|
+
alias: "maxDate",
|
|
1199
|
+
required: false
|
|
1200
|
+
}]
|
|
1201
|
+
}],
|
|
1202
|
+
selected: [{
|
|
1203
|
+
type: i0.Input,
|
|
1204
|
+
args: [{
|
|
1205
|
+
isSignal: true,
|
|
1206
|
+
alias: "selected",
|
|
1207
|
+
required: false
|
|
1208
|
+
}]
|
|
1209
|
+
}],
|
|
1210
|
+
activeDate: [{
|
|
1211
|
+
type: i0.Input,
|
|
1212
|
+
args: [{
|
|
1213
|
+
isSignal: true,
|
|
1214
|
+
alias: "activeDate",
|
|
1215
|
+
required: true
|
|
1216
|
+
}]
|
|
1217
|
+
}]
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
function isSameMultiYearView(dateAdapter, date1, date2, minDate, maxDate) {
|
|
1221
|
+
const year1 = dateAdapter.getYear(date1);
|
|
1222
|
+
const year2 = dateAdapter.getYear(date2);
|
|
1223
|
+
const startingYear = getStartingYear(dateAdapter, minDate, maxDate);
|
|
1224
|
+
return Math.floor((year1 - startingYear) / 24) === Math.floor((year2 - startingYear) / 24);
|
|
1225
|
+
}
|
|
1226
|
+
function getActiveOffset(dateAdapter, activeDate, minDate, maxDate) {
|
|
1227
|
+
return euclideanModulo(dateAdapter.getYear(activeDate) - getStartingYear(dateAdapter, minDate, maxDate), 24);
|
|
1228
|
+
}
|
|
1229
|
+
function getStartingYear(dateAdapter, minDate, maxDate) {
|
|
1230
|
+
let startingYear = 0;
|
|
1231
|
+
if (maxDate) startingYear = dateAdapter.getYear(maxDate) - 24 + 1;
|
|
1232
|
+
else if (minDate) startingYear = dateAdapter.getYear(minDate);
|
|
1233
|
+
return startingYear;
|
|
1234
|
+
}
|
|
1235
|
+
function euclideanModulo(a, b) {
|
|
1236
|
+
return (a % b + b) % b;
|
|
1237
|
+
}
|
|
1238
|
+
function pad(num, size) {
|
|
1239
|
+
num = String(num);
|
|
1240
|
+
while (num.length < size) num = "0" + num;
|
|
1241
|
+
return num;
|
|
1242
|
+
}
|
|
1243
|
+
var CmatDatetimepickerTimeInputDirective = class CmatDatetimepickerTimeInputDirective {
|
|
1244
|
+
constructor() {
|
|
1245
|
+
this.timeValueChanged = output();
|
|
1246
|
+
this.timeInterval = input(1, ...ngDevMode ? [{ debugName: "timeInterval" }] : /* istanbul ignore next */ []);
|
|
1247
|
+
this.timeMin = input(0, ...ngDevMode ? [{ debugName: "timeMin" }] : /* istanbul ignore next */ []);
|
|
1248
|
+
this.timeMax = input(Infinity, ...ngDevMode ? [{ debugName: "timeMax" }] : /* istanbul ignore next */ []);
|
|
1249
|
+
this.timeValue = input(0, ...ngDevMode ? [{ debugName: "timeValue" }] : /* istanbul ignore next */ []);
|
|
1250
|
+
this._element = inject(ElementRef);
|
|
1251
|
+
this._internalValue = signal(0, ...ngDevMode ? [{ debugName: "_internalValue" }] : /* istanbul ignore next */ []);
|
|
1252
|
+
this._keyDownListener = this.keyDownHandler.bind(this);
|
|
1253
|
+
this._keyPressListener = this.keyPressHandler.bind(this);
|
|
1254
|
+
this._inputEventListener = this.inputChangedHandler.bind(this);
|
|
1255
|
+
this._blurListener = this.blur.bind(this);
|
|
1256
|
+
this._focusListener = this.focus.bind(this);
|
|
1257
|
+
const element = this._element.nativeElement;
|
|
1258
|
+
element.addEventListener("keydown", this._keyDownListener, { passive: true });
|
|
1259
|
+
element.addEventListener("keypress", this._keyPressListener);
|
|
1260
|
+
element.addEventListener("input", this._inputEventListener, { passive: true });
|
|
1261
|
+
element.addEventListener("blur", this._blurListener);
|
|
1262
|
+
element.addEventListener("focus", this._focusListener);
|
|
1263
|
+
effect(() => {
|
|
1264
|
+
const value = this.timeValue();
|
|
1265
|
+
this._internalValue.set(coerceNumberProperty(value));
|
|
1266
|
+
if (!this.hasFocus) this.writeValue(this._internalValue());
|
|
1267
|
+
this.writePlaceholder(this._internalValue());
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
get hasFocus() {
|
|
1271
|
+
return !!this._element.nativeElement && this._element?.nativeElement === document?.activeElement;
|
|
1272
|
+
}
|
|
1273
|
+
get inputElement() {
|
|
1274
|
+
return this._element.nativeElement;
|
|
1275
|
+
}
|
|
1276
|
+
get valid() {
|
|
1277
|
+
const currentValue = this._internalValue();
|
|
1278
|
+
if (currentValue) {
|
|
1279
|
+
if (String(this.inputElement.value).length) return pad(currentValue, 2) === this.inputElement.value;
|
|
1280
|
+
else return pad(currentValue, 2) === this.inputElement.placeholder;
|
|
1281
|
+
}
|
|
1282
|
+
return true;
|
|
1283
|
+
}
|
|
1284
|
+
get invalid() {
|
|
1285
|
+
return !this.valid;
|
|
1286
|
+
}
|
|
1287
|
+
setValue(value) {
|
|
1288
|
+
const numericValue = coerceNumberProperty(value);
|
|
1289
|
+
this._internalValue.set(numericValue);
|
|
1290
|
+
this.writeValue(numericValue);
|
|
1291
|
+
this.writePlaceholder(numericValue);
|
|
1292
|
+
}
|
|
1293
|
+
blur() {
|
|
1294
|
+
this.writeValue(this._internalValue());
|
|
1295
|
+
this.writePlaceholder(this._internalValue());
|
|
1296
|
+
this.timeValueChanged.emit(this._internalValue());
|
|
1297
|
+
}
|
|
1298
|
+
focus() {
|
|
1299
|
+
this.writeValue("");
|
|
1300
|
+
}
|
|
1301
|
+
writeValue(value) {
|
|
1302
|
+
if (value !== "") this.inputElement.value = pad(value, 2);
|
|
1303
|
+
else this.inputElement.value = "";
|
|
1304
|
+
}
|
|
1305
|
+
writePlaceholder(value) {
|
|
1306
|
+
this.inputElement.placeholder = pad(value, 2);
|
|
1307
|
+
}
|
|
1308
|
+
keyDownHandler(event) {
|
|
1309
|
+
if (String(this.inputElement.value).length > 0) {
|
|
1310
|
+
let value = null;
|
|
1311
|
+
if (event.code === "ArrowUp") {
|
|
1312
|
+
value = coerceNumberProperty(this._internalValue());
|
|
1313
|
+
value += this.timeInterval();
|
|
1314
|
+
event.stopPropagation();
|
|
1315
|
+
} else if (event.code === "ArrowDown") {
|
|
1316
|
+
value = coerceNumberProperty(this._internalValue());
|
|
1317
|
+
value -= this.timeInterval();
|
|
1318
|
+
event.stopPropagation();
|
|
1319
|
+
}
|
|
1320
|
+
if (typeof value === "number") {
|
|
1321
|
+
this.writeValue(value);
|
|
1322
|
+
this.writePlaceholder(value);
|
|
1323
|
+
this.clampInputValue();
|
|
1324
|
+
this.timeValueChanged.emit(this._internalValue());
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
keyPressHandler(event) {
|
|
1329
|
+
const key = event?.key ?? null;
|
|
1330
|
+
if (isNaN(Number(key)) && key !== "Enter") event.preventDefault();
|
|
1331
|
+
}
|
|
1332
|
+
inputChangedHandler() {
|
|
1333
|
+
this.clampInputValue();
|
|
1334
|
+
this.timeValueChanged.emit(this._internalValue());
|
|
1335
|
+
}
|
|
1336
|
+
clampInputValue() {
|
|
1337
|
+
if (this.inputElement?.value === "") return;
|
|
1338
|
+
const value = coerceNumberProperty(this.inputElement?.value ?? null);
|
|
1339
|
+
if (value) {
|
|
1340
|
+
const clampedValue = Math.min(Math.max(value, this.timeMin()), this.timeMax());
|
|
1341
|
+
if (clampedValue !== value) {
|
|
1342
|
+
this.writeValue(clampedValue);
|
|
1343
|
+
this.writePlaceholder(clampedValue);
|
|
1344
|
+
}
|
|
1345
|
+
this._internalValue.set(clampedValue);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
ngOnDestroy() {
|
|
1349
|
+
this.inputElement.removeEventListener("keydown", this._keyDownListener);
|
|
1350
|
+
this.inputElement.removeEventListener("keypress", this._keyPressListener);
|
|
1351
|
+
this.inputElement.removeEventListener("input", this._inputEventListener);
|
|
1352
|
+
}
|
|
1353
|
+
static {
|
|
1354
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1355
|
+
minVersion: "12.0.0",
|
|
1356
|
+
version: "22.3.0",
|
|
1357
|
+
ngImport: i0,
|
|
1358
|
+
type: CmatDatetimepickerTimeInputDirective,
|
|
1359
|
+
deps: [],
|
|
1360
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
static {
|
|
1364
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
1365
|
+
minVersion: "17.1.0",
|
|
1366
|
+
version: "22.3.0",
|
|
1367
|
+
type: CmatDatetimepickerTimeInputDirective,
|
|
1368
|
+
isStandalone: true,
|
|
1369
|
+
selector: "input.cmat-datetimepicker-time-input",
|
|
1370
|
+
inputs: {
|
|
1371
|
+
timeInterval: {
|
|
1372
|
+
classPropertyName: "timeInterval",
|
|
1373
|
+
publicName: "timeInterval",
|
|
1374
|
+
isSignal: true,
|
|
1375
|
+
isRequired: false,
|
|
1376
|
+
transformFunction: null
|
|
1377
|
+
},
|
|
1378
|
+
timeMin: {
|
|
1379
|
+
classPropertyName: "timeMin",
|
|
1380
|
+
publicName: "timeMin",
|
|
1381
|
+
isSignal: true,
|
|
1382
|
+
isRequired: false,
|
|
1383
|
+
transformFunction: null
|
|
1384
|
+
},
|
|
1385
|
+
timeMax: {
|
|
1386
|
+
classPropertyName: "timeMax",
|
|
1387
|
+
publicName: "timeMax",
|
|
1388
|
+
isSignal: true,
|
|
1389
|
+
isRequired: false,
|
|
1390
|
+
transformFunction: null
|
|
1391
|
+
},
|
|
1392
|
+
timeValue: {
|
|
1393
|
+
classPropertyName: "timeValue",
|
|
1394
|
+
publicName: "timeValue",
|
|
1395
|
+
isSignal: true,
|
|
1396
|
+
isRequired: false,
|
|
1397
|
+
transformFunction: null
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
outputs: { timeValueChanged: "timeValueChanged" },
|
|
1401
|
+
exportAs: ["cmatDatetimepickerTimeInput"],
|
|
1402
|
+
ngImport: i0
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
};
|
|
1406
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1407
|
+
minVersion: "12.0.0",
|
|
1408
|
+
version: "22.3.0",
|
|
1409
|
+
ngImport: i0,
|
|
1410
|
+
type: CmatDatetimepickerTimeInputDirective,
|
|
1411
|
+
decorators: [{
|
|
1412
|
+
type: Directive,
|
|
1413
|
+
args: [{
|
|
1414
|
+
selector: "input.cmat-datetimepicker-time-input",
|
|
1415
|
+
exportAs: "cmatDatetimepickerTimeInput"
|
|
1416
|
+
}]
|
|
1417
|
+
}],
|
|
1418
|
+
ctorParameters: () => [],
|
|
1419
|
+
propDecorators: {
|
|
1420
|
+
timeValueChanged: [{
|
|
1421
|
+
type: i0.Output,
|
|
1422
|
+
args: ["timeValueChanged"]
|
|
1423
|
+
}],
|
|
1424
|
+
timeInterval: [{
|
|
1425
|
+
type: i0.Input,
|
|
1426
|
+
args: [{
|
|
1427
|
+
isSignal: true,
|
|
1428
|
+
alias: "timeInterval",
|
|
1429
|
+
required: false
|
|
1430
|
+
}]
|
|
1431
|
+
}],
|
|
1432
|
+
timeMin: [{
|
|
1433
|
+
type: i0.Input,
|
|
1434
|
+
args: [{
|
|
1435
|
+
isSignal: true,
|
|
1436
|
+
alias: "timeMin",
|
|
1437
|
+
required: false
|
|
1438
|
+
}]
|
|
1439
|
+
}],
|
|
1440
|
+
timeMax: [{
|
|
1441
|
+
type: i0.Input,
|
|
1442
|
+
args: [{
|
|
1443
|
+
isSignal: true,
|
|
1444
|
+
alias: "timeMax",
|
|
1445
|
+
required: false
|
|
1446
|
+
}]
|
|
1447
|
+
}],
|
|
1448
|
+
timeValue: [{
|
|
1449
|
+
type: i0.Input,
|
|
1450
|
+
args: [{
|
|
1451
|
+
isSignal: true,
|
|
1452
|
+
alias: "timeValue",
|
|
1453
|
+
required: false
|
|
1454
|
+
}]
|
|
1455
|
+
}]
|
|
1456
|
+
}
|
|
1457
|
+
});
|
|
1458
|
+
var CmatDatetimepickerTimeComponent = class CmatDatetimepickerTimeComponent {
|
|
1459
|
+
constructor() {
|
|
1460
|
+
this.selectedChange = output();
|
|
1461
|
+
this.activeDateChange = output();
|
|
1462
|
+
this.userSelection = output();
|
|
1463
|
+
this.ampmChange = output();
|
|
1464
|
+
this.clockViewChange = output();
|
|
1465
|
+
this.dateFilter = input(...ngDevMode ? [void 0, { debugName: "dateFilter" }] : /* istanbul ignore next */ []);
|
|
1466
|
+
this.interval = input(1, ...ngDevMode ? [{ debugName: "interval" }] : /* istanbul ignore next */ []);
|
|
1467
|
+
this.AMPM = input("AM", ...ngDevMode ? [{ debugName: "AMPM" }] : /* istanbul ignore next */ []);
|
|
1468
|
+
this.twelvehour = input(false, {
|
|
1469
|
+
...ngDevMode ? { debugName: "twelvehour" } : /* istanbul ignore next */ {},
|
|
1470
|
+
transform: coerceBooleanProperty
|
|
1471
|
+
});
|
|
1472
|
+
this.minDate = input(null, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
|
|
1473
|
+
this.maxDate = input(null, ...ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []);
|
|
1474
|
+
this.selected = input(null, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
1475
|
+
this.clockView = input("hour", ...ngDevMode ? [{ debugName: "clockView" }] : /* istanbul ignore next */ []);
|
|
1476
|
+
this.intlVersion = signal(0, ...ngDevMode ? [{ debugName: "intlVersion" }] : /* istanbul ignore next */ []);
|
|
1477
|
+
this.activeDate = computed(() => {
|
|
1478
|
+
const date = this._activeDate();
|
|
1479
|
+
if (!date) return this._adapter.today();
|
|
1480
|
+
return this._adapter.clampDate(date, this.minDate(), this.maxDate());
|
|
1481
|
+
}, ...ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []);
|
|
1482
|
+
this.isHourView = computed(() => this._clockView() === "hour", ...ngDevMode ? [{ debugName: "isHourView" }] : /* istanbul ignore next */ []);
|
|
1483
|
+
this.isMinuteView = computed(() => this._clockView() === "minute", ...ngDevMode ? [{ debugName: "isMinuteView" }] : /* istanbul ignore next */ []);
|
|
1484
|
+
this.hour = computed(() => {
|
|
1485
|
+
const currentDate = this.activeDate();
|
|
1486
|
+
if (!currentDate) {
|
|
1487
|
+
if (this.twelvehour()) return "12";
|
|
1488
|
+
else return "00";
|
|
1489
|
+
}
|
|
1490
|
+
const hour = Number(this._adapter.getHour(currentDate));
|
|
1491
|
+
if (!this.twelvehour()) return this.prefixWithZero(hour);
|
|
1492
|
+
if (hour === 0) return "12";
|
|
1493
|
+
else return this.prefixWithZero(hour > 12 ? hour - 12 : hour);
|
|
1494
|
+
}, ...ngDevMode ? [{ debugName: "hour" }] : /* istanbul ignore next */ []);
|
|
1495
|
+
this.minute = computed(() => {
|
|
1496
|
+
const currentDate = this.activeDate();
|
|
1497
|
+
if (currentDate) return this.prefixWithZero(this._adapter.getMinute(currentDate));
|
|
1498
|
+
return "00";
|
|
1499
|
+
}, ...ngDevMode ? [{ debugName: "minute" }] : /* istanbul ignore next */ []);
|
|
1500
|
+
this.currentClockView = computed(() => this._clockView(), ...ngDevMode ? [{ debugName: "currentClockView" }] : /* istanbul ignore next */ []);
|
|
1501
|
+
this.hourInputElement = viewChild("hourInput", ...ngDevMode ? [{ debugName: "hourInputElement" }] : /* istanbul ignore next */ []);
|
|
1502
|
+
this.hourInputDirective = viewChild("hourInput", ...ngDevMode ? [{ debugName: "hourInputDirective" }] : /* istanbul ignore next */ []);
|
|
1503
|
+
this.minuteInputElement = viewChild("minuteInput", ...ngDevMode ? [{ debugName: "minuteInputElement" }] : /* istanbul ignore next */ []);
|
|
1504
|
+
this.minuteInputDirective = viewChild("minuteInput", ...ngDevMode ? [{ debugName: "minuteInputDirective" }] : /* istanbul ignore next */ []);
|
|
1505
|
+
this.datetimepickerIntl = inject(CmatDatetimepickerIntl);
|
|
1506
|
+
this._clockView = signal("hour", ...ngDevMode ? [{ debugName: "_clockView" }] : /* istanbul ignore next */ []);
|
|
1507
|
+
this._adapter = inject(DatetimeAdapter);
|
|
1508
|
+
this._destroyRef = inject(DestroyRef);
|
|
1509
|
+
this._activeDate = signal(null, ...ngDevMode ? [{ debugName: "_activeDate" }] : /* istanbul ignore next */ []);
|
|
1510
|
+
this.datetimepickerIntl.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
|
|
1511
|
+
this.intlVersion.update((value) => value + 1);
|
|
1512
|
+
});
|
|
1513
|
+
effect(() => {
|
|
1514
|
+
const selectedValue = this.selected();
|
|
1515
|
+
if (selectedValue) this._activeDate.set(selectedValue);
|
|
1516
|
+
});
|
|
1517
|
+
effect(() => {
|
|
1518
|
+
const clockView = this.clockView();
|
|
1519
|
+
this._clockView.set(clockView);
|
|
1520
|
+
this.focusInputElement();
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
prefixWithZero(value) {
|
|
1524
|
+
if (value < 10) return "0" + String(value);
|
|
1525
|
+
return String(value);
|
|
1526
|
+
}
|
|
1527
|
+
ngAfterViewInit() {
|
|
1528
|
+
this.focusInputElement();
|
|
1529
|
+
}
|
|
1530
|
+
focusInputElement() {
|
|
1531
|
+
if (this.currentClockView() === "hour") {
|
|
1532
|
+
const hourInput = this.hourInputElement();
|
|
1533
|
+
if (hourInput) hourInput.nativeElement?.focus();
|
|
1534
|
+
} else {
|
|
1535
|
+
const minuteInput = this.minuteInputElement();
|
|
1536
|
+
if (minuteInput) minuteInput.nativeElement?.focus();
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
handleHourInputChange(value) {
|
|
1540
|
+
const hour = coerceNumberProperty(value);
|
|
1541
|
+
if (hour || hour === 0) {
|
|
1542
|
+
const currentDate = this.activeDate();
|
|
1543
|
+
const newValue = this._adapter.createDatetime(this._adapter.getYear(currentDate), this._adapter.getMonth(currentDate), this._adapter.getDate(currentDate), this.updateHourForAmPm(hour), this._adapter.getMinute(currentDate));
|
|
1544
|
+
this._activeDate.set(this._adapter.clampDate(newValue, this.minDate(), this.maxDate()));
|
|
1545
|
+
this.activeDateChange.emit(this.activeDate());
|
|
1546
|
+
const hourDirective = this.hourInputDirective();
|
|
1547
|
+
if (hourDirective) hourDirective.setValue(this.hour());
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
updateHourForAmPm(value) {
|
|
1551
|
+
if (!this.twelvehour()) return value;
|
|
1552
|
+
if (this.AMPM() === "AM") {
|
|
1553
|
+
if (value === 0 || value === 12) return 0;
|
|
1554
|
+
return value;
|
|
1555
|
+
} else {
|
|
1556
|
+
if (value === 0 || value === 12) return 12;
|
|
1557
|
+
return value + 12;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
handleMinuteInputChange(value) {
|
|
1561
|
+
const minute = coerceNumberProperty(value);
|
|
1562
|
+
if (minute || minute === 0) {
|
|
1563
|
+
const currentDate = this.activeDate();
|
|
1564
|
+
const newValue = this._adapter.createDatetime(this._adapter.getYear(currentDate), this._adapter.getMonth(currentDate), this._adapter.getDate(currentDate), this._adapter.getHour(currentDate), minute);
|
|
1565
|
+
this._activeDate.set(this._adapter.clampDate(newValue, this.minDate(), this.maxDate()));
|
|
1566
|
+
this.activeDateChange.emit(this.activeDate());
|
|
1567
|
+
const minuteDirective = this.minuteInputDirective();
|
|
1568
|
+
if (minuteDirective) minuteDirective.setValue(this.minute());
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
handleFocus(clockView) {
|
|
1572
|
+
this._clockView.set(clockView);
|
|
1573
|
+
this.clockViewChange.emit(clockView);
|
|
1574
|
+
}
|
|
1575
|
+
timeSelected(date) {
|
|
1576
|
+
if (this.currentClockView() === "hour") this._clockView.set("minute");
|
|
1577
|
+
this._activeDate.set(date);
|
|
1578
|
+
}
|
|
1579
|
+
onActiveDateChange(date) {
|
|
1580
|
+
this._activeDate.set(date);
|
|
1581
|
+
this.activeDateChange.emit(date);
|
|
1582
|
+
}
|
|
1583
|
+
handleOk() {
|
|
1584
|
+
const currentDate = this.activeDate();
|
|
1585
|
+
if (currentDate) this.selectedChange.emit(currentDate);
|
|
1586
|
+
this.userSelection.emit();
|
|
1587
|
+
}
|
|
1588
|
+
handleCancel() {
|
|
1589
|
+
this.userSelection.emit();
|
|
1590
|
+
}
|
|
1591
|
+
static {
|
|
1592
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1593
|
+
minVersion: "12.0.0",
|
|
1594
|
+
version: "22.3.0",
|
|
1595
|
+
ngImport: i0,
|
|
1596
|
+
type: CmatDatetimepickerTimeComponent,
|
|
1597
|
+
deps: [],
|
|
1598
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
static {
|
|
1602
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1603
|
+
minVersion: "17.0.0",
|
|
1604
|
+
version: "22.3.0",
|
|
1605
|
+
type: CmatDatetimepickerTimeComponent,
|
|
1606
|
+
isStandalone: true,
|
|
1607
|
+
selector: "cmat-datetimepicker-time",
|
|
1608
|
+
inputs: {
|
|
1609
|
+
dateFilter: {
|
|
1610
|
+
classPropertyName: "dateFilter",
|
|
1611
|
+
publicName: "dateFilter",
|
|
1612
|
+
isSignal: true,
|
|
1613
|
+
isRequired: false,
|
|
1614
|
+
transformFunction: null
|
|
1615
|
+
},
|
|
1616
|
+
interval: {
|
|
1617
|
+
classPropertyName: "interval",
|
|
1618
|
+
publicName: "interval",
|
|
1619
|
+
isSignal: true,
|
|
1620
|
+
isRequired: false,
|
|
1621
|
+
transformFunction: null
|
|
1622
|
+
},
|
|
1623
|
+
AMPM: {
|
|
1624
|
+
classPropertyName: "AMPM",
|
|
1625
|
+
publicName: "AMPM",
|
|
1626
|
+
isSignal: true,
|
|
1627
|
+
isRequired: false,
|
|
1628
|
+
transformFunction: null
|
|
1629
|
+
},
|
|
1630
|
+
twelvehour: {
|
|
1631
|
+
classPropertyName: "twelvehour",
|
|
1632
|
+
publicName: "twelvehour",
|
|
1633
|
+
isSignal: true,
|
|
1634
|
+
isRequired: false,
|
|
1635
|
+
transformFunction: null
|
|
1636
|
+
},
|
|
1637
|
+
minDate: {
|
|
1638
|
+
classPropertyName: "minDate",
|
|
1639
|
+
publicName: "minDate",
|
|
1640
|
+
isSignal: true,
|
|
1641
|
+
isRequired: false,
|
|
1642
|
+
transformFunction: null
|
|
1643
|
+
},
|
|
1644
|
+
maxDate: {
|
|
1645
|
+
classPropertyName: "maxDate",
|
|
1646
|
+
publicName: "maxDate",
|
|
1647
|
+
isSignal: true,
|
|
1648
|
+
isRequired: false,
|
|
1649
|
+
transformFunction: null
|
|
1650
|
+
},
|
|
1651
|
+
selected: {
|
|
1652
|
+
classPropertyName: "selected",
|
|
1653
|
+
publicName: "selected",
|
|
1654
|
+
isSignal: true,
|
|
1655
|
+
isRequired: false,
|
|
1656
|
+
transformFunction: null
|
|
1657
|
+
},
|
|
1658
|
+
clockView: {
|
|
1659
|
+
classPropertyName: "clockView",
|
|
1660
|
+
publicName: "clockView",
|
|
1661
|
+
isSignal: true,
|
|
1662
|
+
isRequired: false,
|
|
1663
|
+
transformFunction: null
|
|
1664
|
+
}
|
|
1665
|
+
},
|
|
1666
|
+
outputs: {
|
|
1667
|
+
selectedChange: "selectedChange",
|
|
1668
|
+
activeDateChange: "activeDateChange",
|
|
1669
|
+
userSelection: "userSelection",
|
|
1670
|
+
ampmChange: "ampmChange",
|
|
1671
|
+
clockViewChange: "clockViewChange"
|
|
1672
|
+
},
|
|
1673
|
+
host: { classAttribute: "cmat-datetimepicker-time" },
|
|
1674
|
+
viewQueries: [
|
|
1675
|
+
{
|
|
1676
|
+
propertyName: "hourInputElement",
|
|
1677
|
+
first: true,
|
|
1678
|
+
predicate: ["hourInput"],
|
|
1679
|
+
descendants: true,
|
|
1680
|
+
isSignal: true
|
|
1681
|
+
},
|
|
1682
|
+
{
|
|
1683
|
+
propertyName: "hourInputDirective",
|
|
1684
|
+
first: true,
|
|
1685
|
+
predicate: ["hourInput"],
|
|
1686
|
+
descendants: true,
|
|
1687
|
+
isSignal: true
|
|
1688
|
+
},
|
|
1689
|
+
{
|
|
1690
|
+
propertyName: "minuteInputElement",
|
|
1691
|
+
first: true,
|
|
1692
|
+
predicate: ["minuteInput"],
|
|
1693
|
+
descendants: true,
|
|
1694
|
+
isSignal: true
|
|
1695
|
+
},
|
|
1696
|
+
{
|
|
1697
|
+
propertyName: "minuteInputDirective",
|
|
1698
|
+
first: true,
|
|
1699
|
+
predicate: ["minuteInput"],
|
|
1700
|
+
descendants: true,
|
|
1701
|
+
isSignal: true
|
|
1702
|
+
}
|
|
1703
|
+
],
|
|
1704
|
+
exportAs: ["cmatDatetimepickerTime"],
|
|
1705
|
+
ngImport: i0,
|
|
1706
|
+
template: "<div\r\n class=\"cmat-datetimepicker-time-input-wrapper\"\r\n [attr.data-refresh]=\"intlVersion()\"\r\n>\r\n <div class=\"cmat-datetimepicker-time-input-inner\">\r\n <input\r\n #hourInput=\"cmatDatetimepickerTimeInput\"\r\n class=\"cmat-datetimepicker-time-input\"\r\n type=\"text\"\r\n inputmode=\"numeric\"\r\n maxlength=\"2\"\r\n [class.cmat-datetimepicker-time-input-active]=\"currentClockView() === 'hour'\"\r\n [class.cmat-datetimepicker-time-input-warning]=\"!hourInput.valid\"\r\n [timeMin]=\"twelvehour() ? 1 : 0\"\r\n [timeMax]=\"twelvehour() ? 12 : 23\"\r\n [timeValue]=\"hour()\"\r\n (timeValueChanged)=\"handleHourInputChange($event)\"\r\n (focus)=\"handleFocus('hour')\"\r\n />\r\n\r\n <div class=\"cmat-datetimepicker-time-seperator\">:</div>\r\n\r\n <input\r\n #minuteInput=\"cmatDatetimepickerTimeInput\"\r\n class=\"cmat-datetimepicker-time-input\"\r\n type=\"text\"\r\n inputmode=\"numeric\"\r\n maxlength=\"2\"\r\n [class.cmat-datetimepicker-time-input-active]=\"currentClockView() === 'minute'\"\r\n [class.cmat-datetimepicker-time-input-warning]=\"!minuteInput.valid\"\r\n [timeMin]=\"0\"\r\n [timeMax]=\"59\"\r\n [timeValue]=\"minute()\"\r\n [timeInterval]=\"interval()\"\r\n (timeValueChanged)=\"handleMinuteInputChange($event)\"\r\n (focus)=\"handleFocus('minute')\"\r\n />\r\n\r\n @if (twelvehour()) {\r\n <div class=\"cmat-datetimepicker-time-ampm\">\r\n <button\r\n matButton\r\n type=\"button\"\r\n class=\"cmat-datetimepicker-time-am\"\r\n aria-label=\"AM\"\r\n [class.cmat-datetimepicker-time-ampm-active]=\"AMPM() === 'AM'\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (click)=\"ampmChange.emit('AM')\"\r\n >\r\n AM\r\n </button>\r\n <button\r\n matButton\r\n type=\"button\"\r\n class=\"cmat-datetimepicker-time-pm\"\r\n aria-label=\"PM\"\r\n [class.cmat-datetimepicker-time-ampm-active]=\"AMPM() === 'PM'\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (click)=\"ampmChange.emit('PM')\"\r\n >\r\n PM\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<cmat-datetimepicker-clock\r\n [activeDate]=\"activeDate()\"\r\n [dateFilter]=\"dateFilter()\"\r\n [interval]=\"interval()\"\r\n [maxDate]=\"maxDate()\"\r\n [minDate]=\"minDate()\"\r\n [selected]=\"selected()\"\r\n [startView]=\"currentClockView()\"\r\n [twelvehour]=\"twelvehour()\"\r\n (selectedChange)=\"timeSelected($event)\"\r\n (activeDateChange)=\"onActiveDateChange($event)\"\r\n>\r\n</cmat-datetimepicker-clock>\r\n\r\n<div class=\"cmat-datetimepicker-time-button-wrapper flex flex-row gap-4\">\r\n <button\r\n class=\"cmat-datetimepicker-time-cancel-button\"\r\n matButton=\"outlined\"\r\n type=\"button\"\r\n (click)=\"handleCancel()\"\r\n >\r\n {{ datetimepickerIntl.cancelLabel }}\r\n </button>\r\n <button\r\n class=\"cmat-datetimepicker-time-ok-button\"\r\n matButton=\"filled\"\r\n type=\"button\"\r\n color=\"primary\"\r\n [disabled]=\"minuteInputDirective()?.invalid || hourInputDirective()?.invalid\"\r\n (click)=\"handleOk()\"\r\n >\r\n {{ datetimepickerIntl.okLabel }}\r\n </button>\r\n</div>\r\n",
|
|
1707
|
+
styles: [".cmat-datetimepicker-time{display:block;outline:none;-webkit-user-select:none;user-select:none}.cmat-datetimepicker-time-input-wrapper{padding:8px 0;text-align:center}.cmat-datetimepicker-time-input-inner{display:inline-flex;height:56px;align-items:center}.cmat-datetimepicker-time-input{width:72px;font-size:36px;text-align:center;border-radius:8px;border:2px solid #0000;appearance:none;outline:none;height:100%}.cmat-datetimepicker-time-seperator{display:inline-flex;justify-content:center;width:24px;font-size:36px;height:100%}.cmat-datetimepicker-time-ampm{display:inline-flex;flex-direction:column;margin-left:12px;height:100%}[dir=rtl] .cmat-datetimepicker-time-ampm{margin-left:auto;margin-right:12px}.cmat-datetimepicker-time-am.mat-mdc-button,.cmat-datetimepicker-time-pm.mat-mdc-button{flex:1;width:40px;min-width:auto;padding:0;line-height:normal;border-width:1px;border-style:solid;min-height:0}.cmat-datetimepicker-time-am.mat-mdc-button{border-radius:8px 8px 0 0!important}.cmat-datetimepicker-time-pm.mat-mdc-button{border-radius:0 0 8px 8px!important;border-top:none}.cmat-datetimepicker-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}\n"],
|
|
1708
|
+
dependencies: [
|
|
1709
|
+
{
|
|
1710
|
+
kind: "directive",
|
|
1711
|
+
type: CmatDatetimepickerTimeInputDirective,
|
|
1712
|
+
selector: "input.cmat-datetimepicker-time-input",
|
|
1713
|
+
inputs: [
|
|
1714
|
+
"timeInterval",
|
|
1715
|
+
"timeMin",
|
|
1716
|
+
"timeMax",
|
|
1717
|
+
"timeValue"
|
|
1718
|
+
],
|
|
1719
|
+
outputs: ["timeValueChanged"],
|
|
1720
|
+
exportAs: ["cmatDatetimepickerTimeInput"]
|
|
1721
|
+
},
|
|
1722
|
+
{
|
|
1723
|
+
kind: "ngmodule",
|
|
1724
|
+
type: MatButtonModule
|
|
1725
|
+
},
|
|
1726
|
+
{
|
|
1727
|
+
kind: "component",
|
|
1728
|
+
type: i1$1.MatButton,
|
|
1729
|
+
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] ",
|
|
1730
|
+
inputs: ["matButton"],
|
|
1731
|
+
exportAs: ["matButton", "matAnchor"]
|
|
1732
|
+
},
|
|
1733
|
+
{
|
|
1734
|
+
kind: "component",
|
|
1735
|
+
type: CmatDatetimepickerClockComponent,
|
|
1736
|
+
selector: "cmat-datetimepicker-clock",
|
|
1737
|
+
inputs: [
|
|
1738
|
+
"dateFilter",
|
|
1739
|
+
"interval",
|
|
1740
|
+
"twelvehour",
|
|
1741
|
+
"minDate",
|
|
1742
|
+
"maxDate",
|
|
1743
|
+
"selected",
|
|
1744
|
+
"startView",
|
|
1745
|
+
"activeDate"
|
|
1746
|
+
],
|
|
1747
|
+
outputs: [
|
|
1748
|
+
"userSelection",
|
|
1749
|
+
"selectedChange",
|
|
1750
|
+
"activeDateChange"
|
|
1751
|
+
],
|
|
1752
|
+
exportAs: ["cmatDatetimepickerClock"]
|
|
1753
|
+
}
|
|
1754
|
+
],
|
|
1755
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1756
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1757
|
+
});
|
|
1758
|
+
}
|
|
1759
|
+
};
|
|
1760
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1761
|
+
minVersion: "12.0.0",
|
|
1762
|
+
version: "22.3.0",
|
|
1763
|
+
ngImport: i0,
|
|
1764
|
+
type: CmatDatetimepickerTimeComponent,
|
|
1765
|
+
decorators: [{
|
|
1766
|
+
type: Component,
|
|
1767
|
+
args: [{
|
|
1768
|
+
selector: "cmat-datetimepicker-time",
|
|
1769
|
+
host: { "class": "cmat-datetimepicker-time" },
|
|
1770
|
+
exportAs: "cmatDatetimepickerTime",
|
|
1771
|
+
encapsulation: ViewEncapsulation.None,
|
|
1772
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1773
|
+
imports: [
|
|
1774
|
+
CmatDatetimepickerTimeInputDirective,
|
|
1775
|
+
MatButtonModule,
|
|
1776
|
+
CmatDatetimepickerClockComponent
|
|
1777
|
+
],
|
|
1778
|
+
template: "<div\r\n class=\"cmat-datetimepicker-time-input-wrapper\"\r\n [attr.data-refresh]=\"intlVersion()\"\r\n>\r\n <div class=\"cmat-datetimepicker-time-input-inner\">\r\n <input\r\n #hourInput=\"cmatDatetimepickerTimeInput\"\r\n class=\"cmat-datetimepicker-time-input\"\r\n type=\"text\"\r\n inputmode=\"numeric\"\r\n maxlength=\"2\"\r\n [class.cmat-datetimepicker-time-input-active]=\"currentClockView() === 'hour'\"\r\n [class.cmat-datetimepicker-time-input-warning]=\"!hourInput.valid\"\r\n [timeMin]=\"twelvehour() ? 1 : 0\"\r\n [timeMax]=\"twelvehour() ? 12 : 23\"\r\n [timeValue]=\"hour()\"\r\n (timeValueChanged)=\"handleHourInputChange($event)\"\r\n (focus)=\"handleFocus('hour')\"\r\n />\r\n\r\n <div class=\"cmat-datetimepicker-time-seperator\">:</div>\r\n\r\n <input\r\n #minuteInput=\"cmatDatetimepickerTimeInput\"\r\n class=\"cmat-datetimepicker-time-input\"\r\n type=\"text\"\r\n inputmode=\"numeric\"\r\n maxlength=\"2\"\r\n [class.cmat-datetimepicker-time-input-active]=\"currentClockView() === 'minute'\"\r\n [class.cmat-datetimepicker-time-input-warning]=\"!minuteInput.valid\"\r\n [timeMin]=\"0\"\r\n [timeMax]=\"59\"\r\n [timeValue]=\"minute()\"\r\n [timeInterval]=\"interval()\"\r\n (timeValueChanged)=\"handleMinuteInputChange($event)\"\r\n (focus)=\"handleFocus('minute')\"\r\n />\r\n\r\n @if (twelvehour()) {\r\n <div class=\"cmat-datetimepicker-time-ampm\">\r\n <button\r\n matButton\r\n type=\"button\"\r\n class=\"cmat-datetimepicker-time-am\"\r\n aria-label=\"AM\"\r\n [class.cmat-datetimepicker-time-ampm-active]=\"AMPM() === 'AM'\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (click)=\"ampmChange.emit('AM')\"\r\n >\r\n AM\r\n </button>\r\n <button\r\n matButton\r\n type=\"button\"\r\n class=\"cmat-datetimepicker-time-pm\"\r\n aria-label=\"PM\"\r\n [class.cmat-datetimepicker-time-ampm-active]=\"AMPM() === 'PM'\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (click)=\"ampmChange.emit('PM')\"\r\n >\r\n PM\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<cmat-datetimepicker-clock\r\n [activeDate]=\"activeDate()\"\r\n [dateFilter]=\"dateFilter()\"\r\n [interval]=\"interval()\"\r\n [maxDate]=\"maxDate()\"\r\n [minDate]=\"minDate()\"\r\n [selected]=\"selected()\"\r\n [startView]=\"currentClockView()\"\r\n [twelvehour]=\"twelvehour()\"\r\n (selectedChange)=\"timeSelected($event)\"\r\n (activeDateChange)=\"onActiveDateChange($event)\"\r\n>\r\n</cmat-datetimepicker-clock>\r\n\r\n<div class=\"cmat-datetimepicker-time-button-wrapper flex flex-row gap-4\">\r\n <button\r\n class=\"cmat-datetimepicker-time-cancel-button\"\r\n matButton=\"outlined\"\r\n type=\"button\"\r\n (click)=\"handleCancel()\"\r\n >\r\n {{ datetimepickerIntl.cancelLabel }}\r\n </button>\r\n <button\r\n class=\"cmat-datetimepicker-time-ok-button\"\r\n matButton=\"filled\"\r\n type=\"button\"\r\n color=\"primary\"\r\n [disabled]=\"minuteInputDirective()?.invalid || hourInputDirective()?.invalid\"\r\n (click)=\"handleOk()\"\r\n >\r\n {{ datetimepickerIntl.okLabel }}\r\n </button>\r\n</div>\r\n",
|
|
1779
|
+
styles: [".cmat-datetimepicker-time{display:block;outline:none;-webkit-user-select:none;user-select:none}.cmat-datetimepicker-time-input-wrapper{padding:8px 0;text-align:center}.cmat-datetimepicker-time-input-inner{display:inline-flex;height:56px;align-items:center}.cmat-datetimepicker-time-input{width:72px;font-size:36px;text-align:center;border-radius:8px;border:2px solid #0000;appearance:none;outline:none;height:100%}.cmat-datetimepicker-time-seperator{display:inline-flex;justify-content:center;width:24px;font-size:36px;height:100%}.cmat-datetimepicker-time-ampm{display:inline-flex;flex-direction:column;margin-left:12px;height:100%}[dir=rtl] .cmat-datetimepicker-time-ampm{margin-left:auto;margin-right:12px}.cmat-datetimepicker-time-am.mat-mdc-button,.cmat-datetimepicker-time-pm.mat-mdc-button{flex:1;width:40px;min-width:auto;padding:0;line-height:normal;border-width:1px;border-style:solid;min-height:0}.cmat-datetimepicker-time-am.mat-mdc-button{border-radius:8px 8px 0 0!important}.cmat-datetimepicker-time-pm.mat-mdc-button{border-radius:0 0 8px 8px!important;border-top:none}.cmat-datetimepicker-time-button-wrapper{display:flex;justify-content:flex-end;padding-top:8px}\n"]
|
|
1780
|
+
}]
|
|
1781
|
+
}],
|
|
1782
|
+
ctorParameters: () => [],
|
|
1783
|
+
propDecorators: {
|
|
1784
|
+
selectedChange: [{
|
|
1785
|
+
type: i0.Output,
|
|
1786
|
+
args: ["selectedChange"]
|
|
1787
|
+
}],
|
|
1788
|
+
activeDateChange: [{
|
|
1789
|
+
type: i0.Output,
|
|
1790
|
+
args: ["activeDateChange"]
|
|
1791
|
+
}],
|
|
1792
|
+
userSelection: [{
|
|
1793
|
+
type: i0.Output,
|
|
1794
|
+
args: ["userSelection"]
|
|
1795
|
+
}],
|
|
1796
|
+
ampmChange: [{
|
|
1797
|
+
type: i0.Output,
|
|
1798
|
+
args: ["ampmChange"]
|
|
1799
|
+
}],
|
|
1800
|
+
clockViewChange: [{
|
|
1801
|
+
type: i0.Output,
|
|
1802
|
+
args: ["clockViewChange"]
|
|
1803
|
+
}],
|
|
1804
|
+
dateFilter: [{
|
|
1805
|
+
type: i0.Input,
|
|
1806
|
+
args: [{
|
|
1807
|
+
isSignal: true,
|
|
1808
|
+
alias: "dateFilter",
|
|
1809
|
+
required: false
|
|
1810
|
+
}]
|
|
1811
|
+
}],
|
|
1812
|
+
interval: [{
|
|
1813
|
+
type: i0.Input,
|
|
1814
|
+
args: [{
|
|
1815
|
+
isSignal: true,
|
|
1816
|
+
alias: "interval",
|
|
1817
|
+
required: false
|
|
1818
|
+
}]
|
|
1819
|
+
}],
|
|
1820
|
+
AMPM: [{
|
|
1821
|
+
type: i0.Input,
|
|
1822
|
+
args: [{
|
|
1823
|
+
isSignal: true,
|
|
1824
|
+
alias: "AMPM",
|
|
1825
|
+
required: false
|
|
1826
|
+
}]
|
|
1827
|
+
}],
|
|
1828
|
+
twelvehour: [{
|
|
1829
|
+
type: i0.Input,
|
|
1830
|
+
args: [{
|
|
1831
|
+
isSignal: true,
|
|
1832
|
+
alias: "twelvehour",
|
|
1833
|
+
required: false
|
|
1834
|
+
}]
|
|
1835
|
+
}],
|
|
1836
|
+
minDate: [{
|
|
1837
|
+
type: i0.Input,
|
|
1838
|
+
args: [{
|
|
1839
|
+
isSignal: true,
|
|
1840
|
+
alias: "minDate",
|
|
1841
|
+
required: false
|
|
1842
|
+
}]
|
|
1843
|
+
}],
|
|
1844
|
+
maxDate: [{
|
|
1845
|
+
type: i0.Input,
|
|
1846
|
+
args: [{
|
|
1847
|
+
isSignal: true,
|
|
1848
|
+
alias: "maxDate",
|
|
1849
|
+
required: false
|
|
1850
|
+
}]
|
|
1851
|
+
}],
|
|
1852
|
+
selected: [{
|
|
1853
|
+
type: i0.Input,
|
|
1854
|
+
args: [{
|
|
1855
|
+
isSignal: true,
|
|
1856
|
+
alias: "selected",
|
|
1857
|
+
required: false
|
|
1858
|
+
}]
|
|
1859
|
+
}],
|
|
1860
|
+
clockView: [{
|
|
1861
|
+
type: i0.Input,
|
|
1862
|
+
args: [{
|
|
1863
|
+
isSignal: true,
|
|
1864
|
+
alias: "clockView",
|
|
1865
|
+
required: false
|
|
1866
|
+
}]
|
|
1867
|
+
}],
|
|
1868
|
+
hourInputElement: [{
|
|
1869
|
+
type: i0.ViewChild,
|
|
1870
|
+
args: ["hourInput", { isSignal: true }]
|
|
1871
|
+
}],
|
|
1872
|
+
hourInputDirective: [{
|
|
1873
|
+
type: i0.ViewChild,
|
|
1874
|
+
args: ["hourInput", { isSignal: true }]
|
|
1875
|
+
}],
|
|
1876
|
+
minuteInputElement: [{
|
|
1877
|
+
type: i0.ViewChild,
|
|
1878
|
+
args: ["minuteInput", { isSignal: true }]
|
|
1879
|
+
}],
|
|
1880
|
+
minuteInputDirective: [{
|
|
1881
|
+
type: i0.ViewChild,
|
|
1882
|
+
args: ["minuteInput", { isSignal: true }]
|
|
1883
|
+
}]
|
|
1884
|
+
}
|
|
1885
|
+
});
|
|
1886
|
+
var CmatDatetimepickerYearViewComponent = class CmatDatetimepickerYearViewComponent {
|
|
1887
|
+
constructor() {
|
|
1888
|
+
this.userSelection = output();
|
|
1889
|
+
this.selectedChange = output();
|
|
1890
|
+
this.type = input("date", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
1891
|
+
this.dateFilter = input(...ngDevMode ? [void 0, { debugName: "dateFilter" }] : /* istanbul ignore next */ []);
|
|
1892
|
+
this.minDate = input(null, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
|
|
1893
|
+
this.maxDate = input(null, ...ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []);
|
|
1894
|
+
this.selected = input(null, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
1895
|
+
this.activeDate = input.required(...ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []);
|
|
1896
|
+
this.months = signal([], ...ngDevMode ? [{ debugName: "months" }] : /* istanbul ignore next */ []);
|
|
1897
|
+
this.yearLabel = signal("", ...ngDevMode ? [{ debugName: "yearLabel" }] : /* istanbul ignore next */ []);
|
|
1898
|
+
this.todayMonth = signal(null, ...ngDevMode ? [{ debugName: "todayMonth" }] : /* istanbul ignore next */ []);
|
|
1899
|
+
this.selectedMonth = signal(null, ...ngDevMode ? [{ debugName: "selectedMonth" }] : /* istanbul ignore next */ []);
|
|
1900
|
+
this.calendarState = signal("", ...ngDevMode ? [{ debugName: "calendarState" }] : /* istanbul ignore next */ []);
|
|
1901
|
+
this.resolvedActiveDate = computed(() => {
|
|
1902
|
+
return this.activeDate() ?? this._internalActiveDate() ?? this.adapter.today();
|
|
1903
|
+
}, ...ngDevMode ? [{ debugName: "resolvedActiveDate" }] : /* istanbul ignore next */ []);
|
|
1904
|
+
this.adapter = inject(DatetimeAdapter, { optional: true });
|
|
1905
|
+
this._dateFormats = inject(CMAT_DATETIME_FORMATS, { optional: true });
|
|
1906
|
+
this._elementRef = inject(ElementRef);
|
|
1907
|
+
this._calendarAnimationListener = this.calendarStateDone.bind(this);
|
|
1908
|
+
this._internalActiveDate = signal(null, ...ngDevMode ? [{ debugName: "_internalActiveDate" }] : /* istanbul ignore next */ []);
|
|
1909
|
+
if (!this.adapter) throw createMissingDateImplError("CDatetimeAdapter");
|
|
1910
|
+
if (!this._dateFormats) throw createMissingDateImplError("CMAT_DATETIME_FORMATS");
|
|
1911
|
+
this._elementRef.nativeElement.addEventListener("animationend", this._calendarAnimationListener);
|
|
1912
|
+
effect(() => {
|
|
1913
|
+
const newActiveDate = this.activeDate();
|
|
1914
|
+
if (newActiveDate) {
|
|
1915
|
+
this._internalActiveDate();
|
|
1916
|
+
const prev = this._internalActiveDate();
|
|
1917
|
+
this._internalActiveDate.set(newActiveDate);
|
|
1918
|
+
untracked(() => {
|
|
1919
|
+
if (prev && newActiveDate && !this.adapter.sameYear(prev, newActiveDate)) {
|
|
1920
|
+
this._init();
|
|
1921
|
+
if (this.adapter.isInNextMonth(prev, newActiveDate)) this._changeCalendarState("right");
|
|
1922
|
+
else this._changeCalendarState("left");
|
|
1923
|
+
} else if (!prev) {}
|
|
1924
|
+
});
|
|
1925
|
+
}
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
ngAfterContentInit() {
|
|
1929
|
+
this._init();
|
|
1930
|
+
}
|
|
1931
|
+
ngOnDestroy() {
|
|
1932
|
+
this._elementRef.nativeElement.removeEventListener("animationend", this._calendarAnimationListener);
|
|
1933
|
+
}
|
|
1934
|
+
monthSelected(month) {
|
|
1935
|
+
const currentDate = this.resolvedActiveDate();
|
|
1936
|
+
const normalizedDate = this.adapter.createDatetime(this.adapter.getYear(currentDate), month, 1, 0, 0);
|
|
1937
|
+
this.selectedChange.emit(this.adapter.createDatetime(this.adapter.getYear(currentDate), month, Math.min(this.adapter.getDate(currentDate), this.adapter.getNumDaysInMonth(normalizedDate)), this.adapter.getHour(currentDate), this.adapter.getMinute(currentDate)));
|
|
1938
|
+
if (this.type() === "month") this.userSelection.emit();
|
|
1939
|
+
}
|
|
1940
|
+
calendarStateDone(event) {
|
|
1941
|
+
if (event.animationName === "slideCalendarLeft" || event.animationName === "slideCalendarRight") this.calendarState.set("");
|
|
1942
|
+
}
|
|
1943
|
+
_init() {
|
|
1944
|
+
const selectedValue = this.selected();
|
|
1945
|
+
this.selectedMonth.set(this._getMonthInCurrentYear(selectedValue));
|
|
1946
|
+
this.todayMonth.set(this._getMonthInCurrentYear(this.adapter.today()));
|
|
1947
|
+
this.yearLabel.set(this.adapter.getYearName(this.resolvedActiveDate()));
|
|
1948
|
+
const monthNames = this.adapter.getMonthNames("short");
|
|
1949
|
+
const monthsList = [[
|
|
1950
|
+
0,
|
|
1951
|
+
1,
|
|
1952
|
+
2,
|
|
1953
|
+
3,
|
|
1954
|
+
4
|
|
1955
|
+
], [
|
|
1956
|
+
5,
|
|
1957
|
+
6,
|
|
1958
|
+
7,
|
|
1959
|
+
8,
|
|
1960
|
+
9,
|
|
1961
|
+
10,
|
|
1962
|
+
11
|
|
1963
|
+
]].map((row) => row.map((month) => this._createCellForMonth(month, monthNames[month])));
|
|
1964
|
+
this.months.set(monthsList);
|
|
1965
|
+
}
|
|
1966
|
+
_getMonthInCurrentYear(date) {
|
|
1967
|
+
if (!date) return null;
|
|
1968
|
+
return this.adapter.sameYear(date, this.resolvedActiveDate()) ? this.adapter.getMonth(date) : null;
|
|
1969
|
+
}
|
|
1970
|
+
_createCellForMonth(month, monthName) {
|
|
1971
|
+
const currentDate = this.resolvedActiveDate();
|
|
1972
|
+
const ariaLabel = this.adapter.format(this.adapter.createDatetime(this.adapter.getYear(currentDate), month, 1, this.adapter.getHour(currentDate), this.adapter.getMinute(currentDate)), this._dateFormats.display.monthYearA11yLabel);
|
|
1973
|
+
return new CmatDatetimepickerCalendarCellComponent(month, monthName.toLocaleUpperCase(), ariaLabel, this._isMonthEnabled(month));
|
|
1974
|
+
}
|
|
1975
|
+
_isMonthEnabled(month) {
|
|
1976
|
+
const dateFilter = this.dateFilter();
|
|
1977
|
+
if (!dateFilter) return true;
|
|
1978
|
+
const currentDate = this.resolvedActiveDate();
|
|
1979
|
+
const firstOfMonth = this.adapter.createDatetime(this.adapter.getYear(currentDate), month, 1, this.adapter.getHour(currentDate), this.adapter.getMinute(currentDate));
|
|
1980
|
+
for (let date = firstOfMonth; this.adapter.getMonth(date) === month; date = this.adapter.addCalendarDays(date, 1)) if (dateFilter(date)) return true;
|
|
1981
|
+
return false;
|
|
1982
|
+
}
|
|
1983
|
+
_changeCalendarState(direction) {
|
|
1984
|
+
this.calendarState.set(direction);
|
|
1985
|
+
}
|
|
1986
|
+
static {
|
|
1987
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1988
|
+
minVersion: "12.0.0",
|
|
1989
|
+
version: "22.3.0",
|
|
1990
|
+
ngImport: i0,
|
|
1991
|
+
type: CmatDatetimepickerYearViewComponent,
|
|
1992
|
+
deps: [],
|
|
1993
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
static {
|
|
1997
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1998
|
+
minVersion: "17.1.0",
|
|
1999
|
+
version: "22.3.0",
|
|
2000
|
+
type: CmatDatetimepickerYearViewComponent,
|
|
2001
|
+
isStandalone: true,
|
|
2002
|
+
selector: "cmat-datetimepicker-year-view",
|
|
2003
|
+
inputs: {
|
|
2004
|
+
type: {
|
|
2005
|
+
classPropertyName: "type",
|
|
2006
|
+
publicName: "type",
|
|
2007
|
+
isSignal: true,
|
|
2008
|
+
isRequired: false,
|
|
2009
|
+
transformFunction: null
|
|
2010
|
+
},
|
|
2011
|
+
dateFilter: {
|
|
2012
|
+
classPropertyName: "dateFilter",
|
|
2013
|
+
publicName: "dateFilter",
|
|
2014
|
+
isSignal: true,
|
|
2015
|
+
isRequired: false,
|
|
2016
|
+
transformFunction: null
|
|
2017
|
+
},
|
|
2018
|
+
minDate: {
|
|
2019
|
+
classPropertyName: "minDate",
|
|
2020
|
+
publicName: "minDate",
|
|
2021
|
+
isSignal: true,
|
|
2022
|
+
isRequired: false,
|
|
2023
|
+
transformFunction: null
|
|
2024
|
+
},
|
|
2025
|
+
maxDate: {
|
|
2026
|
+
classPropertyName: "maxDate",
|
|
2027
|
+
publicName: "maxDate",
|
|
2028
|
+
isSignal: true,
|
|
2029
|
+
isRequired: false,
|
|
2030
|
+
transformFunction: null
|
|
2031
|
+
},
|
|
2032
|
+
selected: {
|
|
2033
|
+
classPropertyName: "selected",
|
|
2034
|
+
publicName: "selected",
|
|
2035
|
+
isSignal: true,
|
|
2036
|
+
isRequired: false,
|
|
2037
|
+
transformFunction: null
|
|
2038
|
+
},
|
|
2039
|
+
activeDate: {
|
|
2040
|
+
classPropertyName: "activeDate",
|
|
2041
|
+
publicName: "activeDate",
|
|
2042
|
+
isSignal: true,
|
|
2043
|
+
isRequired: true,
|
|
2044
|
+
transformFunction: null
|
|
2045
|
+
}
|
|
2046
|
+
},
|
|
2047
|
+
outputs: {
|
|
2048
|
+
userSelection: "userSelection",
|
|
2049
|
+
selectedChange: "selectedChange"
|
|
2050
|
+
},
|
|
2051
|
+
exportAs: ["cmatDatetimepickerYearView"],
|
|
2052
|
+
ngImport: i0,
|
|
2053
|
+
template: "<table class=\"cmat-datetimepicker-calendar-table\">\r\n <thead class=\"cmat-datetimepicker-calendar-table-header\"></thead>\r\n <tbody class=\"cmat-calendar-slide-animation\" cmat-datetimepicker-calendar-body role=\"grid\"\r\n [ngClass]=\"{\r\n 'left': calendarState()==='left',\r\n 'right': calendarState()==='right'\r\n }\" [activeCell]=\"adapter.getMonth(activeDate())\" [labelMinRequiredCells]=\"2\"\r\n [label]=\"yearLabel()\" [rows]=\"months()\" [selectedValue]=\"selectedMonth()\" [todayValue]=\"todayMonth()\"\r\n [allowDisabledSelection]=\"true\" (selectedValueChange)=\"monthSelected($event)\"></tbody>\r\n</table>\r\n",
|
|
2054
|
+
styles: [".cmat-calendar-slide-animation.left{animation:slideCalendarLeft .18s}.cmat-calendar-slide-animation.right{animation:slideCalendarRight .18s}@keyframes slideCalendarLeft{0%,50%{transform:translate(100%)}51%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideCalendarRight{0%,50%{transform:translate(-100%)}51%{transform:translate(100%)}to{transform:translate(0)}}\n"],
|
|
2055
|
+
dependencies: [{
|
|
2056
|
+
kind: "component",
|
|
2057
|
+
type: CmatDatetimepickerCalendarBodyComponent,
|
|
2058
|
+
selector: "[cmat-datetimepicker-calendar-body]",
|
|
2059
|
+
inputs: [
|
|
2060
|
+
"label",
|
|
2061
|
+
"rows",
|
|
2062
|
+
"todayValue",
|
|
2063
|
+
"selectedValue",
|
|
2064
|
+
"labelMinRequiredCells",
|
|
2065
|
+
"numCols",
|
|
2066
|
+
"allowDisabledSelection",
|
|
2067
|
+
"activeCell"
|
|
2068
|
+
],
|
|
2069
|
+
outputs: ["selectedValueChange"],
|
|
2070
|
+
exportAs: ["cmatDatetimepickerCalendarBody"]
|
|
2071
|
+
}, {
|
|
2072
|
+
kind: "directive",
|
|
2073
|
+
type: NgClass,
|
|
2074
|
+
selector: "[ngClass]",
|
|
2075
|
+
inputs: ["class", "ngClass"]
|
|
2076
|
+
}],
|
|
2077
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2078
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
2079
|
+
});
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2082
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2083
|
+
minVersion: "12.0.0",
|
|
2084
|
+
version: "22.3.0",
|
|
2085
|
+
ngImport: i0,
|
|
2086
|
+
type: CmatDatetimepickerYearViewComponent,
|
|
2087
|
+
decorators: [{
|
|
2088
|
+
type: Component,
|
|
2089
|
+
args: [{
|
|
2090
|
+
selector: "cmat-datetimepicker-year-view",
|
|
2091
|
+
encapsulation: ViewEncapsulation.None,
|
|
2092
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2093
|
+
exportAs: "cmatDatetimepickerYearView",
|
|
2094
|
+
imports: [CmatDatetimepickerCalendarBodyComponent, NgClass],
|
|
2095
|
+
template: "<table class=\"cmat-datetimepicker-calendar-table\">\r\n <thead class=\"cmat-datetimepicker-calendar-table-header\"></thead>\r\n <tbody class=\"cmat-calendar-slide-animation\" cmat-datetimepicker-calendar-body role=\"grid\"\r\n [ngClass]=\"{\r\n 'left': calendarState()==='left',\r\n 'right': calendarState()==='right'\r\n }\" [activeCell]=\"adapter.getMonth(activeDate())\" [labelMinRequiredCells]=\"2\"\r\n [label]=\"yearLabel()\" [rows]=\"months()\" [selectedValue]=\"selectedMonth()\" [todayValue]=\"todayMonth()\"\r\n [allowDisabledSelection]=\"true\" (selectedValueChange)=\"monthSelected($event)\"></tbody>\r\n</table>\r\n",
|
|
2096
|
+
styles: [".cmat-calendar-slide-animation.left{animation:slideCalendarLeft .18s}.cmat-calendar-slide-animation.right{animation:slideCalendarRight .18s}@keyframes slideCalendarLeft{0%,50%{transform:translate(100%)}51%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideCalendarRight{0%,50%{transform:translate(-100%)}51%{transform:translate(100%)}to{transform:translate(0)}}\n"]
|
|
2097
|
+
}]
|
|
2098
|
+
}],
|
|
2099
|
+
ctorParameters: () => [],
|
|
2100
|
+
propDecorators: {
|
|
2101
|
+
userSelection: [{
|
|
2102
|
+
type: i0.Output,
|
|
2103
|
+
args: ["userSelection"]
|
|
2104
|
+
}],
|
|
2105
|
+
selectedChange: [{
|
|
2106
|
+
type: i0.Output,
|
|
2107
|
+
args: ["selectedChange"]
|
|
2108
|
+
}],
|
|
2109
|
+
type: [{
|
|
2110
|
+
type: i0.Input,
|
|
2111
|
+
args: [{
|
|
2112
|
+
isSignal: true,
|
|
2113
|
+
alias: "type",
|
|
2114
|
+
required: false
|
|
2115
|
+
}]
|
|
2116
|
+
}],
|
|
2117
|
+
dateFilter: [{
|
|
2118
|
+
type: i0.Input,
|
|
2119
|
+
args: [{
|
|
2120
|
+
isSignal: true,
|
|
2121
|
+
alias: "dateFilter",
|
|
2122
|
+
required: false
|
|
2123
|
+
}]
|
|
2124
|
+
}],
|
|
2125
|
+
minDate: [{
|
|
2126
|
+
type: i0.Input,
|
|
2127
|
+
args: [{
|
|
2128
|
+
isSignal: true,
|
|
2129
|
+
alias: "minDate",
|
|
2130
|
+
required: false
|
|
2131
|
+
}]
|
|
2132
|
+
}],
|
|
2133
|
+
maxDate: [{
|
|
2134
|
+
type: i0.Input,
|
|
2135
|
+
args: [{
|
|
2136
|
+
isSignal: true,
|
|
2137
|
+
alias: "maxDate",
|
|
2138
|
+
required: false
|
|
2139
|
+
}]
|
|
2140
|
+
}],
|
|
2141
|
+
selected: [{
|
|
2142
|
+
type: i0.Input,
|
|
2143
|
+
args: [{
|
|
2144
|
+
isSignal: true,
|
|
2145
|
+
alias: "selected",
|
|
2146
|
+
required: false
|
|
2147
|
+
}]
|
|
2148
|
+
}],
|
|
2149
|
+
activeDate: [{
|
|
2150
|
+
type: i0.Input,
|
|
2151
|
+
args: [{
|
|
2152
|
+
isSignal: true,
|
|
2153
|
+
alias: "activeDate",
|
|
2154
|
+
required: true
|
|
2155
|
+
}]
|
|
2156
|
+
}]
|
|
2157
|
+
}
|
|
2158
|
+
});
|
|
2159
|
+
var CmatDatetimepickerCalendarComponent = class CmatDatetimepickerCalendarComponent {
|
|
2160
|
+
setCurrentView(view) {
|
|
2161
|
+
this._currentView.set(view);
|
|
2162
|
+
this.viewChanged.emit(view);
|
|
2163
|
+
}
|
|
2164
|
+
getCurrentView() {
|
|
2165
|
+
return this._currentView();
|
|
2166
|
+
}
|
|
2167
|
+
constructor() {
|
|
2168
|
+
this.userSelection = output();
|
|
2169
|
+
this.selectedChange = output();
|
|
2170
|
+
this.viewChanged = output();
|
|
2171
|
+
this.startView = input("month", ...ngDevMode ? [{ debugName: "startView" }] : /* istanbul ignore next */ []);
|
|
2172
|
+
this.twelvehour = input(false, ...ngDevMode ? [{ debugName: "twelvehour" }] : /* istanbul ignore next */ []);
|
|
2173
|
+
this.timeInterval = input(1, ...ngDevMode ? [{ debugName: "timeInterval" }] : /* istanbul ignore next */ []);
|
|
2174
|
+
this.type = input("date", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
2175
|
+
this.multiYearSelector = model(false, ...ngDevMode ? [{ debugName: "multiYearSelector" }] : /* istanbul ignore next */ []);
|
|
2176
|
+
this.timeInput = input(false, {
|
|
2177
|
+
...ngDevMode ? { debugName: "timeInput" } : /* istanbul ignore next */ {},
|
|
2178
|
+
transform: coerceBooleanProperty
|
|
2179
|
+
});
|
|
2180
|
+
this.dateFilter = input(...ngDevMode ? [void 0, { debugName: "dateFilter" }] : /* istanbul ignore next */ []);
|
|
2181
|
+
this.preventSameDateTimeSelection = input(false, ...ngDevMode ? [{ debugName: "preventSameDateTimeSelection" }] : /* istanbul ignore next */ []);
|
|
2182
|
+
this.minDate = input(null, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
|
|
2183
|
+
this.maxDate = input(null, ...ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []);
|
|
2184
|
+
this.selected = input(null, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
2185
|
+
this.startAt = input(null, ...ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []);
|
|
2186
|
+
this.AMPM = signal("AM", ...ngDevMode ? [{ debugName: "AMPM" }] : /* istanbul ignore next */ []);
|
|
2187
|
+
this.clockView = signal("hour", ...ngDevMode ? [{ debugName: "clockView" }] : /* istanbul ignore next */ []);
|
|
2188
|
+
this.calendarState = signal("", ...ngDevMode ? [{ debugName: "calendarState" }] : /* istanbul ignore next */ []);
|
|
2189
|
+
this.intlVersion = signal(0, ...ngDevMode ? [{ debugName: "intlVersion" }] : /* istanbul ignore next */ []);
|
|
2190
|
+
this._elementRef = inject(ElementRef);
|
|
2191
|
+
this._intl = inject(CmatDatetimepickerIntl);
|
|
2192
|
+
this._adapter = inject(DatetimeAdapter, { optional: true });
|
|
2193
|
+
this._dateFormats = inject(CMAT_DATETIME_FORMATS, { optional: true });
|
|
2194
|
+
this._destroyRef = inject(DestroyRef);
|
|
2195
|
+
this._currentView = signal("month", ...ngDevMode ? [{ debugName: "_currentView" }] : /* istanbul ignore next */ []);
|
|
2196
|
+
this._clampedActiveDate = signal(null, ...ngDevMode ? [{ debugName: "_clampedActiveDate" }] : /* istanbul ignore next */ []);
|
|
2197
|
+
this.currentView = computed(() => this._currentView(), ...ngDevMode ? [{ debugName: "currentView" }] : /* istanbul ignore next */ []);
|
|
2198
|
+
this.activeDate = computed(() => {
|
|
2199
|
+
const activeDate = this._clampedActiveDate();
|
|
2200
|
+
if (!activeDate) return this._adapter.today();
|
|
2201
|
+
return this._adapter.clampDate(activeDate, this.minDate(), this.maxDate());
|
|
2202
|
+
}, ...ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []);
|
|
2203
|
+
this.dateFilterForViews = (date) => {
|
|
2204
|
+
const dateFilter = this.dateFilter();
|
|
2205
|
+
const minDateVal = this.minDate();
|
|
2206
|
+
const maxDateVal = this.maxDate();
|
|
2207
|
+
return !!date && (!dateFilter || dateFilter(date, CmatDatetimepickerFilterType.DATE)) && (!minDateVal || this._adapter.compareDate(date, minDateVal) >= 0) && (!maxDateVal || this._adapter.compareDate(date, maxDateVal) <= 0);
|
|
2208
|
+
};
|
|
2209
|
+
this._calendarAnimationListener = this.calendarStateDone.bind(this);
|
|
2210
|
+
if (!this._adapter) throw createMissingDateImplError("CDatetimeAdapter");
|
|
2211
|
+
if (!this._dateFormats) throw createMissingDateImplError("CMAT_DATETIME_FORMATS");
|
|
2212
|
+
this._intl.changes.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => this.intlVersion.update((value) => value + 1));
|
|
2213
|
+
this._elementRef.nativeElement.addEventListener("animationend", this._calendarAnimationListener);
|
|
2214
|
+
this._keydownListener = this.handleCalendarBodyKeydown.bind(this);
|
|
2215
|
+
this._elementRef.nativeElement.addEventListener("keydown", this._keydownListener);
|
|
2216
|
+
effect(() => {
|
|
2217
|
+
if (this.type() === "year") this.multiYearSelector.set(true);
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
2220
|
+
get yearButtonText() {
|
|
2221
|
+
return this._adapter.getYearName(this.activeDate());
|
|
2222
|
+
}
|
|
2223
|
+
get yearPeriodText() {
|
|
2224
|
+
if (this.getCurrentView() === "multi-year") {
|
|
2225
|
+
const minYearOfPage = this._adapter.getYear(this.activeDate()) - getActiveOffset(this._adapter, this.activeDate(), this.minDate(), this.maxDate());
|
|
2226
|
+
const maxYearOfPage = minYearOfPage + 24 - 1;
|
|
2227
|
+
const minYearName = this._adapter.getYearName(this._adapter.createDate(minYearOfPage, 0, 1));
|
|
2228
|
+
const maxYearName = this._adapter.getYearName(this._adapter.createDate(maxYearOfPage, 0, 1));
|
|
2229
|
+
return this._intl.formatYearRange(minYearName, maxYearName);
|
|
2230
|
+
}
|
|
2231
|
+
return this.getCurrentView() === "month" ? this._adapter.getMonthNames("long")[this._adapter.getMonth(this.activeDate())] : this._adapter.getYearName(this.activeDate());
|
|
2232
|
+
}
|
|
2233
|
+
get yearButtonLabel() {
|
|
2234
|
+
return this.multiYearSelector() ? this._intl.switchToMultiYearViewLabel : this._intl.switchToYearViewLabel;
|
|
2235
|
+
}
|
|
2236
|
+
get dateButtonText() {
|
|
2237
|
+
switch (this.type()) {
|
|
2238
|
+
case "month": return this._adapter.getMonthNames("long")[this._adapter.getMonth(this.activeDate())];
|
|
2239
|
+
default: return this._adapter.format(this.activeDate(), this._dateFormats.display.popupHeaderDateLabel);
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
get dateButtonLabel() {
|
|
2243
|
+
return this._intl.switchToMonthViewLabel;
|
|
2244
|
+
}
|
|
2245
|
+
get hoursButtonText() {
|
|
2246
|
+
let hour = this._adapter.getHour(this.activeDate());
|
|
2247
|
+
if (this.twelvehour()) {
|
|
2248
|
+
if (hour === 0) hour = 24;
|
|
2249
|
+
hour = hour > 12 ? hour - 12 : hour;
|
|
2250
|
+
}
|
|
2251
|
+
return this._2digit(hour);
|
|
2252
|
+
}
|
|
2253
|
+
get hourButtonLabel() {
|
|
2254
|
+
return this._intl.switchToClockHourViewLabel;
|
|
2255
|
+
}
|
|
2256
|
+
get minutesButtonText() {
|
|
2257
|
+
return this._2digit(this._adapter.getMinute(this.activeDate()));
|
|
2258
|
+
}
|
|
2259
|
+
get minuteButtonLabel() {
|
|
2260
|
+
return this._intl.switchToClockMinuteViewLabel;
|
|
2261
|
+
}
|
|
2262
|
+
get prevButtonLabel() {
|
|
2263
|
+
switch (this._currentView()) {
|
|
2264
|
+
case "month": return this._intl.prevMonthLabel;
|
|
2265
|
+
case "year": return this._intl.nextYearLabel;
|
|
2266
|
+
case "multi-year": return this._intl.prevMultiYearLabel;
|
|
2267
|
+
default: return "";
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
get nextButtonLabel() {
|
|
2271
|
+
switch (this._currentView()) {
|
|
2272
|
+
case "month": return this._intl.nextMonthLabel;
|
|
2273
|
+
case "year": return this._intl.nextYearLabel;
|
|
2274
|
+
case "multi-year": return this._intl.nextMultiYearLabel;
|
|
2275
|
+
default: return "";
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
handleCalendarBodyKeydown(event) {
|
|
2279
|
+
if (this.getCurrentView() === "month") this._handleCalendarBodyKeydownInMonthView(event);
|
|
2280
|
+
else if (this.getCurrentView() === "year") this._handleCalendarBodyKeydownInYearView(event);
|
|
2281
|
+
else if (this.getCurrentView() === "multi-year") this._handleCalendarBodyKeydownInMultiYearView(event);
|
|
2282
|
+
else this._handleCalendarBodyKeydownInClockView(event);
|
|
2283
|
+
}
|
|
2284
|
+
userSelected() {
|
|
2285
|
+
this.userSelection.emit();
|
|
2286
|
+
}
|
|
2287
|
+
ngAfterContentInit() {
|
|
2288
|
+
const initialDate = this.startAt() ?? this._adapter.today();
|
|
2289
|
+
this._clampedActiveDate.set(initialDate);
|
|
2290
|
+
this.selectAMPM(this.activeDate());
|
|
2291
|
+
this.focusActiveCell();
|
|
2292
|
+
if (this.type() === "year") this.setCurrentView("multi-year");
|
|
2293
|
+
else if (this.type() === "month") this.setCurrentView("year");
|
|
2294
|
+
else if (this.type() === "time") this.setCurrentView("clock");
|
|
2295
|
+
else this.setCurrentView(this.startView() || "month");
|
|
2296
|
+
}
|
|
2297
|
+
ngOnDestroy() {
|
|
2298
|
+
this._elementRef.nativeElement.removeEventListener("animationend", this._calendarAnimationListener);
|
|
2299
|
+
this._elementRef.nativeElement.removeEventListener("keydown", this._keydownListener);
|
|
2300
|
+
}
|
|
2301
|
+
dateSelected(date) {
|
|
2302
|
+
if (this.type() === "date") {
|
|
2303
|
+
const selectedValue = this.selected();
|
|
2304
|
+
if (!this._adapter.sameDate(date, selectedValue) || !this.preventSameDateTimeSelection()) this.selectedChange.emit(date);
|
|
2305
|
+
} else {
|
|
2306
|
+
this._clampedActiveDate.set(date);
|
|
2307
|
+
this.setCurrentView("clock");
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
monthSelected(month) {
|
|
2311
|
+
if (this.type() === "month") {
|
|
2312
|
+
const selectedValue = this.selected();
|
|
2313
|
+
if (!this._adapter.sameMonthAndYear(month, selectedValue) || !this.preventSameDateTimeSelection()) this.selectedChange.emit(this._adapter.getFirstDateOfMonth(month));
|
|
2314
|
+
} else {
|
|
2315
|
+
this._clampedActiveDate.set(month);
|
|
2316
|
+
this.setCurrentView("month");
|
|
2317
|
+
this.clockView.set("hour");
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
yearSelected(year) {
|
|
2321
|
+
if (this.type() === "year") {
|
|
2322
|
+
const selectedValue = this.selected();
|
|
2323
|
+
if (selectedValue && !this._adapter.sameYear(year, selectedValue) || !this.preventSameDateTimeSelection()) {
|
|
2324
|
+
const normalizedDate = this._adapter.createDatetime(this._adapter.getYear(year), 0, 1, 0, 0);
|
|
2325
|
+
this.selectedChange.emit(normalizedDate);
|
|
2326
|
+
}
|
|
2327
|
+
} else {
|
|
2328
|
+
this._clampedActiveDate.set(year);
|
|
2329
|
+
this.setCurrentView("year");
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
timeSelected(date) {
|
|
2333
|
+
this._clampedActiveDate.set(this.updateDate(date));
|
|
2334
|
+
const selectedValue = this.selected();
|
|
2335
|
+
if (!this._adapter.sameDatetime(date, selectedValue) || !this.preventSameDateTimeSelection()) this.selectedChange.emit(date);
|
|
2336
|
+
}
|
|
2337
|
+
dialTimeSelected(date) {
|
|
2338
|
+
if (this.clockView() !== "minute") {
|
|
2339
|
+
this._clampedActiveDate.set(this.updateDate(date));
|
|
2340
|
+
this.clockView.set("minute");
|
|
2341
|
+
} else {
|
|
2342
|
+
const selectedValue = this.selected();
|
|
2343
|
+
if (!this._adapter.sameDatetime(date, selectedValue) || !this.preventSameDateTimeSelection()) this.selectedChange.emit(date);
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
onActiveDateChange(date) {
|
|
2347
|
+
this._clampedActiveDate.set(date);
|
|
2348
|
+
}
|
|
2349
|
+
updateDate(date) {
|
|
2350
|
+
if (this.twelvehour()) {
|
|
2351
|
+
if (this._adapter.getHour(date) === 12) {
|
|
2352
|
+
if (this.AMPM() === "AM") return this._adapter.addCalendarHours(date, -12);
|
|
2353
|
+
} else if (this.AMPM() === "PM") return this._adapter.addCalendarHours(date, 12);
|
|
2354
|
+
}
|
|
2355
|
+
return date;
|
|
2356
|
+
}
|
|
2357
|
+
selectAMPM(date) {
|
|
2358
|
+
if (this._adapter.getHour(date) > 11) this.AMPM.set("PM");
|
|
2359
|
+
else this.AMPM.set("AM");
|
|
2360
|
+
}
|
|
2361
|
+
ampmClicked(source) {
|
|
2362
|
+
this._currentView.set("clock");
|
|
2363
|
+
if (source === this.AMPM()) return;
|
|
2364
|
+
this.AMPM.set(source);
|
|
2365
|
+
const currentHour = this._adapter.getHour(this.activeDate());
|
|
2366
|
+
let newHourValue;
|
|
2367
|
+
if (this.AMPM() === "AM") newHourValue = currentHour >= 12 ? this._adapter.getHour(this.activeDate()) - 12 : 12;
|
|
2368
|
+
else newHourValue = (currentHour + 12) % 24;
|
|
2369
|
+
this._clampedActiveDate.set(this._adapter.createDatetime(this._adapter.getYear(this.activeDate()), this._adapter.getMonth(this.activeDate()), this._adapter.getDate(this.activeDate()), newHourValue, this._adapter.getMinute(this.activeDate())));
|
|
2370
|
+
}
|
|
2371
|
+
yearClicked() {
|
|
2372
|
+
if (this.type() === "year" || this.multiYearSelector()) {
|
|
2373
|
+
this.setCurrentView("multi-year");
|
|
2374
|
+
return;
|
|
2375
|
+
}
|
|
2376
|
+
this.setCurrentView("year");
|
|
2377
|
+
}
|
|
2378
|
+
dateClicked() {
|
|
2379
|
+
if (this.type() !== "month") this.setCurrentView("month");
|
|
2380
|
+
}
|
|
2381
|
+
hoursClicked() {
|
|
2382
|
+
this.setCurrentView("clock");
|
|
2383
|
+
this.clockView.set("hour");
|
|
2384
|
+
}
|
|
2385
|
+
minutesClicked() {
|
|
2386
|
+
this.setCurrentView("clock");
|
|
2387
|
+
this.clockView.set("minute");
|
|
2388
|
+
}
|
|
2389
|
+
previousClicked() {
|
|
2390
|
+
this._clampedActiveDate.set(this.getCurrentView() === "month" ? this._adapter.addCalendarMonths(this.activeDate(), -1) : this._adapter.addCalendarYears(this.activeDate(), this.getCurrentView() === "year" ? -1 : -24));
|
|
2391
|
+
}
|
|
2392
|
+
nextClicked() {
|
|
2393
|
+
this._clampedActiveDate.set(this.getCurrentView() === "month" ? this._adapter.addCalendarMonths(this.activeDate(), 1) : this._adapter.addCalendarYears(this.activeDate(), this.getCurrentView() === "year" ? 1 : 24));
|
|
2394
|
+
}
|
|
2395
|
+
previousEnabled() {
|
|
2396
|
+
const minDateVal = this.minDate();
|
|
2397
|
+
if (!minDateVal) return true;
|
|
2398
|
+
return !minDateVal || !this._isSameView(this.activeDate(), minDateVal);
|
|
2399
|
+
}
|
|
2400
|
+
nextEnabled() {
|
|
2401
|
+
const maxDateVal = this.maxDate();
|
|
2402
|
+
return !maxDateVal || !this._isSameView(this.activeDate(), maxDateVal);
|
|
2403
|
+
}
|
|
2404
|
+
focusActiveCell() {
|
|
2405
|
+
this._elementRef.nativeElement.focus();
|
|
2406
|
+
}
|
|
2407
|
+
calendarStateDone(event) {
|
|
2408
|
+
if (event.animationName === "slideCalendarLeft" || event.animationName === "slideCalendarRight") this.calendarState.set("");
|
|
2409
|
+
}
|
|
2410
|
+
_isSameView(date1, date2) {
|
|
2411
|
+
if (this.getCurrentView() === "month") return this._adapter.getYear(date1) === this._adapter.getYear(date2) && this._adapter.getMonth(date1) === this._adapter.getMonth(date2);
|
|
2412
|
+
if (this.getCurrentView() === "year") return this._adapter.getYear(date1) === this._adapter.getYear(date2);
|
|
2413
|
+
return isSameMultiYearView(this._adapter, date1, date2, this.minDate(), this.maxDate());
|
|
2414
|
+
}
|
|
2415
|
+
_handleCalendarBodyKeydownInMonthView(event) {
|
|
2416
|
+
switch (event.code) {
|
|
2417
|
+
case "ArrowLeft":
|
|
2418
|
+
this._clampedActiveDate.set(this._adapter.addCalendarDays(this.activeDate(), -1));
|
|
2419
|
+
break;
|
|
2420
|
+
case "ArrowRight":
|
|
2421
|
+
this._clampedActiveDate.set(this._adapter.addCalendarDays(this.activeDate(), 1));
|
|
2422
|
+
break;
|
|
2423
|
+
case "ArrowUp":
|
|
2424
|
+
this._clampedActiveDate.set(this._adapter.addCalendarDays(this.activeDate(), -7));
|
|
2425
|
+
break;
|
|
2426
|
+
case "ArrowDown":
|
|
2427
|
+
this._clampedActiveDate.set(this._adapter.addCalendarDays(this.activeDate(), 7));
|
|
2428
|
+
break;
|
|
2429
|
+
case "Home":
|
|
2430
|
+
this._clampedActiveDate.set(this._adapter.addCalendarDays(this.activeDate(), 1 - this._adapter.getDate(this.activeDate())));
|
|
2431
|
+
break;
|
|
2432
|
+
case "End":
|
|
2433
|
+
this._clampedActiveDate.set(this._adapter.addCalendarDays(this.activeDate(), this._adapter.getNumDaysInMonth(this.activeDate()) - this._adapter.getDate(this.activeDate())));
|
|
2434
|
+
break;
|
|
2435
|
+
case "PageUp":
|
|
2436
|
+
this._clampedActiveDate.set(event.altKey ? this._adapter.addCalendarYears(this.activeDate(), -1) : this._adapter.addCalendarMonths(this.activeDate(), -1));
|
|
2437
|
+
break;
|
|
2438
|
+
case "PageDown":
|
|
2439
|
+
this._clampedActiveDate.set(event.altKey ? this._adapter.addCalendarYears(this.activeDate(), 1) : this._adapter.addCalendarMonths(this.activeDate(), 1));
|
|
2440
|
+
break;
|
|
2441
|
+
case "Enter":
|
|
2442
|
+
if (this.dateFilterForViews(this.activeDate())) {
|
|
2443
|
+
this.dateSelected(this.activeDate());
|
|
2444
|
+
event.preventDefault();
|
|
2445
|
+
}
|
|
2446
|
+
return;
|
|
2447
|
+
default: return;
|
|
2448
|
+
}
|
|
2449
|
+
event.preventDefault();
|
|
2450
|
+
}
|
|
2451
|
+
_handleCalendarBodyKeydownInYearView(event) {
|
|
2452
|
+
switch (event.code) {
|
|
2453
|
+
case "ArrowLeft":
|
|
2454
|
+
this._clampedActiveDate.set(this._adapter.addCalendarMonths(this.activeDate(), -1));
|
|
2455
|
+
break;
|
|
2456
|
+
case "ArrowRight":
|
|
2457
|
+
this._clampedActiveDate.set(this._adapter.addCalendarMonths(this.activeDate(), 1));
|
|
2458
|
+
break;
|
|
2459
|
+
case "ArrowUp":
|
|
2460
|
+
this._clampedActiveDate.set(this._prevMonthInSameCol(this.activeDate()));
|
|
2461
|
+
break;
|
|
2462
|
+
case "ArrowDown":
|
|
2463
|
+
this._clampedActiveDate.set(this._nextMonthInSameCol(this.activeDate()));
|
|
2464
|
+
break;
|
|
2465
|
+
case "Home":
|
|
2466
|
+
this._clampedActiveDate.set(this._adapter.addCalendarMonths(this.activeDate(), -this._adapter.getMonth(this.activeDate())));
|
|
2467
|
+
break;
|
|
2468
|
+
case "End":
|
|
2469
|
+
this._clampedActiveDate.set(this._adapter.addCalendarMonths(this.activeDate(), 11 - this._adapter.getMonth(this.activeDate())));
|
|
2470
|
+
break;
|
|
2471
|
+
case "PageUp":
|
|
2472
|
+
this._clampedActiveDate.set(this._adapter.addCalendarYears(this.activeDate(), event.altKey ? -10 : -1));
|
|
2473
|
+
break;
|
|
2474
|
+
case "PageDown":
|
|
2475
|
+
this._clampedActiveDate.set(this._adapter.addCalendarYears(this.activeDate(), event.altKey ? 10 : 1));
|
|
2476
|
+
break;
|
|
2477
|
+
case "Enter":
|
|
2478
|
+
this.monthSelected(this.activeDate());
|
|
2479
|
+
break;
|
|
2480
|
+
default: return;
|
|
2481
|
+
}
|
|
2482
|
+
event.preventDefault();
|
|
2483
|
+
}
|
|
2484
|
+
_handleCalendarBodyKeydownInMultiYearView(event) {
|
|
2485
|
+
switch (event.code) {
|
|
2486
|
+
case "ArrowLeft":
|
|
2487
|
+
this._clampedActiveDate.set(this._adapter.addCalendarYears(this.activeDate(), -1));
|
|
2488
|
+
break;
|
|
2489
|
+
case "ArrowRight":
|
|
2490
|
+
this._clampedActiveDate.set(this._adapter.addCalendarYears(this.activeDate(), 1));
|
|
2491
|
+
break;
|
|
2492
|
+
case "ArrowUp":
|
|
2493
|
+
this._clampedActiveDate.set(this._adapter.addCalendarYears(this.activeDate(), -4));
|
|
2494
|
+
break;
|
|
2495
|
+
case "ArrowDown":
|
|
2496
|
+
this._clampedActiveDate.set(this._adapter.addCalendarYears(this.activeDate(), 4));
|
|
2497
|
+
break;
|
|
2498
|
+
case "Home":
|
|
2499
|
+
this._clampedActiveDate.set(this._adapter.addCalendarYears(this.activeDate(), -getActiveOffset(this._adapter, this.activeDate(), this.minDate(), this.maxDate())));
|
|
2500
|
+
break;
|
|
2501
|
+
case "End":
|
|
2502
|
+
this._clampedActiveDate.set(this._adapter.addCalendarYears(this.activeDate(), 24 - getActiveOffset(this._adapter, this.activeDate(), this.minDate(), this.maxDate()) - 1));
|
|
2503
|
+
break;
|
|
2504
|
+
case "PageUp":
|
|
2505
|
+
this._clampedActiveDate.set(this._adapter.addCalendarYears(this.activeDate(), event.altKey ? -240 : -24));
|
|
2506
|
+
break;
|
|
2507
|
+
case "PageDown":
|
|
2508
|
+
this._clampedActiveDate.set(this._adapter.addCalendarYears(this.activeDate(), event.altKey ? 240 : 24));
|
|
2509
|
+
break;
|
|
2510
|
+
case "Enter":
|
|
2511
|
+
this.yearSelected(this.activeDate());
|
|
2512
|
+
break;
|
|
2513
|
+
default: return;
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
_handleCalendarBodyKeydownInClockView(event) {
|
|
2517
|
+
switch (event.code) {
|
|
2518
|
+
case "ArrowUp":
|
|
2519
|
+
this._clampedActiveDate.set(this.clockView() === "hour" ? this._adapter.addCalendarHours(this.activeDate(), 1) : this._adapter.addCalendarMinutes(this.activeDate(), this.timeInterval()));
|
|
2520
|
+
this.selectAMPM(this.activeDate());
|
|
2521
|
+
break;
|
|
2522
|
+
case "ArrowDown":
|
|
2523
|
+
this._clampedActiveDate.set(this.clockView() === "hour" ? this._adapter.addCalendarHours(this.activeDate(), -1) : this._adapter.addCalendarMinutes(this.activeDate(), -this.timeInterval()));
|
|
2524
|
+
this.selectAMPM(this.activeDate());
|
|
2525
|
+
break;
|
|
2526
|
+
case "Enter":
|
|
2527
|
+
if (!this.timeInput()) this.dialTimeSelected(this.activeDate());
|
|
2528
|
+
return;
|
|
2529
|
+
default: return;
|
|
2530
|
+
}
|
|
2531
|
+
event.preventDefault();
|
|
2532
|
+
}
|
|
2533
|
+
_prevMonthInSameCol(date) {
|
|
2534
|
+
const increment = this._adapter.getMonth(date) <= 4 ? -5 : this._adapter.getMonth(date) >= 7 ? -7 : -12;
|
|
2535
|
+
return this._adapter.addCalendarMonths(date, increment);
|
|
2536
|
+
}
|
|
2537
|
+
_nextMonthInSameCol(date) {
|
|
2538
|
+
const increment = this._adapter.getMonth(date) <= 4 ? 7 : this._adapter.getMonth(date) >= 7 ? 5 : 12;
|
|
2539
|
+
return this._adapter.addCalendarMonths(date, increment);
|
|
2540
|
+
}
|
|
2541
|
+
_changeCalendarState(direction) {
|
|
2542
|
+
this.calendarState.set(direction);
|
|
2543
|
+
}
|
|
2544
|
+
_2digit(n) {
|
|
2545
|
+
return ("00" + n).slice(-2);
|
|
2546
|
+
}
|
|
2547
|
+
static {
|
|
2548
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
2549
|
+
minVersion: "12.0.0",
|
|
2550
|
+
version: "22.3.0",
|
|
2551
|
+
ngImport: i0,
|
|
2552
|
+
type: CmatDatetimepickerCalendarComponent,
|
|
2553
|
+
deps: [],
|
|
2554
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2555
|
+
});
|
|
2556
|
+
}
|
|
2557
|
+
static {
|
|
2558
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2559
|
+
minVersion: "17.0.0",
|
|
2560
|
+
version: "22.3.0",
|
|
2561
|
+
type: CmatDatetimepickerCalendarComponent,
|
|
2562
|
+
isStandalone: true,
|
|
2563
|
+
selector: "cmat-datetimepicker-calendar",
|
|
2564
|
+
inputs: {
|
|
2565
|
+
startView: {
|
|
2566
|
+
classPropertyName: "startView",
|
|
2567
|
+
publicName: "startView",
|
|
2568
|
+
isSignal: true,
|
|
2569
|
+
isRequired: false,
|
|
2570
|
+
transformFunction: null
|
|
2571
|
+
},
|
|
2572
|
+
twelvehour: {
|
|
2573
|
+
classPropertyName: "twelvehour",
|
|
2574
|
+
publicName: "twelvehour",
|
|
2575
|
+
isSignal: true,
|
|
2576
|
+
isRequired: false,
|
|
2577
|
+
transformFunction: null
|
|
2578
|
+
},
|
|
2579
|
+
timeInterval: {
|
|
2580
|
+
classPropertyName: "timeInterval",
|
|
2581
|
+
publicName: "timeInterval",
|
|
2582
|
+
isSignal: true,
|
|
2583
|
+
isRequired: false,
|
|
2584
|
+
transformFunction: null
|
|
2585
|
+
},
|
|
2586
|
+
type: {
|
|
2587
|
+
classPropertyName: "type",
|
|
2588
|
+
publicName: "type",
|
|
2589
|
+
isSignal: true,
|
|
2590
|
+
isRequired: false,
|
|
2591
|
+
transformFunction: null
|
|
2592
|
+
},
|
|
2593
|
+
multiYearSelector: {
|
|
2594
|
+
classPropertyName: "multiYearSelector",
|
|
2595
|
+
publicName: "multiYearSelector",
|
|
2596
|
+
isSignal: true,
|
|
2597
|
+
isRequired: false,
|
|
2598
|
+
transformFunction: null
|
|
2599
|
+
},
|
|
2600
|
+
timeInput: {
|
|
2601
|
+
classPropertyName: "timeInput",
|
|
2602
|
+
publicName: "timeInput",
|
|
2603
|
+
isSignal: true,
|
|
2604
|
+
isRequired: false,
|
|
2605
|
+
transformFunction: null
|
|
2606
|
+
},
|
|
2607
|
+
dateFilter: {
|
|
2608
|
+
classPropertyName: "dateFilter",
|
|
2609
|
+
publicName: "dateFilter",
|
|
2610
|
+
isSignal: true,
|
|
2611
|
+
isRequired: false,
|
|
2612
|
+
transformFunction: null
|
|
2613
|
+
},
|
|
2614
|
+
preventSameDateTimeSelection: {
|
|
2615
|
+
classPropertyName: "preventSameDateTimeSelection",
|
|
2616
|
+
publicName: "preventSameDateTimeSelection",
|
|
2617
|
+
isSignal: true,
|
|
2618
|
+
isRequired: false,
|
|
2619
|
+
transformFunction: null
|
|
2620
|
+
},
|
|
2621
|
+
minDate: {
|
|
2622
|
+
classPropertyName: "minDate",
|
|
2623
|
+
publicName: "minDate",
|
|
2624
|
+
isSignal: true,
|
|
2625
|
+
isRequired: false,
|
|
2626
|
+
transformFunction: null
|
|
2627
|
+
},
|
|
2628
|
+
maxDate: {
|
|
2629
|
+
classPropertyName: "maxDate",
|
|
2630
|
+
publicName: "maxDate",
|
|
2631
|
+
isSignal: true,
|
|
2632
|
+
isRequired: false,
|
|
2633
|
+
transformFunction: null
|
|
2634
|
+
},
|
|
2635
|
+
selected: {
|
|
2636
|
+
classPropertyName: "selected",
|
|
2637
|
+
publicName: "selected",
|
|
2638
|
+
isSignal: true,
|
|
2639
|
+
isRequired: false,
|
|
2640
|
+
transformFunction: null
|
|
2641
|
+
},
|
|
2642
|
+
startAt: {
|
|
2643
|
+
classPropertyName: "startAt",
|
|
2644
|
+
publicName: "startAt",
|
|
2645
|
+
isSignal: true,
|
|
2646
|
+
isRequired: false,
|
|
2647
|
+
transformFunction: null
|
|
2648
|
+
}
|
|
2649
|
+
},
|
|
2650
|
+
outputs: {
|
|
2651
|
+
userSelection: "userSelection",
|
|
2652
|
+
selectedChange: "selectedChange",
|
|
2653
|
+
viewChanged: "viewChanged",
|
|
2654
|
+
multiYearSelector: "multiYearSelectorChange"
|
|
2655
|
+
},
|
|
2656
|
+
host: {
|
|
2657
|
+
attributes: {
|
|
2658
|
+
"role": "dialog",
|
|
2659
|
+
"tabindex": "0"
|
|
2660
|
+
},
|
|
2661
|
+
properties: {
|
|
2662
|
+
"attr.aria-label": "\"ariaLabel\"",
|
|
2663
|
+
"class.cmat-datetimepicker-calendar-with-time-input": "timeInput()"
|
|
2664
|
+
},
|
|
2665
|
+
classAttribute: "cmat-datetimepicker-calendar"
|
|
2666
|
+
},
|
|
2667
|
+
exportAs: ["cmatDatetimepickerCalendar"],
|
|
2668
|
+
ngImport: i0,
|
|
2669
|
+
template: "<div\r\n class=\"cmat-datetimepicker-calendar-header\"\r\n [attr.data-refresh]=\"intlVersion()\"\r\n>\r\n @if (type() !== 'time') {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-year header-button\"\r\n [class.active]=\"currentView() === 'year' || currentView() === 'multi-year'\"\r\n [attr.aria-label]=\"yearButtonLabel\"\r\n (click)=\"yearClicked()\"\r\n >\r\n <span class=\"font-medium\">{{ yearButtonText }}</span>\r\n @if (multiYearSelector() || type() === 'year') {\r\n <svg\r\n class=\"cmat-datetimepicker-calendar-header-year-dropdown\"\r\n width=\"24\"\r\n height=\"24\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"currentColor\"\r\n >\r\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\r\n </svg>\r\n }\r\n </div>\r\n } @if (type() !== 'year') {\r\n <div class=\"cmat-datetimepicker-calendar-header-date-time\">\r\n @if (type() !== 'time') {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-date header-button\"\r\n [class.active]=\"currentView() === 'month'\"\r\n [class.not-clickable]=\"type() === 'month'\"\r\n [attr.aria-label]=\"dateButtonLabel\"\r\n (click)=\"dateClicked()\"\r\n >\r\n {{ dateButtonText }}\r\n </div>\r\n } @if (type().endsWith('time')) {\r\n <span\r\n class=\"cmat-datetimepicker-calendar-header-time\"\r\n [class.active]=\"currentView() === 'clock'\"\r\n >\r\n <span\r\n class=\"cmat-datetimepicker-calendar-header-hour-minute-container flex place-items-center\"\r\n >\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-hours header-button\"\r\n [class.active]=\"clockView() === 'hour'\"\r\n [attr.aria-label]=\"hourButtonLabel\"\r\n (click)=\"hoursClicked()\"\r\n >\r\n {{ hoursButtonText }}\r\n </div>\r\n <span class=\"cmat-datetimepicker-calendar-header-hour-minute-separator\"\r\n >:</span\r\n >\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-minutes header-button\"\r\n [class.active]=\"clockView() === 'minute'\"\r\n [attr.aria-label]=\"minuteButtonLabel\"\r\n (click)=\"minutesClicked()\"\r\n >\r\n {{ minutesButtonText }}\r\n </div>\r\n </span>\r\n @if (twelvehour()) {\r\n <span\r\n class=\"cmat-datetimepicker-calendar-header-ampm-container flex place-items-center\"\r\n >\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-ampm header-button\"\r\n aria-label=\"AM\"\r\n [class.active]=\"AMPM() === 'AM'\"\r\n (click)=\"ampmClicked('AM')\"\r\n >\r\n AM\r\n </div>\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-ampm header-button\"\r\n aria-label=\"PM\"\r\n [class.active]=\"AMPM() === 'PM'\"\r\n (click)=\"ampmClicked('PM')\"\r\n >\r\n PM\r\n </div>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n<div\r\n class=\"cmat-datetimepicker-calendar-content\"\r\n [ngClass]=\"{'flex flex-col justify-center': currentView() === 'clock'}\"\r\n>\r\n @if (currentView() === 'month' || currentView() === 'year' || currentView() ===\r\n 'multi-year') {\r\n <div class=\"cmat-datetimepickermonth-content\">\r\n <div class=\"cmat-datetimepicker-calendar-controls\">\r\n <button\r\n matIconButton\r\n type=\"button\"\r\n class=\"cmat-datetimepicker-calendar-previous-button\"\r\n [class.disabled]=\"!previousEnabled()\"\r\n [attr.aria-disabled]=\"!previousEnabled()\"\r\n [attr.aria-label]=\"prevButtonLabel\"\r\n (click)=\"previousClicked()\"\r\n >\r\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\r\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\r\n </svg>\r\n </button>\r\n <div\r\n class=\"cmat-datetimepicker-calendar-period-button text-default font-medium cmat-calendar-slide-animation\"\r\n [ngClass]=\"{\r\n 'left': calendarState()==='left',\r\n 'right': calendarState()==='right'\r\n }\"\r\n >\r\n <strong>{{ yearPeriodText }}</strong>\r\n </div>\r\n <button\r\n type=\"button\"\r\n matIconButton\r\n class=\"cmat-datetimepicker-calendar-next-button\"\r\n [class.disabled]=\"!nextEnabled()\"\r\n [attr.aria-disabled]=\"!nextEnabled()\"\r\n [attr.aria-label]=\"nextButtonLabel\"\r\n (click)=\"nextClicked()\"\r\n >\r\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\r\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n } @switch (currentView()) { @case ('month') {\r\n <cmat-datetimepicker-month-view\r\n [activeDate]=\"activeDate()\"\r\n [dateFilter]=\"dateFilterForViews\"\r\n [selected]=\"selected()\"\r\n [type]=\"type()\"\r\n (userSelection)=\"userSelected()\"\r\n (selectedChange)=\"dateSelected($event)\"\r\n >\r\n </cmat-datetimepicker-month-view>\r\n } @case ('year') {\r\n <cmat-datetimepicker-year-view\r\n [activeDate]=\"activeDate()\"\r\n [dateFilter]=\"dateFilterForViews\"\r\n [selected]=\"selected()\"\r\n [type]=\"type()\"\r\n (userSelection)=\"userSelected()\"\r\n (selectedChange)=\"monthSelected($event)\"\r\n >\r\n </cmat-datetimepicker-year-view>\r\n } @case ('multi-year') {\r\n <cmat-datetimepicker-multi-year-view\r\n [activeDate]=\"activeDate()\"\r\n [dateFilter]=\"dateFilterForViews\"\r\n [maxDate]=\"maxDate()\"\r\n [minDate]=\"minDate()\"\r\n [selected]=\"selected()\"\r\n [type]=\"type()\"\r\n (userSelection)=\"userSelected()\"\r\n (selectedChange)=\"yearSelected($event)\"\r\n >\r\n </cmat-datetimepicker-multi-year-view>\r\n } @default { @if (timeInput()) {\r\n <cmat-datetimepicker-time\r\n [AMPM]=\"AMPM()\"\r\n [clockView]=\"clockView()\"\r\n [twelvehour]=\"twelvehour()\"\r\n [dateFilter]=\"dateFilter()\"\r\n [interval]=\"timeInterval()\"\r\n [maxDate]=\"maxDate()\"\r\n [minDate]=\"minDate()\"\r\n [selected]=\"activeDate()\"\r\n (userSelection)=\"userSelected()\"\r\n (activeDateChange)=\"onActiveDateChange($event)\"\r\n (selectedChange)=\"timeSelected($event)\"\r\n (ampmChange)=\"ampmClicked($event)\"\r\n (clockViewChange)=\"clockView.set($event)\"\r\n >\r\n </cmat-datetimepicker-time>\r\n } @else {\r\n <cmat-datetimepicker-clock\r\n [activeDate]=\"activeDate()\"\r\n [dateFilter]=\"dateFilter()\"\r\n [interval]=\"timeInterval()\"\r\n [maxDate]=\"maxDate()\"\r\n [minDate]=\"minDate()\"\r\n [selected]=\"activeDate()\"\r\n [startView]=\"clockView()\"\r\n [twelvehour]=\"twelvehour()\"\r\n (userSelection)=\"userSelected()\"\r\n (activeDateChange)=\"onActiveDateChange($event)\"\r\n (selectedChange)=\"dialTimeSelected($event)\"\r\n >\r\n </cmat-datetimepicker-clock>\r\n } } }\r\n</div>\r\n",
|
|
2670
|
+
styles: [".cmat-datetimepicker-calendar{display:block;outline:none}.cmat-datetimepicker-calendar-header{box-sizing:border-box;padding:8px;border-radius:4px 4px 0 0;min-width:264px}.cmat-datetimepicker-calendar-header .header-button{color:#fff!important;padding:0 4px;font-size:inherit;white-space:normal;word-break:break-word;font-weight:500;cursor:pointer}.cmat-datetimepicker-calendar-header-year.header-button{font-size:26px;line-height:24px;display:flex}.cmat-datetimepicker-calendar-header-date-time{font-size:24px;line-height:36px;display:flex;flex-direction:row}.cmat-datetimepicker-calendar-header-ampm:not(.active),.cmat-datetimepicker-calendar-header-date:not(.active),.cmat-datetimepicker-calendar-header-hours:not(.active),.cmat-datetimepicker-calendar-header-minutes:not(.active),.cmat-datetimepicker-calendar-header-time:not(.active),.cmat-datetimepicker-calendar-header-year:not(.active){opacity:.6}.cmat-datetimepicker-calendar-header-ampm.not-clickable,.cmat-datetimepicker-calendar-header-date.not-clickable,.cmat-datetimepicker-calendar-header-hours.not-clickable,.cmat-datetimepicker-calendar-header-minutes.not-clickable,.cmat-datetimepicker-calendar-header-year.not-clickable{cursor:auto}.cmat-datetimepicker-calendar-header-time{display:inline-flex}.cmat-datetimepicker-calendar-header-time:not(.active) :is(.cmat-datetimepicker-calendar-header-ampm,.cmat-datetimepicker-calendar-header-hours,.cmat-datetimepicker-calendar-header-minutes){opacity:1}.cmat-datetimepicker-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.cmat-datetimepicker-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px;font-size:12px}.cmat-datetimepicker-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.cmat-datetimepicker-calendar-controls{display:flex;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.cmat-datetimepicker-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:#0000;box-sizing:border-box}.cmat-datetimepicker-calendar-next-button.disabled,.cmat-datetimepicker-calendar-previous-button.disabled{pointer-events:none}.cmat-datetimepicker-calendar-next-button svg,.cmat-datetimepicker-calendar-previous-button svg{fill:currentColor;vertical-align:top}[dir=rtl] :is(.cmat-datetimepicker-calendar-next-button,.cmat-datetimepicker-calendar-previous-button) svg{transform:rotate(180deg)}.cmat-datetimepicker-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.cmat-datetimepicker-calendar-table-header th{text-align:center;padding:8px 0}\n", ".cmat-calendar-slide-animation.left{animation:slideCalendarLeft .18s}.cmat-calendar-slide-animation.right{animation:slideCalendarRight .18s}@keyframes slideCalendarLeft{0%,50%{transform:translate(100%)}51%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideCalendarRight{0%,50%{transform:translate(-100%)}51%{transform:translate(100%)}to{transform:translate(0)}}\n"],
|
|
2671
|
+
dependencies: [
|
|
2672
|
+
{
|
|
2673
|
+
kind: "ngmodule",
|
|
2674
|
+
type: MatButtonModule
|
|
2675
|
+
},
|
|
2676
|
+
{
|
|
2677
|
+
kind: "component",
|
|
2678
|
+
type: i1$1.MatIconButton,
|
|
2679
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
2680
|
+
exportAs: ["matButton", "matAnchor"]
|
|
2681
|
+
},
|
|
2682
|
+
{
|
|
2683
|
+
kind: "component",
|
|
2684
|
+
type: CmatDatetimepickerMonthViewComponent,
|
|
2685
|
+
selector: "cmat-datetimepicker-month-view",
|
|
2686
|
+
inputs: [
|
|
2687
|
+
"type",
|
|
2688
|
+
"dateFilter",
|
|
2689
|
+
"minDate",
|
|
2690
|
+
"maxDate",
|
|
2691
|
+
"selected",
|
|
2692
|
+
"activeDate"
|
|
2693
|
+
],
|
|
2694
|
+
outputs: ["userSelection", "selectedChange"],
|
|
2695
|
+
exportAs: ["cmatDatetimepickerMonthView"]
|
|
2696
|
+
},
|
|
2697
|
+
{
|
|
2698
|
+
kind: "component",
|
|
2699
|
+
type: CmatDatetimepickerYearViewComponent,
|
|
2700
|
+
selector: "cmat-datetimepicker-year-view",
|
|
2701
|
+
inputs: [
|
|
2702
|
+
"type",
|
|
2703
|
+
"dateFilter",
|
|
2704
|
+
"minDate",
|
|
2705
|
+
"maxDate",
|
|
2706
|
+
"selected",
|
|
2707
|
+
"activeDate"
|
|
2708
|
+
],
|
|
2709
|
+
outputs: ["userSelection", "selectedChange"],
|
|
2710
|
+
exportAs: ["cmatDatetimepickerYearView"]
|
|
2711
|
+
},
|
|
2712
|
+
{
|
|
2713
|
+
kind: "component",
|
|
2714
|
+
type: CmatDatetimepickerMultiYearViewComponent,
|
|
2715
|
+
selector: "cmat-datetimepicker-multi-year-view",
|
|
2716
|
+
inputs: [
|
|
2717
|
+
"type",
|
|
2718
|
+
"dateFilter",
|
|
2719
|
+
"minDate",
|
|
2720
|
+
"maxDate",
|
|
2721
|
+
"selected",
|
|
2722
|
+
"activeDate"
|
|
2723
|
+
],
|
|
2724
|
+
outputs: ["userSelection", "selectedChange"],
|
|
2725
|
+
exportAs: ["cmatDatetimepickerMultiYearView"]
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
kind: "component",
|
|
2729
|
+
type: CmatDatetimepickerTimeComponent,
|
|
2730
|
+
selector: "cmat-datetimepicker-time",
|
|
2731
|
+
inputs: [
|
|
2732
|
+
"dateFilter",
|
|
2733
|
+
"interval",
|
|
2734
|
+
"AMPM",
|
|
2735
|
+
"twelvehour",
|
|
2736
|
+
"minDate",
|
|
2737
|
+
"maxDate",
|
|
2738
|
+
"selected",
|
|
2739
|
+
"clockView"
|
|
2740
|
+
],
|
|
2741
|
+
outputs: [
|
|
2742
|
+
"selectedChange",
|
|
2743
|
+
"activeDateChange",
|
|
2744
|
+
"userSelection",
|
|
2745
|
+
"ampmChange",
|
|
2746
|
+
"clockViewChange"
|
|
2747
|
+
],
|
|
2748
|
+
exportAs: ["cmatDatetimepickerTime"]
|
|
2749
|
+
},
|
|
2750
|
+
{
|
|
2751
|
+
kind: "component",
|
|
2752
|
+
type: CmatDatetimepickerClockComponent,
|
|
2753
|
+
selector: "cmat-datetimepicker-clock",
|
|
2754
|
+
inputs: [
|
|
2755
|
+
"dateFilter",
|
|
2756
|
+
"interval",
|
|
2757
|
+
"twelvehour",
|
|
2758
|
+
"minDate",
|
|
2759
|
+
"maxDate",
|
|
2760
|
+
"selected",
|
|
2761
|
+
"startView",
|
|
2762
|
+
"activeDate"
|
|
2763
|
+
],
|
|
2764
|
+
outputs: [
|
|
2765
|
+
"userSelection",
|
|
2766
|
+
"selectedChange",
|
|
2767
|
+
"activeDateChange"
|
|
2768
|
+
],
|
|
2769
|
+
exportAs: ["cmatDatetimepickerClock"]
|
|
2770
|
+
},
|
|
2771
|
+
{
|
|
2772
|
+
kind: "directive",
|
|
2773
|
+
type: NgClass,
|
|
2774
|
+
selector: "[ngClass]",
|
|
2775
|
+
inputs: ["class", "ngClass"]
|
|
2776
|
+
}
|
|
2777
|
+
],
|
|
2778
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2779
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
};
|
|
2783
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2784
|
+
minVersion: "12.0.0",
|
|
2785
|
+
version: "22.3.0",
|
|
2786
|
+
ngImport: i0,
|
|
2787
|
+
type: CmatDatetimepickerCalendarComponent,
|
|
2788
|
+
decorators: [{
|
|
2789
|
+
type: Component,
|
|
2790
|
+
args: [{
|
|
2791
|
+
selector: "cmat-datetimepicker-calendar",
|
|
2792
|
+
host: {
|
|
2793
|
+
"class": "cmat-datetimepicker-calendar",
|
|
2794
|
+
"[attr.aria-label]": "\"ariaLabel\"",
|
|
2795
|
+
"role": "dialog",
|
|
2796
|
+
"tabindex": "0",
|
|
2797
|
+
"[class.cmat-datetimepicker-calendar-with-time-input]": "timeInput()"
|
|
2798
|
+
},
|
|
2799
|
+
encapsulation: ViewEncapsulation.None,
|
|
2800
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2801
|
+
exportAs: "cmatDatetimepickerCalendar",
|
|
2802
|
+
imports: [
|
|
2803
|
+
MatButtonModule,
|
|
2804
|
+
CmatDatetimepickerMonthViewComponent,
|
|
2805
|
+
CmatDatetimepickerYearViewComponent,
|
|
2806
|
+
CmatDatetimepickerMultiYearViewComponent,
|
|
2807
|
+
CmatDatetimepickerTimeComponent,
|
|
2808
|
+
CmatDatetimepickerClockComponent,
|
|
2809
|
+
NgClass
|
|
2810
|
+
],
|
|
2811
|
+
template: "<div\r\n class=\"cmat-datetimepicker-calendar-header\"\r\n [attr.data-refresh]=\"intlVersion()\"\r\n>\r\n @if (type() !== 'time') {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-year header-button\"\r\n [class.active]=\"currentView() === 'year' || currentView() === 'multi-year'\"\r\n [attr.aria-label]=\"yearButtonLabel\"\r\n (click)=\"yearClicked()\"\r\n >\r\n <span class=\"font-medium\">{{ yearButtonText }}</span>\r\n @if (multiYearSelector() || type() === 'year') {\r\n <svg\r\n class=\"cmat-datetimepicker-calendar-header-year-dropdown\"\r\n width=\"24\"\r\n height=\"24\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"currentColor\"\r\n >\r\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\r\n </svg>\r\n }\r\n </div>\r\n } @if (type() !== 'year') {\r\n <div class=\"cmat-datetimepicker-calendar-header-date-time\">\r\n @if (type() !== 'time') {\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-date header-button\"\r\n [class.active]=\"currentView() === 'month'\"\r\n [class.not-clickable]=\"type() === 'month'\"\r\n [attr.aria-label]=\"dateButtonLabel\"\r\n (click)=\"dateClicked()\"\r\n >\r\n {{ dateButtonText }}\r\n </div>\r\n } @if (type().endsWith('time')) {\r\n <span\r\n class=\"cmat-datetimepicker-calendar-header-time\"\r\n [class.active]=\"currentView() === 'clock'\"\r\n >\r\n <span\r\n class=\"cmat-datetimepicker-calendar-header-hour-minute-container flex place-items-center\"\r\n >\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-hours header-button\"\r\n [class.active]=\"clockView() === 'hour'\"\r\n [attr.aria-label]=\"hourButtonLabel\"\r\n (click)=\"hoursClicked()\"\r\n >\r\n {{ hoursButtonText }}\r\n </div>\r\n <span class=\"cmat-datetimepicker-calendar-header-hour-minute-separator\"\r\n >:</span\r\n >\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-minutes header-button\"\r\n [class.active]=\"clockView() === 'minute'\"\r\n [attr.aria-label]=\"minuteButtonLabel\"\r\n (click)=\"minutesClicked()\"\r\n >\r\n {{ minutesButtonText }}\r\n </div>\r\n </span>\r\n @if (twelvehour()) {\r\n <span\r\n class=\"cmat-datetimepicker-calendar-header-ampm-container flex place-items-center\"\r\n >\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-ampm header-button\"\r\n aria-label=\"AM\"\r\n [class.active]=\"AMPM() === 'AM'\"\r\n (click)=\"ampmClicked('AM')\"\r\n >\r\n AM\r\n </div>\r\n <div\r\n role=\"presentation\"\r\n class=\"cmat-datetimepicker-calendar-header-ampm header-button\"\r\n aria-label=\"PM\"\r\n [class.active]=\"AMPM() === 'PM'\"\r\n (click)=\"ampmClicked('PM')\"\r\n >\r\n PM\r\n </div>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n<div\r\n class=\"cmat-datetimepicker-calendar-content\"\r\n [ngClass]=\"{'flex flex-col justify-center': currentView() === 'clock'}\"\r\n>\r\n @if (currentView() === 'month' || currentView() === 'year' || currentView() ===\r\n 'multi-year') {\r\n <div class=\"cmat-datetimepickermonth-content\">\r\n <div class=\"cmat-datetimepicker-calendar-controls\">\r\n <button\r\n matIconButton\r\n type=\"button\"\r\n class=\"cmat-datetimepicker-calendar-previous-button\"\r\n [class.disabled]=\"!previousEnabled()\"\r\n [attr.aria-disabled]=\"!previousEnabled()\"\r\n [attr.aria-label]=\"prevButtonLabel\"\r\n (click)=\"previousClicked()\"\r\n >\r\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\r\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\r\n </svg>\r\n </button>\r\n <div\r\n class=\"cmat-datetimepicker-calendar-period-button text-default font-medium cmat-calendar-slide-animation\"\r\n [ngClass]=\"{\r\n 'left': calendarState()==='left',\r\n 'right': calendarState()==='right'\r\n }\"\r\n >\r\n <strong>{{ yearPeriodText }}</strong>\r\n </div>\r\n <button\r\n type=\"button\"\r\n matIconButton\r\n class=\"cmat-datetimepicker-calendar-next-button\"\r\n [class.disabled]=\"!nextEnabled()\"\r\n [attr.aria-disabled]=\"!nextEnabled()\"\r\n [attr.aria-label]=\"nextButtonLabel\"\r\n (click)=\"nextClicked()\"\r\n >\r\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\r\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n } @switch (currentView()) { @case ('month') {\r\n <cmat-datetimepicker-month-view\r\n [activeDate]=\"activeDate()\"\r\n [dateFilter]=\"dateFilterForViews\"\r\n [selected]=\"selected()\"\r\n [type]=\"type()\"\r\n (userSelection)=\"userSelected()\"\r\n (selectedChange)=\"dateSelected($event)\"\r\n >\r\n </cmat-datetimepicker-month-view>\r\n } @case ('year') {\r\n <cmat-datetimepicker-year-view\r\n [activeDate]=\"activeDate()\"\r\n [dateFilter]=\"dateFilterForViews\"\r\n [selected]=\"selected()\"\r\n [type]=\"type()\"\r\n (userSelection)=\"userSelected()\"\r\n (selectedChange)=\"monthSelected($event)\"\r\n >\r\n </cmat-datetimepicker-year-view>\r\n } @case ('multi-year') {\r\n <cmat-datetimepicker-multi-year-view\r\n [activeDate]=\"activeDate()\"\r\n [dateFilter]=\"dateFilterForViews\"\r\n [maxDate]=\"maxDate()\"\r\n [minDate]=\"minDate()\"\r\n [selected]=\"selected()\"\r\n [type]=\"type()\"\r\n (userSelection)=\"userSelected()\"\r\n (selectedChange)=\"yearSelected($event)\"\r\n >\r\n </cmat-datetimepicker-multi-year-view>\r\n } @default { @if (timeInput()) {\r\n <cmat-datetimepicker-time\r\n [AMPM]=\"AMPM()\"\r\n [clockView]=\"clockView()\"\r\n [twelvehour]=\"twelvehour()\"\r\n [dateFilter]=\"dateFilter()\"\r\n [interval]=\"timeInterval()\"\r\n [maxDate]=\"maxDate()\"\r\n [minDate]=\"minDate()\"\r\n [selected]=\"activeDate()\"\r\n (userSelection)=\"userSelected()\"\r\n (activeDateChange)=\"onActiveDateChange($event)\"\r\n (selectedChange)=\"timeSelected($event)\"\r\n (ampmChange)=\"ampmClicked($event)\"\r\n (clockViewChange)=\"clockView.set($event)\"\r\n >\r\n </cmat-datetimepicker-time>\r\n } @else {\r\n <cmat-datetimepicker-clock\r\n [activeDate]=\"activeDate()\"\r\n [dateFilter]=\"dateFilter()\"\r\n [interval]=\"timeInterval()\"\r\n [maxDate]=\"maxDate()\"\r\n [minDate]=\"minDate()\"\r\n [selected]=\"activeDate()\"\r\n [startView]=\"clockView()\"\r\n [twelvehour]=\"twelvehour()\"\r\n (userSelection)=\"userSelected()\"\r\n (activeDateChange)=\"onActiveDateChange($event)\"\r\n (selectedChange)=\"dialTimeSelected($event)\"\r\n >\r\n </cmat-datetimepicker-clock>\r\n } } }\r\n</div>\r\n",
|
|
2812
|
+
styles: [".cmat-datetimepicker-calendar{display:block;outline:none}.cmat-datetimepicker-calendar-header{box-sizing:border-box;padding:8px;border-radius:4px 4px 0 0;min-width:264px}.cmat-datetimepicker-calendar-header .header-button{color:#fff!important;padding:0 4px;font-size:inherit;white-space:normal;word-break:break-word;font-weight:500;cursor:pointer}.cmat-datetimepicker-calendar-header-year.header-button{font-size:26px;line-height:24px;display:flex}.cmat-datetimepicker-calendar-header-date-time{font-size:24px;line-height:36px;display:flex;flex-direction:row}.cmat-datetimepicker-calendar-header-ampm:not(.active),.cmat-datetimepicker-calendar-header-date:not(.active),.cmat-datetimepicker-calendar-header-hours:not(.active),.cmat-datetimepicker-calendar-header-minutes:not(.active),.cmat-datetimepicker-calendar-header-time:not(.active),.cmat-datetimepicker-calendar-header-year:not(.active){opacity:.6}.cmat-datetimepicker-calendar-header-ampm.not-clickable,.cmat-datetimepicker-calendar-header-date.not-clickable,.cmat-datetimepicker-calendar-header-hours.not-clickable,.cmat-datetimepicker-calendar-header-minutes.not-clickable,.cmat-datetimepicker-calendar-header-year.not-clickable{cursor:auto}.cmat-datetimepicker-calendar-header-time{display:inline-flex}.cmat-datetimepicker-calendar-header-time:not(.active) :is(.cmat-datetimepicker-calendar-header-ampm,.cmat-datetimepicker-calendar-header-hours,.cmat-datetimepicker-calendar-header-minutes){opacity:1}.cmat-datetimepicker-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.cmat-datetimepicker-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px;font-size:12px}.cmat-datetimepicker-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.cmat-datetimepicker-calendar-controls{display:flex;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.cmat-datetimepicker-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:#0000;box-sizing:border-box}.cmat-datetimepicker-calendar-next-button.disabled,.cmat-datetimepicker-calendar-previous-button.disabled{pointer-events:none}.cmat-datetimepicker-calendar-next-button svg,.cmat-datetimepicker-calendar-previous-button svg{fill:currentColor;vertical-align:top}[dir=rtl] :is(.cmat-datetimepicker-calendar-next-button,.cmat-datetimepicker-calendar-previous-button) svg{transform:rotate(180deg)}.cmat-datetimepicker-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.cmat-datetimepicker-calendar-table-header th{text-align:center;padding:8px 0}\n", ".cmat-calendar-slide-animation.left{animation:slideCalendarLeft .18s}.cmat-calendar-slide-animation.right{animation:slideCalendarRight .18s}@keyframes slideCalendarLeft{0%,50%{transform:translate(100%)}51%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideCalendarRight{0%,50%{transform:translate(-100%)}51%{transform:translate(100%)}to{transform:translate(0)}}\n"]
|
|
2813
|
+
}]
|
|
2814
|
+
}],
|
|
2815
|
+
ctorParameters: () => [],
|
|
2816
|
+
propDecorators: {
|
|
2817
|
+
userSelection: [{
|
|
2818
|
+
type: i0.Output,
|
|
2819
|
+
args: ["userSelection"]
|
|
2820
|
+
}],
|
|
2821
|
+
selectedChange: [{
|
|
2822
|
+
type: i0.Output,
|
|
2823
|
+
args: ["selectedChange"]
|
|
2824
|
+
}],
|
|
2825
|
+
viewChanged: [{
|
|
2826
|
+
type: i0.Output,
|
|
2827
|
+
args: ["viewChanged"]
|
|
2828
|
+
}],
|
|
2829
|
+
startView: [{
|
|
2830
|
+
type: i0.Input,
|
|
2831
|
+
args: [{
|
|
2832
|
+
isSignal: true,
|
|
2833
|
+
alias: "startView",
|
|
2834
|
+
required: false
|
|
2835
|
+
}]
|
|
2836
|
+
}],
|
|
2837
|
+
twelvehour: [{
|
|
2838
|
+
type: i0.Input,
|
|
2839
|
+
args: [{
|
|
2840
|
+
isSignal: true,
|
|
2841
|
+
alias: "twelvehour",
|
|
2842
|
+
required: false
|
|
2843
|
+
}]
|
|
2844
|
+
}],
|
|
2845
|
+
timeInterval: [{
|
|
2846
|
+
type: i0.Input,
|
|
2847
|
+
args: [{
|
|
2848
|
+
isSignal: true,
|
|
2849
|
+
alias: "timeInterval",
|
|
2850
|
+
required: false
|
|
2851
|
+
}]
|
|
2852
|
+
}],
|
|
2853
|
+
type: [{
|
|
2854
|
+
type: i0.Input,
|
|
2855
|
+
args: [{
|
|
2856
|
+
isSignal: true,
|
|
2857
|
+
alias: "type",
|
|
2858
|
+
required: false
|
|
2859
|
+
}]
|
|
2860
|
+
}],
|
|
2861
|
+
multiYearSelector: [{
|
|
2862
|
+
type: i0.Input,
|
|
2863
|
+
args: [{
|
|
2864
|
+
isSignal: true,
|
|
2865
|
+
alias: "multiYearSelector",
|
|
2866
|
+
required: false
|
|
2867
|
+
}]
|
|
2868
|
+
}, {
|
|
2869
|
+
type: i0.Output,
|
|
2870
|
+
args: ["multiYearSelectorChange"]
|
|
2871
|
+
}],
|
|
2872
|
+
timeInput: [{
|
|
2873
|
+
type: i0.Input,
|
|
2874
|
+
args: [{
|
|
2875
|
+
isSignal: true,
|
|
2876
|
+
alias: "timeInput",
|
|
2877
|
+
required: false
|
|
2878
|
+
}]
|
|
2879
|
+
}],
|
|
2880
|
+
dateFilter: [{
|
|
2881
|
+
type: i0.Input,
|
|
2882
|
+
args: [{
|
|
2883
|
+
isSignal: true,
|
|
2884
|
+
alias: "dateFilter",
|
|
2885
|
+
required: false
|
|
2886
|
+
}]
|
|
2887
|
+
}],
|
|
2888
|
+
preventSameDateTimeSelection: [{
|
|
2889
|
+
type: i0.Input,
|
|
2890
|
+
args: [{
|
|
2891
|
+
isSignal: true,
|
|
2892
|
+
alias: "preventSameDateTimeSelection",
|
|
2893
|
+
required: false
|
|
2894
|
+
}]
|
|
2895
|
+
}],
|
|
2896
|
+
minDate: [{
|
|
2897
|
+
type: i0.Input,
|
|
2898
|
+
args: [{
|
|
2899
|
+
isSignal: true,
|
|
2900
|
+
alias: "minDate",
|
|
2901
|
+
required: false
|
|
2902
|
+
}]
|
|
2903
|
+
}],
|
|
2904
|
+
maxDate: [{
|
|
2905
|
+
type: i0.Input,
|
|
2906
|
+
args: [{
|
|
2907
|
+
isSignal: true,
|
|
2908
|
+
alias: "maxDate",
|
|
2909
|
+
required: false
|
|
2910
|
+
}]
|
|
2911
|
+
}],
|
|
2912
|
+
selected: [{
|
|
2913
|
+
type: i0.Input,
|
|
2914
|
+
args: [{
|
|
2915
|
+
isSignal: true,
|
|
2916
|
+
alias: "selected",
|
|
2917
|
+
required: false
|
|
2918
|
+
}]
|
|
2919
|
+
}],
|
|
2920
|
+
startAt: [{
|
|
2921
|
+
type: i0.Input,
|
|
2922
|
+
args: [{
|
|
2923
|
+
isSignal: true,
|
|
2924
|
+
alias: "startAt",
|
|
2925
|
+
required: false
|
|
2926
|
+
}]
|
|
2927
|
+
}]
|
|
2928
|
+
}
|
|
2929
|
+
});
|
|
2930
|
+
let datetimepickerUid = 0;
|
|
2931
|
+
const CMAT_DATETIMEPICKER_SCROLL_STRATEGY = new InjectionToken("cmat-datetimepicker-scroll-strategy");
|
|
2932
|
+
function CMAT_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY(overlay) {
|
|
2933
|
+
return () => overlay.scrollStrategies.reposition();
|
|
2934
|
+
}
|
|
2935
|
+
const CMAT_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = {
|
|
2936
|
+
provide: CMAT_DATETIMEPICKER_SCROLL_STRATEGY,
|
|
2937
|
+
deps: [Overlay],
|
|
2938
|
+
useFactory: CMAT_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY
|
|
2939
|
+
};
|
|
2940
|
+
var CmatDatetimepickerContentComponent = class CmatDatetimepickerContentComponent {
|
|
2941
|
+
constructor() {
|
|
2942
|
+
this._calendar = viewChild.required(CmatDatetimepickerCalendarComponent, ...ngDevMode ? [{ debugName: "_calendar" }] : /* istanbul ignore next */ []);
|
|
2943
|
+
this.color = input(...ngDevMode ? [void 0, { debugName: "color" }] : /* istanbul ignore next */ []);
|
|
2944
|
+
this.animationState = signal("enter-dropdown", ...ngDevMode ? [{ debugName: "animationState" }] : /* istanbul ignore next */ []);
|
|
2945
|
+
this.animationDone = new Subject();
|
|
2946
|
+
this.dialogLabelId = null;
|
|
2947
|
+
this._elementRef = inject(ElementRef);
|
|
2948
|
+
this._animationEndListener = null;
|
|
2949
|
+
}
|
|
2950
|
+
ngOnInit() {
|
|
2951
|
+
this.animationState.set(this.datetimepicker.touchUi() ? "enter-dialog" : "enter-dropdown");
|
|
2952
|
+
this._animationEndListener = (event) => {
|
|
2953
|
+
if (event.animationName === "panel-dropdown-enter" || event.animationName === "panel-dialog-enter" || event.animationName === "panel-leave") this.animationDone.next();
|
|
2954
|
+
};
|
|
2955
|
+
this._elementRef.nativeElement.addEventListener("animationend", this._animationEndListener);
|
|
2956
|
+
}
|
|
2957
|
+
ngAfterContentInit() {
|
|
2958
|
+
this._calendar().focusActiveCell();
|
|
2959
|
+
}
|
|
2960
|
+
startExitAnimation() {
|
|
2961
|
+
this.animationState.set("leave");
|
|
2962
|
+
}
|
|
2963
|
+
ngOnDestroy() {
|
|
2964
|
+
this.animationDone.complete();
|
|
2965
|
+
this._elementRef.nativeElement.removeEventListener("animationend", this._animationEndListener);
|
|
2966
|
+
}
|
|
2967
|
+
static {
|
|
2968
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
2969
|
+
minVersion: "12.0.0",
|
|
2970
|
+
version: "22.3.0",
|
|
2971
|
+
ngImport: i0,
|
|
2972
|
+
type: CmatDatetimepickerContentComponent,
|
|
2973
|
+
deps: [],
|
|
2974
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2975
|
+
});
|
|
2976
|
+
}
|
|
2977
|
+
static {
|
|
2978
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2979
|
+
minVersion: "17.2.0",
|
|
2980
|
+
version: "22.3.0",
|
|
2981
|
+
type: CmatDatetimepickerContentComponent,
|
|
2982
|
+
isStandalone: true,
|
|
2983
|
+
selector: "cmat-datetimepicker-content",
|
|
2984
|
+
inputs: { color: {
|
|
2985
|
+
classPropertyName: "color",
|
|
2986
|
+
publicName: "color",
|
|
2987
|
+
isSignal: true,
|
|
2988
|
+
isRequired: false,
|
|
2989
|
+
transformFunction: null
|
|
2990
|
+
} },
|
|
2991
|
+
host: {
|
|
2992
|
+
properties: {
|
|
2993
|
+
"class": "color() ? \"mat-\" + color() : \"\"",
|
|
2994
|
+
"class.enter-dropdown": "animationState() === \"enter-dropdown\"",
|
|
2995
|
+
"class.enter-dialog": "animationState() === \"enter-dialog\"",
|
|
2996
|
+
"class.leave": "animationState() === \"leave\"",
|
|
2997
|
+
"class.cmat-datetimepicker-content-touch": "datetimepicker?.touchUi()",
|
|
2998
|
+
"attr.mode": "datetimepicker.mode()"
|
|
2999
|
+
},
|
|
3000
|
+
classAttribute: "cmat-datetimepicker-content cmat-datetimepicker-transform-panel"
|
|
3001
|
+
},
|
|
3002
|
+
viewQueries: [{
|
|
3003
|
+
propertyName: "_calendar",
|
|
3004
|
+
first: true,
|
|
3005
|
+
predicate: CmatDatetimepickerCalendarComponent,
|
|
3006
|
+
descendants: true,
|
|
3007
|
+
isSignal: true
|
|
3008
|
+
}],
|
|
3009
|
+
exportAs: ["cmatDatetimepickerContent"],
|
|
3010
|
+
ngImport: i0,
|
|
3011
|
+
template: "<div\r\n cdkTrapFocus\r\n role=\"dialog\"\r\n class=\"cmat-datetimepicker-content-container\"\r\n [attr.aria-modal]=\"true\"\r\n [attr.aria-labelledby]=\"dialogLabelId ?? undefined\"\r\n [attr.mode]=\"datetimepicker.mode()\"\r\n>\r\n <cmat-datetimepicker-calendar\r\n [id]=\"datetimepicker.id\"\r\n [ngClass]=\"datetimepicker.panelClass()\"\r\n [attr.mode]=\"datetimepicker.mode()\"\r\n [type]=\"datetimepicker.type()\"\r\n [startAt]=\"$any(datetimepicker.startAt())\"\r\n [startView]=\"datetimepicker.startView()\"\r\n [maxDate]=\"$any(datetimepicker.maxDate())\"\r\n [minDate]=\"$any(datetimepicker.minDate())\"\r\n [dateFilter]=\"$any(datetimepicker.dateFilter())\"\r\n [multiYearSelector]=\"datetimepicker.multiYearSelector()\"\r\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection()\"\r\n [timeInterval]=\"datetimepicker.timeInterval()\"\r\n [twelvehour]=\"datetimepicker.twelvehour()\"\r\n [selected]=\"$any(datetimepicker.selected())\"\r\n [timeInput]=\"datetimepicker.timeInput()\"\r\n (selectedChange)=\"datetimepicker.select($any($event))\"\r\n (viewChanged)=\"datetimepicker.viewChange($event)\"\r\n (userSelection)=\"datetimepicker.close()\"\r\n >\r\n </cmat-datetimepicker-calendar>\r\n</div>",
|
|
3012
|
+
dependencies: [
|
|
3013
|
+
{
|
|
3014
|
+
kind: "ngmodule",
|
|
3015
|
+
type: A11yModule
|
|
3016
|
+
},
|
|
3017
|
+
{
|
|
3018
|
+
kind: "directive",
|
|
3019
|
+
type: i1.CdkTrapFocus,
|
|
3020
|
+
selector: "[cdkTrapFocus]",
|
|
3021
|
+
inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"],
|
|
3022
|
+
exportAs: ["cdkTrapFocus"]
|
|
3023
|
+
},
|
|
3024
|
+
{
|
|
3025
|
+
kind: "component",
|
|
3026
|
+
type: CmatDatetimepickerCalendarComponent,
|
|
3027
|
+
selector: "cmat-datetimepicker-calendar",
|
|
3028
|
+
inputs: [
|
|
3029
|
+
"startView",
|
|
3030
|
+
"twelvehour",
|
|
3031
|
+
"timeInterval",
|
|
3032
|
+
"type",
|
|
3033
|
+
"multiYearSelector",
|
|
3034
|
+
"timeInput",
|
|
3035
|
+
"dateFilter",
|
|
3036
|
+
"preventSameDateTimeSelection",
|
|
3037
|
+
"minDate",
|
|
3038
|
+
"maxDate",
|
|
3039
|
+
"selected",
|
|
3040
|
+
"startAt"
|
|
3041
|
+
],
|
|
3042
|
+
outputs: [
|
|
3043
|
+
"userSelection",
|
|
3044
|
+
"selectedChange",
|
|
3045
|
+
"viewChanged",
|
|
3046
|
+
"multiYearSelectorChange"
|
|
3047
|
+
],
|
|
3048
|
+
exportAs: ["cmatDatetimepickerCalendar"]
|
|
3049
|
+
},
|
|
3050
|
+
{
|
|
3051
|
+
kind: "directive",
|
|
3052
|
+
type: NgClass,
|
|
3053
|
+
selector: "[ngClass]",
|
|
3054
|
+
inputs: ["class", "ngClass"]
|
|
3055
|
+
}
|
|
3056
|
+
],
|
|
3057
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3058
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
3059
|
+
});
|
|
3060
|
+
}
|
|
3061
|
+
};
|
|
3062
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
3063
|
+
minVersion: "12.0.0",
|
|
3064
|
+
version: "22.3.0",
|
|
3065
|
+
ngImport: i0,
|
|
3066
|
+
type: CmatDatetimepickerContentComponent,
|
|
3067
|
+
decorators: [{
|
|
3068
|
+
type: Component,
|
|
3069
|
+
args: [{
|
|
3070
|
+
selector: "cmat-datetimepicker-content",
|
|
3071
|
+
host: {
|
|
3072
|
+
"class": "cmat-datetimepicker-content cmat-datetimepicker-transform-panel",
|
|
3073
|
+
"[class]": "color() ? \"mat-\" + color() : \"\"",
|
|
3074
|
+
"[class.enter-dropdown]": "animationState() === \"enter-dropdown\"",
|
|
3075
|
+
"[class.enter-dialog]": "animationState() === \"enter-dialog\"",
|
|
3076
|
+
"[class.leave]": "animationState() === \"leave\"",
|
|
3077
|
+
"[class.cmat-datetimepicker-content-touch]": "datetimepicker?.touchUi()",
|
|
3078
|
+
"[attr.mode]": "datetimepicker.mode()"
|
|
3079
|
+
},
|
|
3080
|
+
encapsulation: ViewEncapsulation.None,
|
|
3081
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3082
|
+
exportAs: "cmatDatetimepickerContent",
|
|
3083
|
+
imports: [
|
|
3084
|
+
A11yModule,
|
|
3085
|
+
CmatDatetimepickerCalendarComponent,
|
|
3086
|
+
NgClass
|
|
3087
|
+
],
|
|
3088
|
+
template: "<div\r\n cdkTrapFocus\r\n role=\"dialog\"\r\n class=\"cmat-datetimepicker-content-container\"\r\n [attr.aria-modal]=\"true\"\r\n [attr.aria-labelledby]=\"dialogLabelId ?? undefined\"\r\n [attr.mode]=\"datetimepicker.mode()\"\r\n>\r\n <cmat-datetimepicker-calendar\r\n [id]=\"datetimepicker.id\"\r\n [ngClass]=\"datetimepicker.panelClass()\"\r\n [attr.mode]=\"datetimepicker.mode()\"\r\n [type]=\"datetimepicker.type()\"\r\n [startAt]=\"$any(datetimepicker.startAt())\"\r\n [startView]=\"datetimepicker.startView()\"\r\n [maxDate]=\"$any(datetimepicker.maxDate())\"\r\n [minDate]=\"$any(datetimepicker.minDate())\"\r\n [dateFilter]=\"$any(datetimepicker.dateFilter())\"\r\n [multiYearSelector]=\"datetimepicker.multiYearSelector()\"\r\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection()\"\r\n [timeInterval]=\"datetimepicker.timeInterval()\"\r\n [twelvehour]=\"datetimepicker.twelvehour()\"\r\n [selected]=\"$any(datetimepicker.selected())\"\r\n [timeInput]=\"datetimepicker.timeInput()\"\r\n (selectedChange)=\"datetimepicker.select($any($event))\"\r\n (viewChanged)=\"datetimepicker.viewChange($event)\"\r\n (userSelection)=\"datetimepicker.close()\"\r\n >\r\n </cmat-datetimepicker-calendar>\r\n</div>"
|
|
3089
|
+
}]
|
|
3090
|
+
}],
|
|
3091
|
+
propDecorators: {
|
|
3092
|
+
_calendar: [{
|
|
3093
|
+
type: i0.ViewChild,
|
|
3094
|
+
args: [i0.forwardRef(() => CmatDatetimepickerCalendarComponent), { isSignal: true }]
|
|
3095
|
+
}],
|
|
3096
|
+
color: [{
|
|
3097
|
+
type: i0.Input,
|
|
3098
|
+
args: [{
|
|
3099
|
+
isSignal: true,
|
|
3100
|
+
alias: "color",
|
|
3101
|
+
required: false
|
|
3102
|
+
}]
|
|
3103
|
+
}]
|
|
3104
|
+
}
|
|
3105
|
+
});
|
|
3106
|
+
var CmatDatetimepickerComponent = class CmatDatetimepickerComponent {
|
|
3107
|
+
constructor() {
|
|
3108
|
+
this.selectedChanged = new EventEmitter();
|
|
3109
|
+
this.openedStream = output();
|
|
3110
|
+
this.closedStream = output();
|
|
3111
|
+
this.viewChanged = output();
|
|
3112
|
+
this.id = `cmat-datetimepicker-${datetimepickerUid++}`;
|
|
3113
|
+
this.disabledChange = new Subject();
|
|
3114
|
+
this.startView = input("month", ...ngDevMode ? [{ debugName: "startView" }] : /* istanbul ignore next */ []);
|
|
3115
|
+
this.mode = input("auto", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
|
|
3116
|
+
this.timeInterval = input(1, ...ngDevMode ? [{ debugName: "timeInterval" }] : /* istanbul ignore next */ []);
|
|
3117
|
+
this.preventSameDateTimeSelection = input(false, ...ngDevMode ? [{ debugName: "preventSameDateTimeSelection" }] : /* istanbul ignore next */ []);
|
|
3118
|
+
this.xPosition = input("start", ...ngDevMode ? [{ debugName: "xPosition" }] : /* istanbul ignore next */ []);
|
|
3119
|
+
this.yPosition = input("below", ...ngDevMode ? [{ debugName: "yPosition" }] : /* istanbul ignore next */ []);
|
|
3120
|
+
this.multiYearSelector = input(false, {
|
|
3121
|
+
...ngDevMode ? { debugName: "multiYearSelector" } : /* istanbul ignore next */ {},
|
|
3122
|
+
transform: coerceBooleanProperty
|
|
3123
|
+
});
|
|
3124
|
+
this.twelvehour = input(false, {
|
|
3125
|
+
...ngDevMode ? { debugName: "twelvehour" } : /* istanbul ignore next */ {},
|
|
3126
|
+
transform: coerceBooleanProperty
|
|
3127
|
+
});
|
|
3128
|
+
this.panelClass = input("", {
|
|
3129
|
+
...ngDevMode ? { debugName: "panelClass" } : /* istanbul ignore next */ {},
|
|
3130
|
+
transform: coerceStringArray
|
|
3131
|
+
});
|
|
3132
|
+
this.timeInput = input(true, {
|
|
3133
|
+
...ngDevMode ? { debugName: "timeInput" } : /* istanbul ignore next */ {},
|
|
3134
|
+
transform: coerceBooleanProperty
|
|
3135
|
+
});
|
|
3136
|
+
this.touchUi = input(false, {
|
|
3137
|
+
...ngDevMode ? { debugName: "touchUi" } : /* istanbul ignore next */ {},
|
|
3138
|
+
transform: coerceBooleanProperty
|
|
3139
|
+
});
|
|
3140
|
+
this.restoreFocus = input(true, {
|
|
3141
|
+
...ngDevMode ? { debugName: "restoreFocus" } : /* istanbul ignore next */ {},
|
|
3142
|
+
transform: coerceBooleanProperty
|
|
3143
|
+
});
|
|
3144
|
+
this.color = input(void 0, ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
|
|
3145
|
+
this.type = input("datetime", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
3146
|
+
this.opened = input(false, {
|
|
3147
|
+
...ngDevMode ? { debugName: "opened" } : /* istanbul ignore next */ {},
|
|
3148
|
+
transform: coerceBooleanProperty
|
|
3149
|
+
});
|
|
3150
|
+
this.disabled = input(void 0, {
|
|
3151
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
3152
|
+
transform: coerceBooleanProperty
|
|
3153
|
+
});
|
|
3154
|
+
this.startAt = input(null, ...ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []);
|
|
3155
|
+
this.openedState = computed(() => this._opened(), ...ngDevMode ? [{ debugName: "openedState" }] : /* istanbul ignore next */ []);
|
|
3156
|
+
this.disabledState = computed(() => {
|
|
3157
|
+
const disabledValue = this.disabled();
|
|
3158
|
+
return disabledValue === void 0 && this.datetimepickerInput ? this.datetimepickerInput.disabled() : !!disabledValue;
|
|
3159
|
+
}, ...ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []);
|
|
3160
|
+
this.selected = computed(() => this._validSelected(), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
3161
|
+
this.minDate = computed(() => this.datetimepickerInput?.min(), ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
|
|
3162
|
+
this.maxDate = computed(() => this.datetimepickerInput?.max(), ...ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []);
|
|
3163
|
+
this.dateFilter = computed(() => this.datetimepickerInput?.dateFilter(), ...ngDevMode ? [{ debugName: "dateFilter" }] : /* istanbul ignore next */ []);
|
|
3164
|
+
this.effectiveColor = computed(() => this.color() ?? (this.datetimepickerInput ? this.datetimepickerInput.getThemePalette() : void 0), ...ngDevMode ? [{ debugName: "effectiveColor" }] : /* istanbul ignore next */ []);
|
|
3165
|
+
this.effectiveTimeInput = computed(() => this.timeInput() && !this.touchUi(), ...ngDevMode ? [{ debugName: "effectiveTimeInput" }] : /* istanbul ignore next */ []);
|
|
3166
|
+
this._overlay = inject(Overlay);
|
|
3167
|
+
this._injector = inject(Injector);
|
|
3168
|
+
this._viewContainerRef = inject(ViewContainerRef);
|
|
3169
|
+
this._scrollStrategy = inject(CMAT_DATETIMEPICKER_SCROLL_STRATEGY);
|
|
3170
|
+
this._dateAdapter = inject(DatetimeAdapter, { optional: true });
|
|
3171
|
+
this._dir = inject(Directionality, { optional: true });
|
|
3172
|
+
this._document = inject(DOCUMENT, { optional: true });
|
|
3173
|
+
this._validSelected = signal(null, ...ngDevMode ? [{ debugName: "_validSelected" }] : /* istanbul ignore next */ []);
|
|
3174
|
+
this._focusedElementBeforeOpen = null;
|
|
3175
|
+
this._backdropHarnessClass = `${this.id}-backdrop`;
|
|
3176
|
+
this._inputStateChanges = Subscription.EMPTY;
|
|
3177
|
+
this._closeAnimationTimeoutId = null;
|
|
3178
|
+
this._opened = signal(false, ...ngDevMode ? [{ debugName: "_opened" }] : /* istanbul ignore next */ []);
|
|
3179
|
+
this._startAt = signal(null, ...ngDevMode ? [{ debugName: "_startAt" }] : /* istanbul ignore next */ []);
|
|
3180
|
+
this._disabled = signal(void 0, ...ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []);
|
|
3181
|
+
if (!this._dateAdapter) throw createMissingDateImplError("DatetimeAdapter");
|
|
3182
|
+
effect(() => {
|
|
3183
|
+
if (this.opened()) untracked(() => this.open());
|
|
3184
|
+
else untracked(() => this.close());
|
|
3185
|
+
});
|
|
3186
|
+
effect(() => {
|
|
3187
|
+
const disabledValue = this.disabled();
|
|
3188
|
+
untracked(() => {
|
|
3189
|
+
if (disabledValue !== void 0 && disabledValue !== this._disabled()) {
|
|
3190
|
+
this._disabled.set(disabledValue);
|
|
3191
|
+
this.disabledChange.next(!!disabledValue);
|
|
3192
|
+
}
|
|
3193
|
+
});
|
|
3194
|
+
});
|
|
3195
|
+
effect(() => {
|
|
3196
|
+
const startAtValue = this.startAt();
|
|
3197
|
+
this._startAt.set(this._dateAdapter.getValidDateOrNull(startAtValue));
|
|
3198
|
+
});
|
|
3199
|
+
}
|
|
3200
|
+
ngOnDestroy() {
|
|
3201
|
+
this._destroyOverlay();
|
|
3202
|
+
this.close();
|
|
3203
|
+
this._inputStateChanges.unsubscribe();
|
|
3204
|
+
this.disabledChange.complete();
|
|
3205
|
+
}
|
|
3206
|
+
registerInput(input) {
|
|
3207
|
+
if (this.datetimepickerInput) throw Error("A MatDatepicker can only be associated with a single input.");
|
|
3208
|
+
this.datetimepickerInput = input;
|
|
3209
|
+
this._inputStateChanges = this.datetimepickerInput.valueChange.subscribe((value) => this._validSelected.set(value));
|
|
3210
|
+
}
|
|
3211
|
+
open() {
|
|
3212
|
+
if (this._opened() || this.disabledState()) return;
|
|
3213
|
+
if (!this.datetimepickerInput) throw Error("Attempted to open an MatDatepicker with no associated input.");
|
|
3214
|
+
this._focusedElementBeforeOpen = _getFocusedElementPierceShadowDom();
|
|
3215
|
+
this._openOverlay();
|
|
3216
|
+
this._opened.set(true);
|
|
3217
|
+
this.openedStream.emit();
|
|
3218
|
+
}
|
|
3219
|
+
close() {
|
|
3220
|
+
if (!this._opened()) return;
|
|
3221
|
+
const canRestoreFocus = this.restoreFocus() && this._focusedElementBeforeOpen && typeof this._focusedElementBeforeOpen.focus === "function";
|
|
3222
|
+
const completeClose = () => {
|
|
3223
|
+
if (this._opened()) {
|
|
3224
|
+
this._opened.set(false);
|
|
3225
|
+
this.closedStream.emit();
|
|
3226
|
+
}
|
|
3227
|
+
};
|
|
3228
|
+
if (this._componentRef) {
|
|
3229
|
+
const { instance, location } = this._componentRef;
|
|
3230
|
+
instance.startExitAnimation();
|
|
3231
|
+
this._closeAnimationTimeoutId = window.setTimeout(() => {
|
|
3232
|
+
this._closeAnimationTimeoutId = null;
|
|
3233
|
+
this._focusedElementBeforeOpen = null;
|
|
3234
|
+
this._destroyOverlay();
|
|
3235
|
+
}, 500);
|
|
3236
|
+
instance.animationDone.pipe(take(1)).subscribe(() => {
|
|
3237
|
+
if (this._closeAnimationTimeoutId !== null) {
|
|
3238
|
+
clearTimeout(this._closeAnimationTimeoutId);
|
|
3239
|
+
this._closeAnimationTimeoutId = null;
|
|
3240
|
+
}
|
|
3241
|
+
const activeElement = this._document.activeElement;
|
|
3242
|
+
const overlayElement = location.nativeElement;
|
|
3243
|
+
if (canRestoreFocus && (!activeElement || activeElement === this._document.activeElement || overlayElement.contains(activeElement))) this._focusedElementBeforeOpen?.focus();
|
|
3244
|
+
this._focusedElementBeforeOpen = null;
|
|
3245
|
+
this._destroyOverlay();
|
|
3246
|
+
});
|
|
3247
|
+
}
|
|
3248
|
+
if (canRestoreFocus) setTimeout(completeClose);
|
|
3249
|
+
else completeClose();
|
|
3250
|
+
}
|
|
3251
|
+
select(date) {
|
|
3252
|
+
const oldValue = this.selected();
|
|
3253
|
+
this._validSelected.set(date);
|
|
3254
|
+
if (!this._dateAdapter.sameDatetime(oldValue, this.selected())) this.selectedChanged.emit(date);
|
|
3255
|
+
}
|
|
3256
|
+
viewChange(type) {
|
|
3257
|
+
this.viewChanged.emit(type);
|
|
3258
|
+
}
|
|
3259
|
+
_forwardContentValues(instance) {
|
|
3260
|
+
instance.datetimepicker = this;
|
|
3261
|
+
instance.dialogLabelId = this.datetimepickerInput.getOverlayLabelId();
|
|
3262
|
+
}
|
|
3263
|
+
_openOverlay() {
|
|
3264
|
+
this._destroyOverlay();
|
|
3265
|
+
const isDialog = this.touchUi();
|
|
3266
|
+
const labelId = this.datetimepickerInput.getOverlayLabelId();
|
|
3267
|
+
const portal = new ComponentPortal(CmatDatetimepickerContentComponent, this._viewContainerRef);
|
|
3268
|
+
const overlayRef = this._overlayRef = this._overlay.create(new OverlayConfig({
|
|
3269
|
+
positionStrategy: isDialog ? this._getDialogStrategy() : this._getDropdownStrategy(),
|
|
3270
|
+
hasBackdrop: true,
|
|
3271
|
+
backdropClass: [isDialog ? "cdk-overlay-dark-backdrop" : "mat-overlay-transparent-backdrop", this._backdropHarnessClass],
|
|
3272
|
+
direction: this._dir,
|
|
3273
|
+
scrollStrategy: isDialog ? this._overlay.scrollStrategies.block() : this._scrollStrategy(),
|
|
3274
|
+
panelClass: `cmat-datetimepicker-${isDialog ? "dialog" : "popup"}`
|
|
3275
|
+
}));
|
|
3276
|
+
const overlayElement = overlayRef.overlayElement;
|
|
3277
|
+
overlayElement.setAttribute("role", "dialog");
|
|
3278
|
+
if (labelId) overlayElement.setAttribute("aria-labelledby", labelId);
|
|
3279
|
+
if (isDialog) overlayElement.setAttribute("aria-modal", "true");
|
|
3280
|
+
this._getCloseStream(overlayRef).subscribe(() => this.close());
|
|
3281
|
+
this._componentRef = overlayRef.attach(portal);
|
|
3282
|
+
this._forwardContentValues(this._componentRef.instance);
|
|
3283
|
+
if (!isDialog) afterNextRender(() => {
|
|
3284
|
+
overlayRef.updatePosition();
|
|
3285
|
+
}, { injector: this._injector });
|
|
3286
|
+
}
|
|
3287
|
+
_destroyOverlay() {
|
|
3288
|
+
if (this._overlayRef) {
|
|
3289
|
+
this._overlayRef.dispose();
|
|
3290
|
+
this._overlayRef = this._componentRef = null;
|
|
3291
|
+
}
|
|
3292
|
+
}
|
|
3293
|
+
_getDialogStrategy() {
|
|
3294
|
+
return this._overlay.position().global().centerHorizontally().centerVertically();
|
|
3295
|
+
}
|
|
3296
|
+
_getDropdownStrategy() {
|
|
3297
|
+
const strategy = this._overlay.position().flexibleConnectedTo(this.datetimepickerInput.getConnectedOverlayOrigin()).withTransformOriginOn(".cmat-datetimepicker-content").withFlexibleDimensions(false).withViewportMargin(8).withLockedPosition();
|
|
3298
|
+
return this._setConnectedPositions(strategy);
|
|
3299
|
+
}
|
|
3300
|
+
_setConnectedPositions(strategy) {
|
|
3301
|
+
const primaryX = this.xPosition() === "end" ? "end" : "start";
|
|
3302
|
+
const secondaryX = primaryX === "start" ? "end" : "start";
|
|
3303
|
+
const primaryY = this.yPosition() === "above" ? "bottom" : "top";
|
|
3304
|
+
const secondaryY = primaryY === "top" ? "bottom" : "top";
|
|
3305
|
+
return strategy.withPositions([
|
|
3306
|
+
{
|
|
3307
|
+
originX: primaryX,
|
|
3308
|
+
originY: secondaryY,
|
|
3309
|
+
overlayX: primaryX,
|
|
3310
|
+
overlayY: primaryY
|
|
3311
|
+
},
|
|
3312
|
+
{
|
|
3313
|
+
originX: primaryX,
|
|
3314
|
+
originY: primaryY,
|
|
3315
|
+
overlayX: primaryX,
|
|
3316
|
+
overlayY: secondaryY
|
|
3317
|
+
},
|
|
3318
|
+
{
|
|
3319
|
+
originX: secondaryX,
|
|
3320
|
+
originY: secondaryY,
|
|
3321
|
+
overlayX: secondaryX,
|
|
3322
|
+
overlayY: primaryY
|
|
3323
|
+
},
|
|
3324
|
+
{
|
|
3325
|
+
originX: secondaryX,
|
|
3326
|
+
originY: primaryY,
|
|
3327
|
+
overlayX: secondaryX,
|
|
3328
|
+
overlayY: secondaryY
|
|
3329
|
+
}
|
|
3330
|
+
]);
|
|
3331
|
+
}
|
|
3332
|
+
_getCloseStream(overlayRef) {
|
|
3333
|
+
return new Observable((subscriber) => {
|
|
3334
|
+
const subscriptions = new Subscription();
|
|
3335
|
+
subscriptions.add(overlayRef.backdropClick().subscribe(() => {
|
|
3336
|
+
subscriber.next();
|
|
3337
|
+
subscriber.complete();
|
|
3338
|
+
}));
|
|
3339
|
+
subscriptions.add(overlayRef.detachments().subscribe(() => {
|
|
3340
|
+
subscriber.next();
|
|
3341
|
+
subscriber.complete();
|
|
3342
|
+
}));
|
|
3343
|
+
subscriptions.add(overlayRef.keydownEvents().pipe(filter((event) => event.code === "Escape" && !hasModifierKey(event) || this.datetimepickerInput && hasModifierKey(event, "altKey") && event.code === "ArrowUp")).subscribe(() => {
|
|
3344
|
+
subscriber.next();
|
|
3345
|
+
subscriber.complete();
|
|
3346
|
+
}));
|
|
3347
|
+
return () => {
|
|
3348
|
+
subscriptions.unsubscribe();
|
|
3349
|
+
};
|
|
3350
|
+
});
|
|
3351
|
+
}
|
|
3352
|
+
static {
|
|
3353
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
3354
|
+
minVersion: "12.0.0",
|
|
3355
|
+
version: "22.3.0",
|
|
3356
|
+
ngImport: i0,
|
|
3357
|
+
type: CmatDatetimepickerComponent,
|
|
3358
|
+
deps: [],
|
|
3359
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
3360
|
+
});
|
|
3361
|
+
}
|
|
3362
|
+
static {
|
|
3363
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3364
|
+
minVersion: "17.1.0",
|
|
3365
|
+
version: "22.3.0",
|
|
3366
|
+
type: CmatDatetimepickerComponent,
|
|
3367
|
+
isStandalone: true,
|
|
3368
|
+
selector: "cmat-datetimepicker",
|
|
3369
|
+
inputs: {
|
|
3370
|
+
startView: {
|
|
3371
|
+
classPropertyName: "startView",
|
|
3372
|
+
publicName: "startView",
|
|
3373
|
+
isSignal: true,
|
|
3374
|
+
isRequired: false,
|
|
3375
|
+
transformFunction: null
|
|
3376
|
+
},
|
|
3377
|
+
mode: {
|
|
3378
|
+
classPropertyName: "mode",
|
|
3379
|
+
publicName: "mode",
|
|
3380
|
+
isSignal: true,
|
|
3381
|
+
isRequired: false,
|
|
3382
|
+
transformFunction: null
|
|
3383
|
+
},
|
|
3384
|
+
timeInterval: {
|
|
3385
|
+
classPropertyName: "timeInterval",
|
|
3386
|
+
publicName: "timeInterval",
|
|
3387
|
+
isSignal: true,
|
|
3388
|
+
isRequired: false,
|
|
3389
|
+
transformFunction: null
|
|
3390
|
+
},
|
|
3391
|
+
preventSameDateTimeSelection: {
|
|
3392
|
+
classPropertyName: "preventSameDateTimeSelection",
|
|
3393
|
+
publicName: "preventSameDateTimeSelection",
|
|
3394
|
+
isSignal: true,
|
|
3395
|
+
isRequired: false,
|
|
3396
|
+
transformFunction: null
|
|
3397
|
+
},
|
|
3398
|
+
xPosition: {
|
|
3399
|
+
classPropertyName: "xPosition",
|
|
3400
|
+
publicName: "xPosition",
|
|
3401
|
+
isSignal: true,
|
|
3402
|
+
isRequired: false,
|
|
3403
|
+
transformFunction: null
|
|
3404
|
+
},
|
|
3405
|
+
yPosition: {
|
|
3406
|
+
classPropertyName: "yPosition",
|
|
3407
|
+
publicName: "yPosition",
|
|
3408
|
+
isSignal: true,
|
|
3409
|
+
isRequired: false,
|
|
3410
|
+
transformFunction: null
|
|
3411
|
+
},
|
|
3412
|
+
multiYearSelector: {
|
|
3413
|
+
classPropertyName: "multiYearSelector",
|
|
3414
|
+
publicName: "multiYearSelector",
|
|
3415
|
+
isSignal: true,
|
|
3416
|
+
isRequired: false,
|
|
3417
|
+
transformFunction: null
|
|
3418
|
+
},
|
|
3419
|
+
twelvehour: {
|
|
3420
|
+
classPropertyName: "twelvehour",
|
|
3421
|
+
publicName: "twelvehour",
|
|
3422
|
+
isSignal: true,
|
|
3423
|
+
isRequired: false,
|
|
3424
|
+
transformFunction: null
|
|
3425
|
+
},
|
|
3426
|
+
panelClass: {
|
|
3427
|
+
classPropertyName: "panelClass",
|
|
3428
|
+
publicName: "panelClass",
|
|
3429
|
+
isSignal: true,
|
|
3430
|
+
isRequired: false,
|
|
3431
|
+
transformFunction: null
|
|
3432
|
+
},
|
|
3433
|
+
timeInput: {
|
|
3434
|
+
classPropertyName: "timeInput",
|
|
3435
|
+
publicName: "timeInput",
|
|
3436
|
+
isSignal: true,
|
|
3437
|
+
isRequired: false,
|
|
3438
|
+
transformFunction: null
|
|
3439
|
+
},
|
|
3440
|
+
touchUi: {
|
|
3441
|
+
classPropertyName: "touchUi",
|
|
3442
|
+
publicName: "touchUi",
|
|
3443
|
+
isSignal: true,
|
|
3444
|
+
isRequired: false,
|
|
3445
|
+
transformFunction: null
|
|
3446
|
+
},
|
|
3447
|
+
restoreFocus: {
|
|
3448
|
+
classPropertyName: "restoreFocus",
|
|
3449
|
+
publicName: "restoreFocus",
|
|
3450
|
+
isSignal: true,
|
|
3451
|
+
isRequired: false,
|
|
3452
|
+
transformFunction: null
|
|
3453
|
+
},
|
|
3454
|
+
color: {
|
|
3455
|
+
classPropertyName: "color",
|
|
3456
|
+
publicName: "color",
|
|
3457
|
+
isSignal: true,
|
|
3458
|
+
isRequired: false,
|
|
3459
|
+
transformFunction: null
|
|
3460
|
+
},
|
|
3461
|
+
type: {
|
|
3462
|
+
classPropertyName: "type",
|
|
3463
|
+
publicName: "type",
|
|
3464
|
+
isSignal: true,
|
|
3465
|
+
isRequired: false,
|
|
3466
|
+
transformFunction: null
|
|
3467
|
+
},
|
|
3468
|
+
opened: {
|
|
3469
|
+
classPropertyName: "opened",
|
|
3470
|
+
publicName: "opened",
|
|
3471
|
+
isSignal: true,
|
|
3472
|
+
isRequired: false,
|
|
3473
|
+
transformFunction: null
|
|
3474
|
+
},
|
|
3475
|
+
disabled: {
|
|
3476
|
+
classPropertyName: "disabled",
|
|
3477
|
+
publicName: "disabled",
|
|
3478
|
+
isSignal: true,
|
|
3479
|
+
isRequired: false,
|
|
3480
|
+
transformFunction: null
|
|
3481
|
+
},
|
|
3482
|
+
startAt: {
|
|
3483
|
+
classPropertyName: "startAt",
|
|
3484
|
+
publicName: "startAt",
|
|
3485
|
+
isSignal: true,
|
|
3486
|
+
isRequired: false,
|
|
3487
|
+
transformFunction: null
|
|
3488
|
+
}
|
|
3489
|
+
},
|
|
3490
|
+
outputs: {
|
|
3491
|
+
openedStream: "openedStream",
|
|
3492
|
+
closedStream: "closedStream",
|
|
3493
|
+
viewChanged: "viewChanged"
|
|
3494
|
+
},
|
|
3495
|
+
exportAs: ["cmatDatetimepicker"],
|
|
3496
|
+
ngImport: i0,
|
|
3497
|
+
template: "",
|
|
3498
|
+
isInline: true,
|
|
3499
|
+
styles: [".cmat-datetimepicker-calendar-body-cell-content.cmat-datetimepicker-calendar-body-selected,.cmat-datetimepicker-calendar-header{color:#fff!important}.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected).cmat-datetimepicker-calendar-body-today{border-color:var(--cmat-text-hint)}.cmat-datetimepicker-calendar-body-active>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected),.cmat-datetimepicker-calendar-body-cell:not(.cmat-datetimepicker-calendar-body-disabled):hover>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected){background-color:rgba(var(--cmat-primary-rgb),.3)}.cmat-datetimepicker-calendar-body-disabled>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected),.cmat-datetimepicker-calendar-next-button.disabled,.cmat-datetimepicker-calendar-previous-button.disabled{color:var(--cmat-text-disabled)}.cmat-datetimepicker-calendar-body-disabled>.cmat-datetimepicker-calendar-body-today:not(.cmat-datetimepicker-calendar-body-selected){border-color:rgba(var(--cmat-text-disabled),.8)}.cmat-datetimepicker-calendar-body-disabled>.cmat-datetimepicker-calendar-body-selected{background-color:rgba(var(--cmat-primary-rgb),.4)}.cmat-datetimepicker-clock-wrapper{background-color:var(--cmat-divider)}.cmat-datetimepicker-clock-cell.cmat-datetimepicker-clock-cell-selected{color:#fff!important}.cmat-datetimepicker-clock-cell.cmat-datetimepicker-clock-cell-disabled{color:var(--cmat-text-disabled)}.cmat-datetimepicker-time-input{background-color:var(--cmat-text-disabled)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-active{background-color:rgba(var(--cmat-primary-rgb),.2)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-active:focus{border-color:var(--cmat-primary);background-color:var(--cmat-divider)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-active:focus::placeholder{color:rgba(var(--cmat-primary-rgb),.6)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-warning{border-color:var(--cmat-warn)}.cmat-datetimepicker-time-am.mat-mdc-button,.cmat-datetimepicker-time-pm.mat-mdc-button{color:var(--cmat-text-hint);border-color:var(--cmat-text-hint)}.cmat-datetimepicker-time-am.mat-mdc-button.cmat-datetimepicker-time-ampm-active,.cmat-datetimepicker-time-pm.mat-mdc-button.cmat-datetimepicker-time-ampm-active{background-color:rgba(var(--cmat-accent-rgb),.2)}.cmat-datetimepicker-content{display:block;border-radius:4px;overflow:hidden}.cmat-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.cmat-datetimepicker-content .cmat-calendar{width:296px;height:424px}.cmat-datetimepicker-content .cmat-calendar.cmat-datetimepicker-calendar-with-time-input{height:490px}.cmat-datetimepicker-content-touch{display:block;position:relative;overflow:visible}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.cmat-datetimepicker-content-touch .cmat-datetimepicker-calendar{width:100%;height:auto}@media(orientation:landscape){.cmat-datetimepicker-content-touch :is(.cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-container[mode=landscape]){width:120vh;height:100%;min-height:80vh}.cmat-datetimepicker-content-touch :is(.cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-container[mode=landscape]) .cmat-datetimepicker-calendar{width:auto;height:100%}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait] .cmat-datetimepicker-calendar{width:100%;height:auto}}@media(orientation:portrait){.cmat-datetimepicker-content-touch :is(.cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-container[mode=portrait]){width:80vw;height:120vw}.cmat-datetimepicker-content-touch :is(.cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-container[mode=portrait]) .cmat-datetimepicker-calendar{width:100%;height:auto}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=landscape] .cmat-datetimepicker-calendar{width:auto;height:100%}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container-with-actions{height:135vw}}.cmat-datetimepicker-transform-panel.enter-dropdown{animation:panel-dropdown-enter .12s cubic-bezier(0,0,.2,1)}.cmat-datetimepicker-transform-panel.enter-dialog{animation:panel-dialog-enter .15s cubic-bezier(0,0,.2,1)}.cmat-datetimepicker-transform-panel.leave{animation:panel-leave .1s linear}@keyframes panel-dropdown-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scale(1)}}@keyframes panel-dialog-enter{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:none}}@keyframes panel-leave{0%{opacity:1}to{opacity:0}}\n"],
|
|
3500
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3501
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
3502
|
+
});
|
|
3503
|
+
}
|
|
3504
|
+
};
|
|
3505
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
3506
|
+
minVersion: "12.0.0",
|
|
3507
|
+
version: "22.3.0",
|
|
3508
|
+
ngImport: i0,
|
|
3509
|
+
type: CmatDatetimepickerComponent,
|
|
3510
|
+
decorators: [{
|
|
3511
|
+
type: Component,
|
|
3512
|
+
args: [{
|
|
3513
|
+
selector: "cmat-datetimepicker",
|
|
3514
|
+
exportAs: "cmatDatetimepicker",
|
|
3515
|
+
template: "",
|
|
3516
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3517
|
+
encapsulation: ViewEncapsulation.None,
|
|
3518
|
+
preserveWhitespaces: false,
|
|
3519
|
+
styles: [".cmat-datetimepicker-calendar-body-cell-content.cmat-datetimepicker-calendar-body-selected,.cmat-datetimepicker-calendar-header{color:#fff!important}.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected).cmat-datetimepicker-calendar-body-today{border-color:var(--cmat-text-hint)}.cmat-datetimepicker-calendar-body-active>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected),.cmat-datetimepicker-calendar-body-cell:not(.cmat-datetimepicker-calendar-body-disabled):hover>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected){background-color:rgba(var(--cmat-primary-rgb),.3)}.cmat-datetimepicker-calendar-body-disabled>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected),.cmat-datetimepicker-calendar-next-button.disabled,.cmat-datetimepicker-calendar-previous-button.disabled{color:var(--cmat-text-disabled)}.cmat-datetimepicker-calendar-body-disabled>.cmat-datetimepicker-calendar-body-today:not(.cmat-datetimepicker-calendar-body-selected){border-color:rgba(var(--cmat-text-disabled),.8)}.cmat-datetimepicker-calendar-body-disabled>.cmat-datetimepicker-calendar-body-selected{background-color:rgba(var(--cmat-primary-rgb),.4)}.cmat-datetimepicker-clock-wrapper{background-color:var(--cmat-divider)}.cmat-datetimepicker-clock-cell.cmat-datetimepicker-clock-cell-selected{color:#fff!important}.cmat-datetimepicker-clock-cell.cmat-datetimepicker-clock-cell-disabled{color:var(--cmat-text-disabled)}.cmat-datetimepicker-time-input{background-color:var(--cmat-text-disabled)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-active{background-color:rgba(var(--cmat-primary-rgb),.2)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-active:focus{border-color:var(--cmat-primary);background-color:var(--cmat-divider)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-active:focus::placeholder{color:rgba(var(--cmat-primary-rgb),.6)}.cmat-datetimepicker-time-input.cmat-datetimepicker-time-input-warning{border-color:var(--cmat-warn)}.cmat-datetimepicker-time-am.mat-mdc-button,.cmat-datetimepicker-time-pm.mat-mdc-button{color:var(--cmat-text-hint);border-color:var(--cmat-text-hint)}.cmat-datetimepicker-time-am.mat-mdc-button.cmat-datetimepicker-time-ampm-active,.cmat-datetimepicker-time-pm.mat-mdc-button.cmat-datetimepicker-time-ampm-active{background-color:rgba(var(--cmat-accent-rgb),.2)}.cmat-datetimepicker-content{display:block;border-radius:4px;overflow:hidden}.cmat-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.cmat-datetimepicker-content .cmat-calendar{width:296px;height:424px}.cmat-datetimepicker-content .cmat-calendar.cmat-datetimepicker-calendar-with-time-input{height:490px}.cmat-datetimepicker-content-touch{display:block;position:relative;overflow:visible}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.cmat-datetimepicker-content-touch .cmat-datetimepicker-calendar{width:100%;height:auto}@media(orientation:landscape){.cmat-datetimepicker-content-touch :is(.cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-container[mode=landscape]){width:120vh;height:100%;min-height:80vh}.cmat-datetimepicker-content-touch :is(.cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-container[mode=landscape]) .cmat-datetimepicker-calendar{width:auto;height:100%}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait] .cmat-datetimepicker-calendar{width:100%;height:auto}}@media(orientation:portrait){.cmat-datetimepicker-content-touch :is(.cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-container[mode=portrait]){width:80vw;height:120vw}.cmat-datetimepicker-content-touch :is(.cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-container[mode=portrait]) .cmat-datetimepicker-calendar{width:100%;height:auto}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=landscape] .cmat-datetimepicker-calendar{width:auto;height:100%}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container-with-actions{height:135vw}}.cmat-datetimepicker-transform-panel.enter-dropdown{animation:panel-dropdown-enter .12s cubic-bezier(0,0,.2,1)}.cmat-datetimepicker-transform-panel.enter-dialog{animation:panel-dialog-enter .15s cubic-bezier(0,0,.2,1)}.cmat-datetimepicker-transform-panel.leave{animation:panel-leave .1s linear}@keyframes panel-dropdown-enter{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scale(1)}}@keyframes panel-dialog-enter{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:none}}@keyframes panel-leave{0%{opacity:1}to{opacity:0}}\n"]
|
|
3520
|
+
}]
|
|
3521
|
+
}],
|
|
3522
|
+
ctorParameters: () => [],
|
|
3523
|
+
propDecorators: {
|
|
3524
|
+
openedStream: [{
|
|
3525
|
+
type: i0.Output,
|
|
3526
|
+
args: ["openedStream"]
|
|
3527
|
+
}],
|
|
3528
|
+
closedStream: [{
|
|
3529
|
+
type: i0.Output,
|
|
3530
|
+
args: ["closedStream"]
|
|
3531
|
+
}],
|
|
3532
|
+
viewChanged: [{
|
|
3533
|
+
type: i0.Output,
|
|
3534
|
+
args: ["viewChanged"]
|
|
3535
|
+
}],
|
|
3536
|
+
startView: [{
|
|
3537
|
+
type: i0.Input,
|
|
3538
|
+
args: [{
|
|
3539
|
+
isSignal: true,
|
|
3540
|
+
alias: "startView",
|
|
3541
|
+
required: false
|
|
3542
|
+
}]
|
|
3543
|
+
}],
|
|
3544
|
+
mode: [{
|
|
3545
|
+
type: i0.Input,
|
|
3546
|
+
args: [{
|
|
3547
|
+
isSignal: true,
|
|
3548
|
+
alias: "mode",
|
|
3549
|
+
required: false
|
|
3550
|
+
}]
|
|
3551
|
+
}],
|
|
3552
|
+
timeInterval: [{
|
|
3553
|
+
type: i0.Input,
|
|
3554
|
+
args: [{
|
|
3555
|
+
isSignal: true,
|
|
3556
|
+
alias: "timeInterval",
|
|
3557
|
+
required: false
|
|
3558
|
+
}]
|
|
3559
|
+
}],
|
|
3560
|
+
preventSameDateTimeSelection: [{
|
|
3561
|
+
type: i0.Input,
|
|
3562
|
+
args: [{
|
|
3563
|
+
isSignal: true,
|
|
3564
|
+
alias: "preventSameDateTimeSelection",
|
|
3565
|
+
required: false
|
|
3566
|
+
}]
|
|
3567
|
+
}],
|
|
3568
|
+
xPosition: [{
|
|
3569
|
+
type: i0.Input,
|
|
3570
|
+
args: [{
|
|
3571
|
+
isSignal: true,
|
|
3572
|
+
alias: "xPosition",
|
|
3573
|
+
required: false
|
|
3574
|
+
}]
|
|
3575
|
+
}],
|
|
3576
|
+
yPosition: [{
|
|
3577
|
+
type: i0.Input,
|
|
3578
|
+
args: [{
|
|
3579
|
+
isSignal: true,
|
|
3580
|
+
alias: "yPosition",
|
|
3581
|
+
required: false
|
|
3582
|
+
}]
|
|
3583
|
+
}],
|
|
3584
|
+
multiYearSelector: [{
|
|
3585
|
+
type: i0.Input,
|
|
3586
|
+
args: [{
|
|
3587
|
+
isSignal: true,
|
|
3588
|
+
alias: "multiYearSelector",
|
|
3589
|
+
required: false
|
|
3590
|
+
}]
|
|
3591
|
+
}],
|
|
3592
|
+
twelvehour: [{
|
|
3593
|
+
type: i0.Input,
|
|
3594
|
+
args: [{
|
|
3595
|
+
isSignal: true,
|
|
3596
|
+
alias: "twelvehour",
|
|
3597
|
+
required: false
|
|
3598
|
+
}]
|
|
3599
|
+
}],
|
|
3600
|
+
panelClass: [{
|
|
3601
|
+
type: i0.Input,
|
|
3602
|
+
args: [{
|
|
3603
|
+
isSignal: true,
|
|
3604
|
+
alias: "panelClass",
|
|
3605
|
+
required: false
|
|
3606
|
+
}]
|
|
3607
|
+
}],
|
|
3608
|
+
timeInput: [{
|
|
3609
|
+
type: i0.Input,
|
|
3610
|
+
args: [{
|
|
3611
|
+
isSignal: true,
|
|
3612
|
+
alias: "timeInput",
|
|
3613
|
+
required: false
|
|
3614
|
+
}]
|
|
3615
|
+
}],
|
|
3616
|
+
touchUi: [{
|
|
3617
|
+
type: i0.Input,
|
|
3618
|
+
args: [{
|
|
3619
|
+
isSignal: true,
|
|
3620
|
+
alias: "touchUi",
|
|
3621
|
+
required: false
|
|
3622
|
+
}]
|
|
3623
|
+
}],
|
|
3624
|
+
restoreFocus: [{
|
|
3625
|
+
type: i0.Input,
|
|
3626
|
+
args: [{
|
|
3627
|
+
isSignal: true,
|
|
3628
|
+
alias: "restoreFocus",
|
|
3629
|
+
required: false
|
|
3630
|
+
}]
|
|
3631
|
+
}],
|
|
3632
|
+
color: [{
|
|
3633
|
+
type: i0.Input,
|
|
3634
|
+
args: [{
|
|
3635
|
+
isSignal: true,
|
|
3636
|
+
alias: "color",
|
|
3637
|
+
required: false
|
|
3638
|
+
}]
|
|
3639
|
+
}],
|
|
3640
|
+
type: [{
|
|
3641
|
+
type: i0.Input,
|
|
3642
|
+
args: [{
|
|
3643
|
+
isSignal: true,
|
|
3644
|
+
alias: "type",
|
|
3645
|
+
required: false
|
|
3646
|
+
}]
|
|
3647
|
+
}],
|
|
3648
|
+
opened: [{
|
|
3649
|
+
type: i0.Input,
|
|
3650
|
+
args: [{
|
|
3651
|
+
isSignal: true,
|
|
3652
|
+
alias: "opened",
|
|
3653
|
+
required: false
|
|
3654
|
+
}]
|
|
3655
|
+
}],
|
|
3656
|
+
disabled: [{
|
|
3657
|
+
type: i0.Input,
|
|
3658
|
+
args: [{
|
|
3659
|
+
isSignal: true,
|
|
3660
|
+
alias: "disabled",
|
|
3661
|
+
required: false
|
|
3662
|
+
}]
|
|
3663
|
+
}],
|
|
3664
|
+
startAt: [{
|
|
3665
|
+
type: i0.Input,
|
|
3666
|
+
args: [{
|
|
3667
|
+
isSignal: true,
|
|
3668
|
+
alias: "startAt",
|
|
3669
|
+
required: false
|
|
3670
|
+
}]
|
|
3671
|
+
}]
|
|
3672
|
+
}
|
|
3673
|
+
});
|
|
3674
|
+
const CMAT_DATETIMEPICKER_VALUE_ACCESSOR = {
|
|
3675
|
+
provide: NG_VALUE_ACCESSOR,
|
|
3676
|
+
useExisting: forwardRef(() => CmatDatetimepickerInputDirective),
|
|
3677
|
+
multi: true
|
|
3678
|
+
};
|
|
3679
|
+
const CMAT_DATETIMEPICKER_VALIDATORS = {
|
|
3680
|
+
provide: NG_VALIDATORS,
|
|
3681
|
+
useExisting: forwardRef(() => CmatDatetimepickerInputDirective),
|
|
3682
|
+
multi: true
|
|
3683
|
+
};
|
|
3684
|
+
var CmatDatetimepickerInputEvent = class {
|
|
3685
|
+
constructor(target, targetElement) {
|
|
3686
|
+
this.target = target;
|
|
3687
|
+
this.targetElement = targetElement;
|
|
3688
|
+
this.value = this.target.value();
|
|
3689
|
+
}
|
|
3690
|
+
};
|
|
3691
|
+
var CmatDatetimepickerInputDirective = class CmatDatetimepickerInputDirective {
|
|
3692
|
+
constructor() {
|
|
3693
|
+
this.dateChange = output();
|
|
3694
|
+
this.dateInput = output();
|
|
3695
|
+
this.valueChange = new EventEmitter();
|
|
3696
|
+
this.disabledChange = new EventEmitter();
|
|
3697
|
+
this.cmatDatetimepicker = input(...ngDevMode ? [void 0, { debugName: "cmatDatetimepicker" }] : /* istanbul ignore next */ []);
|
|
3698
|
+
this.cmatDatepickerFilter = input(...ngDevMode ? [void 0, { debugName: "cmatDatepickerFilter" }] : /* istanbul ignore next */ []);
|
|
3699
|
+
this.min = input(null, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
|
|
3700
|
+
this.max = input(null, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
|
|
3701
|
+
this.disabled = input(false, {
|
|
3702
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
3703
|
+
transform: coerceBooleanProperty
|
|
3704
|
+
});
|
|
3705
|
+
this._effectiveDisabled = computed(() => this.disabled() || this._fcDisabled(), ...ngDevMode ? [{ debugName: "_effectiveDisabled" }] : /* istanbul ignore next */ []);
|
|
3706
|
+
this.value = input(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
3707
|
+
this.dateFilter = computed(() => this.cmatDatepickerFilter(), ...ngDevMode ? [{ debugName: "dateFilter" }] : /* istanbul ignore next */ []);
|
|
3708
|
+
this.datetimepicker = computed(() => this.cmatDatetimepicker(), ...ngDevMode ? [{ debugName: "datetimepicker" }] : /* istanbul ignore next */ []);
|
|
3709
|
+
this._fcDisabled = signal(false, ...ngDevMode ? [{ debugName: "_fcDisabled" }] : /* istanbul ignore next */ []);
|
|
3710
|
+
this._elementRef = inject(ElementRef);
|
|
3711
|
+
this._dateAdapter = inject(DatetimeAdapter, { optional: true });
|
|
3712
|
+
this._dateFormats = inject(CMAT_DATETIME_FORMATS, { optional: true });
|
|
3713
|
+
this._formField = inject(MatFormField, { optional: true });
|
|
3714
|
+
this._datepickerSubscription = Subscription.EMPTY;
|
|
3715
|
+
this._localeSubscription = Subscription.EMPTY;
|
|
3716
|
+
this._valueChangeTimeoutId = null;
|
|
3717
|
+
this._lastValueValid = signal(true, ...ngDevMode ? [{ debugName: "_lastValueValid" }] : /* istanbul ignore next */ []);
|
|
3718
|
+
this._internalValue = signal(null, ...ngDevMode ? [{ debugName: "_internalValue" }] : /* istanbul ignore next */ []);
|
|
3719
|
+
this._onTouched = () => {};
|
|
3720
|
+
this._cvaOnChange = () => {};
|
|
3721
|
+
this._validatorOnChange = () => {};
|
|
3722
|
+
this._parseValidator = () => this._lastValueValid() ? null : { "matDatepickerParse": { "text": this._elementRef.nativeElement.value } };
|
|
3723
|
+
this._minValidator = (control) => {
|
|
3724
|
+
const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));
|
|
3725
|
+
const minVal = this.min();
|
|
3726
|
+
return !minVal || !controlValue || this._dateAdapter.compareDatetime(minVal, controlValue) <= 0 ? null : { "matDatepickerMin": {
|
|
3727
|
+
"min": minVal,
|
|
3728
|
+
"actual": controlValue
|
|
3729
|
+
} };
|
|
3730
|
+
};
|
|
3731
|
+
this._maxValidator = (control) => {
|
|
3732
|
+
const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));
|
|
3733
|
+
const maxVal = this.max();
|
|
3734
|
+
return !maxVal || !controlValue || this._dateAdapter.compareDatetime(maxVal, controlValue) >= 0 ? null : { "matDatepickerMax": {
|
|
3735
|
+
"max": maxVal,
|
|
3736
|
+
"actual": controlValue
|
|
3737
|
+
} };
|
|
3738
|
+
};
|
|
3739
|
+
this._filterValidator = (control) => {
|
|
3740
|
+
const controlValue = this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(control.value));
|
|
3741
|
+
const filter = this.dateFilter();
|
|
3742
|
+
return !filter || !controlValue || filter(controlValue, CmatDatetimepickerFilterType.DATE) ? null : { "matDatepickerFilter": true };
|
|
3743
|
+
};
|
|
3744
|
+
this._validator = Validators.compose([
|
|
3745
|
+
this._parseValidator,
|
|
3746
|
+
this._minValidator,
|
|
3747
|
+
this._maxValidator,
|
|
3748
|
+
this._filterValidator
|
|
3749
|
+
]);
|
|
3750
|
+
const _dateAdapter = this._dateAdapter;
|
|
3751
|
+
if (!this._dateAdapter) throw createMissingDateImplError("CDatetimeAdapter");
|
|
3752
|
+
if (!this._dateFormats) throw createMissingDateImplError("CMAT_DATETIME_FORMATS");
|
|
3753
|
+
this._localeSubscription = _dateAdapter.localeChanges.subscribe(() => {
|
|
3754
|
+
if (this._internalValue()) this._formatValue(this._internalValue());
|
|
3755
|
+
});
|
|
3756
|
+
effect(() => {
|
|
3757
|
+
this.min();
|
|
3758
|
+
this._validatorOnChange();
|
|
3759
|
+
});
|
|
3760
|
+
effect(() => {
|
|
3761
|
+
this.max();
|
|
3762
|
+
this._validatorOnChange();
|
|
3763
|
+
});
|
|
3764
|
+
effect(() => {
|
|
3765
|
+
this.dateFilter();
|
|
3766
|
+
this._validatorOnChange();
|
|
3767
|
+
});
|
|
3768
|
+
effect(() => {
|
|
3769
|
+
const disabledValue = this._effectiveDisabled();
|
|
3770
|
+
this.disabledChange.emit(disabledValue);
|
|
3771
|
+
});
|
|
3772
|
+
}
|
|
3773
|
+
ngAfterContentInit() {
|
|
3774
|
+
const picker = this.datetimepicker();
|
|
3775
|
+
if (picker) {
|
|
3776
|
+
picker.registerInput(this);
|
|
3777
|
+
this._datepickerSubscription = picker.selectedChanged.subscribe((selected) => {
|
|
3778
|
+
this._setValue(selected);
|
|
3779
|
+
this._cvaOnChange(selected);
|
|
3780
|
+
this._onTouched();
|
|
3781
|
+
this.dateInput.emit(new CmatDatetimepickerInputEvent(this, this._elementRef.nativeElement));
|
|
3782
|
+
this.dateChange.emit(new CmatDatetimepickerInputEvent(this, this._elementRef.nativeElement));
|
|
3783
|
+
});
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
ngOnDestroy() {
|
|
3787
|
+
if (this._valueChangeTimeoutId !== null) {
|
|
3788
|
+
clearTimeout(this._valueChangeTimeoutId);
|
|
3789
|
+
this._valueChangeTimeoutId = null;
|
|
3790
|
+
}
|
|
3791
|
+
this._datepickerSubscription.unsubscribe();
|
|
3792
|
+
this._localeSubscription.unsubscribe();
|
|
3793
|
+
this.valueChange.complete();
|
|
3794
|
+
this.disabledChange.complete();
|
|
3795
|
+
}
|
|
3796
|
+
registerOnValidatorChange(fn) {
|
|
3797
|
+
this._validatorOnChange = fn;
|
|
3798
|
+
}
|
|
3799
|
+
validate(c) {
|
|
3800
|
+
return this._validator ? this._validator(c) : null;
|
|
3801
|
+
}
|
|
3802
|
+
getConnectedOverlayOrigin() {
|
|
3803
|
+
return this._formField ? this._formField.getConnectedOverlayOrigin() : this._elementRef;
|
|
3804
|
+
}
|
|
3805
|
+
getOverlayLabelId() {
|
|
3806
|
+
if (this._formField) return this._formField.getLabelId() ?? null;
|
|
3807
|
+
return this._elementRef.nativeElement.getAttribute("aria-labelledby");
|
|
3808
|
+
}
|
|
3809
|
+
writeValue(value) {
|
|
3810
|
+
this._setValue(value);
|
|
3811
|
+
}
|
|
3812
|
+
registerOnChange(fn) {
|
|
3813
|
+
this._cvaOnChange = fn;
|
|
3814
|
+
}
|
|
3815
|
+
registerOnTouched(fn) {
|
|
3816
|
+
this._onTouched = fn;
|
|
3817
|
+
}
|
|
3818
|
+
setDisabledState(disabled) {
|
|
3819
|
+
this._fcDisabled.set(disabled);
|
|
3820
|
+
}
|
|
3821
|
+
onKeydown(event) {
|
|
3822
|
+
if (event.altKey && event.code === "ArrowDown") {
|
|
3823
|
+
this.datetimepicker()?.open();
|
|
3824
|
+
event.preventDefault();
|
|
3825
|
+
}
|
|
3826
|
+
}
|
|
3827
|
+
onInput(value) {
|
|
3828
|
+
let date = this._dateAdapter.parse(value, this._getParseFormat());
|
|
3829
|
+
this._lastValueValid.set(!date || this._dateAdapter.isValid(date));
|
|
3830
|
+
date = this._dateAdapter.getValidDateOrNull(date);
|
|
3831
|
+
this._internalValue.set(date);
|
|
3832
|
+
this._cvaOnChange(date);
|
|
3833
|
+
this.valueChange.emit(date);
|
|
3834
|
+
this.dateInput.emit(new CmatDatetimepickerInputEvent(this, this._elementRef.nativeElement));
|
|
3835
|
+
}
|
|
3836
|
+
onChange() {
|
|
3837
|
+
this.dateChange.emit(new CmatDatetimepickerInputEvent(this, this._elementRef.nativeElement));
|
|
3838
|
+
}
|
|
3839
|
+
onBlur() {
|
|
3840
|
+
if (this._internalValue()) this._formatValue(this._internalValue());
|
|
3841
|
+
this._onTouched();
|
|
3842
|
+
}
|
|
3843
|
+
getThemePalette() {
|
|
3844
|
+
return this._formField ? this._formField.color : void 0;
|
|
3845
|
+
}
|
|
3846
|
+
_setValue(value) {
|
|
3847
|
+
value = this._dateAdapter.deserialize(value);
|
|
3848
|
+
this._lastValueValid.set(!value || this._dateAdapter.isValid(value));
|
|
3849
|
+
value = this._dateAdapter.getValidDateOrNull(value);
|
|
3850
|
+
const oldDate = this._internalValue();
|
|
3851
|
+
this._internalValue.set(value);
|
|
3852
|
+
this._formatValue(value);
|
|
3853
|
+
if (this._valueChangeTimeoutId !== null) clearTimeout(this._valueChangeTimeoutId);
|
|
3854
|
+
this._valueChangeTimeoutId = window.setTimeout(() => {
|
|
3855
|
+
this._valueChangeTimeoutId = null;
|
|
3856
|
+
if (!this._dateAdapter.sameDatetime(oldDate, value)) this.valueChange.emit(value);
|
|
3857
|
+
});
|
|
3858
|
+
}
|
|
3859
|
+
_getDisplayFormat() {
|
|
3860
|
+
const picker = this.datetimepicker();
|
|
3861
|
+
if (!picker) return this._dateFormats.display.dateInput;
|
|
3862
|
+
switch (picker.type()) {
|
|
3863
|
+
case "date": return this._dateFormats.display.dateInput;
|
|
3864
|
+
case "datetime": return this._dateFormats.display.datetimeInput;
|
|
3865
|
+
case "time": return this._dateFormats.display.timeInput;
|
|
3866
|
+
case "month": return this._dateFormats.display.monthInput;
|
|
3867
|
+
case "year": return this._dateFormats.display.yearInput;
|
|
3868
|
+
default: return this._dateFormats.display.dateInput;
|
|
3869
|
+
}
|
|
3870
|
+
}
|
|
3871
|
+
_getParseFormat() {
|
|
3872
|
+
const picker = this.datetimepicker();
|
|
3873
|
+
if (!picker) return this._dateFormats.parse.dateInput;
|
|
3874
|
+
let parseFormat = this._dateFormats.parse.dateInput;
|
|
3875
|
+
switch (picker.type()) {
|
|
3876
|
+
case "date":
|
|
3877
|
+
parseFormat = this._dateFormats.parse.dateInput;
|
|
3878
|
+
break;
|
|
3879
|
+
case "datetime":
|
|
3880
|
+
parseFormat = this._dateFormats.parse.datetimeInput;
|
|
3881
|
+
break;
|
|
3882
|
+
case "time":
|
|
3883
|
+
parseFormat = this._dateFormats.parse.timeInput;
|
|
3884
|
+
break;
|
|
3885
|
+
case "month":
|
|
3886
|
+
parseFormat = this._dateFormats.parse.monthInput;
|
|
3887
|
+
break;
|
|
3888
|
+
case "year": parseFormat = this._dateFormats.parse.yearInput;
|
|
3889
|
+
}
|
|
3890
|
+
return parseFormat;
|
|
3891
|
+
}
|
|
3892
|
+
_formatValue(value) {
|
|
3893
|
+
this._elementRef.nativeElement.value = value ? this._dateAdapter.format(value, this._getDisplayFormat()) : "";
|
|
3894
|
+
}
|
|
3895
|
+
static {
|
|
3896
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
3897
|
+
minVersion: "12.0.0",
|
|
3898
|
+
version: "22.3.0",
|
|
3899
|
+
ngImport: i0,
|
|
3900
|
+
type: CmatDatetimepickerInputDirective,
|
|
3901
|
+
deps: [],
|
|
3902
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
3903
|
+
});
|
|
3904
|
+
}
|
|
3905
|
+
static {
|
|
3906
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
3907
|
+
minVersion: "17.1.0",
|
|
3908
|
+
version: "22.3.0",
|
|
3909
|
+
type: CmatDatetimepickerInputDirective,
|
|
3910
|
+
isStandalone: true,
|
|
3911
|
+
selector: "input[cmatDatetimepicker]",
|
|
3912
|
+
inputs: {
|
|
3913
|
+
cmatDatetimepicker: {
|
|
3914
|
+
classPropertyName: "cmatDatetimepicker",
|
|
3915
|
+
publicName: "cmatDatetimepicker",
|
|
3916
|
+
isSignal: true,
|
|
3917
|
+
isRequired: false,
|
|
3918
|
+
transformFunction: null
|
|
3919
|
+
},
|
|
3920
|
+
cmatDatepickerFilter: {
|
|
3921
|
+
classPropertyName: "cmatDatepickerFilter",
|
|
3922
|
+
publicName: "cmatDatepickerFilter",
|
|
3923
|
+
isSignal: true,
|
|
3924
|
+
isRequired: false,
|
|
3925
|
+
transformFunction: null
|
|
3926
|
+
},
|
|
3927
|
+
min: {
|
|
3928
|
+
classPropertyName: "min",
|
|
3929
|
+
publicName: "min",
|
|
3930
|
+
isSignal: true,
|
|
3931
|
+
isRequired: false,
|
|
3932
|
+
transformFunction: null
|
|
3933
|
+
},
|
|
3934
|
+
max: {
|
|
3935
|
+
classPropertyName: "max",
|
|
3936
|
+
publicName: "max",
|
|
3937
|
+
isSignal: true,
|
|
3938
|
+
isRequired: false,
|
|
3939
|
+
transformFunction: null
|
|
3940
|
+
},
|
|
3941
|
+
disabled: {
|
|
3942
|
+
classPropertyName: "disabled",
|
|
3943
|
+
publicName: "disabled",
|
|
3944
|
+
isSignal: true,
|
|
3945
|
+
isRequired: false,
|
|
3946
|
+
transformFunction: null
|
|
3947
|
+
},
|
|
3948
|
+
value: {
|
|
3949
|
+
classPropertyName: "value",
|
|
3950
|
+
publicName: "value",
|
|
3951
|
+
isSignal: true,
|
|
3952
|
+
isRequired: false,
|
|
3953
|
+
transformFunction: null
|
|
3954
|
+
}
|
|
3955
|
+
},
|
|
3956
|
+
outputs: {
|
|
3957
|
+
dateChange: "dateChange",
|
|
3958
|
+
dateInput: "dateInput"
|
|
3959
|
+
},
|
|
3960
|
+
host: {
|
|
3961
|
+
listeners: {
|
|
3962
|
+
"input": "onInput($event.target.value)",
|
|
3963
|
+
"change": "onChange()",
|
|
3964
|
+
"blur": "onBlur()",
|
|
3965
|
+
"keydown": "onKeydown($event)"
|
|
3966
|
+
},
|
|
3967
|
+
properties: {
|
|
3968
|
+
"attr.aria-haspopup": "true",
|
|
3969
|
+
"attr.aria-owns": "(datetimepicker()?.opened() && datetimepicker()?.id) || null",
|
|
3970
|
+
"attr.min": "min() ? datetimepicker()?.toIso8601(min()) : null",
|
|
3971
|
+
"attr.max": "max() ? datetimepicker()?.toIso8601(max()) : null",
|
|
3972
|
+
"disabled": "_effectiveDisabled()"
|
|
3973
|
+
}
|
|
3974
|
+
},
|
|
3975
|
+
providers: [
|
|
3976
|
+
CMAT_DATETIMEPICKER_VALUE_ACCESSOR,
|
|
3977
|
+
CMAT_DATETIMEPICKER_VALIDATORS,
|
|
3978
|
+
{
|
|
3979
|
+
provide: MAT_INPUT_VALUE_ACCESSOR,
|
|
3980
|
+
useExisting: CmatDatetimepickerInputDirective
|
|
3981
|
+
}
|
|
3982
|
+
],
|
|
3983
|
+
exportAs: ["cmatDatepickerInput"],
|
|
3984
|
+
ngImport: i0
|
|
3985
|
+
});
|
|
3986
|
+
}
|
|
3987
|
+
};
|
|
3988
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
3989
|
+
minVersion: "12.0.0",
|
|
3990
|
+
version: "22.3.0",
|
|
3991
|
+
ngImport: i0,
|
|
3992
|
+
type: CmatDatetimepickerInputDirective,
|
|
3993
|
+
decorators: [{
|
|
3994
|
+
type: Directive,
|
|
3995
|
+
args: [{
|
|
3996
|
+
selector: "input[cmatDatetimepicker]",
|
|
3997
|
+
providers: [
|
|
3998
|
+
CMAT_DATETIMEPICKER_VALUE_ACCESSOR,
|
|
3999
|
+
CMAT_DATETIMEPICKER_VALIDATORS,
|
|
4000
|
+
{
|
|
4001
|
+
provide: MAT_INPUT_VALUE_ACCESSOR,
|
|
4002
|
+
useExisting: CmatDatetimepickerInputDirective
|
|
4003
|
+
}
|
|
4004
|
+
],
|
|
4005
|
+
host: {
|
|
4006
|
+
"[attr.aria-haspopup]": "true",
|
|
4007
|
+
"[attr.aria-owns]": "(datetimepicker()?.opened() && datetimepicker()?.id) || null",
|
|
4008
|
+
"[attr.min]": "min() ? datetimepicker()?.toIso8601(min()) : null",
|
|
4009
|
+
"[attr.max]": "max() ? datetimepicker()?.toIso8601(max()) : null",
|
|
4010
|
+
"[disabled]": "_effectiveDisabled()",
|
|
4011
|
+
"(input)": "onInput($event.target.value)",
|
|
4012
|
+
"(change)": "onChange()",
|
|
4013
|
+
"(blur)": "onBlur()",
|
|
4014
|
+
"(keydown)": "onKeydown($event)"
|
|
4015
|
+
},
|
|
4016
|
+
exportAs: "cmatDatepickerInput"
|
|
4017
|
+
}]
|
|
4018
|
+
}],
|
|
4019
|
+
ctorParameters: () => [],
|
|
4020
|
+
propDecorators: {
|
|
4021
|
+
dateChange: [{
|
|
4022
|
+
type: i0.Output,
|
|
4023
|
+
args: ["dateChange"]
|
|
4024
|
+
}],
|
|
4025
|
+
dateInput: [{
|
|
4026
|
+
type: i0.Output,
|
|
4027
|
+
args: ["dateInput"]
|
|
4028
|
+
}],
|
|
4029
|
+
cmatDatetimepicker: [{
|
|
4030
|
+
type: i0.Input,
|
|
4031
|
+
args: [{
|
|
4032
|
+
isSignal: true,
|
|
4033
|
+
alias: "cmatDatetimepicker",
|
|
4034
|
+
required: false
|
|
4035
|
+
}]
|
|
4036
|
+
}],
|
|
4037
|
+
cmatDatepickerFilter: [{
|
|
4038
|
+
type: i0.Input,
|
|
4039
|
+
args: [{
|
|
4040
|
+
isSignal: true,
|
|
4041
|
+
alias: "cmatDatepickerFilter",
|
|
4042
|
+
required: false
|
|
4043
|
+
}]
|
|
4044
|
+
}],
|
|
4045
|
+
min: [{
|
|
4046
|
+
type: i0.Input,
|
|
4047
|
+
args: [{
|
|
4048
|
+
isSignal: true,
|
|
4049
|
+
alias: "min",
|
|
4050
|
+
required: false
|
|
4051
|
+
}]
|
|
4052
|
+
}],
|
|
4053
|
+
max: [{
|
|
4054
|
+
type: i0.Input,
|
|
4055
|
+
args: [{
|
|
4056
|
+
isSignal: true,
|
|
4057
|
+
alias: "max",
|
|
4058
|
+
required: false
|
|
4059
|
+
}]
|
|
4060
|
+
}],
|
|
4061
|
+
disabled: [{
|
|
4062
|
+
type: i0.Input,
|
|
4063
|
+
args: [{
|
|
4064
|
+
isSignal: true,
|
|
4065
|
+
alias: "disabled",
|
|
4066
|
+
required: false
|
|
4067
|
+
}]
|
|
4068
|
+
}],
|
|
4069
|
+
value: [{
|
|
4070
|
+
type: i0.Input,
|
|
4071
|
+
args: [{
|
|
4072
|
+
isSignal: true,
|
|
4073
|
+
alias: "value",
|
|
4074
|
+
required: false
|
|
4075
|
+
}]
|
|
4076
|
+
}]
|
|
4077
|
+
}
|
|
4078
|
+
});
|
|
4079
|
+
var CmatDatetimepickerToggleIconDirective = class CmatDatetimepickerToggleIconDirective {
|
|
4080
|
+
static {
|
|
4081
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4082
|
+
minVersion: "12.0.0",
|
|
4083
|
+
version: "22.3.0",
|
|
4084
|
+
ngImport: i0,
|
|
4085
|
+
type: CmatDatetimepickerToggleIconDirective,
|
|
4086
|
+
deps: [],
|
|
4087
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
4088
|
+
});
|
|
4089
|
+
}
|
|
4090
|
+
static {
|
|
4091
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
4092
|
+
minVersion: "14.0.0",
|
|
4093
|
+
version: "22.3.0",
|
|
4094
|
+
type: CmatDatetimepickerToggleIconDirective,
|
|
4095
|
+
isStandalone: true,
|
|
4096
|
+
selector: "[cmatDatetimepickerToggleIcon]",
|
|
4097
|
+
ngImport: i0
|
|
4098
|
+
});
|
|
4099
|
+
}
|
|
4100
|
+
};
|
|
4101
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
4102
|
+
minVersion: "12.0.0",
|
|
4103
|
+
version: "22.3.0",
|
|
4104
|
+
ngImport: i0,
|
|
4105
|
+
type: CmatDatetimepickerToggleIconDirective,
|
|
4106
|
+
decorators: [{
|
|
4107
|
+
type: Directive,
|
|
4108
|
+
args: [{ selector: "[cmatDatetimepickerToggleIcon]" }]
|
|
4109
|
+
}]
|
|
4110
|
+
});
|
|
4111
|
+
var CmatDatetimepickerToggleComponent = class CmatDatetimepickerToggleComponent {
|
|
4112
|
+
constructor() {
|
|
4113
|
+
this.customIcon = contentChild(CmatDatetimepickerToggleIconDirective, ...ngDevMode ? [{ debugName: "customIcon" }] : /* istanbul ignore next */ []);
|
|
4114
|
+
this.button = viewChild("button", ...ngDevMode ? [{ debugName: "button" }] : /* istanbul ignore next */ []);
|
|
4115
|
+
this.datetimepicker = input.required({
|
|
4116
|
+
...ngDevMode ? { debugName: "datetimepicker" } : /* istanbul ignore next */ {},
|
|
4117
|
+
alias: "for"
|
|
4118
|
+
});
|
|
4119
|
+
this.tabIndex = input(0, ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
|
|
4120
|
+
this.ariaLabel = input(void 0, {
|
|
4121
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
4122
|
+
alias: "aria-label"
|
|
4123
|
+
});
|
|
4124
|
+
this.disableRipple = input(false, ...ngDevMode ? [{ debugName: "disableRipple" }] : /* istanbul ignore next */ []);
|
|
4125
|
+
this.disabled = input(void 0, {
|
|
4126
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
4127
|
+
transform: coerceBooleanProperty
|
|
4128
|
+
});
|
|
4129
|
+
this.isDisabled = computed(() => {
|
|
4130
|
+
const disabledValue = this.disabled();
|
|
4131
|
+
const picker = this.datetimepicker();
|
|
4132
|
+
return disabledValue === void 0 ? picker?.disabled() : !!disabledValue;
|
|
4133
|
+
}, ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
4134
|
+
this.refreshVersion = signal(0, ...ngDevMode ? [{ debugName: "refreshVersion" }] : /* istanbul ignore next */ []);
|
|
4135
|
+
this.intl = inject(CmatDatetimepickerIntl);
|
|
4136
|
+
this._destroyRef = inject(DestroyRef);
|
|
4137
|
+
effect(() => {
|
|
4138
|
+
if (this.datetimepicker()) this._watchStateChanges();
|
|
4139
|
+
});
|
|
4140
|
+
}
|
|
4141
|
+
open(event) {
|
|
4142
|
+
const datetimepicker = this.datetimepicker();
|
|
4143
|
+
if (datetimepicker && !this.isDisabled()) {
|
|
4144
|
+
datetimepicker.open();
|
|
4145
|
+
event.stopPropagation();
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
_watchStateChanges() {
|
|
4149
|
+
const datetimepicker = this.datetimepicker();
|
|
4150
|
+
const datepickerDisabled = datetimepicker?.disabledChange ?? of(false);
|
|
4151
|
+
const inputDisabled = datetimepicker?.datetimepickerInput?.disabledChange ?? of(false);
|
|
4152
|
+
merge(this.intl.changes, datepickerDisabled, inputDisabled).pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => this.refreshVersion.update((value) => value + 1));
|
|
4153
|
+
}
|
|
4154
|
+
static {
|
|
4155
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4156
|
+
minVersion: "12.0.0",
|
|
4157
|
+
version: "22.3.0",
|
|
4158
|
+
ngImport: i0,
|
|
4159
|
+
type: CmatDatetimepickerToggleComponent,
|
|
4160
|
+
deps: [],
|
|
4161
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
4162
|
+
});
|
|
4163
|
+
}
|
|
4164
|
+
static {
|
|
4165
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4166
|
+
minVersion: "17.0.0",
|
|
4167
|
+
version: "22.3.0",
|
|
4168
|
+
type: CmatDatetimepickerToggleComponent,
|
|
4169
|
+
isStandalone: true,
|
|
4170
|
+
selector: "cmat-datetimepicker-toggle",
|
|
4171
|
+
inputs: {
|
|
4172
|
+
datetimepicker: {
|
|
4173
|
+
classPropertyName: "datetimepicker",
|
|
4174
|
+
publicName: "for",
|
|
4175
|
+
isSignal: true,
|
|
4176
|
+
isRequired: true,
|
|
4177
|
+
transformFunction: null
|
|
4178
|
+
},
|
|
4179
|
+
tabIndex: {
|
|
4180
|
+
classPropertyName: "tabIndex",
|
|
4181
|
+
publicName: "tabIndex",
|
|
4182
|
+
isSignal: true,
|
|
4183
|
+
isRequired: false,
|
|
4184
|
+
transformFunction: null
|
|
4185
|
+
},
|
|
4186
|
+
ariaLabel: {
|
|
4187
|
+
classPropertyName: "ariaLabel",
|
|
4188
|
+
publicName: "aria-label",
|
|
4189
|
+
isSignal: true,
|
|
4190
|
+
isRequired: false,
|
|
4191
|
+
transformFunction: null
|
|
4192
|
+
},
|
|
4193
|
+
disableRipple: {
|
|
4194
|
+
classPropertyName: "disableRipple",
|
|
4195
|
+
publicName: "disableRipple",
|
|
4196
|
+
isSignal: true,
|
|
4197
|
+
isRequired: false,
|
|
4198
|
+
transformFunction: null
|
|
4199
|
+
},
|
|
4200
|
+
disabled: {
|
|
4201
|
+
classPropertyName: "disabled",
|
|
4202
|
+
publicName: "disabled",
|
|
4203
|
+
isSignal: true,
|
|
4204
|
+
isRequired: false,
|
|
4205
|
+
transformFunction: null
|
|
4206
|
+
}
|
|
4207
|
+
},
|
|
4208
|
+
host: { classAttribute: "cmat-datetimepicker-toggle" },
|
|
4209
|
+
queries: [{
|
|
4210
|
+
propertyName: "customIcon",
|
|
4211
|
+
first: true,
|
|
4212
|
+
predicate: CmatDatetimepickerToggleIconDirective,
|
|
4213
|
+
descendants: true,
|
|
4214
|
+
isSignal: true
|
|
4215
|
+
}],
|
|
4216
|
+
viewQueries: [{
|
|
4217
|
+
propertyName: "button",
|
|
4218
|
+
first: true,
|
|
4219
|
+
predicate: ["button"],
|
|
4220
|
+
descendants: true,
|
|
4221
|
+
isSignal: true
|
|
4222
|
+
}],
|
|
4223
|
+
exportAs: ["cmatDatetimepickerToggle"],
|
|
4224
|
+
ngImport: i0,
|
|
4225
|
+
template: "<button\r\n type=\"button\"\r\n matIconButton\r\n class=\"mx-1\"\r\n [attr.data-refresh]=\"refreshVersion()\"\r\n [attr.aria-haspopup]=\"datetimepicker() ? 'dialog' : null\"\r\n [attr.aria-label]=\"ariaLabel() || intl.openCalendarLabel\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabIndex()\"\r\n [disabled]=\"disabled()\"\r\n [disableRipple]=\"disableRipple()\"\r\n (click)=\"open($event)\"\r\n>\r\n @if (!customIcon()) { @switch (datetimepicker().type()) { @case ('time') {\r\n <svg\r\n class=\"mat-icon cmat-datetimepicker-toggle-default-icon\"\r\n viewBox=\"0 0 24 24\"\r\n width=\"24px\"\r\n height=\"24px\"\r\n fill=\"currentColor\"\r\n focusable=\"false\"\r\n >\r\n <path\r\n d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\"\r\n ></path>\r\n </svg>\r\n } @case ('datetime') {\r\n <svg\r\n class=\"mat-icon cmat-datetimepicker-toggle-default-icon\"\r\n viewBox=\"0 0 24 24\"\r\n width=\"24px\"\r\n height=\"24px\"\r\n fill=\"currentColor\"\r\n focusable=\"false\"\r\n >\r\n <path\r\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\"\r\n ></path>\r\n </svg>\r\n } @default {\r\n <svg\r\n class=\"mat-icon cmat-datetimepicker-toggle-default-icon\"\r\n viewBox=\"0 0 24 24\"\r\n width=\"24px\"\r\n height=\"24px\"\r\n fill=\"currentColor\"\r\n focusable=\"false\"\r\n >\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n <path\r\n d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\"\r\n />\r\n </svg>\r\n } } }\r\n\r\n <ng-content select=\"[cmatDatetimepickerToggleIcon]\"></ng-content>\r\n</button>\r\n",
|
|
4226
|
+
dependencies: [{
|
|
4227
|
+
kind: "ngmodule",
|
|
4228
|
+
type: MatButtonModule
|
|
4229
|
+
}, {
|
|
4230
|
+
kind: "component",
|
|
4231
|
+
type: i1$1.MatIconButton,
|
|
4232
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
4233
|
+
exportAs: ["matButton", "matAnchor"]
|
|
4234
|
+
}],
|
|
4235
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
4236
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
4237
|
+
});
|
|
4238
|
+
}
|
|
4239
|
+
};
|
|
4240
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
4241
|
+
minVersion: "12.0.0",
|
|
4242
|
+
version: "22.3.0",
|
|
4243
|
+
ngImport: i0,
|
|
4244
|
+
type: CmatDatetimepickerToggleComponent,
|
|
4245
|
+
decorators: [{
|
|
4246
|
+
type: Component,
|
|
4247
|
+
args: [{
|
|
4248
|
+
selector: "cmat-datetimepicker-toggle",
|
|
4249
|
+
exportAs: "cmatDatetimepickerToggle",
|
|
4250
|
+
encapsulation: ViewEncapsulation.None,
|
|
4251
|
+
preserveWhitespaces: false,
|
|
4252
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4253
|
+
imports: [MatButtonModule],
|
|
4254
|
+
host: { "class": "cmat-datetimepicker-toggle" },
|
|
4255
|
+
template: "<button\r\n type=\"button\"\r\n matIconButton\r\n class=\"mx-1\"\r\n [attr.data-refresh]=\"refreshVersion()\"\r\n [attr.aria-haspopup]=\"datetimepicker() ? 'dialog' : null\"\r\n [attr.aria-label]=\"ariaLabel() || intl.openCalendarLabel\"\r\n [attr.tabindex]=\"disabled() ? -1 : tabIndex()\"\r\n [disabled]=\"disabled()\"\r\n [disableRipple]=\"disableRipple()\"\r\n (click)=\"open($event)\"\r\n>\r\n @if (!customIcon()) { @switch (datetimepicker().type()) { @case ('time') {\r\n <svg\r\n class=\"mat-icon cmat-datetimepicker-toggle-default-icon\"\r\n viewBox=\"0 0 24 24\"\r\n width=\"24px\"\r\n height=\"24px\"\r\n fill=\"currentColor\"\r\n focusable=\"false\"\r\n >\r\n <path\r\n d=\"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z\"\r\n ></path>\r\n </svg>\r\n } @case ('datetime') {\r\n <svg\r\n class=\"mat-icon cmat-datetimepicker-toggle-default-icon\"\r\n viewBox=\"0 0 24 24\"\r\n width=\"24px\"\r\n height=\"24px\"\r\n fill=\"currentColor\"\r\n focusable=\"false\"\r\n >\r\n <path\r\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\"\r\n ></path>\r\n </svg>\r\n } @default {\r\n <svg\r\n class=\"mat-icon cmat-datetimepicker-toggle-default-icon\"\r\n viewBox=\"0 0 24 24\"\r\n width=\"24px\"\r\n height=\"24px\"\r\n fill=\"currentColor\"\r\n focusable=\"false\"\r\n >\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n <path\r\n d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\"\r\n />\r\n </svg>\r\n } } }\r\n\r\n <ng-content select=\"[cmatDatetimepickerToggleIcon]\"></ng-content>\r\n</button>\r\n"
|
|
4256
|
+
}]
|
|
4257
|
+
}],
|
|
4258
|
+
ctorParameters: () => [],
|
|
4259
|
+
propDecorators: {
|
|
4260
|
+
customIcon: [{
|
|
4261
|
+
type: i0.ContentChild,
|
|
4262
|
+
args: [i0.forwardRef(() => CmatDatetimepickerToggleIconDirective), { isSignal: true }]
|
|
4263
|
+
}],
|
|
4264
|
+
button: [{
|
|
4265
|
+
type: i0.ViewChild,
|
|
4266
|
+
args: ["button", { isSignal: true }]
|
|
4267
|
+
}],
|
|
4268
|
+
datetimepicker: [{
|
|
4269
|
+
type: i0.Input,
|
|
4270
|
+
args: [{
|
|
4271
|
+
isSignal: true,
|
|
4272
|
+
alias: "for",
|
|
4273
|
+
required: true
|
|
4274
|
+
}]
|
|
4275
|
+
}],
|
|
4276
|
+
tabIndex: [{
|
|
4277
|
+
type: i0.Input,
|
|
4278
|
+
args: [{
|
|
4279
|
+
isSignal: true,
|
|
4280
|
+
alias: "tabIndex",
|
|
4281
|
+
required: false
|
|
4282
|
+
}]
|
|
4283
|
+
}],
|
|
4284
|
+
ariaLabel: [{
|
|
4285
|
+
type: i0.Input,
|
|
4286
|
+
args: [{
|
|
4287
|
+
isSignal: true,
|
|
4288
|
+
alias: "aria-label",
|
|
4289
|
+
required: false
|
|
4290
|
+
}]
|
|
4291
|
+
}],
|
|
4292
|
+
disableRipple: [{
|
|
4293
|
+
type: i0.Input,
|
|
4294
|
+
args: [{
|
|
4295
|
+
isSignal: true,
|
|
4296
|
+
alias: "disableRipple",
|
|
4297
|
+
required: false
|
|
4298
|
+
}]
|
|
4299
|
+
}],
|
|
4300
|
+
disabled: [{
|
|
4301
|
+
type: i0.Input,
|
|
4302
|
+
args: [{
|
|
4303
|
+
isSignal: true,
|
|
4304
|
+
alias: "disabled",
|
|
4305
|
+
required: false
|
|
4306
|
+
}]
|
|
4307
|
+
}]
|
|
4308
|
+
}
|
|
4309
|
+
});
|
|
4310
|
+
export { CmatDatetimepickerFilterType as S, CLOCK_INNER_RADIUS as _, CmatDatetimepickerInputDirective as a, CLOCK_TICK_RADIUS as b, CMAT_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY as c, CmatDatetimepickerContentComponent as d, CmatDatetimepickerCalendarComponent as f, CmatDatetimepickerCalendarCellComponent as g, CmatDatetimepickerCalendarBodyComponent as h, CMAT_DATETIMEPICKER_VALUE_ACCESSOR as i, CMAT_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER as l, CmatDatetimepickerMonthViewComponent as m, CmatDatetimepickerToggleIconDirective as n, CmatDatetimepickerInputEvent as o, CmatDatetimepickerYearViewComponent as p, CMAT_DATETIMEPICKER_VALIDATORS as r, CMAT_DATETIMEPICKER_SCROLL_STRATEGY as s, CmatDatetimepickerToggleComponent as t, CmatDatetimepickerComponent as u, CLOCK_OUTER_RADIUS as v, CmatDatetimepickerClockComponent as x, CLOCK_RADIUS as y };
|
|
4311
|
+
|
|
4312
|
+
//# sourceMappingURL=public-api-BmMqKDzm.mjs.map
|