@dereekb/dbx-form 13.15.0 → 13.17.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/fesm2022/dereekb-dbx-form-calendar.mjs +22 -22
- package/fesm2022/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-form-mapbox.mjs +1 -1
- package/fesm2022/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-form-quiz.mjs +7 -7
- package/fesm2022/dereekb-dbx-form-quiz.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-form.mjs +54 -40
- package/fesm2022/dereekb-dbx-form.mjs.map +1 -1
- package/package.json +8 -8
|
@@ -385,8 +385,8 @@ function updateStateWithMinMaxDateRange(state, minMaxDateRange) {
|
|
|
385
385
|
state = {
|
|
386
386
|
...state,
|
|
387
387
|
minMaxDateRange: {
|
|
388
|
-
start: minMaxDateRange.start
|
|
389
|
-
end: minMaxDateRange.end
|
|
388
|
+
start: minMaxDateRange.start == null ? undefined : startOfDay(minMaxDateRange.start),
|
|
389
|
+
end: minMaxDateRange.end == null ? undefined : endOfDay(minMaxDateRange.end)
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
392
|
}
|
|
@@ -427,12 +427,12 @@ function updateStateWithFilter(currentState, inputFilter) {
|
|
|
427
427
|
if (inputFilter.start) {
|
|
428
428
|
filterStart = inputFilter.start;
|
|
429
429
|
// if no timezone is specified, then use the system timezone and align filterStart to the start of the day.
|
|
430
|
-
if (
|
|
431
|
-
|
|
432
|
-
nextFilterTimezone = systemTimezone;
|
|
430
|
+
if (inputFilter.timezone) {
|
|
431
|
+
nextFilterTimezone = inputFilter.timezone;
|
|
433
432
|
}
|
|
434
433
|
else {
|
|
435
|
-
|
|
434
|
+
filterStart = SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE.startOfDayInTargetTimezone(inputFilter.startsAt);
|
|
435
|
+
nextFilterTimezone = systemTimezone;
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
else if (inputFilter.startsAt) {
|
|
@@ -490,15 +490,15 @@ function updateStateWithFilter(currentState, inputFilter) {
|
|
|
490
490
|
finalEnabledTimezone = systemTimezone;
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
else if (
|
|
493
|
+
else if (enabledFilter.timezone) {
|
|
494
|
+
finalEnabledStart = enabledFilter.start;
|
|
495
|
+
finalEnabledTimezone = enabledFilter.timezone;
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
494
498
|
finalEnabledTimezone = systemTimezone;
|
|
495
499
|
const timezoneNormal = dateTimezoneUtcNormal(finalEnabledTimezone);
|
|
496
500
|
finalEnabledStart = timezoneNormal.startOfDayInTargetTimezone(enabledFilter.start); // get the start of the day for the target timezone
|
|
497
501
|
}
|
|
498
|
-
else {
|
|
499
|
-
finalEnabledStart = enabledFilter.start;
|
|
500
|
-
finalEnabledTimezone = enabledFilter.timezone;
|
|
501
|
-
}
|
|
502
502
|
enabledFilter.start = finalEnabledStart;
|
|
503
503
|
enabledFilter.timezone = finalEnabledTimezone;
|
|
504
504
|
// create the filter
|
|
@@ -790,19 +790,19 @@ function updateStateWithChangedDates(state, change) {
|
|
|
790
790
|
else {
|
|
791
791
|
// when the filter is not set, use the least and greatest indexes from the input set.
|
|
792
792
|
const minAndMax = minAndMaxNumber(inputSetIndexes);
|
|
793
|
-
if (minAndMax
|
|
793
|
+
if (minAndMax == null) {
|
|
794
|
+
// equivalent to an empty set / using "none" with selectAll.
|
|
795
|
+
inputStart = null;
|
|
796
|
+
inputEnd = null;
|
|
797
|
+
toggledIndexes = new Set();
|
|
798
|
+
}
|
|
799
|
+
else {
|
|
794
800
|
minIndex = minAndMax.min;
|
|
795
801
|
maxIndex = minAndMax.max;
|
|
796
802
|
const dateFactory = dateCellTimingStartDateFactory(indexFactory._timing);
|
|
797
803
|
inputStart = dateFactory(minAndMax.min);
|
|
798
804
|
inputEnd = minAndMax.min === minAndMax.max ? inputStart : dateFactory(minAndMax.max);
|
|
799
805
|
}
|
|
800
|
-
else {
|
|
801
|
-
// equivalent to an empty set / using "none" with selectAll.
|
|
802
|
-
inputStart = null;
|
|
803
|
-
inputEnd = null;
|
|
804
|
-
toggledIndexes = new Set();
|
|
805
|
-
}
|
|
806
806
|
}
|
|
807
807
|
// toggledIndexes should not include any indexes we want to include
|
|
808
808
|
if (minIndex != null && maxIndex != null) {
|
|
@@ -1029,7 +1029,7 @@ function computeScheduleSelectionRangeAndExclusion(state) {
|
|
|
1029
1029
|
function computeCalendarScheduleSelectionRange(state) {
|
|
1030
1030
|
const dateFactory = dateCellTimingDateFactory({ startsAt: state.start, timezone: state.systemTimezone });
|
|
1031
1031
|
const dateCellRange = computeCalendarScheduleSelectionDateCellRange(state);
|
|
1032
|
-
const dateRange = dateCellRange
|
|
1032
|
+
const dateRange = dateCellRange == null ? undefined : { start: dateFactory(dateCellRange.i), end: dateFactory(dateCellRange.to) };
|
|
1033
1033
|
return dateRange;
|
|
1034
1034
|
}
|
|
1035
1035
|
/**
|
|
@@ -1051,8 +1051,8 @@ function computeCalendarScheduleSelectionDateCellRange(state) {
|
|
|
1051
1051
|
if (inputStart != null && inputEnd != null) {
|
|
1052
1052
|
const inputStartIndex = indexFactory(inputStart);
|
|
1053
1053
|
const inputEndIndex = indexFactory(inputEnd);
|
|
1054
|
-
startRange = startRange
|
|
1055
|
-
endRange = endRange
|
|
1054
|
+
startRange = startRange == null ? inputStartIndex : Math.min(inputStartIndex, startRange);
|
|
1055
|
+
endRange = endRange == null ? inputEndIndex : Math.max(inputEndIndex, endRange);
|
|
1056
1056
|
}
|
|
1057
1057
|
if (startRange != null && endRange != null) {
|
|
1058
1058
|
const scanStartIndex = startRange;
|
|
@@ -1607,7 +1607,7 @@ class DbxScheduleSelectionCalendarComponent {
|
|
|
1607
1607
|
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
1608
1608
|
_centerRangeSub = cleanSubscription();
|
|
1609
1609
|
config$ = toObservable(this.config).pipe(distinctUntilChanged(), shareReplay(1));
|
|
1610
|
-
readonly$ = this.config$.pipe(switchMap((x) => (x?.readonly
|
|
1610
|
+
readonly$ = this.config$.pipe(switchMap((x) => (x?.readonly == null ? of(undefined) : asObservableFromGetter(x.readonly))), combineLatestWith(toObservable(this.readonly)), map(([configReadonly, inputReadonly]) => {
|
|
1611
1611
|
return configReadonly || inputReadonly || false;
|
|
1612
1612
|
}), shareReplay(1));
|
|
1613
1613
|
showButtonsOnReadonly$ = this.config$.pipe(map((x) => x?.showButtonsOnReadonly ?? false), distinctUntilChanged(), shareReplay(1));
|