@dereekb/dbx-form 9.23.17 → 9.23.18
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/lib/calendar.module.d.ts +14 -13
- package/calendar/lib/calendar.schedule.selection.component.d.ts +27 -8
- package/calendar/lib/calendar.schedule.selection.popover.content.component.d.ts +1 -3
- package/calendar/lib/calendar.schedule.selection.store.d.ts +8 -9
- package/calendar/lib/field/schedule/calendar.schedule.field.component.d.ts +7 -1
- package/esm2020/calendar/lib/calendar.module.mjs +5 -1
- package/esm2020/calendar/lib/calendar.schedule.selection.component.mjs +30 -12
- package/esm2020/calendar/lib/calendar.schedule.selection.dialog.component.mjs +1 -1
- package/esm2020/calendar/lib/calendar.schedule.selection.popover.component.mjs +3 -3
- package/esm2020/calendar/lib/calendar.schedule.selection.popover.content.component.mjs +1 -2
- package/esm2020/calendar/lib/calendar.schedule.selection.store.mjs +45 -20
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.component.mjs +10 -3
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.mjs +3 -2
- package/fesm2015/dereekb-dbx-form-calendar.mjs +98 -45
- package/fesm2015/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form-calendar.mjs +95 -43
- package/fesm2020/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/lib/extension/calendar/_calendar.scss +4 -0
- package/mapbox/package.json +4 -4
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as i4 from '@dereekb/dbx-form';
|
|
1
|
+
import * as i4$1 from '@dereekb/dbx-form';
|
|
2
2
|
import { formlyField, propsAndConfigForFieldConfig, flexLayoutWrapper, toggleField, AbstractSyncFormlyFormDirective, provideFormlyContext, DbxFormModule, DbxFormlyModule } from '@dereekb/dbx-form';
|
|
3
3
|
import * as i1$1 from '@dereekb/dbx-web';
|
|
4
4
|
import { AbstractPopoverDirective, AbstractDialogDirective, DbxActionModule, DbxButtonModule, DbxDialogInteractionModule, DbxPopoverInteractionModule, DbxTextModule } from '@dereekb/dbx-web';
|
|
@@ -7,25 +7,26 @@ import { Injectable, SkipSelf, Directive, Injector, Optional, Component, Inject,
|
|
|
7
7
|
import { FieldType } from '@ngx-formly/material';
|
|
8
8
|
import { switchMap, first, tap, map, distinctUntilChanged, shareReplay, BehaviorSubject, of, startWith, filter, throttleTime } from 'rxjs';
|
|
9
9
|
import { filterMaybe, SubscriptionObject, asObservable } from '@dereekb/rxjs';
|
|
10
|
-
import { DateScheduleDayCode, expandDateScheduleDayCodesToDayOfWeekSet, dateTimingRelativeIndexFactory, dateBlockDayOfWeekFactory, findMaxDate, findMinDate,
|
|
10
|
+
import { DateScheduleDayCode, expandDateScheduleDayCodesToDayOfWeekSet, dateTimingRelativeIndexFactory, dateBlockDayOfWeekFactory, findMaxDate, findMinDate, isSameDateRange, isSameDateDay, isSameDate, isSameDateScheduleRange, dateTimingRelativeIndexArrayFactory, isInfiniteDateRange, copyDateScheduleDateFilterConfig, dateScheduleDateFilter, expandDateScheduleDayCodes, isDateInDateRangeFunction, isDateWithinDateBlockRangeFunction, dateScheduleEncodedWeek, dateBlockTimingDateFactory, enabledDaysFromDateScheduleDayCodes, dateScheduleDayCodesFromEnabledDays, formatToMonthDayString } from '@dereekb/date';
|
|
11
11
|
import { setsAreEquivalent, unique, mergeArrays, iterableToArray, toggleInSet, addToSet, isIndexNumberInIndexRangeFunction, range, minAndMaxNumber, randomNumberFactory, getDaysOfWeekNames } from '@dereekb/util';
|
|
12
12
|
import { ComponentStore } from '@ngrx/component-store';
|
|
13
|
-
import { startOfDay } from 'date-fns';
|
|
13
|
+
import { startOfDay, endOfDay } from 'date-fns';
|
|
14
14
|
import * as i1 from '@dereekb/dbx-web/calendar';
|
|
15
15
|
import { prepareAndSortCalendarEvents, DbxCalendarStore, DbxCalendarModule } from '@dereekb/dbx-web/calendar';
|
|
16
16
|
import * as i3 from '@angular/forms';
|
|
17
17
|
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
18
18
|
import * as i5 from '@angular/material/form-field';
|
|
19
19
|
import { MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormFieldModule } from '@angular/material/form-field';
|
|
20
|
-
import * as
|
|
20
|
+
import * as i4 from '@angular/common';
|
|
21
21
|
import { CommonModule } from '@angular/common';
|
|
22
22
|
import * as i7 from '@angular/material/datepicker';
|
|
23
23
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
24
24
|
import * as i1$2 from '@angular/material/dialog';
|
|
25
|
-
import * as
|
|
25
|
+
import * as i3$1 from '@dereekb/dbx-core';
|
|
26
|
+
import { switchMapDbxInjectionComponentConfig, DbxInjectionComponentModule } from '@dereekb/dbx-core';
|
|
27
|
+
import * as i6 from 'angular-calendar';
|
|
26
28
|
import { CalendarModule, CalendarDayModule, CalendarWeekModule } from 'angular-calendar';
|
|
27
|
-
import * as i3$2 from '@
|
|
28
|
-
import * as i3$3 from '@angular/material/icon';
|
|
29
|
+
import * as i3$2 from '@angular/material/icon';
|
|
29
30
|
import { MatIconModule } from '@angular/material/icon';
|
|
30
31
|
import * as i2 from '@angular/material/button';
|
|
31
32
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -36,13 +37,14 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
|
36
37
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
37
38
|
|
|
38
39
|
function dateScheduleRangeField(config = {}) {
|
|
39
|
-
const { key = 'schedule', filter, initialSelectionState, computeSelectionResultRelativeToFilter, exclusions } = config;
|
|
40
|
+
const { key = 'schedule', filter, initialSelectionState, computeSelectionResultRelativeToFilter, exclusions, minMaxDateRange } = config;
|
|
40
41
|
const fieldConfig = {
|
|
41
42
|
...formlyField({
|
|
42
43
|
key,
|
|
43
44
|
type: 'date-schedule-range',
|
|
44
45
|
...propsAndConfigForFieldConfig(config, {
|
|
45
46
|
label: config.label ?? 'Schedule',
|
|
47
|
+
minMaxDateRange,
|
|
46
48
|
filter,
|
|
47
49
|
computeSelectionResultRelativeToFilter,
|
|
48
50
|
initialSelectionState,
|
|
@@ -98,22 +100,20 @@ function initialCalendarScheduleSelectionState() {
|
|
|
98
100
|
indexDayOfWeek,
|
|
99
101
|
isEnabledFilterDay: () => true,
|
|
100
102
|
isEnabledDay: () => false,
|
|
101
|
-
minDate: null,
|
|
102
|
-
maxDate: null,
|
|
103
103
|
computeSelectionResultRelativeToFilter: true,
|
|
104
104
|
cellContentFactory: defaultCalendarScheduleSelectionCellContentFactory
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
function calendarScheduleMinDate(x) {
|
|
108
|
-
return findMaxDate([x.filter?.start, x.
|
|
108
|
+
return findMaxDate([x.filter?.start, x.minMaxDateRange?.start]);
|
|
109
109
|
}
|
|
110
110
|
function calendarScheduleMaxDate(x) {
|
|
111
|
-
return findMinDate([x.filter?.end, x.
|
|
111
|
+
return findMinDate([x.filter?.end, x.minMaxDateRange?.end]);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function calendarScheduleMinAndMaxDateRange(x) {
|
|
114
114
|
return {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
start: calendarScheduleMinDate(x) || undefined,
|
|
116
|
+
end: calendarScheduleMaxDate(x) || undefined
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
class DbxCalendarScheduleSelectionStore extends ComponentStore {
|
|
@@ -127,7 +127,10 @@ class DbxCalendarScheduleSelectionStore extends ComponentStore {
|
|
|
127
127
|
});
|
|
128
128
|
// MARK: Accessors
|
|
129
129
|
this.filter$ = this.state$.pipe(map((x) => x.filter), distinctUntilChanged(), shareReplay(1));
|
|
130
|
-
this.
|
|
130
|
+
this.minMaxDateRange$ = this.state$.pipe(map(calendarScheduleMinAndMaxDateRange), distinctUntilChanged(isSameDateRange), shareReplay(1));
|
|
131
|
+
this.minDate$ = this.minMaxDateRange$.pipe(map((x) => x?.start), distinctUntilChanged(isSameDateDay), shareReplay(1));
|
|
132
|
+
this.maxDate$ = this.minMaxDateRange$.pipe(map((x) => x?.end), distinctUntilChanged(isSameDateDay), shareReplay(1));
|
|
133
|
+
this.hasConfiguredMinMaxRange$ = this.minMaxDateRange$.pipe(map((x) => x != null && x.start != null && x.end != null), distinctUntilChanged(), shareReplay(1));
|
|
131
134
|
this.inputStart$ = this.state$.pipe(map((x) => x.inputStart), distinctUntilChanged(isSameDate), shareReplay(1));
|
|
132
135
|
this.inputEnd$ = this.state$.pipe(map((x) => x.inputEnd), distinctUntilChanged(isSameDate), shareReplay(1));
|
|
133
136
|
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) => {
|
|
@@ -161,11 +164,10 @@ class DbxCalendarScheduleSelectionStore extends ComponentStore {
|
|
|
161
164
|
this.selectionValue$ = this.currentSelectionValue$.pipe(filterMaybe(), shareReplay(1));
|
|
162
165
|
this.currentDateScheduleRangeValue$ = this.currentSelectionValue$.pipe(map((x) => x?.dateScheduleRange), distinctUntilChanged(isSameDateScheduleRange), shareReplay(1));
|
|
163
166
|
this.dateScheduleRangeValue$ = this.currentDateScheduleRangeValue$.pipe(filterMaybe(), shareReplay(1));
|
|
164
|
-
this.minDate$ = this.state$.pipe(map(calendarScheduleMinDate), distinctUntilChanged(isSameDateDay), shareReplay(1));
|
|
165
|
-
this.maxDate$ = this.state$.pipe(map(calendarScheduleMaxDate), distinctUntilChanged(isSameDateDay), shareReplay(1));
|
|
166
167
|
this.cellContentFactory$ = this.state$.pipe(map((x) => x.cellContentFactory), distinctUntilChanged(), shareReplay(1));
|
|
167
168
|
this.isCustomized$ = this.state$.pipe(map((x) => x.selectedIndexes.size > 0), distinctUntilChanged(), shareReplay(1));
|
|
168
169
|
// MARK: State Changes
|
|
170
|
+
this.setMinMaxDateRange = this.updater((state, filter) => updateStateWithMinMaxDateRange(state, filter));
|
|
169
171
|
this.setFilter = this.updater((state, filter) => updateStateWithFilter(state, filter));
|
|
170
172
|
this.setExclusions = this.updater((state, exclusions) => updateStateWithExclusions(state, exclusions));
|
|
171
173
|
this.setComputeSelectionResultRelativeToFilter = this.updater((state, computeSelectionResultRelativeToFilter) => updateStateWithComputeSelectionResultRelativeToFilter(state, computeSelectionResultRelativeToFilter));
|
|
@@ -213,11 +215,25 @@ function updateStateWithExclusions(state, inputExclusions) {
|
|
|
213
215
|
state = { ...state, inputExclusions, computedExclusions };
|
|
214
216
|
return updateStateWithFilter(state, state.filter);
|
|
215
217
|
}
|
|
218
|
+
function updateStateWithMinMaxDateRange(state, minMaxDateRange) {
|
|
219
|
+
state = { ...state };
|
|
220
|
+
if (minMaxDateRange != null && !isInfiniteDateRange(minMaxDateRange)) {
|
|
221
|
+
state.minMaxDateRange = {
|
|
222
|
+
start: minMaxDateRange.start != null ? startOfDay(minMaxDateRange.start) : undefined,
|
|
223
|
+
end: minMaxDateRange.end != null ? endOfDay(minMaxDateRange.end) : undefined
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
delete state.minMaxDateRange;
|
|
228
|
+
}
|
|
229
|
+
return updateStateWithFilter(state, state.filter);
|
|
230
|
+
}
|
|
216
231
|
function updateStateWithFilter(state, inputFilter) {
|
|
217
|
-
const { computedExclusions: exclusions } = state;
|
|
232
|
+
const { computedExclusions: exclusions, minMaxDateRange } = state;
|
|
218
233
|
let isEnabledFilterDay = () => true;
|
|
219
234
|
let filter = null;
|
|
220
|
-
|
|
235
|
+
// create the filter using inputFilter, exclusions, and minMaxDateRange
|
|
236
|
+
if (inputFilter || exclusions?.length || minMaxDateRange) {
|
|
221
237
|
let enabledFilter;
|
|
222
238
|
if (inputFilter) {
|
|
223
239
|
filter = copyDateScheduleDateFilterConfig(inputFilter); // copy filter
|
|
@@ -237,10 +253,20 @@ function updateStateWithFilter(state, inputFilter) {
|
|
|
237
253
|
ex: exclusions
|
|
238
254
|
};
|
|
239
255
|
}
|
|
256
|
+
if (minMaxDateRange) {
|
|
257
|
+
enabledFilter.minMaxDateRange = minMaxDateRange;
|
|
258
|
+
enabledFilter.setStartAsMinDate = false;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* If the input filter has a start date, use that as the relative start to ensure indexes are compared the same,
|
|
262
|
+
* otherwise use the state's start. This is important for the index calculations.
|
|
263
|
+
*/
|
|
264
|
+
enabledFilter.start = inputFilter?.start ?? state.start;
|
|
265
|
+
// create the filter
|
|
240
266
|
isEnabledFilterDay = dateScheduleDateFilter(enabledFilter);
|
|
241
267
|
}
|
|
242
268
|
state = { ...state, filter, isEnabledFilterDay };
|
|
243
|
-
//
|
|
269
|
+
// For the same reason as above, use the filter's start date as the relative start if applicable.
|
|
244
270
|
if (filter && filter.start) {
|
|
245
271
|
const start = filter.start;
|
|
246
272
|
state.start = start;
|
|
@@ -286,8 +312,8 @@ function updateStateWithChangedScheduleDays(state, change) {
|
|
|
286
312
|
}
|
|
287
313
|
}
|
|
288
314
|
function updateStateWithChangedDates(state, change) {
|
|
289
|
-
const { indexFactory, allowedDaysOfWeek, indexDayOfWeek, inputStart: currentInputStart, inputEnd: currentInputEnd } = state;
|
|
290
|
-
const { minDate, maxDate } =
|
|
315
|
+
const { indexFactory, allowedDaysOfWeek, indexDayOfWeek, inputStart: currentInputStart, inputEnd: currentInputEnd, minMaxDateRange } = state;
|
|
316
|
+
const { start: minDate, end: maxDate } = calendarScheduleMinAndMaxDateRange(state);
|
|
291
317
|
let inputStart = currentInputStart;
|
|
292
318
|
let inputEnd = currentInputEnd;
|
|
293
319
|
let selectedIndexes;
|
|
@@ -341,9 +367,10 @@ function noSelectionCalendarScheduleSelectionState(state) {
|
|
|
341
367
|
return finalizeNewCalendarScheduleSelectionState({ ...state, selectedIndexes: new Set(), inputStart: null, inputEnd: null });
|
|
342
368
|
}
|
|
343
369
|
function updateStateWithChangedRange(state, change) {
|
|
344
|
-
const { inputStart: currentInputStart, inputEnd: currentInputEnd, indexFactory,
|
|
370
|
+
const { inputStart: currentInputStart, inputEnd: currentInputEnd, indexFactory, minMaxDateRange } = state;
|
|
371
|
+
const { start: minDate, end: maxDate } = minMaxDateRange ?? {};
|
|
345
372
|
let inputStart = startOfDay(change.inputStart);
|
|
346
|
-
let inputEnd =
|
|
373
|
+
let inputEnd = endOfDay(change.inputEnd);
|
|
347
374
|
const isValidRange = minDate != null || maxDate != null ? isDateInDateRangeFunction({ start: minDate ?? undefined, end: maxDate ?? undefined }) : () => true;
|
|
348
375
|
if (!isValidRange(inputStart) || !isValidRange(inputEnd) || (isSameDateDay(inputStart, currentInputStart) && isSameDateDay(inputEnd, currentInputEnd))) {
|
|
349
376
|
return state; // if no change, return the current state.
|
|
@@ -606,7 +633,7 @@ class DbxScheduleSelectionCalendarDateRangeComponent {
|
|
|
606
633
|
}
|
|
607
634
|
}
|
|
608
635
|
DbxScheduleSelectionCalendarDateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateRangeComponent, deps: [{ token: i1.DbxCalendarStore }, { token: DbxCalendarScheduleSelectionStore }, { token: MAT_FORM_FIELD_DEFAULT_OPTIONS }], target: i0.ɵɵFactoryTarget.Component });
|
|
609
|
-
DbxScheduleSelectionCalendarDateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateRangeComponent, selector: "dbx-schedule-selection-calendar-date-range", inputs: { required: "required", label: "label", hint: "hint", disabled: "disabled", showCustomize: "showCustomize" }, ngImport: i0, template: "<mat-form-field class=\"dbx-schedule-selection-calendar-date-range-field\">\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 <dbx-button-spacer></dbx-button-spacer>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <dbx-button-spacer></dbx-button-spacer>\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 <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-hint>{{ hint }}</mat-hint>\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:
|
|
636
|
+
DbxScheduleSelectionCalendarDateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDateRangeComponent, selector: "dbx-schedule-selection-calendar-date-range", inputs: { required: "required", label: "label", hint: "hint", disabled: "disabled", showCustomize: "showCustomize" }, ngImport: i0, template: "<mat-form-field class=\"dbx-schedule-selection-calendar-date-range-field\">\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 <dbx-button-spacer></dbx-button-spacer>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <dbx-button-spacer></dbx-button-spacer>\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 <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-hint>{{ hint }}</mat-hint>\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: i4.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.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { 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: i4.AsyncPipe, name: "async" }] });
|
|
610
637
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateRangeComponent, decorators: [{
|
|
611
638
|
type: Component,
|
|
612
639
|
args: [{ selector: 'dbx-schedule-selection-calendar-date-range', template: "<mat-form-field class=\"dbx-schedule-selection-calendar-date-range-field\">\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 <dbx-button-spacer></dbx-button-spacer>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <dbx-button-spacer></dbx-button-spacer>\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 <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-hint>{{ hint }}</mat-hint>\n</mat-form-field>\n" }]
|
|
@@ -647,7 +674,7 @@ class DbxScheduleSelectionCalendarDateDaysFormComponent extends AbstractSyncForm
|
|
|
647
674
|
DbxScheduleSelectionCalendarDateDaysFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
648
675
|
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: `
|
|
649
676
|
<dbx-formly></dbx-formly>
|
|
650
|
-
`, isInline: true, dependencies: [{ kind: "component", type: i4.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
677
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i4$1.DbxFormlyFormComponent, selector: "dbx-formly", exportAs: ["formly"] }] });
|
|
651
678
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysFormComponent, decorators: [{
|
|
652
679
|
type: Component,
|
|
653
680
|
args: [{
|
|
@@ -679,7 +706,7 @@ DbxScheduleSelectionCalendarDateDaysComponent.ɵcmp = i0.ɵɵngDeclareComponent(
|
|
|
679
706
|
<div class="dbx-schedule-selection-calendar-date-days" dbxAction dbxActionAutoTrigger dbxActionEnforceModified [instantTrigger]="true" [dbxActionHandler]="updateScheduleDays">
|
|
680
707
|
<dbx-schedule-selection-calendar-date-days-form dbxActionForm [dbxFormSource]="template$" [dbxActionFormModified]="isFormModified"></dbx-schedule-selection-calendar-date-days-form>
|
|
681
708
|
</div>
|
|
682
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i3$
|
|
709
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i3$1.DbxActionDirective, selector: "dbx-action,[dbxAction],dbx-action-context,[dbxActionContext]", exportAs: ["action", "dbxAction"] }, { kind: "directive", type: i3$1.DbxActionHandlerDirective, selector: "[dbxActionHandler]", inputs: ["dbxActionHandler"] }, { kind: "directive", type: i3$1.DbxActionEnforceModifiedDirective, selector: "[dbxActionEnforceModified]", inputs: ["dbxActionEnforceModified"] }, { kind: "directive", type: i3$1.DbxActionAutoTriggerDirective, selector: "dbxActionAutoTrigger, [dbxActionAutoTrigger]", inputs: ["dbxActionAutoTrigger", "triggerDebounce", "triggerThrottle", "triggerErrorThrottle", "fastTrigger", "instantTrigger", "triggerLimit"] }, { kind: "directive", type: i4$1.DbxActionFormDirective, selector: "[dbxActionForm]", inputs: ["dbxActionFormValidator", "dbxActionFormModified", "formDisabledOnWorking"] }, { kind: "directive", type: i4$1.DbxFormSourceDirective, selector: "[dbxFormSource]", inputs: ["dbxFormSourceMode", "dbxFormSource"] }, { kind: "component", type: DbxScheduleSelectionCalendarDateDaysFormComponent, selector: "dbx-schedule-selection-calendar-date-days-form" }] });
|
|
683
710
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDaysComponent, decorators: [{
|
|
684
711
|
type: Component,
|
|
685
712
|
args: [{
|
|
@@ -693,7 +720,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
693
720
|
}], ctorParameters: function () { return [{ type: i1.DbxCalendarStore }, { type: DbxCalendarScheduleSelectionStore }]; } });
|
|
694
721
|
|
|
695
722
|
class DbxScheduleSelectionCalendarDatePopoverContentComponent {
|
|
696
|
-
ngOnDestroy() { }
|
|
697
723
|
}
|
|
698
724
|
DbxScheduleSelectionCalendarDatePopoverContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
699
725
|
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: `
|
|
@@ -730,7 +756,7 @@ DbxScheduleSelectionCalendarDatePopoverComponent.ɵfac = i0.ɵɵngDeclareFactory
|
|
|
730
756
|
DbxScheduleSelectionCalendarDatePopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarDatePopoverComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
731
757
|
<dbx-popover-content>
|
|
732
758
|
<dbx-popover-scroll-content>
|
|
733
|
-
<dbx-schedule-selection-calendar-date-popover-content
|
|
759
|
+
<dbx-schedule-selection-calendar-date-popover-content></dbx-schedule-selection-calendar-date-popover-content>
|
|
734
760
|
</dbx-popover-scroll-content>
|
|
735
761
|
</dbx-popover-content>
|
|
736
762
|
`, 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" }] });
|
|
@@ -740,7 +766,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
740
766
|
template: `
|
|
741
767
|
<dbx-popover-content>
|
|
742
768
|
<dbx-popover-scroll-content>
|
|
743
|
-
<dbx-schedule-selection-calendar-date-popover-content
|
|
769
|
+
<dbx-schedule-selection-calendar-date-popover-content></dbx-schedule-selection-calendar-date-popover-content>
|
|
744
770
|
</dbx-popover-scroll-content>
|
|
745
771
|
</dbx-popover-content>
|
|
746
772
|
`
|
|
@@ -768,7 +794,7 @@ class DbxScheduleSelectionCalendarDatePopoverButtonComponent {
|
|
|
768
794
|
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 });
|
|
769
795
|
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: `
|
|
770
796
|
<dbx-button #buttonPopoverOrigin icon="date_range" [raised]="true" color="accent" [text]="buttonText$ | async" (buttonClick)="openPopover()"></dbx-button>
|
|
771
|
-
`, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "iconOnly", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { kind: "pipe", type:
|
|
797
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "iconOnly", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
|
|
772
798
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDatePopoverButtonComponent, decorators: [{
|
|
773
799
|
type: Component,
|
|
774
800
|
args: [{
|
|
@@ -803,7 +829,7 @@ DbxScheduleSelectionCalendarCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minV
|
|
|
803
829
|
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: `
|
|
804
830
|
<mat-icon *ngIf="icon">{{ icon }}</mat-icon>
|
|
805
831
|
<span>{{ text }}</span>
|
|
806
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
832
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
807
833
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarCellComponent, decorators: [{
|
|
808
834
|
type: Component,
|
|
809
835
|
args: [{
|
|
@@ -857,7 +883,7 @@ class DbxScheduleSelectionCalendarSelectionToggleButtonComponent {
|
|
|
857
883
|
DbxScheduleSelectionCalendarSelectionToggleButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarSelectionToggleButtonComponent, deps: [{ token: i1$1.DbxPopoverService }, { token: DbxCalendarScheduleSelectionStore }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
858
884
|
DbxScheduleSelectionCalendarSelectionToggleButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarSelectionToggleButtonComponent, selector: "dbx-schedule-selection-calendar-selection-toggle-button", ngImport: i0, template: `
|
|
859
885
|
<dbx-button [disabled]="disableButton$ | async" [buttonDisplay]="buttonDisplay$ | async" [raised]="true" (buttonClick)="toggleSelection()"></dbx-button>
|
|
860
|
-
`, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "iconOnly", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { kind: "pipe", type:
|
|
886
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxButtonComponent, selector: "dbx-button", inputs: ["type", "raised", "stroked", "flat", "iconOnly", "color", "customButtonColor", "customTextColor", "customSpinnerColor"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
|
|
861
887
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarSelectionToggleButtonComponent, decorators: [{
|
|
862
888
|
type: Component,
|
|
863
889
|
args: [{
|
|
@@ -872,6 +898,9 @@ class DbxScheduleSelectionCalendarComponent {
|
|
|
872
898
|
constructor(calendarStore, dbxCalendarScheduleSelectionStore) {
|
|
873
899
|
this.calendarStore = calendarStore;
|
|
874
900
|
this.dbxCalendarScheduleSelectionStore = dbxCalendarScheduleSelectionStore;
|
|
901
|
+
this._config = new BehaviorSubject({});
|
|
902
|
+
this.showClearSelectionButton$ = this._config.pipe(map((config) => config.showClearSelectionButton ?? true), distinctUntilChanged());
|
|
903
|
+
this.datePopoverButtonInjectionConfig$ = this._config.pipe(map((x) => x.buttonInjectionConfig), switchMapDbxInjectionComponentConfig(DbxScheduleSelectionCalendarDatePopoverButtonComponent), shareReplay(1));
|
|
875
904
|
this.clickEvent = new EventEmitter();
|
|
876
905
|
// refresh any time the selected day function updates
|
|
877
906
|
this.state$ = this.dbxCalendarScheduleSelectionStore.state$;
|
|
@@ -879,6 +908,20 @@ class DbxScheduleSelectionCalendarComponent {
|
|
|
879
908
|
this.events$ = this.calendarStore.visibleEvents$.pipe(map(prepareAndSortCalendarEvents), shareReplay(1));
|
|
880
909
|
this.viewDate$ = this.calendarStore.date$;
|
|
881
910
|
}
|
|
911
|
+
ngOnInit() {
|
|
912
|
+
this.calendarStore.setNavigationRangeLimit(this.dbxCalendarScheduleSelectionStore.minMaxDateRange$); // set navigation limit to the min/max allowed dates.
|
|
913
|
+
this.calendarStore.setShowPageButtons(true);
|
|
914
|
+
}
|
|
915
|
+
ngOnDestroy() {
|
|
916
|
+
this.clickEvent.complete();
|
|
917
|
+
this._config.complete();
|
|
918
|
+
}
|
|
919
|
+
get config() {
|
|
920
|
+
return this._config.value;
|
|
921
|
+
}
|
|
922
|
+
set config(config) {
|
|
923
|
+
this._config.next(config);
|
|
924
|
+
}
|
|
882
925
|
dayClicked({ date }) {
|
|
883
926
|
this.dbxCalendarScheduleSelectionStore.toggleSelectedDates(date);
|
|
884
927
|
}
|
|
@@ -916,17 +959,16 @@ class DbxScheduleSelectionCalendarComponent {
|
|
|
916
959
|
});
|
|
917
960
|
});
|
|
918
961
|
}
|
|
919
|
-
ngOnDestroy() {
|
|
920
|
-
this.clickEvent.complete();
|
|
921
|
-
}
|
|
922
962
|
}
|
|
923
963
|
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 });
|
|
924
|
-
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-selection-toggle-button></dbx-schedule-selection-calendar-selection-toggle-button>\n
|
|
964
|
+
DbxScheduleSelectionCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxScheduleSelectionCalendarComponent, selector: "dbx-schedule-selection-calendar", inputs: { config: "config" }, outputs: { clickEvent: "clickEvent" }, providers: [DbxCalendarStore], ngImport: i0, template: "<dbx-calendar-base class=\"dbx-schedule-selection-calendar\">\n <ng-container controls>\n <ng-container *ngIf=\"showClearSelectionButton$ | async\">\n <dbx-schedule-selection-calendar-selection-toggle-button></dbx-schedule-selection-calendar-selection-toggle-button>\n <dbx-button-spacer></dbx-button-spacer>\n </ng-container>\n <dbx-injection [config]=\"datePopoverButtonInjectionConfig$ | async\"></dbx-injection>\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: i3$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "component", type: i1.DbxCalendarBaseComponent, selector: "dbx-calendar-base" }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { kind: "component", type: i6.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: DbxScheduleSelectionCalendarCellComponent, selector: "dbx-schedule-selection-calendar-cell", inputs: ["day"] }, { kind: "component", type: DbxScheduleSelectionCalendarSelectionToggleButtonComponent, selector: "dbx-schedule-selection-calendar-selection-toggle-button" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.ɵCalendarDatePipe, name: "calendarDate" }] });
|
|
925
965
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarComponent, decorators: [{
|
|
926
966
|
type: Component,
|
|
927
|
-
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-selection-toggle-button></dbx-schedule-selection-calendar-selection-toggle-button>\n
|
|
967
|
+
args: [{ selector: 'dbx-schedule-selection-calendar', providers: [DbxCalendarStore], template: "<dbx-calendar-base class=\"dbx-schedule-selection-calendar\">\n <ng-container controls>\n <ng-container *ngIf=\"showClearSelectionButton$ | async\">\n <dbx-schedule-selection-calendar-selection-toggle-button></dbx-schedule-selection-calendar-selection-toggle-button>\n <dbx-button-spacer></dbx-button-spacer>\n </ng-container>\n <dbx-injection [config]=\"datePopoverButtonInjectionConfig$ | async\"></dbx-injection>\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" }]
|
|
928
968
|
}], ctorParameters: function () { return [{ type: i1.DbxCalendarStore }, { type: DbxCalendarScheduleSelectionStore }]; }, propDecorators: { clickEvent: [{
|
|
929
969
|
type: Output
|
|
970
|
+
}], config: [{
|
|
971
|
+
type: Input
|
|
930
972
|
}] } });
|
|
931
973
|
|
|
932
974
|
class DbxScheduleSelectionCalendarDateDialogComponent extends AbstractDialogDirective {
|
|
@@ -947,7 +989,7 @@ DbxScheduleSelectionCalendarDateDialogComponent.ɵcmp = i0.ɵɵngDeclareComponen
|
|
|
947
989
|
<dbx-schedule-selection-calendar></dbx-schedule-selection-calendar>
|
|
948
990
|
<dbx-dialog-content-footer closeText="Close Calendar" (close)="close()"></dbx-dialog-content-footer>
|
|
949
991
|
</dbx-dialog-content>
|
|
950
|
-
`, 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"] }] });
|
|
992
|
+
`, 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", inputs: ["config"], outputs: ["clickEvent"] }] });
|
|
951
993
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxScheduleSelectionCalendarDateDialogComponent, decorators: [{
|
|
952
994
|
type: Component,
|
|
953
995
|
args: [{
|
|
@@ -995,6 +1037,7 @@ class DbxFormCalendarDateScheduleRangeFieldComponent extends FieldType {
|
|
|
995
1037
|
this.ngZone = ngZone;
|
|
996
1038
|
this._syncSub = new SubscriptionObject();
|
|
997
1039
|
this._valueSub = new SubscriptionObject();
|
|
1040
|
+
this._minMaxDateRangeSub = new SubscriptionObject();
|
|
998
1041
|
this._filterSub = new SubscriptionObject();
|
|
999
1042
|
this._exclusionsSub = new SubscriptionObject();
|
|
1000
1043
|
this._formControlObs = new BehaviorSubject(undefined);
|
|
@@ -1019,6 +1062,9 @@ class DbxFormCalendarDateScheduleRangeFieldComponent extends FieldType {
|
|
|
1019
1062
|
get showCustomize() {
|
|
1020
1063
|
return !this.props.hideCustomize;
|
|
1021
1064
|
}
|
|
1065
|
+
get minMaxDateRange() {
|
|
1066
|
+
return this.props.minMaxDateRange;
|
|
1067
|
+
}
|
|
1022
1068
|
get filter() {
|
|
1023
1069
|
return this.props.filter;
|
|
1024
1070
|
}
|
|
@@ -1039,10 +1085,13 @@ class DbxFormCalendarDateScheduleRangeFieldComponent extends FieldType {
|
|
|
1039
1085
|
this._valueSub.subscription = this.dbxCalendarScheduleSelectionStore.currentDateScheduleRangeValue$.subscribe((x) => {
|
|
1040
1086
|
this.formControl.setValue(x);
|
|
1041
1087
|
});
|
|
1042
|
-
const { filter, exclusions } = this;
|
|
1088
|
+
const { minMaxDateRange, filter, exclusions } = this;
|
|
1043
1089
|
if (filter != null) {
|
|
1044
1090
|
this._filterSub.subscription = this.dbxCalendarScheduleSelectionStore.setFilter(asObservable(filter));
|
|
1045
1091
|
}
|
|
1092
|
+
if (minMaxDateRange != null) {
|
|
1093
|
+
this._minMaxDateRangeSub.subscription = this.dbxCalendarScheduleSelectionStore.setMinMaxDateRange(asObservable(minMaxDateRange));
|
|
1094
|
+
}
|
|
1046
1095
|
if (exclusions != null) {
|
|
1047
1096
|
this._exclusionsSub.subscription = this.dbxCalendarScheduleSelectionStore.setExclusions(asObservable(exclusions));
|
|
1048
1097
|
}
|
|
@@ -1052,13 +1101,13 @@ class DbxFormCalendarDateScheduleRangeFieldComponent extends FieldType {
|
|
|
1052
1101
|
if (this.computeSelectionResultRelativeToFilter != null) {
|
|
1053
1102
|
this.dbxCalendarScheduleSelectionStore.setComputeSelectionResultRelativeToFilter(this.computeSelectionResultRelativeToFilter);
|
|
1054
1103
|
}
|
|
1055
|
-
// TODO: Also add ability to set min/max dates independent of the filter
|
|
1056
1104
|
}
|
|
1057
1105
|
ngOnDestroy() {
|
|
1058
1106
|
super.ngOnDestroy();
|
|
1059
1107
|
this._syncSub.destroy();
|
|
1060
1108
|
this._valueSub.destroy();
|
|
1061
1109
|
this._filterSub.destroy();
|
|
1110
|
+
this._minMaxDateRangeSub.destroy();
|
|
1062
1111
|
this._exclusionsSub.destroy();
|
|
1063
1112
|
this._formControlObs.complete();
|
|
1064
1113
|
}
|
|
@@ -1120,6 +1169,7 @@ DbxFormCalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", v
|
|
|
1120
1169
|
DbxScheduleSelectionCalendarDateDialogButtonComponent,
|
|
1121
1170
|
DbxScheduleSelectionCalendarSelectionToggleButtonComponent], imports: [
|
|
1122
1171
|
//
|
|
1172
|
+
DbxInjectionComponentModule,
|
|
1123
1173
|
DbxActionModule,
|
|
1124
1174
|
DbxFormModule,
|
|
1125
1175
|
DbxFormlyModule,
|
|
@@ -1154,6 +1204,7 @@ DbxFormCalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", v
|
|
|
1154
1204
|
DbxScheduleSelectionCalendarSelectionToggleButtonComponent] });
|
|
1155
1205
|
DbxFormCalendarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFormCalendarModule, imports: [
|
|
1156
1206
|
//
|
|
1207
|
+
DbxInjectionComponentModule,
|
|
1157
1208
|
DbxActionModule,
|
|
1158
1209
|
DbxFormModule,
|
|
1159
1210
|
DbxFormlyModule,
|
|
@@ -1178,6 +1229,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
1178
1229
|
args: [{
|
|
1179
1230
|
imports: [
|
|
1180
1231
|
//
|
|
1232
|
+
DbxInjectionComponentModule,
|
|
1181
1233
|
DbxActionModule,
|
|
1182
1234
|
DbxFormModule,
|
|
1183
1235
|
DbxFormlyModule,
|
|
@@ -1251,5 +1303,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
1251
1303
|
* Generated bundle index. Do not edit.
|
|
1252
1304
|
*/
|
|
1253
1305
|
|
|
1254
|
-
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, DbxScheduleSelectionCalendarSelectionToggleButtonComponent, calendarScheduleMaxDate,
|
|
1306
|
+
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, DbxScheduleSelectionCalendarSelectionToggleButtonComponent, calendarScheduleMaxDate, calendarScheduleMinAndMaxDateRange, calendarScheduleMinDate, computeCalendarScheduleSelectionDateBlockRange, computeCalendarScheduleSelectionRange, computeScheduleSelectionRangeAndExclusion, computeScheduleSelectionValue, dateScheduleRangeField, dbxScheduleSelectionCalendarDateDaysFormDayFields, dbxScheduleSelectionCalendarDateDaysFormFields, defaultCalendarScheduleSelectionCellContentFactory, finalizeNewCalendarScheduleSelectionState, initialCalendarScheduleSelectionState, isEnabledDayInCalendarScheduleSelectionState, noSelectionCalendarScheduleSelectionState, provideCalendarScheduleSelectionStoreIfParentIsUnavailable, updateStateWithChangedDates, updateStateWithChangedRange, updateStateWithChangedScheduleDays, updateStateWithComputeSelectionResultRelativeToFilter, updateStateWithDateScheduleRangeValue, updateStateWithExclusions, updateStateWithFilter, updateStateWithInitialSelectionState, updateStateWithMinMaxDateRange };
|
|
1255
1307
|
//# sourceMappingURL=dereekb-dbx-form-calendar.mjs.map
|