@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.
@@ -5,10 +5,10 @@ import { AbstractPopoverDirective, AbstractDialogDirective, sanitizeDbxDialogCon
5
5
  import * as i0 from '@angular/core';
6
6
  import { Injectable, SkipSelf, Directive, Injector, Optional, Component, Inject, Input, ViewChild, ElementRef, ChangeDetectionStrategy, EventEmitter, Output, InjectionToken, NgModule } from '@angular/core';
7
7
  import { FieldType } from '@ngx-formly/material';
8
- import { switchMap, first, tap, map, distinctUntilChanged, shareReplay, of, combineLatestWith, BehaviorSubject, filter, startWith, throttleTime, combineLatest } from 'rxjs';
8
+ import { switchMap, first, tap, map, distinctUntilChanged, shareReplay, of, combineLatestWith, BehaviorSubject, filter, combineLatest, startWith, throttleTime } from 'rxjs';
9
9
  import { filterMaybe, distinctUntilHasDifferentValues, SubscriptionObject, asObservableFromGetter, asObservable } from '@dereekb/rxjs';
10
10
  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';
11
- import { mapValuesToSet, unique, mergeArrays, iterableToArray, range, toggleInSet, removeFromSet, addToSet, isIndexNumberInIndexRangeFunction, minAndMaxNumber, getDaysOfWeekNames, reduceBooleansWithAnd, mergeObjects, KeyValueTypleValueFilter } from '@dereekb/util';
11
+ import { isInAllowedDaysOfWeekSet, mapValuesToSet, unique, mergeArrays, iterableToArray, range, toggleInSet, removeFromSet, addToSet, isIndexNumberInIndexRangeFunction, minAndMaxNumber, getDaysOfWeekNames, reduceBooleansWithAnd, mergeObjects, KeyValueTypleValueFilter } from '@dereekb/util';
12
12
  import { ComponentStore } from '@ngrx/component-store';
13
13
  import { startOfDay, endOfDay, isBefore, endOfWeek } from 'date-fns';
14
14
  import * as i3$1 from '@dereekb/dbx-core';
@@ -168,6 +168,7 @@ class DbxCalendarScheduleSelectionStore extends ComponentStore {
168
168
  map(calendarScheduleStartBeingUsedFromFilter), distinctUntilChanged(), shareReplay(1));
169
169
  this.dateRange$ = this.currentDateRange$.pipe(filterMaybe(), shareReplay(1));
170
170
  this.allowedDaysOfWeek$ = this.state$.pipe(map((x) => x.allowedDaysOfWeek), distinctUntilHasDifferentValues(), shareReplay(1));
171
+ this.isInAllowedDaysOfWeekFunction$ = this.allowedDaysOfWeek$.pipe(map((x) => isInAllowedDaysOfWeekSet(x)), shareReplay(1));
171
172
  this.scheduleDays$ = this.state$.pipe(map((x) => x.effectiveScheduleDays), distinctUntilHasDifferentValues(), shareReplay(1));
172
173
  this.currentTimezone$ = this.state$.pipe(map((x) => x.timezone), distinctUntilChanged(), shareReplay(1));
173
174
  this.effectiveTimezone$ = this.state$.pipe(map((x) => (!calendarScheduleStartBeingUsedFromFilter(x) && x.timezone ? x.timezone : undefined)), distinctUntilChanged(), shareReplay(1));
@@ -614,7 +615,6 @@ function computeScheduleSelectionValue(state) {
614
615
  function computeScheduleSelectionRangeAndExclusion(state) {
615
616
  const { start: currentStart, isEnabledDay, isEnabledFilterDay } = state;
616
617
  const dateFactory = dateBlockTimingStartDateFactory({ start: currentStart }, { assertTimingMatchesTimezone: false, useSystemTimezone: true });
617
- // const dateFactory = dateBlockTimingStartDateFactory(changeTimingToSystemTimezone({ start: currentStart }), { useSystemTimezone: true });
618
618
  const dateBlockRange = computeCalendarScheduleSelectionDateBlockRange(state);
619
619
  if (dateBlockRange == null) {
620
620
  return null; // returns null if no items are selected.
@@ -797,9 +797,9 @@ class DbxScheduleSelectionCalendarDateRangeComponent {
797
797
  }), shareReplay(1));
798
798
  this.pickerOpened$ = this._pickerOpened.asObservable();
799
799
  this.defaultDatePickerFilter = () => true;
800
- this.datePickerFilter$ = this.dbxCalendarScheduleSelectionStore.isEnabledFilterDayFunction$.pipe(map((isEnabled) => {
800
+ this.datePickerFilter$ = combineLatest([this.dbxCalendarScheduleSelectionStore.isEnabledFilterDayFunction$, this.dbxCalendarScheduleSelectionStore.isInAllowedDaysOfWeekFunction$]).pipe(map(([isEnabled, isAllowedDayOfWeek]) => {
801
801
  const fn = (date) => {
802
- const result = date ? isEnabled(date) : true;
802
+ const result = date ? isAllowedDayOfWeek(date) && isEnabled(date) : true;
803
803
  return result;
804
804
  };
805
805
  return fn;