@dereekb/dbx-form 13.10.6 → 13.10.7
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 +21 -44
- package/fesm2022/dereekb-dbx-form-calendar.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-form-mapbox.mjs +24 -46
- package/fesm2022/dereekb-dbx-form-mapbox.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-form.mjs +124 -224
- package/fesm2022/dereekb-dbx-form.mjs.map +1 -1
- package/package.json +8 -8
- package/types/dereekb-dbx-form-calendar.d.ts +3 -6
- package/types/dereekb-dbx-form-mapbox.d.ts +1 -2
- package/types/dereekb-dbx-form.d.ts +16 -24
|
@@ -6,13 +6,13 @@ import * as i0 from '@angular/core';
|
|
|
6
6
|
import { Injectable, inject, Directive, Optional, SkipSelf, Injector, ChangeDetectionStrategy, Component, viewChild, input, effect, computed, ElementRef, output, InjectionToken, NgModule } from '@angular/core';
|
|
7
7
|
import { FieldType } from '@ngx-formly/material';
|
|
8
8
|
import { switchMap, first, tap, map, distinctUntilChanged, shareReplay, of, combineLatestWith, BehaviorSubject, filter, combineLatest, EMPTY, startWith, throttleTime, skip } from 'rxjs';
|
|
9
|
-
import { filterMaybe, distinctUntilHasDifferentValues,
|
|
9
|
+
import { filterMaybe, distinctUntilHasDifferentValues, asObservableFromGetter, asObservable } from '@dereekb/rxjs';
|
|
10
10
|
import { DateCellScheduleDayCode, expandDateCellScheduleDayCodesToDayOfWeekSet, dateCellTimingStartsAtForStartOfDay, dateCellTimingRelativeIndexFactory, dateCellDayOfWeekFactory, dateTimezoneUtcNormal, findMaxDate, findMinDate, isSameDateRange, isSameDateDay, isSameDate, dateCellTimingDateFactory, expandDateCellScheduleRange, formatToISO8601DayStringForSystem, changeDateCellScheduleDateRangeToTimezone, isSameDateCellScheduleDateRange, dateCellTimingRelativeIndexArrayFactory, isInfiniteDateRange, copyDateCellScheduleDateFilterConfig, SYSTEM_DATE_TIMEZONE_UTC_NORMAL_INSTANCE, dateCellScheduleDateFilter, fullDateCellScheduleRange, dateCellTimingTimezoneNormalInstance, expandDateCellScheduleDayCodes, fullWeekDateCellScheduleDayCodes, dateCellScheduleDayCodesAreSetsEquivalent, simplifyDateCellScheduleDayCodes, dateCellTimingStartDateFactory, isDateInDateRangeFunction, isDateWithinDateCellRangeFunction, dateCellScheduleEncodedWeek, enabledDaysFromDateCellScheduleDayCodes, dateCellScheduleDayCodesFromEnabledDays, formatToMonthDayString, dateRange, DateRangeType } from '@dereekb/date';
|
|
11
11
|
import { isInAllowedDaysOfWeekSet, mapValuesToSet, unique, mergeArrays, iterableToArray, isIterable, firstValueFromIterable, minAndMaxNumber, range, toggleInSet, removeFromSet, addToSet, isIndexNumberInIndexRangeFunction, getDaysOfWeekNames, reduceBooleansWithAnd, mergeObjects, KeyValueTypleValueFilter, filterFromPOJO } from '@dereekb/util';
|
|
12
12
|
import { ComponentStore } from '@ngrx/component-store';
|
|
13
13
|
import { endOfDay, startOfDay, isBefore, endOfWeek } from 'date-fns';
|
|
14
14
|
import * as i1$1 from '@dereekb/dbx-core';
|
|
15
|
-
import { TimezoneAbbreviationPipe, switchMapDbxInjectionComponentConfig, DbxInjectionComponent } from '@dereekb/dbx-core';
|
|
15
|
+
import { completeOnDestroy, cleanSubscription, TimezoneAbbreviationPipe, switchMapDbxInjectionComponentConfig, DbxInjectionComponent } from '@dereekb/dbx-core';
|
|
16
16
|
import { toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
17
17
|
import { MatDialog } from '@angular/material/dialog';
|
|
18
18
|
import { CalendarMonthViewComponent, CalendarDatePipe } from 'angular-calendar';
|
|
@@ -1202,9 +1202,9 @@ class DbxScheduleSelectionCalendarDateRangeComponent {
|
|
|
1202
1202
|
this.range.enable();
|
|
1203
1203
|
}
|
|
1204
1204
|
}, ...(ngDevMode ? [{ debugName: "_disabledEffect" }] : /* istanbul ignore next */ []));
|
|
1205
|
-
_pickerOpened = new BehaviorSubject(false);
|
|
1206
|
-
_syncSub =
|
|
1207
|
-
_valueSub =
|
|
1205
|
+
_pickerOpened = completeOnDestroy(new BehaviorSubject(false));
|
|
1206
|
+
_syncSub = cleanSubscription();
|
|
1207
|
+
_valueSub = cleanSubscription();
|
|
1208
1208
|
range = new FormGroup({
|
|
1209
1209
|
start: new FormControl(null),
|
|
1210
1210
|
end: new FormControl(null)
|
|
@@ -1298,10 +1298,6 @@ class DbxScheduleSelectionCalendarDateRangeComponent {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
});
|
|
1300
1300
|
}
|
|
1301
|
-
ngOnDestroy() {
|
|
1302
|
-
this._syncSub.destroy();
|
|
1303
|
-
this._valueSub.destroy();
|
|
1304
|
-
}
|
|
1305
1301
|
clickedDateRangeInput() {
|
|
1306
1302
|
if (this.openPickerOnTextClick()) {
|
|
1307
1303
|
const picker = this.picker();
|
|
@@ -1580,7 +1576,7 @@ class DbxScheduleSelectionCalendarComponent {
|
|
|
1580
1576
|
clickEvent = output();
|
|
1581
1577
|
config = input(...(ngDevMode ? [undefined, { debugName: "config" }] : /* istanbul ignore next */ []));
|
|
1582
1578
|
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
1583
|
-
_centerRangeSub =
|
|
1579
|
+
_centerRangeSub = cleanSubscription();
|
|
1584
1580
|
config$ = toObservable(this.config).pipe(distinctUntilChanged(), shareReplay(1));
|
|
1585
1581
|
readonly$ = this.config$.pipe(switchMap((x) => (x?.readonly != null ? asObservableFromGetter(x.readonly) : of(undefined))), combineLatestWith(toObservable(this.readonly)), map(([configReadonly, inputReadonly]) => {
|
|
1586
1582
|
return configReadonly || inputReadonly || false;
|
|
@@ -1647,9 +1643,6 @@ class DbxScheduleSelectionCalendarComponent {
|
|
|
1647
1643
|
}
|
|
1648
1644
|
});
|
|
1649
1645
|
}
|
|
1650
|
-
ngOnDestroy() {
|
|
1651
|
-
this._centerRangeSub.destroy();
|
|
1652
|
-
}
|
|
1653
1646
|
dayClicked({ date }) {
|
|
1654
1647
|
if (!this.readonlySignal()) {
|
|
1655
1648
|
this.dbxCalendarScheduleSelectionStore.toggleSelectedDates(date);
|
|
@@ -1755,14 +1748,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
1755
1748
|
class DbxFormCalendarDateScheduleRangeFieldComponent extends FieldType {
|
|
1756
1749
|
compact = inject(CompactContextStore, { optional: true });
|
|
1757
1750
|
dbxCalendarScheduleSelectionStore = inject(DbxCalendarScheduleSelectionStore);
|
|
1758
|
-
_syncSub =
|
|
1759
|
-
_valueSub =
|
|
1760
|
-
_timezoneSub =
|
|
1761
|
-
_minMaxDateRangeSub =
|
|
1762
|
-
_defaultWeekSub =
|
|
1763
|
-
_filterSub =
|
|
1764
|
-
_exclusionsSub =
|
|
1765
|
-
_formControlObs = new BehaviorSubject(undefined);
|
|
1751
|
+
_syncSub = cleanSubscription();
|
|
1752
|
+
_valueSub = cleanSubscription();
|
|
1753
|
+
_timezoneSub = cleanSubscription();
|
|
1754
|
+
_minMaxDateRangeSub = cleanSubscription();
|
|
1755
|
+
_defaultWeekSub = cleanSubscription();
|
|
1756
|
+
_filterSub = cleanSubscription();
|
|
1757
|
+
_exclusionsSub = cleanSubscription();
|
|
1758
|
+
_formControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
1766
1759
|
formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
1767
1760
|
value$ = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value))), shareReplay(1));
|
|
1768
1761
|
disableCustomize$ = this.value$.pipe(map((x) => (this.allowCustomizeWithoutDateRange ? false : !x)), distinctUntilChanged(), shareReplay(1));
|
|
@@ -1857,13 +1850,6 @@ class DbxFormCalendarDateScheduleRangeFieldComponent extends FieldType {
|
|
|
1857
1850
|
}
|
|
1858
1851
|
ngOnDestroy() {
|
|
1859
1852
|
super.ngOnDestroy();
|
|
1860
|
-
this._syncSub.destroy();
|
|
1861
|
-
this._valueSub.destroy();
|
|
1862
|
-
this._filterSub.destroy();
|
|
1863
|
-
this._timezoneSub.destroy();
|
|
1864
|
-
this._minMaxDateRangeSub.destroy();
|
|
1865
|
-
this._exclusionsSub.destroy();
|
|
1866
|
-
this._formControlObs.complete();
|
|
1867
1853
|
}
|
|
1868
1854
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DbxFormCalendarDateScheduleRangeFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1869
1855
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.10", type: DbxFormCalendarDateScheduleRangeFieldComponent, isStandalone: true, selector: "ng-component", providers: [provideCalendarScheduleSelectionStoreIfParentIsUnavailable()], usesInheritance: true, ngImport: i0, template: `
|
|
@@ -1984,13 +1970,13 @@ class DbxForgeCalendarDateScheduleRangeFieldComponent {
|
|
|
1984
1970
|
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
1985
1971
|
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
1986
1972
|
// Subscription management
|
|
1987
|
-
_syncSub =
|
|
1988
|
-
_valueSub =
|
|
1989
|
-
_timezoneSub =
|
|
1990
|
-
_minMaxDateRangeSub =
|
|
1991
|
-
_defaultWeekSub =
|
|
1992
|
-
_filterSub =
|
|
1993
|
-
_exclusionsSub =
|
|
1973
|
+
_syncSub = cleanSubscription();
|
|
1974
|
+
_valueSub = cleanSubscription();
|
|
1975
|
+
_timezoneSub = cleanSubscription();
|
|
1976
|
+
_minMaxDateRangeSub = cleanSubscription();
|
|
1977
|
+
_defaultWeekSub = cleanSubscription();
|
|
1978
|
+
_filterSub = cleanSubscription();
|
|
1979
|
+
_exclusionsSub = cleanSubscription();
|
|
1994
1980
|
// Field value signal (double-call pattern: field()() to get FieldState)
|
|
1995
1981
|
fieldValue = computed(() => {
|
|
1996
1982
|
const state = this.field()?.();
|
|
@@ -2077,15 +2063,6 @@ class DbxForgeCalendarDateScheduleRangeFieldComponent {
|
|
|
2077
2063
|
}
|
|
2078
2064
|
});
|
|
2079
2065
|
}
|
|
2080
|
-
ngOnDestroy() {
|
|
2081
|
-
this._syncSub.destroy();
|
|
2082
|
-
this._valueSub.destroy();
|
|
2083
|
-
this._filterSub.destroy();
|
|
2084
|
-
this._timezoneSub.destroy();
|
|
2085
|
-
this._minMaxDateRangeSub.destroy();
|
|
2086
|
-
this._defaultWeekSub.destroy();
|
|
2087
|
-
this._exclusionsSub.destroy();
|
|
2088
|
-
}
|
|
2089
2066
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DbxForgeCalendarDateScheduleRangeFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2090
2067
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.10", type: DbxForgeCalendarDateScheduleRangeFieldComponent, isStandalone: true, selector: "dbx-forge-calendar-date-schedule-range-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: false, transformFunction: null }, validationMessages: { classPropertyName: "validationMessages", publicName: "validationMessages", isSignal: true, isRequired: false, transformFunction: null }, defaultValidationMessages: { classPropertyName: "defaultValidationMessages", publicName: "defaultValidationMessages", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideCalendarScheduleSelectionStoreIfParentIsUnavailable()], ngImport: i0, template: `
|
|
2091
2068
|
<div class="dbx-schedule-selection-field">
|