@dereekb/dbx-form 9.17.3 → 9.18.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/calendar/README.md +6 -0
- package/calendar/index.d.ts +1 -0
- package/calendar/lib/calendar.module.d.ts +29 -0
- package/calendar/lib/calendar.schedule.selection.cell.component.d.ts +14 -0
- package/calendar/lib/calendar.schedule.selection.component.d.ts +27 -0
- package/calendar/lib/calendar.schedule.selection.d.ts +29 -0
- package/calendar/lib/calendar.schedule.selection.days.component.d.ts +17 -0
- package/calendar/lib/calendar.schedule.selection.days.form.component.d.ts +10 -0
- package/calendar/lib/calendar.schedule.selection.dialog.button.component.d.ts +12 -0
- package/calendar/lib/calendar.schedule.selection.dialog.component.d.ts +12 -0
- package/calendar/lib/calendar.schedule.selection.form.d.ts +4 -0
- package/calendar/lib/calendar.schedule.selection.popover.button.component.d.ts +15 -0
- package/calendar/lib/calendar.schedule.selection.popover.component.d.ts +14 -0
- package/calendar/lib/calendar.schedule.selection.popover.content.component.d.ts +7 -0
- package/calendar/lib/calendar.schedule.selection.range.component.d.ts +37 -0
- package/calendar/lib/calendar.schedule.selection.store.d.ts +142 -0
- package/calendar/lib/calendar.schedule.selection.store.provide.d.ts +24 -0
- package/calendar/lib/field/index.d.ts +1 -0
- package/calendar/lib/field/schedule/calendar.schedule.field.component.d.ts +40 -0
- package/calendar/lib/field/schedule/calendar.schedule.field.d.ts +6 -0
- package/calendar/lib/field/schedule/calendar.schedule.module.d.ts +15 -0
- package/calendar/lib/field/schedule/index.d.ts +3 -0
- package/calendar/lib/index.d.ts +16 -0
- package/esm2020/calendar/dereekb-dbx-form-calendar.mjs +5 -0
- package/esm2020/calendar/index.mjs +2 -0
- package/esm2020/calendar/lib/calendar.module.mjs +138 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.cell.component.mjs +46 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.component.mjs +72 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.days.component.mjs +45 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.days.form.component.mjs +26 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.dialog.button.component.mjs +32 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.dialog.component.mjs +35 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.form.mjs +15 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.mjs +30 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.popover.button.component.mjs +45 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.popover.component.mjs +37 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.popover.content.component.mjs +27 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.range.component.mjs +99 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.store.mjs +294 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.store.provide.mjs +52 -0
- package/esm2020/calendar/lib/field/index.mjs +3 -0
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.component.mjs +95 -0
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.mjs +16 -0
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.module.mjs +54 -0
- package/esm2020/calendar/lib/field/schedule/index.mjs +4 -0
- package/esm2020/calendar/lib/index.mjs +17 -0
- package/esm2020/lib/form/action/form.action.directive.mjs +4 -4
- package/esm2020/lib/form/action/form.action.module.mjs +5 -5
- package/esm2020/lib/form/action/transition/form.action.transition.module.mjs +5 -5
- package/esm2020/lib/form/action/transition/form.action.transition.safety.directive.mjs +4 -4
- package/esm2020/lib/form/form.module.mjs +5 -5
- package/esm2020/lib/form/io/form.changes.directive.mjs +4 -4
- package/esm2020/lib/form/io/form.input.directive.mjs +4 -4
- package/esm2020/lib/form/io/form.io.module.mjs +5 -5
- package/esm2020/lib/form/io/form.loading.directive.mjs +4 -4
- package/esm2020/lib/form.module.mjs +5 -5
- package/esm2020/lib/formly/field/checklist/checklist.item.field.component.mjs +7 -7
- package/esm2020/lib/formly/field/checklist/checklist.item.field.content.default.component.mjs +4 -4
- package/esm2020/lib/formly/field/checklist/checklist.item.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/component/component.field.component.mjs +4 -4
- package/esm2020/lib/formly/field/component/component.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/form.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/selection/list/list.field.component.mjs +4 -4
- package/esm2020/lib/formly/field/selection/list/list.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/selection/pickable/pickable.chip.field.component.mjs +4 -4
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.directive.mjs +4 -4
- package/esm2020/lib/formly/field/selection/pickable/pickable.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/selection/pickable/pickable.list.field.component.mjs +13 -13
- package/esm2020/lib/formly/field/selection/searchable/searchable.chip.field.component.mjs +4 -4
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.autocomplete.item.component.mjs +10 -10
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.directive.mjs +4 -4
- package/esm2020/lib/formly/field/selection/searchable/searchable.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/selection/searchable/searchable.text.field.component.mjs +4 -4
- package/esm2020/lib/formly/field/selection/selection.module.mjs +5 -5
- package/esm2020/lib/formly/field/texteditor/texteditor.field.component.mjs +4 -4
- package/esm2020/lib/formly/field/texteditor/texteditor.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/value/array/array.field.component.mjs +14 -6
- package/esm2020/lib/formly/field/value/array/array.field.mjs +3 -2
- package/esm2020/lib/formly/field/value/array/array.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/value/boolean/boolean.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/value/date/date.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/value/date/datetime.field.component.mjs +19 -9
- package/esm2020/lib/formly/field/value/number/number.field.mjs +4 -1
- package/esm2020/lib/formly/field/value/number/number.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/value/phone/phone.field.component.mjs +4 -4
- package/esm2020/lib/formly/field/value/phone/phone.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/value/text/text.field.module.mjs +5 -5
- package/esm2020/lib/formly/field/value/value.module.mjs +5 -5
- package/esm2020/lib/formly/field/wrapper/autotouch.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/expandable.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/expandable.wrapper.delegate.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/flex.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/form.wrapper.module.mjs +5 -5
- package/esm2020/lib/formly/field/wrapper/info.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/section.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/style.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/subsection.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/toggle.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/field/wrapper/working.wrapper.component.mjs +4 -4
- package/esm2020/lib/formly/formly.context.directive.mjs +4 -4
- package/esm2020/lib/formly/formly.directive.mjs +13 -13
- package/esm2020/lib/formly/formly.form.component.mjs +4 -4
- package/esm2020/lib/formly/formly.module.mjs +5 -5
- package/esm2020/lib/layout/form.layout.module.mjs +5 -5
- package/esm2020/lib/layout/form.spacer.component.mjs +4 -4
- package/esm2020/mapbox/lib/field/latlng/latlng.field.component.mjs +4 -4
- package/esm2020/mapbox/lib/field/latlng/latlng.module.mjs +5 -5
- package/esm2020/mapbox/lib/field/zoom/zoom.field.component.mjs +4 -4
- package/esm2020/mapbox/lib/field/zoom/zoom.module.mjs +5 -5
- package/esm2020/mapbox/lib/mapbox.module.mjs +5 -5
- package/fesm2015/dereekb-dbx-form-calendar.mjs +1063 -0
- package/fesm2015/dereekb-dbx-form-calendar.mjs.map +1 -0
- package/fesm2015/dereekb-dbx-form-mapbox.mjs +18 -18
- package/fesm2015/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/fesm2015/dereekb-dbx-form.mjs +252 -230
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form-calendar.mjs +1055 -0
- package/fesm2020/dereekb-dbx-form-calendar.mjs.map +1 -0
- package/fesm2020/dereekb-dbx-form-mapbox.mjs +18 -18
- package/fesm2020/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +252 -230
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/extension/_extension.scss +38 -0
- package/lib/extension/calendar/_calendar.scss +89 -0
- package/lib/formly/field/value/array/array.field.component.d.ts +9 -2
- package/lib/formly/field/value/array/array.field.d.ts +1 -0
- package/lib/formly/field/value/date/datetime.field.component.d.ts +9 -7
- package/lib/formly/field/value/number/number.field.d.ts +4 -0
- package/lib/style/_all-core.scss +3 -1
- package/lib/style/_all-theme.scss +2 -0
- package/lib/style/_all-typography.scss +3 -1
- package/lib/style/_config.scss +16 -0
- package/lib/style/_core.scss +2 -2
- package/mapbox/esm2020/lib/field/latlng/latlng.field.component.mjs +4 -4
- package/mapbox/esm2020/lib/field/latlng/latlng.module.mjs +5 -5
- package/mapbox/esm2020/lib/field/zoom/zoom.field.component.mjs +4 -4
- package/mapbox/esm2020/lib/field/zoom/zoom.module.mjs +5 -5
- package/mapbox/esm2020/lib/mapbox.module.mjs +5 -5
- package/mapbox/fesm2015/dereekb-dbx-form-mapbox.mjs +18 -18
- package/mapbox/fesm2015/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/mapbox/fesm2020/dereekb-dbx-form-mapbox.mjs +18 -18
- package/mapbox/fesm2020/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/mapbox/package.json +7 -7
- package/package.json +16 -8
|
@@ -0,0 +1,1063 @@
|
|
|
1
|
+
import * as i4 from '@dereekb/dbx-form';
|
|
2
|
+
import { formlyField, propsAndConfigForFieldConfig, flexLayoutWrapper, toggleField, AbstractSyncFormlyFormDirective, provideFormlyContext, DbxFormModule, DbxFormlyModule } from '@dereekb/dbx-form';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Injectable, SkipSelf, Directive, Injector, Optional, Component, Input, ElementRef, ViewChild, ChangeDetectionStrategy, EventEmitter, Output, NgModule } from '@angular/core';
|
|
5
|
+
import { FieldType } from '@ngx-formly/material';
|
|
6
|
+
import { map, distinctUntilChanged, shareReplay, BehaviorSubject, of, startWith, filter, first, throttleTime as throttleTime$1, switchMap as switchMap$1 } from 'rxjs';
|
|
7
|
+
import { filterMaybe, SubscriptionObject, asObservable } from '@dereekb/rxjs';
|
|
8
|
+
import { DateScheduleDayCode, expandDateScheduleDayCodesToDayOfWeekSet, dateTimingRelativeIndexFactory, dateBlockDayOfWeekFactory, isSameDate, isSameDateRange, isSameDateScheduleRange, findMaxDate, isSameDateDay, findMinDate, dateScheduleDateFilter, dateScheduleDayCodes, isDateInDateRangeFunction, isDateWithinDateBlockRangeFunction, dateScheduleEncodedWeek, dateBlockTimingDateFactory, enabledDaysFromDateScheduleDayCodes, dateScheduleDayCodesFromEnabledDays, formatToMonthDayString } from '@dereekb/date';
|
|
9
|
+
import { setsAreEquivalent, iterableToArray, toggleInSet, addToSet, isIndexNumberInIndexRangeFunction, range, minAndMaxNumber, randomNumberFactory, getDaysOfWeekNames } from '@dereekb/util';
|
|
10
|
+
import { ComponentStore } from '@ngrx/component-store';
|
|
11
|
+
import { startOfDay, startOfYear, addYears } from 'date-fns';
|
|
12
|
+
import * as i1$1 from '@dereekb/dbx-web';
|
|
13
|
+
import { AbstractPopoverDirective, AbstractDialogDirective, DbxActionModule, DbxButtonModule, DbxDialogInteractionModule, DbxPopoverInteractionModule, DbxTextModule } from '@dereekb/dbx-web';
|
|
14
|
+
import { switchMap, throttleTime } from 'rxjs/operators';
|
|
15
|
+
import * as i3 from '@angular/forms';
|
|
16
|
+
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
17
|
+
import * as i1 from '@dereekb/dbx-web/calendar';
|
|
18
|
+
import { prepareAndSortCalendarEvents, DbxCalendarStore, DbxCalendarModule } from '@dereekb/dbx-web/calendar';
|
|
19
|
+
import * as i3$1 from '@angular/common';
|
|
20
|
+
import { CommonModule } from '@angular/common';
|
|
21
|
+
import * as i5 from '@angular/material/form-field';
|
|
22
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
23
|
+
import * as i7 from '@angular/material/datepicker';
|
|
24
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
25
|
+
import * as i4$1 from 'angular-calendar';
|
|
26
|
+
import { CalendarModule, CalendarDayModule, CalendarWeekModule } from 'angular-calendar';
|
|
27
|
+
import * as i3$2 from '@dereekb/dbx-core';
|
|
28
|
+
import * as i3$3 from '@angular/material/icon';
|
|
29
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
30
|
+
import * as i1$2 from '@angular/material/dialog';
|
|
31
|
+
import * as i2 from '@angular/material/button';
|
|
32
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
33
|
+
import * as i1$3 from '@ngx-formly/core';
|
|
34
|
+
import { FormlyModule } from '@ngx-formly/core';
|
|
35
|
+
import { MatInputModule } from '@angular/material/input';
|
|
36
|
+
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
37
|
+
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
38
|
+
|
|
39
|
+
function dateScheduleRangeField(config = {}) {
|
|
40
|
+
var _a;
|
|
41
|
+
const { key = 'schedule', filter } = config;
|
|
42
|
+
const fieldConfig = Object.assign({}, formlyField(Object.assign({ key, type: 'date-schedule-range' }, propsAndConfigForFieldConfig(config, {
|
|
43
|
+
label: (_a = config.label) !== null && _a !== void 0 ? _a : 'Schedule',
|
|
44
|
+
filter
|
|
45
|
+
}))));
|
|
46
|
+
return fieldConfig;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var CalendarScheduleSelectionDayState;
|
|
50
|
+
(function (CalendarScheduleSelectionDayState) {
|
|
51
|
+
CalendarScheduleSelectionDayState[CalendarScheduleSelectionDayState["NOT_APPLICABLE"] = 0] = "NOT_APPLICABLE";
|
|
52
|
+
CalendarScheduleSelectionDayState[CalendarScheduleSelectionDayState["DISABLED"] = 1] = "DISABLED";
|
|
53
|
+
CalendarScheduleSelectionDayState[CalendarScheduleSelectionDayState["NOT_SELECTED"] = 2] = "NOT_SELECTED";
|
|
54
|
+
CalendarScheduleSelectionDayState[CalendarScheduleSelectionDayState["SELECTED"] = 3] = "SELECTED";
|
|
55
|
+
})(CalendarScheduleSelectionDayState || (CalendarScheduleSelectionDayState = {}));
|
|
56
|
+
const defaultCalendarScheduleSelectionCellContentFactory = (day) => {
|
|
57
|
+
var _a;
|
|
58
|
+
let icon;
|
|
59
|
+
let text;
|
|
60
|
+
switch ((_a = day.meta) === null || _a === void 0 ? void 0 : _a.state) {
|
|
61
|
+
case CalendarScheduleSelectionDayState.SELECTED:
|
|
62
|
+
icon = 'check_box';
|
|
63
|
+
break;
|
|
64
|
+
case CalendarScheduleSelectionDayState.DISABLED:
|
|
65
|
+
icon = 'block';
|
|
66
|
+
break;
|
|
67
|
+
case CalendarScheduleSelectionDayState.NOT_APPLICABLE:
|
|
68
|
+
break;
|
|
69
|
+
case CalendarScheduleSelectionDayState.NOT_SELECTED:
|
|
70
|
+
icon = 'check_box_outline_blank';
|
|
71
|
+
text = 'Add';
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
icon,
|
|
76
|
+
text
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
function initialCalendarScheduleSelectionState() {
|
|
81
|
+
const start = startOfDay(new Date());
|
|
82
|
+
const scheduleDays = new Set([DateScheduleDayCode.WEEKDAY, DateScheduleDayCode.WEEKEND]);
|
|
83
|
+
const allowedDaysOfWeek = expandDateScheduleDayCodesToDayOfWeekSet(Array.from(scheduleDays));
|
|
84
|
+
const indexFactory = dateTimingRelativeIndexFactory({ start });
|
|
85
|
+
const indexDayOfWeek = dateBlockDayOfWeekFactory(start);
|
|
86
|
+
return {
|
|
87
|
+
start,
|
|
88
|
+
indexFactory,
|
|
89
|
+
selectedIndexes: new Set(),
|
|
90
|
+
scheduleDays,
|
|
91
|
+
allowedDaysOfWeek,
|
|
92
|
+
indexDayOfWeek,
|
|
93
|
+
isEnabledFilterDay: () => true,
|
|
94
|
+
isEnabledDay: () => false,
|
|
95
|
+
minDate: new Date(0),
|
|
96
|
+
maxDate: startOfYear(addYears(new Date(), 100)),
|
|
97
|
+
cellContentFactory: defaultCalendarScheduleSelectionCellContentFactory
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
class DbxCalendarScheduleSelectionStore extends ComponentStore {
|
|
101
|
+
constructor() {
|
|
102
|
+
super(initialCalendarScheduleSelectionState());
|
|
103
|
+
// MARK: Accessors
|
|
104
|
+
this.filter$ = this.state$.pipe(map((x) => x.filter), distinctUntilChanged(), shareReplay(1));
|
|
105
|
+
this.inputStart$ = this.state$.pipe(map((x) => x.inputStart), distinctUntilChanged(isSameDate), shareReplay(1));
|
|
106
|
+
this.inputEnd$ = this.state$.pipe(map((x) => x.inputEnd), distinctUntilChanged(isSameDate), shareReplay(1));
|
|
107
|
+
this.currentInputRange$ = this.state$.pipe(map(({ inputStart, inputEnd }) => ({ inputStart, inputEnd })), distinctUntilChanged((a, b) => isSameDate(a.inputStart, b.inputStart) && isSameDate(a.inputEnd, b.inputEnd)), map((x) => {
|
|
108
|
+
if (x.inputStart && x.inputEnd) {
|
|
109
|
+
return x;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
}), shareReplay(1));
|
|
115
|
+
this.inputRange$ = this.currentInputRange$.pipe(filterMaybe(), shareReplay(1));
|
|
116
|
+
this.selectedDates$ = this.state$.pipe(map((x) => x.selectedIndexes), distinctUntilChanged(), shareReplay(1));
|
|
117
|
+
this.isEnabledFilterDayFunction$ = this.state$.pipe(map((x) => x.isEnabledFilterDay), shareReplay(1));
|
|
118
|
+
this.isEnabledDayFunction$ = this.state$.pipe(map((x) => x.isEnabledDay), shareReplay(1));
|
|
119
|
+
this.currentDateRange$ = this.state$.pipe(map(computeCalendarScheduleSelectionRange), distinctUntilChanged((a, b) => isSameDateRange(a, b)), shareReplay(1));
|
|
120
|
+
this.dateRange$ = this.currentDateRange$.pipe(filterMaybe(), shareReplay(1));
|
|
121
|
+
this.scheduleDays$ = this.state$.pipe(map((x) => x.scheduleDays), distinctUntilChanged(setsAreEquivalent), shareReplay(1));
|
|
122
|
+
this.currentSelectionValue$ = this.state$.pipe(map((x) => x.currentSelectionValue), shareReplay(1));
|
|
123
|
+
this.selectionValue$ = this.currentSelectionValue$.pipe(filterMaybe(), shareReplay(1));
|
|
124
|
+
this.currentDateScheduleRangeValue$ = this.currentSelectionValue$.pipe(map((x) => x === null || x === void 0 ? void 0 : x.dateScheduleRange), distinctUntilChanged(isSameDateScheduleRange), shareReplay(1));
|
|
125
|
+
this.dateScheduleRangeValue$ = this.currentDateScheduleRangeValue$.pipe(filterMaybe(), shareReplay(1));
|
|
126
|
+
this.minDate$ = this.state$.pipe(map((x) => { var _a; return findMaxDate([(_a = x.filter) === null || _a === void 0 ? void 0 : _a.start, x.minDate]); }), distinctUntilChanged(isSameDateDay), shareReplay(1));
|
|
127
|
+
this.maxDate$ = this.state$.pipe(map((x) => { var _a; return findMinDate([(_a = x.filter) === null || _a === void 0 ? void 0 : _a.end, x.maxDate]); }), distinctUntilChanged(isSameDateDay), shareReplay(1));
|
|
128
|
+
this.cellContentFactory$ = this.state$.pipe(map((x) => x.cellContentFactory), distinctUntilChanged(), shareReplay(1));
|
|
129
|
+
this.isCustomized$ = this.state$.pipe(map((x) => x.selectedIndexes.size > 0), distinctUntilChanged(), shareReplay(1));
|
|
130
|
+
// MARK: State Changes
|
|
131
|
+
this.setFilter = this.updater((state, filter) => updateStateWithFilter(state, filter));
|
|
132
|
+
this.clearFilter = this.updater((state) => updateStateWithFilter(state, undefined));
|
|
133
|
+
this.setTimezone = this.updater((state, timezone) => (Object.assign(Object.assign({}, state), { timezone })));
|
|
134
|
+
this.setInputRange = this.updater((state, range) => updateStateWithChangedRange(state, range));
|
|
135
|
+
this.toggleSelectedDates = this.updater((state, toggle) => updateStateWithChangedDates(state, { toggle }));
|
|
136
|
+
this.addSelectedDates = this.updater((state, add) => updateStateWithChangedDates(state, { add }));
|
|
137
|
+
this.removeSelectedDates = this.updater((state, remove) => updateStateWithChangedDates(state, { remove }));
|
|
138
|
+
this.setSelectedDates = this.updater((state, set) => updateStateWithChangedDates(state, { set }));
|
|
139
|
+
this.setScheduleDays = this.updater((state, scheduleDays) => updateStateWithChangedScheduleDays(state, scheduleDays));
|
|
140
|
+
this.setAllowAllScheduleDays = this.updater((state) => updateStateWithChangedScheduleDays(state, null));
|
|
141
|
+
this.setDateScheduleRangeValue = this.updater((state, value) => updateStateWithDateScheduleRangeValue(state, value));
|
|
142
|
+
this.setCellContentFactory = this.updater((state, cellContentFactory) => (Object.assign(Object.assign({}, state), { cellContentFactory })));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
DbxCalendarScheduleSelectionStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
146
|
+
DbxCalendarScheduleSelectionStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStore });
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStore, decorators: [{
|
|
148
|
+
type: Injectable
|
|
149
|
+
}], ctorParameters: function () { return []; } });
|
|
150
|
+
function updateStateWithFilter(state, filter) {
|
|
151
|
+
let isEnabledFilterDay = () => true;
|
|
152
|
+
if (filter) {
|
|
153
|
+
isEnabledFilterDay = dateScheduleDateFilter(filter);
|
|
154
|
+
}
|
|
155
|
+
return Object.assign(Object.assign({}, state), { filter, isEnabledFilterDay });
|
|
156
|
+
}
|
|
157
|
+
function updateStateWithDateScheduleRangeValue(state, change) {
|
|
158
|
+
var _a;
|
|
159
|
+
const isSameValue = isSameDateScheduleRange((_a = state.currentSelectionValue) === null || _a === void 0 ? void 0 : _a.dateScheduleRange, change);
|
|
160
|
+
if (isSameValue) {
|
|
161
|
+
return state;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
if (change != null) {
|
|
165
|
+
const nextState = Object.assign(Object.assign({}, state), { inputStart: change.start, inputEnd: change.end, selectedIndexes: new Set(change.ex) });
|
|
166
|
+
return updateStateWithChangedScheduleDays(finalizeNewCalendarScheduleSelectionState(nextState), dateScheduleDayCodes(change.w));
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
return noSelectionCalendarScheduleSelectionState(state); // clear selection, retain disabled days
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function updateStateWithChangedScheduleDays(state, change) {
|
|
174
|
+
const { scheduleDays: currentScheduleDays } = state;
|
|
175
|
+
const scheduleDays = new Set(change || [DateScheduleDayCode.WEEKDAY, DateScheduleDayCode.WEEKEND]);
|
|
176
|
+
if (setsAreEquivalent(currentScheduleDays, scheduleDays)) {
|
|
177
|
+
return state; // no change
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
const allowedDaysOfWeek = expandDateScheduleDayCodesToDayOfWeekSet(Array.from(scheduleDays));
|
|
181
|
+
const nextState = Object.assign(Object.assign({}, state), { scheduleDays, allowedDaysOfWeek });
|
|
182
|
+
return finalizeNewCalendarScheduleSelectionState(nextState);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function updateStateWithChangedDates(state, change) {
|
|
186
|
+
const { indexFactory, allowedDaysOfWeek, indexDayOfWeek } = state;
|
|
187
|
+
let selectedIndexes;
|
|
188
|
+
if (change.set) {
|
|
189
|
+
selectedIndexes = new Set(iterableToArray(change.set).map(indexFactory));
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
selectedIndexes = new Set(state.selectedIndexes);
|
|
193
|
+
if (change.toggle) {
|
|
194
|
+
const allowedToToggle = iterableToArray(change.toggle)
|
|
195
|
+
.map(indexFactory)
|
|
196
|
+
.filter((i) => allowedDaysOfWeek.has(indexDayOfWeek(i)));
|
|
197
|
+
toggleInSet(selectedIndexes, allowedToToggle);
|
|
198
|
+
}
|
|
199
|
+
if (change.add) {
|
|
200
|
+
addToSet(selectedIndexes, iterableToArray(change.add).map(indexFactory));
|
|
201
|
+
}
|
|
202
|
+
if (change.remove) {
|
|
203
|
+
addToSet(selectedIndexes, iterableToArray(change.remove).map(indexFactory));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const nextState = Object.assign(Object.assign({}, state), { selectedIndexes });
|
|
207
|
+
nextState.isEnabledDay = isEnabledDayInCalendarScheduleSelectionState(nextState);
|
|
208
|
+
// Recalculate the range and simplified to exclusions
|
|
209
|
+
const rangeAndExclusion = computeScheduleSelectionRangeAndExclusion(nextState);
|
|
210
|
+
if (rangeAndExclusion) {
|
|
211
|
+
return finalizeNewCalendarScheduleSelectionState(Object.assign(Object.assign({}, nextState), { selectedIndexes: new Set(rangeAndExclusion.excluded), inputStart: rangeAndExclusion.start, inputEnd: rangeAndExclusion.end }));
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
// no selected days
|
|
215
|
+
return noSelectionCalendarScheduleSelectionState(state);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function noSelectionCalendarScheduleSelectionState(state) {
|
|
219
|
+
return finalizeNewCalendarScheduleSelectionState(Object.assign(Object.assign({}, state), { selectedIndexes: new Set(), inputStart: null, inputEnd: null }));
|
|
220
|
+
}
|
|
221
|
+
function updateStateWithChangedRange(state, change) {
|
|
222
|
+
const { inputStart: currentInputStart, inputEnd: currentInputEnd, indexFactory, minDate, maxDate } = state;
|
|
223
|
+
const inputStart = startOfDay(change.inputStart);
|
|
224
|
+
const inputEnd = startOfDay(change.inputEnd);
|
|
225
|
+
const isValidRange = minDate != null || maxDate != null ? isDateInDateRangeFunction({ start: minDate !== null && minDate !== void 0 ? minDate : undefined, end: maxDate !== null && maxDate !== void 0 ? maxDate : undefined }) : () => true;
|
|
226
|
+
if (!isValidRange(inputStart) || !isValidRange(inputEnd) || (isSameDateDay(inputStart, currentInputStart) && isSameDateDay(inputEnd, currentInputEnd))) {
|
|
227
|
+
return state; // if no change, return the current state.
|
|
228
|
+
}
|
|
229
|
+
// retain all indexes that are within the new range
|
|
230
|
+
const minIndex = indexFactory(inputStart);
|
|
231
|
+
const maxIndex = indexFactory(inputEnd) + 1;
|
|
232
|
+
const currentIndexes = Array.from(state.selectedIndexes);
|
|
233
|
+
const isInCurrentRange = isIndexNumberInIndexRangeFunction({ minIndex, maxIndex });
|
|
234
|
+
const excludedIndexesInNewRange = currentIndexes.filter(isInCurrentRange);
|
|
235
|
+
const nextState = Object.assign(Object.assign({}, state), { excludedIndexesInNewRange, inputStart, inputEnd });
|
|
236
|
+
return finalizeNewCalendarScheduleSelectionState(nextState);
|
|
237
|
+
}
|
|
238
|
+
function finalizeNewCalendarScheduleSelectionState(nextState) {
|
|
239
|
+
nextState.isEnabledDay = isEnabledDayInCalendarScheduleSelectionState(nextState);
|
|
240
|
+
nextState.currentSelectionValue = computeScheduleSelectionValue(nextState);
|
|
241
|
+
return nextState;
|
|
242
|
+
}
|
|
243
|
+
function isEnabledDayInCalendarScheduleSelectionState(state) {
|
|
244
|
+
const { indexFactory, inputStart, inputEnd, indexDayOfWeek, allowedDaysOfWeek } = state;
|
|
245
|
+
let isInStartAndEndRange;
|
|
246
|
+
if (inputStart && inputEnd) {
|
|
247
|
+
isInStartAndEndRange = isDateWithinDateBlockRangeFunction({ start: state.start, range: { start: inputStart, end: inputEnd } });
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
isInStartAndEndRange = () => false;
|
|
251
|
+
}
|
|
252
|
+
return (input) => {
|
|
253
|
+
const index = indexFactory(input);
|
|
254
|
+
const dayOfWeek = indexDayOfWeek(index);
|
|
255
|
+
const isInSelectedRange = isInStartAndEndRange(input);
|
|
256
|
+
const isSelected = state.selectedIndexes.has(index);
|
|
257
|
+
const isAllowedDayOfWeek = allowedDaysOfWeek.has(dayOfWeek);
|
|
258
|
+
const result = isAllowedDayOfWeek && ((isInSelectedRange && !isSelected) || (isSelected && !isInSelectedRange));
|
|
259
|
+
return result;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function computeScheduleSelectionValue(state) {
|
|
263
|
+
const { scheduleDays, allowedDaysOfWeek, indexDayOfWeek } = state;
|
|
264
|
+
const rangeAndExclusion = computeScheduleSelectionRangeAndExclusion(state);
|
|
265
|
+
if (rangeAndExclusion == null) {
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
const { start, end, excluded, dateBlockRange } = rangeAndExclusion;
|
|
269
|
+
const indexOffset = dateBlockRange.i;
|
|
270
|
+
const ex = excluded
|
|
271
|
+
.filter((x) => {
|
|
272
|
+
const isExcludedIndex = allowedDaysOfWeek.has(indexDayOfWeek(x));
|
|
273
|
+
return isExcludedIndex;
|
|
274
|
+
})
|
|
275
|
+
.map((x) => x - indexOffset); // set to the proper offset
|
|
276
|
+
const w = dateScheduleEncodedWeek(scheduleDays);
|
|
277
|
+
const d = []; // "included" blocks are never used/calculated.
|
|
278
|
+
const dateScheduleRange = {
|
|
279
|
+
start,
|
|
280
|
+
end,
|
|
281
|
+
w,
|
|
282
|
+
d,
|
|
283
|
+
ex
|
|
284
|
+
};
|
|
285
|
+
return {
|
|
286
|
+
dateScheduleRange,
|
|
287
|
+
minMaxRange: { start, end }
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function computeScheduleSelectionRangeAndExclusion(state) {
|
|
291
|
+
const { isEnabledDay } = state;
|
|
292
|
+
const dateFactory = dateBlockTimingDateFactory(state);
|
|
293
|
+
const dateBlockRange = computeCalendarScheduleSelectionDateBlockRange(state);
|
|
294
|
+
if (dateBlockRange == null) {
|
|
295
|
+
return null; // returns null if no items are selected.
|
|
296
|
+
}
|
|
297
|
+
const start = dateFactory(dateBlockRange.i);
|
|
298
|
+
const end = dateFactory(dateBlockRange.to);
|
|
299
|
+
const excluded = range(dateBlockRange.i, dateBlockRange.to + 1).filter((x) => {
|
|
300
|
+
const isExcludedIndex = !isEnabledDay(x);
|
|
301
|
+
return isExcludedIndex;
|
|
302
|
+
});
|
|
303
|
+
const result = {
|
|
304
|
+
dateBlockRange,
|
|
305
|
+
start,
|
|
306
|
+
end,
|
|
307
|
+
excluded
|
|
308
|
+
};
|
|
309
|
+
return result;
|
|
310
|
+
}
|
|
311
|
+
function computeCalendarScheduleSelectionRange(state) {
|
|
312
|
+
const dateFactory = dateBlockTimingDateFactory(state);
|
|
313
|
+
const dateBlockRange = computeCalendarScheduleSelectionDateBlockRange(state);
|
|
314
|
+
if (dateBlockRange != null) {
|
|
315
|
+
return { start: dateFactory(dateBlockRange.i), end: dateFactory(dateBlockRange.to) };
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
return undefined;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function computeCalendarScheduleSelectionDateBlockRange(state) {
|
|
322
|
+
const { indexFactory, inputStart, inputEnd, allowedDaysOfWeek, indexDayOfWeek, isEnabledDay, isEnabledFilterDay } = state;
|
|
323
|
+
const enabledSelectedIndexes = Array.from(state.selectedIndexes).filter((i) => allowedDaysOfWeek.has(indexDayOfWeek(i)));
|
|
324
|
+
const minAndMaxSelectedValues = minAndMaxNumber(enabledSelectedIndexes);
|
|
325
|
+
let startRange;
|
|
326
|
+
let endRange;
|
|
327
|
+
if (minAndMaxSelectedValues) {
|
|
328
|
+
startRange = minAndMaxSelectedValues.min;
|
|
329
|
+
endRange = minAndMaxSelectedValues.max;
|
|
330
|
+
}
|
|
331
|
+
if (inputStart != null && inputEnd != null) {
|
|
332
|
+
const inputStartIndex = indexFactory(inputStart);
|
|
333
|
+
const inputEndIndex = indexFactory(inputEnd);
|
|
334
|
+
startRange = startRange != null ? Math.min(inputStartIndex, startRange) : inputStartIndex;
|
|
335
|
+
endRange = endRange != null ? Math.max(inputEndIndex, endRange) : inputEndIndex;
|
|
336
|
+
}
|
|
337
|
+
if (startRange != null && endRange != null) {
|
|
338
|
+
const scanStartIndex = startRange;
|
|
339
|
+
const scanEndIndex = endRange;
|
|
340
|
+
// clear start and end
|
|
341
|
+
startRange = undefined;
|
|
342
|
+
endRange = undefined;
|
|
343
|
+
// if the min is equal to the start index, then we are in the range and need to iterate dates until we find one that is not selected/excluded.
|
|
344
|
+
for (let i = scanStartIndex; i <= scanEndIndex; i += 1) {
|
|
345
|
+
if (isEnabledFilterDay(i) && isEnabledDay(i)) {
|
|
346
|
+
startRange = i;
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
// same with the max
|
|
351
|
+
for (let i = scanEndIndex; i >= scanStartIndex; i -= 1) {
|
|
352
|
+
if (isEnabledFilterDay(i) && isEnabledDay(i)) {
|
|
353
|
+
endRange = i;
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (startRange != null && endRange != null) {
|
|
359
|
+
return { i: startRange, to: endRange };
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
return undefined;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Token used by provideCalendarScheduleSelectionStoreIfDoesNotExist() to prevent injecting a parent DbxCalendarScheduleSelectionStore into the child view.
|
|
368
|
+
*/
|
|
369
|
+
class DbxCalendarScheduleSelectionStoreProviderBlock {
|
|
370
|
+
constructor(dbxCalendarScheduleSelectionStore) {
|
|
371
|
+
this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
DbxCalendarScheduleSelectionStoreProviderBlock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStoreProviderBlock, deps: [{ token: DbxCalendarScheduleSelectionStore, skipSelf: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
375
|
+
DbxCalendarScheduleSelectionStoreProviderBlock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStoreProviderBlock });
|
|
376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStoreProviderBlock, decorators: [{
|
|
377
|
+
type: Injectable
|
|
378
|
+
}], ctorParameters: function () {
|
|
379
|
+
return [{ type: DbxCalendarScheduleSelectionStore, decorators: [{
|
|
380
|
+
type: SkipSelf
|
|
381
|
+
}] }];
|
|
382
|
+
} });
|
|
383
|
+
class DbxCalendarScheduleSelectionStoreInjectionBlockDirective {
|
|
384
|
+
}
|
|
385
|
+
DbxCalendarScheduleSelectionStoreInjectionBlockDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStoreInjectionBlockDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
386
|
+
DbxCalendarScheduleSelectionStoreInjectionBlockDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DbxCalendarScheduleSelectionStoreInjectionBlockDirective, selector: "[dbxCalendarScheduleSelectionStoreParentBlocker]", providers: [DbxCalendarScheduleSelectionStoreProviderBlock], ngImport: i0 });
|
|
387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStoreInjectionBlockDirective, decorators: [{
|
|
388
|
+
type: Directive,
|
|
389
|
+
args: [{
|
|
390
|
+
selector: '[dbxCalendarScheduleSelectionStoreParentBlocker]',
|
|
391
|
+
providers: [DbxCalendarScheduleSelectionStoreProviderBlock]
|
|
392
|
+
}]
|
|
393
|
+
}] });
|
|
394
|
+
/**
|
|
395
|
+
* Creates a Provider that initializes a new DbxCalendarScheduleSelectionStore if a parent does not exist.
|
|
396
|
+
*
|
|
397
|
+
* If a DbxCalendarScheduleSelectionStoreInjectionBlock is available in the context, and references the same dbxCalendarScheduleSelectionStore that is attempting to be injected, a new DbxCalendarScheduleSelectionStore is created.
|
|
398
|
+
*
|
|
399
|
+
* @returns
|
|
400
|
+
*/
|
|
401
|
+
function provideCalendarScheduleSelectionStoreIfParentIsUnavailable() {
|
|
402
|
+
return {
|
|
403
|
+
provide: DbxCalendarScheduleSelectionStore,
|
|
404
|
+
useFactory: (parentInjector, dbxCalendarScheduleSelectionStoreInjectionBlock, dbxCalendarScheduleSelectionStore) => {
|
|
405
|
+
if (!dbxCalendarScheduleSelectionStore || (dbxCalendarScheduleSelectionStore && dbxCalendarScheduleSelectionStoreInjectionBlock != null && dbxCalendarScheduleSelectionStoreInjectionBlock.dbxCalendarScheduleSelectionStore === dbxCalendarScheduleSelectionStore)) {
|
|
406
|
+
// create a new dbxCalendarScheduleSelectionStore to use
|
|
407
|
+
const injector = Injector.create({ providers: [{ provide: DbxCalendarScheduleSelectionStore }], parent: parentInjector });
|
|
408
|
+
dbxCalendarScheduleSelectionStore = injector.get(DbxCalendarScheduleSelectionStore);
|
|
409
|
+
}
|
|
410
|
+
return dbxCalendarScheduleSelectionStore;
|
|
411
|
+
},
|
|
412
|
+
deps: [Injector, [new Optional(), DbxCalendarScheduleSelectionStoreProviderBlock], [new Optional(), new SkipSelf(), DbxCalendarScheduleSelectionStore]]
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
class DbxScheduleSelectionCalendarDateRangeComponent {
|
|
417
|
+
constructor(dbxCalendarStore, dbxCalendarScheduleSelectionStore) {
|
|
418
|
+
this.dbxCalendarStore = dbxCalendarStore;
|
|
419
|
+
this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
|
|
420
|
+
this.appearance = 'fill';
|
|
421
|
+
this.label = 'Enter a date range';
|
|
422
|
+
this.showCustomize = false;
|
|
423
|
+
this.random = randomNumberFactory(10000)();
|
|
424
|
+
this._pickerOpened = new BehaviorSubject(false);
|
|
425
|
+
this._syncSub = new SubscriptionObject();
|
|
426
|
+
this._valueSub = new SubscriptionObject();
|
|
427
|
+
this.range = new FormGroup({
|
|
428
|
+
start: new FormControl(null),
|
|
429
|
+
end: new FormControl(null)
|
|
430
|
+
});
|
|
431
|
+
this.minDate$ = this.dbxCalendarScheduleSelectionStore.minDate$;
|
|
432
|
+
this.maxDate$ = this.dbxCalendarScheduleSelectionStore.maxDate$;
|
|
433
|
+
this.isCustomized$ = this.dbxCalendarScheduleSelectionStore.isCustomized$;
|
|
434
|
+
this.pickerOpened$ = this._pickerOpened.asObservable();
|
|
435
|
+
}
|
|
436
|
+
set disabled(disabled) {
|
|
437
|
+
if (disabled) {
|
|
438
|
+
this.range.disable();
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
this.range.enable();
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
ngOnInit() {
|
|
445
|
+
this._syncSub.subscription = this.dbxCalendarScheduleSelectionStore.inputRange$.subscribe((x) => {
|
|
446
|
+
var _a, _b;
|
|
447
|
+
this.range.setValue({
|
|
448
|
+
start: (_a = x.inputStart) !== null && _a !== void 0 ? _a : null,
|
|
449
|
+
end: (_b = x.inputEnd) !== null && _b !== void 0 ? _b : null
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
this._valueSub.subscription = this._pickerOpened
|
|
453
|
+
.pipe(distinctUntilChanged(), switchMap((opened) => {
|
|
454
|
+
let obs;
|
|
455
|
+
if (opened) {
|
|
456
|
+
obs = of({});
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
obs = this.range.valueChanges.pipe(startWith(this.range.value));
|
|
460
|
+
}
|
|
461
|
+
return obs;
|
|
462
|
+
}), filter((x) => Boolean(x.start && x.end)), distinctUntilChanged((a, b) => isSameDateDay(a.start, b.start) && isSameDateDay(a.end, b.end)), throttleTime(100, undefined, { trailing: true }))
|
|
463
|
+
.subscribe((x) => {
|
|
464
|
+
if (x.start && x.end) {
|
|
465
|
+
this.dbxCalendarScheduleSelectionStore.setInputRange({ inputStart: x.start, inputEnd: x.end });
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
ngOnDestroy() {
|
|
470
|
+
this._syncSub.destroy();
|
|
471
|
+
this._valueSub.destroy();
|
|
472
|
+
}
|
|
473
|
+
pickerOpened() {
|
|
474
|
+
this._pickerOpened.next(true);
|
|
475
|
+
}
|
|
476
|
+
pickerClosed() {
|
|
477
|
+
this._pickerOpened.next(false);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
DbxScheduleSelectionCalendarDateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateRangeComponent, deps: [{ token: i1.DbxCalendarStore }, { token: DbxCalendarScheduleSelectionStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
481
|
+
DbxScheduleSelectionCalendarDateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateRangeComponent, selector: "dbx-schedule-selection-calendar-date-range", inputs: { required: "required", appearance: "appearance", label: "label", hint: "hint", disabled: "disabled", showCustomize: "showCustomize" }, ngImport: i0, template: "<mat-form-field class=\"dbx-schedule-selection-calendar-date-range-field\" [appearance]=\"appearance\">\n <mat-label *ngIf=\"label\">{{ label }}</mat-label>\n <div *ngIf=\"showCustomize && (isCustomized$ | async)\" class=\"date-range-field-customized\">\n <span class=\"dbx-accent-bg date-range-field-customized-text\">Custom</span>\n </div>\n <mat-date-range-input [required]=\"required\" [min]=\"minDate$ | async\" [max]=\"maxDate$ | async\" [formGroup]=\"range\" [rangePicker]=\"picker\">\n <input matStartDate formControlName=\"start\" placeholder=\"Start date\" />\n <input matEndDate formControlName=\"end\" placeholder=\"End date\" />\n </mat-date-range-input>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <div *ngIf=\"showCustomize\">\n <dbx-button-spacer></dbx-button-spacer>\n <ng-content select=\"[customizeButton]\"></ng-content>\n </div>\n <mat-date-range-picker #picker (opened)=\"pickerOpened()\" (closed)=\"pickerClosed()\"></mat-date-range-picker>\n <mat-error *ngIf=\"range.controls.start.hasError('matStartDateInvalid')\">Invalid start date</mat-error>\n <mat-error *ngIf=\"range.controls.end.hasError('matEndDateInvalid')\">Invalid end date</mat-error>\n</mat-form-field>\n", dependencies: [{ kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { kind: "component", type: i7.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i7.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i7.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i7.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i7.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }] });
|
|
482
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateRangeComponent, decorators: [{
|
|
483
|
+
type: Component,
|
|
484
|
+
args: [{ selector: 'dbx-schedule-selection-calendar-date-range', template: "<mat-form-field class=\"dbx-schedule-selection-calendar-date-range-field\" [appearance]=\"appearance\">\n <mat-label *ngIf=\"label\">{{ label }}</mat-label>\n <div *ngIf=\"showCustomize && (isCustomized$ | async)\" class=\"date-range-field-customized\">\n <span class=\"dbx-accent-bg date-range-field-customized-text\">Custom</span>\n </div>\n <mat-date-range-input [required]=\"required\" [min]=\"minDate$ | async\" [max]=\"maxDate$ | async\" [formGroup]=\"range\" [rangePicker]=\"picker\">\n <input matStartDate formControlName=\"start\" placeholder=\"Start date\" />\n <input matEndDate formControlName=\"end\" placeholder=\"End date\" />\n </mat-date-range-input>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <div *ngIf=\"showCustomize\">\n <dbx-button-spacer></dbx-button-spacer>\n <ng-content select=\"[customizeButton]\"></ng-content>\n </div>\n <mat-date-range-picker #picker (opened)=\"pickerOpened()\" (closed)=\"pickerClosed()\"></mat-date-range-picker>\n <mat-error *ngIf=\"range.controls.start.hasError('matStartDateInvalid')\">Invalid start date</mat-error>\n <mat-error *ngIf=\"range.controls.end.hasError('matEndDateInvalid')\">Invalid end date</mat-error>\n</mat-form-field>\n" }]
|
|
485
|
+
}], ctorParameters: function () { return [{ type: i1.DbxCalendarStore }, { type: DbxCalendarScheduleSelectionStore }]; }, propDecorators: { required: [{
|
|
486
|
+
type: Input
|
|
487
|
+
}], appearance: [{
|
|
488
|
+
type: Input
|
|
489
|
+
}], label: [{
|
|
490
|
+
type: Input
|
|
491
|
+
}], hint: [{
|
|
492
|
+
type: Input
|
|
493
|
+
}], disabled: [{
|
|
494
|
+
type: Input
|
|
495
|
+
}], showCustomize: [{
|
|
496
|
+
type: Input
|
|
497
|
+
}] } });
|
|
498
|
+
|
|
499
|
+
function dbxScheduleSelectionCalendarDateDaysFormFields() {
|
|
500
|
+
const fields = dbxScheduleSelectionCalendarDateDaysFormDayFields();
|
|
501
|
+
return [flexLayoutWrapper(fields, { relative: true, size: 3 })];
|
|
502
|
+
}
|
|
503
|
+
function dbxScheduleSelectionCalendarDateDaysFormDayFields() {
|
|
504
|
+
return getDaysOfWeekNames(false).map((dayOfWeekName) => {
|
|
505
|
+
return toggleField({
|
|
506
|
+
key: dayOfWeekName.toLowerCase(),
|
|
507
|
+
label: dayOfWeekName
|
|
508
|
+
});
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
class DbxScheduleSelectionCalendarDateDaysFormComponent extends AbstractSyncFormlyFormDirective {
|
|
513
|
+
constructor() {
|
|
514
|
+
super(...arguments);
|
|
515
|
+
this.fields = dbxScheduleSelectionCalendarDateDaysFormFields();
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
DbxScheduleSelectionCalendarDateDaysFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
519
|
+
DbxScheduleSelectionCalendarDateDaysFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateDaysFormComponent, selector: "dbx-schedule-selection-calendar-date-days-form", providers: [provideFormlyContext()], usesInheritance: true, ngImport: i0, template: `
|
|
520
|
+
<dbx-formly></dbx-formly>
|
|
521
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i4.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
522
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysFormComponent, decorators: [{
|
|
523
|
+
type: Component,
|
|
524
|
+
args: [{
|
|
525
|
+
template: `
|
|
526
|
+
<dbx-formly></dbx-formly>
|
|
527
|
+
`,
|
|
528
|
+
selector: 'dbx-schedule-selection-calendar-date-days-form',
|
|
529
|
+
providers: [provideFormlyContext()]
|
|
530
|
+
}]
|
|
531
|
+
}] });
|
|
532
|
+
|
|
533
|
+
class DbxScheduleSelectionCalendarDateDaysComponent {
|
|
534
|
+
constructor(dbxCalendarStore, dbxCalendarScheduleSelectionStore) {
|
|
535
|
+
this.dbxCalendarStore = dbxCalendarStore;
|
|
536
|
+
this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
|
|
537
|
+
this.template$ = this.dbxCalendarScheduleSelectionStore.scheduleDays$.pipe(map(enabledDaysFromDateScheduleDayCodes), shareReplay());
|
|
538
|
+
this.isFormModified = (value) => {
|
|
539
|
+
const newSetValue = new Set(dateScheduleDayCodesFromEnabledDays(value));
|
|
540
|
+
return this.dbxCalendarScheduleSelectionStore.scheduleDays$.pipe(map((currentSet) => !setsAreEquivalent(currentSet, newSetValue)));
|
|
541
|
+
};
|
|
542
|
+
this.updateScheduleDays = (value) => {
|
|
543
|
+
this.dbxCalendarScheduleSelectionStore.setScheduleDays(new Set(dateScheduleDayCodesFromEnabledDays(value)));
|
|
544
|
+
return of(true);
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
DbxScheduleSelectionCalendarDateDaysComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysComponent, deps: [{ token: i1.DbxCalendarStore }, { token: DbxCalendarScheduleSelectionStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
549
|
+
DbxScheduleSelectionCalendarDateDaysComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateDaysComponent, selector: "dbx-schedule-selection-calendar-date-days", ngImport: i0, template: `
|
|
550
|
+
<div class="dbx-schedule-selection-calendar-date-days" dbxAction dbxActionAutoTrigger dbxActionEnforceModified [instantTrigger]="true" [dbxActionHandler]="updateScheduleDays">
|
|
551
|
+
<dbx-schedule-selection-calendar-date-days-form dbxActionForm [dbxFormSource]="template$" [dbxActionFormModified]="isFormModified"></dbx-schedule-selection-calendar-date-days-form>
|
|
552
|
+
</div>
|
|
553
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i3$2.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: i3$2.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "directive", type: i3$2.DbxActionEnforceModifiedDirective, selector: "[dbxActionEnforceModified]", inputs: ["dbxActionEnforceModified"] }, { kind: "directive", type: i3$2.DbxActionAutoTriggerDirective, selector: "dbxActionAutoTrigger, [dbxActionAutoTrigger]", inputs: ["dbxActionAutoTrigger", "triggerDebounce", "triggerThrottle", "triggerErrorThrottle", "fastTrigger", "instantTrigger", "triggerLimit"] }, { kind: "directive", type: i4.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "formDisabledOnWorking"] }, { kind: "directive", type: i4.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { kind: "component", type: DbxScheduleSelectionCalendarDateDaysFormComponent, selector: "dbx-schedule-selection-calendar-date-days-form" }] });
|
|
554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysComponent, decorators: [{
|
|
555
|
+
type: Component,
|
|
556
|
+
args: [{
|
|
557
|
+
selector: 'dbx-schedule-selection-calendar-date-days',
|
|
558
|
+
template: `
|
|
559
|
+
<div class="dbx-schedule-selection-calendar-date-days" dbxAction dbxActionAutoTrigger dbxActionEnforceModified [instantTrigger]="true" [dbxActionHandler]="updateScheduleDays">
|
|
560
|
+
<dbx-schedule-selection-calendar-date-days-form dbxActionForm [dbxFormSource]="template$" [dbxActionFormModified]="isFormModified"></dbx-schedule-selection-calendar-date-days-form>
|
|
561
|
+
</div>
|
|
562
|
+
`
|
|
563
|
+
}]
|
|
564
|
+
}], ctorParameters: function () { return [{ type: i1.DbxCalendarStore }, { type: DbxCalendarScheduleSelectionStore }]; } });
|
|
565
|
+
|
|
566
|
+
class DbxScheduleSelectionCalendarDatePopoverContentComponent {
|
|
567
|
+
ngOnDestroy() { }
|
|
568
|
+
}
|
|
569
|
+
DbxScheduleSelectionCalendarDatePopoverContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
570
|
+
DbxScheduleSelectionCalendarDatePopoverContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDatePopoverContentComponent, selector: "dbx-schedule-selection-calendar-date-popover-content", ngImport: i0, template: `
|
|
571
|
+
<div>
|
|
572
|
+
<dbx-schedule-selection-calendar-date-range></dbx-schedule-selection-calendar-date-range>
|
|
573
|
+
<dbx-schedule-selection-calendar-date-days></dbx-schedule-selection-calendar-date-days>
|
|
574
|
+
</div>
|
|
575
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DbxScheduleSelectionCalendarDateDaysComponent, selector: "dbx-schedule-selection-calendar-date-days" }, { kind: "component", type: DbxScheduleSelectionCalendarDateRangeComponent, selector: "dbx-schedule-selection-calendar-date-range", inputs: ["required", "appearance", "label", "hint", "disabled", "showCustomize"] }] });
|
|
576
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverContentComponent, decorators: [{
|
|
577
|
+
type: Component,
|
|
578
|
+
args: [{
|
|
579
|
+
selector: 'dbx-schedule-selection-calendar-date-popover-content',
|
|
580
|
+
template: `
|
|
581
|
+
<div>
|
|
582
|
+
<dbx-schedule-selection-calendar-date-range></dbx-schedule-selection-calendar-date-range>
|
|
583
|
+
<dbx-schedule-selection-calendar-date-days></dbx-schedule-selection-calendar-date-days>
|
|
584
|
+
</div>
|
|
585
|
+
`
|
|
586
|
+
}]
|
|
587
|
+
}] });
|
|
588
|
+
|
|
589
|
+
const DEFAULT_SCHEDULE_SELECTION_CALENDAR_DATE_POPOVER_KEY = 'calendarselection';
|
|
590
|
+
class DbxScheduleSelectionCalendarDatePopoverComponent extends AbstractPopoverDirective {
|
|
591
|
+
static openPopover(popoverService, { origin, injector }, popoverKey) {
|
|
592
|
+
return popoverService.open({
|
|
593
|
+
key: popoverKey !== null && popoverKey !== void 0 ? popoverKey : DEFAULT_SCHEDULE_SELECTION_CALENDAR_DATE_POPOVER_KEY,
|
|
594
|
+
origin,
|
|
595
|
+
componentClass: DbxScheduleSelectionCalendarDatePopoverComponent,
|
|
596
|
+
injector
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
DbxScheduleSelectionCalendarDatePopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
601
|
+
DbxScheduleSelectionCalendarDatePopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDatePopoverComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
602
|
+
<dbx-popover-content>
|
|
603
|
+
<dbx-popover-scroll-content>
|
|
604
|
+
<dbx-schedule-selection-calendar-date-popover-content (close)="close()"></dbx-schedule-selection-calendar-date-popover-content>
|
|
605
|
+
</dbx-popover-scroll-content>
|
|
606
|
+
</dbx-popover-content>
|
|
607
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxPopoverContentComponent, selector: "dbx-popover-content" }, { kind: "component", type: i1$1.DbxPopoverScrollContentComponent, selector: "dbx-popover-scroll-content" }, { kind: "component", type: DbxScheduleSelectionCalendarDatePopoverContentComponent, selector: "dbx-schedule-selection-calendar-date-popover-content" }] });
|
|
608
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverComponent, decorators: [{
|
|
609
|
+
type: Component,
|
|
610
|
+
args: [{
|
|
611
|
+
template: `
|
|
612
|
+
<dbx-popover-content>
|
|
613
|
+
<dbx-popover-scroll-content>
|
|
614
|
+
<dbx-schedule-selection-calendar-date-popover-content (close)="close()"></dbx-schedule-selection-calendar-date-popover-content>
|
|
615
|
+
</dbx-popover-scroll-content>
|
|
616
|
+
</dbx-popover-content>
|
|
617
|
+
`
|
|
618
|
+
}]
|
|
619
|
+
}] });
|
|
620
|
+
|
|
621
|
+
class DbxScheduleSelectionCalendarDatePopoverButtonComponent {
|
|
622
|
+
constructor(popoverService, dbxCalendarScheduleSelectionStore, injector) {
|
|
623
|
+
this.popoverService = popoverService;
|
|
624
|
+
this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
|
|
625
|
+
this.injector = injector;
|
|
626
|
+
this.buttonText$ = this.dbxCalendarScheduleSelectionStore.currentDateRange$.pipe(map((x) => {
|
|
627
|
+
if ((x === null || x === void 0 ? void 0 : x.start) && x.end) {
|
|
628
|
+
return `${formatToMonthDayString(x.start)} - ${formatToMonthDayString(x.end)}`;
|
|
629
|
+
}
|
|
630
|
+
else {
|
|
631
|
+
return 'Pick a Date Range';
|
|
632
|
+
}
|
|
633
|
+
}), shareReplay(1));
|
|
634
|
+
}
|
|
635
|
+
openPopover() {
|
|
636
|
+
DbxScheduleSelectionCalendarDatePopoverComponent.openPopover(this.popoverService, { origin: this.buttonPopoverOrigin, injector: this.injector });
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
DbxScheduleSelectionCalendarDatePopoverButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverButtonComponent, deps: [{ token: i1$1.DbxPopoverService }, { token: DbxCalendarScheduleSelectionStore }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
640
|
+
DbxScheduleSelectionCalendarDatePopoverButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDatePopoverButtonComponent, selector: "dbx-schedule-selection-calendar-date-popover-button", viewQueries: [{ propertyName: "buttonPopoverOrigin", first: true, predicate: ["buttonPopoverOrigin"], descendants: true, read: ElementRef }], ngImport: i0, template: `
|
|
641
|
+
<dbx-button #buttonPopoverOrigin icon="date_range" [raised]="true" color="accent" [text]="buttonText$ | async" (buttonClick)="openPopover()"></dbx-button>
|
|
642
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }] });
|
|
643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverButtonComponent, decorators: [{
|
|
644
|
+
type: Component,
|
|
645
|
+
args: [{
|
|
646
|
+
selector: 'dbx-schedule-selection-calendar-date-popover-button',
|
|
647
|
+
template: `
|
|
648
|
+
<dbx-button #buttonPopoverOrigin icon="date_range" [raised]="true" color="accent" [text]="buttonText$ | async" (buttonClick)="openPopover()"></dbx-button>
|
|
649
|
+
`
|
|
650
|
+
}]
|
|
651
|
+
}], ctorParameters: function () { return [{ type: i1$1.DbxPopoverService }, { type: DbxCalendarScheduleSelectionStore }, { type: i0.Injector }]; }, propDecorators: { buttonPopoverOrigin: [{
|
|
652
|
+
type: ViewChild,
|
|
653
|
+
args: ['buttonPopoverOrigin', { read: ElementRef }]
|
|
654
|
+
}] } });
|
|
655
|
+
|
|
656
|
+
class DbxScheduleSelectionCalendarCellComponent {
|
|
657
|
+
constructor(dbxCalendarScheduleSelectionStore) {
|
|
658
|
+
this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
|
|
659
|
+
this.content = {};
|
|
660
|
+
}
|
|
661
|
+
get icon() {
|
|
662
|
+
return this.content.icon;
|
|
663
|
+
}
|
|
664
|
+
get text() {
|
|
665
|
+
return this.content.text;
|
|
666
|
+
}
|
|
667
|
+
set day(day) {
|
|
668
|
+
this.dbxCalendarScheduleSelectionStore.cellContentFactory$.pipe(first()).subscribe((fn) => {
|
|
669
|
+
this.content = fn(day);
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
DbxScheduleSelectionCalendarCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarCellComponent, deps: [{ token: DbxCalendarScheduleSelectionStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
674
|
+
DbxScheduleSelectionCalendarCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarCellComponent, selector: "dbx-schedule-selection-calendar-cell", inputs: { day: "day" }, host: { classAttribute: "dbx-schedule-selection-calendar-cell" }, ngImport: i0, template: `
|
|
675
|
+
<mat-icon *ngIf="icon">{{ icon }}</mat-icon>
|
|
676
|
+
<span>{{ text }}</span>
|
|
677
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
678
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarCellComponent, decorators: [{
|
|
679
|
+
type: Component,
|
|
680
|
+
args: [{
|
|
681
|
+
selector: 'dbx-schedule-selection-calendar-cell',
|
|
682
|
+
template: `
|
|
683
|
+
<mat-icon *ngIf="icon">{{ icon }}</mat-icon>
|
|
684
|
+
<span>{{ text }}</span>
|
|
685
|
+
`,
|
|
686
|
+
host: {
|
|
687
|
+
class: 'dbx-schedule-selection-calendar-cell'
|
|
688
|
+
},
|
|
689
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
690
|
+
}]
|
|
691
|
+
}], ctorParameters: function () { return [{ type: DbxCalendarScheduleSelectionStore }]; }, propDecorators: { day: [{
|
|
692
|
+
type: Input
|
|
693
|
+
}] } });
|
|
694
|
+
|
|
695
|
+
class DbxScheduleSelectionCalendarComponent {
|
|
696
|
+
constructor(calendarStore, dbxCalendarScheduleSelectionStore) {
|
|
697
|
+
this.calendarStore = calendarStore;
|
|
698
|
+
this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
|
|
699
|
+
this.clickEvent = new EventEmitter();
|
|
700
|
+
// refresh any time the selected day function updates
|
|
701
|
+
this.state$ = this.dbxCalendarScheduleSelectionStore.state$;
|
|
702
|
+
this.refresh$ = this.state$.pipe(throttleTime$1(100), map(() => undefined));
|
|
703
|
+
this.events$ = this.calendarStore.visibleEvents$.pipe(map(prepareAndSortCalendarEvents), shareReplay(1));
|
|
704
|
+
this.viewDate$ = this.calendarStore.date$;
|
|
705
|
+
}
|
|
706
|
+
dayClicked({ date }) {
|
|
707
|
+
this.dbxCalendarScheduleSelectionStore.toggleSelectedDates(date);
|
|
708
|
+
}
|
|
709
|
+
eventClicked(action, event) {
|
|
710
|
+
this.clickEvent.emit({ action, event });
|
|
711
|
+
}
|
|
712
|
+
beforeMonthViewRender({ body }) {
|
|
713
|
+
this.state$.pipe(first()).subscribe(({ isEnabledDay, indexFactory, isEnabledFilterDay, allowedDaysOfWeek }) => {
|
|
714
|
+
body.forEach((viewDay) => {
|
|
715
|
+
const { date } = viewDay;
|
|
716
|
+
const i = indexFactory(date);
|
|
717
|
+
const day = date.getDay();
|
|
718
|
+
let state;
|
|
719
|
+
if (!isEnabledFilterDay(i)) {
|
|
720
|
+
viewDay.cssClass = 'cal-day-not-applicable';
|
|
721
|
+
state = CalendarScheduleSelectionDayState.NOT_APPLICABLE;
|
|
722
|
+
}
|
|
723
|
+
else if (!allowedDaysOfWeek.has(day)) {
|
|
724
|
+
viewDay.cssClass = 'cal-day-disabled';
|
|
725
|
+
state = CalendarScheduleSelectionDayState.DISABLED;
|
|
726
|
+
}
|
|
727
|
+
else if (isEnabledDay(i)) {
|
|
728
|
+
viewDay.cssClass = 'cal-day-selected';
|
|
729
|
+
state = CalendarScheduleSelectionDayState.SELECTED;
|
|
730
|
+
}
|
|
731
|
+
else {
|
|
732
|
+
viewDay.cssClass = 'cal-day-not-selected';
|
|
733
|
+
state = CalendarScheduleSelectionDayState.NOT_SELECTED;
|
|
734
|
+
}
|
|
735
|
+
viewDay.meta = {
|
|
736
|
+
state,
|
|
737
|
+
i
|
|
738
|
+
};
|
|
739
|
+
});
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
ngOnDestroy() {
|
|
743
|
+
this.clickEvent.complete();
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
DbxScheduleSelectionCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarComponent, deps: [{ token: i1.DbxCalendarStore }, { token: DbxCalendarScheduleSelectionStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
747
|
+
DbxScheduleSelectionCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarComponent, selector: "dbx-schedule-selection-calendar", outputs: { clickEvent: "clickEvent" }, providers: [DbxCalendarStore], ngImport: i0, template: "<dbx-calendar-base class=\"dbx-schedule-selection-calendar\">\n <ng-container controls>\n <dbx-schedule-selection-calendar-date-popover-button></dbx-schedule-selection-calendar-date-popover-button>\n </ng-container>\n <div class=\"dbx-calendar-content dbx-calendar-content-month\">\n <mwl-calendar-month-view [refresh]=\"refresh$\" [viewDate]=\"(viewDate$ | async)!\" [events]=\"(events$ | async)!\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\" (beforeViewRender)=\"beforeMonthViewRender($event)\" [cellTemplate]=\"monthDayCellTemplate\"></mwl-calendar-month-view>\n </div>\n</dbx-calendar-base>\n\n<!-- Cell -->\n<ng-template #monthDayCellTemplate let-day=\"day\" let-locale=\"locale\">\n <div class=\"cal-cell-top\">\n <span class=\"cal-day-badge\" *ngIf=\"day.badgeTotal > 0\">{{ day.badgeTotal }}</span>\n <span class=\"cal-day-number\">{{ day.date | calendarDate: 'monthViewDayNumber':locale }}</span>\n </div>\n <dbx-schedule-selection-calendar-cell [day]=\"day\"></dbx-schedule-selection-calendar-cell>\n</ng-template>\n", dependencies: [{ kind: "component", type: i1.DbxCalendarBaseComponent, selector: "dbx-calendar-base" }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$1.CalendarMonthViewComponent, selector: "mwl-calendar-month-view", inputs: ["viewDate", "events", "excludeDays", "activeDayIsOpen", "activeDay", "refresh", "locale", "tooltipPlacement", "tooltipTemplate", "tooltipAppendToBody", "tooltipDelay", "weekStartsOn", "headerTemplate", "cellTemplate", "openDayEventsTemplate", "eventTitleTemplate", "eventActionsTemplate", "weekendDays"], outputs: ["beforeViewRender", "dayClicked", "eventClicked", "columnHeaderClicked", "eventTimesChanged"] }, { kind: "component", type: DbxScheduleSelectionCalendarDatePopoverButtonComponent, selector: "dbx-schedule-selection-calendar-date-popover-button" }, { kind: "component", type: DbxScheduleSelectionCalendarCellComponent, selector: "dbx-schedule-selection-calendar-cell", inputs: ["day"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4$1.ɵCalendarDatePipe, name: "calendarDate" }] });
|
|
748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarComponent, decorators: [{
|
|
749
|
+
type: Component,
|
|
750
|
+
args: [{ selector: 'dbx-schedule-selection-calendar', providers: [DbxCalendarStore], template: "<dbx-calendar-base class=\"dbx-schedule-selection-calendar\">\n <ng-container controls>\n <dbx-schedule-selection-calendar-date-popover-button></dbx-schedule-selection-calendar-date-popover-button>\n </ng-container>\n <div class=\"dbx-calendar-content dbx-calendar-content-month\">\n <mwl-calendar-month-view [refresh]=\"refresh$\" [viewDate]=\"(viewDate$ | async)!\" [events]=\"(events$ | async)!\" (dayClicked)=\"dayClicked($event.day)\" (eventClicked)=\"eventClicked('Clicked', $event.event)\" (beforeViewRender)=\"beforeMonthViewRender($event)\" [cellTemplate]=\"monthDayCellTemplate\"></mwl-calendar-month-view>\n </div>\n</dbx-calendar-base>\n\n<!-- Cell -->\n<ng-template #monthDayCellTemplate let-day=\"day\" let-locale=\"locale\">\n <div class=\"cal-cell-top\">\n <span class=\"cal-day-badge\" *ngIf=\"day.badgeTotal > 0\">{{ day.badgeTotal }}</span>\n <span class=\"cal-day-number\">{{ day.date | calendarDate: 'monthViewDayNumber':locale }}</span>\n </div>\n <dbx-schedule-selection-calendar-cell [day]=\"day\"></dbx-schedule-selection-calendar-cell>\n</ng-template>\n" }]
|
|
751
|
+
}], ctorParameters: function () { return [{ type: i1.DbxCalendarStore }, { type: DbxCalendarScheduleSelectionStore }]; }, propDecorators: { clickEvent: [{
|
|
752
|
+
type: Output
|
|
753
|
+
}] } });
|
|
754
|
+
|
|
755
|
+
class DbxScheduleSelectionCalendarDateDialogComponent extends AbstractDialogDirective {
|
|
756
|
+
static openDialog(matDialog, { injector }) {
|
|
757
|
+
return matDialog.open(DbxScheduleSelectionCalendarDateDialogComponent, {
|
|
758
|
+
injector,
|
|
759
|
+
width: '80vw',
|
|
760
|
+
minWidth: 460
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
DbxScheduleSelectionCalendarDateDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
765
|
+
DbxScheduleSelectionCalendarDateDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateDialogComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
766
|
+
<dbx-dialog-content>
|
|
767
|
+
<dbx-dialog-content-close (close)="close()"></dbx-dialog-content-close>
|
|
768
|
+
<dbx-schedule-selection-calendar></dbx-schedule-selection-calendar>
|
|
769
|
+
<dbx-dialog-content-footer closeText="Close Calendar" (close)="close()"></dbx-dialog-content-footer>
|
|
770
|
+
</dbx-dialog-content>
|
|
771
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1$1.DbxDialogContentDirective, selector: "dbx-dialog-content,[dbxDialogContent].dbx-dialog-content", inputs: ["width"] }, { kind: "component", type: i1$1.DbxDialogContentFooterComponent, selector: "dbx-dialog-content-footer", inputs: ["closeText"], outputs: ["close"] }, { kind: "component", type: i1$1.DbxDialogContentCloseComponent, selector: "dbx-dialog-content-close", outputs: ["close"] }, { kind: "component", type: DbxScheduleSelectionCalendarComponent, selector: "dbx-schedule-selection-calendar", outputs: ["clickEvent"] }] });
|
|
772
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDialogComponent, decorators: [{
|
|
773
|
+
type: Component,
|
|
774
|
+
args: [{
|
|
775
|
+
template: `
|
|
776
|
+
<dbx-dialog-content>
|
|
777
|
+
<dbx-dialog-content-close (close)="close()"></dbx-dialog-content-close>
|
|
778
|
+
<dbx-schedule-selection-calendar></dbx-schedule-selection-calendar>
|
|
779
|
+
<dbx-dialog-content-footer closeText="Close Calendar" (close)="close()"></dbx-dialog-content-footer>
|
|
780
|
+
</dbx-dialog-content>
|
|
781
|
+
`
|
|
782
|
+
}]
|
|
783
|
+
}] });
|
|
784
|
+
|
|
785
|
+
class DbxScheduleSelectionCalendarDateDialogButtonComponent {
|
|
786
|
+
constructor(matDialog, injector) {
|
|
787
|
+
this.matDialog = matDialog;
|
|
788
|
+
this.injector = injector;
|
|
789
|
+
this.buttonText = 'Customize';
|
|
790
|
+
}
|
|
791
|
+
clickCustomize() {
|
|
792
|
+
DbxScheduleSelectionCalendarDateDialogComponent.openDialog(this.matDialog, { injector: this.injector });
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
DbxScheduleSelectionCalendarDateDialogButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDialogButtonComponent, deps: [{ token: i1$2.MatDialog }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
796
|
+
DbxScheduleSelectionCalendarDateDialogButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateDialogButtonComponent, selector: "dbx-schedule-selection-calendar-date-dialog-button", inputs: { buttonText: "buttonText" }, ngImport: i0, template: `
|
|
797
|
+
<button mat-raised-button color="accent" (click)="clickCustomize()">{{ buttonText }}</button>
|
|
798
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i2.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"] }] });
|
|
799
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDialogButtonComponent, decorators: [{
|
|
800
|
+
type: Component,
|
|
801
|
+
args: [{
|
|
802
|
+
selector: 'dbx-schedule-selection-calendar-date-dialog-button',
|
|
803
|
+
template: `
|
|
804
|
+
<button mat-raised-button color="accent" (click)="clickCustomize()">{{ buttonText }}</button>
|
|
805
|
+
`
|
|
806
|
+
}]
|
|
807
|
+
}], ctorParameters: function () { return [{ type: i1$2.MatDialog }, { type: i0.Injector }]; }, propDecorators: { buttonText: [{
|
|
808
|
+
type: Input
|
|
809
|
+
}] } });
|
|
810
|
+
|
|
811
|
+
class DbxFormCalendarDateScheduleRangeFieldComponent extends FieldType {
|
|
812
|
+
constructor(compact, dbxCalendarScheduleSelectionStore, ngZone) {
|
|
813
|
+
super();
|
|
814
|
+
this.compact = compact;
|
|
815
|
+
this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
|
|
816
|
+
this.ngZone = ngZone;
|
|
817
|
+
this._syncSub = new SubscriptionObject();
|
|
818
|
+
this._valueSub = new SubscriptionObject();
|
|
819
|
+
this._filterSub = new SubscriptionObject();
|
|
820
|
+
this._formControlObs = new BehaviorSubject(undefined);
|
|
821
|
+
this.formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
822
|
+
this.value$ = this.formControl$.pipe(switchMap$1((control) => control.valueChanges.pipe(startWith(control.value))), shareReplay(1));
|
|
823
|
+
}
|
|
824
|
+
get formGroupName() {
|
|
825
|
+
return this.field.key;
|
|
826
|
+
}
|
|
827
|
+
get formGroup() {
|
|
828
|
+
return this.form;
|
|
829
|
+
}
|
|
830
|
+
get appearance() {
|
|
831
|
+
var _a;
|
|
832
|
+
return (_a = this.props.appearance) !== null && _a !== void 0 ? _a : 'standard';
|
|
833
|
+
}
|
|
834
|
+
get label() {
|
|
835
|
+
var _a;
|
|
836
|
+
return (_a = this.field.props) === null || _a === void 0 ? void 0 : _a.label;
|
|
837
|
+
}
|
|
838
|
+
get description() {
|
|
839
|
+
return this.props.description;
|
|
840
|
+
}
|
|
841
|
+
get isReadonlyOrDisabled() {
|
|
842
|
+
return this.props.readonly || this.disabled;
|
|
843
|
+
}
|
|
844
|
+
get showCustomize() {
|
|
845
|
+
return !this.props.hideCustomize;
|
|
846
|
+
}
|
|
847
|
+
get filter() {
|
|
848
|
+
return this.props.filter;
|
|
849
|
+
}
|
|
850
|
+
ngOnInit() {
|
|
851
|
+
this._formControlObs.next(this.formControl);
|
|
852
|
+
this._syncSub.subscription = this.value$.pipe(distinctUntilChanged(isSameDateScheduleRange)).subscribe((x) => {
|
|
853
|
+
this.dbxCalendarScheduleSelectionStore.setDateScheduleRangeValue(x);
|
|
854
|
+
});
|
|
855
|
+
this._valueSub.subscription = this.dbxCalendarScheduleSelectionStore.currentDateScheduleRangeValue$.subscribe((x) => {
|
|
856
|
+
this.formControl.setValue(x);
|
|
857
|
+
});
|
|
858
|
+
const filter = this.filter;
|
|
859
|
+
if (filter != null) {
|
|
860
|
+
this._filterSub.subscription = this.dbxCalendarScheduleSelectionStore.setFilter(asObservable(filter));
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
ngOnDestroy() {
|
|
864
|
+
super.ngOnDestroy();
|
|
865
|
+
this._syncSub.destroy();
|
|
866
|
+
this._valueSub.destroy();
|
|
867
|
+
this._formControlObs.complete();
|
|
868
|
+
this._filterSub.destroy();
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
DbxFormCalendarDateScheduleRangeFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarDateScheduleRangeFieldComponent, deps: [{ token: i1$1.CompactContextStore, optional: true }, { token: DbxCalendarScheduleSelectionStore }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
872
|
+
DbxFormCalendarDateScheduleRangeFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxFormCalendarDateScheduleRangeFieldComponent, selector: "ng-component", providers: [provideCalendarScheduleSelectionStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
|
|
873
|
+
<div class="dbx-schedule-selection-field">
|
|
874
|
+
<dbx-schedule-selection-calendar-date-range [showCustomize]="showCustomize" [appearance]="appearance" [required]="required" [disabled]="isReadonlyOrDisabled" [label]="label" [hint]="description">
|
|
875
|
+
<dbx-schedule-selection-calendar-date-dialog-button customizeButton></dbx-schedule-selection-calendar-date-dialog-button>
|
|
876
|
+
</dbx-schedule-selection-calendar-date-range>
|
|
877
|
+
</div>
|
|
878
|
+
`, isInline: true, dependencies: [{ kind: "component", type: DbxScheduleSelectionCalendarDateRangeComponent, selector: "dbx-schedule-selection-calendar-date-range", inputs: ["required", "appearance", "label", "hint", "disabled", "showCustomize"] }, { kind: "component", type: DbxScheduleSelectionCalendarDateDialogButtonComponent, selector: "dbx-schedule-selection-calendar-date-dialog-button", inputs: ["buttonText"] }] });
|
|
879
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarDateScheduleRangeFieldComponent, decorators: [{
|
|
880
|
+
type: Component,
|
|
881
|
+
args: [{
|
|
882
|
+
template: `
|
|
883
|
+
<div class="dbx-schedule-selection-field">
|
|
884
|
+
<dbx-schedule-selection-calendar-date-range [showCustomize]="showCustomize" [appearance]="appearance" [required]="required" [disabled]="isReadonlyOrDisabled" [label]="label" [hint]="description">
|
|
885
|
+
<dbx-schedule-selection-calendar-date-dialog-button customizeButton></dbx-schedule-selection-calendar-date-dialog-button>
|
|
886
|
+
</dbx-schedule-selection-calendar-date-range>
|
|
887
|
+
</div>
|
|
888
|
+
`,
|
|
889
|
+
providers: [provideCalendarScheduleSelectionStoreIfParentIsUnavailable()]
|
|
890
|
+
}]
|
|
891
|
+
}], ctorParameters: function () {
|
|
892
|
+
return [{ type: i1$1.CompactContextStore, decorators: [{
|
|
893
|
+
type: Optional
|
|
894
|
+
}] }, { type: DbxCalendarScheduleSelectionStore }, { type: i0.NgZone }];
|
|
895
|
+
} });
|
|
896
|
+
|
|
897
|
+
const declarations = [
|
|
898
|
+
//
|
|
899
|
+
DbxScheduleSelectionCalendarComponent,
|
|
900
|
+
DbxScheduleSelectionCalendarDateDaysComponent,
|
|
901
|
+
DbxScheduleSelectionCalendarDateDaysFormComponent,
|
|
902
|
+
DbxScheduleSelectionCalendarDateRangeComponent,
|
|
903
|
+
DbxScheduleSelectionCalendarDatePopoverButtonComponent,
|
|
904
|
+
DbxScheduleSelectionCalendarCellComponent,
|
|
905
|
+
DbxScheduleSelectionCalendarDatePopoverComponent,
|
|
906
|
+
DbxScheduleSelectionCalendarDatePopoverContentComponent,
|
|
907
|
+
DbxCalendarScheduleSelectionStoreInjectionBlockDirective,
|
|
908
|
+
DbxScheduleSelectionCalendarDateDialogComponent,
|
|
909
|
+
DbxScheduleSelectionCalendarDateDialogButtonComponent
|
|
910
|
+
];
|
|
911
|
+
class DbxFormCalendarModule {
|
|
912
|
+
}
|
|
913
|
+
DbxFormCalendarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
914
|
+
DbxFormCalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarModule, declarations: [
|
|
915
|
+
//
|
|
916
|
+
DbxScheduleSelectionCalendarComponent,
|
|
917
|
+
DbxScheduleSelectionCalendarDateDaysComponent,
|
|
918
|
+
DbxScheduleSelectionCalendarDateDaysFormComponent,
|
|
919
|
+
DbxScheduleSelectionCalendarDateRangeComponent,
|
|
920
|
+
DbxScheduleSelectionCalendarDatePopoverButtonComponent,
|
|
921
|
+
DbxScheduleSelectionCalendarCellComponent,
|
|
922
|
+
DbxScheduleSelectionCalendarDatePopoverComponent,
|
|
923
|
+
DbxScheduleSelectionCalendarDatePopoverContentComponent,
|
|
924
|
+
DbxCalendarScheduleSelectionStoreInjectionBlockDirective,
|
|
925
|
+
DbxScheduleSelectionCalendarDateDialogComponent,
|
|
926
|
+
DbxScheduleSelectionCalendarDateDialogButtonComponent
|
|
927
|
+
], imports: [
|
|
928
|
+
//
|
|
929
|
+
DbxActionModule,
|
|
930
|
+
DbxFormModule,
|
|
931
|
+
DbxFormlyModule,
|
|
932
|
+
DbxCalendarModule,
|
|
933
|
+
CommonModule,
|
|
934
|
+
MatIconModule,
|
|
935
|
+
MatButtonModule,
|
|
936
|
+
FormsModule,
|
|
937
|
+
ReactiveFormsModule,
|
|
938
|
+
MatFormFieldModule,
|
|
939
|
+
MatButtonToggleModule,
|
|
940
|
+
DbxButtonModule,
|
|
941
|
+
MatDatepickerModule,
|
|
942
|
+
DbxDialogInteractionModule,
|
|
943
|
+
DbxPopoverInteractionModule,
|
|
944
|
+
CalendarModule,
|
|
945
|
+
CalendarDayModule,
|
|
946
|
+
FlexLayoutModule,
|
|
947
|
+
CalendarWeekModule
|
|
948
|
+
], exports: [
|
|
949
|
+
//
|
|
950
|
+
DbxScheduleSelectionCalendarComponent,
|
|
951
|
+
DbxScheduleSelectionCalendarDateDaysComponent,
|
|
952
|
+
DbxScheduleSelectionCalendarDateDaysFormComponent,
|
|
953
|
+
DbxScheduleSelectionCalendarDateRangeComponent,
|
|
954
|
+
DbxScheduleSelectionCalendarDatePopoverButtonComponent,
|
|
955
|
+
DbxScheduleSelectionCalendarCellComponent,
|
|
956
|
+
DbxScheduleSelectionCalendarDatePopoverComponent,
|
|
957
|
+
DbxScheduleSelectionCalendarDatePopoverContentComponent,
|
|
958
|
+
DbxCalendarScheduleSelectionStoreInjectionBlockDirective,
|
|
959
|
+
DbxScheduleSelectionCalendarDateDialogComponent,
|
|
960
|
+
DbxScheduleSelectionCalendarDateDialogButtonComponent
|
|
961
|
+
] });
|
|
962
|
+
DbxFormCalendarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarModule, imports: [
|
|
963
|
+
//
|
|
964
|
+
DbxActionModule,
|
|
965
|
+
DbxFormModule,
|
|
966
|
+
DbxFormlyModule,
|
|
967
|
+
DbxCalendarModule,
|
|
968
|
+
CommonModule,
|
|
969
|
+
MatIconModule,
|
|
970
|
+
MatButtonModule,
|
|
971
|
+
FormsModule,
|
|
972
|
+
ReactiveFormsModule,
|
|
973
|
+
MatFormFieldModule,
|
|
974
|
+
MatButtonToggleModule,
|
|
975
|
+
DbxButtonModule,
|
|
976
|
+
MatDatepickerModule,
|
|
977
|
+
DbxDialogInteractionModule,
|
|
978
|
+
DbxPopoverInteractionModule,
|
|
979
|
+
CalendarModule,
|
|
980
|
+
CalendarDayModule,
|
|
981
|
+
FlexLayoutModule,
|
|
982
|
+
CalendarWeekModule
|
|
983
|
+
] });
|
|
984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarModule, decorators: [{
|
|
985
|
+
type: NgModule,
|
|
986
|
+
args: [{
|
|
987
|
+
imports: [
|
|
988
|
+
//
|
|
989
|
+
DbxActionModule,
|
|
990
|
+
DbxFormModule,
|
|
991
|
+
DbxFormlyModule,
|
|
992
|
+
DbxCalendarModule,
|
|
993
|
+
CommonModule,
|
|
994
|
+
MatIconModule,
|
|
995
|
+
MatButtonModule,
|
|
996
|
+
FormsModule,
|
|
997
|
+
ReactiveFormsModule,
|
|
998
|
+
MatFormFieldModule,
|
|
999
|
+
MatButtonToggleModule,
|
|
1000
|
+
DbxButtonModule,
|
|
1001
|
+
MatDatepickerModule,
|
|
1002
|
+
DbxDialogInteractionModule,
|
|
1003
|
+
DbxPopoverInteractionModule,
|
|
1004
|
+
CalendarModule,
|
|
1005
|
+
CalendarDayModule,
|
|
1006
|
+
FlexLayoutModule,
|
|
1007
|
+
CalendarWeekModule
|
|
1008
|
+
],
|
|
1009
|
+
declarations,
|
|
1010
|
+
exports: declarations
|
|
1011
|
+
}]
|
|
1012
|
+
}] });
|
|
1013
|
+
|
|
1014
|
+
class DbxFormDateScheduleRangeFieldModule {
|
|
1015
|
+
}
|
|
1016
|
+
DbxFormDateScheduleRangeFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormDateScheduleRangeFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1017
|
+
DbxFormDateScheduleRangeFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFormDateScheduleRangeFieldModule, declarations: [DbxFormCalendarDateScheduleRangeFieldComponent], imports: [CommonModule,
|
|
1018
|
+
MatIconModule,
|
|
1019
|
+
DbxFormCalendarModule,
|
|
1020
|
+
MatButtonModule,
|
|
1021
|
+
DbxTextModule,
|
|
1022
|
+
FormsModule,
|
|
1023
|
+
ReactiveFormsModule,
|
|
1024
|
+
MatInputModule, i1$3.FormlyModule] });
|
|
1025
|
+
DbxFormDateScheduleRangeFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormDateScheduleRangeFieldModule, imports: [CommonModule,
|
|
1026
|
+
MatIconModule,
|
|
1027
|
+
DbxFormCalendarModule,
|
|
1028
|
+
MatButtonModule,
|
|
1029
|
+
DbxTextModule,
|
|
1030
|
+
FormsModule,
|
|
1031
|
+
ReactiveFormsModule,
|
|
1032
|
+
MatInputModule,
|
|
1033
|
+
FormlyModule.forChild({
|
|
1034
|
+
types: [{ name: 'date-schedule-range', component: DbxFormCalendarDateScheduleRangeFieldComponent }]
|
|
1035
|
+
})] });
|
|
1036
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormDateScheduleRangeFieldModule, decorators: [{
|
|
1037
|
+
type: NgModule,
|
|
1038
|
+
args: [{
|
|
1039
|
+
imports: [
|
|
1040
|
+
CommonModule,
|
|
1041
|
+
MatIconModule,
|
|
1042
|
+
DbxFormCalendarModule,
|
|
1043
|
+
MatButtonModule,
|
|
1044
|
+
DbxTextModule,
|
|
1045
|
+
FormsModule,
|
|
1046
|
+
ReactiveFormsModule,
|
|
1047
|
+
MatInputModule,
|
|
1048
|
+
FormlyModule.forChild({
|
|
1049
|
+
types: [{ name: 'date-schedule-range', component: DbxFormCalendarDateScheduleRangeFieldComponent }]
|
|
1050
|
+
})
|
|
1051
|
+
],
|
|
1052
|
+
declarations: [DbxFormCalendarDateScheduleRangeFieldComponent]
|
|
1053
|
+
}]
|
|
1054
|
+
}] });
|
|
1055
|
+
|
|
1056
|
+
// export * from './selection';
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* Generated bundle index. Do not edit.
|
|
1060
|
+
*/
|
|
1061
|
+
|
|
1062
|
+
export { CalendarScheduleSelectionDayState, DEFAULT_SCHEDULE_SELECTION_CALENDAR_DATE_POPOVER_KEY, DbxCalendarScheduleSelectionStore, DbxCalendarScheduleSelectionStoreInjectionBlockDirective, DbxCalendarScheduleSelectionStoreProviderBlock, DbxFormCalendarDateScheduleRangeFieldComponent, DbxFormCalendarModule, DbxFormDateScheduleRangeFieldModule, DbxScheduleSelectionCalendarCellComponent, DbxScheduleSelectionCalendarComponent, DbxScheduleSelectionCalendarDateDaysComponent, DbxScheduleSelectionCalendarDateDaysFormComponent, DbxScheduleSelectionCalendarDateDialogButtonComponent, DbxScheduleSelectionCalendarDateDialogComponent, DbxScheduleSelectionCalendarDatePopoverButtonComponent, DbxScheduleSelectionCalendarDatePopoverComponent, DbxScheduleSelectionCalendarDatePopoverContentComponent, DbxScheduleSelectionCalendarDateRangeComponent, computeCalendarScheduleSelectionDateBlockRange, computeCalendarScheduleSelectionRange, computeScheduleSelectionRangeAndExclusion, computeScheduleSelectionValue, dateScheduleRangeField, dbxScheduleSelectionCalendarDateDaysFormDayFields, dbxScheduleSelectionCalendarDateDaysFormFields, defaultCalendarScheduleSelectionCellContentFactory, finalizeNewCalendarScheduleSelectionState, initialCalendarScheduleSelectionState, isEnabledDayInCalendarScheduleSelectionState, noSelectionCalendarScheduleSelectionState, provideCalendarScheduleSelectionStoreIfParentIsUnavailable, updateStateWithChangedDates, updateStateWithChangedRange, updateStateWithChangedScheduleDays, updateStateWithDateScheduleRangeValue, updateStateWithFilter };
|
|
1063
|
+
//# sourceMappingURL=dereekb-dbx-form-calendar.mjs.map
|