cmat 0.0.29 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/adapter/index.d.ts +8 -9
- package/components/breadcrumb/index.d.ts +2 -4
- package/components/carousel/index.d.ts +3 -5
- package/components/cascade/index.d.ts +6 -7
- package/components/chip-input/index.d.ts +2 -2
- package/components/custom-formly/index.d.ts +41 -49
- package/components/date-range/index.d.ts +5 -6
- package/components/drawer/index.d.ts +30 -34
- package/components/fullscreen/index.d.ts +1 -2
- package/components/highlight/index.d.ts +12 -14
- package/components/image-viewer/index.d.ts +4 -5
- package/components/json-editor/index.d.ts +2 -3
- package/components/knob-input/index.d.ts +8 -8
- package/components/material-color-picker/index.d.ts +3 -3
- package/components/material-datetimepicker/index.d.ts +89 -93
- package/components/navigation/index.d.ts +82 -88
- package/components/opt-input/index.d.ts +6 -6
- package/components/pagination/index.d.ts +6 -9
- package/components/popover/index.d.ts +13 -16
- package/components/progress-bar/index.d.ts +3 -5
- package/components/rating/index.d.ts +5 -5
- package/components/select-search/index.d.ts +16 -17
- package/components/select-table/index.d.ts +6 -6
- package/components/select-tree/index.d.ts +7 -6
- package/components/speed-dial/index.d.ts +2 -3
- package/components/timeline/index.d.ts +2 -3
- package/components/toast/index.d.ts +14 -16
- package/components/transfer-picker/index.d.ts +43 -44
- package/components/treetable/index.d.ts +2 -3
- package/components/upload/index.d.ts +23 -27
- package/directives/animate-on-scroll/index.d.ts +4 -19
- package/directives/arrow-cursor/index.d.ts +2 -4
- package/directives/autofocus/index.d.ts +2 -2
- package/directives/data-exporter/index.d.ts +2 -15
- package/directives/digit-only/index.d.ts +4 -4
- package/directives/equal-validator/index.d.ts +1 -2
- package/fesm2022/cmat-components-adapter.mjs +22 -39
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +19 -21
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +3 -3
- package/fesm2022/cmat-components-carousel.mjs +112 -127
- package/fesm2022/cmat-components-carousel.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +61 -73
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +14 -18
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +167 -169
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
- package/fesm2022/cmat-components-date-range.mjs +17 -17
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +17 -19
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +7 -10
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +14 -14
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-image-viewer.mjs +9 -12
- package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
- 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 +12 -19
- package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
- package/fesm2022/cmat-components-masonry.mjs +3 -3
- package/fesm2022/cmat-components-material-color-picker.mjs +8 -7
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +166 -216
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +108 -112
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-opt-input.mjs +13 -20
- package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
- package/fesm2022/cmat-components-org-chart.mjs +9 -9
- package/fesm2022/cmat-components-pagination.mjs +32 -34
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +9 -9
- package/fesm2022/cmat-components-popover.mjs +27 -32
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +10 -10
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +10 -14
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +30 -53
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-table.mjs +28 -33
- package/fesm2022/cmat-components-select-table.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +55 -61
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-speed-dial.mjs +13 -13
- package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +18 -20
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +16 -16
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +47 -47
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-treetable.mjs +11 -12
- package/fesm2022/cmat-components-treetable.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +32 -33
- package/fesm2022/cmat-components-upload.mjs.map +1 -1
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +13 -14
- package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/cmat-directives-arrow-cursor.mjs +11 -14
- package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
- package/fesm2022/cmat-directives-autofocus.mjs +8 -9
- package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
- package/fesm2022/cmat-directives-data-exporter.mjs +28 -28
- package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
- package/fesm2022/cmat-directives-debounce.mjs +11 -13
- package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
- package/fesm2022/cmat-directives-digit-only.mjs +17 -17
- package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
- package/fesm2022/cmat-directives-equal-validator.mjs +9 -16
- package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
- package/fesm2022/cmat-lib-mock-api.mjs +11 -14
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-bytes.mjs +4 -5
- package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
- package/fesm2022/cmat-pipes-date-format.mjs +4 -5
- package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
- package/fesm2022/cmat-pipes-find-by-key.mjs +4 -5
- package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
- package/fesm2022/cmat-pipes-group-by.mjs +4 -5
- package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
- package/fesm2022/cmat-pipes-keys.mjs +4 -5
- package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
- package/fesm2022/cmat-pipes-secure.mjs +13 -14
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +4 -5
- package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
- package/fesm2022/cmat-services-alert.mjs +3 -3
- package/fesm2022/cmat-services-config.mjs +10 -12
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +17 -20
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +10 -11
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-export-as.mjs +3 -3
- package/fesm2022/cmat-services-loading.mjs +14 -14
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs +10 -10
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +8 -8
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +9 -13
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +10 -11
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +8 -8
- package/fesm2022/cmat-services-translation.mjs.map +1 -1
- package/fesm2022/cmat-services-utils.mjs +3 -3
- package/lib/mock-api/index.d.ts +0 -1
- package/package.json +52 -52
- package/pipes/secure/index.d.ts +2 -4
- package/services/config/index.d.ts +1 -1
- package/services/confirmation/index.d.ts +2 -4
- package/services/data/index.d.ts +1 -3
- package/services/loading/index.d.ts +3 -4
- package/services/media-watcher/index.d.ts +2 -3
- package/services/platform/index.d.ts +2 -3
- package/services/splash-screen/index.d.ts +1 -2
- package/services/title/index.d.ts +3 -5
- package/services/translation/index.d.ts +1 -2
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { NgStyle, NgClass } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { EventEmitter, HostListener, Input, HostBinding, Output, ChangeDetectionStrategy, ViewEncapsulation, Component,
|
|
4
|
-
import
|
|
5
|
-
import { CMAT_DATETIME_FORMATS } from 'cmat/components/adapter';
|
|
3
|
+
import { EventEmitter, inject, ElementRef, HostListener, Input, HostBinding, Output, ChangeDetectionStrategy, ViewEncapsulation, Component, Injectable, ChangeDetectorRef, Directive, ViewChild, InjectionToken, Injector, ViewContainerRef, DOCUMENT, afterNextRender, forwardRef, ContentChild } from '@angular/core';
|
|
4
|
+
import { DatetimeAdapter, CMAT_DATETIME_FORMATS } from 'cmat/components/adapter';
|
|
6
5
|
import { coerceNumberProperty, coerceBooleanProperty, coerceStringArray } from '@angular/cdk/coercion';
|
|
7
|
-
import * as
|
|
6
|
+
import * as i1 from '@angular/material/button';
|
|
8
7
|
import { MatButtonModule } from '@angular/material/button';
|
|
9
8
|
import { trigger, transition, animate, keyframes, style, state } from '@angular/animations';
|
|
10
9
|
import { Subject, Subscription, merge, of } from 'rxjs';
|
|
11
10
|
import * as i1$1 from '@angular/cdk/a11y';
|
|
12
11
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
12
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
13
13
|
import { hasModifierKey } from '@angular/cdk/keycodes';
|
|
14
|
-
import * as i2 from '@angular/cdk/overlay';
|
|
15
14
|
import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
|
16
15
|
import { _getFocusedElementPierceShadowDom } from '@angular/cdk/platform';
|
|
17
16
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
18
17
|
import { take, filter } from 'rxjs/operators';
|
|
19
|
-
import * as i4 from '@angular/cdk/bidi';
|
|
20
18
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators } from '@angular/forms';
|
|
19
|
+
import { MatFormField } from '@angular/material/form-field';
|
|
21
20
|
import { MAT_INPUT_VALUE_ACCESSOR } from '@angular/material/input';
|
|
22
|
-
import * as i2$1 from '@angular/material/form-field';
|
|
23
21
|
|
|
24
22
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
25
23
|
var CmatDatetimepickerFilterType;
|
|
@@ -37,9 +35,7 @@ const CLOCK_TICK_RADIUS = 7.0833;
|
|
|
37
35
|
* A clock that is used as part of the datepicker.
|
|
38
36
|
*/
|
|
39
37
|
class CmatDatetimepickerClockComponent {
|
|
40
|
-
constructor(
|
|
41
|
-
this._element = _element;
|
|
42
|
-
this._adapter = _adapter;
|
|
38
|
+
constructor() {
|
|
43
39
|
this.userSelection = new EventEmitter();
|
|
44
40
|
this.interval = 1;
|
|
45
41
|
this.twelvehour = false;
|
|
@@ -53,6 +49,8 @@ class CmatDatetimepickerClockComponent {
|
|
|
53
49
|
this.minutes = [];
|
|
54
50
|
/** Whether the clock is in hour view. */
|
|
55
51
|
this.hourView = true;
|
|
52
|
+
this._element = inject(ElementRef);
|
|
53
|
+
this._adapter = inject(DatetimeAdapter);
|
|
56
54
|
this._timeChanged = false;
|
|
57
55
|
this._mouseMoveListener = (event) => {
|
|
58
56
|
this.handleMousemove(event);
|
|
@@ -273,13 +271,13 @@ class CmatDatetimepickerClockComponent {
|
|
|
273
271
|
this.activeDate = date;
|
|
274
272
|
this.activeDateChange.emit(this.activeDate);
|
|
275
273
|
}
|
|
276
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
277
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.
|
|
274
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerClockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
275
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.2", type: CmatDatetimepickerClockComponent, isStandalone: true, selector: "cmat-datetimepicker-clock", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: "twelvehour", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", startView: "startView" }, outputs: { userSelection: "userSelection", selectedChange: "selectedChange", activeDateChange: "activeDateChange" }, host: { listeners: { "mousedown": "handleMousedown($event)" }, properties: { "role": "this.role", "class": "this.class" } }, exportAs: ["cmatDatetimepickerClock"], ngImport: i0, 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>", 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"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
278
276
|
}
|
|
279
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
277
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerClockComponent, decorators: [{
|
|
280
278
|
type: Component,
|
|
281
279
|
args: [{ selector: 'cmat-datetimepicker-clock', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDatetimepickerClock', imports: [NgStyle], 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>", 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"] }]
|
|
282
|
-
}], ctorParameters: () => [
|
|
280
|
+
}], ctorParameters: () => [], propDecorators: { userSelection: [{
|
|
283
281
|
type: Output
|
|
284
282
|
}], dateFilter: [{
|
|
285
283
|
type: Input
|
|
@@ -353,6 +351,66 @@ function createMissingDateImplError(provider) {
|
|
|
353
351
|
'custom implementation.');
|
|
354
352
|
}
|
|
355
353
|
|
|
354
|
+
class CmatDatetimepickerIntl {
|
|
355
|
+
constructor() {
|
|
356
|
+
/**
|
|
357
|
+
* Stream to emit from when labels are changed. Use this to notify components when the labels have
|
|
358
|
+
* changed after initialization.
|
|
359
|
+
*/
|
|
360
|
+
this.changes = new Subject();
|
|
361
|
+
/** A label for the calendar popup (used by screen readers). */
|
|
362
|
+
this.calendarLabel = '日历';
|
|
363
|
+
/** A label for the button used to open the calendar popup (used by screen readers). */
|
|
364
|
+
this.openCalendarLabel = '打开日历';
|
|
365
|
+
/** Label for the button used to close the calendar popup. */
|
|
366
|
+
this.closeCalendarLabel = '关闭日历';
|
|
367
|
+
/** A label for the previous month button (used by screen readers). */
|
|
368
|
+
this.prevMonthLabel = '上个月';
|
|
369
|
+
/** A label for the next month button (used by screen readers). */
|
|
370
|
+
this.nextMonthLabel = '下个月';
|
|
371
|
+
/** A label for the previous year button (used by screen readers). */
|
|
372
|
+
this.prevYearLabel = '去年';
|
|
373
|
+
/** A label for the next year button (used by screen readers). */
|
|
374
|
+
this.nextYearLabel = '明年';
|
|
375
|
+
/** A label for the previous multi-year button (used by screen readers). */
|
|
376
|
+
this.prevMultiYearLabel = '过去24年';
|
|
377
|
+
/** A label for the next multi-year button (used by screen readers). */
|
|
378
|
+
this.nextMultiYearLabel = '未来24年';
|
|
379
|
+
/** A label for the 'switch to month view' button (used by screen readers). */
|
|
380
|
+
this.switchToMonthViewLabel = '选择日期';
|
|
381
|
+
/** A label for the 'switch to year view' button (used by screen readers). */
|
|
382
|
+
this.switchToYearViewLabel = '选择月份';
|
|
383
|
+
/** A label for the 'switch to multi-year view' button (used by screen readers). */
|
|
384
|
+
this.switchToMultiYearViewLabel = '选择年月';
|
|
385
|
+
/** A label for the first date of a range of dates (used by screen readers). */
|
|
386
|
+
this.startDateLabel = '开始日期';
|
|
387
|
+
/** A label for the last date of a range of dates (used by screen readers). */
|
|
388
|
+
this.endDateLabel = '结束日期';
|
|
389
|
+
/** A label for the 'switch to clock hour view' button (used by screen readers). */
|
|
390
|
+
this.switchToClockHourViewLabel = '选择小时';
|
|
391
|
+
/** A label for the 'switch to clock minute view' button (used by screen readers). */
|
|
392
|
+
this.switchToClockMinuteViewLabel = '选择分钟';
|
|
393
|
+
/** Label used for ok button within the manual time input. */
|
|
394
|
+
this.okLabel = '确认';
|
|
395
|
+
/** Label used for cancel button within the manual time input. */
|
|
396
|
+
this.cancelLabel = '取消';
|
|
397
|
+
}
|
|
398
|
+
/** Formats a range of years (used for visuals). */
|
|
399
|
+
formatYearRange(start, end) {
|
|
400
|
+
return `${start} \u2013 ${end}`;
|
|
401
|
+
}
|
|
402
|
+
/** Formats a label for a range of years (used by screen readers). */
|
|
403
|
+
formatYearRangeLabel(start, end) {
|
|
404
|
+
return `${start} to ${end}`;
|
|
405
|
+
}
|
|
406
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
407
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerIntl, providedIn: 'root' }); }
|
|
408
|
+
}
|
|
409
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerIntl, decorators: [{
|
|
410
|
+
type: Injectable,
|
|
411
|
+
args: [{ providedIn: 'root' }]
|
|
412
|
+
}] });
|
|
413
|
+
|
|
356
414
|
/**
|
|
357
415
|
* An internal class that represents the data corresponding to a single calendar cell.
|
|
358
416
|
*/
|
|
@@ -398,10 +456,10 @@ class CmatDatetimepickerCalendarBodyComponent {
|
|
|
398
456
|
}
|
|
399
457
|
return cellNumber === this.activeCell;
|
|
400
458
|
}
|
|
401
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
402
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.
|
|
459
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerCalendarBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
460
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.2", type: CmatDatetimepickerCalendarBodyComponent, isStandalone: true, selector: "[cmat-datetimepicker-calendar-body]", inputs: { label: "label", rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", allowDisabledSelection: "allowDisabledSelection", activeCell: "activeCell" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { properties: { "class": "this.class" } }, exportAs: ["cmatDatetimepickerCalendarBody"], ngImport: i0, template: "<!--\r\nIf rst row, create a separate label row. We mark this row as\r\naria-hidden because we don't want it to be read out as one of the weeks in the month.\r\n-->\r\n@if (_firstRowOffset < labelMinRequiredCells) {\r\n <tr aria-hidden=\"true\">\r\n <td class=\"cmat-datetimepicker-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\r\n </tr>\r\n}\r\n\r\n<!-- Create the first row separately so we can include a special spacer cell. -->\r\n@for (row of rows; track $index; let rowIndex = $index) {\r\n <tr role=\"row\">\r\n <!--\r\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\r\n -->\r\n @if (rowIndex === 0 && _firstRowOffset) {\r\n <td aria-hidden=\"true\" class=\"cmat-datetimepicker-calendar-body-label\"\r\n [attr.colspan]=\"_firstRowOffset\">\r\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\r\n </td>\r\n }\r\n @for (item of row; track $index; let colIndex = $index) {\r\n <td role=\"presentation\" 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\" (click)=\"cellClicked(item)\">\r\n <div 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 {{ item.displayValue }}\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n}", 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 transparent;border-radius:999px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
403
461
|
}
|
|
404
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
462
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerCalendarBodyComponent, decorators: [{
|
|
405
463
|
type: Component,
|
|
406
464
|
args: [{ selector: '[cmat-datetimepicker-calendar-body]', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDatetimepickerCalendarBody', imports: [], template: "<!--\r\nIf rst row, create a separate label row. We mark this row as\r\naria-hidden because we don't want it to be read out as one of the weeks in the month.\r\n-->\r\n@if (_firstRowOffset < labelMinRequiredCells) {\r\n <tr aria-hidden=\"true\">\r\n <td class=\"cmat-datetimepicker-calendar-body-label\" [attr.colspan]=\"numCols\">{{ label }}</td>\r\n </tr>\r\n}\r\n\r\n<!-- Create the first row separately so we can include a special spacer cell. -->\r\n@for (row of rows; track $index; let rowIndex = $index) {\r\n <tr role=\"row\">\r\n <!--\r\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\r\n -->\r\n @if (rowIndex === 0 && _firstRowOffset) {\r\n <td aria-hidden=\"true\" class=\"cmat-datetimepicker-calendar-body-label\"\r\n [attr.colspan]=\"_firstRowOffset\">\r\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\r\n </td>\r\n }\r\n @for (item of row; track $index; let colIndex = $index) {\r\n <td role=\"presentation\" 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\" (click)=\"cellClicked(item)\">\r\n <div 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 {{ item.displayValue }}\r\n </div>\r\n </td>\r\n }\r\n </tr>\r\n}", 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 transparent;border-radius:999px}\n"] }]
|
|
407
465
|
}], propDecorators: { label: [{
|
|
@@ -432,13 +490,13 @@ const DAYS_PER_WEEK = 7;
|
|
|
432
490
|
* An internal component used to display a single month in the datepicker.
|
|
433
491
|
*/
|
|
434
492
|
class CmatDatetimepickerMonthViewComponent {
|
|
435
|
-
constructor(
|
|
436
|
-
this.adapter = adapter;
|
|
437
|
-
this._dateFormats = _dateFormats;
|
|
493
|
+
constructor() {
|
|
438
494
|
this.type = 'date';
|
|
439
495
|
this.userSelection = new EventEmitter();
|
|
440
496
|
/** Emits when a new date is selected. */
|
|
441
497
|
this.selectedChange = new EventEmitter();
|
|
498
|
+
this.adapter = inject(DatetimeAdapter, { optional: true });
|
|
499
|
+
this._dateFormats = inject(CMAT_DATETIME_FORMATS, { optional: true });
|
|
442
500
|
if (!this.adapter) {
|
|
443
501
|
throw createMissingDateImplError('CDatetimeAdapter');
|
|
444
502
|
}
|
|
@@ -534,20 +592,13 @@ class CmatDatetimepickerMonthViewComponent {
|
|
|
534
592
|
_changeCalendarState(direction) {
|
|
535
593
|
this.calendarState = direction;
|
|
536
594
|
}
|
|
537
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
538
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.
|
|
595
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerMonthViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
596
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.2", type: CmatDatetimepickerMonthViewComponent, isStandalone: true, selector: "cmat-datetimepicker-month-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { userSelection: "userSelection", selectedChange: "selectedChange" }, exportAs: ["cmatDatetimepickerMonthView"], ngImport: i0, 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 cmat-datetimepicker-calendar-body role=\"grid\"\r\n [@slideCalendar]=\"calendarState\" [activeCell]=\"adapter.getDate(activeDate) - 1\" [rows]=\"weeks\"\r\n [selectedValue]=\"selectedDate\" [todayValue]=\"todayDate\" (@slideCalendar.done)=\"calendarStateDone()\" (selectedValueChange)=\"dateSelected($event)\"></tbody>\r\n</table>", dependencies: [{ kind: "component", type: CmatDatetimepickerCalendarBodyComponent, selector: "[cmat-datetimepicker-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["cmatDatetimepickerCalendarBody"] }], animations: [slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
539
597
|
}
|
|
540
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
598
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerMonthViewComponent, decorators: [{
|
|
541
599
|
type: Component,
|
|
542
600
|
args: [{ selector: 'cmat-datetimepicker-month-view', animations: [slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDatetimepickerMonthView', imports: [CmatDatetimepickerCalendarBodyComponent], 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 cmat-datetimepicker-calendar-body role=\"grid\"\r\n [@slideCalendar]=\"calendarState\" [activeCell]=\"adapter.getDate(activeDate) - 1\" [rows]=\"weeks\"\r\n [selectedValue]=\"selectedDate\" [todayValue]=\"todayDate\" (@slideCalendar.done)=\"calendarStateDone()\" (selectedValueChange)=\"dateSelected($event)\"></tbody>\r\n</table>" }]
|
|
543
|
-
}], ctorParameters: () => [
|
|
544
|
-
type: Optional
|
|
545
|
-
}] }, { type: undefined, decorators: [{
|
|
546
|
-
type: Optional
|
|
547
|
-
}, {
|
|
548
|
-
type: Inject,
|
|
549
|
-
args: [CMAT_DATETIME_FORMATS]
|
|
550
|
-
}] }], propDecorators: { type: [{
|
|
601
|
+
}], ctorParameters: () => [], propDecorators: { type: [{
|
|
551
602
|
type: Input
|
|
552
603
|
}], userSelection: [{
|
|
553
604
|
type: Output
|
|
@@ -567,13 +618,13 @@ const yearsPerRow = 4;
|
|
|
567
618
|
* An internal component used to display multiple years in the datepicker.
|
|
568
619
|
*/
|
|
569
620
|
class CmatDatetimepickerMultiYearViewComponent {
|
|
570
|
-
constructor(
|
|
571
|
-
this.adapter = adapter;
|
|
572
|
-
this._dateFormats = _dateFormats;
|
|
621
|
+
constructor() {
|
|
573
622
|
this.userSelection = new EventEmitter();
|
|
574
623
|
this.type = 'date';
|
|
575
624
|
/** Emits when a new month is selected. */
|
|
576
625
|
this.selectedChange = new EventEmitter();
|
|
626
|
+
this.adapter = inject(DatetimeAdapter, { optional: true });
|
|
627
|
+
this._dateFormats = inject(CMAT_DATETIME_FORMATS, { optional: true });
|
|
577
628
|
if (!this.adapter) {
|
|
578
629
|
throw createMissingDateImplError('CDatetimeAdapter');
|
|
579
630
|
}
|
|
@@ -685,20 +736,13 @@ class CmatDatetimepickerMultiYearViewComponent {
|
|
|
685
736
|
_getValidDateOrNull(obj) {
|
|
686
737
|
return (this.adapter.isDateInstance(obj) && this.adapter.isValid(obj)) ? obj : null;
|
|
687
738
|
}
|
|
688
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
689
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.
|
|
739
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerMultiYearViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
740
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: CmatDatetimepickerMultiYearViewComponent, isStandalone: true, selector: "cmat-datetimepicker-multi-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { userSelection: "userSelection", selectedChange: "selectedChange" }, exportAs: ["cmatDatetimepickerMultiYearView"], ngImport: i0, template: "<table class=\"cmat-datetimepicker-calendar-table\">\r\n <thead class=\"cmat-datetimepicker-calendar-table-header\"></thead>\r\n <tbody cmat-datetimepicker-calendar-body role=\"grid\"\r\n [@slideCalendar]=\"calendarState\" [activeCell]=\"getActiveCell()\" [numCols]=\"4\" [rows]=\"years\"\r\n [selectedValue]=\"selectedYear\" [todayValue]=\"todayYear\" [allowDisabledSelection]=\"true\"\r\n (@slideCalendar.done)=\"calendarStateDone()\" (selectedValueChange)=\"yearSelected($event)\"></tbody>\r\n</table>", dependencies: [{ kind: "component", type: CmatDatetimepickerCalendarBodyComponent, selector: "[cmat-datetimepicker-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["cmatDatetimepickerCalendarBody"] }], animations: [slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
690
741
|
}
|
|
691
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
742
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerMultiYearViewComponent, decorators: [{
|
|
692
743
|
type: Component,
|
|
693
744
|
args: [{ selector: 'cmat-datetimepicker-multi-year-view', animations: [slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDatetimepickerMultiYearView', imports: [CmatDatetimepickerCalendarBodyComponent], template: "<table class=\"cmat-datetimepicker-calendar-table\">\r\n <thead class=\"cmat-datetimepicker-calendar-table-header\"></thead>\r\n <tbody cmat-datetimepicker-calendar-body role=\"grid\"\r\n [@slideCalendar]=\"calendarState\" [activeCell]=\"getActiveCell()\" [numCols]=\"4\" [rows]=\"years\"\r\n [selectedValue]=\"selectedYear\" [todayValue]=\"todayYear\" [allowDisabledSelection]=\"true\"\r\n (@slideCalendar.done)=\"calendarStateDone()\" (selectedValueChange)=\"yearSelected($event)\"></tbody>\r\n</table>" }]
|
|
694
|
-
}], ctorParameters: () => [
|
|
695
|
-
type: Optional
|
|
696
|
-
}] }, { type: undefined, decorators: [{
|
|
697
|
-
type: Optional
|
|
698
|
-
}, {
|
|
699
|
-
type: Inject,
|
|
700
|
-
args: [CMAT_DATETIME_FORMATS]
|
|
701
|
-
}] }], propDecorators: { userSelection: [{
|
|
745
|
+
}], ctorParameters: () => [], propDecorators: { userSelection: [{
|
|
702
746
|
type: Output
|
|
703
747
|
}], type: [{
|
|
704
748
|
type: Input
|
|
@@ -751,66 +795,6 @@ function euclideanModulo(a, b) {
|
|
|
751
795
|
return (a % b + b) % b;
|
|
752
796
|
}
|
|
753
797
|
|
|
754
|
-
class CmatDatetimepickerIntl {
|
|
755
|
-
constructor() {
|
|
756
|
-
/**
|
|
757
|
-
* Stream to emit from when labels are changed. Use this to notify components when the labels have
|
|
758
|
-
* changed after initialization.
|
|
759
|
-
*/
|
|
760
|
-
this.changes = new Subject();
|
|
761
|
-
/** A label for the calendar popup (used by screen readers). */
|
|
762
|
-
this.calendarLabel = '日历';
|
|
763
|
-
/** A label for the button used to open the calendar popup (used by screen readers). */
|
|
764
|
-
this.openCalendarLabel = '打开日历';
|
|
765
|
-
/** Label for the button used to close the calendar popup. */
|
|
766
|
-
this.closeCalendarLabel = '关闭日历';
|
|
767
|
-
/** A label for the previous month button (used by screen readers). */
|
|
768
|
-
this.prevMonthLabel = '上个月';
|
|
769
|
-
/** A label for the next month button (used by screen readers). */
|
|
770
|
-
this.nextMonthLabel = '下个月';
|
|
771
|
-
/** A label for the previous year button (used by screen readers). */
|
|
772
|
-
this.prevYearLabel = '去年';
|
|
773
|
-
/** A label for the next year button (used by screen readers). */
|
|
774
|
-
this.nextYearLabel = '明年';
|
|
775
|
-
/** A label for the previous multi-year button (used by screen readers). */
|
|
776
|
-
this.prevMultiYearLabel = '过去24年';
|
|
777
|
-
/** A label for the next multi-year button (used by screen readers). */
|
|
778
|
-
this.nextMultiYearLabel = '未来24年';
|
|
779
|
-
/** A label for the 'switch to month view' button (used by screen readers). */
|
|
780
|
-
this.switchToMonthViewLabel = '选择日期';
|
|
781
|
-
/** A label for the 'switch to year view' button (used by screen readers). */
|
|
782
|
-
this.switchToYearViewLabel = '选择月份';
|
|
783
|
-
/** A label for the 'switch to multi-year view' button (used by screen readers). */
|
|
784
|
-
this.switchToMultiYearViewLabel = '选择年月';
|
|
785
|
-
/** A label for the first date of a range of dates (used by screen readers). */
|
|
786
|
-
this.startDateLabel = '开始日期';
|
|
787
|
-
/** A label for the last date of a range of dates (used by screen readers). */
|
|
788
|
-
this.endDateLabel = '结束日期';
|
|
789
|
-
/** A label for the 'switch to clock hour view' button (used by screen readers). */
|
|
790
|
-
this.switchToClockHourViewLabel = '选择小时';
|
|
791
|
-
/** A label for the 'switch to clock minute view' button (used by screen readers). */
|
|
792
|
-
this.switchToClockMinuteViewLabel = '选择分钟';
|
|
793
|
-
/** Label used for ok button within the manual time input. */
|
|
794
|
-
this.okLabel = '确认';
|
|
795
|
-
/** Label used for cancel button within the manual time input. */
|
|
796
|
-
this.cancelLabel = '取消';
|
|
797
|
-
}
|
|
798
|
-
/** Formats a range of years (used for visuals). */
|
|
799
|
-
formatYearRange(start, end) {
|
|
800
|
-
return `${start} \u2013 ${end}`;
|
|
801
|
-
}
|
|
802
|
-
/** Formats a label for a range of years (used by screen readers). */
|
|
803
|
-
formatYearRangeLabel(start, end) {
|
|
804
|
-
return `${start} to ${end}`;
|
|
805
|
-
}
|
|
806
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CmatDatetimepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
807
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CmatDatetimepickerIntl, providedIn: 'root' }); }
|
|
808
|
-
}
|
|
809
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CmatDatetimepickerIntl, decorators: [{
|
|
810
|
-
type: Injectable,
|
|
811
|
-
args: [{ providedIn: 'root' }]
|
|
812
|
-
}] });
|
|
813
|
-
|
|
814
798
|
function pad(num, size) {
|
|
815
799
|
num = String(num);
|
|
816
800
|
while (num.length < size) {
|
|
@@ -819,13 +803,13 @@ function pad(num, size) {
|
|
|
819
803
|
return num;
|
|
820
804
|
}
|
|
821
805
|
class CmatDatetimepickerTimeInputDirective {
|
|
822
|
-
constructor(
|
|
823
|
-
this._element = _element;
|
|
824
|
-
this._cdr = _cdr;
|
|
806
|
+
constructor() {
|
|
825
807
|
this.timeInterval = 1;
|
|
826
808
|
this.timeMin = 0;
|
|
827
809
|
this.timeMax = Infinity;
|
|
828
810
|
this.timeValueChanged = new EventEmitter();
|
|
811
|
+
this._element = inject(ElementRef);
|
|
812
|
+
this._cdr = inject(ChangeDetectorRef);
|
|
829
813
|
this._keyDownListener = this.keyDownHandler.bind(this);
|
|
830
814
|
this._keyPressListener = this.keyPressHandler.bind(this);
|
|
831
815
|
this._inputEventListener = this.inputChangedHandler.bind(this);
|
|
@@ -962,17 +946,16 @@ class CmatDatetimepickerTimeInputDirective {
|
|
|
962
946
|
this.inputElement.removeEventListener('keypress', this._keyPressListener);
|
|
963
947
|
this.inputElement.removeEventListener('input', this._inputEventListener);
|
|
964
948
|
}
|
|
965
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
966
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.
|
|
949
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerTimeInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
950
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.2", type: CmatDatetimepickerTimeInputDirective, isStandalone: true, selector: "input.cmat-datetimepicker-time-input", inputs: { timeInterval: "timeInterval", timeMin: "timeMin", timeMax: "timeMax", timeValue: "timeValue" }, outputs: { timeValueChanged: "timeValueChanged" }, host: { listeners: { "blur": "blur($event)", "focus": "focus($event)" } }, exportAs: ["cmatDatetimepickerTimeInput"], ngImport: i0 }); }
|
|
967
951
|
}
|
|
968
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
952
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerTimeInputDirective, decorators: [{
|
|
969
953
|
type: Directive,
|
|
970
954
|
args: [{
|
|
971
955
|
selector: 'input.cmat-datetimepicker-time-input',
|
|
972
|
-
exportAs: 'cmatDatetimepickerTimeInput'
|
|
973
|
-
standalone: true
|
|
956
|
+
exportAs: 'cmatDatetimepickerTimeInput'
|
|
974
957
|
}]
|
|
975
|
-
}], ctorParameters: () => [
|
|
958
|
+
}], ctorParameters: () => [], propDecorators: { timeInterval: [{
|
|
976
959
|
type: Input
|
|
977
960
|
}], timeMin: [{
|
|
978
961
|
type: Input
|
|
@@ -990,10 +973,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
990
973
|
args: ['focus', ['$event']]
|
|
991
974
|
}] } });
|
|
992
975
|
class CmatDatetimepickerTimeComponent {
|
|
993
|
-
constructor(
|
|
994
|
-
this._adapter = _adapter;
|
|
995
|
-
this._changeDetectorRef = _changeDetectorRef;
|
|
996
|
-
this.datetimepickerIntl = datetimepickerIntl;
|
|
976
|
+
constructor() {
|
|
997
977
|
/** Emits when the currently selected date changes. */
|
|
998
978
|
this.selectedChange = new EventEmitter();
|
|
999
979
|
/** Emits when any date changes. */
|
|
@@ -1010,6 +990,9 @@ class CmatDatetimepickerTimeComponent {
|
|
|
1010
990
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1011
991
|
this.AMPM = 'AM';
|
|
1012
992
|
this.class = 'cmat-datetimepicker-time';
|
|
993
|
+
this.datetimepickerIntl = inject(CmatDatetimepickerIntl);
|
|
994
|
+
this._adapter = inject(DatetimeAdapter);
|
|
995
|
+
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
1013
996
|
this._twelvehour = false;
|
|
1014
997
|
/** Whether the clock is in hour view. */
|
|
1015
998
|
this._clockView = 'hour';
|
|
@@ -1207,13 +1190,13 @@ class CmatDatetimepickerTimeComponent {
|
|
|
1207
1190
|
this.datetimepickerIntlChangesSubscription.unsubscribe();
|
|
1208
1191
|
}
|
|
1209
1192
|
}
|
|
1210
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
1211
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.
|
|
1193
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerTimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1194
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.2", type: CmatDatetimepickerTimeComponent, isStandalone: true, selector: "cmat-datetimepicker-time", inputs: { dateFilter: "dateFilter", interval: "interval", AMPM: "AMPM", twelvehour: "twelvehour", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", clockView: "clockView" }, outputs: { selectedChange: "selectedChange", activeDateChange: "activeDateChange", userSelection: "userSelection", ampmChange: "ampmChange", clockViewChange: "clockViewChange" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "hourInputElement", first: true, predicate: ["hourInput"], descendants: true, read: (ElementRef) }, { propertyName: "hourInputDirective", first: true, predicate: ["hourInput"], descendants: true, read: CmatDatetimepickerTimeInputDirective }, { propertyName: "minuteInputElement", first: true, predicate: ["minuteInput"], descendants: true, read: (ElementRef) }, { propertyName: "minuteInputDirective", first: true, predicate: ["minuteInput"], descendants: true, read: CmatDatetimepickerTimeInputDirective }], exportAs: ["cmatDatetimepickerTime"], usesOnChanges: true, ngImport: i0, template: "<div class=\"cmat-datetimepicker-time-input-wrapper\">\r\n <div class=\"cmat-datetimepicker-time-input-inner\">\r\n <input #hourInput=\"cmatDatetimepickerTimeInput\" class=\"cmat-datetimepicker-time-input\"\r\n type=\"text\" inputmode=\"numeric\"\r\n maxlength=\"2\" [class.cmat-datetimepicker-time-input-active]=\"clockView === 'hour'\" [class.cmat-datetimepicker-time-input-warning]=\"!hourInput.valid\" [timeMin]=\"twelvehour ? 1 : 0\" [timeMax]=\"twelvehour ? 12 : 23\"\r\n [timeValue]=\"hour\" (timeValueChanged)=\"handleHourInputChange($event)\" (focus)=\"handleFocus('hour')\" />\r\n\r\n <div class=\"cmat-datetimepicker-time-seperator\">:</div>\r\n\r\n <input #minuteInput=\"cmatDatetimepickerTimeInput\" class=\"cmat-datetimepicker-time-input\"\r\n type=\"text\" inputmode=\"numeric\"\r\n maxlength=\"2\" [class.cmat-datetimepicker-time-input-active]=\"clockView === 'minute'\" [class.cmat-datetimepicker-time-input-warning]=\"!minuteInput.valid\" [timeMin]=\"0\" [timeMax]=\"59\" [timeValue]=\"minute\"\r\n [timeInterval]=\"interval\" (timeValueChanged)=\"handleMinuteInputChange($event)\" (focus)=\"handleFocus('minute')\" />\r\n\r\n @if (twelvehour) {\r\n <div class=\"cmat-datetimepicker-time-ampm\">\r\n <button mat-button type=\"button\" class=\"cmat-datetimepicker-time-am\"\r\n aria-label=\"AM\" [class.cmat-datetimepicker-time-ampm-active]=\"AMPM === 'AM'\"\r\n (keydown)=\"$event.stopPropagation()\" (click)=\"ampmChange.emit('AM')\">AM</button>\r\n <button mat-button type=\"button\" class=\"cmat-datetimepicker-time-pm\"\r\n aria-label=\"PM\" [class.cmat-datetimepicker-time-ampm-active]=\"AMPM === 'PM'\"\r\n (keydown)=\"$event.stopPropagation()\" (click)=\"ampmChange.emit('PM')\">PM</button>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <cmat-datetimepicker-clock [dateFilter]=\"dateFilter\" [interval]=\"interval\"\r\n [maxDate]=\"maxDate\" [minDate]=\"minDate\" [selected]=\"selected\" [startView]=\"clockView\" [twelvehour]=\"twelvehour\"\r\n (selectedChange)=\"timeSelected($event)\" (activeDateChange)=\"onActiveDateChange($event)\">\r\n </cmat-datetimepicker-clock>\r\n\r\n <div class=\"cmat-datetimepicker-time-button-wrapper flex flex-row gap-4\">\r\n <button class=\"cmat=datetimepicker-time-cancel-button\" mat-stroked-button type=\"button\" (click)=\"handleCancel()\">\r\n {{ datetimepickerIntl.cancelLabel }}\r\n </button>\r\n <button class=\"cmat-datetimepicker-time-ok-button\" mat-flat-button type=\"button\" color=\"primary\" [disabled]=\"minuteInputDirective?.invalid || hourInputDirective?.invalid\"\r\n (click)=\"handleOk()\">\r\n {{ datetimepickerIntl.okLabel }}\r\n </button>\r\n </div>", 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 transparent;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"], dependencies: [{ kind: "directive", type: CmatDatetimepickerTimeInputDirective, selector: "input.cmat-datetimepicker-time-input", inputs: ["timeInterval", "timeMin", "timeMax", "timeValue"], outputs: ["timeValueChanged"], exportAs: ["cmatDatetimepickerTimeInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: CmatDatetimepickerClockComponent, selector: "cmat-datetimepicker-clock", inputs: ["dateFilter", "interval", "twelvehour", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["userSelection", "selectedChange", "activeDateChange"], exportAs: ["cmatDatetimepickerClock"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1212
1195
|
}
|
|
1213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
1196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerTimeComponent, decorators: [{
|
|
1214
1197
|
type: Component,
|
|
1215
1198
|
args: [{ selector: 'cmat-datetimepicker-time', exportAs: 'cmatDatetimepickerTime', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CmatDatetimepickerTimeInputDirective, MatButtonModule, CmatDatetimepickerClockComponent], template: "<div class=\"cmat-datetimepicker-time-input-wrapper\">\r\n <div class=\"cmat-datetimepicker-time-input-inner\">\r\n <input #hourInput=\"cmatDatetimepickerTimeInput\" class=\"cmat-datetimepicker-time-input\"\r\n type=\"text\" inputmode=\"numeric\"\r\n maxlength=\"2\" [class.cmat-datetimepicker-time-input-active]=\"clockView === 'hour'\" [class.cmat-datetimepicker-time-input-warning]=\"!hourInput.valid\" [timeMin]=\"twelvehour ? 1 : 0\" [timeMax]=\"twelvehour ? 12 : 23\"\r\n [timeValue]=\"hour\" (timeValueChanged)=\"handleHourInputChange($event)\" (focus)=\"handleFocus('hour')\" />\r\n\r\n <div class=\"cmat-datetimepicker-time-seperator\">:</div>\r\n\r\n <input #minuteInput=\"cmatDatetimepickerTimeInput\" class=\"cmat-datetimepicker-time-input\"\r\n type=\"text\" inputmode=\"numeric\"\r\n maxlength=\"2\" [class.cmat-datetimepicker-time-input-active]=\"clockView === 'minute'\" [class.cmat-datetimepicker-time-input-warning]=\"!minuteInput.valid\" [timeMin]=\"0\" [timeMax]=\"59\" [timeValue]=\"minute\"\r\n [timeInterval]=\"interval\" (timeValueChanged)=\"handleMinuteInputChange($event)\" (focus)=\"handleFocus('minute')\" />\r\n\r\n @if (twelvehour) {\r\n <div class=\"cmat-datetimepicker-time-ampm\">\r\n <button mat-button type=\"button\" class=\"cmat-datetimepicker-time-am\"\r\n aria-label=\"AM\" [class.cmat-datetimepicker-time-ampm-active]=\"AMPM === 'AM'\"\r\n (keydown)=\"$event.stopPropagation()\" (click)=\"ampmChange.emit('AM')\">AM</button>\r\n <button mat-button type=\"button\" class=\"cmat-datetimepicker-time-pm\"\r\n aria-label=\"PM\" [class.cmat-datetimepicker-time-ampm-active]=\"AMPM === 'PM'\"\r\n (keydown)=\"$event.stopPropagation()\" (click)=\"ampmChange.emit('PM')\">PM</button>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <cmat-datetimepicker-clock [dateFilter]=\"dateFilter\" [interval]=\"interval\"\r\n [maxDate]=\"maxDate\" [minDate]=\"minDate\" [selected]=\"selected\" [startView]=\"clockView\" [twelvehour]=\"twelvehour\"\r\n (selectedChange)=\"timeSelected($event)\" (activeDateChange)=\"onActiveDateChange($event)\">\r\n </cmat-datetimepicker-clock>\r\n\r\n <div class=\"cmat-datetimepicker-time-button-wrapper flex flex-row gap-4\">\r\n <button class=\"cmat=datetimepicker-time-cancel-button\" mat-stroked-button type=\"button\" (click)=\"handleCancel()\">\r\n {{ datetimepickerIntl.cancelLabel }}\r\n </button>\r\n <button class=\"cmat-datetimepicker-time-ok-button\" mat-flat-button type=\"button\" color=\"primary\" [disabled]=\"minuteInputDirective?.invalid || hourInputDirective?.invalid\"\r\n (click)=\"handleOk()\">\r\n {{ datetimepickerIntl.okLabel }}\r\n </button>\r\n </div>", 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 transparent;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"] }]
|
|
1216
|
-
}], ctorParameters: () => [
|
|
1199
|
+
}], ctorParameters: () => [], propDecorators: { selectedChange: [{
|
|
1217
1200
|
type: Output
|
|
1218
1201
|
}], activeDateChange: [{
|
|
1219
1202
|
type: Output
|
|
@@ -1262,13 +1245,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
1262
1245
|
* An internal component used to display a single year in the datepicker.
|
|
1263
1246
|
*/
|
|
1264
1247
|
class CmatDatetimepickerYearViewComponent {
|
|
1265
|
-
constructor(
|
|
1266
|
-
this.adapter = adapter;
|
|
1267
|
-
this._dateFormats = _dateFormats;
|
|
1248
|
+
constructor() {
|
|
1268
1249
|
this.userSelection = new EventEmitter();
|
|
1269
1250
|
this.type = 'date';
|
|
1270
1251
|
/** Emits when a new month is selected. */
|
|
1271
1252
|
this.selectedChange = new EventEmitter();
|
|
1253
|
+
this.adapter = inject(DatetimeAdapter, { optional: true });
|
|
1254
|
+
this._dateFormats = inject(CMAT_DATETIME_FORMATS, { optional: true });
|
|
1272
1255
|
if (!this.adapter) {
|
|
1273
1256
|
throw createMissingDateImplError('CDatetimeAdapter');
|
|
1274
1257
|
}
|
|
@@ -1348,20 +1331,13 @@ class CmatDatetimepickerYearViewComponent {
|
|
|
1348
1331
|
}
|
|
1349
1332
|
return false;
|
|
1350
1333
|
}
|
|
1351
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
1352
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.
|
|
1334
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerYearViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1335
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: CmatDatetimepickerYearViewComponent, isStandalone: true, selector: "cmat-datetimepicker-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { userSelection: "userSelection", selectedChange: "selectedChange" }, exportAs: ["cmatDatetimepickerYearView"], ngImport: i0, template: "<table class=\"cmat-datetimepicker-calendar-table\">\r\n <thead class=\"cmat-datetimepicker-calendar-table-header\"></thead>\r\n <tbody cmat-datetimepicker-calendar-body role=\"grid\"\r\n [@slideCalendar]=\"calendarState\" [activeCell]=\"adapter.getMonth(activeDate)\" [labelMinRequiredCells]=\"2\"\r\n [label]=\"yearLabel\" [rows]=\"months\" [selectedValue]=\"selectedMonth\" [todayValue]=\"todayMonth\"\r\n [allowDisabledSelection]=\"true\" (@slideCalendar.done)=\"calendarStateDone()\" (selectedValueChange)=\"monthSelected($event)\"></tbody>\r\n</table>", dependencies: [{ kind: "component", type: CmatDatetimepickerCalendarBodyComponent, selector: "[cmat-datetimepicker-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["cmatDatetimepickerCalendarBody"] }], animations: [slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1353
1336
|
}
|
|
1354
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
1337
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerYearViewComponent, decorators: [{
|
|
1355
1338
|
type: Component,
|
|
1356
1339
|
args: [{ selector: 'cmat-datetimepicker-year-view', animations: [slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDatetimepickerYearView', imports: [CmatDatetimepickerCalendarBodyComponent], template: "<table class=\"cmat-datetimepicker-calendar-table\">\r\n <thead class=\"cmat-datetimepicker-calendar-table-header\"></thead>\r\n <tbody cmat-datetimepicker-calendar-body role=\"grid\"\r\n [@slideCalendar]=\"calendarState\" [activeCell]=\"adapter.getMonth(activeDate)\" [labelMinRequiredCells]=\"2\"\r\n [label]=\"yearLabel\" [rows]=\"months\" [selectedValue]=\"selectedMonth\" [todayValue]=\"todayMonth\"\r\n [allowDisabledSelection]=\"true\" (@slideCalendar.done)=\"calendarStateDone()\" (selectedValueChange)=\"monthSelected($event)\"></tbody>\r\n</table>" }]
|
|
1357
|
-
}], ctorParameters: () => [
|
|
1358
|
-
type: Optional
|
|
1359
|
-
}] }, { type: undefined, decorators: [{
|
|
1360
|
-
type: Optional
|
|
1361
|
-
}, {
|
|
1362
|
-
type: Inject,
|
|
1363
|
-
args: [CMAT_DATETIME_FORMATS]
|
|
1364
|
-
}] }], propDecorators: { userSelection: [{
|
|
1340
|
+
}], ctorParameters: () => [], propDecorators: { userSelection: [{
|
|
1365
1341
|
type: Output
|
|
1366
1342
|
}], type: [{
|
|
1367
1343
|
type: Input
|
|
@@ -1379,11 +1355,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
1379
1355
|
* A calendar that is used as part of the datepicker.
|
|
1380
1356
|
*/
|
|
1381
1357
|
class CmatDatetimepickerCalendarComponent {
|
|
1382
|
-
constructor(
|
|
1383
|
-
this._elementRef = _elementRef;
|
|
1384
|
-
this._intl = _intl;
|
|
1385
|
-
this._adapter = _adapter;
|
|
1386
|
-
this._dateFormats = _dateFormats;
|
|
1358
|
+
constructor() {
|
|
1387
1359
|
this.userSelection = new EventEmitter();
|
|
1388
1360
|
/** Active multi year view when click on year. */
|
|
1389
1361
|
this.multiYearSelector = false;
|
|
@@ -1402,6 +1374,11 @@ class CmatDatetimepickerCalendarComponent {
|
|
|
1402
1374
|
this.role = 'dialog';
|
|
1403
1375
|
this.tabindex = 0;
|
|
1404
1376
|
this.clockView = 'hour';
|
|
1377
|
+
/** Whether the calendar is in month view. */
|
|
1378
|
+
this._elementRef = inject(ElementRef);
|
|
1379
|
+
this._intl = inject(CmatDatetimepickerIntl);
|
|
1380
|
+
this._adapter = inject(DatetimeAdapter, { optional: true });
|
|
1381
|
+
this._dateFormats = inject(CMAT_DATETIME_FORMATS, { optional: true });
|
|
1405
1382
|
this._type = 'date';
|
|
1406
1383
|
this._timeInput = false;
|
|
1407
1384
|
/** Date filter for the month and year views. */
|
|
@@ -1409,6 +1386,8 @@ class CmatDatetimepickerCalendarComponent {
|
|
|
1409
1386
|
(!this.dateFilter || this.dateFilter(date, CmatDatetimepickerFilterType.DATE)) &&
|
|
1410
1387
|
(!this.minDate || this._adapter.compareDate(date, this.minDate) >= 0) &&
|
|
1411
1388
|
(!this.maxDate || this._adapter.compareDate(date, this.maxDate) <= 0);
|
|
1389
|
+
const _intl = this._intl;
|
|
1390
|
+
const changeDetectorRef = inject(ChangeDetectorRef);
|
|
1412
1391
|
if (!this._adapter) {
|
|
1413
1392
|
throw createMissingDateImplError('CDatetimeAdapter');
|
|
1414
1393
|
}
|
|
@@ -1964,24 +1943,17 @@ class CmatDatetimepickerCalendarComponent {
|
|
|
1964
1943
|
_2digit(n) {
|
|
1965
1944
|
return ('00' + n).slice(-2);
|
|
1966
1945
|
}
|
|
1967
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
1968
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: CmatDatetimepickerCalendarComponent, isStandalone: true, selector: "cmat-datetimepicker-calendar", inputs: { multiYearSelector: "multiYearSelector", startView: "startView", twelvehour: "twelvehour", timeInterval: "timeInterval", dateFilter: "dateFilter", preventSameDateTimeSelection: "preventSameDateTimeSelection", type: "type", startAt: "startAt", timeInput: "timeInput", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { userSelection: "userSelection", selectedChange: "selectedChange", viewChanged: "viewChanged" }, host: { listeners: { "keydown": "handleCalendarBodyKeydown($event)" }, properties: { "class.cmat-datetimepicker-calendar-with-time-input": "timeInput", "class": "this.class", "attr.aria-label": "this.label", "role": "this.role", "tabindex": "this.tabindex" } }, exportAs: ["cmatDatetimepickerCalendar"], ngImport: i0, template: "<div class=\"cmat-datetimepicker-calendar-header\">\r\n @if (type !== 'time') {\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-year header-button\"\r\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\" [attr.aria-label]=\"yearButtonLabel\"\r\n (click)=\"yearClicked()\">\r\n <span class=\"font-medium\">{{ yearButtonText }}</span>\r\n @if (multiYearSelector || type === 'year') {\r\n <svg class=\"cmat-datetimepicker-calendar-header-year-dropdown\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"\r\n fill=\"currentColor\">\r\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\r\n </svg>\r\n }\r\n </div>\r\n }\r\n @if (type !== 'year') {\r\n <div class=\"cmat-datetimepicker-calendar-header-date-time\">\r\n @if (type !== 'time') {\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-date header-button\"\r\n [class.active]=\"currentView === 'month'\" [class.not-clickable]=\"type === 'month'\"\r\n [attr.aria-label]=\"dateButtonLabel\" (click)=\"dateClicked()\">{{ dateButtonText }}</div>\r\n }\r\n @if (type.endsWith('time')) {\r\n <span class=\"cmat-datetimepicker-calendar-header-time\" [class.active]=\"currentView === 'clock'\">\r\n <span class=\"cmat-datetimepicker-calendar-header-hour-minute-container flex place-items-center\">\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-hours header-button\"\r\n [class.active]=\"clockView === 'hour'\" [attr.aria-label]=\"hourButtonLabel\" (click)=\"hoursClicked()\">\r\n {{ hoursButtonText }}</div>\r\n <span class=\"cmat-datetimepicker-calendar-header-hour-minute-separator\">:</span>\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-minutes header-button\"\r\n [class.active]=\"clockView === 'minute'\" [attr.aria-label]=\"minuteButtonLabel\" (click)=\"minutesClicked()\">{{\r\n minutesButtonText }}</div>\r\n </span>\r\n @if (twelvehour) {\r\n <span class=\"cmat-datetimepicker-calendar-header-ampm-container flex place-items-center\">\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-ampm header-button\"\r\n aria-label=\"AM\" [class.active]=\"AMPM === 'AM'\" (click)=\"ampmClicked('AM')\">AM</div>\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-ampm header-button\"\r\n aria-label=\"PM\" [class.active]=\"AMPM === 'PM'\" (click)=\"ampmClicked('PM')\">PM</div>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n<div class=\"cmat-datetimepicker-calendar-content\" [ngClass]=\"{'flex flex-col justify-center': currentView==='clock'}\">\r\n @if (currentView === 'month' || currentView === 'year' || currentView === 'multi-year') {\r\n <div class=\"cmat-datetimepickermonth-content\">\r\n <div class=\"cmat-datetimepicker-calendar-controls\">\r\n <button mat-icon-button type=\"button\" class=\"cmat-datetimepicker-calendar-previous-button\"\r\n [class.disabled]=\"!previousEnabled()\" [attr.aria-disabled]=\"!previousEnabled()\"\r\n [attr.aria-label]=\"prevButtonLabel\" (click)=\"previousClicked()\">\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 class=\"cmat-datetimepicker-calendar-period-button text-default font-medium\" [@slideCalendar]=\"calendarState\"\r\n (@slideCalendar.done)=\"calendarStateDone()\">\r\n <strong>{{ yearPeriodText }}</strong>\r\n </div>\r\n <button type=\"button\" mat-icon-button class=\"cmat-datetimepicker-calendar-next-button\"\r\n [class.disabled]=\"!nextEnabled()\" [attr.aria-disabled]=\"!nextEnabled()\" [attr.aria-label]=\"nextButtonLabel\"\r\n (click)=\"nextClicked()\">\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 }\r\n\r\n @switch (currentView) {\r\n @case ('month') {\r\n <cmat-datetimepicker-month-view [activeDate]=\"activeDate\" [dateFilter]=\"dateFilterForViews\"\r\n [selected]=\"selected!\" [type]=\"type\" (userSelection)=\"userSelected()\" (selectedChange)=\"dateSelected($event)\">\r\n </cmat-datetimepicker-month-view>\r\n }\r\n @case ('year') {\r\n <cmat-datetimepicker-year-view [activeDate]=\"activeDate\" [dateFilter]=\"dateFilterForViews\"\r\n [selected]=\"selected!\" [type]=\"type\" (userSelection)=\"userSelected()\" (selectedChange)=\"monthSelected($event)\">\r\n </cmat-datetimepicker-year-view>\r\n }\r\n @case ('multi-year') {\r\n <cmat-datetimepicker-multi-year-view [activeDate]=\"activeDate\" [dateFilter]=\"dateFilterForViews\"\r\n [maxDate]=\"maxDate\" [minDate]=\"minDate\" [selected]=\"selected!\" [type]=\"type\"\r\n (userSelection)=\"userSelected()\" (selectedChange)=\"yearSelected($event)\">\r\n </cmat-datetimepicker-multi-year-view>\r\n }\r\n @default {\r\n @if (timeInput) {\r\n <cmat-datetimepicker-time [AMPM]=\"AMPM\" [clockView]=\"clockView\"\r\n [twelvehour]=\"twelvehour\" [dateFilter]=\"dateFilter\" [interval]=\"timeInterval\" [maxDate]=\"maxDate\"\r\n [minDate]=\"minDate\" [selected]=\"activeDate\" (userSelection)=\"userSelected()\" (activeDateChange)=\"onActiveDateChange($event)\"\r\n (selectedChange)=\"timeSelected($event)\" (ampmChange)=\"ampmClicked($event)\" (clockViewChange)=\"clockView = $event\">\r\n </cmat-datetimepicker-time>\r\n } @else {\r\n <cmat-datetimepicker-clock [dateFilter]=\"dateFilter\" [interval]=\"timeInterval\"\r\n [maxDate]=\"maxDate\" [minDate]=\"minDate\" [selected]=\"activeDate\" [startView]=\"clockView\"\r\n [twelvehour]=\"twelvehour\" (userSelection)=\"userSelected()\" (activeDateChange)=\"onActiveDateChange($event)\" (selectedChange)=\"dialTimeSelected($event)\">\r\n </cmat-datetimepicker-clock>\r\n }\r\n }\r\n }\r\n</div>", 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-year: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-ampm:not(.active){opacity:.6}.cmat-datetimepicker-calendar-header-year.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-ampm.not-clickable{cursor:initial}.cmat-datetimepicker-calendar-header-time{display:inline-flex}.cmat-datetimepicker-calendar-header-time:not(.active){opacity:.6}.cmat-datetimepicker-calendar-header-time:not(.active) .cmat-datetimepicker-calendar-header-hours,.cmat-datetimepicker-calendar-header-time:not(.active) .cmat-datetimepicker-calendar-header-minutes,.cmat-datetimepicker-calendar-header-time:not(.active) .cmat-datetimepicker-calendar-header-ampm{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:transparent;box-sizing:border-box}.cmat-datetimepicker-calendar-previous-button.disabled,.cmat-datetimepicker-calendar-next-button.disabled{pointer-events:none}.cmat-datetimepicker-calendar-previous-button svg,.cmat-datetimepicker-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .cmat-datetimepicker-calendar-previous-button svg,[dir=rtl] .cmat-datetimepicker-calendar-next-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"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: CmatDatetimepickerMonthViewComponent, selector: "cmat-datetimepicker-month-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["userSelection", "selectedChange"], exportAs: ["cmatDatetimepickerMonthView"] }, { kind: "component", type: CmatDatetimepickerYearViewComponent, selector: "cmat-datetimepicker-year-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["userSelection", "selectedChange"], exportAs: ["cmatDatetimepickerYearView"] }, { kind: "component", type: CmatDatetimepickerMultiYearViewComponent, selector: "cmat-datetimepicker-multi-year-view", inputs: ["type", "dateFilter", "activeDate", "selected", "minDate", "maxDate"], outputs: ["userSelection", "selectedChange"], exportAs: ["cmatDatetimepickerMultiYearView"] }, { kind: "component", type: CmatDatetimepickerTimeComponent, selector: "cmat-datetimepicker-time", inputs: ["dateFilter", "interval", "AMPM", "twelvehour", "activeDate", "selected", "minDate", "maxDate", "clockView"], outputs: ["selectedChange", "activeDateChange", "userSelection", "ampmChange", "clockViewChange"], exportAs: ["cmatDatetimepickerTime"] }, { kind: "component", type: CmatDatetimepickerClockComponent, selector: "cmat-datetimepicker-clock", inputs: ["dateFilter", "interval", "twelvehour", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["userSelection", "selectedChange", "activeDateChange"], exportAs: ["cmatDatetimepickerClock"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1946
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1947
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.2", type: CmatDatetimepickerCalendarComponent, isStandalone: true, selector: "cmat-datetimepicker-calendar", inputs: { multiYearSelector: "multiYearSelector", startView: "startView", twelvehour: "twelvehour", timeInterval: "timeInterval", dateFilter: "dateFilter", preventSameDateTimeSelection: "preventSameDateTimeSelection", type: "type", startAt: "startAt", timeInput: "timeInput", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { userSelection: "userSelection", selectedChange: "selectedChange", viewChanged: "viewChanged" }, host: { listeners: { "keydown": "handleCalendarBodyKeydown($event)" }, properties: { "class.cmat-datetimepicker-calendar-with-time-input": "timeInput", "class": "this.class", "attr.aria-label": "this.label", "role": "this.role", "tabindex": "this.tabindex" } }, exportAs: ["cmatDatetimepickerCalendar"], ngImport: i0, template: "<div class=\"cmat-datetimepicker-calendar-header\">\r\n @if (type !== 'time') {\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-year header-button\"\r\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\" [attr.aria-label]=\"yearButtonLabel\"\r\n (click)=\"yearClicked()\">\r\n <span class=\"font-medium\">{{ yearButtonText }}</span>\r\n @if (multiYearSelector || type === 'year') {\r\n <svg class=\"cmat-datetimepicker-calendar-header-year-dropdown\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"\r\n fill=\"currentColor\">\r\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\r\n </svg>\r\n }\r\n </div>\r\n }\r\n @if (type !== 'year') {\r\n <div class=\"cmat-datetimepicker-calendar-header-date-time\">\r\n @if (type !== 'time') {\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-date header-button\"\r\n [class.active]=\"currentView === 'month'\" [class.not-clickable]=\"type === 'month'\"\r\n [attr.aria-label]=\"dateButtonLabel\" (click)=\"dateClicked()\">{{ dateButtonText }}</div>\r\n }\r\n @if (type.endsWith('time')) {\r\n <span class=\"cmat-datetimepicker-calendar-header-time\" [class.active]=\"currentView === 'clock'\">\r\n <span class=\"cmat-datetimepicker-calendar-header-hour-minute-container flex place-items-center\">\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-hours header-button\"\r\n [class.active]=\"clockView === 'hour'\" [attr.aria-label]=\"hourButtonLabel\" (click)=\"hoursClicked()\">\r\n {{ hoursButtonText }}</div>\r\n <span class=\"cmat-datetimepicker-calendar-header-hour-minute-separator\">:</span>\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-minutes header-button\"\r\n [class.active]=\"clockView === 'minute'\" [attr.aria-label]=\"minuteButtonLabel\" (click)=\"minutesClicked()\">{{\r\n minutesButtonText }}</div>\r\n </span>\r\n @if (twelvehour) {\r\n <span class=\"cmat-datetimepicker-calendar-header-ampm-container flex place-items-center\">\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-ampm header-button\"\r\n aria-label=\"AM\" [class.active]=\"AMPM === 'AM'\" (click)=\"ampmClicked('AM')\">AM</div>\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-ampm header-button\"\r\n aria-label=\"PM\" [class.active]=\"AMPM === 'PM'\" (click)=\"ampmClicked('PM')\">PM</div>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n<div class=\"cmat-datetimepicker-calendar-content\" [ngClass]=\"{'flex flex-col justify-center': currentView==='clock'}\">\r\n @if (currentView === 'month' || currentView === 'year' || currentView === 'multi-year') {\r\n <div class=\"cmat-datetimepickermonth-content\">\r\n <div class=\"cmat-datetimepicker-calendar-controls\">\r\n <button mat-icon-button type=\"button\" class=\"cmat-datetimepicker-calendar-previous-button\"\r\n [class.disabled]=\"!previousEnabled()\" [attr.aria-disabled]=\"!previousEnabled()\"\r\n [attr.aria-label]=\"prevButtonLabel\" (click)=\"previousClicked()\">\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 class=\"cmat-datetimepicker-calendar-period-button text-default font-medium\" [@slideCalendar]=\"calendarState\"\r\n (@slideCalendar.done)=\"calendarStateDone()\">\r\n <strong>{{ yearPeriodText }}</strong>\r\n </div>\r\n <button type=\"button\" mat-icon-button class=\"cmat-datetimepicker-calendar-next-button\"\r\n [class.disabled]=\"!nextEnabled()\" [attr.aria-disabled]=\"!nextEnabled()\" [attr.aria-label]=\"nextButtonLabel\"\r\n (click)=\"nextClicked()\">\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 }\r\n\r\n @switch (currentView) {\r\n @case ('month') {\r\n <cmat-datetimepicker-month-view [activeDate]=\"activeDate\" [dateFilter]=\"dateFilterForViews\"\r\n [selected]=\"selected!\" [type]=\"type\" (userSelection)=\"userSelected()\" (selectedChange)=\"dateSelected($event)\">\r\n </cmat-datetimepicker-month-view>\r\n }\r\n @case ('year') {\r\n <cmat-datetimepicker-year-view [activeDate]=\"activeDate\" [dateFilter]=\"dateFilterForViews\"\r\n [selected]=\"selected!\" [type]=\"type\" (userSelection)=\"userSelected()\" (selectedChange)=\"monthSelected($event)\">\r\n </cmat-datetimepicker-year-view>\r\n }\r\n @case ('multi-year') {\r\n <cmat-datetimepicker-multi-year-view [activeDate]=\"activeDate\" [dateFilter]=\"dateFilterForViews\"\r\n [maxDate]=\"maxDate\" [minDate]=\"minDate\" [selected]=\"selected!\" [type]=\"type\"\r\n (userSelection)=\"userSelected()\" (selectedChange)=\"yearSelected($event)\">\r\n </cmat-datetimepicker-multi-year-view>\r\n }\r\n @default {\r\n @if (timeInput) {\r\n <cmat-datetimepicker-time [AMPM]=\"AMPM\" [clockView]=\"clockView\"\r\n [twelvehour]=\"twelvehour\" [dateFilter]=\"dateFilter\" [interval]=\"timeInterval\" [maxDate]=\"maxDate\"\r\n [minDate]=\"minDate\" [selected]=\"activeDate\" (userSelection)=\"userSelected()\" (activeDateChange)=\"onActiveDateChange($event)\"\r\n (selectedChange)=\"timeSelected($event)\" (ampmChange)=\"ampmClicked($event)\" (clockViewChange)=\"clockView = $event\">\r\n </cmat-datetimepicker-time>\r\n } @else {\r\n <cmat-datetimepicker-clock [dateFilter]=\"dateFilter\" [interval]=\"timeInterval\"\r\n [maxDate]=\"maxDate\" [minDate]=\"minDate\" [selected]=\"activeDate\" [startView]=\"clockView\"\r\n [twelvehour]=\"twelvehour\" (userSelection)=\"userSelected()\" (activeDateChange)=\"onActiveDateChange($event)\" (selectedChange)=\"dialTimeSelected($event)\">\r\n </cmat-datetimepicker-clock>\r\n }\r\n }\r\n }\r\n</div>", 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-year: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-ampm:not(.active){opacity:.6}.cmat-datetimepicker-calendar-header-year.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-ampm.not-clickable{cursor:initial}.cmat-datetimepicker-calendar-header-time{display:inline-flex}.cmat-datetimepicker-calendar-header-time:not(.active){opacity:.6}.cmat-datetimepicker-calendar-header-time:not(.active) .cmat-datetimepicker-calendar-header-hours,.cmat-datetimepicker-calendar-header-time:not(.active) .cmat-datetimepicker-calendar-header-minutes,.cmat-datetimepicker-calendar-header-time:not(.active) .cmat-datetimepicker-calendar-header-ampm{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:transparent;box-sizing:border-box}.cmat-datetimepicker-calendar-previous-button.disabled,.cmat-datetimepicker-calendar-next-button.disabled{pointer-events:none}.cmat-datetimepicker-calendar-previous-button svg,.cmat-datetimepicker-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .cmat-datetimepicker-calendar-previous-button svg,[dir=rtl] .cmat-datetimepicker-calendar-next-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"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: CmatDatetimepickerMonthViewComponent, selector: "cmat-datetimepicker-month-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["userSelection", "selectedChange"], exportAs: ["cmatDatetimepickerMonthView"] }, { kind: "component", type: CmatDatetimepickerYearViewComponent, selector: "cmat-datetimepicker-year-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["userSelection", "selectedChange"], exportAs: ["cmatDatetimepickerYearView"] }, { kind: "component", type: CmatDatetimepickerMultiYearViewComponent, selector: "cmat-datetimepicker-multi-year-view", inputs: ["type", "dateFilter", "activeDate", "selected", "minDate", "maxDate"], outputs: ["userSelection", "selectedChange"], exportAs: ["cmatDatetimepickerMultiYearView"] }, { kind: "component", type: CmatDatetimepickerTimeComponent, selector: "cmat-datetimepicker-time", inputs: ["dateFilter", "interval", "AMPM", "twelvehour", "activeDate", "selected", "minDate", "maxDate", "clockView"], outputs: ["selectedChange", "activeDateChange", "userSelection", "ampmChange", "clockViewChange"], exportAs: ["cmatDatetimepickerTime"] }, { kind: "component", type: CmatDatetimepickerClockComponent, selector: "cmat-datetimepicker-clock", inputs: ["dateFilter", "interval", "twelvehour", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["userSelection", "selectedChange", "activeDateChange"], exportAs: ["cmatDatetimepickerClock"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1969
1948
|
}
|
|
1970
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
1949
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerCalendarComponent, decorators: [{
|
|
1971
1950
|
type: Component,
|
|
1972
1951
|
args: [{ selector: 'cmat-datetimepicker-calendar', animations: [slideCalendar], host: {
|
|
1973
1952
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1974
1953
|
'[class.cmat-datetimepicker-calendar-with-time-input]': 'timeInput',
|
|
1975
1954
|
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDatetimepickerCalendar', imports: [MatButtonModule, CmatDatetimepickerMonthViewComponent, CmatDatetimepickerYearViewComponent,
|
|
1976
1955
|
CmatDatetimepickerMultiYearViewComponent, CmatDatetimepickerTimeComponent, CmatDatetimepickerClockComponent, NgClass], template: "<div class=\"cmat-datetimepicker-calendar-header\">\r\n @if (type !== 'time') {\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-year header-button\"\r\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\" [attr.aria-label]=\"yearButtonLabel\"\r\n (click)=\"yearClicked()\">\r\n <span class=\"font-medium\">{{ yearButtonText }}</span>\r\n @if (multiYearSelector || type === 'year') {\r\n <svg class=\"cmat-datetimepicker-calendar-header-year-dropdown\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"\r\n fill=\"currentColor\">\r\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\r\n </svg>\r\n }\r\n </div>\r\n }\r\n @if (type !== 'year') {\r\n <div class=\"cmat-datetimepicker-calendar-header-date-time\">\r\n @if (type !== 'time') {\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-date header-button\"\r\n [class.active]=\"currentView === 'month'\" [class.not-clickable]=\"type === 'month'\"\r\n [attr.aria-label]=\"dateButtonLabel\" (click)=\"dateClicked()\">{{ dateButtonText }}</div>\r\n }\r\n @if (type.endsWith('time')) {\r\n <span class=\"cmat-datetimepicker-calendar-header-time\" [class.active]=\"currentView === 'clock'\">\r\n <span class=\"cmat-datetimepicker-calendar-header-hour-minute-container flex place-items-center\">\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-hours header-button\"\r\n [class.active]=\"clockView === 'hour'\" [attr.aria-label]=\"hourButtonLabel\" (click)=\"hoursClicked()\">\r\n {{ hoursButtonText }}</div>\r\n <span class=\"cmat-datetimepicker-calendar-header-hour-minute-separator\">:</span>\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-minutes header-button\"\r\n [class.active]=\"clockView === 'minute'\" [attr.aria-label]=\"minuteButtonLabel\" (click)=\"minutesClicked()\">{{\r\n minutesButtonText }}</div>\r\n </span>\r\n @if (twelvehour) {\r\n <span class=\"cmat-datetimepicker-calendar-header-ampm-container flex place-items-center\">\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-ampm header-button\"\r\n aria-label=\"AM\" [class.active]=\"AMPM === 'AM'\" (click)=\"ampmClicked('AM')\">AM</div>\r\n <div role=\"presentation\" class=\"cmat-datetimepicker-calendar-header-ampm header-button\"\r\n aria-label=\"PM\" [class.active]=\"AMPM === 'PM'\" (click)=\"ampmClicked('PM')\">PM</div>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n }\r\n</div>\r\n\r\n<div class=\"cmat-datetimepicker-calendar-content\" [ngClass]=\"{'flex flex-col justify-center': currentView==='clock'}\">\r\n @if (currentView === 'month' || currentView === 'year' || currentView === 'multi-year') {\r\n <div class=\"cmat-datetimepickermonth-content\">\r\n <div class=\"cmat-datetimepicker-calendar-controls\">\r\n <button mat-icon-button type=\"button\" class=\"cmat-datetimepicker-calendar-previous-button\"\r\n [class.disabled]=\"!previousEnabled()\" [attr.aria-disabled]=\"!previousEnabled()\"\r\n [attr.aria-label]=\"prevButtonLabel\" (click)=\"previousClicked()\">\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 class=\"cmat-datetimepicker-calendar-period-button text-default font-medium\" [@slideCalendar]=\"calendarState\"\r\n (@slideCalendar.done)=\"calendarStateDone()\">\r\n <strong>{{ yearPeriodText }}</strong>\r\n </div>\r\n <button type=\"button\" mat-icon-button class=\"cmat-datetimepicker-calendar-next-button\"\r\n [class.disabled]=\"!nextEnabled()\" [attr.aria-disabled]=\"!nextEnabled()\" [attr.aria-label]=\"nextButtonLabel\"\r\n (click)=\"nextClicked()\">\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 }\r\n\r\n @switch (currentView) {\r\n @case ('month') {\r\n <cmat-datetimepicker-month-view [activeDate]=\"activeDate\" [dateFilter]=\"dateFilterForViews\"\r\n [selected]=\"selected!\" [type]=\"type\" (userSelection)=\"userSelected()\" (selectedChange)=\"dateSelected($event)\">\r\n </cmat-datetimepicker-month-view>\r\n }\r\n @case ('year') {\r\n <cmat-datetimepicker-year-view [activeDate]=\"activeDate\" [dateFilter]=\"dateFilterForViews\"\r\n [selected]=\"selected!\" [type]=\"type\" (userSelection)=\"userSelected()\" (selectedChange)=\"monthSelected($event)\">\r\n </cmat-datetimepicker-year-view>\r\n }\r\n @case ('multi-year') {\r\n <cmat-datetimepicker-multi-year-view [activeDate]=\"activeDate\" [dateFilter]=\"dateFilterForViews\"\r\n [maxDate]=\"maxDate\" [minDate]=\"minDate\" [selected]=\"selected!\" [type]=\"type\"\r\n (userSelection)=\"userSelected()\" (selectedChange)=\"yearSelected($event)\">\r\n </cmat-datetimepicker-multi-year-view>\r\n }\r\n @default {\r\n @if (timeInput) {\r\n <cmat-datetimepicker-time [AMPM]=\"AMPM\" [clockView]=\"clockView\"\r\n [twelvehour]=\"twelvehour\" [dateFilter]=\"dateFilter\" [interval]=\"timeInterval\" [maxDate]=\"maxDate\"\r\n [minDate]=\"minDate\" [selected]=\"activeDate\" (userSelection)=\"userSelected()\" (activeDateChange)=\"onActiveDateChange($event)\"\r\n (selectedChange)=\"timeSelected($event)\" (ampmChange)=\"ampmClicked($event)\" (clockViewChange)=\"clockView = $event\">\r\n </cmat-datetimepicker-time>\r\n } @else {\r\n <cmat-datetimepicker-clock [dateFilter]=\"dateFilter\" [interval]=\"timeInterval\"\r\n [maxDate]=\"maxDate\" [minDate]=\"minDate\" [selected]=\"activeDate\" [startView]=\"clockView\"\r\n [twelvehour]=\"twelvehour\" (userSelection)=\"userSelected()\" (activeDateChange)=\"onActiveDateChange($event)\" (selectedChange)=\"dialTimeSelected($event)\">\r\n </cmat-datetimepicker-clock>\r\n }\r\n }\r\n }\r\n</div>", 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-year: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-ampm:not(.active){opacity:.6}.cmat-datetimepicker-calendar-header-year.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-ampm.not-clickable{cursor:initial}.cmat-datetimepicker-calendar-header-time{display:inline-flex}.cmat-datetimepicker-calendar-header-time:not(.active){opacity:.6}.cmat-datetimepicker-calendar-header-time:not(.active) .cmat-datetimepicker-calendar-header-hours,.cmat-datetimepicker-calendar-header-time:not(.active) .cmat-datetimepicker-calendar-header-minutes,.cmat-datetimepicker-calendar-header-time:not(.active) .cmat-datetimepicker-calendar-header-ampm{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:transparent;box-sizing:border-box}.cmat-datetimepicker-calendar-previous-button.disabled,.cmat-datetimepicker-calendar-next-button.disabled{pointer-events:none}.cmat-datetimepicker-calendar-previous-button svg,.cmat-datetimepicker-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .cmat-datetimepicker-calendar-previous-button svg,[dir=rtl] .cmat-datetimepicker-calendar-next-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"] }]
|
|
1977
|
-
}], ctorParameters: () => [
|
|
1978
|
-
type: Optional
|
|
1979
|
-
}] }, { type: undefined, decorators: [{
|
|
1980
|
-
type: Optional
|
|
1981
|
-
}, {
|
|
1982
|
-
type: Inject,
|
|
1983
|
-
args: [CMAT_DATETIME_FORMATS]
|
|
1984
|
-
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { userSelection: [{
|
|
1956
|
+
}], ctorParameters: () => [], propDecorators: { userSelection: [{
|
|
1985
1957
|
type: Output
|
|
1986
1958
|
}], multiYearSelector: [{
|
|
1987
1959
|
type: Input
|
|
@@ -2048,13 +2020,13 @@ const CMAT_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER = {
|
|
|
2048
2020
|
* future. (e.g. confirmation buttons).
|
|
2049
2021
|
*/
|
|
2050
2022
|
class CmatDatetimepickerContentComponent {
|
|
2051
|
-
constructor(
|
|
2052
|
-
this._elementRef = _elementRef;
|
|
2053
|
-
this._changeDetectorRef = _changeDetectorRef;
|
|
2023
|
+
constructor() {
|
|
2054
2024
|
/** Emits when an animation has finished. */
|
|
2055
2025
|
this.animationDone = new Subject();
|
|
2056
2026
|
/** Id of the label for the `role="dialog"` element. */
|
|
2057
2027
|
this.dialogLabelId = null;
|
|
2028
|
+
this._elementRef = inject(ElementRef);
|
|
2029
|
+
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
2058
2030
|
}
|
|
2059
2031
|
ngOnInit() {
|
|
2060
2032
|
this.animationState = this.datetimepicker.touchUi ? 'enter-dialog' : 'enter-dropdown';
|
|
@@ -2069,13 +2041,13 @@ class CmatDatetimepickerContentComponent {
|
|
|
2069
2041
|
ngOnDestroy() {
|
|
2070
2042
|
this.animationDone.complete();
|
|
2071
2043
|
}
|
|
2072
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
2073
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.
|
|
2044
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2045
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: CmatDatetimepickerContentComponent, isStandalone: true, selector: "cmat-datetimepicker-content", inputs: { color: "color" }, host: { listeners: { "@transformPanel.done": "animationDone.next()" }, properties: { "class": "color ? \"mat-\" + color : \"\"", "class.cmat-datetimepicker-content-touch": "datetimepicker?.touchUi", "attr.mode": "datetimepicker.mode", "@transformPanel": "animationState" }, classAttribute: "cmat-datetimepicker-content" }, viewQueries: [{ propertyName: "_calendar", first: true, predicate: CmatDatetimepickerCalendarComponent, descendants: true, static: true }], exportAs: ["cmatDatetimepickerContent"], ngImport: i0, template: "<div cdkTrapFocus role=\"dialog\" class=\"cmat-datetimepicker-content-container\" [attr.aria-modal]=\"true\"\r\n [attr.aria-labelledby]=\"dialogLabelId ?? undefined\" [attr.mode]=\"datetimepicker.mode\">\r\n <cmat-datetimepicker-calendar [id]=\"datetimepicker.id\" [ngClass]=\"datetimepicker.panelClass\"\r\n [attr.mode]=\"datetimepicker.mode\" [type]=\"datetimepicker.type\" [startAt]=\"datetimepicker.startAt\"\r\n [startView]=\"datetimepicker.startView\" [maxDate]=\"datetimepicker.maxDate\" [minDate]=\"datetimepicker.minDate\"\r\n [dateFilter]=\"datetimepicker.dateFilter\" [multiYearSelector]=\"datetimepicker.multiYearSelector\"\r\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\r\n [timeInterval]=\"datetimepicker.timeInterval\" [twelvehour]=\"datetimepicker.twelvehour\"\r\n [selected]=\"datetimepicker.selected\" [timeInput]=\"datetimepicker.timeInput\"\r\n [@fadeInCalendar]=\"'enter'\" (selectedChange)=\"datetimepicker.select($event)\"\r\n (viewChanged)=\"datetimepicker.viewChange($event)\" (userSelection)=\"datetimepicker.close()\">\r\n </cmat-datetimepicker-calendar>\r\n</div>", dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: CmatDatetimepickerCalendarComponent, selector: "cmat-datetimepicker-calendar", inputs: ["multiYearSelector", "startView", "twelvehour", "timeInterval", "dateFilter", "preventSameDateTimeSelection", "type", "startAt", "timeInput", "selected", "minDate", "maxDate"], outputs: ["userSelection", "selectedChange", "viewChanged"], exportAs: ["cmatDatetimepickerCalendar"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [
|
|
2074
2046
|
transformPanel,
|
|
2075
2047
|
fadeInCalendar,
|
|
2076
2048
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2077
2049
|
}
|
|
2078
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
2050
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerContentComponent, decorators: [{
|
|
2079
2051
|
type: Component,
|
|
2080
2052
|
args: [{ selector: 'cmat-datetimepicker-content', host: {
|
|
2081
2053
|
'class': 'cmat-datetimepicker-content',
|
|
@@ -2093,21 +2065,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
2093
2065
|
transformPanel,
|
|
2094
2066
|
fadeInCalendar,
|
|
2095
2067
|
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatDatetimepickerContent', imports: [A11yModule, CmatDatetimepickerCalendarComponent, NgClass], template: "<div cdkTrapFocus role=\"dialog\" class=\"cmat-datetimepicker-content-container\" [attr.aria-modal]=\"true\"\r\n [attr.aria-labelledby]=\"dialogLabelId ?? undefined\" [attr.mode]=\"datetimepicker.mode\">\r\n <cmat-datetimepicker-calendar [id]=\"datetimepicker.id\" [ngClass]=\"datetimepicker.panelClass\"\r\n [attr.mode]=\"datetimepicker.mode\" [type]=\"datetimepicker.type\" [startAt]=\"datetimepicker.startAt\"\r\n [startView]=\"datetimepicker.startView\" [maxDate]=\"datetimepicker.maxDate\" [minDate]=\"datetimepicker.minDate\"\r\n [dateFilter]=\"datetimepicker.dateFilter\" [multiYearSelector]=\"datetimepicker.multiYearSelector\"\r\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\r\n [timeInterval]=\"datetimepicker.timeInterval\" [twelvehour]=\"datetimepicker.twelvehour\"\r\n [selected]=\"datetimepicker.selected\" [timeInput]=\"datetimepicker.timeInput\"\r\n [@fadeInCalendar]=\"'enter'\" (selectedChange)=\"datetimepicker.select($event)\"\r\n (viewChanged)=\"datetimepicker.viewChange($event)\" (userSelection)=\"datetimepicker.close()\">\r\n </cmat-datetimepicker-calendar>\r\n</div>" }]
|
|
2096
|
-
}],
|
|
2068
|
+
}], propDecorators: { _calendar: [{
|
|
2097
2069
|
type: ViewChild,
|
|
2098
2070
|
args: [CmatDatetimepickerCalendarComponent, { static: true }]
|
|
2099
2071
|
}], color: [{
|
|
2100
2072
|
type: Input
|
|
2101
2073
|
}] } });
|
|
2102
2074
|
class CmatDatetimepickerComponent {
|
|
2103
|
-
constructor(
|
|
2104
|
-
this._overlay = _overlay;
|
|
2105
|
-
this._injector = _injector;
|
|
2106
|
-
this._viewContainerRef = _viewContainerRef;
|
|
2107
|
-
this._scrollStrategy = _scrollStrategy;
|
|
2108
|
-
this._dateAdapter = _dateAdapter;
|
|
2109
|
-
this._dir = _dir;
|
|
2110
|
-
this._document = _document;
|
|
2075
|
+
constructor() {
|
|
2111
2076
|
/** The view that the calendar should start in. */
|
|
2112
2077
|
this.startView = 'month';
|
|
2113
2078
|
this.mode = 'auto';
|
|
@@ -2130,6 +2095,13 @@ class CmatDatetimepickerComponent {
|
|
|
2130
2095
|
this.id = `cmat-datetimepicker-${datetimepickerUid++}`;
|
|
2131
2096
|
/** Emits when the datepicker is disabled. */
|
|
2132
2097
|
this.disabledChange = new Subject();
|
|
2098
|
+
this._overlay = inject(Overlay);
|
|
2099
|
+
this._injector = inject(Injector);
|
|
2100
|
+
this._viewContainerRef = inject(ViewContainerRef);
|
|
2101
|
+
this._scrollStrategy = inject(CMAT_DATETIMEPICKER_SCROLL_STRATEGY);
|
|
2102
|
+
this._dateAdapter = inject(DatetimeAdapter, { optional: true });
|
|
2103
|
+
this._dir = inject(Directionality, { optional: true });
|
|
2104
|
+
this._document = inject(DOCUMENT, { optional: true });
|
|
2133
2105
|
this._validSelected = null;
|
|
2134
2106
|
/** The element that was focused before the datetimepicker was opened. */
|
|
2135
2107
|
this._focusedElementBeforeOpen = null;
|
|
@@ -2479,25 +2451,13 @@ class CmatDatetimepickerComponent {
|
|
|
2479
2451
|
hasModifierKey(event, 'altKey') &&
|
|
2480
2452
|
event.code === 'ArrowUp')))));
|
|
2481
2453
|
}
|
|
2482
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
2483
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.
|
|
2454
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2455
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: CmatDatetimepickerComponent, isStandalone: true, selector: "cmat-datetimepicker", inputs: { startView: "startView", mode: "mode", timeInterval: "timeInterval", preventSameDateTimeSelection: "preventSameDateTimeSelection", xPosition: "xPosition", yPosition: "yPosition", multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", panelClass: "panelClass", opened: "opened", color: "color", startAt: "startAt", type: "type", timeInput: "timeInput", touchUi: "touchUi", disabled: "disabled", restoreFocus: "restoreFocus" }, outputs: { selectedChanged: "selectedChanged", openedStream: "openedStream", closedStream: "closedStream", viewChanged: "viewChanged" }, exportAs: ["cmatDatetimepicker"], ngImport: i0, template: '', isInline: true, styles: [".cmat-datetimepicker-calendar-header,.cmat-datetimepicker-calendar-body-cell-content.cmat-datetimepicker-calendar-body-selected{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-cell:not(.cmat-datetimepicker-calendar-body-disabled):hover>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected),.cmat-datetimepicker-calendar-body-active>.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){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-calendar-previous-button.disabled,.cmat-datetimepicker-calendar-next-button.disabled{color:var(--cmat-text-disabled)}.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 all and (orientation: landscape){.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=landscape]{width:120vh;height:100%;min-height:80vh}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto] .cmat-datetimepicker-calendar,.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[mode=portrait]{width:64vh;height:90vh}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait] .cmat-datetimepicker-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto] .cmat-datetimepicker-calendar,.cmat-datetimepicker-content-touch .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}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2484
2456
|
}
|
|
2485
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
2457
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerComponent, decorators: [{
|
|
2486
2458
|
type: Component,
|
|
2487
|
-
args: [{ selector: 'cmat-datetimepicker', exportAs: 'cmatDatetimepicker', template: '', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false,
|
|
2488
|
-
}], ctorParameters: () => [
|
|
2489
|
-
type: Inject,
|
|
2490
|
-
args: [CMAT_DATETIMEPICKER_SCROLL_STRATEGY]
|
|
2491
|
-
}] }, { type: i1.DatetimeAdapter, decorators: [{
|
|
2492
|
-
type: Optional
|
|
2493
|
-
}] }, { type: i4.Directionality, decorators: [{
|
|
2494
|
-
type: Optional
|
|
2495
|
-
}] }, { type: undefined, decorators: [{
|
|
2496
|
-
type: Optional
|
|
2497
|
-
}, {
|
|
2498
|
-
type: Inject,
|
|
2499
|
-
args: [DOCUMENT]
|
|
2500
|
-
}] }], propDecorators: { startView: [{
|
|
2459
|
+
args: [{ selector: 'cmat-datetimepicker', exportAs: 'cmatDatetimepicker', template: '', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, styles: [".cmat-datetimepicker-calendar-header,.cmat-datetimepicker-calendar-body-cell-content.cmat-datetimepicker-calendar-body-selected{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-cell:not(.cmat-datetimepicker-calendar-body-disabled):hover>.cmat-datetimepicker-calendar-body-cell-content:not(.cmat-datetimepicker-calendar-body-selected),.cmat-datetimepicker-calendar-body-active>.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){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-calendar-previous-button.disabled,.cmat-datetimepicker-calendar-next-button.disabled{color:var(--cmat-text-disabled)}.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 all and (orientation: landscape){.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=landscape]{width:120vh;height:100%;min-height:80vh}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto] .cmat-datetimepicker-calendar,.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[mode=portrait]{width:64vh;height:90vh}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait] .cmat-datetimepicker-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto],.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.cmat-datetimepicker-content-touch .cmat-datetimepicker-content-container[mode=auto] .cmat-datetimepicker-calendar,.cmat-datetimepicker-content-touch .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}}\n"] }]
|
|
2460
|
+
}], ctorParameters: () => [], propDecorators: { startView: [{
|
|
2501
2461
|
type: Input
|
|
2502
2462
|
}], mode: [{
|
|
2503
2463
|
type: Input
|
|
@@ -2566,11 +2526,7 @@ class CmatDatetimepickerInputEvent {
|
|
|
2566
2526
|
}
|
|
2567
2527
|
/** Directive used to connect an input to a MatDatepicker. */
|
|
2568
2528
|
class CmatDatetimepickerInputDirective {
|
|
2569
|
-
constructor(
|
|
2570
|
-
this._elementRef = _elementRef;
|
|
2571
|
-
this._dateAdapter = _dateAdapter;
|
|
2572
|
-
this._dateFormats = _dateFormats;
|
|
2573
|
-
this._formField = _formField;
|
|
2529
|
+
constructor() {
|
|
2574
2530
|
/** Emits when a `change` event is fired on this `<input>`. */
|
|
2575
2531
|
this.dateChange = new EventEmitter();
|
|
2576
2532
|
/** Emits when an `input` event is fired on this `<input>`. */
|
|
@@ -2579,6 +2535,10 @@ class CmatDatetimepickerInputDirective {
|
|
|
2579
2535
|
this.valueChange = new EventEmitter();
|
|
2580
2536
|
/** Emits when the disabled state has changed */
|
|
2581
2537
|
this.disabledChange = new EventEmitter();
|
|
2538
|
+
this._elementRef = inject(ElementRef);
|
|
2539
|
+
this._dateAdapter = inject(DatetimeAdapter, { optional: true });
|
|
2540
|
+
this._dateFormats = inject(CMAT_DATETIME_FORMATS, { optional: true });
|
|
2541
|
+
this._formField = inject(MatFormField, { optional: true });
|
|
2582
2542
|
this._datepickerSubscription = Subscription.EMPTY;
|
|
2583
2543
|
this._localeSubscription = Subscription.EMPTY;
|
|
2584
2544
|
/** Whether the last value set on the input was valid. */
|
|
@@ -2615,6 +2575,7 @@ class CmatDatetimepickerInputDirective {
|
|
|
2615
2575
|
/** The combined form control validator for this input. */
|
|
2616
2576
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
2617
2577
|
this._validator = Validators.compose([this._parseValidator, this._minValidator, this._maxValidator, this._filterValidator]);
|
|
2578
|
+
const _dateAdapter = this._dateAdapter;
|
|
2618
2579
|
if (!this._dateAdapter) {
|
|
2619
2580
|
throw createMissingDateImplError('CDatetimeAdapter');
|
|
2620
2581
|
}
|
|
@@ -2812,14 +2773,14 @@ class CmatDatetimepickerInputDirective {
|
|
|
2812
2773
|
this._elementRef.nativeElement.value =
|
|
2813
2774
|
value ? this._dateAdapter.format(value, this._getDisplayFormat()) : '';
|
|
2814
2775
|
}
|
|
2815
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
2816
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.
|
|
2776
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2777
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.2", type: CmatDatetimepickerInputDirective, isStandalone: true, selector: "input[cmatDatetimepicker]", inputs: { cmatDatetimepicker: "cmatDatetimepicker", cmatDatepickerFilter: "cmatDatepickerFilter", value: "value", min: "min", max: "max", disabled: "disabled" }, outputs: { dateChange: "dateChange", dateInput: "dateInput" }, host: { listeners: { "input": "onInput($event.target.value)", "change": "onChange()", "blur": "onBlur()", "keydown": "onKeydown($event)" }, properties: { "attr.aria-haspopup": "true", "attr.aria-owns": "(datetimepicker?.opened && datetimepicker.id) || null", "attr.min": "min ? datetimepicker.toIso8601(min) : null", "attr.max": "max ? datetimepicker.toIso8601(max) : null", "disabled": "disabled" } }, providers: [
|
|
2817
2778
|
CMAT_DATETIMEPICKER_VALUE_ACCESSOR,
|
|
2818
2779
|
CMAT_DATETIMEPICKER_VALIDATORS,
|
|
2819
2780
|
{ provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: CmatDatetimepickerInputDirective },
|
|
2820
2781
|
], exportAs: ["cmatDatepickerInput"], ngImport: i0 }); }
|
|
2821
2782
|
}
|
|
2822
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
2783
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerInputDirective, decorators: [{
|
|
2823
2784
|
type: Directive,
|
|
2824
2785
|
args: [{
|
|
2825
2786
|
selector: 'input[cmatDatetimepicker]',
|
|
@@ -2839,19 +2800,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
2839
2800
|
'(blur)': 'onBlur()',
|
|
2840
2801
|
'(keydown)': 'onKeydown($event)'
|
|
2841
2802
|
},
|
|
2842
|
-
exportAs: 'cmatDatepickerInput'
|
|
2843
|
-
standalone: true
|
|
2803
|
+
exportAs: 'cmatDatepickerInput'
|
|
2844
2804
|
}]
|
|
2845
|
-
}], ctorParameters: () => [
|
|
2846
|
-
type: Optional
|
|
2847
|
-
}] }, { type: undefined, decorators: [{
|
|
2848
|
-
type: Optional
|
|
2849
|
-
}, {
|
|
2850
|
-
type: Inject,
|
|
2851
|
-
args: [CMAT_DATETIME_FORMATS]
|
|
2852
|
-
}] }, { type: i2$1.MatFormField, decorators: [{
|
|
2853
|
-
type: Optional
|
|
2854
|
-
}] }], propDecorators: { dateChange: [{
|
|
2805
|
+
}], ctorParameters: () => [], propDecorators: { dateChange: [{
|
|
2855
2806
|
type: Output
|
|
2856
2807
|
}], dateInput: [{
|
|
2857
2808
|
type: Output
|
|
@@ -2871,22 +2822,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
2871
2822
|
|
|
2872
2823
|
/** Can be used to override the icon of a `cmatDatetimepickerToggle`. */
|
|
2873
2824
|
class CmatDatetimepickerToggleIconDirective {
|
|
2874
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
2875
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.
|
|
2825
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerToggleIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2826
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.2", type: CmatDatetimepickerToggleIconDirective, isStandalone: true, selector: "[cmatDatetimepickerToggleIcon]", ngImport: i0 }); }
|
|
2876
2827
|
}
|
|
2877
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
2828
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerToggleIconDirective, decorators: [{
|
|
2878
2829
|
type: Directive,
|
|
2879
2830
|
args: [{
|
|
2880
|
-
selector: '[cmatDatetimepickerToggleIcon]'
|
|
2881
|
-
standalone: true
|
|
2831
|
+
selector: '[cmatDatetimepickerToggleIcon]'
|
|
2882
2832
|
}]
|
|
2883
2833
|
}] });
|
|
2884
2834
|
class CmatDatetimepickerToggleComponent {
|
|
2885
|
-
constructor(
|
|
2886
|
-
this.intl = intl;
|
|
2887
|
-
this._changeDetectorRef = _changeDetectorRef;
|
|
2835
|
+
constructor() {
|
|
2888
2836
|
this.class = 'cmat-datetimepicker-toggle';
|
|
2837
|
+
this.intl = inject(CmatDatetimepickerIntl);
|
|
2889
2838
|
this._stateChanges = Subscription.EMPTY;
|
|
2839
|
+
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
2890
2840
|
}
|
|
2891
2841
|
/** Whether the toggle button is disabled. */
|
|
2892
2842
|
get disabled() {
|
|
@@ -2920,13 +2870,13 @@ class CmatDatetimepickerToggleComponent {
|
|
|
2920
2870
|
this._stateChanges = merge([this.intl.changes, datepickerDisabled, inputDisabled])
|
|
2921
2871
|
.subscribe(() => this._changeDetectorRef.markForCheck());
|
|
2922
2872
|
}
|
|
2923
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.
|
|
2924
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.
|
|
2873
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2874
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.2", type: CmatDatetimepickerToggleComponent, isStandalone: true, selector: "cmat-datetimepicker-toggle", inputs: { datetimepicker: ["for", "datetimepicker"], tabIndex: "tabIndex", ariaLabel: ["aria-label", "ariaLabel"], disableRipple: "disableRipple", disabled: "disabled" }, host: { properties: { "class": "this.class" } }, queries: [{ propertyName: "customIcon", first: true, predicate: CmatDatetimepickerToggleIconDirective, descendants: true }], viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }], exportAs: ["cmatDatetimepickerToggle"], usesOnChanges: true, ngImport: i0, template: "<button type=\"button\" mat-icon-button \r\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\" [attr.aria-label]=\"ariaLabel || intl.openCalendarLabel\"\r\n [attr.tabindex]=\"disabled ? -1 : tabIndex\" [disabled]=\"disabled\" [disableRipple]=\"disableRipple\" (click)=\"open($event)\">\r\n @if (!customIcon) {\r\n @switch (datetimepicker.type) {\r\n @case ('time') {\r\n <svg class=\"mat-icon cmat-datetimepicker-toggle-default-icon\" viewBox=\"0 0 24 24\" width=\"24px\"\r\n height=\"24px\" fill=\"currentColor\" focusable=\"false\">\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 }\r\n @case ('datetime') {\r\n <svg class=\"mat-icon cmat-datetimepicker-toggle-default-icon\" viewBox=\"0 0 24 24\" width=\"24px\"\r\n height=\"24px\" fill=\"currentColor\" focusable=\"false\">\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 }\r\n @default {\r\n <svg class=\"mat-icon cmat-datetimepicker-toggle-default-icon\" viewBox=\"0 0 24 24\" width=\"24px\"\r\n height=\"24px\" fill=\"currentColor\" focusable=\"false\">\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 </svg>\r\n }\r\n }\r\n }\r\n\r\n <ng-content select=\"[cmatDatetimepickerToggleIcon]\"></ng-content>\r\n </button>", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2925
2875
|
}
|
|
2926
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.
|
|
2876
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: CmatDatetimepickerToggleComponent, decorators: [{
|
|
2927
2877
|
type: Component,
|
|
2928
2878
|
args: [{ selector: 'cmat-datetimepicker-toggle', exportAs: 'cmatDatetimepickerToggle', encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule], template: "<button type=\"button\" mat-icon-button \r\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\" [attr.aria-label]=\"ariaLabel || intl.openCalendarLabel\"\r\n [attr.tabindex]=\"disabled ? -1 : tabIndex\" [disabled]=\"disabled\" [disableRipple]=\"disableRipple\" (click)=\"open($event)\">\r\n @if (!customIcon) {\r\n @switch (datetimepicker.type) {\r\n @case ('time') {\r\n <svg class=\"mat-icon cmat-datetimepicker-toggle-default-icon\" viewBox=\"0 0 24 24\" width=\"24px\"\r\n height=\"24px\" fill=\"currentColor\" focusable=\"false\">\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 }\r\n @case ('datetime') {\r\n <svg class=\"mat-icon cmat-datetimepicker-toggle-default-icon\" viewBox=\"0 0 24 24\" width=\"24px\"\r\n height=\"24px\" fill=\"currentColor\" focusable=\"false\">\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 }\r\n @default {\r\n <svg class=\"mat-icon cmat-datetimepicker-toggle-default-icon\" viewBox=\"0 0 24 24\" width=\"24px\"\r\n height=\"24px\" fill=\"currentColor\" focusable=\"false\">\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 </svg>\r\n }\r\n }\r\n }\r\n\r\n <ng-content select=\"[cmatDatetimepickerToggleIcon]\"></ng-content>\r\n </button>" }]
|
|
2929
|
-
}],
|
|
2879
|
+
}], propDecorators: { datetimepicker: [{
|
|
2930
2880
|
type: Input,
|
|
2931
2881
|
args: ['for']
|
|
2932
2882
|
}], tabIndex: [{
|