@dereekb/dbx-form 9.24.36 → 9.24.38
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 +4 -0
- package/esm2020/calendar/lib/calendar.schedule.selection.range.component.mjs +4 -4
- package/esm2020/calendar/lib/calendar.schedule.selection.store.mjs +3 -3
- package/fesm2015/dereekb-dbx-form-calendar.mjs +5 -5
- package/fesm2015/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-form-calendar.mjs +5 -5
- package/fesm2020/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/mapbox/package.json +4 -4
- package/package.json +4 -4
|
@@ -3,10 +3,10 @@ import { formlyField, propsAndConfigForFieldConfig, flexLayoutWrapper, toggleFie
|
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { Injectable, SkipSelf, Directive, Injector, Optional, Component, Inject, Input, ViewChild, ElementRef, ChangeDetectionStrategy, EventEmitter, Output, InjectionToken, NgModule } from '@angular/core';
|
|
5
5
|
import { FieldType } from '@ngx-formly/material';
|
|
6
|
-
import { switchMap, first, tap, map, distinctUntilChanged, shareReplay, of, combineLatestWith, BehaviorSubject, filter, startWith, throttleTime
|
|
6
|
+
import { switchMap, first, tap, map, distinctUntilChanged, shareReplay, of, combineLatestWith, BehaviorSubject, filter, combineLatest, startWith, throttleTime } from 'rxjs';
|
|
7
7
|
import { filterMaybe, distinctUntilHasDifferentValues, SubscriptionObject, asObservableFromGetter, asObservable } from '@dereekb/rxjs';
|
|
8
8
|
import { DateScheduleDayCode, expandDateScheduleDayCodesToDayOfWeekSet, dateTimingRelativeIndexFactory, dateBlockDayOfWeekFactory, findMaxDate, findMinDate, isSameDateRange, isSameDateDay, isSameDate, dateBlockTimingDateFactory, expandDateScheduleRange, formatToISO8601DayString, isSameDateScheduleRange, dateTimingRelativeIndexArrayFactory, isInfiniteDateRange, copyDateScheduleDateFilterConfig, dateScheduleDateFilter, dateTimezoneUtcNormal, expandDateScheduleDayCodes, fullWeekDayScheduleDayCodes, dateScheduleDayCodesAreSetsEquivalent, simplifyDateScheduleDayCodes, isDateInDateRangeFunction, isDateWithinDateBlockRangeFunction, copyHoursAndMinutesFromDate, dateScheduleEncodedWeek, dateBlockTimingStartDateFactory, enabledDaysFromDateScheduleDayCodes, dateScheduleDayCodesFromEnabledDays, formatToMonthDayString, dateRange, DateRangeType } from '@dereekb/date';
|
|
9
|
-
import { mapValuesToSet, unique, mergeArrays, iterableToArray, range, toggleInSet, removeFromSet, addToSet, isIndexNumberInIndexRangeFunction, minAndMaxNumber, getDaysOfWeekNames, reduceBooleansWithAnd, mergeObjects, KeyValueTypleValueFilter } from '@dereekb/util';
|
|
9
|
+
import { isInAllowedDaysOfWeekSet, mapValuesToSet, unique, mergeArrays, iterableToArray, range, toggleInSet, removeFromSet, addToSet, isIndexNumberInIndexRangeFunction, minAndMaxNumber, getDaysOfWeekNames, reduceBooleansWithAnd, mergeObjects, KeyValueTypleValueFilter } from '@dereekb/util';
|
|
10
10
|
import { ComponentStore } from '@ngrx/component-store';
|
|
11
11
|
import { startOfDay, endOfDay, isBefore, endOfWeek } from 'date-fns';
|
|
12
12
|
import * as i1$1 from '@dereekb/dbx-web';
|
|
@@ -167,6 +167,7 @@ class DbxCalendarScheduleSelectionStore extends ComponentStore {
|
|
|
167
167
|
map(calendarScheduleStartBeingUsedFromFilter), distinctUntilChanged(), shareReplay(1));
|
|
168
168
|
this.dateRange$ = this.currentDateRange$.pipe(filterMaybe(), shareReplay(1));
|
|
169
169
|
this.allowedDaysOfWeek$ = this.state$.pipe(map((x) => x.allowedDaysOfWeek), distinctUntilHasDifferentValues(), shareReplay(1));
|
|
170
|
+
this.isInAllowedDaysOfWeekFunction$ = this.allowedDaysOfWeek$.pipe(map((x) => isInAllowedDaysOfWeekSet(x)), shareReplay(1));
|
|
170
171
|
this.scheduleDays$ = this.state$.pipe(map((x) => x.effectiveScheduleDays), distinctUntilHasDifferentValues(), shareReplay(1));
|
|
171
172
|
this.currentTimezone$ = this.state$.pipe(map((x) => x.timezone), distinctUntilChanged(), shareReplay(1));
|
|
172
173
|
this.effectiveTimezone$ = this.state$.pipe(map((x) => (!calendarScheduleStartBeingUsedFromFilter(x) && x.timezone ? x.timezone : undefined)), distinctUntilChanged(), shareReplay(1));
|
|
@@ -600,7 +601,6 @@ function computeScheduleSelectionValue(state) {
|
|
|
600
601
|
function computeScheduleSelectionRangeAndExclusion(state) {
|
|
601
602
|
const { start: currentStart, isEnabledDay, isEnabledFilterDay } = state;
|
|
602
603
|
const dateFactory = dateBlockTimingStartDateFactory({ start: currentStart }, { assertTimingMatchesTimezone: false, useSystemTimezone: true });
|
|
603
|
-
// const dateFactory = dateBlockTimingStartDateFactory(changeTimingToSystemTimezone({ start: currentStart }), { useSystemTimezone: true });
|
|
604
604
|
const dateBlockRange = computeCalendarScheduleSelectionDateBlockRange(state);
|
|
605
605
|
if (dateBlockRange == null) {
|
|
606
606
|
return null; // returns null if no items are selected.
|
|
@@ -786,9 +786,9 @@ class DbxScheduleSelectionCalendarDateRangeComponent {
|
|
|
786
786
|
}), shareReplay(1));
|
|
787
787
|
this.pickerOpened$ = this._pickerOpened.asObservable();
|
|
788
788
|
this.defaultDatePickerFilter = () => true;
|
|
789
|
-
this.datePickerFilter$ = this.dbxCalendarScheduleSelectionStore.isEnabledFilterDayFunction
|
|
789
|
+
this.datePickerFilter$ = combineLatest([this.dbxCalendarScheduleSelectionStore.isEnabledFilterDayFunction$, this.dbxCalendarScheduleSelectionStore.isInAllowedDaysOfWeekFunction$]).pipe(map(([isEnabled, isAllowedDayOfWeek]) => {
|
|
790
790
|
const fn = (date) => {
|
|
791
|
-
const result = date ? isEnabled(date) : true;
|
|
791
|
+
const result = date ? isAllowedDayOfWeek(date) && isEnabled(date) : true;
|
|
792
792
|
return result;
|
|
793
793
|
};
|
|
794
794
|
return fn;
|