@dereekb/dbx-form 10.1.4 → 10.1.6
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.days.component.d.ts +2 -3
- package/esm2022/calendar/lib/calendar.schedule.selection.days.component.mjs +1 -1
- package/esm2022/calendar/lib/calendar.schedule.selection.store.mjs +1 -1
- package/esm2022/lib/formly/field/selection/sourceselect/sourceselect.field.component.mjs +1 -1
- package/esm2022/lib/formly/field/value/date/datetime.field.component.mjs +18 -9
- package/fesm2022/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-form.mjs +17 -8
- package/fesm2022/dereekb-dbx-form.mjs.map +1 -1
- package/lib/formly/field/selection/sourceselect/sourceselect.field.component.d.ts +2 -3
- package/lib/formly/field/value/date/datetime.field.component.d.ts +1 -1
- package/mapbox/package.json +1 -1
- package/package.json +1 -1
|
@@ -3952,7 +3952,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
3952
3952
|
}
|
|
3953
3953
|
return result;
|
|
3954
3954
|
}), distinctUntilChanged(isSameDateHoursAndMinutes), shareReplay(1));
|
|
3955
|
-
this.
|
|
3955
|
+
this.dateTimePickerConfig$ = combineLatest([this._config.pipe(switchMapMaybeObs()), this.syncConfigBeforeValue$, this.syncConfigAfterValue$]).pipe(map(([x, dateInputMin, dateInputMax]) => {
|
|
3956
3956
|
let result = x;
|
|
3957
3957
|
if (dateInputMin != null || dateInputMax != null) {
|
|
3958
3958
|
const { min: limitMin, max: limitMax } = x?.limits ?? {};
|
|
@@ -3969,9 +3969,9 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
3969
3969
|
}
|
|
3970
3970
|
return result;
|
|
3971
3971
|
}), distinctUntilChanged(), shareReplay(1));
|
|
3972
|
-
this.dateInputMin$ = this.
|
|
3973
|
-
this.dateInputMax$ = this.
|
|
3974
|
-
this.pickerFilter$ = this.
|
|
3972
|
+
this.dateInputMin$ = this.dateTimePickerConfig$.pipe(map((x) => (x?.limits?.min ?? null)), distinctUntilChanged(isSameDate), shareReplay(1));
|
|
3973
|
+
this.dateInputMax$ = this.dateTimePickerConfig$.pipe(map((x) => (x?.limits?.max ?? null)), distinctUntilChanged(isSameDate), shareReplay(1));
|
|
3974
|
+
this.pickerFilter$ = this.dateTimePickerConfig$.pipe(distinctUntilChanged(), map((x) => {
|
|
3975
3975
|
if (x) {
|
|
3976
3976
|
const filter = dateTimeMinuteWholeDayDecisionFunction(x, false);
|
|
3977
3977
|
return (x) => (x != null ? filter(x) : true);
|
|
@@ -3981,7 +3981,7 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
3981
3981
|
}
|
|
3982
3982
|
}), shareReplay(1));
|
|
3983
3983
|
this.defaultPickerFilter = () => true;
|
|
3984
|
-
this.timeOutput$ = combineLatest([this.rawDateTime$, this._offset, this.
|
|
3984
|
+
this.timeOutput$ = combineLatest([this.rawDateTime$, this._offset, this.dateTimePickerConfig$]).pipe(throttleTime(TIME_OUTPUT_THROTTLE_TIME$1, undefined, { leading: false, trailing: true }), distinctUntilChanged((current, next) => current[0] === next[0] && next[1] === 0), tap(([, stepsOffset]) => (stepsOffset ? this._offset.next(0) : 0)), map(([date, stepsOffset, config]) => {
|
|
3985
3985
|
if (date != null) {
|
|
3986
3986
|
const instance = new DateTimeMinuteInstance({
|
|
3987
3987
|
date,
|
|
@@ -4156,9 +4156,18 @@ class DbxDateTimeFieldComponent extends FieldType$1 {
|
|
|
4156
4156
|
offset = 7;
|
|
4157
4157
|
}
|
|
4158
4158
|
if (direction !== 0) {
|
|
4159
|
-
this.date
|
|
4160
|
-
|
|
4161
|
-
|
|
4159
|
+
combineLatest([this.date$, this.dateTimePickerConfig$])
|
|
4160
|
+
.pipe(first())
|
|
4161
|
+
.subscribe(([date, config]) => {
|
|
4162
|
+
const newDate = startOfDay(addDays(date, offset * direction));
|
|
4163
|
+
const instance = new DateTimeMinuteInstance({
|
|
4164
|
+
date: newDate,
|
|
4165
|
+
...config
|
|
4166
|
+
});
|
|
4167
|
+
const nextDate = instance.isInSchedule(newDate) ? newDate : instance.findNextAvailableDayInSchedule(newDate, direction === 1 ? 'future' : 'past');
|
|
4168
|
+
if (nextDate != null) {
|
|
4169
|
+
this.setDateInputValue(instance.clampToLimit(nextDate));
|
|
4170
|
+
}
|
|
4162
4171
|
});
|
|
4163
4172
|
}
|
|
4164
4173
|
}
|