@ng-matero/extensions 13.2.1 → 14.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/alert/alert.component.d.ts +2 -2
- package/alert/{mtxAlert.d.ts → index.d.ts} +0 -0
- package/button/button-loading.directive.d.ts +1 -1
- package/button/{mtxButton.d.ts → index.d.ts} +0 -0
- package/checkbox-group/checkbox-group.component.d.ts +1 -1
- package/checkbox-group/{mtxCheckboxGroup.d.ts → index.d.ts} +0 -0
- package/colorpicker/colorpicker-input.d.ts +1 -1
- package/colorpicker/colorpicker-toggle.d.ts +2 -2
- package/colorpicker/colorpicker.d.ts +5 -3
- package/colorpicker/{mtxColorpicker.d.ts → index.d.ts} +0 -0
- package/column-resize/column-resize-directives/column-resize-flex.d.ts +1 -1
- package/column-resize/column-resize-directives/column-resize.d.ts +1 -1
- package/column-resize/column-resize.d.ts +1 -1
- package/column-resize/{mtxColumnResize.d.ts → index.d.ts} +0 -0
- package/column-resize/overlay-handle.d.ts +1 -1
- package/column-resize/resizable.d.ts +1 -1
- package/core/{mtxCore.d.ts → index.d.ts} +0 -0
- package/core/pipes/to-observable.pipe.d.ts +1 -1
- package/core/style/_vendor-prefixes.scss +1 -1
- package/datetimepicker/_datetimepicker-theme.scss +1 -1
- package/datetimepicker/calendar-body.d.ts +1 -1
- package/datetimepicker/calendar.d.ts +6 -2
- package/datetimepicker/clock.d.ts +4 -1
- package/datetimepicker/datetimepicker-input.d.ts +1 -1
- package/datetimepicker/datetimepicker-toggle.d.ts +2 -2
- package/datetimepicker/datetimepicker-types.d.ts +1 -0
- package/datetimepicker/datetimepicker.d.ts +10 -6
- package/datetimepicker/{mtxDatetimepicker.d.ts → index.d.ts} +0 -0
- package/datetimepicker/month-view.d.ts +1 -1
- package/datetimepicker/multi-year-view.d.ts +1 -1
- package/datetimepicker/year-view.d.ts +1 -1
- package/dialog/dialog.component.d.ts +1 -1
- package/dialog/{mtxDialog.d.ts → index.d.ts} +0 -0
- package/drawer/drawer-config.d.ts +12 -4
- package/drawer/drawer-container.d.ts +12 -4
- package/drawer/{mtxDrawer.d.ts → index.d.ts} +0 -0
- package/esm2020/alert/alert.component.mjs +6 -6
- package/esm2020/alert/alert.module.mjs +5 -5
- package/esm2020/button/button-loading.directive.mjs +4 -4
- package/esm2020/button/button.module.mjs +5 -5
- package/esm2020/checkbox-group/checkbox-group.component.mjs +7 -7
- package/esm2020/checkbox-group/checkbox-group.module.mjs +5 -5
- package/esm2020/colorpicker/colorpicker-input.mjs +3 -3
- package/esm2020/colorpicker/colorpicker-module.mjs +10 -12
- package/esm2020/colorpicker/colorpicker-toggle.mjs +8 -8
- package/esm2020/colorpicker/colorpicker.mjs +12 -10
- package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +3 -3
- package/esm2020/column-resize/column-resize-directives/column-resize.mjs +3 -3
- package/esm2020/column-resize/column-resize-module.mjs +4 -4
- package/esm2020/column-resize/column-resize-notifier.mjs +6 -6
- package/esm2020/column-resize/column-resize.mjs +3 -3
- package/esm2020/column-resize/column-size-store.mjs +3 -3
- package/esm2020/column-resize/event-dispatcher.mjs +3 -3
- package/esm2020/column-resize/overlay-handle.mjs +3 -3
- package/esm2020/column-resize/resizable.mjs +3 -3
- package/esm2020/column-resize/resize-strategy.mjs +9 -9
- package/esm2020/core/datetime/datetime.module.mjs +10 -10
- package/esm2020/core/datetime/native-datetime-adapter.mjs +3 -3
- package/esm2020/core/pipes/pipes.module.mjs +5 -5
- package/esm2020/core/pipes/to-observable.pipe.mjs +3 -3
- package/esm2020/datetimepicker/calendar-body.mjs +3 -3
- package/esm2020/datetimepicker/calendar.mjs +14 -11
- package/esm2020/datetimepicker/clock.mjs +6 -4
- package/esm2020/datetimepicker/datetimepicker-input.mjs +3 -3
- package/esm2020/datetimepicker/datetimepicker-module.mjs +5 -5
- package/esm2020/datetimepicker/datetimepicker-toggle.mjs +8 -8
- package/esm2020/datetimepicker/datetimepicker-types.mjs +1 -1
- package/esm2020/datetimepicker/datetimepicker.mjs +14 -11
- package/esm2020/datetimepicker/month-view.mjs +6 -6
- package/esm2020/datetimepicker/multi-year-view.mjs +4 -4
- package/esm2020/datetimepicker/year-view.mjs +4 -4
- package/esm2020/dialog/dialog.component.mjs +6 -6
- package/esm2020/dialog/dialog.mjs +3 -3
- package/esm2020/dialog/dialog.module.mjs +5 -5
- package/esm2020/drawer/drawer-config.mjs +1 -5
- package/esm2020/drawer/drawer-container.mjs +22 -12
- package/esm2020/drawer/drawer-module.mjs +5 -5
- package/esm2020/drawer/drawer.mjs +3 -3
- package/esm2020/form-group/form-group.component.mjs +5 -5
- package/esm2020/form-group/form-group.module.mjs +5 -5
- package/esm2020/grid/cell.component.mjs +61 -39
- package/esm2020/grid/column-menu.component.mjs +10 -10
- package/esm2020/grid/column-resize/column-resize-directives/column-resize-flex.mjs +3 -3
- package/esm2020/grid/column-resize/column-resize-directives/column-resize.mjs +3 -3
- package/esm2020/grid/column-resize/column-resize-module.mjs +8 -8
- package/esm2020/grid/column-resize/overlay-handle.mjs +3 -3
- package/esm2020/grid/column-resize/resizable-directives/resizable.mjs +3 -3
- package/esm2020/grid/column-resize/resize-strategy.mjs +3 -3
- package/esm2020/grid/expansion-toggle.directive.mjs +3 -3
- package/esm2020/grid/grid.component.mjs +28 -23
- package/esm2020/grid/grid.interface.mjs +1 -1
- package/esm2020/grid/grid.module.mjs +22 -24
- package/esm2020/grid/grid.service.mjs +3 -3
- package/esm2020/loader/loader.component.mjs +6 -6
- package/esm2020/loader/loader.module.mjs +5 -5
- package/esm2020/popover/popover-module.mjs +5 -5
- package/esm2020/popover/popover-target.mjs +3 -3
- package/esm2020/popover/popover-trigger.mjs +3 -3
- package/esm2020/popover/popover.mjs +4 -4
- package/esm2020/progress/progress.component.mjs +3 -3
- package/esm2020/progress/progress.module.mjs +5 -5
- package/esm2020/select/option.component.mjs +3 -3
- package/esm2020/select/select.component.mjs +5 -5
- package/esm2020/select/select.module.mjs +5 -5
- package/esm2020/select/templates.directive.mjs +33 -33
- package/esm2020/slider/slider-module.mjs +5 -5
- package/esm2020/slider/slider.mjs +4 -4
- package/esm2020/split/split-pane.directive.mjs +3 -3
- package/esm2020/split/split.component.mjs +3 -3
- package/esm2020/split/split.module.mjs +5 -5
- package/esm2020/text3d/text3d.component.mjs +3 -3
- package/esm2020/text3d/text3d.module.mjs +5 -5
- package/esm2020/tooltip/tooltip-module.mjs +5 -5
- package/esm2020/tooltip/tooltip.mjs +7 -7
- package/fesm2015/mtxAlert.mjs +9 -9
- package/fesm2015/mtxAlert.mjs.map +1 -1
- package/fesm2015/mtxButton.mjs +7 -7
- package/fesm2015/mtxButton.mjs.map +1 -1
- package/fesm2015/mtxCheckboxGroup.mjs +11 -11
- package/fesm2015/mtxCheckboxGroup.mjs.map +1 -1
- package/fesm2015/mtxColorpicker.mjs +30 -30
- package/fesm2015/mtxColorpicker.mjs.map +1 -1
- package/fesm2015/mtxColumnResize.mjs +40 -40
- package/fesm2015/mtxColumnResize.mjs.map +1 -1
- package/fesm2015/mtxCore.mjs +19 -19
- package/fesm2015/mtxCore.mjs.map +1 -1
- package/fesm2015/mtxDatetimepicker.mjs +405 -397
- package/fesm2015/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2015/mtxDialog.mjs +13 -13
- package/fesm2015/mtxDialog.mjs.map +1 -1
- package/fesm2015/mtxDrawer.mjs +28 -22
- package/fesm2015/mtxDrawer.mjs.map +1 -1
- package/fesm2015/mtxFormGroup.mjs +8 -8
- package/fesm2015/mtxFormGroup.mjs.map +1 -1
- package/fesm2015/mtxGrid.mjs +377 -351
- package/fesm2015/mtxGrid.mjs.map +1 -1
- package/fesm2015/mtxLoader.mjs +10 -10
- package/fesm2015/mtxLoader.mjs.map +1 -1
- package/fesm2015/mtxPopover.mjs +13 -13
- package/fesm2015/mtxPopover.mjs.map +1 -1
- package/fesm2015/mtxProgress.mjs +7 -7
- package/fesm2015/mtxProgress.mjs.map +1 -1
- package/fesm2015/mtxSelect.mjs +45 -45
- package/fesm2015/mtxSelect.mjs.map +1 -1
- package/fesm2015/mtxSlider.mjs +8 -8
- package/fesm2015/mtxSlider.mjs.map +1 -1
- package/fesm2015/mtxSplit.mjs +10 -10
- package/fesm2015/mtxSplit.mjs.map +1 -1
- package/fesm2015/mtxText3d.mjs +7 -7
- package/fesm2015/mtxText3d.mjs.map +1 -1
- package/fesm2015/mtxTooltip.mjs +10 -10
- package/fesm2015/mtxTooltip.mjs.map +1 -1
- package/fesm2015/ng-matero-extensions.mjs.map +1 -1
- package/fesm2020/mtxAlert.mjs +9 -9
- package/fesm2020/mtxAlert.mjs.map +1 -1
- package/fesm2020/mtxButton.mjs +7 -7
- package/fesm2020/mtxButton.mjs.map +1 -1
- package/fesm2020/mtxCheckboxGroup.mjs +11 -11
- package/fesm2020/mtxCheckboxGroup.mjs.map +1 -1
- package/fesm2020/mtxColorpicker.mjs +30 -30
- package/fesm2020/mtxColorpicker.mjs.map +1 -1
- package/fesm2020/mtxColumnResize.mjs +40 -40
- package/fesm2020/mtxColumnResize.mjs.map +1 -1
- package/fesm2020/mtxCore.mjs +19 -19
- package/fesm2020/mtxCore.mjs.map +1 -1
- package/fesm2020/mtxDatetimepicker.mjs +414 -406
- package/fesm2020/mtxDatetimepicker.mjs.map +1 -1
- package/fesm2020/mtxDialog.mjs +13 -13
- package/fesm2020/mtxDialog.mjs.map +1 -1
- package/fesm2020/mtxDrawer.mjs +28 -22
- package/fesm2020/mtxDrawer.mjs.map +1 -1
- package/fesm2020/mtxFormGroup.mjs +8 -8
- package/fesm2020/mtxFormGroup.mjs.map +1 -1
- package/fesm2020/mtxGrid.mjs +376 -351
- package/fesm2020/mtxGrid.mjs.map +1 -1
- package/fesm2020/mtxLoader.mjs +10 -10
- package/fesm2020/mtxLoader.mjs.map +1 -1
- package/fesm2020/mtxPopover.mjs +13 -13
- package/fesm2020/mtxPopover.mjs.map +1 -1
- package/fesm2020/mtxProgress.mjs +7 -7
- package/fesm2020/mtxProgress.mjs.map +1 -1
- package/fesm2020/mtxSelect.mjs +45 -45
- package/fesm2020/mtxSelect.mjs.map +1 -1
- package/fesm2020/mtxSlider.mjs +8 -8
- package/fesm2020/mtxSlider.mjs.map +1 -1
- package/fesm2020/mtxSplit.mjs +10 -10
- package/fesm2020/mtxSplit.mjs.map +1 -1
- package/fesm2020/mtxText3d.mjs +7 -7
- package/fesm2020/mtxText3d.mjs.map +1 -1
- package/fesm2020/mtxTooltip.mjs +10 -10
- package/fesm2020/mtxTooltip.mjs.map +1 -1
- package/fesm2020/ng-matero-extensions.mjs.map +1 -1
- package/form-group/form-group.component.d.ts +1 -1
- package/form-group/{mtxFormGroup.d.ts → index.d.ts} +0 -0
- package/grid/cell.component.d.ts +10 -11
- package/grid/column-menu.component.d.ts +1 -1
- package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +1 -1
- package/grid/column-resize/column-resize-directives/column-resize.d.ts +1 -1
- package/grid/column-resize/overlay-handle.d.ts +1 -1
- package/grid/column-resize/resizable-directives/resizable.d.ts +1 -1
- package/grid/expansion-toggle.directive.d.ts +1 -1
- package/grid/grid.component.d.ts +8 -6
- package/grid/grid.interface.d.ts +24 -12
- package/grid/{mtxGrid.d.ts → index.d.ts} +0 -0
- package/{ng-matero-extensions.d.ts → index.d.ts} +0 -0
- package/loader/{mtxLoader.d.ts → index.d.ts} +0 -0
- package/loader/loader.component.d.ts +1 -1
- package/package.json +29 -29
- package/popover/{mtxPopover.d.ts → index.d.ts} +0 -0
- package/popover/popover-target.d.ts +1 -1
- package/popover/popover-trigger.d.ts +1 -1
- package/popover/popover.d.ts +1 -1
- package/progress/{mtxProgress.d.ts → index.d.ts} +0 -0
- package/progress/progress.component.d.ts +1 -1
- package/select/{mtxSelect.d.ts → index.d.ts} +0 -0
- package/select/option.component.d.ts +1 -1
- package/select/select.component.d.ts +1 -1
- package/select/templates.directive.d.ts +11 -11
- package/slider/_slider-theme.scss +1 -1
- package/slider/{mtxSlider.d.ts → index.d.ts} +0 -0
- package/slider/slider.d.ts +1 -1
- package/slider/slider.scss +1 -1
- package/split/{mtxSplit.d.ts → index.d.ts} +0 -0
- package/split/split-pane.directive.d.ts +1 -1
- package/split/split.component.d.ts +1 -1
- package/text3d/{mtxText3d.d.ts → index.d.ts} +0 -0
- package/text3d/text3d.component.d.ts +1 -1
- package/tooltip/{mtxTooltip.d.ts → index.d.ts} +0 -0
- package/tooltip/tooltip.d.ts +2 -2
- package/alert/package.json +0 -10
- package/button/package.json +0 -10
- package/checkbox-group/package.json +0 -10
- package/colorpicker/package.json +0 -10
- package/column-resize/package.json +0 -10
- package/core/package.json +0 -10
- package/datetimepicker/package.json +0 -10
- package/dialog/package.json +0 -10
- package/drawer/package.json +0 -10
- package/form-group/package.json +0 -10
- package/grid/package.json +0 -10
- package/loader/package.json +0 -10
- package/popover/package.json +0 -10
- package/progress/package.json +0 -10
- package/select/package.json +0 -10
- package/slider/package.json +0 -10
- package/split/package.json +0 -10
- package/text3d/package.json +0 -10
- package/tooltip/package.json +0 -10
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as i2 from '@angular/cdk/a11y';
|
|
1
|
+
import * as i2$1 from '@angular/cdk/a11y';
|
|
2
2
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
3
|
-
import * as i4 from '@angular/cdk/overlay';
|
|
3
|
+
import * as i4$1 from '@angular/cdk/overlay';
|
|
4
4
|
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
5
5
|
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
6
|
-
import * as
|
|
6
|
+
import * as i2 from '@angular/common';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
9
|
import { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, Optional, Inject, InjectionToken, ViewChild, forwardRef, Directive, ContentChild, NgModule } from '@angular/core';
|
|
10
|
-
import * as
|
|
10
|
+
import * as i4 from '@angular/material/button';
|
|
11
11
|
import { MatButtonModule } from '@angular/material/button';
|
|
12
12
|
import { ENTER, PAGE_DOWN, PAGE_UP, END, HOME, DOWN_ARROW, UP_ARROW, RIGHT_ARROW, LEFT_ARROW, ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
13
13
|
import { coerceBooleanProperty, coerceStringArray } from '@angular/cdk/coercion';
|
|
@@ -22,7 +22,7 @@ import { Subject, Subscription, merge, of } from 'rxjs';
|
|
|
22
22
|
import * as i6 from '@angular/cdk/bidi';
|
|
23
23
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators } from '@angular/forms';
|
|
24
24
|
import { MAT_INPUT_VALUE_ACCESSOR } from '@angular/material/input';
|
|
25
|
-
import * as i2$
|
|
25
|
+
import * as i2$2 from '@angular/material/form-field';
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Animations used by the Material datepicker.
|
|
@@ -129,9 +129,9 @@ class MtxCalendarBody {
|
|
|
129
129
|
return cellNumber === this.activeCell;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
/** @nocollapse */ MtxCalendarBody.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
133
|
-
/** @nocollapse */ MtxCalendarBody.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
132
|
+
/** @nocollapse */ MtxCalendarBody.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxCalendarBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
133
|
+
/** @nocollapse */ MtxCalendarBody.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: { label: "label", rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", allowDisabledSelection: "allowDisabledSelection", activeCell: "activeCell" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { classAttribute: "mtx-calendar-body" }, exportAs: ["mtxCalendarBody"], ngImport: i0, template: "<!--\n If there's not enough space in the first row, create a separate label row. We mark this row as\n aria-hidden because we don't want it to be read out as one of the weeks in the month.\n-->\n<tr *ngIf=\"_firstRowOffset < labelMinRequiredCells\" aria-hidden=\"true\">\n <td [attr.colspan]=\"numCols\" class=\"mtx-calendar-body-label\">{{ label }}</td>\n</tr>\n\n<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\" role=\"row\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n -->\n <td *ngIf=\"rowIndex === 0 && _firstRowOffset\"\n [attr.colspan]=\"_firstRowOffset\"\n aria-hidden=\"true\"\n class=\"mtx-calendar-body-label\">\n {{ _firstRowOffset >= labelMinRequiredCells ? label : '' }}\n </td>\n <td *ngFor=\"let item of row; let colIndex = index\"\n role=\"gridcell\"\n class=\"mtx-calendar-body-cell\"\n [tabindex]=\"_isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [attr.data-mat-row]=\"rowIndex\"\n [attr.data-mat-col]=\"colIndex\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n [class.mtx-calendar-body-active]=\"_isActiveCell(rowIndex, colIndex)\"\n [class.mtx-calendar-body-disabled]=\"!item.enabled\"\n (click)=\"_cellClicked(item)\">\n <div [attr.aria-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-selected]=\"selectedValue === item.value\"\n [class.mtx-calendar-body-today]=\"todayValue === item.value\"\n class=\"mtx-calendar-body-cell-content\">\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".mtx-calendar-body{min-width:224px}.mtx-calendar-body-label{height:0;line-height:0;text-align:left;padding:7.1428571429% 4.7142857143%}[dir=rtl] .mtx-calendar-body-label{text-align:right}.mtx-calendar-body-cell{position:relative;width:14.2857142857%;height:0;line-height:0;padding:7.1428571429% 0;text-align:center;outline:none;cursor:pointer}.mtx-calendar-body-disabled{cursor:default;pointer-events:none}.mtx-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"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxCalendarBody, decorators: [{
|
|
135
135
|
type: Component,
|
|
136
136
|
args: [{ selector: '[mtx-calendar-body]', host: {
|
|
137
137
|
class: 'mtx-calendar-body',
|
|
@@ -297,9 +297,9 @@ class MtxMultiYearView {
|
|
|
297
297
|
return this._adapter.isDateInstance(obj) && this._adapter.isValid(obj) ? obj : null;
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
-
/** @nocollapse */ MtxMultiYearView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
301
|
-
/** @nocollapse */ MtxMultiYearView.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
302
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
300
|
+
/** @nocollapse */ MtxMultiYearView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxMultiYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
301
|
+
/** @nocollapse */ MtxMultiYearView.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MtxMultiYearView, selector: "mtx-multi-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxMultiYearView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [todayValue]=\"_todayYear\"\n [rows]=\"_years\"\n [numCols]=\"4\"\n [activeCell]=\"_getActiveCell()\"\n [allowDisabledSelection]=\"true\"\n [selectedValue]=\"_selectedYear!\"\n (selectedValueChange)=\"_yearSelected($event)\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxMultiYearView, decorators: [{
|
|
303
303
|
type: Component,
|
|
304
304
|
args: [{ selector: 'mtx-multi-year-view', exportAs: 'mtxMultiYearView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [todayValue]=\"_todayYear\"\n [rows]=\"_years\"\n [numCols]=\"4\"\n [activeCell]=\"_getActiveCell()\"\n [allowDisabledSelection]=\"true\"\n [selectedValue]=\"_selectedYear!\"\n (selectedValueChange)=\"_yearSelected($event)\"></tbody>\n</table>\n" }]
|
|
305
305
|
}], ctorParameters: function () { return [{ type: i1.DatetimeAdapter, decorators: [{
|
|
@@ -362,55 +362,52 @@ function euclideanModulo(a, b) {
|
|
|
362
362
|
return ((a % b) + b) % b;
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
const
|
|
365
|
+
const CLOCK_RADIUS = 50;
|
|
366
|
+
const CLOCK_INNER_RADIUS = 27.5;
|
|
367
|
+
const CLOCK_OUTER_RADIUS = 41.25;
|
|
368
|
+
const CLOCK_TICK_RADIUS = 7.0833;
|
|
366
369
|
/**
|
|
367
|
-
*
|
|
370
|
+
* A clock that is used as part of the datetimepicker.
|
|
368
371
|
* @docs-private
|
|
369
372
|
*/
|
|
370
|
-
class
|
|
371
|
-
constructor(
|
|
373
|
+
class MtxClock {
|
|
374
|
+
constructor(_element, _adapter) {
|
|
375
|
+
this._element = _element;
|
|
372
376
|
this._adapter = _adapter;
|
|
373
|
-
|
|
374
|
-
this.
|
|
375
|
-
/**
|
|
377
|
+
/** Step over minutes. */
|
|
378
|
+
this.interval = 1;
|
|
379
|
+
/** Whether the clock uses 12 hour format. */
|
|
380
|
+
this.twelvehour = false;
|
|
381
|
+
/** Emits when the currently selected date changes. */
|
|
376
382
|
this.selectedChange = new EventEmitter();
|
|
383
|
+
/** Emits when any date is activated. */
|
|
384
|
+
this.activeDateChange = new EventEmitter();
|
|
377
385
|
/** Emits when any date is selected. */
|
|
378
386
|
this._userSelection = new EventEmitter();
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
});
|
|
392
|
-
this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
|
|
393
|
-
this._activeDate = this._adapter.today();
|
|
387
|
+
/** Hours and Minutes representing the clock view. */
|
|
388
|
+
this._hours = [];
|
|
389
|
+
this._minutes = [];
|
|
390
|
+
/** Whether the clock is in hour view. */
|
|
391
|
+
this._hourView = true;
|
|
392
|
+
this._timeChanged = false;
|
|
393
|
+
this.mouseMoveListener = (event) => {
|
|
394
|
+
this._handleMousemove(event);
|
|
395
|
+
};
|
|
396
|
+
this.mouseUpListener = () => {
|
|
397
|
+
this._handleMouseup();
|
|
398
|
+
};
|
|
394
399
|
}
|
|
395
400
|
/**
|
|
396
|
-
* The date to display in this
|
|
401
|
+
* The date to display in this clock view.
|
|
397
402
|
*/
|
|
398
403
|
get activeDate() {
|
|
399
404
|
return this._activeDate;
|
|
400
405
|
}
|
|
401
406
|
set activeDate(value) {
|
|
402
407
|
const oldActiveDate = this._activeDate;
|
|
403
|
-
this._activeDate = value
|
|
404
|
-
if (oldActiveDate
|
|
405
|
-
this._activeDate &&
|
|
406
|
-
!this._adapter.sameMonthAndYear(oldActiveDate, this._activeDate)) {
|
|
408
|
+
this._activeDate = this._adapter.clampDate(value, this.minDate, this.maxDate);
|
|
409
|
+
if (!this._adapter.sameMinute(oldActiveDate, this._activeDate)) {
|
|
407
410
|
this._init();
|
|
408
|
-
if (this._adapter.isInNextMonth(oldActiveDate, this._activeDate)) {
|
|
409
|
-
this.calendarState('right');
|
|
410
|
-
}
|
|
411
|
-
else {
|
|
412
|
-
this.calendarState('left');
|
|
413
|
-
}
|
|
414
411
|
}
|
|
415
412
|
}
|
|
416
413
|
/** The currently selected date. */
|
|
@@ -418,354 +415,90 @@ class MtxMonthView {
|
|
|
418
415
|
return this._selected;
|
|
419
416
|
}
|
|
420
417
|
set selected(value) {
|
|
421
|
-
this._selected = value;
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
ngAfterContentInit() {
|
|
425
|
-
this._init();
|
|
426
|
-
}
|
|
427
|
-
/** Handles when a new date is selected. */
|
|
428
|
-
_dateSelected(date) {
|
|
429
|
-
this.selectedChange.emit(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), date, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
|
|
430
|
-
if (this.type === 'date') {
|
|
431
|
-
this._userSelection.emit();
|
|
418
|
+
this._selected = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
419
|
+
if (this._selected) {
|
|
420
|
+
this.activeDate = this._selected;
|
|
432
421
|
}
|
|
433
422
|
}
|
|
434
|
-
|
|
435
|
-
|
|
423
|
+
/** The minimum selectable date. */
|
|
424
|
+
get minDate() {
|
|
425
|
+
return this._minDate;
|
|
436
426
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
this._selectedDate = this._getDateInCurrentMonth(this.selected);
|
|
440
|
-
this._todayDate = this._getDateInCurrentMonth(this._adapter.today());
|
|
441
|
-
const firstOfMonth = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
|
|
442
|
-
this._firstWeekOffset =
|
|
443
|
-
(DAYS_PER_WEEK +
|
|
444
|
-
this._adapter.getDayOfWeek(firstOfMonth) -
|
|
445
|
-
this._adapter.getFirstDayOfWeek()) %
|
|
446
|
-
DAYS_PER_WEEK;
|
|
447
|
-
this._createWeekCells();
|
|
427
|
+
set minDate(value) {
|
|
428
|
+
this._minDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
448
429
|
}
|
|
449
|
-
/**
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
const dateNames = this._adapter.getDateNames();
|
|
453
|
-
this._weeks = [[]];
|
|
454
|
-
for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {
|
|
455
|
-
if (cell === DAYS_PER_WEEK) {
|
|
456
|
-
this._weeks.push([]);
|
|
457
|
-
cell = 0;
|
|
458
|
-
}
|
|
459
|
-
const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), i + 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
|
|
460
|
-
const enabled = !this.dateFilter || this.dateFilter(date);
|
|
461
|
-
const ariaLabel = this._adapter.format(date, this._dateFormats.display.dateA11yLabel);
|
|
462
|
-
this._weeks[this._weeks.length - 1].push(new MtxCalendarCell(i + 1, dateNames[i], ariaLabel, enabled));
|
|
463
|
-
}
|
|
430
|
+
/** The maximum selectable date. */
|
|
431
|
+
get maxDate() {
|
|
432
|
+
return this._maxDate;
|
|
464
433
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
* Returns null if the given Date is in another month.
|
|
468
|
-
*/
|
|
469
|
-
_getDateInCurrentMonth(date) {
|
|
470
|
-
return this._adapter.sameMonthAndYear(date, this.activeDate)
|
|
471
|
-
? this._adapter.getDate(date)
|
|
472
|
-
: null;
|
|
434
|
+
set maxDate(value) {
|
|
435
|
+
this._maxDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
473
436
|
}
|
|
474
|
-
|
|
475
|
-
|
|
437
|
+
/** Whether the clock should be started in hour or minute view. */
|
|
438
|
+
set startView(value) {
|
|
439
|
+
this._hourView = value !== 'minute';
|
|
476
440
|
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
type: Optional
|
|
485
|
-
}] }, { type: undefined, decorators: [{
|
|
486
|
-
type: Optional
|
|
487
|
-
}, {
|
|
488
|
-
type: Inject,
|
|
489
|
-
args: [MTX_DATETIME_FORMATS]
|
|
490
|
-
}] }]; }, propDecorators: { type: [{
|
|
491
|
-
type: Input
|
|
492
|
-
}], dateFilter: [{
|
|
493
|
-
type: Input
|
|
494
|
-
}], selectedChange: [{
|
|
495
|
-
type: Output
|
|
496
|
-
}], _userSelection: [{
|
|
497
|
-
type: Output
|
|
498
|
-
}], activeDate: [{
|
|
499
|
-
type: Input
|
|
500
|
-
}], selected: [{
|
|
501
|
-
type: Input
|
|
502
|
-
}] } });
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* An internal component used to display a single year in the datetimepicker.
|
|
506
|
-
* @docs-private
|
|
507
|
-
*/
|
|
508
|
-
class MtxYearView {
|
|
509
|
-
constructor(_adapter, _dateFormats) {
|
|
510
|
-
this._adapter = _adapter;
|
|
511
|
-
this._dateFormats = _dateFormats;
|
|
512
|
-
this.type = 'date';
|
|
513
|
-
/** Emits when a new month is selected. */
|
|
514
|
-
this.selectedChange = new EventEmitter();
|
|
515
|
-
/** Emits when any date is selected. */
|
|
516
|
-
this._userSelection = new EventEmitter();
|
|
517
|
-
if (!this._adapter) {
|
|
518
|
-
throw createMissingDateImplError('DatetimeAdapter');
|
|
441
|
+
get _hand() {
|
|
442
|
+
let hour = this._adapter.getHour(this.activeDate);
|
|
443
|
+
if (this.twelvehour) {
|
|
444
|
+
if (hour === 0) {
|
|
445
|
+
hour = 24;
|
|
446
|
+
}
|
|
447
|
+
this._selectedHour = hour > 12 ? hour - 12 : hour;
|
|
519
448
|
}
|
|
520
|
-
|
|
521
|
-
|
|
449
|
+
else {
|
|
450
|
+
this._selectedHour = hour;
|
|
522
451
|
}
|
|
523
|
-
this.
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
this._activeDate &&
|
|
534
|
-
!this._adapter.sameYear(oldActiveDate, this._activeDate)) {
|
|
535
|
-
this._init();
|
|
536
|
-
// if (oldActiveDate < this._activeDate) {
|
|
537
|
-
// this.calendarState('right');
|
|
538
|
-
// } else {
|
|
539
|
-
// this.calendarState('left');
|
|
540
|
-
// }
|
|
452
|
+
this._selectedMinute = this._adapter.getMinute(this.activeDate);
|
|
453
|
+
let deg = 0;
|
|
454
|
+
let radius = CLOCK_OUTER_RADIUS;
|
|
455
|
+
if (this._hourView) {
|
|
456
|
+
const outer = this._selectedHour > 0 && this._selectedHour < 13;
|
|
457
|
+
radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
|
|
458
|
+
if (this.twelvehour) {
|
|
459
|
+
radius = CLOCK_OUTER_RADIUS;
|
|
460
|
+
}
|
|
461
|
+
deg = Math.round(this._selectedHour * (360 / (24 / 2)));
|
|
541
462
|
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
return
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
463
|
+
else {
|
|
464
|
+
deg = Math.round(this._selectedMinute * (360 / 60));
|
|
465
|
+
}
|
|
466
|
+
return {
|
|
467
|
+
'transform': `rotate(${deg}deg)`,
|
|
468
|
+
'height': `${radius}%`,
|
|
469
|
+
'margin-top': `${50 - radius}%`,
|
|
470
|
+
};
|
|
550
471
|
}
|
|
551
472
|
ngAfterContentInit() {
|
|
473
|
+
this.activeDate = this._activeDate || this._adapter.today();
|
|
552
474
|
this._init();
|
|
553
475
|
}
|
|
554
|
-
/** Handles
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
this.
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
476
|
+
/** Handles mousedown events on the clock body. */
|
|
477
|
+
_handleMousedown(event) {
|
|
478
|
+
this._timeChanged = false;
|
|
479
|
+
this.setTime(event);
|
|
480
|
+
document.addEventListener('mousemove', this.mouseMoveListener);
|
|
481
|
+
document.addEventListener('touchmove', this.mouseMoveListener);
|
|
482
|
+
document.addEventListener('mouseup', this.mouseUpListener);
|
|
483
|
+
document.addEventListener('touchend', this.mouseUpListener);
|
|
561
484
|
}
|
|
562
|
-
|
|
563
|
-
|
|
485
|
+
_handleMousemove(event) {
|
|
486
|
+
event.preventDefault();
|
|
487
|
+
this.setTime(event);
|
|
564
488
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* Gets the month in this year that the given Date falls on.
|
|
580
|
-
* Returns null if the given Date is in another year.
|
|
581
|
-
*/
|
|
582
|
-
_getMonthInCurrentYear(date) {
|
|
583
|
-
return this._adapter.sameYear(date, this.activeDate) ? this._adapter.getMonth(date) : null;
|
|
584
|
-
}
|
|
585
|
-
/** Creates an MdCalendarCell for the given month. */
|
|
586
|
-
_createCellForMonth(month, monthName) {
|
|
587
|
-
const ariaLabel = this._adapter.format(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), month, 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)), this._dateFormats.display.monthYearA11yLabel);
|
|
588
|
-
return new MtxCalendarCell(month, monthName.toLocaleUpperCase(), ariaLabel, this._isMonthEnabled(month));
|
|
589
|
-
}
|
|
590
|
-
// private calendarState(direction: string): void {
|
|
591
|
-
// this._calendarState = direction;
|
|
592
|
-
// }
|
|
593
|
-
/** Whether the given month is enabled. */
|
|
594
|
-
_isMonthEnabled(month) {
|
|
595
|
-
if (!this.dateFilter) {
|
|
596
|
-
return true;
|
|
597
|
-
}
|
|
598
|
-
const firstOfMonth = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), month, 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
|
|
599
|
-
// If any date in the month is enabled count the month as enabled.
|
|
600
|
-
for (let date = firstOfMonth; this._adapter.getMonth(date) === month; date = this._adapter.addCalendarDays(date, 1)) {
|
|
601
|
-
if (this.dateFilter(date)) {
|
|
602
|
-
return true;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
return false;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
/** @nocollapse */ MtxYearView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: MtxYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
609
|
-
/** @nocollapse */ MtxYearView.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.6", type: MtxYearView, selector: "mtx-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxYearView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n", components: [{ type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
610
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: MtxYearView, decorators: [{
|
|
611
|
-
type: Component,
|
|
612
|
-
args: [{ selector: 'mtx-year-view', exportAs: 'mtxYearView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n" }]
|
|
613
|
-
}], ctorParameters: function () { return [{ type: i1.DatetimeAdapter, decorators: [{
|
|
614
|
-
type: Optional
|
|
615
|
-
}] }, { type: undefined, decorators: [{
|
|
616
|
-
type: Optional
|
|
617
|
-
}, {
|
|
618
|
-
type: Inject,
|
|
619
|
-
args: [MTX_DATETIME_FORMATS]
|
|
620
|
-
}] }]; }, propDecorators: { type: [{
|
|
621
|
-
type: Input
|
|
622
|
-
}], dateFilter: [{
|
|
623
|
-
type: Input
|
|
624
|
-
}], selectedChange: [{
|
|
625
|
-
type: Output
|
|
626
|
-
}], _userSelection: [{
|
|
627
|
-
type: Output
|
|
628
|
-
}], activeDate: [{
|
|
629
|
-
type: Input
|
|
630
|
-
}], selected: [{
|
|
631
|
-
type: Input
|
|
632
|
-
}] } });
|
|
633
|
-
|
|
634
|
-
const CLOCK_RADIUS = 50;
|
|
635
|
-
const CLOCK_INNER_RADIUS = 27.5;
|
|
636
|
-
const CLOCK_OUTER_RADIUS = 41.25;
|
|
637
|
-
const CLOCK_TICK_RADIUS = 7.0833;
|
|
638
|
-
/**
|
|
639
|
-
* A clock that is used as part of the datetimepicker.
|
|
640
|
-
* @docs-private
|
|
641
|
-
*/
|
|
642
|
-
class MtxClock {
|
|
643
|
-
constructor(_element, _adapter) {
|
|
644
|
-
this._element = _element;
|
|
645
|
-
this._adapter = _adapter;
|
|
646
|
-
this.interval = 1;
|
|
647
|
-
this.twelvehour = false;
|
|
648
|
-
/** Emits when the currently selected date changes. */
|
|
649
|
-
this.selectedChange = new EventEmitter();
|
|
650
|
-
/** Emits when any date is activated. */
|
|
651
|
-
this.activeDateChange = new EventEmitter();
|
|
652
|
-
/** Emits when any date is selected. */
|
|
653
|
-
this._userSelection = new EventEmitter();
|
|
654
|
-
/** Hours and Minutes representing the clock view. */
|
|
655
|
-
this._hours = [];
|
|
656
|
-
this._minutes = [];
|
|
657
|
-
/** Whether the clock is in hour view. */
|
|
658
|
-
this._hourView = true;
|
|
659
|
-
this._timeChanged = false;
|
|
660
|
-
this.mouseMoveListener = (event) => {
|
|
661
|
-
this._handleMousemove(event);
|
|
662
|
-
};
|
|
663
|
-
this.mouseUpListener = () => {
|
|
664
|
-
this._handleMouseup();
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* The date to display in this clock view.
|
|
669
|
-
*/
|
|
670
|
-
get activeDate() {
|
|
671
|
-
return this._activeDate;
|
|
672
|
-
}
|
|
673
|
-
set activeDate(value) {
|
|
674
|
-
const oldActiveDate = this._activeDate;
|
|
675
|
-
this._activeDate = this._adapter.clampDate(value, this.minDate, this.maxDate);
|
|
676
|
-
if (!this._adapter.sameMinute(oldActiveDate, this._activeDate)) {
|
|
677
|
-
this._init();
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
/** The currently selected date. */
|
|
681
|
-
get selected() {
|
|
682
|
-
return this._selected;
|
|
683
|
-
}
|
|
684
|
-
set selected(value) {
|
|
685
|
-
this._selected = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
686
|
-
if (this._selected) {
|
|
687
|
-
this.activeDate = this._selected;
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
/** The minimum selectable date. */
|
|
691
|
-
get minDate() {
|
|
692
|
-
return this._minDate;
|
|
693
|
-
}
|
|
694
|
-
set minDate(value) {
|
|
695
|
-
this._minDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
696
|
-
}
|
|
697
|
-
/** The maximum selectable date. */
|
|
698
|
-
get maxDate() {
|
|
699
|
-
return this._maxDate;
|
|
700
|
-
}
|
|
701
|
-
set maxDate(value) {
|
|
702
|
-
this._maxDate = this._adapter.getValidDateOrNull(this._adapter.deserialize(value));
|
|
703
|
-
}
|
|
704
|
-
/** Whether the clock should be started in hour or minute view. */
|
|
705
|
-
set startView(value) {
|
|
706
|
-
this._hourView = value !== 'minute';
|
|
707
|
-
}
|
|
708
|
-
get _hand() {
|
|
709
|
-
let hour = this._adapter.getHour(this.activeDate);
|
|
710
|
-
if (this.twelvehour) {
|
|
711
|
-
if (hour === 0) {
|
|
712
|
-
hour = 24;
|
|
713
|
-
}
|
|
714
|
-
this._selectedHour = hour > 12 ? hour - 12 : hour;
|
|
715
|
-
}
|
|
716
|
-
else {
|
|
717
|
-
this._selectedHour = hour;
|
|
718
|
-
}
|
|
719
|
-
this._selectedMinute = this._adapter.getMinute(this.activeDate);
|
|
720
|
-
let deg = 0;
|
|
721
|
-
let radius = CLOCK_OUTER_RADIUS;
|
|
722
|
-
if (this._hourView) {
|
|
723
|
-
const outer = this._selectedHour > 0 && this._selectedHour < 13;
|
|
724
|
-
radius = outer ? CLOCK_OUTER_RADIUS : CLOCK_INNER_RADIUS;
|
|
725
|
-
if (this.twelvehour) {
|
|
726
|
-
radius = CLOCK_OUTER_RADIUS;
|
|
727
|
-
}
|
|
728
|
-
deg = Math.round(this._selectedHour * (360 / (24 / 2)));
|
|
729
|
-
}
|
|
730
|
-
else {
|
|
731
|
-
deg = Math.round(this._selectedMinute * (360 / 60));
|
|
732
|
-
}
|
|
733
|
-
return {
|
|
734
|
-
'transform': `rotate(${deg}deg)`,
|
|
735
|
-
'height': `${radius}%`,
|
|
736
|
-
'margin-top': `${50 - radius}%`,
|
|
737
|
-
};
|
|
738
|
-
}
|
|
739
|
-
ngAfterContentInit() {
|
|
740
|
-
this.activeDate = this._activeDate || this._adapter.today();
|
|
741
|
-
this._init();
|
|
742
|
-
}
|
|
743
|
-
/** Handles mousedown events on the clock body. */
|
|
744
|
-
_handleMousedown(event) {
|
|
745
|
-
this._timeChanged = false;
|
|
746
|
-
this.setTime(event);
|
|
747
|
-
document.addEventListener('mousemove', this.mouseMoveListener);
|
|
748
|
-
document.addEventListener('touchmove', this.mouseMoveListener);
|
|
749
|
-
document.addEventListener('mouseup', this.mouseUpListener);
|
|
750
|
-
document.addEventListener('touchend', this.mouseUpListener);
|
|
751
|
-
}
|
|
752
|
-
_handleMousemove(event) {
|
|
753
|
-
event.preventDefault();
|
|
754
|
-
this.setTime(event);
|
|
755
|
-
}
|
|
756
|
-
_handleMouseup() {
|
|
757
|
-
document.removeEventListener('mousemove', this.mouseMoveListener);
|
|
758
|
-
document.removeEventListener('touchmove', this.mouseMoveListener);
|
|
759
|
-
document.removeEventListener('mouseup', this.mouseUpListener);
|
|
760
|
-
document.removeEventListener('touchend', this.mouseUpListener);
|
|
761
|
-
if (this._timeChanged) {
|
|
762
|
-
this.selectedChange.emit(this.activeDate);
|
|
763
|
-
if (!this._hourView) {
|
|
764
|
-
this._userSelection.emit();
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
/** Initializes this clock view. */
|
|
489
|
+
_handleMouseup() {
|
|
490
|
+
document.removeEventListener('mousemove', this.mouseMoveListener);
|
|
491
|
+
document.removeEventListener('touchmove', this.mouseMoveListener);
|
|
492
|
+
document.removeEventListener('mouseup', this.mouseUpListener);
|
|
493
|
+
document.removeEventListener('touchend', this.mouseUpListener);
|
|
494
|
+
if (this._timeChanged) {
|
|
495
|
+
this.selectedChange.emit(this.activeDate);
|
|
496
|
+
if (!this._hourView) {
|
|
497
|
+
this._userSelection.emit();
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
/** Initializes this clock view. */
|
|
769
502
|
_init() {
|
|
770
503
|
this._hours.length = 0;
|
|
771
504
|
this._minutes.length = 0;
|
|
@@ -870,9 +603,9 @@ class MtxClock {
|
|
|
870
603
|
this.activeDateChange.emit(this.activeDate);
|
|
871
604
|
}
|
|
872
605
|
}
|
|
873
|
-
/** @nocollapse */ MtxClock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
874
|
-
/** @nocollapse */ MtxClock.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
875
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
606
|
+
/** @nocollapse */ MtxClock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxClock, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter }], target: i0.ɵɵFactoryTarget.Component });
|
|
607
|
+
/** @nocollapse */ MtxClock.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MtxClock, selector: "mtx-clock", inputs: { dateFilter: "dateFilter", interval: "interval", twelvehour: "twelvehour", activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", startView: "startView" }, outputs: { selectedChange: "selectedChange", activeDateChange: "activeDateChange", _userSelection: "_userSelection" }, host: { attributes: { "role": "clock" }, listeners: { "mousedown": "_handleMousedown($event)" }, properties: { "class.mtx-clock": "true" } }, exportAs: ["mtxClock"], ngImport: i0, template: "<div class=\"mtx-clock-wrapper\">\n <div class=\"mtx-clock-center\"></div>\n <div [ngStyle]=\"_hand\" class=\"mtx-clock-hand\"></div>\n <div [class.active]=\"_hourView\" class=\"mtx-clock-hours\">\n <div *ngFor=\"let item of _hours\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedHour === item.value\"\n [style.fontSize]=\"item.fontSize\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\"\n class=\"mtx-clock-cell\">{{ item.displayValue }}</div>\n </div>\n <div [class.active]=\"!_hourView\" class=\"mtx-clock-minutes\">\n <div *ngFor=\"let item of _minutes\"\n [class.mtx-clock-cell-disabled]=\"!item.enabled\"\n [class.mtx-clock-cell-selected]=\"_selectedMinute === item.value\"\n [style.left]=\"item.left+'%'\"\n [style.top]=\"item.top+'%'\"\n class=\"mtx-clock-cell\">{{ item.displayValue }}</div>\n </div>\n</div>\n", styles: [".mtx-clock{position:relative;display:block;min-width:224px;margin:8px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.mtx-clock-wrapper{position:relative;width:100%;height:0;padding-top:100%;border-radius:50%}.mtx-clock-center{position:absolute;top:50%;left:50%;width:2%;height:2%;margin:-1%;border-radius:50%}.mtx-clock-hand{position:absolute;top:0;right:0;bottom:0;left:0;width:1px;margin:0 auto;transform-origin:bottom}.mtx-clock-hand:before{content:\"\";position:absolute;top:-4px;left:-4px;width:8px;height:8px;border-radius:50%}.mtx-clock-hours,.mtx-clock-minutes{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;visibility:hidden;transition:.35s;transform:scale(1.2)}.mtx-clock-hours.active,.mtx-clock-minutes.active{opacity:1;visibility:visible;transform:scale(1)}.mtx-clock-minutes{transform:scale(.8)}.mtx-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}.mtx-clock-cell.mtx-clock-cell-disabled{pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
608
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxClock, decorators: [{
|
|
876
609
|
type: Component,
|
|
877
610
|
args: [{ selector: 'mtx-clock', host: {
|
|
878
611
|
'[class.mtx-clock]': 'true',
|
|
@@ -903,6 +636,275 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImpor
|
|
|
903
636
|
type: Input
|
|
904
637
|
}] } });
|
|
905
638
|
|
|
639
|
+
const DAYS_PER_WEEK = 7;
|
|
640
|
+
/**
|
|
641
|
+
* An internal component used to display a single month in the datetimepicker.
|
|
642
|
+
* @docs-private
|
|
643
|
+
*/
|
|
644
|
+
class MtxMonthView {
|
|
645
|
+
constructor(_adapter, _dateFormats) {
|
|
646
|
+
this._adapter = _adapter;
|
|
647
|
+
this._dateFormats = _dateFormats;
|
|
648
|
+
this.type = 'date';
|
|
649
|
+
/** Emits when a new date is selected. */
|
|
650
|
+
this.selectedChange = new EventEmitter();
|
|
651
|
+
/** Emits when any date is selected. */
|
|
652
|
+
this._userSelection = new EventEmitter();
|
|
653
|
+
if (!this._adapter) {
|
|
654
|
+
throw createMissingDateImplError('DatetimeAdapter');
|
|
655
|
+
}
|
|
656
|
+
if (!this._dateFormats) {
|
|
657
|
+
throw createMissingDateImplError('MTX_DATETIME_FORMATS');
|
|
658
|
+
}
|
|
659
|
+
const firstDayOfWeek = this._adapter.getFirstDayOfWeek();
|
|
660
|
+
const narrowWeekdays = this._adapter.getDayOfWeekNames('narrow');
|
|
661
|
+
const longWeekdays = this._adapter.getDayOfWeekNames('long');
|
|
662
|
+
// Rotate the labels for days of the week based on the configured first day of the week.
|
|
663
|
+
const weekdays = longWeekdays.map((long, i) => {
|
|
664
|
+
return { long, narrow: narrowWeekdays[i] };
|
|
665
|
+
});
|
|
666
|
+
this._weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
|
|
667
|
+
this._activeDate = this._adapter.today();
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* The date to display in this month view (everything other than the month and year is ignored).
|
|
671
|
+
*/
|
|
672
|
+
get activeDate() {
|
|
673
|
+
return this._activeDate;
|
|
674
|
+
}
|
|
675
|
+
set activeDate(value) {
|
|
676
|
+
const oldActiveDate = this._activeDate;
|
|
677
|
+
this._activeDate = value || this._adapter.today();
|
|
678
|
+
if (oldActiveDate &&
|
|
679
|
+
this._activeDate &&
|
|
680
|
+
!this._adapter.sameMonthAndYear(oldActiveDate, this._activeDate)) {
|
|
681
|
+
this._init();
|
|
682
|
+
if (this._adapter.isInNextMonth(oldActiveDate, this._activeDate)) {
|
|
683
|
+
this.calendarState('right');
|
|
684
|
+
}
|
|
685
|
+
else {
|
|
686
|
+
this.calendarState('left');
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
/** The currently selected date. */
|
|
691
|
+
get selected() {
|
|
692
|
+
return this._selected;
|
|
693
|
+
}
|
|
694
|
+
set selected(value) {
|
|
695
|
+
this._selected = value;
|
|
696
|
+
this._selectedDate = this._getDateInCurrentMonth(this.selected);
|
|
697
|
+
}
|
|
698
|
+
ngAfterContentInit() {
|
|
699
|
+
this._init();
|
|
700
|
+
}
|
|
701
|
+
/** Handles when a new date is selected. */
|
|
702
|
+
_dateSelected(date) {
|
|
703
|
+
this.selectedChange.emit(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), date, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
|
|
704
|
+
if (this.type === 'date') {
|
|
705
|
+
this._userSelection.emit();
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
_calendarStateDone() {
|
|
709
|
+
this._calendarState = '';
|
|
710
|
+
}
|
|
711
|
+
/** Initializes this month view. */
|
|
712
|
+
_init() {
|
|
713
|
+
this._selectedDate = this._getDateInCurrentMonth(this.selected);
|
|
714
|
+
this._todayDate = this._getDateInCurrentMonth(this._adapter.today());
|
|
715
|
+
const firstOfMonth = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
|
|
716
|
+
this._firstWeekOffset =
|
|
717
|
+
(DAYS_PER_WEEK +
|
|
718
|
+
this._adapter.getDayOfWeek(firstOfMonth) -
|
|
719
|
+
this._adapter.getFirstDayOfWeek()) %
|
|
720
|
+
DAYS_PER_WEEK;
|
|
721
|
+
this._createWeekCells();
|
|
722
|
+
}
|
|
723
|
+
/** Creates MdCalendarCells for the dates in this month. */
|
|
724
|
+
_createWeekCells() {
|
|
725
|
+
const daysInMonth = this._adapter.getNumDaysInMonth(this.activeDate);
|
|
726
|
+
const dateNames = this._adapter.getDateNames();
|
|
727
|
+
this._weeks = [[]];
|
|
728
|
+
for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {
|
|
729
|
+
if (cell === DAYS_PER_WEEK) {
|
|
730
|
+
this._weeks.push([]);
|
|
731
|
+
cell = 0;
|
|
732
|
+
}
|
|
733
|
+
const date = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), this._adapter.getMonth(this.activeDate), i + 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
|
|
734
|
+
const enabled = !this.dateFilter || this.dateFilter(date);
|
|
735
|
+
const ariaLabel = this._adapter.format(date, this._dateFormats.display.dateA11yLabel);
|
|
736
|
+
this._weeks[this._weeks.length - 1].push(new MtxCalendarCell(i + 1, dateNames[i], ariaLabel, enabled));
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Gets the date in this month that the given Date falls on.
|
|
741
|
+
* Returns null if the given Date is in another month.
|
|
742
|
+
*/
|
|
743
|
+
_getDateInCurrentMonth(date) {
|
|
744
|
+
return this._adapter.sameMonthAndYear(date, this.activeDate)
|
|
745
|
+
? this._adapter.getDate(date)
|
|
746
|
+
: null;
|
|
747
|
+
}
|
|
748
|
+
calendarState(direction) {
|
|
749
|
+
this._calendarState = direction;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
/** @nocollapse */ MtxMonthView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxMonthView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
753
|
+
/** @nocollapse */ MtxMonthView.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MtxMonthView, selector: "mtx-month-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxMonthView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n <th *ngFor=\"let day of _weekdays\" [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n </tr>\n </thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [activeCell]=\"_adapter.getDate(activeDate) - 1\"\n [selectedValue]=\"_selectedDate!\"\n (selectedValueChange)=\"_dateSelected($event)\"></tbody>\n</table>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxMonthView, decorators: [{
|
|
755
|
+
type: Component,
|
|
756
|
+
args: [{ selector: 'mtx-month-view', exportAs: 'mtxMonthView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\">\n <tr>\n <th *ngFor=\"let day of _weekdays\" [attr.aria-label]=\"day.long\">{{day.narrow}}</th>\n </tr>\n </thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [activeCell]=\"_adapter.getDate(activeDate) - 1\"\n [selectedValue]=\"_selectedDate!\"\n (selectedValueChange)=\"_dateSelected($event)\"></tbody>\n</table>\n" }]
|
|
757
|
+
}], ctorParameters: function () { return [{ type: i1.DatetimeAdapter, decorators: [{
|
|
758
|
+
type: Optional
|
|
759
|
+
}] }, { type: undefined, decorators: [{
|
|
760
|
+
type: Optional
|
|
761
|
+
}, {
|
|
762
|
+
type: Inject,
|
|
763
|
+
args: [MTX_DATETIME_FORMATS]
|
|
764
|
+
}] }]; }, propDecorators: { type: [{
|
|
765
|
+
type: Input
|
|
766
|
+
}], dateFilter: [{
|
|
767
|
+
type: Input
|
|
768
|
+
}], selectedChange: [{
|
|
769
|
+
type: Output
|
|
770
|
+
}], _userSelection: [{
|
|
771
|
+
type: Output
|
|
772
|
+
}], activeDate: [{
|
|
773
|
+
type: Input
|
|
774
|
+
}], selected: [{
|
|
775
|
+
type: Input
|
|
776
|
+
}] } });
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* An internal component used to display a single year in the datetimepicker.
|
|
780
|
+
* @docs-private
|
|
781
|
+
*/
|
|
782
|
+
class MtxYearView {
|
|
783
|
+
constructor(_adapter, _dateFormats) {
|
|
784
|
+
this._adapter = _adapter;
|
|
785
|
+
this._dateFormats = _dateFormats;
|
|
786
|
+
this.type = 'date';
|
|
787
|
+
/** Emits when a new month is selected. */
|
|
788
|
+
this.selectedChange = new EventEmitter();
|
|
789
|
+
/** Emits when any date is selected. */
|
|
790
|
+
this._userSelection = new EventEmitter();
|
|
791
|
+
if (!this._adapter) {
|
|
792
|
+
throw createMissingDateImplError('DatetimeAdapter');
|
|
793
|
+
}
|
|
794
|
+
if (!this._dateFormats) {
|
|
795
|
+
throw createMissingDateImplError('MTX_DATETIME_FORMATS');
|
|
796
|
+
}
|
|
797
|
+
this._activeDate = this._adapter.today();
|
|
798
|
+
}
|
|
799
|
+
/** The date to display in this year view (everything other than the year is ignored). */
|
|
800
|
+
get activeDate() {
|
|
801
|
+
return this._activeDate;
|
|
802
|
+
}
|
|
803
|
+
set activeDate(value) {
|
|
804
|
+
const oldActiveDate = this._activeDate;
|
|
805
|
+
this._activeDate = value || this._adapter.today();
|
|
806
|
+
if (oldActiveDate &&
|
|
807
|
+
this._activeDate &&
|
|
808
|
+
!this._adapter.sameYear(oldActiveDate, this._activeDate)) {
|
|
809
|
+
this._init();
|
|
810
|
+
// if (oldActiveDate < this._activeDate) {
|
|
811
|
+
// this.calendarState('right');
|
|
812
|
+
// } else {
|
|
813
|
+
// this.calendarState('left');
|
|
814
|
+
// }
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
/** The currently selected date. */
|
|
818
|
+
get selected() {
|
|
819
|
+
return this._selected;
|
|
820
|
+
}
|
|
821
|
+
set selected(value) {
|
|
822
|
+
this._selected = value;
|
|
823
|
+
this._selectedMonth = this._getMonthInCurrentYear(this.selected);
|
|
824
|
+
}
|
|
825
|
+
ngAfterContentInit() {
|
|
826
|
+
this._init();
|
|
827
|
+
}
|
|
828
|
+
/** Handles when a new month is selected. */
|
|
829
|
+
_monthSelected(month) {
|
|
830
|
+
const normalizedDate = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), month, 1, 0, 0);
|
|
831
|
+
this.selectedChange.emit(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), month, Math.min(this._adapter.getDate(this.activeDate), this._adapter.getNumDaysInMonth(normalizedDate)), this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)));
|
|
832
|
+
if (this.type === 'month') {
|
|
833
|
+
this._userSelection.emit();
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
_calendarStateDone() {
|
|
837
|
+
this._calendarState = '';
|
|
838
|
+
}
|
|
839
|
+
/** Initializes this month view. */
|
|
840
|
+
_init() {
|
|
841
|
+
this._selectedMonth = this._getMonthInCurrentYear(this.selected);
|
|
842
|
+
this._todayMonth = this._getMonthInCurrentYear(this._adapter.today());
|
|
843
|
+
this._yearLabel = this._adapter.getYearName(this.activeDate);
|
|
844
|
+
const monthNames = this._adapter.getMonthNames('short');
|
|
845
|
+
// First row of months only contains 5 elements so we can fit the year label on the same row.
|
|
846
|
+
this._months = [
|
|
847
|
+
[0, 1, 2, 3],
|
|
848
|
+
[4, 5, 6, 7],
|
|
849
|
+
[8, 9, 10, 11],
|
|
850
|
+
].map(row => row.map(month => this._createCellForMonth(month, monthNames[month])));
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Gets the month in this year that the given Date falls on.
|
|
854
|
+
* Returns null if the given Date is in another year.
|
|
855
|
+
*/
|
|
856
|
+
_getMonthInCurrentYear(date) {
|
|
857
|
+
return this._adapter.sameYear(date, this.activeDate) ? this._adapter.getMonth(date) : null;
|
|
858
|
+
}
|
|
859
|
+
/** Creates an MdCalendarCell for the given month. */
|
|
860
|
+
_createCellForMonth(month, monthName) {
|
|
861
|
+
const ariaLabel = this._adapter.format(this._adapter.createDatetime(this._adapter.getYear(this.activeDate), month, 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate)), this._dateFormats.display.monthYearA11yLabel);
|
|
862
|
+
return new MtxCalendarCell(month, monthName.toLocaleUpperCase(), ariaLabel, this._isMonthEnabled(month));
|
|
863
|
+
}
|
|
864
|
+
// private calendarState(direction: string): void {
|
|
865
|
+
// this._calendarState = direction;
|
|
866
|
+
// }
|
|
867
|
+
/** Whether the given month is enabled. */
|
|
868
|
+
_isMonthEnabled(month) {
|
|
869
|
+
if (!this.dateFilter) {
|
|
870
|
+
return true;
|
|
871
|
+
}
|
|
872
|
+
const firstOfMonth = this._adapter.createDatetime(this._adapter.getYear(this.activeDate), month, 1, this._adapter.getHour(this.activeDate), this._adapter.getMinute(this.activeDate));
|
|
873
|
+
// If any date in the month is enabled count the month as enabled.
|
|
874
|
+
for (let date = firstOfMonth; this._adapter.getMonth(date) === month; date = this._adapter.addCalendarDays(date, 1)) {
|
|
875
|
+
if (this.dateFilter(date)) {
|
|
876
|
+
return true;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
return false;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
/** @nocollapse */ MtxYearView.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxYearView, deps: [{ token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
883
|
+
/** @nocollapse */ MtxYearView.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MtxYearView, selector: "mtx-year-view", inputs: { type: "type", dateFilter: "dateFilter", activeDate: "activeDate", selected: "selected" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection" }, exportAs: ["mtxYearView"], ngImport: i0, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n", dependencies: [{ kind: "component", type: MtxCalendarBody, selector: "[mtx-calendar-body]", inputs: ["label", "rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "allowDisabledSelection", "activeCell"], outputs: ["selectedValueChange"], exportAs: ["mtxCalendarBody"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxYearView, decorators: [{
|
|
885
|
+
type: Component,
|
|
886
|
+
args: [{ selector: 'mtx-year-view', exportAs: 'mtxYearView', animations: [mtxDatetimepickerAnimations.slideCalendar], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"mtx-calendar-table\" role=\"grid\">\n <thead class=\"mtx-calendar-table-header\"></thead>\n <tbody mtx-calendar-body\n (@slideCalendar.done)=\"_calendarStateDone()\"\n [@slideCalendar]=\"_calendarState\"\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [activeCell]=\"_adapter.getMonth(activeDate)\"\n [selectedValue]=\"_selectedMonth!\"\n (selectedValueChange)=\"_monthSelected($event)\"\n [allowDisabledSelection]=\"true\"></tbody>\n</table>\n" }]
|
|
887
|
+
}], ctorParameters: function () { return [{ type: i1.DatetimeAdapter, decorators: [{
|
|
888
|
+
type: Optional
|
|
889
|
+
}] }, { type: undefined, decorators: [{
|
|
890
|
+
type: Optional
|
|
891
|
+
}, {
|
|
892
|
+
type: Inject,
|
|
893
|
+
args: [MTX_DATETIME_FORMATS]
|
|
894
|
+
}] }]; }, propDecorators: { type: [{
|
|
895
|
+
type: Input
|
|
896
|
+
}], dateFilter: [{
|
|
897
|
+
type: Input
|
|
898
|
+
}], selectedChange: [{
|
|
899
|
+
type: Output
|
|
900
|
+
}], _userSelection: [{
|
|
901
|
+
type: Output
|
|
902
|
+
}], activeDate: [{
|
|
903
|
+
type: Input
|
|
904
|
+
}], selected: [{
|
|
905
|
+
type: Input
|
|
906
|
+
}] } });
|
|
907
|
+
|
|
906
908
|
/**
|
|
907
909
|
* A calendar that is used as part of the datetimepicker.
|
|
908
910
|
* @docs-private
|
|
@@ -918,6 +920,7 @@ class MtxCalendar {
|
|
|
918
920
|
this._twelvehour = false;
|
|
919
921
|
/** Whether the calendar should be started in month or year view. */
|
|
920
922
|
this.startView = 'month';
|
|
923
|
+
/** Step over minutes. */
|
|
921
924
|
this.timeInterval = 1;
|
|
922
925
|
/** Prevent user to select same date time */
|
|
923
926
|
this.preventSameDateTimeSelection = false;
|
|
@@ -943,19 +946,21 @@ class MtxCalendar {
|
|
|
943
946
|
}
|
|
944
947
|
this._intlChanges = _intl.changes.subscribe(() => changeDetectorRef.markForCheck());
|
|
945
948
|
}
|
|
949
|
+
/** Whether to show multi-year view. */
|
|
946
950
|
get multiYearSelector() {
|
|
947
951
|
return this._multiYearSelector;
|
|
948
952
|
}
|
|
949
953
|
set multiYearSelector(value) {
|
|
950
954
|
this._multiYearSelector = coerceBooleanProperty(value);
|
|
951
955
|
}
|
|
952
|
-
/**
|
|
956
|
+
/** Whether the clock uses 12 hour format. */
|
|
953
957
|
get twelvehour() {
|
|
954
958
|
return this._twelvehour;
|
|
955
959
|
}
|
|
956
960
|
set twelvehour(value) {
|
|
957
961
|
this._twelvehour = coerceBooleanProperty(value);
|
|
958
962
|
}
|
|
963
|
+
/** The display type of datetimepicker. */
|
|
959
964
|
get type() {
|
|
960
965
|
return this._type;
|
|
961
966
|
}
|
|
@@ -1457,9 +1462,9 @@ class MtxCalendar {
|
|
|
1457
1462
|
return ('00' + n).slice(-2);
|
|
1458
1463
|
}
|
|
1459
1464
|
}
|
|
1460
|
-
/** @nocollapse */ MtxCalendar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1461
|
-
/** @nocollapse */ MtxCalendar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.6", type: MtxCalendar, selector: "mtx-calendar", inputs: { multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", startView: "startView", timeInterval: "timeInterval", dateFilter: "dateFilter", preventSameDateTimeSelection: "preventSameDateTimeSelection", type: "type", startAt: "startAt", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", viewChanged: "viewChanged", _userSelection: "_userSelection" }, host: { attributes: { "tabindex": "0" }, listeners: { "keydown": "_handleCalendarBodyKeydown($event)" }, classAttribute: "mtx-calendar" }, exportAs: ["mtxCalendar"], ngImport: i0, template: "<div class=\"mtx-calendar-header\">\n <div (click)=\"_yearClicked()\" *ngIf=\"type !== 'time'\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-calendar-header-year\" role=\"button\">\n <span>{{ _yearLabel }}</span>\n <svg *ngIf=\"multiYearSelector || type === 'year'\"\n class=\"mtx-calendar-header-year-dropdown\"\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\n </svg>\n </div>\n <div class=\"mtx-calendar-header-date-time\">\n <span (click)=\"_dateClicked()\" *ngIf=\"type !== 'time' && type !== 'year'\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n class=\"mtx-calendar-header-date\"\n role=\"button\">{{ _dateLabel }}</span>\n <span *ngIf=\"type.endsWith('time')\"\n [class.active]=\"currentView === 'clock'\"\n class=\"mtx-calendar-header-time\">\n <span class=\"mtx-calendar-header-hour-minute-container\">\n <span (click)=\"_hoursClicked()\"\n [class.active]=\"_clockView === 'hour'\"\n class=\"mtx-calendar-header-hours\"\n role=\"button\">{{ _hoursLabel }}</span>\n <span class=\"mtx-calendar-header-hour-minute-separator\">:</span>\n <span (click)=\"_minutesClicked()\"\n [class.active]=\"_clockView === 'minute'\"\n class=\"mtx-calendar-header-minutes\"\n role=\"button\">{{ _minutesLabel }}</span>\n </span>\n <span *ngIf=\"twelvehour\" class=\"mtx-calendar-header-ampm-container\">\n <span (click)=\"_ampmClicked('AM')\"\n [class.active]=\"_AMPM === 'AM'\"\n class=\"mtx-calendar-header-ampm\" role=\"button\">AM</span>\n <span (click)=\"_ampmClicked('PM')\"\n [class.active]=\"_AMPM === 'PM'\"\n class=\"mtx-calendar-header-ampm\" role=\"button\">PM</span>\n </span>\n </span>\n </div>\n</div>\n<div class=\"mtx-calendar-content\" [ngSwitch]=\"currentView\">\n <div *ngIf=\"currentView === 'month' || currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\" (click)=\"_previousClicked()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_ariaLabelPrev\"\n [class.disabled]=\"!_previousEnabled()\"\n class=\"mtx-calendar-previous-button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n </svg>\n </button>\n <div [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\"\n class=\"mtx-calendar-period-button\">\n <strong>{{ _monthYearLabel }}</strong>\n </div>\n <button mat-icon-button type=\"button\" (click)=\"_nextClicked()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_ariaLabelNext\"\n [class.disabled]=\"!_nextEnabled()\"\n class=\"mtx-calendar-next-button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\n </svg>\n </button>\n </div>\n </div>\n <mtx-month-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n *ngSwitchCase=\"'month'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n <mtx-year-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n *ngSwitchCase=\"'year'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n <mtx-multi-year-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n *ngSwitchCase=\"'multi-year'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n *ngSwitchDefault\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n</div>\n", styles: [".mtx-calendar{display:block;outline:none}.mtx-calendar[mode=landscape]{display:flex}.mtx-calendar-header{padding:16px;box-sizing:border-box;border-radius:4px 4px 0 0}[mode=landscape] .mtx-calendar-header{width:150px;min-width:150px;border-radius:4px 0 0 4px}[dir=rtl] [mode=landscape] .mtx-calendar-header{border-radius:0 4px 4px 0}.mtx-calendar-header-year,.mtx-calendar-header-date-time{width:100%;white-space:nowrap}.mtx-calendar-header-year{line-height:24px}.mtx-calendar-header-year>*{vertical-align:middle}.mtx-calendar-header-year+.mtx-calendar-header-date-time{margin-top:4px}.mtx-calendar-header-date-time{line-height:36px}[mode=landscape] .mtx-calendar-header-date-time{white-space:normal;word-wrap:break-word}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){cursor:pointer;opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-flex}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{cursor:pointer;opacity:1}[mode=landscape] .mtx-calendar-header-time{display:flex;flex-direction:column}.mtx-calendar-header-hour-minute-container{padding:0 8px}[mode=landscape] .mtx-calendar-header-hour-minute-container{padding:0}.mtx-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.mtx-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px}[mode=landscape] .mtx-calendar-header-ampm-container{flex-direction:row}[mode=landscape] .mtx-calendar-header-ampm{padding:4px}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0}@media all and (orientation: landscape){.mtx-calendar[mode=auto]{display:flex}.mtx-calendar[mode=auto] .mtx-calendar-header{width:150px;min-width:150px;border-radius:4px 0 0 4px}[dir=rtl] .mtx-calendar[mode=auto] .mtx-calendar-header{border-radius:0 4px 4px 0}.mtx-calendar[mode=auto] .mtx-calendar-header-date-time{white-space:normal;word-wrap:break-word}.mtx-calendar[mode=auto] .mtx-calendar-header-time{display:flex;flex-direction:column}.mtx-calendar[mode=auto] .mtx-calendar-header-hour-minute-container{padding:0}.mtx-calendar[mode=auto] .mtx-calendar-header-ampm-container{flex-direction:row}.mtx-calendar[mode=auto] .mtx-calendar-header-ampm{padding:4px}}\n"], components: [{ type: i3$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: MtxMonthView, selector: "mtx-month-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMonthView"] }, { type: MtxYearView, selector: "mtx-year-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxYearView"] }, { type: MtxMultiYearView, selector: "mtx-multi-year-view", inputs: ["type", "dateFilter", "activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMultiYearView"] }, { type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["selectedChange", "activeDateChange", "_userSelection"], exportAs: ["mtxClock"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1465
|
+
/** @nocollapse */ MtxCalendar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxCalendar, deps: [{ token: i0.ElementRef }, { token: i1$1.MatDatepickerIntl }, { token: i0.NgZone }, { token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1466
|
+
/** @nocollapse */ MtxCalendar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MtxCalendar, selector: "mtx-calendar", inputs: { multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", startView: "startView", timeInterval: "timeInterval", dateFilter: "dateFilter", preventSameDateTimeSelection: "preventSameDateTimeSelection", type: "type", startAt: "startAt", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", viewChanged: "viewChanged", _userSelection: "_userSelection" }, host: { attributes: { "tabindex": "0" }, listeners: { "keydown": "_handleCalendarBodyKeydown($event)" }, classAttribute: "mtx-calendar" }, exportAs: ["mtxCalendar"], ngImport: i0, template: "<div class=\"mtx-calendar-header\">\n <div (click)=\"_yearClicked()\" *ngIf=\"type !== 'time'\"\n [class.active]=\"currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-calendar-header-year\" role=\"button\">\n <span>{{ _yearLabel }}</span>\n <svg *ngIf=\"multiYearSelector || type === 'year'\"\n class=\"mtx-calendar-header-year-dropdown\"\n width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M7,10L12,15L17,10H7Z\"></path>\n </svg>\n </div>\n <div class=\"mtx-calendar-header-date-time\">\n <span (click)=\"_dateClicked()\" *ngIf=\"type !== 'time' && type !== 'year'\"\n [class.active]=\"currentView === 'month'\"\n [class.not-clickable]=\"type === 'month'\"\n class=\"mtx-calendar-header-date\"\n role=\"button\">{{ _dateLabel }}</span>\n <span *ngIf=\"type.endsWith('time')\"\n [class.active]=\"currentView === 'clock'\"\n class=\"mtx-calendar-header-time\">\n <span class=\"mtx-calendar-header-hour-minute-container\">\n <span (click)=\"_hoursClicked()\"\n [class.active]=\"_clockView === 'hour'\"\n class=\"mtx-calendar-header-hours\"\n role=\"button\">{{ _hoursLabel }}</span>\n <span class=\"mtx-calendar-header-hour-minute-separator\">:</span>\n <span (click)=\"_minutesClicked()\"\n [class.active]=\"_clockView === 'minute'\"\n class=\"mtx-calendar-header-minutes\"\n role=\"button\">{{ _minutesLabel }}</span>\n </span>\n <span *ngIf=\"twelvehour\" class=\"mtx-calendar-header-ampm-container\">\n <span (click)=\"_ampmClicked('AM')\"\n [class.active]=\"_AMPM === 'AM'\"\n class=\"mtx-calendar-header-ampm\" role=\"button\">AM</span>\n <span (click)=\"_ampmClicked('PM')\"\n [class.active]=\"_AMPM === 'PM'\"\n class=\"mtx-calendar-header-ampm\" role=\"button\">PM</span>\n </span>\n </span>\n </div>\n</div>\n<div class=\"mtx-calendar-content\" [ngSwitch]=\"currentView\">\n <div *ngIf=\"currentView === 'month' || currentView === 'year' || currentView === 'multi-year'\"\n class=\"mtx-month-content\">\n <div class=\"mtx-calendar-controls\">\n <button mat-icon-button type=\"button\" (click)=\"_previousClicked()\"\n [attr.aria-disabled]=\"!_previousEnabled()\"\n [attr.aria-label]=\"_ariaLabelPrev\"\n [class.disabled]=\"!_previousEnabled()\"\n class=\"mtx-calendar-previous-button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n </svg>\n </button>\n <div [@slideCalendar]=\"_calendarState\"\n (@slideCalendar.done)=\"_calendarStateDone()\"\n class=\"mtx-calendar-period-button\">\n <strong>{{ _monthYearLabel }}</strong>\n </div>\n <button mat-icon-button type=\"button\" (click)=\"_nextClicked()\"\n [attr.aria-disabled]=\"!_nextEnabled()\"\n [attr.aria-label]=\"_ariaLabelNext\"\n [class.disabled]=\"!_nextEnabled()\"\n class=\"mtx-calendar-next-button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"></path>\n </svg>\n </button>\n </div>\n </div>\n <mtx-month-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_dateSelected($event)\"\n *ngSwitchCase=\"'month'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-month-view>\n <mtx-year-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_monthSelected($event)\"\n *ngSwitchCase=\"'year'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-year-view>\n <mtx-multi-year-view (_userSelection)=\"_userSelected()\"\n (selectedChange)=\"_yearSelected($event)\"\n *ngSwitchCase=\"'multi-year'\"\n [activeDate]=\"_activeDate\"\n [dateFilter]=\"_dateFilterForViews\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected!\"\n [type]=\"type\">\n </mtx-multi-year-view>\n <mtx-clock (_userSelection)=\"_userSelected()\"\n (activeDateChange)=\"_onActiveDateChange($event)\"\n (selectedChange)=\"_timeSelected($event)\"\n *ngSwitchDefault\n [dateFilter]=\"dateFilter\"\n [interval]=\"timeInterval\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"_activeDate\"\n [startView]=\"_clockView\"\n [twelvehour]=\"twelvehour\">\n </mtx-clock>\n</div>\n", styles: [".mtx-calendar{display:block;outline:none}.mtx-calendar[mode=landscape]{display:flex}.mtx-calendar-header{padding:16px;box-sizing:border-box;border-radius:4px 4px 0 0}[mode=landscape] .mtx-calendar-header{width:150px;min-width:150px;border-radius:4px 0 0 4px}[dir=rtl] [mode=landscape] .mtx-calendar-header{border-radius:0 4px 4px 0}.mtx-calendar-header-year,.mtx-calendar-header-date-time{width:100%;white-space:nowrap}.mtx-calendar-header-year{line-height:24px}.mtx-calendar-header-year>*{vertical-align:middle}.mtx-calendar-header-year+.mtx-calendar-header-date-time{margin-top:4px}.mtx-calendar-header-date-time{line-height:36px}[mode=landscape] .mtx-calendar-header-date-time{white-space:normal;word-wrap:break-word}.mtx-calendar-header-year:not(.active),.mtx-calendar-header-date:not(.active),.mtx-calendar-header-hours:not(.active),.mtx-calendar-header-minutes:not(.active),.mtx-calendar-header-ampm:not(.active){cursor:pointer;opacity:.6}.mtx-calendar-header-year.not-clickable,.mtx-calendar-header-date.not-clickable,.mtx-calendar-header-hours.not-clickable,.mtx-calendar-header-minutes.not-clickable,.mtx-calendar-header-ampm.not-clickable{cursor:initial}.mtx-calendar-header-time{display:inline-flex}.mtx-calendar-header-time:not(.active){opacity:.6}.mtx-calendar-header-time:not(.active) .mtx-calendar-header-hours,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-minutes,.mtx-calendar-header-time:not(.active) .mtx-calendar-header-ampm{cursor:pointer;opacity:1}[mode=landscape] .mtx-calendar-header-time{display:flex;flex-direction:column}.mtx-calendar-header-hour-minute-container{padding:0 8px}[mode=landscape] .mtx-calendar-header-hour-minute-container{padding:0}.mtx-calendar-header-hour-minute-separator{display:inline-block;width:8px;text-align:center}.mtx-calendar-header-ampm-container{display:inline-flex;flex-direction:column;line-height:18px}[mode=landscape] .mtx-calendar-header-ampm-container{flex-direction:row}[mode=landscape] .mtx-calendar-header-ampm{padding:4px}.mtx-calendar-content{width:100%;padding:8px;outline:none;box-sizing:border-box;overflow:hidden}.mtx-calendar-controls{display:flex;justify-content:space-between;margin:0 calc(4.7142857143% - 16px)}.mtx-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:.04}.mtx-calendar-period-button{display:inline-block;height:40px;line-height:40px;outline:none;border:0;background:transparent;box-sizing:border-box}.mtx-calendar-previous-button.disabled,.mtx-calendar-next-button.disabled{pointer-events:none}.mtx-calendar-previous-button svg,.mtx-calendar-next-button svg{fill:currentColor;vertical-align:top}[dir=rtl] .mtx-calendar-previous-button svg,[dir=rtl] .mtx-calendar-next-button svg{transform:rotate(180deg)}.mtx-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mtx-calendar-table-header th{text-align:center;padding:8px 0}@media all and (orientation: landscape){.mtx-calendar[mode=auto]{display:flex}.mtx-calendar[mode=auto] .mtx-calendar-header{width:150px;min-width:150px;border-radius:4px 0 0 4px}[dir=rtl] .mtx-calendar[mode=auto] .mtx-calendar-header{border-radius:0 4px 4px 0}.mtx-calendar[mode=auto] .mtx-calendar-header-date-time{white-space:normal;word-wrap:break-word}.mtx-calendar[mode=auto] .mtx-calendar-header-time{display:flex;flex-direction:column}.mtx-calendar[mode=auto] .mtx-calendar-header-hour-minute-container{padding:0}.mtx-calendar[mode=auto] .mtx-calendar-header-ampm-container{flex-direction:row}.mtx-calendar[mode=auto] .mtx-calendar-header-ampm{padding:4px}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: MtxClock, selector: "mtx-clock", inputs: ["dateFilter", "interval", "twelvehour", "activeDate", "selected", "minDate", "maxDate", "startView"], outputs: ["selectedChange", "activeDateChange", "_userSelection"], exportAs: ["mtxClock"] }, { kind: "component", type: MtxMonthView, selector: "mtx-month-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMonthView"] }, { kind: "component", type: MtxYearView, selector: "mtx-year-view", inputs: ["type", "dateFilter", "activeDate", "selected"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxYearView"] }, { kind: "component", type: MtxMultiYearView, selector: "mtx-multi-year-view", inputs: ["type", "dateFilter", "activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "_userSelection"], exportAs: ["mtxMultiYearView"] }], animations: [mtxDatetimepickerAnimations.slideCalendar], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1467
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxCalendar, decorators: [{
|
|
1463
1468
|
type: Component,
|
|
1464
1469
|
args: [{ selector: 'mtx-calendar', host: {
|
|
1465
1470
|
'class': 'mtx-calendar',
|
|
@@ -1550,12 +1555,12 @@ class MtxDatetimepickerContent extends _MtxDatetimepickerContentBase {
|
|
|
1550
1555
|
this._animationDone.complete();
|
|
1551
1556
|
}
|
|
1552
1557
|
}
|
|
1553
|
-
/** @nocollapse */ MtxDatetimepickerContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1554
|
-
/** @nocollapse */ MtxDatetimepickerContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1558
|
+
/** @nocollapse */ MtxDatetimepickerContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerContent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1559
|
+
/** @nocollapse */ MtxDatetimepickerContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MtxDatetimepickerContent, selector: "mtx-datetimepicker-content", inputs: { color: "color" }, host: { listeners: { "@transformPanel.done": "_animationDone.next()" }, properties: { "class.mtx-datetimepicker-content-touch": "datetimepicker?.touchUi", "attr.mode": "datetimepicker.mode", "@transformPanel": "_animationState" }, classAttribute: "mtx-datetimepicker-content" }, viewQueries: [{ propertyName: "_calendar", first: true, predicate: MtxCalendar, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div cdkTrapFocus\n class=\"mtx-datetimepicker-content-container\"\n [attr.mode]=\"datetimepicker.mode\">\n <mtx-calendar [id]=\"datetimepicker.id\"\n [ngClass]=\"datetimepicker.panelClass\"\n [attr.mode]=\"datetimepicker.mode\"\n [type]=\"datetimepicker.type\"\n [startAt]=\"datetimepicker.startAt\"\n [startView]=\"datetimepicker.startView\"\n [maxDate]=\"datetimepicker._maxDate\"\n [minDate]=\"datetimepicker._minDate\"\n [dateFilter]=\"datetimepicker._dateFilter\"\n [multiYearSelector]=\"datetimepicker.multiYearSelector\"\n [preventSameDateTimeSelection]=\"datetimepicker.preventSameDateTimeSelection\"\n [timeInterval]=\"datetimepicker.timeInterval\"\n [twelvehour]=\"datetimepicker.twelvehour\"\n [selected]=\"datetimepicker._selected\"\n [@fadeInCalendar]=\"'enter'\"\n (selectedChange)=\"datetimepicker._select($event)\"\n (viewChanged)=\"datetimepicker._viewChanged($event)\"\n (_userSelection)=\"datetimepicker.close()\">\n </mtx-calendar>\n</div>\n", styles: [".mtx-datetimepicker-content{display:block;border-radius:4px}.mtx-datetimepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mtx-datetimepicker-content .mtx-calendar{width:296px;height:424px}.mtx-datetimepicker-content .mtx-calendar[mode=landscape]{width:446px;height:328px}@media all and (orientation: landscape){.mtx-datetimepicker-content .mtx-calendar[mode=auto]{width:446px;height:328px}}.mtx-datetimepicker-content-touch{display:block;max-height:80vh;position:relative;overflow:visible}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container{min-height:300px;max-height:850px;min-width:250px;max-width:750px}.mtx-datetimepicker-content-touch .mtx-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:120vh;height:80vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:64vh;height:90vh}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}}@media all and (orientation: portrait){.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto],.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait]{width:80vw;height:120vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=auto] .mtx-calendar,.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=portrait] .mtx-calendar{width:100%;height:auto}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape]{width:90vw;height:64vw}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container[mode=landscape] .mtx-calendar{width:auto;height:100%}.mtx-datetimepicker-content-touch .mtx-datetimepicker-content-container-with-actions{height:135vw}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: MtxCalendar, selector: "mtx-calendar", inputs: ["multiYearSelector", "twelvehour", "startView", "timeInterval", "dateFilter", "preventSameDateTimeSelection", "type", "startAt", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "viewChanged", "_userSelection"], exportAs: ["mtxCalendar"] }], animations: [
|
|
1555
1560
|
mtxDatetimepickerAnimations.transformPanel,
|
|
1556
1561
|
mtxDatetimepickerAnimations.fadeInCalendar,
|
|
1557
1562
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1558
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerContent, decorators: [{
|
|
1559
1564
|
type: Component,
|
|
1560
1565
|
args: [{ selector: 'mtx-datetimepicker-content', host: {
|
|
1561
1566
|
'class': 'mtx-datetimepicker-content',
|
|
@@ -1583,7 +1588,9 @@ class MtxDatetimepicker {
|
|
|
1583
1588
|
this._twelvehour = false;
|
|
1584
1589
|
/** The view that the calendar should start in. */
|
|
1585
1590
|
this.startView = 'month';
|
|
1591
|
+
/** The display mode of datetimepicker. */
|
|
1586
1592
|
this.mode = 'auto';
|
|
1593
|
+
/** Step over minutes. */
|
|
1587
1594
|
this.timeInterval = 1;
|
|
1588
1595
|
/** Prevent user to select same date time */
|
|
1589
1596
|
this.preventSameDateTimeSelection = false;
|
|
@@ -1620,14 +1627,14 @@ class MtxDatetimepicker {
|
|
|
1620
1627
|
throw createMissingDateImplError('DateAdapter');
|
|
1621
1628
|
}
|
|
1622
1629
|
}
|
|
1623
|
-
/**
|
|
1630
|
+
/** Whether to show multi-year view. */
|
|
1624
1631
|
get multiYearSelector() {
|
|
1625
1632
|
return this._multiYearSelector;
|
|
1626
1633
|
}
|
|
1627
1634
|
set multiYearSelector(value) {
|
|
1628
1635
|
this._multiYearSelector = coerceBooleanProperty(value);
|
|
1629
1636
|
}
|
|
1630
|
-
/**
|
|
1637
|
+
/** Whether the clock uses 12 hour format. */
|
|
1631
1638
|
get twelvehour() {
|
|
1632
1639
|
return this._twelvehour;
|
|
1633
1640
|
}
|
|
@@ -1668,6 +1675,7 @@ class MtxDatetimepicker {
|
|
|
1668
1675
|
set startAt(date) {
|
|
1669
1676
|
this._startAt = this._dateAdapter.getValidDateOrNull(date);
|
|
1670
1677
|
}
|
|
1678
|
+
/** The display type of datetimepicker. */
|
|
1671
1679
|
get type() {
|
|
1672
1680
|
return this._type;
|
|
1673
1681
|
}
|
|
@@ -1913,9 +1921,9 @@ class MtxDatetimepicker {
|
|
|
1913
1921
|
})));
|
|
1914
1922
|
}
|
|
1915
1923
|
}
|
|
1916
|
-
/** @nocollapse */ MtxDatetimepicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1917
|
-
/** @nocollapse */ MtxDatetimepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1918
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1924
|
+
/** @nocollapse */ MtxDatetimepicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepicker, deps: [{ token: i4$1.Overlay }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: MTX_DATETIMEPICKER_SCROLL_STRATEGY }, { token: i1.DatetimeAdapter, optional: true }, { token: i6.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1925
|
+
/** @nocollapse */ MtxDatetimepicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MtxDatetimepicker, selector: "mtx-datetimepicker", inputs: { multiYearSelector: "multiYearSelector", twelvehour: "twelvehour", startView: "startView", mode: "mode", timeInterval: "timeInterval", preventSameDateTimeSelection: "preventSameDateTimeSelection", panelClass: "panelClass", opened: "opened", color: "color", startAt: "startAt", type: "type", touchUi: "touchUi", disabled: "disabled", xPosition: "xPosition", yPosition: "yPosition", restoreFocus: "restoreFocus" }, outputs: { selectedChanged: "selectedChanged", openedStream: "opened", closedStream: "closed", viewChanged: "viewChanged" }, exportAs: ["mtxDatetimepicker"], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1926
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepicker, decorators: [{
|
|
1919
1927
|
type: Component,
|
|
1920
1928
|
args: [{
|
|
1921
1929
|
selector: 'mtx-datetimepicker',
|
|
@@ -1925,7 +1933,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImpor
|
|
|
1925
1933
|
encapsulation: ViewEncapsulation.None,
|
|
1926
1934
|
preserveWhitespaces: false,
|
|
1927
1935
|
}]
|
|
1928
|
-
}], ctorParameters: function () { return [{ type: i4.Overlay }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
|
|
1936
|
+
}], ctorParameters: function () { return [{ type: i4$1.Overlay }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
|
|
1929
1937
|
type: Inject,
|
|
1930
1938
|
args: [MTX_DATETIMEPICKER_SCROLL_STRATEGY]
|
|
1931
1939
|
}] }, { type: i1.DatetimeAdapter, decorators: [{
|
|
@@ -2253,13 +2261,13 @@ class MtxDatetimepickerInput {
|
|
|
2253
2261
|
return this._formField ? this._formField.color : undefined;
|
|
2254
2262
|
}
|
|
2255
2263
|
}
|
|
2256
|
-
/** @nocollapse */ MtxDatetimepickerInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2257
|
-
/** @nocollapse */ MtxDatetimepickerInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
2264
|
+
/** @nocollapse */ MtxDatetimepickerInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerInput, deps: [{ token: i0.ElementRef }, { token: i1.DatetimeAdapter, optional: true }, { token: MTX_DATETIME_FORMATS, optional: true }, { token: i2$2.MatFormField, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2265
|
+
/** @nocollapse */ MtxDatetimepickerInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: MtxDatetimepickerInput, selector: "input[mtxDatetimepicker]", inputs: { mtxDatetimepicker: "mtxDatetimepicker", mtxDatetimepickerFilter: "mtxDatetimepickerFilter", 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 ? _dateAdapter.toIso8601(min) : null", "attr.max": "max ? _dateAdapter.toIso8601(max) : null", "disabled": "disabled" } }, providers: [
|
|
2258
2266
|
MAT_DATETIMEPICKER_VALUE_ACCESSOR,
|
|
2259
2267
|
MAT_DATETIMEPICKER_VALIDATORS,
|
|
2260
2268
|
{ provide: MAT_INPUT_VALUE_ACCESSOR, useExisting: MtxDatetimepickerInput },
|
|
2261
2269
|
], exportAs: ["mtxDatetimepickerInput"], ngImport: i0 });
|
|
2262
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerInput, decorators: [{
|
|
2263
2271
|
type: Directive,
|
|
2264
2272
|
args: [{
|
|
2265
2273
|
selector: 'input[mtxDatetimepicker]',
|
|
@@ -2288,7 +2296,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImpor
|
|
|
2288
2296
|
}, {
|
|
2289
2297
|
type: Inject,
|
|
2290
2298
|
args: [MTX_DATETIME_FORMATS]
|
|
2291
|
-
}] }, { type: i2$
|
|
2299
|
+
}] }, { type: i2$2.MatFormField, decorators: [{
|
|
2292
2300
|
type: Optional
|
|
2293
2301
|
}] }]; }, propDecorators: { dateChange: [{
|
|
2294
2302
|
type: Output
|
|
@@ -2311,9 +2319,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImpor
|
|
|
2311
2319
|
/** Can be used to override the icon of a `mtxDatetimepickerToggle`. */
|
|
2312
2320
|
class MtxDatetimepickerToggleIcon {
|
|
2313
2321
|
}
|
|
2314
|
-
/** @nocollapse */ MtxDatetimepickerToggleIcon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2315
|
-
/** @nocollapse */ MtxDatetimepickerToggleIcon.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
2316
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2322
|
+
/** @nocollapse */ MtxDatetimepickerToggleIcon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerToggleIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2323
|
+
/** @nocollapse */ MtxDatetimepickerToggleIcon.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: MtxDatetimepickerToggleIcon, selector: "[mtxDatetimepickerToggleIcon]", ngImport: i0 });
|
|
2324
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerToggleIcon, decorators: [{
|
|
2317
2325
|
type: Directive,
|
|
2318
2326
|
args: [{
|
|
2319
2327
|
selector: '[mtxDatetimepickerToggleIcon]',
|
|
@@ -2364,9 +2372,9 @@ class MtxDatetimepickerToggle {
|
|
|
2364
2372
|
]).subscribe(() => this._changeDetectorRef.markForCheck());
|
|
2365
2373
|
}
|
|
2366
2374
|
}
|
|
2367
|
-
/** @nocollapse */ MtxDatetimepickerToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2368
|
-
/** @nocollapse */ MtxDatetimepickerToggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2369
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2375
|
+
/** @nocollapse */ MtxDatetimepickerToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerToggle, deps: [{ token: i1$1.MatDatepickerIntl }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2376
|
+
/** @nocollapse */ MtxDatetimepickerToggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: MtxDatetimepickerToggle, selector: "mtx-datetimepicker-toggle", inputs: { datetimepicker: ["for", "datetimepicker"], tabIndex: "tabIndex", disabled: "disabled", disableRipple: "disableRipple" }, host: { listeners: { "focus": "_button.focus()" }, properties: { "attr.tabindex": "disabled ? null : -1", "class.mtx-datetimepicker-toggle-active": "datetimepicker && datetimepicker.opened", "class.mat-accent": "datetimepicker && datetimepicker.color === \"accent\"", "class.mat-warn": "datetimepicker && datetimepicker.color === \"warn\"" }, classAttribute: "mtx-datetimepicker-toggle" }, queries: [{ propertyName: "_customIcon", first: true, predicate: MtxDatetimepickerToggleIcon, descendants: true }], viewQueries: [{ propertyName: "_button", first: true, predicate: ["button"], descendants: true }], exportAs: ["mtxDatetimepickerToggle"], usesOnChanges: true, ngImport: i0, template: "<button #button\n mat-icon-button\n type=\"button\"\n [attr.aria-haspopup]=\"datetimepicker ? 'dialog' : null\"\n [attr.aria-label]=\"_intl.openCalendarLabel\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n (click)=\"_open($event)\">\n\n <ng-container *ngIf=\"!_customIcon\" [ngSwitch]=\"datetimepicker.type\">\n <svg *ngSwitchCase=\"'time'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\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\">\n </path>\n </svg>\n <svg *ngSwitchCase=\"'datetime'\"\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path\n d=\"M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z\">\n </path>\n </svg>\n <svg *ngSwitchDefault\n class=\"mtx-datetimepicker-toggle-default-icon\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n fill=\"currentColor\"\n focusable=\"false\">\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\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\" />\n </svg>\n </ng-container>\n\n <ng-content select=\"[mtxDatetimepickerToggleIcon]\"></ng-content>\n</button>\n", styles: [".mat-form-field-appearance-legacy .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{width:1em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mtx-datetimepicker-toggle-default-icon{display:block;width:1.5em;height:1.5em}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mtx-datetimepicker-toggle-default-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mtx-datetimepicker-toggle-default-icon{margin:auto}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerToggle, decorators: [{
|
|
2370
2378
|
type: Component,
|
|
2371
2379
|
args: [{ selector: 'mtx-datetimepicker-toggle', host: {
|
|
2372
2380
|
'class': 'mtx-datetimepicker-toggle',
|
|
@@ -2397,8 +2405,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImpor
|
|
|
2397
2405
|
|
|
2398
2406
|
class MtxDatetimepickerModule {
|
|
2399
2407
|
}
|
|
2400
|
-
/** @nocollapse */ MtxDatetimepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2401
|
-
/** @nocollapse */ MtxDatetimepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
2408
|
+
/** @nocollapse */ MtxDatetimepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2409
|
+
/** @nocollapse */ MtxDatetimepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerModule, declarations: [MtxCalendar,
|
|
2402
2410
|
MtxCalendarBody,
|
|
2403
2411
|
MtxClock,
|
|
2404
2412
|
MtxDatetimepicker,
|
|
@@ -2419,8 +2427,8 @@ class MtxDatetimepickerModule {
|
|
|
2419
2427
|
MtxMonthView,
|
|
2420
2428
|
MtxYearView,
|
|
2421
2429
|
MtxMultiYearView] });
|
|
2422
|
-
/** @nocollapse */ MtxDatetimepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2423
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2430
|
+
/** @nocollapse */ MtxDatetimepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerModule, providers: [MTX_DATETIMEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [CommonModule, MatButtonModule, OverlayModule, A11yModule, PortalModule] });
|
|
2431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: MtxDatetimepickerModule, decorators: [{
|
|
2424
2432
|
type: NgModule,
|
|
2425
2433
|
args: [{
|
|
2426
2434
|
imports: [CommonModule, MatButtonModule, OverlayModule, A11yModule, PortalModule],
|