@dereekb/dbx-form 9.24.37 → 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.
@@ -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, combineLatest } from 'rxjs';
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));
@@ -785,9 +786,9 @@ class DbxScheduleSelectionCalendarDateRangeComponent {
785
786
  }), shareReplay(1));
786
787
  this.pickerOpened$ = this._pickerOpened.asObservable();
787
788
  this.defaultDatePickerFilter = () => true;
788
- this.datePickerFilter$ = this.dbxCalendarScheduleSelectionStore.isEnabledFilterDayFunction$.pipe(map((isEnabled) => {
789
+ this.datePickerFilter$ = combineLatest([this.dbxCalendarScheduleSelectionStore.isEnabledFilterDayFunction$, this.dbxCalendarScheduleSelectionStore.isInAllowedDaysOfWeekFunction$]).pipe(map(([isEnabled, isAllowedDayOfWeek]) => {
789
790
  const fn = (date) => {
790
- const result = date ? isEnabled(date) : true;
791
+ const result = date ? isAllowedDayOfWeek(date) && isEnabled(date) : true;
791
792
  return result;
792
793
  };
793
794
  return fn;