@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
|
@@ -5,8 +5,8 @@ import { DbxActionTransitionSafetyDirective, AbstractDialogDirective, DbxDialogC
|
|
|
5
5
|
import { isPast, addSeconds, startOfDay, addMinutes, addDays, isBefore } from 'date-fns';
|
|
6
6
|
import { map, of, shareReplay, switchMap, first, exhaustMap, catchError, delay, filter, combineLatest, distinctUntilChanged, BehaviorSubject, Subject, startWith, throttleTime, scan, timer, merge, EMPTY, skip, debounceTime, combineLatestWith, interval, tap, withLatestFrom, mergeMap } from 'rxjs';
|
|
7
7
|
import * as i1$2 from '@dereekb/dbx-core';
|
|
8
|
-
import { DbxActionContextStoreSourceInstance, cleanLockSet,
|
|
9
|
-
import { makeIsModifiedFunctionObservable,
|
|
8
|
+
import { DbxActionContextStoreSourceInstance, cleanLockSet, cleanSubscription, completeOnDestroy, cleanWithLockSet, GetValuePipe, DateDistancePipe, TimeDistancePipe, DbxInjectionComponent, mergeDbxInjectionComponentConfigs } from '@dereekb/dbx-core';
|
|
9
|
+
import { makeIsModifiedFunctionObservable, asObservable, LockSet, filterMaybe, switchMapFilterMaybe, scanCount, errorOnEmissionsInPeriod, asObservableFromGetter, maybeValueFromObservableOrValue, valueFromFinishedLoadingState, switchMapMaybeDefault, skipAllInitialMaybe, successResult, startWithBeginLoading, skipUntilTimeElapsedAfterLastEmission, mapLoadingStateResults, isLoadingStateWithDefinedValue, isLoadingStateLoading, beginLoading, mapLoadingStateValueWithOperator, loadingStateContext, distinctUntilHasDifferentValues, SimpleLoadingContext, listLoadingStateContext, mapIsListLoadingStateWithEmptyValue, isLoadingStateInLoadingState, asyncPusherCache } from '@dereekb/rxjs';
|
|
10
10
|
import { toObservable, toSignal, rxResource } from '@angular/core/rxjs-interop';
|
|
11
11
|
import { BooleanStringKeyArrayUtility, iterablesAreSetEquivalent, filterUndefinedValues, filterMaybeArrayValues, filterUniqueValues, areEqualPOJOValuesUsingPojoFilter, NOOP_MODIFIER, asArray, mergeArrays, filterNullAndUndefinedValues, objectHasNoKeys, mapMaybeFunction, isWebsiteUrlWithPrefix, websiteUrlDetails, transformStringFunction, US_STATE_CODE_STRING_REGEX, ZIP_CODE_STRING_REGEX, LAT_LNG_PATTERN, transformNumberFunction, DOLLAR_AMOUNT_PRECISION, stripObject, getValueFromGetter, asGetter, dateFromMinuteOfDay, dateToMinuteOfDay, isISO8601DayStringStart, mapIdentityFunction, isDate, MS_IN_MINUTE, isMonthDaySlashDate, filterFromPOJO, TIME_UNIT_SHORT_LABEL_MAP, timeUnitToMilliseconds, ALL_TIME_UNITS, minutesToHoursAndMinutes, millisecondsToTimeUnit, hoursAndMinutesToTimeUnit, isE164PhoneNumber as isE164PhoneNumber$1, isValidPhoneExtensionNumber, e164PhoneNumberExtensionPair, e164PhoneNumberFromE164PhoneNumberExtensionPair, mergeArraysIntoArray, convertMaybeToArray, lastValue, filterEmptyArrayValues, setContainsAllValues, addToSetCopy, setsAreEquivalent, makeValuesGroupMap, sortByStringFunction, separateValues, isSelectedDecisionFunctionFactory, readKeysFrom, hasDifferentValues, capitalizeFirstLetter, objectIsEmpty, mergeObjectsFunction, filterFromPOJOFunction, mergeObjects, addPlusPrefixToNumber, searchStringFilterFunction, caseInsensitiveFilterByIndexOfDecisionFactory, arrayToMap, firstValue, cachedGetter, makeGetter, asDecisionFunction, TIME_UNIT_LABEL_MAP, HAS_WEBSITE_DOMAIN_NAME_REGEX, KeyValueTypleValueFilter, valuesFromPOJO, allObjectsAreEqual, isNumberDivisibleBy, nearestDivisibleValues, concatArrays } from '@dereekb/util';
|
|
12
12
|
import * as i1 from '@angular/forms';
|
|
@@ -209,9 +209,9 @@ class DbxActionFormDirective {
|
|
|
209
209
|
isEqual: toObservable(this.dbxActionFormIsEqual)
|
|
210
210
|
}).pipe(shareReplay(1));
|
|
211
211
|
mapValueFunction$ = toObservable(this.dbxActionFormMapValue);
|
|
212
|
-
_triggeredSub =
|
|
213
|
-
_isCompleteSub =
|
|
214
|
-
_isWorkingSub =
|
|
212
|
+
_triggeredSub = cleanSubscription();
|
|
213
|
+
_isCompleteSub = cleanSubscription();
|
|
214
|
+
_isWorkingSub = cleanSubscription();
|
|
215
215
|
constructor() {
|
|
216
216
|
if (this.form.lockSet) {
|
|
217
217
|
this.lockSet.addChildLockSet(this.form.lockSet, 'form');
|
|
@@ -471,13 +471,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
471
471
|
class DbxFormlyComponent {
|
|
472
472
|
_dbxFormlyContext = inject((DbxFormlyContext));
|
|
473
473
|
formlyForm = viewChild(FormlyForm, ...(ngDevMode ? [{ debugName: "formlyForm" }] : /* istanbul ignore next */ []));
|
|
474
|
-
_fields = new BehaviorSubject(undefined);
|
|
475
|
-
_events = new BehaviorSubject({ isComplete: false, state: DbxFormState.INITIALIZING, status: 'PENDING' });
|
|
476
|
-
_disabled = new BehaviorSubject(undefined);
|
|
477
|
-
_reset = new BehaviorSubject(new Date());
|
|
478
|
-
_forceUpdate = new Subject();
|
|
479
|
-
_disabledSub =
|
|
480
|
-
_enforceDisabledSub =
|
|
474
|
+
_fields = completeOnDestroy(new BehaviorSubject(undefined));
|
|
475
|
+
_events = completeOnDestroy(new BehaviorSubject({ isComplete: false, state: DbxFormState.INITIALIZING, status: 'PENDING' }));
|
|
476
|
+
_disabled = completeOnDestroy(new BehaviorSubject(undefined));
|
|
477
|
+
_reset = completeOnDestroy(new BehaviorSubject(new Date()));
|
|
478
|
+
_forceUpdate = completeOnDestroy(new Subject());
|
|
479
|
+
_disabledSub = cleanSubscription();
|
|
480
|
+
_enforceDisabledSub = cleanSubscription();
|
|
481
481
|
form = new FormGroup({});
|
|
482
482
|
modelSignal = signal({}, ...(ngDevMode ? [{ debugName: "modelSignal" }] : /* istanbul ignore next */ []));
|
|
483
483
|
options = {};
|
|
@@ -1568,9 +1568,9 @@ function _getNestedValue(source, path) {
|
|
|
1568
1568
|
*/
|
|
1569
1569
|
class DbxForgeFormComponent {
|
|
1570
1570
|
_context = inject((DbxForgeFormContext));
|
|
1571
|
-
_setValueSub =
|
|
1572
|
-
_resetSub =
|
|
1573
|
-
_disabledSub =
|
|
1571
|
+
_setValueSub = cleanSubscription();
|
|
1572
|
+
_resetSub = cleanSubscription();
|
|
1573
|
+
_disabledSub = cleanSubscription();
|
|
1574
1574
|
dynamicForm = viewChild(DynamicForm, ...(ngDevMode ? [{ debugName: "dynamicForm" }] : /* istanbul ignore next */ []));
|
|
1575
1575
|
formValue = signal({}, { ...(ngDevMode ? { debugName: "formValue" } : /* istanbul ignore next */ {}), equal: (a, b) => _forgeFormValueEqual(a, b, this._context) });
|
|
1576
1576
|
configSignal = toSignal(this._context.config$, { initialValue: undefined });
|
|
@@ -1781,11 +1781,6 @@ class DbxForgeFormComponent {
|
|
|
1781
1781
|
this.formValue.set(sanitized);
|
|
1782
1782
|
this._emitFormState();
|
|
1783
1783
|
}
|
|
1784
|
-
ngOnDestroy() {
|
|
1785
|
-
this._setValueSub.destroy();
|
|
1786
|
-
this._resetSub.destroy();
|
|
1787
|
-
this._disabledSub.destroy();
|
|
1788
|
-
}
|
|
1789
1784
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DbxForgeFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1790
1785
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: DbxForgeFormComponent, isStandalone: true, selector: "dbx-forge", host: { properties: { "class.dbx-forge-form-disabled": "isDisabled()" }, classAttribute: "dbx-forge" }, providers: [EventDispatcher, { provide: DbxForgeDynamicFormSignalRef, useExisting: DbxForgeFormComponent }, DbxForgeFormContextService, { provide: DbxForm, useExisting: DbxForgeFormContext }, { provide: DbxMutableForm, useExisting: DbxForgeFormContext }], viewQueries: [{ propertyName: "dynamicForm", first: true, predicate: DynamicForm, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1791
1786
|
@if (configSignal()) {
|
|
@@ -4514,35 +4509,35 @@ const DBX_DATE_TIME_FIELD_TIME_NOT_IN_RANGE_ERROR = 'dateTimeFieldTimeNotInRange
|
|
|
4514
4509
|
*/
|
|
4515
4510
|
class DbxDateTimeFieldComponent extends FieldType {
|
|
4516
4511
|
dbxDateTimeFieldConfigService = inject(DbxDateTimeFieldMenuPresetsService);
|
|
4517
|
-
_sub =
|
|
4518
|
-
_valueSub =
|
|
4519
|
-
_autoFillDateSync =
|
|
4520
|
-
_config = new BehaviorSubject(undefined);
|
|
4512
|
+
_sub = cleanSubscription();
|
|
4513
|
+
_valueSub = cleanSubscription();
|
|
4514
|
+
_autoFillDateSync = cleanSubscription();
|
|
4515
|
+
_config = completeOnDestroy(new BehaviorSubject(undefined));
|
|
4521
4516
|
latestConfig$ = this._config.pipe(switchMapMaybeDefault(), distinctUntilChanged(), shareReplay(1));
|
|
4522
|
-
_syncConfigObs = new BehaviorSubject(undefined);
|
|
4523
|
-
_defaultTimezone = new BehaviorSubject(undefined);
|
|
4524
|
-
_timeDate = new BehaviorSubject(undefined);
|
|
4525
|
-
_presets = new BehaviorSubject(of([]));
|
|
4517
|
+
_syncConfigObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
4518
|
+
_defaultTimezone = completeOnDestroy(new BehaviorSubject(undefined));
|
|
4519
|
+
_timeDate = completeOnDestroy(new BehaviorSubject(undefined));
|
|
4520
|
+
_presets = completeOnDestroy(new BehaviorSubject(of([])));
|
|
4526
4521
|
/**
|
|
4527
4522
|
* Alternative/backup full day control if not defined in the Formly form.
|
|
4528
4523
|
*/
|
|
4529
4524
|
_fullDayInputCtrl = new FormControl(false);
|
|
4530
|
-
_fullDayControlObs = new BehaviorSubject(undefined);
|
|
4525
|
+
_fullDayControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
4531
4526
|
fullDayControl$ = this._fullDayControlObs.pipe(filterMaybe());
|
|
4532
|
-
_offset = new BehaviorSubject(0);
|
|
4533
|
-
_formControlObs = new BehaviorSubject(undefined);
|
|
4527
|
+
_offset = completeOnDestroy(new BehaviorSubject(0));
|
|
4528
|
+
_formControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
4534
4529
|
formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
4535
|
-
_cleared = new Subject();
|
|
4536
|
-
_updateTime = new Subject();
|
|
4537
|
-
_resyncTimeInputSub =
|
|
4538
|
-
_resyncTimeInput = new Subject();
|
|
4530
|
+
_cleared = completeOnDestroy(new Subject());
|
|
4531
|
+
_updateTime = completeOnDestroy(new Subject());
|
|
4532
|
+
_resyncTimeInputSub = cleanSubscription();
|
|
4533
|
+
_resyncTimeInput = completeOnDestroy(new Subject());
|
|
4539
4534
|
timeErrorStateMatcher = {
|
|
4540
4535
|
isErrorState: (control, form) => {
|
|
4541
4536
|
return control ? (control.invalid && (control.dirty || control.touched)) || this.errorStateMatcher.isErrorState(this.formControl, form) : false;
|
|
4542
4537
|
}
|
|
4543
4538
|
};
|
|
4544
4539
|
resyncTimeInput$ = this._resyncTimeInput.pipe(debounceTime(200), shareReplay(1));
|
|
4545
|
-
_configUpdateTimeSync =
|
|
4540
|
+
_configUpdateTimeSync = cleanSubscription(this.latestConfig$.pipe(skip(1)).subscribe((_x) => {
|
|
4546
4541
|
this._updateTime.next();
|
|
4547
4542
|
}));
|
|
4548
4543
|
timezone$ = this._defaultTimezone.pipe(switchMapMaybeDefault(), distinctUntilChanged()).pipe(map((defaultTimezone) => {
|
|
@@ -5004,22 +4999,6 @@ class DbxDateTimeFieldComponent extends FieldType {
|
|
|
5004
4999
|
}
|
|
5005
5000
|
ngOnDestroy() {
|
|
5006
5001
|
super.ngOnDestroy();
|
|
5007
|
-
this._sub.destroy();
|
|
5008
|
-
this._valueSub.destroy();
|
|
5009
|
-
this._config.complete();
|
|
5010
|
-
this._configUpdateTimeSync.destroy();
|
|
5011
|
-
this._defaultTimezone.complete();
|
|
5012
|
-
this._resyncTimeInputSub.destroy();
|
|
5013
|
-
this._autoFillDateSync.destroy();
|
|
5014
|
-
this._timeDate.complete();
|
|
5015
|
-
this._presets.complete();
|
|
5016
|
-
this._fullDayControlObs.complete();
|
|
5017
|
-
this._offset.complete();
|
|
5018
|
-
this._formControlObs.complete();
|
|
5019
|
-
this._updateTime.complete();
|
|
5020
|
-
this._cleared.complete();
|
|
5021
|
-
this._resyncTimeInput.complete();
|
|
5022
|
-
this._syncConfigObs.complete();
|
|
5023
5002
|
}
|
|
5024
5003
|
selectPreset(preset) {
|
|
5025
5004
|
const value = preset.value();
|
|
@@ -5698,19 +5677,19 @@ class DbxForgeDateTimeFieldComponent {
|
|
|
5698
5677
|
_isCleared = signal(false, ...(ngDevMode ? [{ debugName: "_isCleared" }] : /* istanbul ignore next */ []));
|
|
5699
5678
|
_isTimeInputFocused = signal(false, ...(ngDevMode ? [{ debugName: "_isTimeInputFocused" }] : /* istanbul ignore next */ []));
|
|
5700
5679
|
// MARK: Subscription management
|
|
5701
|
-
_sub =
|
|
5702
|
-
_valueSub =
|
|
5703
|
-
_autoFillDateSync =
|
|
5704
|
-
_resyncTimeInputSub =
|
|
5680
|
+
_sub = cleanSubscription();
|
|
5681
|
+
_valueSub = cleanSubscription();
|
|
5682
|
+
_autoFillDateSync = cleanSubscription();
|
|
5683
|
+
_resyncTimeInputSub = cleanSubscription();
|
|
5705
5684
|
_timezoneSub;
|
|
5706
5685
|
_pickerConfigSub;
|
|
5707
5686
|
_timeDateSub;
|
|
5708
5687
|
_presetsSub;
|
|
5709
5688
|
// MARK: Subjects for event coordination
|
|
5710
|
-
_offset = new BehaviorSubject(0);
|
|
5711
|
-
_updateTime = new Subject();
|
|
5712
|
-
_resyncTimeInput = new Subject();
|
|
5713
|
-
_syncConfigObs = new BehaviorSubject(undefined);
|
|
5689
|
+
_offset = completeOnDestroy(new BehaviorSubject(0));
|
|
5690
|
+
_updateTime = completeOnDestroy(new Subject());
|
|
5691
|
+
_resyncTimeInput = completeOnDestroy(new Subject());
|
|
5692
|
+
_syncConfigObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
5714
5693
|
// MARK: Error state matcher
|
|
5715
5694
|
timeErrorStateMatcher = {
|
|
5716
5695
|
isErrorState: (control) => {
|
|
@@ -6586,20 +6565,20 @@ class DbxForgeFixedDateRangeFieldComponent {
|
|
|
6586
6565
|
currentDateRangeInputSignal = signal(undefined, ...(ngDevMode ? [{ debugName: "currentDateRangeInputSignal" }] : /* istanbul ignore next */ []));
|
|
6587
6566
|
currentSelectionModeSignal = signal('single', ...(ngDevMode ? [{ debugName: "currentSelectionModeSignal" }] : /* istanbul ignore next */ []));
|
|
6588
6567
|
// MARK: Subscription management
|
|
6589
|
-
_sub =
|
|
6590
|
-
_inputRangeFormSub =
|
|
6591
|
-
_inputRangeFormValueSub =
|
|
6592
|
-
_dateRangeInputSub =
|
|
6593
|
-
_currentSelectionModeSub =
|
|
6594
|
-
_disableEndSub =
|
|
6595
|
-
_activeDateSub =
|
|
6568
|
+
_sub = cleanSubscription();
|
|
6569
|
+
_inputRangeFormSub = cleanSubscription();
|
|
6570
|
+
_inputRangeFormValueSub = cleanSubscription();
|
|
6571
|
+
_dateRangeInputSub = cleanSubscription();
|
|
6572
|
+
_currentSelectionModeSub = cleanSubscription();
|
|
6573
|
+
_disableEndSub = cleanSubscription();
|
|
6574
|
+
_activeDateSub = cleanSubscription();
|
|
6596
6575
|
// MARK: BehaviorSubjects
|
|
6597
|
-
_config = new BehaviorSubject(undefined);
|
|
6598
|
-
_selectionMode = new BehaviorSubject(undefined);
|
|
6599
|
-
_dateRangeInput = new BehaviorSubject(undefined);
|
|
6600
|
-
_timezone = new BehaviorSubject(undefined);
|
|
6576
|
+
_config = completeOnDestroy(new BehaviorSubject(undefined));
|
|
6577
|
+
_selectionMode = completeOnDestroy(new BehaviorSubject(undefined));
|
|
6578
|
+
_dateRangeInput = completeOnDestroy(new BehaviorSubject(undefined));
|
|
6579
|
+
_timezone = completeOnDestroy(new BehaviorSubject(undefined));
|
|
6601
6580
|
// MARK: Event subject
|
|
6602
|
-
_selectionEvent = new Subject();
|
|
6581
|
+
_selectionEvent = completeOnDestroy(new Subject());
|
|
6603
6582
|
selectedDateRange$ = this._selectionEvent.pipe(map((x) => x.range));
|
|
6604
6583
|
// MARK: Form group for text inputs
|
|
6605
6584
|
inputRangeForm = new FormGroup({
|
|
@@ -8326,8 +8305,8 @@ class AbstractForgeSearchableFieldDirective {
|
|
|
8326
8305
|
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
8327
8306
|
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
8328
8307
|
inputCtrl = new FormControl('');
|
|
8329
|
-
_clearDisplayHashMapSub =
|
|
8330
|
-
_displayHashMap = new BehaviorSubject(new Map());
|
|
8308
|
+
_clearDisplayHashMapSub = cleanSubscription();
|
|
8309
|
+
_displayHashMap = completeOnDestroy(new BehaviorSubject(new Map()));
|
|
8331
8310
|
// MARK: Input Observables
|
|
8332
8311
|
inputValue$ = this.inputCtrl.valueChanges.pipe(startWith(this.inputCtrl.value), map((x) => (typeof x === 'string' ? x : '')));
|
|
8333
8312
|
inputValueString$ = this.inputValue$.pipe(debounceTime(200), distinctUntilChanged());
|
|
@@ -8371,8 +8350,6 @@ class AbstractForgeSearchableFieldDirective {
|
|
|
8371
8350
|
this._onInit();
|
|
8372
8351
|
}
|
|
8373
8352
|
ngOnDestroy() {
|
|
8374
|
-
this._clearDisplayHashMapSub.destroy();
|
|
8375
|
-
this._displayHashMap.complete();
|
|
8376
8353
|
this._onDestroy();
|
|
8377
8354
|
}
|
|
8378
8355
|
// MARK: Protected Helpers
|
|
@@ -8546,8 +8523,8 @@ class DbxForgeSearchableTextFieldComponent extends AbstractForgeSearchableFieldD
|
|
|
8546
8523
|
elementRef = inject((ElementRef));
|
|
8547
8524
|
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
8548
8525
|
textInputRef = viewChild('textInput', ...(ngDevMode ? [{ debugName: "textInputRef" }] : /* istanbul ignore next */ []));
|
|
8549
|
-
_singleValueSyncSub =
|
|
8550
|
-
_valuesSubject = new BehaviorSubject([]);
|
|
8526
|
+
_singleValueSyncSub = cleanSubscription();
|
|
8527
|
+
_valuesSubject = completeOnDestroy(new BehaviorSubject([]));
|
|
8551
8528
|
// Disabled state
|
|
8552
8529
|
isDisabled = dbxForgeFieldDisabled();
|
|
8553
8530
|
// Error handling
|
|
@@ -8669,9 +8646,9 @@ class DbxForgeSearchableChipFieldComponent extends AbstractForgeSearchableFieldD
|
|
|
8669
8646
|
return this.hintId();
|
|
8670
8647
|
return null;
|
|
8671
8648
|
}, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
|
|
8672
|
-
_blur = new Subject();
|
|
8673
|
-
_blurSub =
|
|
8674
|
-
_valuesSubject = new BehaviorSubject([]);
|
|
8649
|
+
_blur = completeOnDestroy(new Subject());
|
|
8650
|
+
_blurSub = cleanSubscription();
|
|
8651
|
+
_valuesSubject = completeOnDestroy(new BehaviorSubject([]));
|
|
8675
8652
|
values$ = this._valuesSubject.asObservable().pipe(shareReplay(1));
|
|
8676
8653
|
displayValues$ = this._valuesSubject.pipe(switchMap((values) => this._loadDisplayValuesForValues(values)), map((x) => x?.value ?? []), shareReplay(1));
|
|
8677
8654
|
displayValuesSignal = toSignal(this.displayValues$, { initialValue: [] });
|
|
@@ -8862,9 +8839,9 @@ class AbstractForgePickableItemFieldDirective {
|
|
|
8862
8839
|
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
8863
8840
|
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
8864
8841
|
inputCtrl = new FormControl('');
|
|
8865
|
-
_clearDisplayHashMapSub =
|
|
8866
|
-
_displayHashMap = new BehaviorSubject(new Map());
|
|
8867
|
-
_valuesSubject = new BehaviorSubject([]);
|
|
8842
|
+
_clearDisplayHashMapSub = cleanSubscription();
|
|
8843
|
+
_displayHashMap = completeOnDestroy(new BehaviorSubject(new Map()));
|
|
8844
|
+
_valuesSubject = completeOnDestroy(new BehaviorSubject([]));
|
|
8868
8845
|
// MARK: Computed Signals
|
|
8869
8846
|
labelSignal = computed(() => {
|
|
8870
8847
|
const l = this.label();
|
|
@@ -8981,11 +8958,6 @@ class AbstractForgePickableItemFieldDirective {
|
|
|
8981
8958
|
this._clearDisplayHashMapSub.subscription = p.refreshDisplayValues$.subscribe(() => this._displayHashMap.next(new Map()));
|
|
8982
8959
|
}
|
|
8983
8960
|
}
|
|
8984
|
-
ngOnDestroy() {
|
|
8985
|
-
this._clearDisplayHashMapSub.destroy();
|
|
8986
|
-
this._displayHashMap.complete();
|
|
8987
|
-
this._valuesSubject.complete();
|
|
8988
|
-
}
|
|
8989
8961
|
// MARK: Template Actions
|
|
8990
8962
|
itemClicked(item) {
|
|
8991
8963
|
if (!item.disabled) {
|
|
@@ -9282,14 +9254,14 @@ class DbxForgeSourceSelectFieldComponent {
|
|
|
9282
9254
|
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
9283
9255
|
// Disabled state
|
|
9284
9256
|
isDisabled = dbxForgeFieldDisabled();
|
|
9285
|
-
_cacheMetaSub =
|
|
9286
|
-
_clearDisplayHashMapSub =
|
|
9287
|
-
_valueMetaHashMap = new BehaviorSubject(new Map());
|
|
9288
|
-
_displayHashMap = new BehaviorSubject(new Map());
|
|
9289
|
-
_fromOpenSource = new BehaviorSubject({ values: [], valuesSet: new Set() });
|
|
9290
|
-
_loadSources = new BehaviorSubject(undefined);
|
|
9291
|
-
_valuesSubject = new BehaviorSubject([]);
|
|
9292
|
-
_filterText$ = new BehaviorSubject('');
|
|
9257
|
+
_cacheMetaSub = cleanSubscription();
|
|
9258
|
+
_clearDisplayHashMapSub = cleanSubscription();
|
|
9259
|
+
_valueMetaHashMap = completeOnDestroy(new BehaviorSubject(new Map()));
|
|
9260
|
+
_displayHashMap = completeOnDestroy(new BehaviorSubject(new Map()));
|
|
9261
|
+
_fromOpenSource = completeOnDestroy(new BehaviorSubject({ values: [], valuesSet: new Set() }));
|
|
9262
|
+
_loadSources = completeOnDestroy(new BehaviorSubject(undefined));
|
|
9263
|
+
_valuesSubject = completeOnDestroy(new BehaviorSubject([]));
|
|
9264
|
+
_filterText$ = completeOnDestroy(new BehaviorSubject(''));
|
|
9293
9265
|
buttonElement = viewChild('button', { ...(ngDevMode ? { debugName: "buttonElement" } : /* istanbul ignore next */ {}), read: (ElementRef) });
|
|
9294
9266
|
filterInputElement = viewChild('filterInput', { ...(ngDevMode ? { debugName: "filterInputElement" } : /* istanbul ignore next */ {}), read: (ElementRef) });
|
|
9295
9267
|
// Computed signals from props
|
|
@@ -9451,14 +9423,6 @@ class DbxForgeSourceSelectFieldComponent {
|
|
|
9451
9423
|
});
|
|
9452
9424
|
}
|
|
9453
9425
|
ngOnDestroy() {
|
|
9454
|
-
this._cacheMetaSub.destroy();
|
|
9455
|
-
this._clearDisplayHashMapSub.destroy();
|
|
9456
|
-
this._valueMetaHashMap.complete();
|
|
9457
|
-
this._displayHashMap.complete();
|
|
9458
|
-
this._fromOpenSource.complete();
|
|
9459
|
-
this._loadSources.complete();
|
|
9460
|
-
this._valuesSubject.complete();
|
|
9461
|
-
this._filterText$.complete();
|
|
9462
9426
|
this.context.destroy();
|
|
9463
9427
|
}
|
|
9464
9428
|
onSelectOpenedChange(opened) {
|
|
@@ -9673,10 +9637,10 @@ class DbxForgeListSelectionFieldComponent {
|
|
|
9673
9637
|
// Disabled state
|
|
9674
9638
|
isDisabled = dbxForgeFieldDisabled();
|
|
9675
9639
|
isDisabled$ = toObservable(this.isDisabled);
|
|
9676
|
-
_selectionEventSub =
|
|
9677
|
-
_loadMoreSub =
|
|
9678
|
-
_listComponentClassObs = new BehaviorSubject(undefined);
|
|
9679
|
-
_valuesSubject = new BehaviorSubject([]);
|
|
9640
|
+
_selectionEventSub = cleanSubscription();
|
|
9641
|
+
_loadMoreSub = cleanSubscription();
|
|
9642
|
+
_listComponentClassObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
9643
|
+
_valuesSubject = completeOnDestroy(new BehaviorSubject([]));
|
|
9680
9644
|
labelSignal = computed(() => {
|
|
9681
9645
|
const l = this.label();
|
|
9682
9646
|
return typeof l === 'string' ? l : undefined;
|
|
@@ -9748,12 +9712,6 @@ class DbxForgeListSelectionFieldComponent {
|
|
|
9748
9712
|
this._listComponentClassObs.next(p.listComponentClass);
|
|
9749
9713
|
}
|
|
9750
9714
|
}
|
|
9751
|
-
ngOnDestroy() {
|
|
9752
|
-
this._selectionEventSub.destroy();
|
|
9753
|
-
this._loadMoreSub.destroy();
|
|
9754
|
-
this._listComponentClassObs.complete();
|
|
9755
|
-
this._valuesSubject.complete();
|
|
9756
|
-
}
|
|
9757
9715
|
// MARK: Internal
|
|
9758
9716
|
_updateForSelection(list) {
|
|
9759
9717
|
if (this.isDisabled())
|
|
@@ -9952,8 +9910,8 @@ class DbxForgeTextEditorFieldComponent {
|
|
|
9952
9910
|
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
9953
9911
|
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
9954
9912
|
_editor;
|
|
9955
|
-
_editorValueSub =
|
|
9956
|
-
_syncFromFieldSub =
|
|
9913
|
+
_editorValueSub = cleanSubscription();
|
|
9914
|
+
_syncFromFieldSub = cleanSubscription();
|
|
9957
9915
|
editorFormControl = new FormControl('', { nonNullable: true });
|
|
9958
9916
|
// Disabled state
|
|
9959
9917
|
isDisabled = dbxForgeFieldDisabled();
|
|
@@ -10016,8 +9974,6 @@ class DbxForgeTextEditorFieldComponent {
|
|
|
10016
9974
|
if (this._editor != null) {
|
|
10017
9975
|
this._editor.destroy();
|
|
10018
9976
|
}
|
|
10019
|
-
this._editorValueSub.destroy();
|
|
10020
|
-
this._syncFromFieldSub.destroy();
|
|
10021
9977
|
}
|
|
10022
9978
|
_setFieldValue(value) {
|
|
10023
9979
|
const fieldSignal = this.field();
|
|
@@ -10802,16 +10758,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
10802
10758
|
* Base directive for forge forms with dynamic (Observable) FormConfig.
|
|
10803
10759
|
*/
|
|
10804
10760
|
class AbstractAsyncForgeFormDirective extends AbstractForgeFormDirective {
|
|
10805
|
-
_configSub =
|
|
10761
|
+
_configSub = cleanSubscription();
|
|
10806
10762
|
ngOnInit() {
|
|
10807
10763
|
// TODO: Can probably move this to constructor().
|
|
10808
10764
|
this._configSub.subscription = this.formConfig$.pipe(distinctUntilChanged$1(), filterMaybe()).subscribe((formConfig) => {
|
|
10809
10765
|
this.context.config = formConfig;
|
|
10810
10766
|
});
|
|
10811
10767
|
}
|
|
10812
|
-
ngOnDestroy() {
|
|
10813
|
-
this._configSub.destroy();
|
|
10814
|
-
}
|
|
10815
10768
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AbstractAsyncForgeFormDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
10816
10769
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.10", type: AbstractAsyncForgeFormDirective, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
10817
10770
|
}
|
|
@@ -11772,8 +11725,8 @@ const DEFAULT_HAS_VALUE_FN = (x) => !objectIsEmpty(x);
|
|
|
11772
11725
|
class AbstractFormExpandSectionWrapperDirective extends FieldWrapper {
|
|
11773
11726
|
static _nextId = 0;
|
|
11774
11727
|
expandContentId = `dbx-form-expand-${AbstractFormExpandSectionWrapperDirective._nextId++}`;
|
|
11775
|
-
_formControlObs = new BehaviorSubject(undefined);
|
|
11776
|
-
_toggleOpen = new BehaviorSubject(undefined);
|
|
11728
|
+
_formControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
11729
|
+
_toggleOpen = completeOnDestroy(new BehaviorSubject(undefined));
|
|
11777
11730
|
formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
11778
11731
|
show$ = this._toggleOpen.pipe(switchMap((toggleOpen) => {
|
|
11779
11732
|
if (toggleOpen != null) {
|
|
@@ -11808,10 +11761,6 @@ class AbstractFormExpandSectionWrapperDirective extends FieldWrapper {
|
|
|
11808
11761
|
ngOnInit() {
|
|
11809
11762
|
this._formControlObs.next(this.formControl);
|
|
11810
11763
|
}
|
|
11811
|
-
ngOnDestroy() {
|
|
11812
|
-
this._toggleOpen.complete();
|
|
11813
|
-
this._formControlObs.complete();
|
|
11814
|
-
}
|
|
11815
11764
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AbstractFormExpandSectionWrapperDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
11816
11765
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.10", type: AbstractFormExpandSectionWrapperDirective, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
11817
11766
|
}
|
|
@@ -11941,8 +11890,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
11941
11890
|
* Registered as Formly wrapper `'style'`.
|
|
11942
11891
|
*/
|
|
11943
11892
|
class DbxFormStyleWrapperComponent extends FieldWrapper {
|
|
11944
|
-
_style = new BehaviorSubject(undefined);
|
|
11945
|
-
_class = new BehaviorSubject(undefined);
|
|
11893
|
+
_style = completeOnDestroy(new BehaviorSubject(undefined));
|
|
11894
|
+
_class = completeOnDestroy(new BehaviorSubject(undefined));
|
|
11946
11895
|
style$ = this._style.pipe(switchMapMaybeDefault({}), shareReplay(1));
|
|
11947
11896
|
class$ = this._class.pipe(switchMapMaybeDefault(''), shareReplay(1));
|
|
11948
11897
|
styleSignal = toSignal(this.style$);
|
|
@@ -11961,10 +11910,6 @@ class DbxFormStyleWrapperComponent extends FieldWrapper {
|
|
|
11961
11910
|
this._class.next(asObservable(this.classGetter));
|
|
11962
11911
|
}
|
|
11963
11912
|
}
|
|
11964
|
-
ngOnDestroy() {
|
|
11965
|
-
this._style.complete();
|
|
11966
|
-
this._class.complete();
|
|
11967
|
-
}
|
|
11968
11913
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DbxFormStyleWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
11969
11914
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.10", type: DbxFormStyleWrapperComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
11970
11915
|
<div class="dbx-form-style-wrapper" [ngClass]="classSignal()" [ngStyle]="styleSignal()">
|
|
@@ -11992,7 +11937,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
11992
11937
|
* By default shows loading during asynchronous validation of a field (FormControl status is "PENDING")
|
|
11993
11938
|
*/
|
|
11994
11939
|
class DbxFormWorkingWrapperComponent extends FieldWrapper {
|
|
11995
|
-
sub =
|
|
11940
|
+
sub = cleanSubscription();
|
|
11996
11941
|
workingContext = new SimpleLoadingContext(false);
|
|
11997
11942
|
ngOnInit() {
|
|
11998
11943
|
this.sub.subscription = this.formControl?.statusChanges.subscribe({
|
|
@@ -12001,7 +11946,6 @@ class DbxFormWorkingWrapperComponent extends FieldWrapper {
|
|
|
12001
11946
|
}
|
|
12002
11947
|
ngOnDestroy() {
|
|
12003
11948
|
this.workingContext.destroy();
|
|
12004
|
-
this.sub.destroy();
|
|
12005
11949
|
}
|
|
12006
11950
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DbxFormWorkingWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
12007
11951
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.10", type: DbxFormWorkingWrapperComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
@@ -12565,13 +12509,13 @@ const dbxListField = formlyDbxListField;
|
|
|
12565
12509
|
* are tracked by key and synchronized with the form control value.
|
|
12566
12510
|
*/
|
|
12567
12511
|
class DbxItemListFieldComponent extends FieldType$1 {
|
|
12568
|
-
_selectionEventSub =
|
|
12569
|
-
_loadMoreSub =
|
|
12570
|
-
_formControlObs = new BehaviorSubject(undefined);
|
|
12512
|
+
_selectionEventSub = cleanSubscription();
|
|
12513
|
+
_loadMoreSub = cleanSubscription();
|
|
12514
|
+
_formControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
12571
12515
|
formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
12572
12516
|
_formControlValue$ = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value), shareReplay(1))));
|
|
12573
12517
|
values$ = this._formControlValue$.pipe(map(convertMaybeToArray), shareReplay(1));
|
|
12574
|
-
_listComponentClassObs = new BehaviorSubject(undefined);
|
|
12518
|
+
_listComponentClassObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
12575
12519
|
listComponentClass$ = this._listComponentClassObs.pipe(switchMapFilterMaybe());
|
|
12576
12520
|
config$ = this.listComponentClass$.pipe(map((componentClass) => {
|
|
12577
12521
|
const loadMore = this.loadMore;
|
|
@@ -12613,11 +12557,6 @@ class DbxItemListFieldComponent extends FieldType$1 {
|
|
|
12613
12557
|
this._formControlObs.next(this.formControl);
|
|
12614
12558
|
this._listComponentClassObs.next(this.listComponentClass);
|
|
12615
12559
|
}
|
|
12616
|
-
ngOnDestroy() {
|
|
12617
|
-
this._formControlObs.complete();
|
|
12618
|
-
this._selectionEventSub.destroy();
|
|
12619
|
-
this._listComponentClassObs.complete();
|
|
12620
|
-
}
|
|
12621
12560
|
updateForSelection(list) {
|
|
12622
12561
|
const items = list.items.filter((x) => x.selected).map((x) => x.itemValue);
|
|
12623
12562
|
const values = readKeysFrom(this.readKey, items);
|
|
@@ -12672,10 +12611,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
|
|
|
12672
12611
|
class AbstractDbxPickableItemFieldDirective extends FieldType {
|
|
12673
12612
|
filterMatInput = viewChild('matInput', { ...(ngDevMode ? { debugName: "filterMatInput" } : /* istanbul ignore next */ {}), read: MatInput });
|
|
12674
12613
|
inputCtrl = new FormControl('');
|
|
12675
|
-
_formControlObs = new BehaviorSubject(undefined);
|
|
12614
|
+
_formControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
12676
12615
|
formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
12677
|
-
_clearDisplayHashMapSub =
|
|
12678
|
-
_displayHashMap = new BehaviorSubject(new Map());
|
|
12616
|
+
_clearDisplayHashMapSub = cleanSubscription();
|
|
12617
|
+
_displayHashMap = completeOnDestroy(new BehaviorSubject(new Map()));
|
|
12679
12618
|
filterInputValue$ = this.inputCtrl.valueChanges.pipe(startWith(undefined));
|
|
12680
12619
|
filterInputValueString$ = this.filterInputValue$.pipe(debounceTime(200), distinctUntilChanged(), shareReplay(1));
|
|
12681
12620
|
loadResultsDisplayValuesState$ = this.formControl$.pipe(first(), switchMap(() => this.loadValuesFn().pipe(switchMap((x) => this.loadDisplayValuesForFieldValues(x)), startWithBeginLoading())), shareReplay(1));
|
|
@@ -12882,9 +12821,6 @@ class AbstractDbxPickableItemFieldDirective extends FieldType {
|
|
|
12882
12821
|
}
|
|
12883
12822
|
ngOnDestroy() {
|
|
12884
12823
|
super.ngOnDestroy();
|
|
12885
|
-
this._displayHashMap.complete();
|
|
12886
|
-
this._formControlObs.complete();
|
|
12887
|
-
this._clearDisplayHashMapSub.destroy();
|
|
12888
12824
|
this.filterResultsContext.destroy();
|
|
12889
12825
|
}
|
|
12890
12826
|
_getValueOnFormControl(valueOnFormControl) {
|
|
@@ -13292,16 +13228,16 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
13292
13228
|
defaultSearchInputPlaceholder = DEFAULT_SEARCH_INPUT_PLACEHOLDER;
|
|
13293
13229
|
textInput = viewChild('textInput', { ...(ngDevMode ? { debugName: "textInput" } : /* istanbul ignore next */ {}), read: (ElementRef) });
|
|
13294
13230
|
inputCtrl = new FormControl('');
|
|
13295
|
-
_formControlObs = new BehaviorSubject(undefined);
|
|
13231
|
+
_formControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
13296
13232
|
formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
13297
|
-
_clearDisplayHashMapSub =
|
|
13298
|
-
_displayHashMap = new BehaviorSubject(new Map());
|
|
13233
|
+
_clearDisplayHashMapSub = cleanSubscription();
|
|
13234
|
+
_displayHashMap = completeOnDestroy(new BehaviorSubject(new Map()));
|
|
13299
13235
|
inputValue$ = this.inputCtrl.valueChanges.pipe(startWith(this.inputCtrl.value), map((x) => (typeof x === 'string' ? x : '')));
|
|
13300
13236
|
inputValueString$ = this.inputValue$.pipe(debounceTime(200), distinctUntilChanged());
|
|
13301
13237
|
searchResultsState$ = this.inputValueString$.pipe(switchMap((text) => (text || this.searchOnEmptyText ? this.search(text ?? '') : of([])).pipe(switchMap((x) => this.loadDisplayValuesForFieldValues(x)),
|
|
13302
13238
|
// Return begin loading to setup the loading state.
|
|
13303
13239
|
startWithBeginLoading())), shareReplay(1));
|
|
13304
|
-
_singleValueSyncSub =
|
|
13240
|
+
_singleValueSyncSub = cleanSubscription();
|
|
13305
13241
|
searchContext = listLoadingStateContext({ obs: this.searchResultsState$, showLoadingOnNoValue: false });
|
|
13306
13242
|
searchResults$ = this.searchResultsState$.pipe(map((x) => x?.value ?? []), shareReplay(1));
|
|
13307
13243
|
isLoadingSearchResults$ = this.searchResultsState$.pipe(map(isLoadingStateInLoadingState), distinctUntilChanged(), shareReplay(1));
|
|
@@ -13447,10 +13383,6 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
|
|
|
13447
13383
|
}
|
|
13448
13384
|
ngOnDestroy() {
|
|
13449
13385
|
super.ngOnDestroy();
|
|
13450
|
-
this._clearDisplayHashMapSub.destroy();
|
|
13451
|
-
this._displayHashMap.complete();
|
|
13452
|
-
this._singleValueSyncSub.destroy();
|
|
13453
|
-
this._formControlObs.complete();
|
|
13454
13386
|
this.searchContext.destroy();
|
|
13455
13387
|
}
|
|
13456
13388
|
/**
|
|
@@ -13580,8 +13512,8 @@ class DbxSearchableChipFieldComponent extends AbstractDbxSearchableValueFieldDir
|
|
|
13580
13512
|
get multiSelect() {
|
|
13581
13513
|
return this.props.multiSelect ?? true;
|
|
13582
13514
|
}
|
|
13583
|
-
_blur = new Subject();
|
|
13584
|
-
_blurSub =
|
|
13515
|
+
_blur = completeOnDestroy(new Subject());
|
|
13516
|
+
_blurSub = cleanSubscription();
|
|
13585
13517
|
separatorKeysCodes = [ENTER, COMMA];
|
|
13586
13518
|
selected(event) {
|
|
13587
13519
|
this.addWithDisplayValue(event.option.value);
|
|
@@ -13610,8 +13542,6 @@ class DbxSearchableChipFieldComponent extends AbstractDbxSearchableValueFieldDir
|
|
|
13610
13542
|
}
|
|
13611
13543
|
ngOnDestroy() {
|
|
13612
13544
|
super.ngOnDestroy();
|
|
13613
|
-
this._blur.complete();
|
|
13614
|
-
this._blurSub.destroy();
|
|
13615
13545
|
}
|
|
13616
13546
|
onBlur() {
|
|
13617
13547
|
this._blur.next();
|
|
@@ -13868,13 +13798,13 @@ const chipTextField = formlyChipTextField;
|
|
|
13868
13798
|
* and caches display values and metadata for performance.
|
|
13869
13799
|
*/
|
|
13870
13800
|
class DbxFormSourceSelectFieldComponent extends FieldType$2 {
|
|
13871
|
-
_cacheMetaSub =
|
|
13872
|
-
_clearDisplayHashMapSub =
|
|
13873
|
-
_valueMetaHashMap = new BehaviorSubject(new Map());
|
|
13874
|
-
_displayHashMap = new BehaviorSubject(new Map());
|
|
13875
|
-
_formControlObs = new BehaviorSubject(undefined);
|
|
13876
|
-
_fromOpenSource = new BehaviorSubject({ values: [], valuesSet: new Set() });
|
|
13877
|
-
_loadSources = new BehaviorSubject(undefined);
|
|
13801
|
+
_cacheMetaSub = cleanSubscription();
|
|
13802
|
+
_clearDisplayHashMapSub = cleanSubscription();
|
|
13803
|
+
_valueMetaHashMap = completeOnDestroy(new BehaviorSubject(new Map()));
|
|
13804
|
+
_displayHashMap = completeOnDestroy(new BehaviorSubject(new Map()));
|
|
13805
|
+
_formControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
13806
|
+
_fromOpenSource = completeOnDestroy(new BehaviorSubject({ values: [], valuesSet: new Set() }));
|
|
13807
|
+
_loadSources = completeOnDestroy(new BehaviorSubject(undefined));
|
|
13878
13808
|
buttonElement = viewChild('button', { ...(ngDevMode ? { debugName: "buttonElement" } : /* istanbul ignore next */ {}), read: (ElementRef) });
|
|
13879
13809
|
formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
13880
13810
|
currentFormControlValue$ = this.formControl$.pipe(switchMap((control) => control.valueChanges.pipe(startWith(control.value))), shareReplay(1));
|
|
@@ -13996,7 +13926,7 @@ class DbxFormSourceSelectFieldComponent extends FieldType$2 {
|
|
|
13996
13926
|
nonGroupedValuesSignal = toSignal(this.nonGroupedValues$);
|
|
13997
13927
|
groupedOptionsSignal = toSignal(this.groupedOptions$);
|
|
13998
13928
|
// MARK: Filterable
|
|
13999
|
-
_filterText$ = new BehaviorSubject('');
|
|
13929
|
+
_filterText$ = completeOnDestroy(new BehaviorSubject(''));
|
|
14000
13930
|
filterInputElement = viewChild('filterInput', { ...(ngDevMode ? { debugName: "filterInputElement" } : /* istanbul ignore next */ {}), read: (ElementRef) });
|
|
14001
13931
|
filteredOptions$ = combineLatest([this.options$, this._filterText$, this.values$]).pipe(map(([options, filterText, currentValues]) => {
|
|
14002
13932
|
let result;
|
|
@@ -14160,14 +14090,6 @@ class DbxFormSourceSelectFieldComponent extends FieldType$2 {
|
|
|
14160
14090
|
}
|
|
14161
14091
|
ngOnDestroy() {
|
|
14162
14092
|
super.ngOnDestroy();
|
|
14163
|
-
this._cacheMetaSub.destroy();
|
|
14164
|
-
this._clearDisplayHashMapSub.destroy();
|
|
14165
|
-
this._valueMetaHashMap.complete();
|
|
14166
|
-
this._displayHashMap.complete();
|
|
14167
|
-
this._formControlObs.complete();
|
|
14168
|
-
this._fromOpenSource.complete();
|
|
14169
|
-
this._loadSources.complete();
|
|
14170
|
-
this._filterText$.complete();
|
|
14171
14093
|
this.context.destroy();
|
|
14172
14094
|
}
|
|
14173
14095
|
handleSelectOptions = (_, context) => {
|
|
@@ -14363,7 +14285,7 @@ const addValueSelectionOptionFunction = formlyAddValueSelectionOptionFunction;
|
|
|
14363
14285
|
class DbxTextEditorFieldComponent extends FieldType {
|
|
14364
14286
|
_compactContextStore = inject(CompactContextStore, { optional: true });
|
|
14365
14287
|
_editor;
|
|
14366
|
-
_sub =
|
|
14288
|
+
_sub = cleanSubscription();
|
|
14367
14289
|
compactClass$ = mapCompactModeObs(this._compactContextStore?.mode$, {
|
|
14368
14290
|
compact: 'dbx-texteditor-field-compact'
|
|
14369
14291
|
}).pipe(filterMaybe());
|
|
@@ -14400,7 +14322,6 @@ class DbxTextEditorFieldComponent extends FieldType {
|
|
|
14400
14322
|
if (this._editor != null) {
|
|
14401
14323
|
this._editor.destroy();
|
|
14402
14324
|
}
|
|
14403
|
-
this._sub.destroy();
|
|
14404
14325
|
}
|
|
14405
14326
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DbxTextEditorFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
14406
14327
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: DbxTextEditorFieldComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
@@ -14948,22 +14869,22 @@ class DbxFixedDateRangeFieldComponent extends FieldType {
|
|
|
14948
14869
|
endDateInputElement = viewChild('endDateInput', { ...(ngDevMode ? { debugName: "endDateInputElement" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
14949
14870
|
currentDateRangeInputSignal = signal(undefined, ...(ngDevMode ? [{ debugName: "currentDateRangeInputSignal" }] : /* istanbul ignore next */ []));
|
|
14950
14871
|
currentSelectionModeSignal = signal('single', ...(ngDevMode ? [{ debugName: "currentSelectionModeSignal" }] : /* istanbul ignore next */ []));
|
|
14951
|
-
_sub =
|
|
14952
|
-
_inputRangeFormSub =
|
|
14953
|
-
_inputRangeFormValueSub =
|
|
14954
|
-
_dateRangeInputSub =
|
|
14955
|
-
_currentSelectionModeSub =
|
|
14956
|
-
_latestBoundarySub =
|
|
14957
|
-
_disableEndSub =
|
|
14958
|
-
_activeDateSub =
|
|
14959
|
-
_config = new BehaviorSubject(undefined);
|
|
14960
|
-
_selectionMode = new BehaviorSubject(undefined);
|
|
14961
|
-
_dateRangeInput = new BehaviorSubject(undefined);
|
|
14962
|
-
_timezone = new BehaviorSubject(undefined);
|
|
14963
|
-
_presets = new BehaviorSubject(of([]));
|
|
14964
|
-
_selectionEvent = new Subject();
|
|
14872
|
+
_sub = cleanSubscription();
|
|
14873
|
+
_inputRangeFormSub = cleanSubscription();
|
|
14874
|
+
_inputRangeFormValueSub = cleanSubscription();
|
|
14875
|
+
_dateRangeInputSub = cleanSubscription();
|
|
14876
|
+
_currentSelectionModeSub = cleanSubscription();
|
|
14877
|
+
_latestBoundarySub = cleanSubscription();
|
|
14878
|
+
_disableEndSub = cleanSubscription();
|
|
14879
|
+
_activeDateSub = cleanSubscription();
|
|
14880
|
+
_config = completeOnDestroy(new BehaviorSubject(undefined));
|
|
14881
|
+
_selectionMode = completeOnDestroy(new BehaviorSubject(undefined));
|
|
14882
|
+
_dateRangeInput = completeOnDestroy(new BehaviorSubject(undefined));
|
|
14883
|
+
_timezone = completeOnDestroy(new BehaviorSubject(undefined));
|
|
14884
|
+
_presets = completeOnDestroy(new BehaviorSubject(of([])));
|
|
14885
|
+
_selectionEvent = completeOnDestroy(new Subject());
|
|
14965
14886
|
selectedDateRange$ = this._selectionEvent.pipe(map((x) => x.range));
|
|
14966
|
-
_formControlObs = new BehaviorSubject(undefined);
|
|
14887
|
+
_formControlObs = completeOnDestroy(new BehaviorSubject(undefined));
|
|
14967
14888
|
formControl$ = this._formControlObs.pipe(filterMaybe());
|
|
14968
14889
|
config$ = this._config.pipe(filterMaybe(), switchMap((x) => x), distinctUntilChanged(), shareReplay(1));
|
|
14969
14890
|
limitDateTimeInstance$ = this.config$.pipe(map(limitDateTimeInstance), shareReplay(1));
|
|
@@ -15301,21 +15222,6 @@ class DbxFixedDateRangeFieldComponent extends FieldType {
|
|
|
15301
15222
|
}
|
|
15302
15223
|
ngOnDestroy() {
|
|
15303
15224
|
super.ngOnDestroy();
|
|
15304
|
-
this._sub.destroy();
|
|
15305
|
-
this._inputRangeFormSub.destroy();
|
|
15306
|
-
this._inputRangeFormValueSub.destroy();
|
|
15307
|
-
this._dateRangeInputSub.destroy();
|
|
15308
|
-
this._currentSelectionModeSub.destroy();
|
|
15309
|
-
this._latestBoundarySub.destroy();
|
|
15310
|
-
this._disableEndSub.destroy();
|
|
15311
|
-
this._activeDateSub.destroy();
|
|
15312
|
-
this._config.complete();
|
|
15313
|
-
this._selectionMode.complete();
|
|
15314
|
-
this._dateRangeInput.complete();
|
|
15315
|
-
this._timezone.complete();
|
|
15316
|
-
this._presets.complete();
|
|
15317
|
-
this._selectionEvent.complete();
|
|
15318
|
-
this._formControlObs.complete();
|
|
15319
15225
|
}
|
|
15320
15226
|
selectedChange(date) {
|
|
15321
15227
|
this.setDateRange(date ? { start: date } : null, 'calendar');
|
|
@@ -16044,8 +15950,8 @@ const timeDurationField = formlyTimeDurationField;
|
|
|
16044
15950
|
*/
|
|
16045
15951
|
class DbxTimeDurationFieldComponent extends FieldType {
|
|
16046
15952
|
_popoverService = inject(DbxPopoverService);
|
|
16047
|
-
_inputSync =
|
|
16048
|
-
_outputSync =
|
|
15953
|
+
_inputSync = cleanSubscription();
|
|
15954
|
+
_outputSync = cleanSubscription();
|
|
16049
15955
|
_suppressOutputSync = false;
|
|
16050
15956
|
_currentDurationData = {};
|
|
16051
15957
|
textCtrl = new FormControl('');
|
|
@@ -16145,8 +16051,6 @@ class DbxTimeDurationFieldComponent extends FieldType {
|
|
|
16145
16051
|
}
|
|
16146
16052
|
ngOnDestroy() {
|
|
16147
16053
|
super.ngOnDestroy();
|
|
16148
|
-
this._inputSync.destroy();
|
|
16149
|
-
this._outputSync.destroy();
|
|
16150
16054
|
}
|
|
16151
16055
|
/**
|
|
16152
16056
|
* Parses the current text input and syncs the output value.
|
|
@@ -16537,10 +16441,10 @@ const DEFAULT_PREFERRED_COUNTRIES = ['us'];
|
|
|
16537
16441
|
* Registered as Formly type `'intphone'`.
|
|
16538
16442
|
*/
|
|
16539
16443
|
class DbxPhoneFieldComponent extends FieldType {
|
|
16540
|
-
inputSync =
|
|
16541
|
-
outputSync =
|
|
16542
|
-
extensionErrorSync =
|
|
16543
|
-
phoneErrorSync =
|
|
16444
|
+
inputSync = cleanSubscription();
|
|
16445
|
+
outputSync = cleanSubscription();
|
|
16446
|
+
extensionErrorSync = cleanSubscription();
|
|
16447
|
+
phoneErrorSync = cleanSubscription();
|
|
16544
16448
|
phoneCtrl = new FormControl('');
|
|
16545
16449
|
extensionCtrl = new FormControl('', {
|
|
16546
16450
|
validators: [isPhoneExtension()]
|
|
@@ -16611,10 +16515,6 @@ class DbxPhoneFieldComponent extends FieldType {
|
|
|
16611
16515
|
}
|
|
16612
16516
|
ngOnDestroy() {
|
|
16613
16517
|
super.ngOnDestroy();
|
|
16614
|
-
this.inputSync.destroy();
|
|
16615
|
-
this.outputSync.destroy();
|
|
16616
|
-
this.extensionErrorSync.destroy();
|
|
16617
|
-
this.phoneErrorSync.destroy();
|
|
16618
16518
|
}
|
|
16619
16519
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: DbxPhoneFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
16620
16520
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.10", type: DbxPhoneFieldComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-form-phone-field\" [formGroup]=\"inputFormGroup\">\n <ngx-mat-input-tel name=\"phone\" class=\"dbx-form-phone-field-phone-content\" [required]=\"required\" [enableSearch]=\"enableSearch\" [preferredCountries]=\"preferredCountries\" [enablePlaceholder]=\"false\" [formControl]=\"phoneCtrl\"></ngx-mat-input-tel>\n @if (allowExtension) {\n <div class=\"dbx-form-phone-field-extension-content\">\n <span class=\"dbx-hint dbx-button-spacer\">Ext.</span>\n <input name=\"phone-extension\" class=\"dbx-form-phone-field-extension-input\" placeholder=\"123\" minlength=\"0\" maxlength=\"6\" #extensionInput [formControl]=\"extensionCtrl\" aria-label=\"Phone extension\" />\n </div>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: FlexLayoutModule }, { kind: "ngmodule", type: FormlyMatFormFieldModule }, { kind: "component", type: NgxMatInputTelComponent, selector: "ngx-mat-input-tel", inputs: ["autocomplete", "ariaLabel", "cssClass", "defaultCountry", "errorStateMatcher", "maxLength", "name", "placeholder", "countriesName", "preferredCountries", "onlyCountries", "searchPlaceholder", "validation", "enablePlaceholder", "enableSearch", "resetOnChange", "separateDialCode", "hideAreaCodes", "format", "required", "disabled"], outputs: ["countryChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|