@skyux/datetime 5.6.2 → 6.0.0-beta.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/esm2020/index.mjs +28 -0
- package/esm2020/lib/modules/date-pipe/date-format-utility.mjs +46 -0
- package/esm2020/lib/modules/date-pipe/date-pipe.module.mjs +21 -0
- package/esm2020/lib/modules/date-pipe/date.pipe.mjs +65 -0
- package/esm2020/lib/modules/date-pipe/fuzzy-date.pipe.mjs +47 -0
- package/esm2020/lib/modules/date-range-picker/date-range-picker.component.mjs +448 -0
- package/esm2020/lib/modules/date-range-picker/date-range-picker.module.mjs +47 -0
- package/esm2020/lib/modules/date-range-picker/date-range.service.mjs +97 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range-calculation.mjs +2 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range-calculator-config.mjs +2 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range-calculator-date-range-function.mjs +2 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range-calculator-id.mjs +118 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range-calculator-type.mjs +23 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range-calculator-validate-function.mjs +2 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range-calculator.mjs +56 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range-default-calculator-config.mjs +2 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range-default-calculator-configs.mjs +147 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range-relative-value.mjs +249 -0
- package/esm2020/lib/modules/date-range-picker/types/date-range.mjs +2 -0
- package/esm2020/lib/modules/datepicker/date-formatter.mjs +38 -0
- package/esm2020/lib/modules/datepicker/datepicker-adapter.service.mjs +33 -0
- package/esm2020/lib/modules/datepicker/datepicker-calendar-change.mjs +2 -0
- package/esm2020/lib/modules/datepicker/datepicker-calendar-inner.component.mjs +310 -0
- package/esm2020/lib/modules/datepicker/datepicker-calendar.component.mjs +104 -0
- package/esm2020/lib/modules/datepicker/datepicker-config.service.mjs +21 -0
- package/esm2020/lib/modules/datepicker/datepicker-custom-date.mjs +2 -0
- package/esm2020/lib/modules/datepicker/datepicker-date.mjs +2 -0
- package/esm2020/lib/modules/datepicker/datepicker-input-fuzzy.directive.mjs +466 -0
- package/esm2020/lib/modules/datepicker/datepicker-input.directive.mjs +445 -0
- package/esm2020/lib/modules/datepicker/datepicker.component.mjs +328 -0
- package/esm2020/lib/modules/datepicker/datepicker.module.mjs +95 -0
- package/esm2020/lib/modules/datepicker/datepicker.service.mjs +21 -0
- package/esm2020/lib/modules/datepicker/daypicker-button.component.mjs +22 -0
- package/esm2020/lib/modules/datepicker/daypicker-cell.component.mjs +126 -0
- package/esm2020/lib/modules/datepicker/daypicker.component.mjs +211 -0
- package/esm2020/lib/modules/datepicker/fuzzy-date.mjs +2 -0
- package/esm2020/lib/modules/datepicker/fuzzy-date.service.mjs +403 -0
- package/esm2020/lib/modules/datepicker/monthpicker.component.mjs +80 -0
- package/esm2020/lib/modules/datepicker/yearpicker.component.mjs +86 -0
- package/esm2020/lib/modules/shared/sky-datetime-resources.module.mjs +131 -0
- package/esm2020/lib/modules/timepicker/timepicker.component.mjs +361 -0
- package/esm2020/lib/modules/timepicker/timepicker.directive.mjs +228 -0
- package/esm2020/lib/modules/timepicker/timepicker.interface.mjs +2 -0
- package/esm2020/lib/modules/timepicker/timepicker.module.mjs +46 -0
- package/esm2020/skyux-datetime.mjs +5 -0
- package/esm2020/testing/datepicker-fixture.mjs +54 -0
- package/esm2020/testing/public-api.mjs +3 -0
- package/esm2020/testing/skyux-datetime-testing.mjs +5 -0
- package/esm2020/testing/timepicker-fixture.mjs +50 -0
- package/fesm2015/{skyux-datetime-testing.js → skyux-datetime-testing.mjs} +1 -1
- package/fesm2015/skyux-datetime-testing.mjs.map +1 -0
- package/fesm2015/skyux-datetime.mjs +4726 -0
- package/fesm2015/skyux-datetime.mjs.map +1 -0
- package/{esm2015/testing/datepicker-fixture.js → fesm2020/skyux-datetime-testing.mjs} +57 -2
- package/fesm2020/skyux-datetime-testing.mjs.map +1 -0
- package/{fesm2015/skyux-datetime.js → fesm2020/skyux-datetime.mjs} +111 -159
- package/fesm2020/skyux-datetime.mjs.map +1 -0
- package/lib/modules/shared/sky-datetime-resources.module.d.ts +1 -1
- package/package.json +38 -17
- package/testing/package.json +5 -5
- package/bundles/skyux-datetime-testing.umd.js +0 -143
- package/bundles/skyux-datetime.umd.js +0 -5488
- package/esm2015/index.js +0 -28
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/modules/date-pipe/date-format-utility.js +0 -46
- package/esm2015/lib/modules/date-pipe/date-format-utility.js.map +0 -1
- package/esm2015/lib/modules/date-pipe/date-pipe.module.js +0 -21
- package/esm2015/lib/modules/date-pipe/date-pipe.module.js.map +0 -1
- package/esm2015/lib/modules/date-pipe/date.pipe.js +0 -65
- package/esm2015/lib/modules/date-pipe/date.pipe.js.map +0 -1
- package/esm2015/lib/modules/date-pipe/fuzzy-date.pipe.js +0 -47
- package/esm2015/lib/modules/date-pipe/fuzzy-date.pipe.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/date-range-picker.component.js +0 -453
- package/esm2015/lib/modules/date-range-picker/date-range-picker.component.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/date-range-picker.module.js +0 -47
- package/esm2015/lib/modules/date-range-picker/date-range-picker.module.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/date-range.service.js +0 -97
- package/esm2015/lib/modules/date-range-picker/date-range.service.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculation.js +0 -2
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculation.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-config.js +0 -2
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-config.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-date-range-function.js +0 -2
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-date-range-function.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-id.js +0 -118
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-id.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-type.js +0 -23
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-type.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-validate-function.js +0 -2
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator-validate-function.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator.js +0 -56
- package/esm2015/lib/modules/date-range-picker/types/date-range-calculator.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-default-calculator-config.js +0 -2
- package/esm2015/lib/modules/date-range-picker/types/date-range-default-calculator-config.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-default-calculator-configs.js +0 -147
- package/esm2015/lib/modules/date-range-picker/types/date-range-default-calculator-configs.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range-relative-value.js +0 -249
- package/esm2015/lib/modules/date-range-picker/types/date-range-relative-value.js.map +0 -1
- package/esm2015/lib/modules/date-range-picker/types/date-range.js +0 -2
- package/esm2015/lib/modules/date-range-picker/types/date-range.js.map +0 -1
- package/esm2015/lib/modules/datepicker/date-formatter.js +0 -38
- package/esm2015/lib/modules/datepicker/date-formatter.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker-adapter.service.js +0 -33
- package/esm2015/lib/modules/datepicker/datepicker-adapter.service.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker-calendar-change.js +0 -2
- package/esm2015/lib/modules/datepicker/datepicker-calendar-change.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker-calendar-inner.component.js +0 -315
- package/esm2015/lib/modules/datepicker/datepicker-calendar-inner.component.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker-calendar.component.js +0 -109
- package/esm2015/lib/modules/datepicker/datepicker-calendar.component.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker-config.service.js +0 -21
- package/esm2015/lib/modules/datepicker/datepicker-config.service.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker-custom-date.js +0 -2
- package/esm2015/lib/modules/datepicker/datepicker-custom-date.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker-date.js +0 -2
- package/esm2015/lib/modules/datepicker/datepicker-date.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker-input-fuzzy.directive.js +0 -467
- package/esm2015/lib/modules/datepicker/datepicker-input-fuzzy.directive.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker-input.directive.js +0 -446
- package/esm2015/lib/modules/datepicker/datepicker-input.directive.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker.component.js +0 -333
- package/esm2015/lib/modules/datepicker/datepicker.component.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker.module.js +0 -95
- package/esm2015/lib/modules/datepicker/datepicker.module.js.map +0 -1
- package/esm2015/lib/modules/datepicker/datepicker.service.js +0 -21
- package/esm2015/lib/modules/datepicker/datepicker.service.js.map +0 -1
- package/esm2015/lib/modules/datepicker/daypicker-button.component.js +0 -26
- package/esm2015/lib/modules/datepicker/daypicker-button.component.js.map +0 -1
- package/esm2015/lib/modules/datepicker/daypicker-cell.component.js +0 -130
- package/esm2015/lib/modules/datepicker/daypicker-cell.component.js.map +0 -1
- package/esm2015/lib/modules/datepicker/daypicker.component.js +0 -215
- package/esm2015/lib/modules/datepicker/daypicker.component.js.map +0 -1
- package/esm2015/lib/modules/datepicker/fuzzy-date.js +0 -2
- package/esm2015/lib/modules/datepicker/fuzzy-date.js.map +0 -1
- package/esm2015/lib/modules/datepicker/fuzzy-date.service.js +0 -403
- package/esm2015/lib/modules/datepicker/fuzzy-date.service.js.map +0 -1
- package/esm2015/lib/modules/datepicker/monthpicker.component.js +0 -84
- package/esm2015/lib/modules/datepicker/monthpicker.component.js.map +0 -1
- package/esm2015/lib/modules/datepicker/yearpicker.component.js +0 -90
- package/esm2015/lib/modules/datepicker/yearpicker.component.js.map +0 -1
- package/esm2015/lib/modules/shared/sky-datetime-resources.module.js +0 -131
- package/esm2015/lib/modules/shared/sky-datetime-resources.module.js.map +0 -1
- package/esm2015/lib/modules/timepicker/timepicker.component.js +0 -367
- package/esm2015/lib/modules/timepicker/timepicker.component.js.map +0 -1
- package/esm2015/lib/modules/timepicker/timepicker.directive.js +0 -228
- package/esm2015/lib/modules/timepicker/timepicker.directive.js.map +0 -1
- package/esm2015/lib/modules/timepicker/timepicker.interface.js +0 -2
- package/esm2015/lib/modules/timepicker/timepicker.interface.js.map +0 -1
- package/esm2015/lib/modules/timepicker/timepicker.module.js +0 -46
- package/esm2015/lib/modules/timepicker/timepicker.module.js.map +0 -1
- package/esm2015/skyux-datetime.js +0 -5
- package/esm2015/skyux-datetime.js.map +0 -1
- package/esm2015/testing/datepicker-fixture.js.map +0 -1
- package/esm2015/testing/public-api.js +0 -3
- package/esm2015/testing/public-api.js.map +0 -1
- package/esm2015/testing/skyux-datetime-testing.js +0 -5
- package/esm2015/testing/skyux-datetime-testing.js.map +0 -1
- package/esm2015/testing/timepicker-fixture.js +0 -50
- package/esm2015/testing/timepicker-fixture.js.map +0 -1
- package/fesm2015/skyux-datetime-testing.js.map +0 -1
- package/fesm2015/skyux-datetime.js.map +0 -1
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Optional, Output, TemplateRef, ViewChild, } from '@angular/core';
|
|
2
|
-
import { SkyAffixAutoFitContext, SkyAffixService, SkyCoreAdapterService, SkyOverlayService, } from '@skyux/core';
|
|
3
|
-
import { SkyInputBoxHostService } from '@skyux/forms';
|
|
4
|
-
import { SkyThemeService } from '@skyux/theme';
|
|
5
|
-
import { Subject, fromEvent } from 'rxjs';
|
|
6
|
-
import { debounceTime, takeUntil } from 'rxjs/operators';
|
|
7
|
-
import { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
import * as i1 from "@skyux/core";
|
|
10
|
-
import * as i2 from "@skyux/forms";
|
|
11
|
-
import * as i3 from "@skyux/theme";
|
|
12
|
-
import * as i4 from "@skyux/indicators";
|
|
13
|
-
import * as i5 from "./datepicker-calendar.component";
|
|
14
|
-
import * as i6 from "@angular/common";
|
|
15
|
-
import * as i7 from "@skyux/i18n";
|
|
16
|
-
let nextId = 0;
|
|
17
|
-
/**
|
|
18
|
-
* Creates the datepicker button and calendar.
|
|
19
|
-
* You must wrap this component around an input with the `skyDatepickerInput` directive.
|
|
20
|
-
*/
|
|
21
|
-
export class SkyDatepickerComponent {
|
|
22
|
-
constructor(affixService, changeDetector, coreAdapter, overlayService, inputBoxHostService, themeSvc) {
|
|
23
|
-
this.affixService = affixService;
|
|
24
|
-
this.changeDetector = changeDetector;
|
|
25
|
-
this.coreAdapter = coreAdapter;
|
|
26
|
-
this.overlayService = overlayService;
|
|
27
|
-
this.inputBoxHostService = inputBoxHostService;
|
|
28
|
-
/**
|
|
29
|
-
* Adds a class to the datepicker.
|
|
30
|
-
* @default ""
|
|
31
|
-
*/
|
|
32
|
-
this.pickerClass = '';
|
|
33
|
-
/**
|
|
34
|
-
* Fires when the range of displayed dates in the calendar changes. Provides the
|
|
35
|
-
* current range of displayed dates and a mutable `customDate` property consumers can use
|
|
36
|
-
* to modify individual dates on the calendar.
|
|
37
|
-
*/
|
|
38
|
-
this.calendarDateRangeChange = new EventEmitter();
|
|
39
|
-
this.dateChange = new EventEmitter();
|
|
40
|
-
this.isDaypickerWaiting = false;
|
|
41
|
-
this.isOpen = false;
|
|
42
|
-
this.isVisible = false;
|
|
43
|
-
this.ngUnsubscribe = new Subject();
|
|
44
|
-
this._disabled = false;
|
|
45
|
-
const uniqueId = nextId++;
|
|
46
|
-
this.calendarId = `sky-datepicker-calendar-${uniqueId}`;
|
|
47
|
-
this.triggerButtonId = `sky-datepicker-button-${uniqueId}`;
|
|
48
|
-
// Update icons when theme changes.
|
|
49
|
-
themeSvc === null || themeSvc === void 0 ? void 0 : themeSvc.settingsChange.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
|
|
50
|
-
this.changeDetector.markForCheck();
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* @internal
|
|
55
|
-
* Indicates if the calendar button element or any of its children have focus.
|
|
56
|
-
* @deprecated This property will be removed in the next major version release.
|
|
57
|
-
*/
|
|
58
|
-
get buttonIsFocused() {
|
|
59
|
-
/* sanity check */
|
|
60
|
-
/* istanbul ignore if */
|
|
61
|
-
if (!this.triggerButtonRef) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
const activeEl = document.activeElement;
|
|
65
|
-
return this.triggerButtonRef.nativeElement === activeEl;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* @internal
|
|
69
|
-
* Indicates if the calendar element or any of its children have focus.
|
|
70
|
-
* @deprecated This property will be removed in the next major version release.
|
|
71
|
-
*/
|
|
72
|
-
get calendarIsFocused() {
|
|
73
|
-
if (!this.calendarRef) {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
const focusedEl = document.activeElement;
|
|
77
|
-
return this.calendarRef.nativeElement.contains(focusedEl);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* @internal
|
|
81
|
-
* Indicates if the calendar element's visiblity property is 'visible'.
|
|
82
|
-
* @deprecated This property will be removed in the next major version release.
|
|
83
|
-
*/
|
|
84
|
-
get calendarIsVisible() {
|
|
85
|
-
return this.calendar ? this.calendar.isVisible : false;
|
|
86
|
-
}
|
|
87
|
-
get disabled() {
|
|
88
|
-
return this._disabled;
|
|
89
|
-
}
|
|
90
|
-
set disabled(value) {
|
|
91
|
-
this._disabled = value;
|
|
92
|
-
this.changeDetector.markForCheck();
|
|
93
|
-
}
|
|
94
|
-
set selectedDate(value) {
|
|
95
|
-
this._selectedDate = value;
|
|
96
|
-
if (this.calendar) {
|
|
97
|
-
this.calendar.writeValue(this._selectedDate);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
set calendarRef(value) {
|
|
101
|
-
if (value) {
|
|
102
|
-
this._calendarRef = value;
|
|
103
|
-
// Wait for the calendar component to render before gauging dimensions.
|
|
104
|
-
setTimeout(() => {
|
|
105
|
-
this.calendar.writeValue(this._selectedDate);
|
|
106
|
-
this.destroyAffixer();
|
|
107
|
-
this.createAffixer();
|
|
108
|
-
setTimeout(() => {
|
|
109
|
-
this.coreAdapter.getFocusableChildrenAndApplyFocus(this.calendarRef, '.sky-datepicker-calendar-inner', false);
|
|
110
|
-
this.isVisible = true;
|
|
111
|
-
this.changeDetector.markForCheck();
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
get calendarRef() {
|
|
117
|
-
return this._calendarRef;
|
|
118
|
-
}
|
|
119
|
-
ngOnInit() {
|
|
120
|
-
if (this.inputBoxHostService) {
|
|
121
|
-
this.inputBoxHostService.populate({
|
|
122
|
-
inputTemplate: this.inputTemplateRef,
|
|
123
|
-
buttonsTemplate: this.triggerButtonTemplateRef,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
ngOnDestroy() {
|
|
128
|
-
this.dateChange.complete();
|
|
129
|
-
this.ngUnsubscribe.next();
|
|
130
|
-
this.ngUnsubscribe.complete();
|
|
131
|
-
this.removePickerEventListeners();
|
|
132
|
-
this.destroyAffixer();
|
|
133
|
-
this.destroyOverlay();
|
|
134
|
-
}
|
|
135
|
-
onCalendarModeChange() {
|
|
136
|
-
// Let the calendar populate in the DOM before recalculating placement.
|
|
137
|
-
setTimeout(() => {
|
|
138
|
-
this.affixer.reaffix();
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
onSelectedDateChange(value) {
|
|
142
|
-
this.dateChange.emit(value);
|
|
143
|
-
this.closePicker();
|
|
144
|
-
}
|
|
145
|
-
onTriggerButtonClick() {
|
|
146
|
-
if (this.isOpen) {
|
|
147
|
-
this.closePicker();
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
this.openPicker();
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
onCalendarDateRangeChange(event) {
|
|
154
|
-
/* istanbul ignore else */
|
|
155
|
-
if (event) {
|
|
156
|
-
this.cancelCustomDatesSubscription();
|
|
157
|
-
const args = {
|
|
158
|
-
startDate: event.startDate,
|
|
159
|
-
endDate: event.endDate,
|
|
160
|
-
customDates: undefined,
|
|
161
|
-
};
|
|
162
|
-
this.calendarDateRangeChange.emit(args);
|
|
163
|
-
// If consumer has added an observable to the args, watch for incoming custom dates.
|
|
164
|
-
/* istanbul ignore else */
|
|
165
|
-
if (args.customDates) {
|
|
166
|
-
this.isDaypickerWaiting = true;
|
|
167
|
-
// Avoid an ExpressionChangedAfterItHasBeenCheckedError.
|
|
168
|
-
this.changeDetector.detectChanges();
|
|
169
|
-
this.customDatesSubscription = args.customDates
|
|
170
|
-
.pipe(debounceTime(250))
|
|
171
|
-
.subscribe((result) => {
|
|
172
|
-
this.customDates = result;
|
|
173
|
-
this.isDaypickerWaiting = false;
|
|
174
|
-
// Trigger change detection in child components to show changes in the calendar.
|
|
175
|
-
this.changeDetector.markForCheck();
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
// If consumer returns an undefined value after custom dates have
|
|
180
|
-
// already ben established, remove custom dates.
|
|
181
|
-
if (this.customDates) {
|
|
182
|
-
this.customDates = undefined;
|
|
183
|
-
// Avoid an ExpressionChangedAfterItHasBeenCheckedError.
|
|
184
|
-
this.changeDetector.detectChanges();
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
closePicker() {
|
|
190
|
-
this.destroyAffixer();
|
|
191
|
-
this.destroyOverlay();
|
|
192
|
-
this.removePickerEventListeners();
|
|
193
|
-
this.triggerButtonRef.nativeElement.focus();
|
|
194
|
-
this.isOpen = false;
|
|
195
|
-
}
|
|
196
|
-
openPicker() {
|
|
197
|
-
this.isVisible = false;
|
|
198
|
-
this.changeDetector.markForCheck();
|
|
199
|
-
this.removePickerEventListeners();
|
|
200
|
-
this.calendarUnsubscribe = new Subject();
|
|
201
|
-
this.destroyOverlay();
|
|
202
|
-
this.createOverlay();
|
|
203
|
-
this.isOpen = true;
|
|
204
|
-
this.changeDetector.markForCheck();
|
|
205
|
-
}
|
|
206
|
-
createAffixer() {
|
|
207
|
-
const affixer = this.affixService.createAffixer(this.calendarRef);
|
|
208
|
-
// Hide calendar when trigger button is scrolled off screen.
|
|
209
|
-
affixer.placementChange
|
|
210
|
-
.pipe(takeUntil(this.calendarUnsubscribe))
|
|
211
|
-
.subscribe((change) => {
|
|
212
|
-
this.isVisible = change.placement !== null;
|
|
213
|
-
this.changeDetector.markForCheck();
|
|
214
|
-
});
|
|
215
|
-
affixer.affixTo(this.triggerButtonRef.nativeElement, {
|
|
216
|
-
autoFitContext: SkyAffixAutoFitContext.Viewport,
|
|
217
|
-
enableAutoFit: true,
|
|
218
|
-
horizontalAlignment: 'right',
|
|
219
|
-
isSticky: true,
|
|
220
|
-
placement: 'below',
|
|
221
|
-
});
|
|
222
|
-
this.affixer = affixer;
|
|
223
|
-
}
|
|
224
|
-
destroyAffixer() {
|
|
225
|
-
/*istanbul ignore else*/
|
|
226
|
-
if (this.affixer) {
|
|
227
|
-
this.affixer.destroy();
|
|
228
|
-
this.affixer = undefined;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
createOverlay() {
|
|
232
|
-
const overlay = this.overlayService.create({
|
|
233
|
-
wrapperClass: this.pickerClass,
|
|
234
|
-
enableClose: false,
|
|
235
|
-
enablePointerEvents: false,
|
|
236
|
-
});
|
|
237
|
-
overlay.backdropClick
|
|
238
|
-
.pipe(takeUntil(this.calendarUnsubscribe))
|
|
239
|
-
.subscribe(() => {
|
|
240
|
-
/* istanbul ignore else */
|
|
241
|
-
if (this.isOpen) {
|
|
242
|
-
this.closePicker();
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
this.addKeydownListner();
|
|
246
|
-
overlay.attachTemplate(this.calendarTemplateRef);
|
|
247
|
-
this.overlay = overlay;
|
|
248
|
-
}
|
|
249
|
-
destroyOverlay() {
|
|
250
|
-
/*istanbul ignore else*/
|
|
251
|
-
if (this.overlay) {
|
|
252
|
-
this.overlayService.close(this.overlay);
|
|
253
|
-
this.overlay = undefined;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
addKeydownListner() {
|
|
257
|
-
this.overlayKeydownListner = fromEvent(window.document, 'keydown')
|
|
258
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
259
|
-
.subscribe((event) => {
|
|
260
|
-
var _a;
|
|
261
|
-
const key = (_a = event.key) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
262
|
-
if (key === 'escape' && this.isOpen) {
|
|
263
|
-
this.closePicker();
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
removePickerEventListeners() {
|
|
268
|
-
var _a;
|
|
269
|
-
/* istanbul ignore else */
|
|
270
|
-
if (this.calendarUnsubscribe) {
|
|
271
|
-
this.calendarUnsubscribe.next();
|
|
272
|
-
this.calendarUnsubscribe.complete();
|
|
273
|
-
this.calendarUnsubscribe = undefined;
|
|
274
|
-
}
|
|
275
|
-
(_a = this.overlayKeydownListner) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
276
|
-
}
|
|
277
|
-
cancelCustomDatesSubscription() {
|
|
278
|
-
if (this.customDatesSubscription) {
|
|
279
|
-
this.customDatesSubscription.unsubscribe();
|
|
280
|
-
this.customDatesSubscription = undefined;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
SkyDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDatepickerComponent, deps: [{ token: i1.SkyAffixService }, { token: i0.ChangeDetectorRef }, { token: i1.SkyCoreAdapterService }, { token: i1.SkyOverlayService }, { token: i2.SkyInputBoxHostService, optional: true }, { token: i3.SkyThemeService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
285
|
-
SkyDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyDatepickerComponent, selector: "sky-datepicker", inputs: { pickerClass: "pickerClass" }, outputs: { calendarDateRangeChange: "calendarDateRangeChange" }, viewQueries: [{ propertyName: "calendar", first: true, predicate: SkyDatepickerCalendarComponent, descendants: true }, { propertyName: "calendarRef", first: true, predicate: ["calendarRef"], descendants: true, read: ElementRef }, { propertyName: "calendarTemplateRef", first: true, predicate: ["calendarTemplateRef"], descendants: true, read: TemplateRef }, { propertyName: "triggerButtonRef", first: true, predicate: ["triggerButtonRef"], descendants: true, read: ElementRef }, { propertyName: "inputTemplateRef", first: true, predicate: ["inputTemplateRef"], descendants: true, read: TemplateRef, static: true }, { propertyName: "triggerButtonTemplateRef", first: true, predicate: ["triggerButtonTemplateRef"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<div class=\"sky-datepicker\">\n <ng-container *ngIf=\"!inputBoxHostService\">\n <div class=\"sky-input-group\">\n <ng-container *ngTemplateOutlet=\"inputTemplateRef\"></ng-container>\n <ng-container *ngTemplateOutlet=\"triggerButtonTemplateRef\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n<ng-template #inputTemplateRef>\n <ng-content></ng-content>\n</ng-template>\n\n<ng-template #triggerButtonTemplateRef>\n <div class=\"sky-input-group-btn\">\n <button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-btn-default sky-input-group-datepicker-btn\"\n type=\"button\"\n [attr.aria-controls]=\"isOpen ? calendarId : null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-label]=\"\n 'skyux_datepicker_trigger_button_label' | skyLibResources\n \"\n [attr.id]=\"triggerButtonId\"\n [attr.title]=\"'skyux_datepicker_trigger_button_label' | skyLibResources\"\n [disabled]=\"disabled\"\n (click)=\"onTriggerButtonClick()\"\n #triggerButtonRef\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"calendar\" size=\"lg\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"calendar\"\n size=\"lg\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #calendarTemplateRef>\n <div\n class=\"sky-datepicker-calendar-container sky-shadow sky-elevation-4\"\n role=\"dialog\"\n [attr.aria-labelledby]=\"triggerButtonId\"\n [attr.id]=\"calendarId\"\n [class.sky-datepicker-hidden]=\"!isVisible\"\n #calendarRef\n >\n <sky-datepicker-calendar\n [customDates]=\"customDates\"\n [isDaypickerWaiting]=\"isDaypickerWaiting\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [startingDay]=\"startingDay\"\n (calendarDateRangeChange)=\"onCalendarDateRangeChange($event)\"\n (calendarModeChange)=\"onCalendarModeChange()\"\n (selectedDateChange)=\"onSelectedDateChange($event)\"\n >\n </sky-datepicker-calendar>\n </div>\n</ng-template>\n", styles: [".sky-datepicker-calendar-container{position:fixed;border-radius:5px}.sky-datepicker-hidden{visibility:hidden}\n"], components: [{ type: i4.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { type: i5.SkyDatepickerCalendarComponent, selector: "sky-datepicker-calendar", inputs: ["customDates", "isDaypickerWaiting", "minDate", "maxDate", "selectedDate", "startingDay"], outputs: ["calendarDateRangeChange", "calendarModeChange", "selectedDateChange"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }], pipes: { "skyLibResources": i7.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
286
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDatepickerComponent, decorators: [{
|
|
287
|
-
type: Component,
|
|
288
|
-
args: [{
|
|
289
|
-
selector: 'sky-datepicker',
|
|
290
|
-
templateUrl: './datepicker.component.html',
|
|
291
|
-
styleUrls: ['./datepicker.component.scss'],
|
|
292
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
293
|
-
}]
|
|
294
|
-
}], ctorParameters: function () { return [{ type: i1.SkyAffixService }, { type: i0.ChangeDetectorRef }, { type: i1.SkyCoreAdapterService }, { type: i1.SkyOverlayService }, { type: i2.SkyInputBoxHostService, decorators: [{
|
|
295
|
-
type: Optional
|
|
296
|
-
}] }, { type: i3.SkyThemeService, decorators: [{
|
|
297
|
-
type: Optional
|
|
298
|
-
}] }]; }, propDecorators: { pickerClass: [{
|
|
299
|
-
type: Input
|
|
300
|
-
}], calendarDateRangeChange: [{
|
|
301
|
-
type: Output
|
|
302
|
-
}], calendar: [{
|
|
303
|
-
type: ViewChild,
|
|
304
|
-
args: [SkyDatepickerCalendarComponent]
|
|
305
|
-
}], calendarRef: [{
|
|
306
|
-
type: ViewChild,
|
|
307
|
-
args: ['calendarRef', {
|
|
308
|
-
read: ElementRef,
|
|
309
|
-
}]
|
|
310
|
-
}], calendarTemplateRef: [{
|
|
311
|
-
type: ViewChild,
|
|
312
|
-
args: ['calendarTemplateRef', {
|
|
313
|
-
read: TemplateRef,
|
|
314
|
-
}]
|
|
315
|
-
}], triggerButtonRef: [{
|
|
316
|
-
type: ViewChild,
|
|
317
|
-
args: ['triggerButtonRef', {
|
|
318
|
-
read: ElementRef,
|
|
319
|
-
}]
|
|
320
|
-
}], inputTemplateRef: [{
|
|
321
|
-
type: ViewChild,
|
|
322
|
-
args: ['inputTemplateRef', {
|
|
323
|
-
read: TemplateRef,
|
|
324
|
-
static: true,
|
|
325
|
-
}]
|
|
326
|
-
}], triggerButtonTemplateRef: [{
|
|
327
|
-
type: ViewChild,
|
|
328
|
-
args: ['triggerButtonTemplateRef', {
|
|
329
|
-
read: TemplateRef,
|
|
330
|
-
static: true,
|
|
331
|
-
}]
|
|
332
|
-
}] } });
|
|
333
|
-
//# sourceMappingURL=datepicker.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker.component.ts","../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EAGL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,eAAe,EAEf,qBAAqB,EAErB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;;;;;;;;;AAGjF,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf;;;GAGG;AAOH,MAAM,OAAO,sBAAsB;IAqKjC,YACU,YAA6B,EAC7B,cAAiC,EACjC,WAAkC,EAClC,cAAiC,EACtB,mBAA4C,EACnD,QAA0B;QAL9B,iBAAY,GAAZ,YAAY,CAAiB;QAC7B,mBAAc,GAAd,cAAc,CAAmB;Q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\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {\n SkyAffixAutoFitContext,\n SkyAffixService,\n SkyAffixer,\n SkyCoreAdapterService,\n SkyOverlayInstance,\n SkyOverlayService,\n} from '@skyux/core';\nimport { SkyInputBoxHostService } from '@skyux/forms';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { Subject, Subscription, fromEvent } from 'rxjs';\nimport { debounceTime, takeUntil } from 'rxjs/operators';\n\nimport { SkyDatepickerCalendarChange } from './datepicker-calendar-change';\nimport { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';\nimport { SkyDatepickerCustomDate } from './datepicker-custom-date';\n\nlet nextId = 0;\n\n/**\n * Creates the datepicker button and calendar.\n * You must wrap this component around an input with the `skyDatepickerInput` directive.\n */\n@Component({\n selector: 'sky-datepicker',\n templateUrl: './datepicker.component.html',\n styleUrls: ['./datepicker.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyDatepickerComponent implements OnDestroy, OnInit {\n /**\n * Adds a class to the datepicker.\n * @default \"\"\n */\n @Input()\n public pickerClass = '';\n\n /**\n * @internal\n * Indicates if the calendar button element or any of its children have focus.\n * @deprecated This property will be removed in the next major version release.\n */\n public get buttonIsFocused(): boolean {\n /* sanity check */\n /* istanbul ignore if */\n if (!this.triggerButtonRef) {\n return false;\n }\n const activeEl = document.activeElement;\n return this.triggerButtonRef.nativeElement === activeEl;\n }\n\n /**\n * @internal\n * Indicates if the calendar element or any of its children have focus.\n * @deprecated This property will be removed in the next major version release.\n */\n public get calendarIsFocused(): boolean {\n if (!this.calendarRef) {\n return false;\n }\n\n const focusedEl = document.activeElement;\n return this.calendarRef.nativeElement.contains(focusedEl);\n }\n\n /**\n * @internal\n * Indicates if the calendar element's visiblity property is 'visible'.\n * @deprecated This property will be removed in the next major version release.\n */\n public get calendarIsVisible(): boolean {\n return this.calendar ? this.calendar.isVisible : false;\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n public set disabled(value: boolean) {\n this._disabled = value;\n this.changeDetector.markForCheck();\n }\n\n public set selectedDate(value: Date) {\n this._selectedDate = value;\n if (this.calendar) {\n this.calendar.writeValue(this._selectedDate);\n }\n }\n\n /**\n * Fires when the range of displayed dates in the calendar changes. Provides the\n * current range of displayed dates and a mutable `customDate` property consumers can use\n * to modify individual dates on the calendar.\n */\n @Output()\n public calendarDateRangeChange = new EventEmitter<SkyDatepickerCalendarChange>();\n\n public calendarId: string;\n\n public customDates: SkyDatepickerCustomDate[] | undefined;\n\n public dateChange = new EventEmitter<Date>();\n\n public isDaypickerWaiting = false;\n\n public isOpen = false;\n\n public isVisible = false;\n\n public maxDate: Date;\n\n public minDate: Date;\n\n public startingDay: number;\n\n public triggerButtonId: string;\n\n @ViewChild(SkyDatepickerCalendarComponent)\n private calendar: SkyDatepickerCalendarComponent;\n\n @ViewChild('calendarRef', {\n read: ElementRef,\n })\n private set calendarRef(value: ElementRef) {\n if (value) {\n this._calendarRef = value;\n\n // Wait for the calendar component to render before gauging dimensions.\n setTimeout(() => {\n this.calendar.writeValue(this._selectedDate);\n\n this.destroyAffixer();\n this.createAffixer();\n\n setTimeout(() => {\n this.coreAdapter.getFocusableChildrenAndApplyFocus(\n this.calendarRef,\n '.sky-datepicker-calendar-inner',\n false\n );\n\n this.isVisible = true;\n this.changeDetector.markForCheck();\n });\n });\n }\n }\n\n private get calendarRef(): ElementRef {\n return this._calendarRef;\n }\n\n @ViewChild('calendarTemplateRef', {\n read: TemplateRef,\n })\n private calendarTemplateRef: TemplateRef<any>;\n\n @ViewChild('triggerButtonRef', {\n read: ElementRef,\n })\n private triggerButtonRef: ElementRef;\n\n @ViewChild('inputTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private inputTemplateRef: TemplateRef<any>;\n\n @ViewChild('triggerButtonTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private triggerButtonTemplateRef: TemplateRef<any>;\n\n private affixer: SkyAffixer;\n\n private calendarUnsubscribe: Subject<void>;\n\n private customDatesSubscription: Subscription;\n\n private ngUnsubscribe = new Subject();\n\n private overlay: SkyOverlayInstance;\n\n private overlayKeydownListner: Subscription;\n\n private _calendarRef: ElementRef;\n\n private _disabled = false;\n\n private _selectedDate: Date;\n\n constructor(\n private affixService: SkyAffixService,\n private changeDetector: ChangeDetectorRef,\n private coreAdapter: SkyCoreAdapterService,\n private overlayService: SkyOverlayService,\n @Optional() public inputBoxHostService?: SkyInputBoxHostService,\n @Optional() themeSvc?: SkyThemeService\n ) {\n const uniqueId = nextId++;\n this.calendarId = `sky-datepicker-calendar-${uniqueId}`;\n this.triggerButtonId = `sky-datepicker-button-${uniqueId}`;\n\n // Update icons when theme changes.\n themeSvc?.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnInit(): void {\n if (this.inputBoxHostService) {\n this.inputBoxHostService.populate({\n inputTemplate: this.inputTemplateRef,\n buttonsTemplate: this.triggerButtonTemplateRef,\n });\n }\n }\n\n public ngOnDestroy(): void {\n this.dateChange.complete();\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.removePickerEventListeners();\n this.destroyAffixer();\n this.destroyOverlay();\n }\n\n public onCalendarModeChange(): void {\n // Let the calendar populate in the DOM before recalculating placement.\n setTimeout(() => {\n this.affixer.reaffix();\n });\n }\n\n public onSelectedDateChange(value: Date): void {\n this.dateChange.emit(value);\n this.closePicker();\n }\n\n public onTriggerButtonClick(): void {\n if (this.isOpen) {\n this.closePicker();\n } else {\n this.openPicker();\n }\n }\n\n public onCalendarDateRangeChange(event: SkyDatepickerCalendarChange): void {\n /* istanbul ignore else */\n if (event) {\n this.cancelCustomDatesSubscription();\n\n const args: SkyDatepickerCalendarChange = {\n startDate: event.startDate,\n endDate: event.endDate,\n customDates: undefined,\n };\n this.calendarDateRangeChange.emit(args);\n // If consumer has added an observable to the args, watch for incoming custom dates.\n /* istanbul ignore else */\n if (args.customDates) {\n this.isDaypickerWaiting = true;\n // Avoid an ExpressionChangedAfterItHasBeenCheckedError.\n this.changeDetector.detectChanges();\n\n this.customDatesSubscription = args.customDates\n .pipe(debounceTime(250))\n .subscribe((result) => {\n this.customDates = result;\n this.isDaypickerWaiting = false;\n\n // Trigger change detection in child components to show changes in the calendar.\n this.changeDetector.markForCheck();\n });\n } else {\n // If consumer returns an undefined value after custom dates have\n // already ben established, remove custom dates.\n if (this.customDates) {\n this.customDates = undefined;\n // Avoid an ExpressionChangedAfterItHasBeenCheckedError.\n this.changeDetector.detectChanges();\n }\n }\n }\n }\n\n private closePicker() {\n this.destroyAffixer();\n this.destroyOverlay();\n this.removePickerEventListeners();\n this.triggerButtonRef.nativeElement.focus();\n this.isOpen = false;\n }\n\n private openPicker(): void {\n this.isVisible = false;\n this.changeDetector.markForCheck();\n\n this.removePickerEventListeners();\n this.calendarUnsubscribe = new Subject<void>();\n this.destroyOverlay();\n this.createOverlay();\n\n this.isOpen = true;\n this.changeDetector.markForCheck();\n }\n\n private createAffixer(): void {\n const affixer = this.affixService.createAffixer(this.calendarRef);\n\n // Hide calendar when trigger button is scrolled off screen.\n affixer.placementChange\n .pipe(takeUntil(this.calendarUnsubscribe))\n .subscribe((change) => {\n this.isVisible = change.placement !== null;\n this.changeDetector.markForCheck();\n });\n\n affixer.affixTo(this.triggerButtonRef.nativeElement, {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: 'right',\n isSticky: true,\n placement: 'below',\n });\n\n this.affixer = affixer;\n }\n\n private destroyAffixer(): void {\n /*istanbul ignore else*/\n if (this.affixer) {\n this.affixer.destroy();\n this.affixer = undefined;\n }\n }\n\n private createOverlay(): void {\n const overlay = this.overlayService.create({\n wrapperClass: this.pickerClass,\n enableClose: false,\n enablePointerEvents: false,\n });\n\n overlay.backdropClick\n .pipe(takeUntil(this.calendarUnsubscribe))\n .subscribe(() => {\n /* istanbul ignore else */\n if (this.isOpen) {\n this.closePicker();\n }\n });\n\n this.addKeydownListner();\n\n overlay.attachTemplate(this.calendarTemplateRef);\n\n this.overlay = overlay;\n }\n\n private destroyOverlay(): void {\n /*istanbul ignore else*/\n if (this.overlay) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n }\n }\n\n private addKeydownListner(): void {\n this.overlayKeydownListner = fromEvent(window.document, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key?.toLowerCase();\n if (key === 'escape' && this.isOpen) {\n this.closePicker();\n }\n });\n }\n\n private removePickerEventListeners(): void {\n /* istanbul ignore else */\n if (this.calendarUnsubscribe) {\n this.calendarUnsubscribe.next();\n this.calendarUnsubscribe.complete();\n this.calendarUnsubscribe = undefined;\n }\n this.overlayKeydownListner?.unsubscribe();\n }\n\n private cancelCustomDatesSubscription(): void {\n if (this.customDatesSubscription) {\n this.customDatesSubscription.unsubscribe();\n this.customDatesSubscription = undefined;\n }\n }\n}\n","<div class=\"sky-datepicker\">\n <ng-container *ngIf=\"!inputBoxHostService\">\n <div class=\"sky-input-group\">\n <ng-container *ngTemplateOutlet=\"inputTemplateRef\"></ng-container>\n <ng-container *ngTemplateOutlet=\"triggerButtonTemplateRef\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n<ng-template #inputTemplateRef>\n <ng-content></ng-content>\n</ng-template>\n\n<ng-template #triggerButtonTemplateRef>\n <div class=\"sky-input-group-btn\">\n <button\n aria-haspopup=\"dialog\"\n class=\"sky-btn sky-btn-default sky-input-group-datepicker-btn\"\n type=\"button\"\n [attr.aria-controls]=\"isOpen ? calendarId : null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-label]=\"\n 'skyux_datepicker_trigger_button_label' | skyLibResources\n \"\n [attr.id]=\"triggerButtonId\"\n [attr.title]=\"'skyux_datepicker_trigger_button_label' | skyLibResources\"\n [disabled]=\"disabled\"\n (click)=\"onTriggerButtonClick()\"\n #triggerButtonRef\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"calendar\" size=\"lg\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"calendar\"\n size=\"lg\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #calendarTemplateRef>\n <div\n class=\"sky-datepicker-calendar-container sky-shadow sky-elevation-4\"\n role=\"dialog\"\n [attr.aria-labelledby]=\"triggerButtonId\"\n [attr.id]=\"calendarId\"\n [class.sky-datepicker-hidden]=\"!isVisible\"\n #calendarRef\n >\n <sky-datepicker-calendar\n [customDates]=\"customDates\"\n [isDaypickerWaiting]=\"isDaypickerWaiting\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [startingDay]=\"startingDay\"\n (calendarDateRangeChange)=\"onCalendarDateRangeChange($event)\"\n (calendarModeChange)=\"onCalendarModeChange()\"\n (selectedDateChange)=\"onSelectedDateChange($event)\"\n >\n </sky-datepicker-calendar>\n </div>\n</ng-template>\n"]}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { NgModule } from '@angular/core';
|
|
3
|
-
import { FormsModule } from '@angular/forms';
|
|
4
|
-
import { SkyAffixModule, SkyOverlayModule } from '@skyux/core';
|
|
5
|
-
import { SkyI18nModule } from '@skyux/i18n';
|
|
6
|
-
import { SkyIconModule, SkyWaitModule } from '@skyux/indicators';
|
|
7
|
-
import { SkyPopoverModule } from '@skyux/popovers';
|
|
8
|
-
import { SkyThemeModule } from '@skyux/theme';
|
|
9
|
-
import { SkyDatetimeResourcesModule } from '../shared/sky-datetime-resources.module';
|
|
10
|
-
import { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';
|
|
11
|
-
import { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';
|
|
12
|
-
import { SkyFuzzyDatepickerInputDirective } from './datepicker-input-fuzzy.directive';
|
|
13
|
-
import { SkyDatepickerInputDirective } from './datepicker-input.directive';
|
|
14
|
-
import { SkyDatepickerComponent } from './datepicker.component';
|
|
15
|
-
import { SkyDatepickerService } from './datepicker.service';
|
|
16
|
-
import { SkyDayPickerButtonComponent } from './daypicker-button.component';
|
|
17
|
-
import { SkyDayPickerCellComponent } from './daypicker-cell.component';
|
|
18
|
-
import { SkyDayPickerComponent } from './daypicker.component';
|
|
19
|
-
import { SkyMonthPickerComponent } from './monthpicker.component';
|
|
20
|
-
import { SkyYearPickerComponent } from './yearpicker.component';
|
|
21
|
-
import * as i0 from "@angular/core";
|
|
22
|
-
export class SkyDatepickerModule {
|
|
23
|
-
}
|
|
24
|
-
SkyDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
25
|
-
SkyDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDatepickerModule, declarations: [SkyDatepickerCalendarComponent,
|
|
26
|
-
SkyDatepickerCalendarInnerComponent,
|
|
27
|
-
SkyDayPickerComponent,
|
|
28
|
-
SkyMonthPickerComponent,
|
|
29
|
-
SkyYearPickerComponent,
|
|
30
|
-
SkyDatepickerComponent,
|
|
31
|
-
SkyDatepickerInputDirective,
|
|
32
|
-
SkyFuzzyDatepickerInputDirective,
|
|
33
|
-
SkyDayPickerCellComponent,
|
|
34
|
-
SkyDayPickerButtonComponent], imports: [CommonModule,
|
|
35
|
-
SkyI18nModule,
|
|
36
|
-
FormsModule,
|
|
37
|
-
SkyIconModule,
|
|
38
|
-
SkyDatetimeResourcesModule,
|
|
39
|
-
SkyAffixModule,
|
|
40
|
-
SkyOverlayModule,
|
|
41
|
-
SkyThemeModule,
|
|
42
|
-
SkyPopoverModule,
|
|
43
|
-
SkyWaitModule], exports: [SkyDatepickerCalendarComponent,
|
|
44
|
-
SkyDatepickerComponent,
|
|
45
|
-
SkyDatepickerInputDirective,
|
|
46
|
-
SkyFuzzyDatepickerInputDirective] });
|
|
47
|
-
SkyDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDatepickerModule, providers: [SkyDatepickerService], imports: [[
|
|
48
|
-
CommonModule,
|
|
49
|
-
SkyI18nModule,
|
|
50
|
-
FormsModule,
|
|
51
|
-
SkyIconModule,
|
|
52
|
-
SkyDatetimeResourcesModule,
|
|
53
|
-
SkyAffixModule,
|
|
54
|
-
SkyOverlayModule,
|
|
55
|
-
SkyThemeModule,
|
|
56
|
-
SkyPopoverModule,
|
|
57
|
-
SkyWaitModule,
|
|
58
|
-
]] });
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDatepickerModule, decorators: [{
|
|
60
|
-
type: NgModule,
|
|
61
|
-
args: [{
|
|
62
|
-
declarations: [
|
|
63
|
-
SkyDatepickerCalendarComponent,
|
|
64
|
-
SkyDatepickerCalendarInnerComponent,
|
|
65
|
-
SkyDayPickerComponent,
|
|
66
|
-
SkyMonthPickerComponent,
|
|
67
|
-
SkyYearPickerComponent,
|
|
68
|
-
SkyDatepickerComponent,
|
|
69
|
-
SkyDatepickerInputDirective,
|
|
70
|
-
SkyFuzzyDatepickerInputDirective,
|
|
71
|
-
SkyDayPickerCellComponent,
|
|
72
|
-
SkyDayPickerButtonComponent,
|
|
73
|
-
],
|
|
74
|
-
imports: [
|
|
75
|
-
CommonModule,
|
|
76
|
-
SkyI18nModule,
|
|
77
|
-
FormsModule,
|
|
78
|
-
SkyIconModule,
|
|
79
|
-
SkyDatetimeResourcesModule,
|
|
80
|
-
SkyAffixModule,
|
|
81
|
-
SkyOverlayModule,
|
|
82
|
-
SkyThemeModule,
|
|
83
|
-
SkyPopoverModule,
|
|
84
|
-
SkyWaitModule,
|
|
85
|
-
],
|
|
86
|
-
exports: [
|
|
87
|
-
SkyDatepickerCalendarComponent,
|
|
88
|
-
SkyDatepickerComponent,
|
|
89
|
-
SkyDatepickerInputDirective,
|
|
90
|
-
SkyFuzzyDatepickerInputDirective,
|
|
91
|
-
],
|
|
92
|
-
providers: [SkyDatepickerService],
|
|
93
|
-
}]
|
|
94
|
-
}] });
|
|
95
|
-
//# sourceMappingURL=datepicker.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,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B,CAAC;iBAClC","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyAffixModule, SkyOverlayModule } from '@skyux/core';\nimport { SkyI18nModule } from '@skyux/i18n';\nimport { SkyIconModule, SkyWaitModule } from '@skyux/indicators';\nimport { SkyPopoverModule } from '@skyux/popovers';\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyDatetimeResourcesModule } from '../shared/sky-datetime-resources.module';\n\nimport { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';\nimport { SkyDatepickerCalendarComponent } from './datepicker-calendar.component';\nimport { SkyFuzzyDatepickerInputDirective } from './datepicker-input-fuzzy.directive';\nimport { SkyDatepickerInputDirective } from './datepicker-input.directive';\nimport { SkyDatepickerComponent } from './datepicker.component';\nimport { SkyDatepickerService } from './datepicker.service';\nimport { SkyDayPickerButtonComponent } from './daypicker-button.component';\nimport { SkyDayPickerCellComponent } from './daypicker-cell.component';\nimport { SkyDayPickerComponent } from './daypicker.component';\nimport { SkyMonthPickerComponent } from './monthpicker.component';\nimport { SkyYearPickerComponent } from './yearpicker.component';\n\n@NgModule({\n declarations: [\n SkyDatepickerCalendarComponent,\n SkyDatepickerCalendarInnerComponent,\n SkyDayPickerComponent,\n SkyMonthPickerComponent,\n SkyYearPickerComponent,\n SkyDatepickerComponent,\n SkyDatepickerInputDirective,\n SkyFuzzyDatepickerInputDirective,\n SkyDayPickerCellComponent,\n SkyDayPickerButtonComponent,\n ],\n imports: [\n CommonModule,\n SkyI18nModule,\n FormsModule,\n SkyIconModule,\n SkyDatetimeResourcesModule,\n SkyAffixModule,\n SkyOverlayModule,\n SkyThemeModule,\n SkyPopoverModule,\n SkyWaitModule,\n ],\n exports: [\n SkyDatepickerCalendarComponent,\n SkyDatepickerComponent,\n SkyDatepickerInputDirective,\n SkyFuzzyDatepickerInputDirective,\n ],\n providers: [SkyDatepickerService],\n})\nexport class SkyDatepickerModule {}\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { Subject } from 'rxjs';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export class SkyDatepickerService {
|
|
8
|
-
constructor() {
|
|
9
|
-
/**
|
|
10
|
-
* Specifies if a key date popover is currently displayed.
|
|
11
|
-
* Useful for communicating across all daypicker siblings when a popover is displayed.
|
|
12
|
-
*/
|
|
13
|
-
this.keyDatePopoverStream = new Subject();
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
SkyDatepickerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDatepickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
17
|
-
SkyDatepickerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDatepickerService });
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDatepickerService, decorators: [{
|
|
19
|
-
type: Injectable
|
|
20
|
-
}] });
|
|
21
|
-
//# sourceMappingURL=datepicker.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/datepicker.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;;AAI/B;;GAEG;AAEH,MAAM,OAAO,oBAAoB;IADjC;QAEE;;;WAGG;QACI,yBAAoB,GACzB,IAAI,OAAO,EAAqB,CAAC;KACpC;;kHAPY,oBAAoB;sHAApB,oBAAoB;4FAApB,oBAAoB;kBADhC,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Subject } from 'rxjs';\n\nimport { SkyDatepickerDate } from './datepicker-date';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyDatepickerService {\n /**\n * Specifies if a key date popover is currently displayed.\n * Useful for communicating across all daypicker siblings when a popover is displayed.\n */\n public keyDatePopoverStream: Subject<SkyDatepickerDate> =\n new Subject<SkyDatepickerDate>();\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "./datepicker-calendar-inner.component";
|
|
5
|
-
import * as i2 from "@angular/common";
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export class SkyDayPickerButtonComponent {
|
|
10
|
-
constructor(datepicker) {
|
|
11
|
-
this.datepicker = datepicker;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
SkyDayPickerButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDayPickerButtonComponent, deps: [{ token: i1.SkyDatepickerCalendarInnerComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
15
|
-
SkyDayPickerButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyDayPickerButtonComponent, selector: "sky-daypicker-button", inputs: { date: "date" }, ngImport: i0, template: "<button\n class=\"sky-btn sky-btn-sm sky-btn-default sky-datepicker-btn-date\"\n tabindex=\"-1\"\n type=\"button\"\n [disabled]=\"date.disabled\"\n [ngClass]=\"{\n 'sky-datepicker-btn-selected': date.selected,\n 'sky-btn-disabled': date.disabled,\n 'sky-btn-active': datepicker.isActive(date),\n 'sky-datepicker-btn-disabled': date.disabled,\n 'sky-datepicker-btn-key-date': date.keyDate\n }\"\n (click)=\"datepicker.selectCalendar($event, date.date, true)\"\n>\n <span [ngClass]=\"{ 'sky-datepicker-secondary': date.secondary }\">\n {{ date.label }}\n </span>\n</button>\n", styles: [".sky-datepicker-btn-disabled{font-style:italic}.sky-datepicker-btn-key-date{position:relative}.sky-datepicker-btn-key-date:before{position:absolute;content:\"\";height:5px;width:5px;background-color:#d93a3d;border-radius:50%;left:15px;top:22px}:host-context(.sky-theme-modern) .sky-datepicker-btn-key-date:before{left:12px}.sky-theme-modern .sky-datepicker-btn-key-date:before{left:12px}\n"], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
16
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDayPickerButtonComponent, decorators: [{
|
|
17
|
-
type: Component,
|
|
18
|
-
args: [{
|
|
19
|
-
selector: 'sky-daypicker-button',
|
|
20
|
-
templateUrl: 'daypicker-button.component.html',
|
|
21
|
-
styleUrls: ['./daypicker-button.component.scss'],
|
|
22
|
-
}]
|
|
23
|
-
}], ctorParameters: function () { return [{ type: i1.SkyDatepickerCalendarInnerComponent }]; }, propDecorators: { date: [{
|
|
24
|
-
type: Input
|
|
25
|
-
}] } });
|
|
26
|
-
//# sourceMappingURL=daypicker-button.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"daypicker-button.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/daypicker-button.component.ts","../../../../../../../../libs/components/datetime/src/lib/modules/datepicker/daypicker-button.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;;;;AAG5F;;GAEG;AAMH,MAAM,OAAO,2BAA2B;IAOtC,YAAmB,UAA+C;QAA/C,eAAU,GAAV,UAAU,CAAqC;IAAG,CAAC;;yHAP3D,2BAA2B;6GAA3B,2BAA2B,sFCbxC,0lBAkBA;4FDLa,2BAA2B;kBALvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,WAAW,EAAE,iCAAiC;oBAC9C,SAAS,EAAE,CAAC,mCAAmC,CAAC;iBACjD;0HAMQ,IAAI;sBADV,KAAK","sourcesContent":["import { Component, Input } from '@angular/core';\n\nimport { SkyDatepickerCalendarInnerComponent } from './datepicker-calendar-inner.component';\nimport { SkyDatepickerDate } from './datepicker-date';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-daypicker-button',\n templateUrl: 'daypicker-button.component.html',\n styleUrls: ['./daypicker-button.component.scss'],\n})\nexport class SkyDayPickerButtonComponent {\n /**\n * Specifies the date this picker button will represent on the calendar.\n */\n @Input()\n public date: SkyDatepickerDate;\n\n constructor(public datepicker: SkyDatepickerCalendarInnerComponent) {}\n}\n","<button\n class=\"sky-btn sky-btn-sm sky-btn-default sky-datepicker-btn-date\"\n tabindex=\"-1\"\n type=\"button\"\n [disabled]=\"date.disabled\"\n [ngClass]=\"{\n 'sky-datepicker-btn-selected': date.selected,\n 'sky-btn-disabled': date.disabled,\n 'sky-btn-active': datepicker.isActive(date),\n 'sky-datepicker-btn-disabled': date.disabled,\n 'sky-datepicker-btn-key-date': date.keyDate\n }\"\n (click)=\"datepicker.selectCalendar($event, date.date, true)\"\n>\n <span [ngClass]=\"{ 'sky-datepicker-secondary': date.secondary }\">\n {{ date.label }}\n </span>\n</button>\n"]}
|