@dereekb/dbx-form 9.23.8 → 9.23.10
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.schedule.selection.store.d.ts +24 -2
- package/calendar/lib/field/schedule/calendar.schedule.field.component.d.ts +5 -3
- package/esm2020/calendar/lib/calendar.schedule.selection.store.mjs +101 -35
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.component.mjs +13 -1
- package/esm2020/calendar/lib/field/schedule/calendar.schedule.field.mjs +5 -3
- package/esm2020/lib/formly/field/selection/sourceselect/sourceselect.field.component.mjs +10 -6
- package/esm2020/lib/formly/field/selection/sourceselect/sourceselect.mjs +1 -1
- package/esm2020/lib/formly/template/timezone.mjs +2 -1
- package/fesm2015/dereekb-dbx-form-calendar.mjs +121 -38
- package/fesm2015/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2015/dereekb-dbx-form.mjs +10 -6
- package/fesm2015/dereekb-dbx-form.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form-calendar.mjs +118 -38
- package/fesm2020/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form.mjs +10 -5
- package/fesm2020/dereekb-dbx-form.mjs.map +1 -1
- package/lib/extension/calendar/_calendar.scss +2 -0
- package/lib/formly/field/selection/sourceselect/sourceselect.d.ts +8 -1
- package/lib/formly/field/selection/sourceselect/sourceselect.field.component.d.ts +2 -1
- package/mapbox/package.json +4 -4
- package/package.json +4 -4
|
@@ -5,10 +5,10 @@ import { Injectable, SkipSelf, Directive, Injector, Optional, Component, Inject,
|
|
|
5
5
|
import { FieldType } from '@ngx-formly/material';
|
|
6
6
|
import { map, distinctUntilChanged, shareReplay, BehaviorSubject, switchMap, of, startWith, filter, throttleTime, first } from 'rxjs';
|
|
7
7
|
import { filterMaybe, SubscriptionObject, asObservable } from '@dereekb/rxjs';
|
|
8
|
-
import { DateScheduleDayCode, expandDateScheduleDayCodesToDayOfWeekSet, dateTimingRelativeIndexFactory, dateBlockDayOfWeekFactory, isSameDate, isSameDateRange, isSameDateScheduleRange,
|
|
9
|
-
import { setsAreEquivalent, iterableToArray, toggleInSet, addToSet, isIndexNumberInIndexRangeFunction,
|
|
8
|
+
import { DateScheduleDayCode, expandDateScheduleDayCodesToDayOfWeekSet, dateTimingRelativeIndexFactory, dateBlockDayOfWeekFactory, findMaxDate, findMinDate, isSameDate, isSameDateRange, isSameDateScheduleRange, isSameDateDay, copyDateScheduleDateFilterConfig, dateScheduleDateFilter, expandDateScheduleDayCodes, isDateInDateRangeFunction, isDateWithinDateBlockRangeFunction, dateScheduleEncodedWeek, dateBlockTimingDateFactory, enabledDaysFromDateScheduleDayCodes, dateScheduleDayCodesFromEnabledDays, formatToMonthDayString } from '@dereekb/date';
|
|
9
|
+
import { setsAreEquivalent, range, iterableToArray, toggleInSet, addToSet, isIndexNumberInIndexRangeFunction, minAndMaxNumber, randomNumberFactory, getDaysOfWeekNames } from '@dereekb/util';
|
|
10
10
|
import { ComponentStore } from '@ngrx/component-store';
|
|
11
|
-
import { startOfDay
|
|
11
|
+
import { startOfDay } from 'date-fns';
|
|
12
12
|
import * as i1$1 from '@dereekb/dbx-web';
|
|
13
13
|
import { AbstractPopoverDirective, AbstractDialogDirective, DbxActionModule, DbxButtonModule, DbxDialogInteractionModule, DbxPopoverInteractionModule, DbxTextModule } from '@dereekb/dbx-web';
|
|
14
14
|
import * as i3 from '@angular/forms';
|
|
@@ -37,10 +37,12 @@ import { FlexLayoutModule } from '@angular/flex-layout';
|
|
|
37
37
|
|
|
38
38
|
function dateScheduleRangeField(config = {}) {
|
|
39
39
|
var _a;
|
|
40
|
-
const { key = 'schedule', filter } = config;
|
|
40
|
+
const { key = 'schedule', filter, initialSelectionState, computeSelectionResultRelativeToFilter } = config;
|
|
41
41
|
const fieldConfig = Object.assign({}, formlyField(Object.assign({ key, type: 'date-schedule-range' }, propsAndConfigForFieldConfig(config, {
|
|
42
42
|
label: (_a = config.label) !== null && _a !== void 0 ? _a : 'Schedule',
|
|
43
|
-
filter
|
|
43
|
+
filter,
|
|
44
|
+
computeSelectionResultRelativeToFilter,
|
|
45
|
+
initialSelectionState
|
|
44
46
|
}))));
|
|
45
47
|
return fieldConfig;
|
|
46
48
|
}
|
|
@@ -91,11 +93,26 @@ function initialCalendarScheduleSelectionState() {
|
|
|
91
93
|
indexDayOfWeek,
|
|
92
94
|
isEnabledFilterDay: () => true,
|
|
93
95
|
isEnabledDay: () => false,
|
|
94
|
-
minDate:
|
|
95
|
-
maxDate:
|
|
96
|
+
minDate: null,
|
|
97
|
+
maxDate: null,
|
|
98
|
+
computeSelectionResultRelativeToFilter: true,
|
|
96
99
|
cellContentFactory: defaultCalendarScheduleSelectionCellContentFactory
|
|
97
100
|
};
|
|
98
101
|
}
|
|
102
|
+
function calendarScheduleMinDate(x) {
|
|
103
|
+
var _a;
|
|
104
|
+
return findMaxDate([(_a = x.filter) === null || _a === void 0 ? void 0 : _a.start, x.minDate]);
|
|
105
|
+
}
|
|
106
|
+
function calendarScheduleMaxDate(x) {
|
|
107
|
+
var _a;
|
|
108
|
+
return findMinDate([(_a = x.filter) === null || _a === void 0 ? void 0 : _a.end, x.maxDate]);
|
|
109
|
+
}
|
|
110
|
+
function calendarScheduleMinAndMaxDate(x) {
|
|
111
|
+
return {
|
|
112
|
+
minDate: calendarScheduleMinDate(x),
|
|
113
|
+
maxDate: calendarScheduleMaxDate(x)
|
|
114
|
+
};
|
|
115
|
+
}
|
|
99
116
|
class DbxCalendarScheduleSelectionStore extends ComponentStore {
|
|
100
117
|
constructor() {
|
|
101
118
|
super(initialCalendarScheduleSelectionState());
|
|
@@ -116,18 +133,21 @@ class DbxCalendarScheduleSelectionStore extends ComponentStore {
|
|
|
116
133
|
this.isEnabledFilterDayFunction$ = this.state$.pipe(map((x) => x.isEnabledFilterDay), shareReplay(1));
|
|
117
134
|
this.isEnabledDayFunction$ = this.state$.pipe(map((x) => x.isEnabledDay), shareReplay(1));
|
|
118
135
|
this.currentDateRange$ = this.state$.pipe(map(computeCalendarScheduleSelectionRange), distinctUntilChanged((a, b) => isSameDateRange(a, b)), shareReplay(1));
|
|
136
|
+
this.computeSelectionResultRelativeToFilter$ = this.state$.pipe(map((x) => x.computeSelectionResultRelativeToFilter), shareReplay(1));
|
|
137
|
+
this.startBeingUsedFromFilter$ = this.state$.pipe(map((x) => { var _a; return x.computeSelectionResultRelativeToFilter && ((_a = x.filter) === null || _a === void 0 ? void 0 : _a.start) != null; }), shareReplay(1));
|
|
119
138
|
this.dateRange$ = this.currentDateRange$.pipe(filterMaybe(), shareReplay(1));
|
|
120
139
|
this.scheduleDays$ = this.state$.pipe(map((x) => x.scheduleDays), distinctUntilChanged(setsAreEquivalent), shareReplay(1));
|
|
121
140
|
this.currentSelectionValue$ = this.state$.pipe(map((x) => x.currentSelectionValue), shareReplay(1));
|
|
122
141
|
this.selectionValue$ = this.currentSelectionValue$.pipe(filterMaybe(), shareReplay(1));
|
|
123
142
|
this.currentDateScheduleRangeValue$ = this.currentSelectionValue$.pipe(map((x) => x === null || x === void 0 ? void 0 : x.dateScheduleRange), distinctUntilChanged(isSameDateScheduleRange), shareReplay(1));
|
|
124
143
|
this.dateScheduleRangeValue$ = this.currentDateScheduleRangeValue$.pipe(filterMaybe(), shareReplay(1));
|
|
125
|
-
this.minDate$ = this.state$.pipe(map(
|
|
126
|
-
this.maxDate$ = this.state$.pipe(map(
|
|
144
|
+
this.minDate$ = this.state$.pipe(map(calendarScheduleMinDate), distinctUntilChanged(isSameDateDay), shareReplay(1));
|
|
145
|
+
this.maxDate$ = this.state$.pipe(map(calendarScheduleMaxDate), distinctUntilChanged(isSameDateDay), shareReplay(1));
|
|
127
146
|
this.cellContentFactory$ = this.state$.pipe(map((x) => x.cellContentFactory), distinctUntilChanged(), shareReplay(1));
|
|
128
147
|
this.isCustomized$ = this.state$.pipe(map((x) => x.selectedIndexes.size > 0), distinctUntilChanged(), shareReplay(1));
|
|
129
148
|
// MARK: State Changes
|
|
130
149
|
this.setFilter = this.updater((state, filter) => updateStateWithFilter(state, filter));
|
|
150
|
+
this.setComputeSelectionResultRelativeToFilter = this.updater((state, computeSelectionResultRelativeToFilter) => updateStateWithComputeSelectionResultRelativeToFilter(state, computeSelectionResultRelativeToFilter));
|
|
131
151
|
this.clearFilter = this.updater((state) => updateStateWithFilter(state, undefined));
|
|
132
152
|
this.setTimezone = this.updater((state, timezone) => (Object.assign(Object.assign({}, state), { timezone })));
|
|
133
153
|
this.setInputRange = this.updater((state, range) => updateStateWithChangedRange(state, range));
|
|
@@ -135,6 +155,8 @@ class DbxCalendarScheduleSelectionStore extends ComponentStore {
|
|
|
135
155
|
this.addSelectedDates = this.updater((state, add) => updateStateWithChangedDates(state, { add }));
|
|
136
156
|
this.removeSelectedDates = this.updater((state, remove) => updateStateWithChangedDates(state, { remove }));
|
|
137
157
|
this.setSelectedDates = this.updater((state, set) => updateStateWithChangedDates(state, { set }));
|
|
158
|
+
this.selectAllDates = this.updater((state, selectAll = 'all') => updateStateWithChangedDates(state, { selectAll }));
|
|
159
|
+
this.setInitialSelectionState = this.updater((state, initialSelectionState) => updateStateWithInitialSelectionState(state, initialSelectionState));
|
|
138
160
|
this.setScheduleDays = this.updater((state, scheduleDays) => updateStateWithChangedScheduleDays(state, scheduleDays));
|
|
139
161
|
this.setAllowAllScheduleDays = this.updater((state) => updateStateWithChangedScheduleDays(state, null));
|
|
140
162
|
this.setDateScheduleRangeValue = this.updater((state, value) => updateStateWithDateScheduleRangeValue(state, value));
|
|
@@ -146,12 +168,38 @@ DbxCalendarScheduleSelectionStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersi
|
|
|
146
168
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxCalendarScheduleSelectionStore, decorators: [{
|
|
147
169
|
type: Injectable
|
|
148
170
|
}], ctorParameters: function () { return []; } });
|
|
149
|
-
function
|
|
171
|
+
function updateStateWithInitialSelectionState(state, initialSelectionState) {
|
|
172
|
+
const { selectedIndexes } = state;
|
|
173
|
+
if (selectedIndexes.size === 0 && initialSelectionState === 'all') {
|
|
174
|
+
state = updateStateWithChangedDates(state, { selectAll: initialSelectionState });
|
|
175
|
+
}
|
|
176
|
+
return Object.assign(Object.assign({}, state), { initialSelectionState });
|
|
177
|
+
}
|
|
178
|
+
function updateStateWithComputeSelectionResultRelativeToFilter(currentState, computeSelectionResultRelativeToFilter) {
|
|
179
|
+
let state = Object.assign(Object.assign({}, currentState), { computeSelectionResultRelativeToFilter });
|
|
180
|
+
if (Boolean(currentState.computeSelectionResultRelativeToFilter) !== Boolean(computeSelectionResultRelativeToFilter)) {
|
|
181
|
+
state = updateStateWithChangedDates(state, {}); // recalculate if change occurs as it will affect the output value
|
|
182
|
+
}
|
|
183
|
+
return state;
|
|
184
|
+
}
|
|
185
|
+
function updateStateWithFilter(state, inputFilter) {
|
|
150
186
|
let isEnabledFilterDay = () => true;
|
|
151
|
-
|
|
187
|
+
let filter = null;
|
|
188
|
+
if (inputFilter) {
|
|
189
|
+
filter = copyDateScheduleDateFilterConfig(inputFilter); // copy filter
|
|
152
190
|
isEnabledFilterDay = dateScheduleDateFilter(filter);
|
|
153
191
|
}
|
|
154
|
-
|
|
192
|
+
state = Object.assign(Object.assign({}, state), { filter, isEnabledFilterDay });
|
|
193
|
+
// attempt to re-apply the initial selection state once filter is applied
|
|
194
|
+
if (state.initialSelectionState) {
|
|
195
|
+
state = updateStateWithInitialSelectionState(state, state.initialSelectionState);
|
|
196
|
+
}
|
|
197
|
+
// re-calculate the selection given the filter
|
|
198
|
+
const { inputStart, inputEnd } = state;
|
|
199
|
+
if (inputStart && inputEnd) {
|
|
200
|
+
state = updateStateWithChangedRange(state, { inputStart, inputEnd });
|
|
201
|
+
}
|
|
202
|
+
return state;
|
|
155
203
|
}
|
|
156
204
|
function updateStateWithDateScheduleRangeValue(state, change) {
|
|
157
205
|
var _a;
|
|
@@ -162,7 +210,7 @@ function updateStateWithDateScheduleRangeValue(state, change) {
|
|
|
162
210
|
else {
|
|
163
211
|
if (change != null) {
|
|
164
212
|
const nextState = Object.assign(Object.assign({}, state), { inputStart: change.start, inputEnd: change.end, selectedIndexes: new Set(change.ex) });
|
|
165
|
-
return updateStateWithChangedScheduleDays(finalizeNewCalendarScheduleSelectionState(nextState),
|
|
213
|
+
return updateStateWithChangedScheduleDays(finalizeNewCalendarScheduleSelectionState(nextState), expandDateScheduleDayCodes(change.w));
|
|
166
214
|
}
|
|
167
215
|
else {
|
|
168
216
|
return noSelectionCalendarScheduleSelectionState(state); // clear selection, retain disabled days
|
|
@@ -182,10 +230,26 @@ function updateStateWithChangedScheduleDays(state, change) {
|
|
|
182
230
|
}
|
|
183
231
|
}
|
|
184
232
|
function updateStateWithChangedDates(state, change) {
|
|
233
|
+
var _a;
|
|
185
234
|
const { indexFactory, allowedDaysOfWeek, indexDayOfWeek } = state;
|
|
235
|
+
const { minDate, maxDate } = calendarScheduleMinAndMaxDate(state);
|
|
186
236
|
let selectedIndexes;
|
|
187
|
-
if (change.set) {
|
|
188
|
-
|
|
237
|
+
if (change.reset || change.selectAll != null || change.set) {
|
|
238
|
+
let set = (_a = change.set) !== null && _a !== void 0 ? _a : [];
|
|
239
|
+
let selectAll = change.reset === true ? state.initialSelectionState : change.selectAll;
|
|
240
|
+
switch (selectAll) {
|
|
241
|
+
case 'all':
|
|
242
|
+
if (minDate != null && maxDate != null) {
|
|
243
|
+
const minIndex = indexFactory(minDate);
|
|
244
|
+
const maxIndex = indexFactory(maxDate);
|
|
245
|
+
set = range(minIndex, maxIndex);
|
|
246
|
+
}
|
|
247
|
+
break;
|
|
248
|
+
case 'none':
|
|
249
|
+
set = [];
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
selectedIndexes = new Set(iterableToArray(set).map(indexFactory));
|
|
189
253
|
}
|
|
190
254
|
else {
|
|
191
255
|
selectedIndexes = new Set(state.selectedIndexes);
|
|
@@ -211,22 +275,22 @@ function updateStateWithChangedDates(state, change) {
|
|
|
211
275
|
}
|
|
212
276
|
else {
|
|
213
277
|
// no selected days
|
|
214
|
-
return noSelectionCalendarScheduleSelectionState(
|
|
278
|
+
return noSelectionCalendarScheduleSelectionState(nextState);
|
|
215
279
|
}
|
|
216
280
|
}
|
|
217
281
|
function noSelectionCalendarScheduleSelectionState(state) {
|
|
218
282
|
return finalizeNewCalendarScheduleSelectionState(Object.assign(Object.assign({}, state), { selectedIndexes: new Set(), inputStart: null, inputEnd: null }));
|
|
219
283
|
}
|
|
220
284
|
function updateStateWithChangedRange(state, change) {
|
|
221
|
-
const { inputStart: currentInputStart, inputEnd: currentInputEnd, indexFactory, minDate, maxDate } = state;
|
|
222
|
-
|
|
223
|
-
|
|
285
|
+
const { inputStart: currentInputStart, inputEnd: currentInputEnd, indexFactory, minDate, maxDate, filter, computeSelectionResultRelativeToFilter } = state;
|
|
286
|
+
let inputStart = startOfDay(change.inputStart);
|
|
287
|
+
let inputEnd = startOfDay(change.inputEnd);
|
|
224
288
|
const isValidRange = minDate != null || maxDate != null ? isDateInDateRangeFunction({ start: minDate !== null && minDate !== void 0 ? minDate : undefined, end: maxDate !== null && maxDate !== void 0 ? maxDate : undefined }) : () => true;
|
|
225
289
|
if (!isValidRange(inputStart) || !isValidRange(inputEnd) || (isSameDateDay(inputStart, currentInputStart) && isSameDateDay(inputEnd, currentInputEnd))) {
|
|
226
290
|
return state; // if no change, return the current state.
|
|
227
291
|
}
|
|
228
292
|
// retain all indexes that are within the new range
|
|
229
|
-
const minIndex = indexFactory(inputStart);
|
|
293
|
+
const minIndex = computeSelectionResultRelativeToFilter && (filter === null || filter === void 0 ? void 0 : filter.start) ? indexFactory(filter === null || filter === void 0 ? void 0 : filter.start) : indexFactory(inputStart);
|
|
230
294
|
const maxIndex = indexFactory(inputEnd) + 1;
|
|
231
295
|
const currentIndexes = Array.from(state.selectedIndexes);
|
|
232
296
|
const isInCurrentRange = isIndexNumberInIndexRangeFunction({ minIndex, maxIndex });
|
|
@@ -259,19 +323,30 @@ function isEnabledDayInCalendarScheduleSelectionState(state) {
|
|
|
259
323
|
};
|
|
260
324
|
}
|
|
261
325
|
function computeScheduleSelectionValue(state) {
|
|
262
|
-
const { scheduleDays, allowedDaysOfWeek, indexDayOfWeek } = state;
|
|
326
|
+
const { indexFactory, scheduleDays, allowedDaysOfWeek, indexDayOfWeek, computeSelectionResultRelativeToFilter, filter } = state;
|
|
263
327
|
const rangeAndExclusion = computeScheduleSelectionRangeAndExclusion(state);
|
|
264
328
|
if (rangeAndExclusion == null) {
|
|
265
329
|
return null;
|
|
266
330
|
}
|
|
267
|
-
const { start, end, excluded, dateBlockRange } = rangeAndExclusion;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
331
|
+
const { start: rangeStart, end, excluded: allExcluded, dateBlockRange } = rangeAndExclusion;
|
|
332
|
+
let filterOffsetExcludedRange = [];
|
|
333
|
+
let indexOffset = dateBlockRange.i;
|
|
334
|
+
let start = rangeStart;
|
|
335
|
+
// If computeSelectionResultRelativeToFilter is true, then we need to offset the values to be relative to that start.
|
|
336
|
+
if (computeSelectionResultRelativeToFilter && (filter === null || filter === void 0 ? void 0 : filter.start)) {
|
|
337
|
+
start = filter.start;
|
|
338
|
+
const filterStartIndexOffset = indexFactory(rangeStart) - indexFactory(start);
|
|
339
|
+
filterOffsetExcludedRange = range(0, filterStartIndexOffset);
|
|
340
|
+
indexOffset = indexOffset - filterStartIndexOffset;
|
|
341
|
+
}
|
|
342
|
+
const excluded = computeSelectionResultRelativeToFilter
|
|
343
|
+
? allExcluded.filter((x) => {
|
|
344
|
+
const isExcludedIndex = allowedDaysOfWeek.has(indexDayOfWeek(x)); // ???
|
|
345
|
+
return isExcludedIndex;
|
|
346
|
+
})
|
|
347
|
+
: allExcluded;
|
|
348
|
+
const offsetExcluded = excluded.map((x) => x - indexOffset); // set to the proper offset
|
|
349
|
+
const ex = [...filterOffsetExcludedRange, ...offsetExcluded];
|
|
275
350
|
const w = dateScheduleEncodedWeek(scheduleDays);
|
|
276
351
|
const d = []; // "included" blocks are never used/calculated.
|
|
277
352
|
const dateScheduleRange = {
|
|
@@ -287,7 +362,7 @@ function computeScheduleSelectionValue(state) {
|
|
|
287
362
|
};
|
|
288
363
|
}
|
|
289
364
|
function computeScheduleSelectionRangeAndExclusion(state) {
|
|
290
|
-
const { isEnabledDay } = state;
|
|
365
|
+
const { isEnabledDay, isEnabledFilterDay } = state;
|
|
291
366
|
const dateFactory = dateBlockTimingDateFactory(state);
|
|
292
367
|
const dateBlockRange = computeCalendarScheduleSelectionDateBlockRange(state);
|
|
293
368
|
if (dateBlockRange == null) {
|
|
@@ -296,7 +371,7 @@ function computeScheduleSelectionRangeAndExclusion(state) {
|
|
|
296
371
|
const start = dateFactory(dateBlockRange.i);
|
|
297
372
|
const end = dateFactory(dateBlockRange.to);
|
|
298
373
|
const excluded = range(dateBlockRange.i, dateBlockRange.to + 1).filter((x) => {
|
|
299
|
-
const isExcludedIndex = !isEnabledDay(x);
|
|
374
|
+
const isExcludedIndex = !isEnabledDay(x) || !isEnabledFilterDay(x);
|
|
300
375
|
return isExcludedIndex;
|
|
301
376
|
});
|
|
302
377
|
const result = {
|
|
@@ -310,12 +385,8 @@ function computeScheduleSelectionRangeAndExclusion(state) {
|
|
|
310
385
|
function computeCalendarScheduleSelectionRange(state) {
|
|
311
386
|
const dateFactory = dateBlockTimingDateFactory(state);
|
|
312
387
|
const dateBlockRange = computeCalendarScheduleSelectionDateBlockRange(state);
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
return undefined;
|
|
318
|
-
}
|
|
388
|
+
const dateRange = dateBlockRange != null ? { start: dateFactory(dateBlockRange.i), end: dateFactory(dateBlockRange.to) } : undefined;
|
|
389
|
+
return dateRange;
|
|
319
390
|
}
|
|
320
391
|
function computeCalendarScheduleSelectionDateBlockRange(state) {
|
|
321
392
|
const { indexFactory, inputStart, inputEnd, allowedDaysOfWeek, indexDayOfWeek, isEnabledDay, isEnabledFilterDay } = state;
|
|
@@ -849,6 +920,12 @@ class DbxFormCalendarDateScheduleRangeFieldComponent extends FieldType {
|
|
|
849
920
|
get filter() {
|
|
850
921
|
return this.props.filter;
|
|
851
922
|
}
|
|
923
|
+
get initialSelectionState() {
|
|
924
|
+
return this.props.initialSelectionState;
|
|
925
|
+
}
|
|
926
|
+
get computeSelectionResultRelativeToFilter() {
|
|
927
|
+
return this.props.computeSelectionResultRelativeToFilter;
|
|
928
|
+
}
|
|
852
929
|
ngOnInit() {
|
|
853
930
|
this._formControlObs.next(this.formControl);
|
|
854
931
|
this._syncSub.subscription = this.value$.pipe(distinctUntilChanged(isSameDateScheduleRange)).subscribe((x) => {
|
|
@@ -861,6 +938,12 @@ class DbxFormCalendarDateScheduleRangeFieldComponent extends FieldType {
|
|
|
861
938
|
if (filter != null) {
|
|
862
939
|
this._filterSub.subscription = this.dbxCalendarScheduleSelectionStore.setFilter(asObservable(filter));
|
|
863
940
|
}
|
|
941
|
+
if (this.initialSelectionState !== undefined) {
|
|
942
|
+
this.dbxCalendarScheduleSelectionStore.setInitialSelectionState(this.initialSelectionState);
|
|
943
|
+
}
|
|
944
|
+
if (this.computeSelectionResultRelativeToFilter != null) {
|
|
945
|
+
this.dbxCalendarScheduleSelectionStore.setComputeSelectionResultRelativeToFilter(this.computeSelectionResultRelativeToFilter);
|
|
946
|
+
}
|
|
864
947
|
}
|
|
865
948
|
ngOnDestroy() {
|
|
866
949
|
super.ngOnDestroy();
|
|
@@ -1061,5 +1144,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
1061
1144
|
* Generated bundle index. Do not edit.
|
|
1062
1145
|
*/
|
|
1063
1146
|
|
|
1064
|
-
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 };
|
|
1147
|
+
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, calendarScheduleMaxDate, calendarScheduleMinAndMaxDate, calendarScheduleMinDate, computeCalendarScheduleSelectionDateBlockRange, computeCalendarScheduleSelectionRange, computeScheduleSelectionRangeAndExclusion, computeScheduleSelectionValue, dateScheduleRangeField, dbxScheduleSelectionCalendarDateDaysFormDayFields, dbxScheduleSelectionCalendarDateDaysFormFields, defaultCalendarScheduleSelectionCellContentFactory, finalizeNewCalendarScheduleSelectionState, initialCalendarScheduleSelectionState, isEnabledDayInCalendarScheduleSelectionState, noSelectionCalendarScheduleSelectionState, provideCalendarScheduleSelectionStoreIfParentIsUnavailable, updateStateWithChangedDates, updateStateWithChangedRange, updateStateWithChangedScheduleDays, updateStateWithComputeSelectionResultRelativeToFilter, updateStateWithDateScheduleRangeValue, updateStateWithFilter, updateStateWithInitialSelectionState };
|
|
1065
1148
|
//# sourceMappingURL=dereekb-dbx-form-calendar.mjs.map
|