@dereekb/dbx-web 13.4.1 → 13.4.2
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-web-calendar.mjs +51 -17
- package/fesm2022/dereekb-dbx-web-calendar.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-web-mapbox.mjs +44 -12
- package/fesm2022/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-web-table.mjs +48 -10
- package/fesm2022/dereekb-dbx-web-table.mjs.map +1 -1
- package/fesm2022/dereekb-dbx-web.mjs +398 -149
- package/fesm2022/dereekb-dbx-web.mjs.map +1 -1
- package/package.json +6 -6
- package/types/dereekb-dbx-web-calendar.d.ts +40 -2
- package/types/dereekb-dbx-web-mapbox.d.ts +27 -1
- package/types/dereekb-dbx-web-table.d.ts +47 -6
- package/types/dereekb-dbx-web.d.ts +445 -89
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, input, inject, effect, Directive, NgModule, ChangeDetectionStrategy, Component, output, computed, HostListener, InjectionToken, signal, ElementRef, Injector, DestroyRef, viewChild, makeEnvironmentProviders, TemplateRef, model, SecurityContext, forwardRef, ViewContainerRef,
|
|
2
|
+
import { Injectable, input, inject, effect, Directive, NgModule, ChangeDetectionStrategy, Component, output, computed, HostListener, InjectionToken, signal, ElementRef, Injector, DestroyRef, viewChild, makeEnvironmentProviders, TemplateRef, model, SecurityContext, forwardRef, ViewContainerRef, Renderer2 } from '@angular/core';
|
|
3
3
|
import { DASH_CHARACTER_PREFIX_INSTANCE, asPromise, cssClassesSet, isDefinedAndNotFalse, spaceSeparatedCssClasses, objectHasNoKeys, getValueFromGetter, firstValue, filterUndefinedValues, separateValues, splitFront, asDecisionFunction, SLASH_PATH_FILE_TYPE_SEPARATOR, filterMaybeArrayValues, mapIterable, toReadableError, isDefaultReadableError, MS_IN_SECOND, mergeObjects, build, ServerErrorResponse, UnauthorizedServerErrorResponse, makeTimer, MS_IN_MINUTE, toggleTimerRunning, unixDateTimeSecondsNumberForNow, ModelRelationUtility, encodeModelKeyTypePair, useIterableOrValue, safeCompareEquality, addMilliseconds, isPast, asArray, slashPathDetails, mimeTypeForFileExtension, slashPathDirectoryTree, isMaybeNot, isNotFalse, modifier, combineMaps, addModifiers, removeModifiers, applyBestFit, findNext, maybeModifierMapToFunction, makeValuesGroupMap, compareWithMappedValuesFunction, invertMaybeBoolean, splitCommaSeparatedStringToSet, ZIP_FILE_MIME_TYPE, cachedGetter, sortByNumberFunction } from '@dereekb/util';
|
|
4
4
|
import * as i1$2 from '@dereekb/dbx-core';
|
|
5
5
|
import { completeOnDestroy, clean, cleanSubscription, AbstractTransitionWatcherDirective, DbxInjectionComponent, AbstractDbxActionValueGetterDirective, AbstractDbxButtonDirective, provideDbxButton, dbxActionWorkProgress, DbxCoreButtonModule, AbstractDbxActionHandlerDirective, FilterSourceDirective, provideActionStoreSource, isClickableFilterPreset, AbstractDbxAnchorDirective, expandClickableAnchorLinkTrees, DbxCoreFilterModule, DbxButton, DbxActionContextStoreSourceInstance, cleanSubscriptionWithLockSet, DBX_INJECTION_COMPONENT_DATA, checkNgContentWrapperHasContent, cleanLoadingContext, DbxActionSourceDirective, DbxActionSuccessHandlerDirective, DbxActionDirective, transformEmptyStringInputToUndefined, isIdleActionState, canTriggerAction, DbxCoreActionModule, DbxActionButtonDirective, onDbxAppAuth, SimpleStorageAccessorFactory, mergeStaticProviders, asSegueRef, AbstractTransitionDirective, DbxRouterService, AbstractIfDirective, isSegueRefActive, anchorTypeForAnchor } from '@dereekb/dbx-core';
|
|
@@ -137,6 +137,9 @@ var CompactMode;
|
|
|
137
137
|
* compactModeFromInput(true); // CompactMode.COMPACT
|
|
138
138
|
* compactModeFromInput(CompactMode.FULL); // CompactMode.FULL
|
|
139
139
|
* ```
|
|
140
|
+
*
|
|
141
|
+
* @param input - a boolean or CompactMode value to normalize
|
|
142
|
+
* @returns the normalized CompactMode enum value
|
|
140
143
|
*/
|
|
141
144
|
function compactModeFromInput(input) {
|
|
142
145
|
if (typeof input === 'boolean') {
|
|
@@ -156,6 +159,10 @@ function compactModeFromInput(input) {
|
|
|
156
159
|
* defaultMode: CompactMode.FULL
|
|
157
160
|
* });
|
|
158
161
|
* ```
|
|
162
|
+
*
|
|
163
|
+
* @param mode$ - an observable of the current compact mode, or nullish to use the default
|
|
164
|
+
* @param config - the mapping configuration containing values for each mode and an optional default
|
|
165
|
+
* @returns an observable emitting the mapped value corresponding to the current compact mode
|
|
159
166
|
*/
|
|
160
167
|
function mapCompactModeObs(mode$, config) {
|
|
161
168
|
const modeObs = mode$ ?? of(config.defaultMode ?? CompactMode.FULL);
|
|
@@ -364,10 +371,8 @@ class DbxWindowKeyDownListenerDirective {
|
|
|
364
371
|
handleKeyboardEvent(event) {
|
|
365
372
|
const keysFilter = this.keysFilterSignal();
|
|
366
373
|
const enabled = this.isEnabledSignal();
|
|
367
|
-
if (enabled !== false) {
|
|
368
|
-
|
|
369
|
-
this.dbxWindowKeyDownListener.emit(event);
|
|
370
|
-
}
|
|
374
|
+
if (enabled !== false && (!keysFilter || keysFilter.has(event.key))) {
|
|
375
|
+
this.dbxWindowKeyDownListener.emit(event);
|
|
371
376
|
}
|
|
372
377
|
}
|
|
373
378
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxWindowKeyDownListenerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -404,6 +409,9 @@ const DBX_THEME_COLORS = [...DBX_THEME_COLORS_MAIN, ...DBX_THEME_COLORS_EXTRA, .
|
|
|
404
409
|
* dbxColorBackground('primary'); // 'dbx-primary-bg'
|
|
405
410
|
* dbxColorBackground(undefined); // 'dbx-default'
|
|
406
411
|
* ```
|
|
412
|
+
*
|
|
413
|
+
* @param color - the theme color to convert, or nullish/empty for the default class
|
|
414
|
+
* @returns the CSS class name for the themed background (e.g., `'dbx-primary-bg'` or `'dbx-default'`)
|
|
407
415
|
*/
|
|
408
416
|
function dbxColorBackground(color) {
|
|
409
417
|
let cssClass = 'dbx-default'; // background by default
|
|
@@ -419,6 +427,8 @@ function dbxColorBackground(color) {
|
|
|
419
427
|
case 'default':
|
|
420
428
|
cssClass = `dbx-${color}-bg`;
|
|
421
429
|
break;
|
|
430
|
+
default:
|
|
431
|
+
break;
|
|
422
432
|
}
|
|
423
433
|
return cssClass;
|
|
424
434
|
}
|
|
@@ -456,10 +466,8 @@ class DbxStyleService {
|
|
|
456
466
|
getStyleClassWithConfig(configObs) {
|
|
457
467
|
return combineLatest([configObs, this.styleClassSuffix$]).pipe(map(([config, suffix]) => {
|
|
458
468
|
let styleClass = config.style;
|
|
459
|
-
if (suffix != null && config.suffixes) {
|
|
460
|
-
|
|
461
|
-
styleClass = `${styleClass}${DASH_CHARACTER_PREFIX_INSTANCE.prefixSuffixString(suffix)}`;
|
|
462
|
-
}
|
|
469
|
+
if (suffix != null && config.suffixes?.has(suffix)) {
|
|
470
|
+
styleClass = `${styleClass}${DASH_CHARACTER_PREFIX_INSTANCE.prefixSuffixString(suffix)}`;
|
|
463
471
|
}
|
|
464
472
|
return styleClass;
|
|
465
473
|
}), distinctUntilChanged(), shareReplay(1));
|
|
@@ -493,30 +501,40 @@ class DbxStyleService {
|
|
|
493
501
|
}
|
|
494
502
|
/**
|
|
495
503
|
* Returns the current style class suffix, if one is set.
|
|
504
|
+
*
|
|
505
|
+
* @returns the currently active style class suffix, or undefined if none is set
|
|
496
506
|
*/
|
|
497
507
|
get currentStyleClassSuffix() {
|
|
498
508
|
return this._styleClassSuffix.value;
|
|
499
509
|
}
|
|
500
510
|
/**
|
|
501
511
|
* Directly sets the active style class suffix, or clears it if null/undefined.
|
|
512
|
+
*
|
|
513
|
+
* @param suffix - the suffix to activate, or nullish to clear the current suffix
|
|
502
514
|
*/
|
|
503
515
|
setStyleClassSuffix(suffix) {
|
|
504
516
|
this._styleClassSuffix.next(suffix ? dbxStyleClassCleanSuffix(suffix) : undefined);
|
|
505
517
|
}
|
|
506
518
|
/**
|
|
507
519
|
* Updates the default style configuration used when no override config is set.
|
|
520
|
+
*
|
|
521
|
+
* @param defaultConfig - the style configuration to use as the new default
|
|
508
522
|
*/
|
|
509
523
|
setDefaultConfig(defaultConfig) {
|
|
510
524
|
this._defaultConfig.next(defaultConfig);
|
|
511
525
|
}
|
|
512
526
|
/**
|
|
513
527
|
* Overrides the active style configuration with the given value or observable.
|
|
528
|
+
*
|
|
529
|
+
* @param config - a style configuration value or observable to set as the active override
|
|
514
530
|
*/
|
|
515
531
|
setConfig(config) {
|
|
516
532
|
this._config.next(asObservable(config));
|
|
517
533
|
}
|
|
518
534
|
/**
|
|
519
535
|
* Clears the active config override if it matches the given reference, reverting to the default config.
|
|
536
|
+
*
|
|
537
|
+
* @param config - the config reference to compare against the current override
|
|
520
538
|
*/
|
|
521
539
|
unsetConfig(config) {
|
|
522
540
|
if (this._config.value === config) {
|
|
@@ -605,7 +623,9 @@ class DbxPopoverComponent extends AbstractTransitionWatcherDirective {
|
|
|
605
623
|
}
|
|
606
624
|
};
|
|
607
625
|
// Also intercept the _close function to capture backdropClose, etc.
|
|
626
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- accessing private member _close
|
|
608
627
|
const original_close = this.popoverRef._close;
|
|
628
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- accessing private member _close
|
|
609
629
|
this.popoverRef._close = (closeType, inputValue) => {
|
|
610
630
|
const closeWithValue = (value) => {
|
|
611
631
|
original_close.call(this.popoverRef, closeType, value);
|
|
@@ -618,7 +638,7 @@ class DbxPopoverComponent extends AbstractTransitionWatcherDirective {
|
|
|
618
638
|
this._useClosingValue(closeType, (x) => closeWithValue(x));
|
|
619
639
|
}
|
|
620
640
|
};
|
|
621
|
-
// eslint-disable-next-line
|
|
641
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- accessing private member _overlay
|
|
622
642
|
const overlay = this.popoverRef._overlay; // overlay is not publically accessible
|
|
623
643
|
const elementRef = this.config.origin;
|
|
624
644
|
const configuration = this.config.configuration;
|
|
@@ -778,6 +798,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
778
798
|
*/
|
|
779
799
|
class DbxDialogContentCloseComponent {
|
|
780
800
|
padded = input(true, ...(ngDevMode ? [{ debugName: "padded" }] : []));
|
|
801
|
+
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
781
802
|
close = output();
|
|
782
803
|
closeClicked() {
|
|
783
804
|
this.close.emit(undefined);
|
|
@@ -822,6 +843,7 @@ class DbxDialogContentFooterComponent {
|
|
|
822
843
|
buttonColor = input(...(ngDevMode ? [undefined, { debugName: "buttonColor" }] : []));
|
|
823
844
|
closeTextSignal = computed(() => this.closeText() ?? this.config()?.closeText ?? 'Close', ...(ngDevMode ? [{ debugName: "closeTextSignal" }] : []));
|
|
824
845
|
buttonColorSignal = computed(() => this.buttonColor() ?? this.config()?.buttonColor ?? undefined, ...(ngDevMode ? [{ debugName: "buttonColorSignal" }] : []));
|
|
846
|
+
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
825
847
|
close = output();
|
|
826
848
|
closeClicked() {
|
|
827
849
|
this.close.emit();
|
|
@@ -943,13 +965,12 @@ class DbxInjectionDialogComponent extends AbstractDialogDirective {
|
|
|
943
965
|
return this.data.componentConfig;
|
|
944
966
|
}
|
|
945
967
|
static openDialog(matDialog, config) {
|
|
946
|
-
|
|
968
|
+
return matDialog.open((DbxInjectionDialogComponent), {
|
|
947
969
|
width: '80vw',
|
|
948
970
|
height: '80vh',
|
|
949
971
|
...config,
|
|
950
972
|
data: config
|
|
951
973
|
});
|
|
952
|
-
return dialogRef;
|
|
953
974
|
}
|
|
954
975
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxInjectionDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
955
976
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: DbxInjectionDialogComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
@@ -981,6 +1002,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
981
1002
|
/**
|
|
982
1003
|
* Sanitizes a {@link DbxDialogContentConfig} by normalizing the panelClass into an array.
|
|
983
1004
|
*
|
|
1005
|
+
* @param input - The dialog content config to sanitize, or null/undefined
|
|
1006
|
+
* @returns A new config with panelClass normalized to an array of CSS class strings
|
|
1007
|
+
*
|
|
984
1008
|
* @example
|
|
985
1009
|
* ```ts
|
|
986
1010
|
* const config = sanitizeDbxDialogContentConfig({ panelClass: 'my-panel my-other-panel' });
|
|
@@ -990,7 +1014,7 @@ function sanitizeDbxDialogContentConfig(input) {
|
|
|
990
1014
|
const panelClass = input?.panelClass;
|
|
991
1015
|
return {
|
|
992
1016
|
...input,
|
|
993
|
-
panelClass: panelClass ?
|
|
1017
|
+
panelClass: panelClass ? [...cssClassesSet(input?.panelClass)] : undefined
|
|
994
1018
|
};
|
|
995
1019
|
}
|
|
996
1020
|
|
|
@@ -1089,17 +1113,18 @@ class AbstractPopoverRefDirective {
|
|
|
1089
1113
|
}
|
|
1090
1114
|
}
|
|
1091
1115
|
_showPopoverRef(origin) {
|
|
1092
|
-
|
|
1093
|
-
this.
|
|
1094
|
-
this.
|
|
1116
|
+
const popoverRef = this._makePopoverRef(origin);
|
|
1117
|
+
this._popoverRef = popoverRef;
|
|
1118
|
+
this._afterOpened(popoverRef);
|
|
1119
|
+
this._popoverSub.setSub(popoverRef.afterClosed$.subscribe((x) => {
|
|
1095
1120
|
this._afterClosed(x);
|
|
1096
1121
|
this._popoverRef = undefined;
|
|
1097
1122
|
}));
|
|
1098
1123
|
}
|
|
1099
|
-
_afterOpened(
|
|
1124
|
+
_afterOpened(_popoverRef) {
|
|
1100
1125
|
// Do nothing. Override in parent type
|
|
1101
1126
|
}
|
|
1102
|
-
_afterClosed(
|
|
1127
|
+
_afterClosed(_value) {
|
|
1103
1128
|
// Do nothing. Override in parent type
|
|
1104
1129
|
}
|
|
1105
1130
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AbstractPopoverRefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -1658,6 +1683,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
1658
1683
|
*/
|
|
1659
1684
|
class AbstractFilterPopoverButtonDirective extends AbstractPopoverRefDirective {
|
|
1660
1685
|
popupService = inject(DbxPopoverService);
|
|
1686
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1661
1687
|
config = input(undefined, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
1662
1688
|
_makePopoverRef(origin) {
|
|
1663
1689
|
const config = this.config();
|
|
@@ -1871,8 +1897,7 @@ class AbstractProgressButtonDirective {
|
|
|
1871
1897
|
const working = this.working();
|
|
1872
1898
|
const config = this.configSignal();
|
|
1873
1899
|
const configWorking = config?.working;
|
|
1874
|
-
|
|
1875
|
-
return workingProgress;
|
|
1900
|
+
return dbxActionWorkProgress([working, configWorking]);
|
|
1876
1901
|
}, ...(ngDevMode ? [{ debugName: "workingProgressSignal" }] : []));
|
|
1877
1902
|
isWorkingSignal = computed(() => isDefinedAndNotFalse(this.workingProgressSignal()), ...(ngDevMode ? [{ debugName: "isWorkingSignal" }] : []));
|
|
1878
1903
|
workingValueSignal = computed(() => {
|
|
@@ -2049,9 +2074,8 @@ class DbxProgressSpinnerButtonComponent extends AbstractProgressButtonDirective
|
|
|
2049
2074
|
}, ...(ngDevMode ? [{ debugName: "showTextButtonIconSignal" }] : []));
|
|
2050
2075
|
showIconSignal = computed(() => {
|
|
2051
2076
|
const config = this.configSignal();
|
|
2052
|
-
return (config &&
|
|
2053
|
-
|
|
2054
|
-
!this.showTextContentSignal()); // show icon if either fab or iconOnly is true
|
|
2077
|
+
return (config?.buttonIcon && !this.showTextContentSignal() // button icon must be defined
|
|
2078
|
+
); // show icon if either fab or iconOnly is true
|
|
2055
2079
|
}, ...(ngDevMode ? [{ debugName: "showIconSignal" }] : []));
|
|
2056
2080
|
customSpinnerStyleSignal = computed(() => {
|
|
2057
2081
|
const customSpinnerColor = this.configSignal()?.customSpinnerColor;
|
|
@@ -2475,6 +2499,9 @@ class DbxRouterWebProviderConfig {
|
|
|
2475
2499
|
* childClickTarget: this.buttonElementRef
|
|
2476
2500
|
* });
|
|
2477
2501
|
* ```
|
|
2502
|
+
*
|
|
2503
|
+
* @param config - configuration specifying the click target, child element to intercept, and optional disabled signal
|
|
2504
|
+
* @returns the created Angular effect reference
|
|
2478
2505
|
*/
|
|
2479
2506
|
function overrideClickElementEffect(config) {
|
|
2480
2507
|
const { clickTarget, childClickTarget, disabledSignal } = config;
|
|
@@ -2491,30 +2518,28 @@ function overrideClickElementEffect(config) {
|
|
|
2491
2518
|
if (_cleanupClickOverride) {
|
|
2492
2519
|
_cleanupClickOverride();
|
|
2493
2520
|
}
|
|
2494
|
-
if (childClickElement) {
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
});
|
|
2517
|
-
}
|
|
2521
|
+
if (childClickElement && !anchorDisabled) {
|
|
2522
|
+
const clickOverride = (event) => {
|
|
2523
|
+
// Allow ctrl+click, cmd+click, shift+click, and middle-click for new tab/window
|
|
2524
|
+
// Don't preventDefault or stopPropagation - let browser handle it naturally
|
|
2525
|
+
if (event.ctrlKey || event.metaKey || event.shiftKey || event.button === 1) {
|
|
2526
|
+
return; // Browser will open in new tab/window
|
|
2527
|
+
}
|
|
2528
|
+
else {
|
|
2529
|
+
// otherwise, also trigger a click on the uiSref anchor element
|
|
2530
|
+
clickTargetElement?.nativeElement.click();
|
|
2531
|
+
// Prevents the default behavior of the anchor element's href from being triggered
|
|
2532
|
+
event.preventDefault();
|
|
2533
|
+
event.stopPropagation();
|
|
2534
|
+
}
|
|
2535
|
+
};
|
|
2536
|
+
_cleanupClickOverride = () => {
|
|
2537
|
+
childClickElement.nativeElement.removeEventListener('click', clickOverride);
|
|
2538
|
+
_cleanupClickOverride = null;
|
|
2539
|
+
};
|
|
2540
|
+
childClickElement.nativeElement.addEventListener('click', clickOverride, {
|
|
2541
|
+
capture: true // Use capture to ensure this event listener is called before any nested child's event listeners
|
|
2542
|
+
});
|
|
2518
2543
|
}
|
|
2519
2544
|
});
|
|
2520
2545
|
}
|
|
@@ -2561,7 +2586,7 @@ class DbxAnchorComponent extends AbstractDbxAnchorDirective {
|
|
|
2561
2586
|
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
2562
2587
|
}
|
|
2563
2588
|
@case ('clickable') {
|
|
2564
|
-
<a #clickable class="dbx-anchor-a dbx-anchor-click" [ngClass]="selectedClassSignal()" (click)="clickAnchor()">
|
|
2589
|
+
<a #clickable class="dbx-anchor-a dbx-anchor-click" [ngClass]="selectedClassSignal()" tabindex="0" (click)="clickAnchor()" (keydown.enter)="clickAnchor()">
|
|
2565
2590
|
<span #childClickTarget>
|
|
2566
2591
|
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
2567
2592
|
</span>
|
|
@@ -2599,7 +2624,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
2599
2624
|
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
2600
2625
|
}
|
|
2601
2626
|
@case ('clickable') {
|
|
2602
|
-
<a #clickable class="dbx-anchor-a dbx-anchor-click" [ngClass]="selectedClassSignal()" (click)="clickAnchor()">
|
|
2627
|
+
<a #clickable class="dbx-anchor-a dbx-anchor-click" [ngClass]="selectedClassSignal()" tabindex="0" (click)="clickAnchor()" (keydown.enter)="clickAnchor()">
|
|
2603
2628
|
<span #childClickTarget>
|
|
2604
2629
|
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
2605
2630
|
</span>
|
|
@@ -2699,6 +2724,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
2699
2724
|
/**
|
|
2700
2725
|
* Creates an observable that emits the button text for a preset filter menu based on the current selection.
|
|
2701
2726
|
*
|
|
2727
|
+
* @param config$ - Observable of the preset filter menu configuration
|
|
2728
|
+
* @param selection$ - Observable of the currently selected preset, used to derive the display title
|
|
2729
|
+
* @param defaultText - Fallback text when no selection or unknownSelectionText is configured. Defaults to 'Filter'.
|
|
2730
|
+
* @returns An observable emitting the resolved button text string
|
|
2731
|
+
*
|
|
2702
2732
|
* @example
|
|
2703
2733
|
* ```ts
|
|
2704
2734
|
* const text$ = dbxPresetFilterMenuButtonTextObservable(config$, selectedPreset$);
|
|
@@ -2710,6 +2740,11 @@ function dbxPresetFilterMenuButtonTextObservable(config$, selection$, defaultTex
|
|
|
2710
2740
|
/**
|
|
2711
2741
|
* Creates an observable that emits the button icon for a preset filter menu based on the current selection and config.
|
|
2712
2742
|
*
|
|
2743
|
+
* @param config$ - Observable of the preset filter menu configuration controlling icon behavior
|
|
2744
|
+
* @param selection$ - Observable of the currently selected preset, used to derive the display icon
|
|
2745
|
+
* @param defaultIcon - Fallback icon when no filterIcon is configured. Defaults to 'arrow_drop_down'.
|
|
2746
|
+
* @returns An observable emitting the resolved icon string, or undefined when no icon should be shown
|
|
2747
|
+
*
|
|
2713
2748
|
* @example
|
|
2714
2749
|
* ```ts
|
|
2715
2750
|
* const icon$ = dbxPresetFilterMenuButtonIconObservable(config$, selectedPreset$);
|
|
@@ -2937,6 +2972,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
2937
2972
|
/**
|
|
2938
2973
|
* Opens a dialog containing a {@link DbxIframeComponent} to display a URL in an iframe.
|
|
2939
2974
|
*
|
|
2975
|
+
* @param matDialog - The Angular Material dialog service used to open the dialog
|
|
2976
|
+
* @param config - Configuration specifying the content URL and dialog options
|
|
2977
|
+
* @returns A reference to the opened dialog for controlling or subscribing to its lifecycle
|
|
2978
|
+
*
|
|
2940
2979
|
* @example
|
|
2941
2980
|
* ```ts
|
|
2942
2981
|
* const ref = openIframeDialog(matDialog, { contentUrl: 'https://example.com' });
|
|
@@ -3054,6 +3093,8 @@ class DbxEmbedComponent {
|
|
|
3054
3093
|
embed.setAttribute('type', type);
|
|
3055
3094
|
}
|
|
3056
3095
|
break;
|
|
3096
|
+
default:
|
|
3097
|
+
break;
|
|
3057
3098
|
}
|
|
3058
3099
|
element.appendChild(embed);
|
|
3059
3100
|
}
|
|
@@ -3080,6 +3121,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
3080
3121
|
/**
|
|
3081
3122
|
* Opens a dialog containing a {@link DbxEmbedComponent} to display embedded content from a URL or Blob.
|
|
3082
3123
|
*
|
|
3124
|
+
* @param matDialog - The Angular Material dialog service used to open the dialog
|
|
3125
|
+
* @param config - Configuration specifying the content source (URL or Blob), MIME type, and dialog options
|
|
3126
|
+
* @returns A reference to the opened dialog for controlling or subscribing to its lifecycle
|
|
3127
|
+
*
|
|
3083
3128
|
* @example
|
|
3084
3129
|
* ```ts
|
|
3085
3130
|
* const ref = openEmbedDialog(matDialog, { srcUrl: 'https://example.com/doc.pdf', embedMimeType: 'application/pdf' });
|
|
@@ -3647,6 +3692,9 @@ class DbxPromptConfirm {
|
|
|
3647
3692
|
/**
|
|
3648
3693
|
* Provides a {@link DbxPromptConfirm} implementation for dependency injection.
|
|
3649
3694
|
*
|
|
3695
|
+
* @param sourceType - The concrete class that implements {@link DbxPromptConfirm}
|
|
3696
|
+
* @returns An array of providers that register the given type as the {@link DbxPromptConfirm} implementation
|
|
3697
|
+
*
|
|
3650
3698
|
* @example
|
|
3651
3699
|
* ```ts
|
|
3652
3700
|
* @Directive({ providers: provideDbxPromptConfirm(MyConfirmDirective) })
|
|
@@ -4006,6 +4054,7 @@ class DbxPromptConfirmComponent {
|
|
|
4006
4054
|
confirmTextSignal = computed(() => this.config()?.confirmText || 'Confirm', ...(ngDevMode ? [{ debugName: "confirmTextSignal" }] : []));
|
|
4007
4055
|
cancelTextSignal = computed(() => this.config()?.cancelText || 'Cancel', ...(ngDevMode ? [{ debugName: "cancelTextSignal" }] : []));
|
|
4008
4056
|
confirm = output();
|
|
4057
|
+
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
4009
4058
|
cancel = output();
|
|
4010
4059
|
onConfirm() {
|
|
4011
4060
|
this.confirm.emit();
|
|
@@ -4074,10 +4123,9 @@ class DbxPromptConfirmDialogComponent extends AbstractDialogDirective {
|
|
|
4074
4123
|
return this.data.component;
|
|
4075
4124
|
}
|
|
4076
4125
|
static openDialog(matDialog, config) {
|
|
4077
|
-
|
|
4126
|
+
return matDialog.open(DbxPromptConfirmDialogComponent, {
|
|
4078
4127
|
data: config ?? DEFAULT_DBX_PROMPT_CONFIRM_DIALOG_CONFIG
|
|
4079
4128
|
});
|
|
4080
|
-
return dialogRef;
|
|
4081
4129
|
}
|
|
4082
4130
|
confirm() {
|
|
4083
4131
|
this.close(true);
|
|
@@ -4191,8 +4239,7 @@ class DbxContentContainerDirective {
|
|
|
4191
4239
|
padding = input('normal', ...(ngDevMode ? [{ debugName: "padding" }] : []));
|
|
4192
4240
|
topPadding = input('none', ...(ngDevMode ? [{ debugName: "topPadding" }] : []));
|
|
4193
4241
|
classConfig = computed(() => {
|
|
4194
|
-
|
|
4195
|
-
return classConfig;
|
|
4242
|
+
return 'container-' + this.grow() + ' container-padding-' + this.padding() + ' container-top-padding-' + this.topPadding();
|
|
4196
4243
|
}, ...(ngDevMode ? [{ debugName: "classConfig" }] : []));
|
|
4197
4244
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxContentContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4198
4245
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: DbxContentContainerDirective, isStandalone: true, selector: "dbx-content-container,[dbxContentContainer],.dbx-content-container", inputs: { grow: { classPropertyName: "grow", publicName: "grow", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, topPadding: { classPropertyName: "topPadding", publicName: "topPadding", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classConfig()" }, classAttribute: "d-block dbx-content-container" }, ngImport: i0 });
|
|
@@ -4376,8 +4423,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
4376
4423
|
/**
|
|
4377
4424
|
* Returns a string that can be used as the "accept" attribute of a file input element.
|
|
4378
4425
|
*
|
|
4379
|
-
* @param accept
|
|
4380
|
-
* @returns
|
|
4426
|
+
* @param accept - A file accept string or array of filter type strings to convert
|
|
4427
|
+
* @returns A comma-separated string suitable for the HTML accept attribute
|
|
4381
4428
|
*/
|
|
4382
4429
|
function fileAcceptString(accept) {
|
|
4383
4430
|
return typeof accept === 'string' ? accept : accept.join(',');
|
|
@@ -4385,6 +4432,9 @@ function fileAcceptString(accept) {
|
|
|
4385
4432
|
/**
|
|
4386
4433
|
* Converts a comma-separated accept string or array into a {@link FileAcceptFilterTypeStringArray}.
|
|
4387
4434
|
*
|
|
4435
|
+
* @param accept - A file accept string or array of filter type strings to normalize
|
|
4436
|
+
* @returns An array of individual filter type strings
|
|
4437
|
+
*
|
|
4388
4438
|
* @example
|
|
4389
4439
|
* ```ts
|
|
4390
4440
|
* const types = fileAcceptFilterTypeStringArray('image/png, .pdf');
|
|
@@ -4397,6 +4447,9 @@ function fileAcceptFilterTypeStringArray(accept) {
|
|
|
4397
4447
|
/**
|
|
4398
4448
|
* Creates a {@link FileArrayAcceptMatchFunction} that filters and separates files based on accept criteria and multiple file support.
|
|
4399
4449
|
*
|
|
4450
|
+
* @param config - Configuration specifying the accept criteria and whether multiple files are allowed
|
|
4451
|
+
* @returns A function that accepts an array of files and returns the categorized match result
|
|
4452
|
+
*
|
|
4400
4453
|
* @example
|
|
4401
4454
|
* ```ts
|
|
4402
4455
|
* const matchFn = fileArrayAcceptMatchFunction({ accept: 'image/*', multiple: false });
|
|
@@ -4422,6 +4475,9 @@ function fileArrayAcceptMatchFunction(config) {
|
|
|
4422
4475
|
/**
|
|
4423
4476
|
* Creates a {@link FileAcceptFunction} that checks individual files against accept criteria (MIME types, wildcards, or file extensions).
|
|
4424
4477
|
*
|
|
4478
|
+
* @param accept - A file accept string or array specifying which MIME types, wildcards, or file extensions to allow
|
|
4479
|
+
* @returns A decision function that returns true if a file matches any of the accept criteria
|
|
4480
|
+
*
|
|
4425
4481
|
* @example
|
|
4426
4482
|
* ```ts
|
|
4427
4483
|
* const isAccepted = fileAcceptFunction(['image/*', '.pdf']);
|
|
@@ -4436,7 +4492,7 @@ function fileAcceptFunction(accept) {
|
|
|
4436
4492
|
fileAcceptFunction = asDecisionFunction(true);
|
|
4437
4493
|
}
|
|
4438
4494
|
else {
|
|
4439
|
-
const hasWildcard = acceptList.
|
|
4495
|
+
const hasWildcard = acceptList.includes('*');
|
|
4440
4496
|
if (hasWildcard) {
|
|
4441
4497
|
fileAcceptFunction = asDecisionFunction(true);
|
|
4442
4498
|
}
|
|
@@ -4457,7 +4513,7 @@ function fileAcceptFunction(accept) {
|
|
|
4457
4513
|
}
|
|
4458
4514
|
});
|
|
4459
4515
|
fileAcceptFunction = (input) => {
|
|
4460
|
-
return isAcceptedFunctions.
|
|
4516
|
+
return isAcceptedFunctions.some((x) => x(input));
|
|
4461
4517
|
};
|
|
4462
4518
|
}
|
|
4463
4519
|
}
|
|
@@ -4472,6 +4528,9 @@ class DbxFileUploadActionCompatable {
|
|
|
4472
4528
|
/**
|
|
4473
4529
|
* Provides a {@link DbxFileUploadActionCompatable} for dependency injection from the given component type.
|
|
4474
4530
|
*
|
|
4531
|
+
* @param sourceType - The concrete component class that implements {@link DbxFileUploadActionCompatable}
|
|
4532
|
+
* @returns An array of providers that register the given type as the {@link DbxFileUploadActionCompatable} implementation
|
|
4533
|
+
*
|
|
4475
4534
|
* @example
|
|
4476
4535
|
* ```ts
|
|
4477
4536
|
* @Component({ providers: provideDbxFileUploadActionCompatable(MyUploadComponent) })
|
|
@@ -4545,10 +4604,10 @@ class DbxFileUploadAreaComponent extends AbstractDbxFileUploadComponent {
|
|
|
4545
4604
|
@if (show()) {
|
|
4546
4605
|
<div class="dbx-file-upload-area-content">
|
|
4547
4606
|
<div class="dbx-file-upload-area-content-text">
|
|
4548
|
-
@if (icon()
|
|
4607
|
+
@if (icon()) {
|
|
4549
4608
|
<mat-icon>{{ icon() }}</mat-icon>
|
|
4550
4609
|
}
|
|
4551
|
-
@if (text()
|
|
4610
|
+
@if (text()) {
|
|
4552
4611
|
<span>{{ text() }}</span>
|
|
4553
4612
|
}
|
|
4554
4613
|
</div>
|
|
@@ -4577,10 +4636,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
4577
4636
|
@if (show()) {
|
|
4578
4637
|
<div class="dbx-file-upload-area-content">
|
|
4579
4638
|
<div class="dbx-file-upload-area-content-text">
|
|
4580
|
-
@if (icon()
|
|
4639
|
+
@if (icon()) {
|
|
4581
4640
|
<mat-icon>{{ icon() }}</mat-icon>
|
|
4582
4641
|
}
|
|
4583
|
-
@if (text()
|
|
4642
|
+
@if (text()) {
|
|
4584
4643
|
<span>{{ text() }}</span>
|
|
4585
4644
|
}
|
|
4586
4645
|
</div>
|
|
@@ -5012,6 +5071,7 @@ class DbxErrorWidgetService {
|
|
|
5012
5071
|
if (override || !this._entries.has(entry.code)) {
|
|
5013
5072
|
this._entries.set(entry.code, {
|
|
5014
5073
|
...entry,
|
|
5074
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
5015
5075
|
widgetComponentClass: entry.widgetComponentClass ?? entry.componentClass
|
|
5016
5076
|
});
|
|
5017
5077
|
return true;
|
|
@@ -5022,7 +5082,7 @@ class DbxErrorWidgetService {
|
|
|
5022
5082
|
}
|
|
5023
5083
|
// MARK: Get
|
|
5024
5084
|
getErrorWidgetIdentifiers() {
|
|
5025
|
-
return
|
|
5085
|
+
return [...this._entries.keys()];
|
|
5026
5086
|
}
|
|
5027
5087
|
getDefaultErrorWidgetEntry() {
|
|
5028
5088
|
return this.getErrorWidgetEntry(DEFAULT_ERROR_WIDGET_CODE);
|
|
@@ -5062,7 +5122,7 @@ class DbxErrorWidgetViewComponent {
|
|
|
5062
5122
|
error = input(...(ngDevMode ? [undefined, { debugName: "error" }] : []));
|
|
5063
5123
|
errorWithCodeSignal = computed(() => {
|
|
5064
5124
|
const currentError = this.error();
|
|
5065
|
-
const error = currentError
|
|
5125
|
+
const error = currentError?.code ? currentError : undefined;
|
|
5066
5126
|
let config;
|
|
5067
5127
|
if (error != null) {
|
|
5068
5128
|
const entry = this.dbxErrorWidgetService.getErrorWidgetEntry(error.code);
|
|
@@ -6018,6 +6078,7 @@ class DbxActionSnackbarService {
|
|
|
6018
6078
|
*
|
|
6019
6079
|
* @param type - The snackbar type key (e.g. "save", "delete"), or undefined to use "none".
|
|
6020
6080
|
* @param input - The generator input containing the event and optional undo configuration.
|
|
6081
|
+
* @returns The generated display configuration, or `undefined` if no config is registered for the given type.
|
|
6021
6082
|
*/
|
|
6022
6083
|
generateDisplayConfig(type, input) {
|
|
6023
6084
|
const configForType = this.eventTypeConfigs[type ?? 'none'];
|
|
@@ -6082,7 +6143,7 @@ class DbxActionSnackbarDirective {
|
|
|
6082
6143
|
const snackbarFunction = this.dbxActionSnackbar();
|
|
6083
6144
|
return snackbarFunction ? snackbarFunction(input) : this.dbxActionSnackbarService.generateDisplayConfig(this.dbxActionSnackbarDefault(), input);
|
|
6084
6145
|
}
|
|
6085
|
-
showSnackbarForConfiguration(config,
|
|
6146
|
+
showSnackbarForConfiguration(config, _event) {
|
|
6086
6147
|
this.dbxActionSnackbarService.openSnackbar(config);
|
|
6087
6148
|
}
|
|
6088
6149
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxActionSnackbarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -6280,18 +6341,16 @@ class DbxActionTransitionSafetyDirective {
|
|
|
6280
6341
|
_autoTrigger(transition) {
|
|
6281
6342
|
return this.source.pipeStore((store) => store.state$.pipe(delay(20), // Prevent racing with auto-trigger.
|
|
6282
6343
|
first(), mergeMap((state) => {
|
|
6283
|
-
if (isIdleActionState(state.actionState)
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
store.trigger(); // Try and trigger it.
|
|
6287
|
-
}
|
|
6344
|
+
if (isIdleActionState(state.actionState) && // If we're in an idle state, get ready to trigger it.
|
|
6345
|
+
canTriggerAction(state)) {
|
|
6346
|
+
store.trigger(); // Try and trigger it.
|
|
6288
6347
|
}
|
|
6289
6348
|
// Watch for errors. If an error occurs, show the dialog.
|
|
6290
6349
|
// Success will cause the race in _handleOnBeforeTransition() to trigger and close everything.
|
|
6291
6350
|
return store.rejected$.pipe(first(), mergeMap(() => this._showDialog(transition)));
|
|
6292
6351
|
})));
|
|
6293
6352
|
}
|
|
6294
|
-
_showDialog(
|
|
6353
|
+
_showDialog(_transition) {
|
|
6295
6354
|
if (this.checkIsDestroyed()) {
|
|
6296
6355
|
return of(true);
|
|
6297
6356
|
}
|
|
@@ -6401,7 +6460,7 @@ class DbxActionKeyTriggerDirective {
|
|
|
6401
6460
|
source = inject((DbxActionContextStoreSourceInstance), { host: true });
|
|
6402
6461
|
key = input(DEFAULT_ACTION_KEY_TRIGGER, { ...(ngDevMode ? { debugName: "key" } : {}), alias: 'dbxActionKeyTrigger', transform: (x) => (x ?? DEFAULT_ACTION_KEY_TRIGGER).toLowerCase() });
|
|
6403
6462
|
onKeyupHandler(event) {
|
|
6404
|
-
if (event.key
|
|
6463
|
+
if (event.key?.toLowerCase() === this.key()) {
|
|
6405
6464
|
this.source.trigger();
|
|
6406
6465
|
}
|
|
6407
6466
|
}
|
|
@@ -6448,6 +6507,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
6448
6507
|
* const pojoError = convertToPOJOServerErrorResponse(httpErrorResponse);
|
|
6449
6508
|
* console.log(pojoError.message);
|
|
6450
6509
|
* ```
|
|
6510
|
+
*
|
|
6511
|
+
* @param httpError - The HTTP error response or generic error object to convert.
|
|
6512
|
+
* @returns A plain JSON-serializable {@link ServerError} object.
|
|
6451
6513
|
*/
|
|
6452
6514
|
function convertToPOJOServerErrorResponse(httpError) {
|
|
6453
6515
|
const result = convertToServerErrorResponse(httpError);
|
|
@@ -6459,7 +6521,7 @@ function convertToPOJOServerErrorResponse(httpError) {
|
|
|
6459
6521
|
const stringy = JSON.stringify(pojo.data);
|
|
6460
6522
|
x.data = JSON.parse(stringy);
|
|
6461
6523
|
}
|
|
6462
|
-
catch
|
|
6524
|
+
catch {
|
|
6463
6525
|
console.warn('convertToPOJOServerErrorResponse(): Non-serializable Error Data Detected. It is being removed.: ', pojo.data);
|
|
6464
6526
|
x.data = undefined;
|
|
6465
6527
|
}
|
|
@@ -6481,12 +6543,17 @@ function convertToPOJOServerErrorResponse(httpError) {
|
|
|
6481
6543
|
* console.log(serverError.status, serverError.message);
|
|
6482
6544
|
* }
|
|
6483
6545
|
* ```
|
|
6546
|
+
*
|
|
6547
|
+
* @param error - The HTTP error response or generic error object to convert.
|
|
6548
|
+
* @returns A {@link ServerErrorResponse} derived from the error, or `undefined` if the input is falsy.
|
|
6484
6549
|
*/
|
|
6485
6550
|
function convertToServerErrorResponse(error) {
|
|
6486
6551
|
let result;
|
|
6487
6552
|
if (error instanceof HttpErrorResponse) {
|
|
6488
6553
|
const { status, error: data } = error;
|
|
6489
6554
|
const code = data.code;
|
|
6555
|
+
// statusText is deprecated with HTTP/2+ but still needed as a fallback for error messages
|
|
6556
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
6490
6557
|
const message = data.message ?? error.statusText;
|
|
6491
6558
|
switch (status) {
|
|
6492
6559
|
case 401:
|
|
@@ -6783,6 +6850,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
6783
6850
|
* const params = convertServerErrorParams(httpErrorResponse);
|
|
6784
6851
|
* store.dispatch(myErrorAction(params));
|
|
6785
6852
|
* ```
|
|
6853
|
+
*
|
|
6854
|
+
* @param httpError - The HTTP error response or generic error object to convert.
|
|
6855
|
+
* @returns A {@link ServerErrorParams} object wrapping the converted server error.
|
|
6786
6856
|
*/
|
|
6787
6857
|
function convertServerErrorParams(httpError) {
|
|
6788
6858
|
const error = convertToPOJOServerErrorResponse(httpError);
|
|
@@ -6800,6 +6870,10 @@ function convertServerErrorParams(httpError) {
|
|
|
6800
6870
|
* ))
|
|
6801
6871
|
* );
|
|
6802
6872
|
* ```
|
|
6873
|
+
*
|
|
6874
|
+
* @param action - The NgRx action creator to dispatch with the converted error params.
|
|
6875
|
+
* @param mapError - Optional function to transform the {@link ServerErrorParams} before dispatching. Defaults to identity.
|
|
6876
|
+
* @returns An RxJS operator that catches errors and emits the corresponding error action.
|
|
6803
6877
|
*/
|
|
6804
6878
|
function catchErrorServerParams(action, mapError = (error) => error) {
|
|
6805
6879
|
return catchError((error) => {
|
|
@@ -6854,6 +6928,7 @@ const reducer = createReducer(INITIAL_STATE$1, on(dbxModelResetState, () => INIT
|
|
|
6854
6928
|
/**
|
|
6855
6929
|
* @deprecated use STATE_FEATURE_KEY instead.
|
|
6856
6930
|
*/
|
|
6931
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
6857
6932
|
const stateFeatureKey = STATE_FEATURE_KEY;
|
|
6858
6933
|
/**
|
|
6859
6934
|
* @deprecated use INITIAL_STATE instead.
|
|
@@ -6861,12 +6936,20 @@ const stateFeatureKey = STATE_FEATURE_KEY;
|
|
|
6861
6936
|
const initialState = INITIAL_STATE$1;
|
|
6862
6937
|
|
|
6863
6938
|
const FEATURE_KEY = 'app.model';
|
|
6939
|
+
/**
|
|
6940
|
+
* Combined reducer for the DbxModel NgRx feature state, delegating to sub-reducers for each state slice.
|
|
6941
|
+
*
|
|
6942
|
+
* @param state The current DbxModel feature state, or undefined for initial state
|
|
6943
|
+
* @param action The NgRx action to process
|
|
6944
|
+
* @returns The new DbxModelState produced by the combined sub-reducers
|
|
6945
|
+
*/
|
|
6864
6946
|
function reducers(state, action) {
|
|
6865
6947
|
return combineReducers({
|
|
6866
6948
|
[STATE_FEATURE_KEY]: reducer
|
|
6867
6949
|
})(state, action);
|
|
6868
6950
|
}
|
|
6869
6951
|
// MARK: Context
|
|
6952
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
6870
6953
|
const selectDbxModelFeature = createFeatureSelector(FEATURE_KEY);
|
|
6871
6954
|
// MARK: Module Config
|
|
6872
6955
|
const selectDbxModelFeatureObjectModuleConfig = createSelector(selectDbxModelFeature, (state) => state[STATE_FEATURE_KEY]);
|
|
@@ -6874,6 +6957,7 @@ const selectDbxModelFeatureObjectModuleConfig = createSelector(selectDbxModelFea
|
|
|
6874
6957
|
/**
|
|
6875
6958
|
* @deprecated use FEATURE_KEY instead.
|
|
6876
6959
|
*/
|
|
6960
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
6877
6961
|
const featureKey = FEATURE_KEY;
|
|
6878
6962
|
|
|
6879
6963
|
var index = /*#__PURE__*/Object.freeze({
|
|
@@ -6933,6 +7017,7 @@ class DbxModelViewTrackerStorage {
|
|
|
6933
7017
|
* Returns all stored view events for the given folder.
|
|
6934
7018
|
*
|
|
6935
7019
|
* @param folder - Optional folder name; defaults to `'default'`
|
|
7020
|
+
* @returns Observable of all view tracker events in the folder
|
|
6936
7021
|
*/
|
|
6937
7022
|
getAllEvents(folder) {
|
|
6938
7023
|
return this.getEventSet(folder).pipe(map((x) => x.e));
|
|
@@ -6941,13 +7026,14 @@ class DbxModelViewTrackerStorage {
|
|
|
6941
7026
|
* Returns the complete event set for the given folder.
|
|
6942
7027
|
*
|
|
6943
7028
|
* @param folder - Optional folder name; defaults to `'default'`
|
|
7029
|
+
* @returns Observable of the event set containing events and the last-update timestamp
|
|
6944
7030
|
*/
|
|
6945
7031
|
getEventSet(folder) {
|
|
6946
7032
|
const storageKey = this.getStorageKeyForFolder(folder);
|
|
6947
7033
|
return this._getEventSetForStorageKey(storageKey);
|
|
6948
7034
|
}
|
|
6949
7035
|
_getEventSetForStorageKey(storageKey) {
|
|
6950
|
-
return this.storageAccessor.get(storageKey).pipe(catchError((
|
|
7036
|
+
return this.storageAccessor.get(storageKey).pipe(catchError(() => {
|
|
6951
7037
|
return of(undefined);
|
|
6952
7038
|
}), map((result) => result ?? { e: [], l: 0 }));
|
|
6953
7039
|
}
|
|
@@ -6955,10 +7041,10 @@ class DbxModelViewTrackerStorage {
|
|
|
6955
7041
|
* Computes the storage key for a given folder name.
|
|
6956
7042
|
*
|
|
6957
7043
|
* @param folder - Optional folder name; defaults to `'default'`
|
|
7044
|
+
* @returns The computed storage key string combining the base key and folder name
|
|
6958
7045
|
*/
|
|
6959
7046
|
getStorageKeyForFolder(folder) {
|
|
6960
|
-
|
|
6961
|
-
return storageKey;
|
|
7047
|
+
return `${this.storageKey}_${folder ?? 'default'}`;
|
|
6962
7048
|
}
|
|
6963
7049
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxModelViewTrackerStorage, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6964
7050
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxModelViewTrackerStorage });
|
|
@@ -6979,6 +7065,8 @@ class DbxModelTrackerService {
|
|
|
6979
7065
|
newEvent$ = this._viewTrackerStorage.newEvent$;
|
|
6980
7066
|
/**
|
|
6981
7067
|
* The default storage folder used when no folder is specified in tracking calls.
|
|
7068
|
+
*
|
|
7069
|
+
* @returns The current default folder name, or undefined if not set
|
|
6982
7070
|
*/
|
|
6983
7071
|
get defaultFolder() {
|
|
6984
7072
|
return this._defaultFolder;
|
|
@@ -7008,6 +7096,7 @@ class DbxModelTrackerService {
|
|
|
7008
7096
|
* Returns all recorded view events for the given folder, sorted by most recent first.
|
|
7009
7097
|
*
|
|
7010
7098
|
* @param folder - Storage folder; defaults to {@link defaultFolder}
|
|
7099
|
+
* @returns Observable of view events sorted by most recent first
|
|
7011
7100
|
*/
|
|
7012
7101
|
getAllViewEvents(folder = this._defaultFolder) {
|
|
7013
7102
|
return this._viewTrackerStorage.getAllEvents(folder);
|
|
@@ -7016,6 +7105,7 @@ class DbxModelTrackerService {
|
|
|
7016
7105
|
* Returns the complete event set (events and last-update timestamp) for the given folder.
|
|
7017
7106
|
*
|
|
7018
7107
|
* @param folder - Storage folder; defaults to {@link defaultFolder}
|
|
7108
|
+
* @returns Observable of the complete event set including events and last-update timestamp
|
|
7019
7109
|
*/
|
|
7020
7110
|
getViewEventSet(folder = this._defaultFolder) {
|
|
7021
7111
|
return this._viewTrackerStorage.getEventSet(folder);
|
|
@@ -7053,6 +7143,10 @@ class DbxModelObjectStateService {
|
|
|
7053
7143
|
store = inject((Store));
|
|
7054
7144
|
/**
|
|
7055
7145
|
* Emit a model viewed event.
|
|
7146
|
+
*
|
|
7147
|
+
* @param params - The model viewed event parameters
|
|
7148
|
+
* @param params.modelKeyTypeNamePair - Identifies the model that was viewed
|
|
7149
|
+
* @param params.context - Optional context describing how the model was viewed
|
|
7056
7150
|
*/
|
|
7057
7151
|
emitModelViewEvent({ modelKeyTypeNamePair, context }) {
|
|
7058
7152
|
this.store.dispatch(emitObjectViewEvent({ modelKeyTypeNamePair, context }));
|
|
@@ -7071,12 +7165,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
7071
7165
|
* ```typescript
|
|
7072
7166
|
* const accessor = defaultDbxModelViewTrackerStorageAccessorFactory(storageAccessorFactory);
|
|
7073
7167
|
* ```
|
|
7168
|
+
*
|
|
7169
|
+
* @param storageAccessorFactory - The factory used to create typed storage accessors
|
|
7170
|
+
* @returns A storage accessor configured with the `mtvs` prefix for model view tracker events
|
|
7074
7171
|
*/
|
|
7075
7172
|
function defaultDbxModelViewTrackerStorageAccessorFactory(storageAccessorFactory) {
|
|
7076
|
-
|
|
7173
|
+
return storageAccessorFactory.createStorageAccessor({
|
|
7077
7174
|
prefix: 'mtvs'
|
|
7078
7175
|
});
|
|
7079
|
-
return accessor;
|
|
7080
7176
|
}
|
|
7081
7177
|
/**
|
|
7082
7178
|
* Creates EnvironmentProviders for providing DbxModelTrackerService, DbxModelObjectStateService and sets up the NgRx store for DbxModelTrackerEffects.
|
|
@@ -7097,7 +7193,7 @@ function provideDbxModelService() {
|
|
|
7097
7193
|
DbxModelObjectStateService,
|
|
7098
7194
|
// NgRx
|
|
7099
7195
|
provideEffects([DbxModelTrackerEffects]),
|
|
7100
|
-
provideState(
|
|
7196
|
+
provideState(FEATURE_KEY, reducers)
|
|
7101
7197
|
];
|
|
7102
7198
|
return makeEnvironmentProviders(providers);
|
|
7103
7199
|
}
|
|
@@ -7109,6 +7205,9 @@ function provideDbxModelService() {
|
|
|
7109
7205
|
* ```typescript
|
|
7110
7206
|
* const keys = allDbxModelViewTrackerEventSetModelKeys(eventSet);
|
|
7111
7207
|
* ```
|
|
7208
|
+
*
|
|
7209
|
+
* @param eventSet - The event set from which to extract model keys
|
|
7210
|
+
* @returns Array of model keys from all events in the set
|
|
7112
7211
|
*/
|
|
7113
7212
|
function allDbxModelViewTrackerEventSetModelKeys(eventSet) {
|
|
7114
7213
|
return allDbxModelViewTrackerEventModelKeys(eventSet.e);
|
|
@@ -7120,6 +7219,9 @@ function allDbxModelViewTrackerEventSetModelKeys(eventSet) {
|
|
|
7120
7219
|
* ```typescript
|
|
7121
7220
|
* const keys = allDbxModelViewTrackerEventModelKeys(events);
|
|
7122
7221
|
* ```
|
|
7222
|
+
*
|
|
7223
|
+
* @param events - Array of view tracker events from which to extract model keys
|
|
7224
|
+
* @returns Array of model keys, one per event
|
|
7123
7225
|
*/
|
|
7124
7226
|
function allDbxModelViewTrackerEventModelKeys(events) {
|
|
7125
7227
|
return events.map((y) => y.m.key);
|
|
@@ -7200,6 +7302,7 @@ class DbxModelTypesService {
|
|
|
7200
7302
|
* Returns an observable of the Material icon name for the given model type.
|
|
7201
7303
|
*
|
|
7202
7304
|
* @param type - The model type string to look up
|
|
7305
|
+
* @returns Observable emitting the icon name for the given model type
|
|
7203
7306
|
*/
|
|
7204
7307
|
iconForType(type) {
|
|
7205
7308
|
return this.iconMap$.pipe(map((x) => x[type]));
|
|
@@ -7578,6 +7681,9 @@ const DBX_WEB_FILE_PREVIEW_SERVICE_ENTRIES_TOKEN = new InjectionToken('DefaultDb
|
|
|
7578
7681
|
/**
|
|
7579
7682
|
* Creates a provider that registers the given entries with the {@link DbxWebFilePreviewService} via the {@link DBX_WEB_FILE_PREVIEW_SERVICE_ENTRIES_TOKEN}.
|
|
7580
7683
|
*
|
|
7684
|
+
* @param entries - Array of preview service entries to register, each mapping a MIME type to its preview component
|
|
7685
|
+
* @returns A provider configuration that supplies the entries via the injection token
|
|
7686
|
+
*
|
|
7581
7687
|
* @example
|
|
7582
7688
|
* ```typescript
|
|
7583
7689
|
* provideDbxWebFilePreviewServiceEntries([DBX_WEB_FILE_PREVIEW_SERVICE_ZIP_PRESET_ENTRY]);
|
|
@@ -7590,11 +7696,11 @@ function provideDbxWebFilePreviewServiceEntries(entries) {
|
|
|
7590
7696
|
};
|
|
7591
7697
|
}
|
|
7592
7698
|
// MARK: Default Functions
|
|
7593
|
-
/**
|
|
7594
|
-
* Default preset for previewing a file using a DbxEmbedDialogComponent.
|
|
7595
|
-
*/
|
|
7596
7699
|
/**
|
|
7597
7700
|
* Default preview component function that embeds files using {@link DbxEmbedComponent}. Images are rendered with an `img` element; all other types use `embed`.
|
|
7701
|
+
*
|
|
7702
|
+
* @param input - The preview input containing blob data, source URL, and MIME type information
|
|
7703
|
+
* @returns An injection component config that initializes a {@link DbxEmbedComponent} with the appropriate embed element and content
|
|
7598
7704
|
*/
|
|
7599
7705
|
const DBX_WEB_FILE_PREVIEW_SERVICE_DEFAULT_PREVIEW_COMPONENT_FUNCTION = (input) => {
|
|
7600
7706
|
const { blob, srcUrl, embedMimeType, sanitizeSrcUrl } = input;
|
|
@@ -7622,6 +7728,9 @@ const DBX_WEB_FILE_PREVIEW_SERVICE_DEFAULT_PREVIEW_COMPONENT_FUNCTION = (input)
|
|
|
7622
7728
|
};
|
|
7623
7729
|
/**
|
|
7624
7730
|
* Default dialog-with-component function that opens the preview component inside a {@link DbxInjectionDialogComponent} with a close button.
|
|
7731
|
+
*
|
|
7732
|
+
* @param input - The dialog input containing the MatDialog instance and the component config to display
|
|
7733
|
+
* @returns A MatDialogRef for the opened injection dialog
|
|
7625
7734
|
*/
|
|
7626
7735
|
const DBX_WEB_FILE_PREVIEW_SERVICE_DEFAULT_DIALOG_WITH_COMPONENT_FUNCTION = (input) => {
|
|
7627
7736
|
const { matDialog, componentConfig } = input;
|
|
@@ -7637,7 +7746,8 @@ const DBX_WEB_FILE_PREVIEW_SERVICE_DEFAULT_DIALOG_WITH_COMPONENT_FUNCTION = (inp
|
|
|
7637
7746
|
class DbxWebFilePreviewService {
|
|
7638
7747
|
matDialog = inject(MatDialog);
|
|
7639
7748
|
_entries = new Map();
|
|
7640
|
-
constructor(
|
|
7749
|
+
constructor() {
|
|
7750
|
+
const entries = inject(DBX_WEB_FILE_PREVIEW_SERVICE_ENTRIES_TOKEN, { optional: true });
|
|
7641
7751
|
if (entries) {
|
|
7642
7752
|
entries.forEach((x) => this.registerPreviewEntry(x));
|
|
7643
7753
|
}
|
|
@@ -7663,12 +7773,16 @@ class DbxWebFilePreviewService {
|
|
|
7663
7773
|
}
|
|
7664
7774
|
/**
|
|
7665
7775
|
* Overrides the default preview component function used when no MIME-specific entry is registered.
|
|
7776
|
+
*
|
|
7777
|
+
* @param previewFunction - The preview component function to use as the new default
|
|
7666
7778
|
*/
|
|
7667
7779
|
setDefaultPreviewComponentFunction(previewFunction) {
|
|
7668
7780
|
this._defaultPreviewComponentFunction = previewFunction;
|
|
7669
7781
|
}
|
|
7670
7782
|
/**
|
|
7671
7783
|
* Overrides the default dialog-with-component function used when no MIME-specific dialog handler is registered.
|
|
7784
|
+
*
|
|
7785
|
+
* @param previewDialogWithComponentFunction - The dialog-with-component function to use as the new default
|
|
7672
7786
|
*/
|
|
7673
7787
|
setDefaultPreviewDialogWithComponentFunction(previewDialogWithComponentFunction) {
|
|
7674
7788
|
this._defaultPreviewDialogWithComponentFunction = previewDialogWithComponentFunction;
|
|
@@ -7678,6 +7792,7 @@ class DbxWebFilePreviewService {
|
|
|
7678
7792
|
* Creates an injection component config for previewing a file. Uses a MIME-specific preview function if registered, otherwise falls back to the default.
|
|
7679
7793
|
*
|
|
7680
7794
|
* @param input - The preview input containing blob, URL, and MIME type information
|
|
7795
|
+
* @returns An injection component config suitable for rendering the file preview
|
|
7681
7796
|
*/
|
|
7682
7797
|
createPreviewConfig(input) {
|
|
7683
7798
|
const { embedMimeType } = input;
|
|
@@ -7710,7 +7825,7 @@ class DbxWebFilePreviewService {
|
|
|
7710
7825
|
}
|
|
7711
7826
|
return matDialogRef;
|
|
7712
7827
|
}
|
|
7713
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxWebFilePreviewService, deps: [
|
|
7828
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxWebFilePreviewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7714
7829
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxWebFilePreviewService, providedIn: 'root' });
|
|
7715
7830
|
}
|
|
7716
7831
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxWebFilePreviewService, decorators: [{
|
|
@@ -7718,12 +7833,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
7718
7833
|
args: [{
|
|
7719
7834
|
providedIn: 'root'
|
|
7720
7835
|
}]
|
|
7721
|
-
}], ctorParameters: () => [
|
|
7722
|
-
type: Optional
|
|
7723
|
-
}, {
|
|
7724
|
-
type: Inject,
|
|
7725
|
-
args: [DBX_WEB_FILE_PREVIEW_SERVICE_ENTRIES_TOKEN]
|
|
7726
|
-
}] }] });
|
|
7836
|
+
}], ctorParameters: () => [] });
|
|
7727
7837
|
|
|
7728
7838
|
/**
|
|
7729
7839
|
* Previews a file by delegating to the {@link DbxWebFilePreviewService} to resolve the appropriate preview component for the given MIME type.
|
|
@@ -7738,6 +7848,7 @@ class DbxWebFilePreviewComponent {
|
|
|
7738
7848
|
config = input(...(ngDevMode ? [undefined, { debugName: "config" }] : []));
|
|
7739
7849
|
componentConfigSignal = computed(() => {
|
|
7740
7850
|
const config = this.config();
|
|
7851
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- any required for contravariant init callback compatibility
|
|
7741
7852
|
let componentConfig;
|
|
7742
7853
|
if (config) {
|
|
7743
7854
|
componentConfig = this.webFilePreviewService.createPreviewConfig(config);
|
|
@@ -7765,6 +7876,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
7765
7876
|
/**
|
|
7766
7877
|
* Builds a directory tree from an array of zip archive entries, enriching each node with MIME type detection and blob retrieval capability.
|
|
7767
7878
|
*
|
|
7879
|
+
* @param entries - Array of zip archive entries to build the tree from, or null/undefined for an empty tree
|
|
7880
|
+
* @returns The root node of the constructed directory tree with MIME types and blob getters attached
|
|
7881
|
+
*
|
|
7768
7882
|
* @example
|
|
7769
7883
|
* ```typescript
|
|
7770
7884
|
* const root = dbxZipBlobPreviewEntryTreeFromEntries(zipEntries);
|
|
@@ -7806,12 +7920,19 @@ const SCREEN_MEDIA_WIDTH_TYPE_SIZE_MAP = {
|
|
|
7806
7920
|
* screenMediaWidthTypeIsActive('tablet', 'small'); // true
|
|
7807
7921
|
* screenMediaWidthTypeIsActive('micro', 'tablet'); // false
|
|
7808
7922
|
* ```
|
|
7923
|
+
*
|
|
7924
|
+
* @returns `true` if the current width type meets or exceeds the breakpoint
|
|
7809
7925
|
*/
|
|
7810
7926
|
function screenMediaWidthTypeIsActive(current, breakpoint) {
|
|
7811
7927
|
return compareScreenMediaWidthTypes(current, breakpoint, (a, b) => a >= b);
|
|
7812
7928
|
}
|
|
7813
7929
|
/**
|
|
7814
7930
|
* Compares two {@link ScreenMediaWidthType} values using a custom comparator on their numeric sizes.
|
|
7931
|
+
*
|
|
7932
|
+
* @param a - the first screen width type
|
|
7933
|
+
* @param b - the second screen width type
|
|
7934
|
+
* @param compare - a comparator function applied to the numeric size values of `a` and `b`
|
|
7935
|
+
* @returns the result of applying the comparator to the mapped numeric sizes
|
|
7815
7936
|
*/
|
|
7816
7937
|
function compareScreenMediaWidthTypes(a, b, compare) {
|
|
7817
7938
|
return compare(SCREEN_MEDIA_WIDTH_TYPE_SIZE_MAP[a], SCREEN_MEDIA_WIDTH_TYPE_SIZE_MAP[b]);
|
|
@@ -7858,8 +7979,8 @@ class DbxScreenMediaService {
|
|
|
7858
7979
|
_updateHeight = new Subject();
|
|
7859
7980
|
widthType$ = this._updateWidth.pipe(initialize(() => this._updateWidth.next()), throttleTime(100, undefined, { leading: true, trailing: true }), map(() => this._readWidthType()), distinctUntilChanged(), shareReplay(1));
|
|
7860
7981
|
heightType$ = this._updateWidth.pipe(initialize(() => this._updateHeight.next()), throttleTime(100, undefined, { leading: true, trailing: true }), map(() => this._readHeightType()), distinctUntilChanged(), shareReplay(1));
|
|
7861
|
-
constructor(
|
|
7862
|
-
const { microScreenWidthMax, smallScreenWidthMax, tabletScreenWidthMax, largeScreenWidthMax } =
|
|
7982
|
+
constructor() {
|
|
7983
|
+
const { microScreenWidthMax, smallScreenWidthMax, tabletScreenWidthMax, largeScreenWidthMax } = inject(DbxScreenMediaServiceConfig);
|
|
7863
7984
|
this._microQuery = this._media.matchMedia(`screen and (max-width:${microScreenWidthMax}px)`);
|
|
7864
7985
|
this._smallQuery = this._media.matchMedia(`screen and (max-width:${smallScreenWidthMax}px)`);
|
|
7865
7986
|
this._tabletQuery = this._media.matchMedia(`screen and (max-width:${tabletScreenWidthMax}px)`);
|
|
@@ -7917,15 +8038,12 @@ class DbxScreenMediaService {
|
|
|
7917
8038
|
return 'normal';
|
|
7918
8039
|
}
|
|
7919
8040
|
}
|
|
7920
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxScreenMediaService, deps: [
|
|
8041
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxScreenMediaService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7921
8042
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxScreenMediaService });
|
|
7922
8043
|
}
|
|
7923
8044
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxScreenMediaService, decorators: [{
|
|
7924
8045
|
type: Injectable
|
|
7925
|
-
}], ctorParameters: () => [
|
|
7926
|
-
type: Inject,
|
|
7927
|
-
args: [DbxScreenMediaServiceConfig]
|
|
7928
|
-
}] }] });
|
|
8046
|
+
}], ctorParameters: () => [] });
|
|
7929
8047
|
|
|
7930
8048
|
/**
|
|
7931
8049
|
* Calculates and applies a dynamic height to a Material expansion panel header based on text content.
|
|
@@ -8069,8 +8187,7 @@ class DbxAvatarViewComponent {
|
|
|
8069
8187
|
avatarIcon = input(...(ngDevMode ? [undefined, { debugName: "avatarIcon" }] : []));
|
|
8070
8188
|
avatarHideOnError = input(...(ngDevMode ? [undefined, { debugName: "avatarHideOnError" }] : []));
|
|
8071
8189
|
avatarHideOnErrorSignal = computed(() => {
|
|
8072
|
-
|
|
8073
|
-
return hideOnError;
|
|
8190
|
+
return this.avatarHideOnError() ?? this.defaultContext?.hideOnError ?? false;
|
|
8074
8191
|
}, ...(ngDevMode ? [{ debugName: "avatarHideOnErrorSignal" }] : []));
|
|
8075
8192
|
currentAvatarUrlSignal = computed(() => {
|
|
8076
8193
|
const directUrl = this.avatarUrl();
|
|
@@ -8206,6 +8323,9 @@ class DbxAvatarViewService {
|
|
|
8206
8323
|
* Resolves the injection component configuration for the given avatar context.
|
|
8207
8324
|
*
|
|
8208
8325
|
* Falls back to the default component config if no custom resolver is configured or if it returns null.
|
|
8326
|
+
*
|
|
8327
|
+
* @param context - the avatar context used to resolve the appropriate component configuration
|
|
8328
|
+
* @returns the resolved injection component config, or the default if no custom resolver matches
|
|
8209
8329
|
*/
|
|
8210
8330
|
avatarComponentForContext(context) {
|
|
8211
8331
|
let config = this._defaultAvatarComponentConfig;
|
|
@@ -8223,19 +8343,35 @@ class DbxAvatarViewService {
|
|
|
8223
8343
|
get defaultAvatarErrorIcon() {
|
|
8224
8344
|
return this._defaultAvatarErrorIcon;
|
|
8225
8345
|
}
|
|
8226
|
-
/**
|
|
8346
|
+
/**
|
|
8347
|
+
* Sets the default avatar image URL used when no context-specific URL is provided.
|
|
8348
|
+
*
|
|
8349
|
+
* @param url - the URL to use as the default avatar image, or nullish to clear
|
|
8350
|
+
*/
|
|
8227
8351
|
setDefaultAvatarUrl(url) {
|
|
8228
8352
|
this._defaultAvatarUrl = url;
|
|
8229
8353
|
}
|
|
8230
|
-
/**
|
|
8354
|
+
/**
|
|
8355
|
+
* Sets the default Material icon name used as a fallback when no avatar image is available.
|
|
8356
|
+
*
|
|
8357
|
+
* @param icon - the Material icon name to use, or nullish to clear
|
|
8358
|
+
*/
|
|
8231
8359
|
setDefaultAvatarIcon(icon) {
|
|
8232
8360
|
this._defaultAvatarIcon = icon;
|
|
8233
8361
|
}
|
|
8234
|
-
/**
|
|
8362
|
+
/**
|
|
8363
|
+
* Sets the Material icon name displayed when the avatar image fails to load.
|
|
8364
|
+
*
|
|
8365
|
+
* @param icon - the Material icon name to display on image load error, or nullish to clear
|
|
8366
|
+
*/
|
|
8235
8367
|
setDefaultAvatarErrorIcon(icon) {
|
|
8236
8368
|
this._defaultAvatarErrorIcon = icon;
|
|
8237
8369
|
}
|
|
8238
|
-
/**
|
|
8370
|
+
/**
|
|
8371
|
+
* Overrides the default component used to render avatars when no context-specific component is resolved.
|
|
8372
|
+
*
|
|
8373
|
+
* @param config - the injection component config to use as the new default
|
|
8374
|
+
*/
|
|
8239
8375
|
setDefaultAvatarComponentConfig(config) {
|
|
8240
8376
|
this._defaultAvatarComponentConfig = config;
|
|
8241
8377
|
}
|
|
@@ -8286,7 +8422,7 @@ class DbxAvatarComponent {
|
|
|
8286
8422
|
const icon = this.avatarIcon() ?? inputContext?.icon;
|
|
8287
8423
|
const style = this.avatarStyle() ?? inputContext?.style;
|
|
8288
8424
|
const hideOnError = this.avatarHideOnError() ?? inputContext?.hideOnError;
|
|
8289
|
-
|
|
8425
|
+
return {
|
|
8290
8426
|
selector,
|
|
8291
8427
|
uid,
|
|
8292
8428
|
url,
|
|
@@ -8295,7 +8431,6 @@ class DbxAvatarComponent {
|
|
|
8295
8431
|
style,
|
|
8296
8432
|
hideOnError
|
|
8297
8433
|
};
|
|
8298
|
-
return context;
|
|
8299
8434
|
}, ...(ngDevMode ? [{ debugName: "contextSignal" }] : []));
|
|
8300
8435
|
configSignal = computed(() => {
|
|
8301
8436
|
const context = this.contextSignal();
|
|
@@ -8689,8 +8824,7 @@ class TwoColumnsContextStore extends ComponentStore {
|
|
|
8689
8824
|
* The right side is less-than or equal to half the total width when resizing, so we can use the total width to guess the best case current scenario.
|
|
8690
8825
|
*/
|
|
8691
8826
|
const expectedRightWidth = (x.totalWidth ?? 0) / 2;
|
|
8692
|
-
|
|
8693
|
-
return hideLeft;
|
|
8827
|
+
return x.showRight && expectedRightWidth < x.minRightWidth;
|
|
8694
8828
|
}));
|
|
8695
8829
|
/**
|
|
8696
8830
|
* Pipes the current state of reverseSizing.
|
|
@@ -8787,6 +8921,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
8787
8921
|
* })
|
|
8788
8922
|
* export class MyColumnLayoutComponent { }
|
|
8789
8923
|
* ```
|
|
8924
|
+
*
|
|
8925
|
+
* @returns an array of Angular providers that supply a new {@link TwoColumnsContextStore}
|
|
8790
8926
|
*/
|
|
8791
8927
|
function provideTwoColumnsContext() {
|
|
8792
8928
|
return [
|
|
@@ -8848,7 +8984,7 @@ class DbxTwoColumnComponent {
|
|
|
8848
8984
|
this.twoColumnsContextStore.setHasRight(true);
|
|
8849
8985
|
}
|
|
8850
8986
|
}, ...(ngDevMode ? [{ debugName: "_hasRightContentEffect" }] : []));
|
|
8851
|
-
viewResized(
|
|
8987
|
+
viewResized(_event) {
|
|
8852
8988
|
const totalWidth = this._elementRef.nativeElement.clientWidth;
|
|
8853
8989
|
this.twoColumnsContextStore.setTotalWidth(totalWidth);
|
|
8854
8990
|
}
|
|
@@ -9263,6 +9399,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
9263
9399
|
*/
|
|
9264
9400
|
class DbxAnchorContentComponent {
|
|
9265
9401
|
parent = inject(DbxAnchorComponent, { optional: true });
|
|
9402
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
9266
9403
|
inputAnchor = input(undefined, { ...(ngDevMode ? { debugName: "inputAnchor" } : {}), alias: 'anchor' });
|
|
9267
9404
|
_inputAnchor = toObservable(this.inputAnchor);
|
|
9268
9405
|
_parentAnchor = this.parent ? this.parent.anchor$ : of(undefined);
|
|
@@ -9362,6 +9499,9 @@ class DbxValueListItemModifier {
|
|
|
9362
9499
|
* })
|
|
9363
9500
|
* export class MyModifierDirective extends DbxValueListItemModifier<MyItem> { ... }
|
|
9364
9501
|
* ```
|
|
9502
|
+
*
|
|
9503
|
+
* @param sourceType - the directive class to register as the DbxValueListItemModifier provider
|
|
9504
|
+
* @returns an array of Angular providers that wire up the directive as a DbxValueListItemModifier
|
|
9365
9505
|
*/
|
|
9366
9506
|
function provideDbxValueListViewModifier(sourceType) {
|
|
9367
9507
|
return [
|
|
@@ -9380,6 +9520,10 @@ function provideDbxValueListViewModifier(sourceType) {
|
|
|
9380
9520
|
* item.selected = item.itemValue.isImportant;
|
|
9381
9521
|
* });
|
|
9382
9522
|
* ```
|
|
9523
|
+
*
|
|
9524
|
+
* @param key - a unique string identifier for this modifier in the modifier map
|
|
9525
|
+
* @param modify - the function that mutates list item properties during rendering
|
|
9526
|
+
* @returns a new ListItemModifier with the given key and modification function
|
|
9383
9527
|
*/
|
|
9384
9528
|
function listItemModifier(key, modify) {
|
|
9385
9529
|
return modifier(key, modify);
|
|
@@ -9633,6 +9777,8 @@ class DbxSidenavComponent extends AbstractTransitionWatcherDirective {
|
|
|
9633
9777
|
case 'full':
|
|
9634
9778
|
mode = SideNavDisplayMode.FULL;
|
|
9635
9779
|
break;
|
|
9780
|
+
default:
|
|
9781
|
+
break;
|
|
9636
9782
|
}
|
|
9637
9783
|
return mode;
|
|
9638
9784
|
}), distinctUntilChanged(), shareReplay(1));
|
|
@@ -9652,6 +9798,8 @@ class DbxSidenavComponent extends AbstractTransitionWatcherDirective {
|
|
|
9652
9798
|
drawer = 'side';
|
|
9653
9799
|
open = true; // always show
|
|
9654
9800
|
break;
|
|
9801
|
+
default:
|
|
9802
|
+
break;
|
|
9655
9803
|
}
|
|
9656
9804
|
return {
|
|
9657
9805
|
mode,
|
|
@@ -9691,6 +9839,8 @@ class DbxSidenavComponent extends AbstractTransitionWatcherDirective {
|
|
|
9691
9839
|
case SideNavDisplayMode.FULL:
|
|
9692
9840
|
// Do nothing. Should be always open.
|
|
9693
9841
|
break;
|
|
9842
|
+
default:
|
|
9843
|
+
break;
|
|
9694
9844
|
}
|
|
9695
9845
|
}
|
|
9696
9846
|
else {
|
|
@@ -9698,10 +9848,10 @@ class DbxSidenavComponent extends AbstractTransitionWatcherDirective {
|
|
|
9698
9848
|
}
|
|
9699
9849
|
if (open != null) {
|
|
9700
9850
|
if (open) {
|
|
9701
|
-
this.sidenav().open();
|
|
9851
|
+
void this.sidenav().open();
|
|
9702
9852
|
}
|
|
9703
9853
|
else {
|
|
9704
|
-
this.sidenav().close();
|
|
9854
|
+
void this.sidenav().close();
|
|
9705
9855
|
}
|
|
9706
9856
|
}
|
|
9707
9857
|
}
|
|
@@ -10001,6 +10151,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
10001
10151
|
* providers: [provideDbxRouterWebAngularRouterProviderConfig()]
|
|
10002
10152
|
* });
|
|
10003
10153
|
* ```
|
|
10154
|
+
*
|
|
10155
|
+
* @returns environment providers that configure the Angular Router-based segue anchor component
|
|
10004
10156
|
*/
|
|
10005
10157
|
function provideDbxRouterWebAngularRouterProviderConfig() {
|
|
10006
10158
|
const config = {
|
|
@@ -10052,6 +10204,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
10052
10204
|
* providers: [provideDbxRouterWebUiRouterProviderConfig()]
|
|
10053
10205
|
* });
|
|
10054
10206
|
* ```
|
|
10207
|
+
*
|
|
10208
|
+
* @returns environment providers that configure the UIRouter-based segue anchor component
|
|
10055
10209
|
*/
|
|
10056
10210
|
function provideDbxRouterWebUiRouterProviderConfig() {
|
|
10057
10211
|
const config = {
|
|
@@ -10736,6 +10890,9 @@ class DbxListView {
|
|
|
10736
10890
|
* })
|
|
10737
10891
|
* export class MyCustomListViewComponent extends DbxListView<MyItem> { ... }
|
|
10738
10892
|
* ```
|
|
10893
|
+
*
|
|
10894
|
+
* @param sourceType - the component class to register as the DbxListView provider
|
|
10895
|
+
* @returns an array of Angular providers that wire up the component as a DbxListView
|
|
10739
10896
|
*/
|
|
10740
10897
|
// eslint-disable-next-line
|
|
10741
10898
|
function provideDbxListView(sourceType) {
|
|
@@ -10754,6 +10911,7 @@ function provideDbxListView(sourceType) {
|
|
|
10754
10911
|
const DBX_VALUE_LIST_VIEW_ITEM = new InjectionToken('DbxValueListViewItem');
|
|
10755
10912
|
/**
|
|
10756
10913
|
* Convenience function for mapping a DecisionFunction for a value to a DecisionFunction for a DbxValueListItem with the same value type.
|
|
10914
|
+
*
|
|
10757
10915
|
* @param decisionFunction
|
|
10758
10916
|
* @returns
|
|
10759
10917
|
*/
|
|
@@ -10762,11 +10920,18 @@ function dbxValueListItemDecisionFunction(decisionFunction) {
|
|
|
10762
10920
|
}
|
|
10763
10921
|
/**
|
|
10764
10922
|
* Default mapping function that wraps each raw value into a {@link DbxValueListItem} with only the `itemValue` property set.
|
|
10923
|
+
*
|
|
10924
|
+
* @param itemValues The raw values to wrap as list items
|
|
10925
|
+
* @returns An observable emitting the values wrapped in {@link DbxValueListItem} objects
|
|
10765
10926
|
*/
|
|
10766
10927
|
const DEFAULT_DBX_VALUE_LIST_CONFIG_MAP_VALUES = (itemValues) => of(itemValues.map((itemValue) => ({ itemValue })));
|
|
10767
10928
|
/**
|
|
10768
10929
|
* Maps raw values into an observable of {@link DbxValueListItemConfig} items, applying the list view config's mapping function and attaching injection configuration.
|
|
10769
10930
|
*
|
|
10931
|
+
* @param listViewConfig The list view configuration containing the component and optional mapping function
|
|
10932
|
+
* @param itemValues The raw values to map into configured list items
|
|
10933
|
+
* @returns An observable emitting the mapped and configured list item configs
|
|
10934
|
+
*
|
|
10770
10935
|
* @example
|
|
10771
10936
|
* ```ts
|
|
10772
10937
|
* const items$ = mapValuesToValuesListItemConfigObs(listViewConfig, rawValues);
|
|
@@ -10780,11 +10945,11 @@ function mapValuesToValuesListItemConfigObs(listViewConfig, itemValues) {
|
|
|
10780
10945
|
}));
|
|
10781
10946
|
}
|
|
10782
10947
|
/**
|
|
10783
|
-
* Adds
|
|
10948
|
+
* Adds injection component configuration and meta configuration to each list item, producing fully configured {@link DbxValueListItemConfig} entries ready for rendering.
|
|
10784
10949
|
*
|
|
10785
|
-
* @param listViewConfig
|
|
10786
|
-
* @param listItems
|
|
10787
|
-
* @returns
|
|
10950
|
+
* @param listViewConfig The list view configuration providing injection component config and optional meta config
|
|
10951
|
+
* @param listItems The list items to augment with configuration
|
|
10952
|
+
* @returns The list items extended with injection component configuration attached
|
|
10788
10953
|
*/
|
|
10789
10954
|
function addConfigToValueListItems(listViewConfig, listItems) {
|
|
10790
10955
|
const itemConfigs = listItems.map((listItem) => {
|
|
@@ -10825,6 +10990,9 @@ class DbxValueListView {
|
|
|
10825
10990
|
/**
|
|
10826
10991
|
* Registers a component as a {@link DbxValueListView} provider for dependency injection.
|
|
10827
10992
|
*
|
|
10993
|
+
* @param sourceType The component class type to register as the list view provider
|
|
10994
|
+
* @returns An array of Angular providers that bind the given component to {@link DbxValueListView}
|
|
10995
|
+
*
|
|
10828
10996
|
* @example
|
|
10829
10997
|
* ```ts
|
|
10830
10998
|
* @Component({
|
|
@@ -10866,6 +11034,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
10866
11034
|
|
|
10867
11035
|
/**
|
|
10868
11036
|
* Default grouping function that places all items into a single unnamed group.
|
|
11037
|
+
*
|
|
11038
|
+
* @param items The flat list of configured list items to group
|
|
11039
|
+
* @returns An array containing a single group with all input items
|
|
10869
11040
|
*/
|
|
10870
11041
|
const defaultDbxValueListViewGroupValuesFunction = (items) => {
|
|
10871
11042
|
const data = {};
|
|
@@ -10885,20 +11056,24 @@ class DbxValueListViewGroupDelegate {
|
|
|
10885
11056
|
/**
|
|
10886
11057
|
* Creates a default {@link DbxValueListViewGroupDelegate} that places all items into a single ungrouped list.
|
|
10887
11058
|
*
|
|
11059
|
+
* @returns A group delegate that places all items into one unnamed group
|
|
11060
|
+
*
|
|
10888
11061
|
* @example
|
|
10889
11062
|
* ```ts
|
|
10890
11063
|
* const delegate = defaultDbxValueListViewGroupDelegate<MyItem>();
|
|
10891
11064
|
* ```
|
|
10892
11065
|
*/
|
|
10893
11066
|
function defaultDbxValueListViewGroupDelegate() {
|
|
10894
|
-
|
|
11067
|
+
return {
|
|
10895
11068
|
groupValues: defaultDbxValueListViewGroupValuesFunction
|
|
10896
11069
|
};
|
|
10897
|
-
return result;
|
|
10898
11070
|
}
|
|
10899
11071
|
/**
|
|
10900
11072
|
* Registers a class as a {@link DbxValueListViewGroupDelegate} provider for dependency injection.
|
|
10901
11073
|
*
|
|
11074
|
+
* @param sourceType The class type to register as the group delegate provider
|
|
11075
|
+
* @returns An array of Angular providers that bind the given class to {@link DbxValueListViewGroupDelegate}
|
|
11076
|
+
*
|
|
10902
11077
|
* @example
|
|
10903
11078
|
* ```ts
|
|
10904
11079
|
* @Directive({
|
|
@@ -10907,7 +11082,7 @@ function defaultDbxValueListViewGroupDelegate() {
|
|
|
10907
11082
|
* export class MyGroupDelegate extends DbxValueListViewGroupDelegate<MyGroup, MyItem> { ... }
|
|
10908
11083
|
* ```
|
|
10909
11084
|
*/
|
|
10910
|
-
// eslint-disable-next-line
|
|
11085
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- generic provider factory requires any for type compatibility
|
|
10911
11086
|
function provideDbxValueListViewGroupDelegate(sourceType) {
|
|
10912
11087
|
// use of any here is allowed as typings are not relevant for providers
|
|
10913
11088
|
return [
|
|
@@ -10954,7 +11129,7 @@ class DbxValueListViewContentGroupComponent {
|
|
|
10954
11129
|
}
|
|
10955
11130
|
@for (item of itemsSignal(); track trackByFunctionSignal()($index, item)) {
|
|
10956
11131
|
<dbx-anchor [anchor]="item.anchor" [disabled]="item.disabled">
|
|
10957
|
-
<a mat-list-item class="dbx-list-view-item" [disabled]="item.disabled" [disableRipple]="rippleDisabledOnItem(item)" (click)="onClickItem(item)">
|
|
11132
|
+
<a mat-list-item class="dbx-list-view-item" [disabled]="item.disabled" [disableRipple]="rippleDisabledOnItem(item)" (click)="onClickItem(item)" (keydown.enter)="onClickItem(item)">
|
|
10958
11133
|
@if (item.icon) {
|
|
10959
11134
|
<mat-icon matListItemIcon>{{ item.icon }}</mat-icon>
|
|
10960
11135
|
}
|
|
@@ -10988,7 +11163,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
10988
11163
|
}
|
|
10989
11164
|
@for (item of itemsSignal(); track trackByFunctionSignal()($index, item)) {
|
|
10990
11165
|
<dbx-anchor [anchor]="item.anchor" [disabled]="item.disabled">
|
|
10991
|
-
<a mat-list-item class="dbx-list-view-item" [disabled]="item.disabled" [disableRipple]="rippleDisabledOnItem(item)" (click)="onClickItem(item)">
|
|
11166
|
+
<a mat-list-item class="dbx-list-view-item" [disabled]="item.disabled" [disableRipple]="rippleDisabledOnItem(item)" (click)="onClickItem(item)" (keydown.enter)="onClickItem(item)">
|
|
10992
11167
|
@if (item.icon) {
|
|
10993
11168
|
<mat-icon matListItemIcon>{{ item.icon }}</mat-icon>
|
|
10994
11169
|
}
|
|
@@ -11023,6 +11198,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
11023
11198
|
*
|
|
11024
11199
|
* Uses the item's {@link DbxValueListItem.key} when available for stable identity across
|
|
11025
11200
|
* data updates, falling back to a prefixed index string to avoid collisions with key values.
|
|
11201
|
+
*
|
|
11202
|
+
* @param index - the item's position index in the list
|
|
11203
|
+
* @param item - the list item whose identity key is resolved
|
|
11204
|
+
* @returns the item's key, itemValue key/id, or a prefixed index string as a fallback
|
|
11026
11205
|
*/
|
|
11027
11206
|
const DEFAULT_VALUE_LIST_VIEW_CONTENT_COMPONENT_TRACK_BY_FUNCTION = (index, item) => item?.key ?? item?.itemValue?.key ?? item?.itemValue?.id ?? `__list__${index}__`;
|
|
11028
11207
|
/**
|
|
@@ -11036,21 +11215,21 @@ const DEFAULT_VALUE_LIST_VIEW_CONTENT_COMPONENT_TRACK_BY_FUNCTION = (index, item
|
|
|
11036
11215
|
*/
|
|
11037
11216
|
class DbxValueListViewContentComponent {
|
|
11038
11217
|
dbxListView = inject((DbxListView));
|
|
11218
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- any required for generic group delegate compatibility
|
|
11039
11219
|
_dbxListGroupDelegate = inject(DbxValueListViewGroupDelegate, { optional: true }) ?? defaultDbxValueListViewGroupDelegate();
|
|
11040
11220
|
_trackBy$ = this.dbxListView.trackBy$ ?? of(undefined);
|
|
11041
11221
|
trackBy$ = this._trackBy$.pipe(map((trackBy) => (trackBy ? (index, item) => trackBy(index, item.itemValue) : DEFAULT_VALUE_LIST_VIEW_CONTENT_COMPONENT_TRACK_BY_FUNCTION)));
|
|
11042
11222
|
items = input(...(ngDevMode ? [undefined, { debugName: "items" }] : []));
|
|
11043
11223
|
emitAllClicks = input(...(ngDevMode ? [undefined, { debugName: "emitAllClicks" }] : []));
|
|
11224
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- any required for generic group type compatibility
|
|
11044
11225
|
groups$ = toObservable(this.items).pipe(switchMap((items) => asObservable(this._dbxListGroupDelegate.groupValues(items ?? []))), shareReplay(1));
|
|
11045
11226
|
groupsSignal = toSignal(this.groups$);
|
|
11046
11227
|
disabledSignal = toSignal(this.dbxListView.disabled$);
|
|
11047
11228
|
onClickItem(item) {
|
|
11048
11229
|
// do not emit clicks for disabled items.
|
|
11049
|
-
if (!item.disabled) {
|
|
11050
|
-
|
|
11051
|
-
|
|
11052
|
-
this.onClickValue(item.itemValue);
|
|
11053
|
-
}
|
|
11230
|
+
if (!item.disabled && (this.emitAllClicks() || !item.anchor || anchorTypeForAnchor(item.anchor) === 'plain')) {
|
|
11231
|
+
// only emit clicks for items with no anchor, or plain anchors.
|
|
11232
|
+
this.onClickValue(item.itemValue);
|
|
11054
11233
|
}
|
|
11055
11234
|
}
|
|
11056
11235
|
onClickValue(value) {
|
|
@@ -11361,6 +11540,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
11361
11540
|
/**
|
|
11362
11541
|
* @deprecated use DBX_LIST_ACCORDION_VIEW_COMPONENT_IMPORTS_AND_EXPORTS instead.
|
|
11363
11542
|
*/
|
|
11543
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11364
11544
|
const dbxListAccordionViewComponentImportsAndExports = DBX_LIST_ACCORDION_VIEW_COMPONENT_IMPORTS_AND_EXPORTS;
|
|
11365
11545
|
|
|
11366
11546
|
/**
|
|
@@ -11486,6 +11666,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
11486
11666
|
*/
|
|
11487
11667
|
class DbxValueListGridViewContentComponent extends DbxValueListViewContentComponent {
|
|
11488
11668
|
_gridSizeOverride = inject(DbxValueListGridSizeDirective, { optional: true });
|
|
11669
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
11489
11670
|
inputGridConfig = input(undefined, { ...(ngDevMode ? { debugName: "inputGridConfig" } : {}), alias: 'grid' });
|
|
11490
11671
|
gridConfigFromGridSizeSignal = toSignal(this._gridSizeOverride?.gridSize$ ?? of(undefined));
|
|
11491
11672
|
gridConfigSignal = computed(() => {
|
|
@@ -11578,6 +11759,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
11578
11759
|
/**
|
|
11579
11760
|
* @deprecated use DBX_LIST_GRID_VIEW_COMPONENT_IMPORTS_AND_EXPORTS instead.
|
|
11580
11761
|
*/
|
|
11762
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11581
11763
|
const dbxListGridViewComponentImportsAndExports = DBX_LIST_GRID_VIEW_COMPONENT_IMPORTS_AND_EXPORTS;
|
|
11582
11764
|
|
|
11583
11765
|
/**
|
|
@@ -11714,7 +11896,7 @@ class DbxListTitleGroupDirective {
|
|
|
11714
11896
|
const cssClassesForAllGroups = inputCssClasses ?? [];
|
|
11715
11897
|
const componentClass = delegate.headerComponentClass ?? DbxListTitleGroupHeaderComponent;
|
|
11716
11898
|
const { dataForGroupValue, footerComponentClass } = delegate;
|
|
11717
|
-
groups =
|
|
11899
|
+
groups = [...groupsValuesMap.entries()].map(([value, items]) => {
|
|
11718
11900
|
const data = dataForGroupValue(value, items);
|
|
11719
11901
|
data.value = value;
|
|
11720
11902
|
const cssClasses = data.cssClasses ? [...cssClassesForAllGroups, ...data.cssClasses] : cssClassesForAllGroups;
|
|
@@ -11769,6 +11951,9 @@ const DBX_LIST_ITEM_DISABLE_RIPPLE_LIST_ITEM_MODIFIER_KEY = 'disable_ripple_anch
|
|
|
11769
11951
|
/**
|
|
11770
11952
|
* Default decision function that disables ripple on items that already have ripple disabled,
|
|
11771
11953
|
* lack an anchor, or have an anchor with no navigation target.
|
|
11954
|
+
*
|
|
11955
|
+
* @param item - the list item to evaluate for ripple disabling
|
|
11956
|
+
* @returns `true` if the ripple should be disabled for this item
|
|
11772
11957
|
*/
|
|
11773
11958
|
const DBX_LIST_ITEM_DEFAULT_DISABLE_FUNCTION = (item) => {
|
|
11774
11959
|
return item.rippleDisabled || !item.anchor || (!item.anchor.ref && !item.anchor.url && !item.anchor.onClick);
|
|
@@ -11816,6 +12001,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
11816
12001
|
const DBX_LIST_ITEM_IS_SELECTED_ITEM_MODIFIER_KEY = 'is_selected_item_modifier';
|
|
11817
12002
|
/**
|
|
11818
12003
|
* Default decision function that returns the item's current `selected` state (defaulting to false).
|
|
12004
|
+
*
|
|
12005
|
+
* @param item - the list item to check for selection
|
|
12006
|
+
* @returns `true` if the item is currently selected, `false` otherwise
|
|
11819
12007
|
*/
|
|
11820
12008
|
const DEFAULT_DBX_LIST_ITEM_IS_SELECTED_FUNCTION = (item) => {
|
|
11821
12009
|
return item.selected ?? false;
|
|
@@ -12089,7 +12277,9 @@ class DbxListComponent {
|
|
|
12089
12277
|
const { scrollTop, scrollHeight, clientHeight } = element;
|
|
12090
12278
|
return scrollHeight - (scrollTop + clientHeight);
|
|
12091
12279
|
}
|
|
12092
|
-
catch
|
|
12280
|
+
catch {
|
|
12281
|
+
/* ignored */
|
|
12282
|
+
}
|
|
12093
12283
|
}
|
|
12094
12284
|
return 0;
|
|
12095
12285
|
}
|
|
@@ -12099,7 +12289,7 @@ class DbxListComponent {
|
|
|
12099
12289
|
try {
|
|
12100
12290
|
element.scrollTop = element.scrollHeight;
|
|
12101
12291
|
}
|
|
12102
|
-
catch
|
|
12292
|
+
catch {
|
|
12103
12293
|
// do nothing.
|
|
12104
12294
|
}
|
|
12105
12295
|
}
|
|
@@ -12111,7 +12301,7 @@ class DbxListComponent {
|
|
|
12111
12301
|
const { scrollHeight, clientHeight } = element;
|
|
12112
12302
|
element.scrollTop = scrollHeight - (clientHeight + pos);
|
|
12113
12303
|
}
|
|
12114
|
-
catch
|
|
12304
|
+
catch {
|
|
12115
12305
|
// do nothing.
|
|
12116
12306
|
}
|
|
12117
12307
|
}
|
|
@@ -12194,6 +12384,7 @@ class AbstractDbxListWrapperDirective {
|
|
|
12194
12384
|
currentState$ = combineLatest([this._stateOverride, toObservable(this.state)]).pipe(map(([stateOverride, state]) => stateOverride ?? state), maybeValueFromObservableOrValue(), shareReplay(1));
|
|
12195
12385
|
config$ = this._config.pipe(maybeValueFromObservableOrValue(), map((x) => (x ? this._buildListConfig(x) : undefined)), shareReplay(1));
|
|
12196
12386
|
configSignal = toSignal(this.config$);
|
|
12387
|
+
// eslint-disable-next-line @angular-eslint/prefer-inject
|
|
12197
12388
|
constructor(initConfig) {
|
|
12198
12389
|
this._config.next(initConfig);
|
|
12199
12390
|
}
|
|
@@ -12275,6 +12466,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
12275
12466
|
|
|
12276
12467
|
/**
|
|
12277
12468
|
* Angular {@link TrackByFunction} that tracks {@link UniqueModel} items by their `id` property.
|
|
12469
|
+
*
|
|
12470
|
+
* @param index - the item's index in the iterable
|
|
12471
|
+
* @param model - the model whose `id` is used as the tracking identity
|
|
12472
|
+
* @returns the model's unique `id` value
|
|
12278
12473
|
*/
|
|
12279
12474
|
const TRACK_BY_MODEL_ID = (index, model) => model.id;
|
|
12280
12475
|
/**
|
|
@@ -12284,12 +12479,18 @@ const TRACK_BY_MODEL_ID = (index, model) => model.id;
|
|
|
12284
12479
|
* ```ts
|
|
12285
12480
|
* readonly trackBy = trackByUniqueIdentifier<MyModel>();
|
|
12286
12481
|
* ```
|
|
12482
|
+
*
|
|
12483
|
+
* @returns a TrackByFunction that uses the item's `id` for identity tracking
|
|
12287
12484
|
*/
|
|
12288
12485
|
function trackByUniqueIdentifier() {
|
|
12289
12486
|
return TRACK_BY_MODEL_ID;
|
|
12290
12487
|
}
|
|
12291
12488
|
/**
|
|
12292
12489
|
* Angular {@link TrackByFunction} that tracks {@link ModelKeyRef} items by their `key` property.
|
|
12490
|
+
*
|
|
12491
|
+
* @param index - the item's index in the iterable
|
|
12492
|
+
* @param model - the model whose `key` is used as the tracking identity
|
|
12493
|
+
* @returns the model's `key` value
|
|
12293
12494
|
*/
|
|
12294
12495
|
const TRACK_BY_MODEL_KEY = (index, model) => model.key;
|
|
12295
12496
|
/**
|
|
@@ -12299,6 +12500,8 @@ const TRACK_BY_MODEL_KEY = (index, model) => model.key;
|
|
|
12299
12500
|
* ```ts
|
|
12300
12501
|
* readonly trackBy = trackByModelKeyRef<MyModelRef>();
|
|
12301
12502
|
* ```
|
|
12503
|
+
*
|
|
12504
|
+
* @returns a TrackByFunction that uses the item's `key` for identity tracking
|
|
12302
12505
|
*/
|
|
12303
12506
|
function trackByModelKeyRef() {
|
|
12304
12507
|
return TRACK_BY_MODEL_KEY;
|
|
@@ -12509,6 +12712,9 @@ class DbxListViewWrapper {
|
|
|
12509
12712
|
* })
|
|
12510
12713
|
* export class MyListWrapperComponent extends DbxListViewWrapper<MyItem> { ... }
|
|
12511
12714
|
* ```
|
|
12715
|
+
*
|
|
12716
|
+
* @param sourceType - the component class to register as the DbxListViewWrapper provider
|
|
12717
|
+
* @returns an array of Angular providers that wire up the component as a DbxListViewWrapper
|
|
12512
12718
|
*/
|
|
12513
12719
|
function provideDbxListViewWrapper(sourceType) {
|
|
12514
12720
|
return [
|
|
@@ -12908,6 +13114,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
12908
13114
|
* ```ts
|
|
12909
13115
|
* provideDbxStyleService({ dbxStyleConfig: { style: 'my-app', suffixes: new Set(['dark']) } });
|
|
12910
13116
|
* ```
|
|
13117
|
+
*
|
|
13118
|
+
* @param config - configuration specifying the default style and its allowed suffixes
|
|
13119
|
+
* @returns environment providers for the DbxStyleService and its default config token
|
|
12911
13120
|
*/
|
|
12912
13121
|
function provideDbxStyleService(config) {
|
|
12913
13122
|
const { dbxStyleConfig } = config;
|
|
@@ -13201,18 +13410,26 @@ class DbxLinkifyService {
|
|
|
13201
13410
|
// MARK: Get
|
|
13202
13411
|
/**
|
|
13203
13412
|
* Returns the default entry.
|
|
13413
|
+
*
|
|
13414
|
+
* @returns the default linkify service entry, or undefined if none is registered
|
|
13204
13415
|
*/
|
|
13205
13416
|
getDefaultEntry() {
|
|
13206
13417
|
return this._entries.get(DEFAULT_DBX_LINKIFY_STRING_TYPE);
|
|
13207
13418
|
}
|
|
13208
13419
|
/**
|
|
13209
13420
|
* Returns the entry for the given type.
|
|
13421
|
+
*
|
|
13422
|
+
* @param type - the linkify string type to look up
|
|
13423
|
+
* @returns the registered entry for the given type, or undefined if not found
|
|
13210
13424
|
*/
|
|
13211
13425
|
getEntryRegisteredForType(type) {
|
|
13212
13426
|
return this._entries.get(type);
|
|
13213
13427
|
}
|
|
13214
13428
|
/**
|
|
13215
13429
|
* Returns the entry for the given type, or the default type if there is no entry registered or the input type is null/undefined.
|
|
13430
|
+
*
|
|
13431
|
+
* @param type - the linkify string type to look up, or nullish to retrieve the default entry
|
|
13432
|
+
* @returns the matching entry, or the default entry if the type is not provided
|
|
13216
13433
|
*/
|
|
13217
13434
|
getEntry(type) {
|
|
13218
13435
|
return type ? this._entries.get(type) : this.getDefaultEntry();
|
|
@@ -13292,6 +13509,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
13292
13509
|
* })
|
|
13293
13510
|
* });
|
|
13294
13511
|
* ```
|
|
13512
|
+
*
|
|
13513
|
+
* @param config - configuration containing the factory function for creating the linkify service config
|
|
13514
|
+
* @returns environment providers that register the DbxLinkifyServiceConfig
|
|
13295
13515
|
*/
|
|
13296
13516
|
function provideDbxLinkify(config) {
|
|
13297
13517
|
const { dbxLinkifyServiceConfigFactory } = config;
|
|
@@ -13329,6 +13549,7 @@ class DbxChipDirective {
|
|
|
13329
13549
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxChipDirective, decorators: [{
|
|
13330
13550
|
type: Directive,
|
|
13331
13551
|
args: [{
|
|
13552
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
13332
13553
|
selector: 'dbx-chip',
|
|
13333
13554
|
host: {
|
|
13334
13555
|
class: 'dbx-chip mat-standard-chip',
|
|
@@ -13515,7 +13736,7 @@ class DbxClickToCopyTextDirective extends AbstractDbxClipboardDirective {
|
|
|
13515
13736
|
copyText = (element ?? eventElement)?.textContent ?? undefined;
|
|
13516
13737
|
}
|
|
13517
13738
|
if (copyText) {
|
|
13518
|
-
this._copyToClipboard(copyText);
|
|
13739
|
+
void this._copyToClipboard(copyText);
|
|
13519
13740
|
}
|
|
13520
13741
|
return copyText;
|
|
13521
13742
|
}
|
|
@@ -13609,19 +13830,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
13609
13830
|
|
|
13610
13831
|
class DbxLayoutModule {
|
|
13611
13832
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
13612
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: DbxLayoutModule, exports: [DbxBarLayoutModule, DbxCardBoxLayoutModule, DbxColumnLayoutModule,
|
|
13613
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxLayoutModule, imports: [DbxBarLayoutModule, DbxCardBoxLayoutModule, DbxColumnLayoutModule,
|
|
13833
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.0", ngImport: i0, type: DbxLayoutModule, imports: [DbxCompactDirective, DbxFlexGroupDirective, DbxFlexSizeDirective], exports: [DbxBarLayoutModule, DbxCardBoxLayoutModule, DbxColumnLayoutModule, DbxCompactDirective, DbxContentLayoutModule, DbxFlagLayoutModule, DbxFlexGroupDirective, DbxFlexSizeDirective, DbxSectionLayoutModule, DbxStyleLayoutModule, DbxTextModule] });
|
|
13834
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxLayoutModule, imports: [DbxBarLayoutModule, DbxCardBoxLayoutModule, DbxColumnLayoutModule, DbxContentLayoutModule, DbxFlagLayoutModule, DbxSectionLayoutModule, DbxStyleLayoutModule, DbxTextModule] });
|
|
13614
13835
|
}
|
|
13615
13836
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxLayoutModule, decorators: [{
|
|
13616
13837
|
type: NgModule,
|
|
13617
13838
|
args: [{
|
|
13618
|
-
|
|
13839
|
+
imports: [DbxCompactDirective, DbxFlexGroupDirective, DbxFlexSizeDirective],
|
|
13840
|
+
exports: [DbxBarLayoutModule, DbxCardBoxLayoutModule, DbxColumnLayoutModule, DbxCompactDirective, DbxContentLayoutModule, DbxFlagLayoutModule, DbxFlexGroupDirective, DbxFlexSizeDirective, DbxSectionLayoutModule, DbxStyleLayoutModule, DbxTextModule]
|
|
13619
13841
|
}]
|
|
13620
13842
|
}] });
|
|
13621
13843
|
|
|
13622
13844
|
/**
|
|
13623
13845
|
* Returns the appropriate Material icon name for a zip entry tree node: "folder" for directories, "note" for files with a known MIME type, or "question_mark" for unknown files.
|
|
13624
13846
|
*
|
|
13847
|
+
* @param entry - The zip entry tree node to determine the icon for
|
|
13848
|
+
* @returns The Material icon name: "folder", "note", or "question_mark"
|
|
13849
|
+
*
|
|
13625
13850
|
* @example
|
|
13626
13851
|
* ```typescript
|
|
13627
13852
|
* const icon = iconForDbxZipPreviewEntryWithSelection(treeNode); // 'folder', 'note', or 'question_mark'
|
|
@@ -13869,7 +14094,7 @@ class DbxZipBlobPreviewComponent {
|
|
|
13869
14094
|
return selectedNode?.value.value.directory ? undefined : selectedNode;
|
|
13870
14095
|
}, ...(ngDevMode ? [{ debugName: "selectedFileNodeSignal" }] : []));
|
|
13871
14096
|
selectedFileEntry$ = toObservable(this.selectedFileNodeSignal);
|
|
13872
|
-
selectedFileEntryBlob$ = this.selectedFileEntry$.pipe(switchMap((x) => (x
|
|
14097
|
+
selectedFileEntryBlob$ = this.selectedFileEntry$.pipe(switchMap((x) => (x?.value.getBlob ? x.value.getBlob() : of(undefined))), shareReplay(1));
|
|
13873
14098
|
selectedFileEntryBlobSignal = toSignal(this.selectedFileEntryBlob$);
|
|
13874
14099
|
context = cleanLoadingContext({ obs: this.allEntriesLoadingState$ });
|
|
13875
14100
|
makeEntryAnchor = (itemValue) => {
|
|
@@ -13990,6 +14215,9 @@ function openZipPreviewDialog(matDialog, config) {
|
|
|
13990
14215
|
// MARK: Zip
|
|
13991
14216
|
/**
|
|
13992
14217
|
* Preview component function preset that renders zip files using {@link DbxZipPreviewComponent}.
|
|
14218
|
+
*
|
|
14219
|
+
* @param input - The preview input containing the source URL and MIME type of the zip file
|
|
14220
|
+
* @returns An injection component config that initializes a {@link DbxZipPreviewComponent} with the given source URL
|
|
13993
14221
|
*/
|
|
13994
14222
|
const DBX_WEB_FILE_PREVIEW_SERVICE_ZIP_COMPONENT_PRESET = (input) => {
|
|
13995
14223
|
const { srcUrl } = input;
|
|
@@ -14096,8 +14324,9 @@ class DbxWidgetService {
|
|
|
14096
14324
|
/**
|
|
14097
14325
|
* Used to register an entry. If an entry with the same type is already registered, this will override it by default.
|
|
14098
14326
|
*
|
|
14099
|
-
* @param entry
|
|
14100
|
-
* @param override
|
|
14327
|
+
* @param entry - The widget entry mapping a type identifier to its component class
|
|
14328
|
+
* @param override - Whether to replace an existing entry with the same type. Defaults to true.
|
|
14329
|
+
* @returns True if the entry was registered, false if an entry with the same type already exists and override is false
|
|
14101
14330
|
*/
|
|
14102
14331
|
register(entry, override = true) {
|
|
14103
14332
|
if (override || !this._entries.has(entry.type)) {
|
|
@@ -14110,7 +14339,7 @@ class DbxWidgetService {
|
|
|
14110
14339
|
}
|
|
14111
14340
|
// MARK: Get
|
|
14112
14341
|
getWidgetIdentifiers() {
|
|
14113
|
-
return
|
|
14342
|
+
return [...this._entries.keys()];
|
|
14114
14343
|
}
|
|
14115
14344
|
getWidgetEntry(type) {
|
|
14116
14345
|
return this._entries.get(type);
|
|
@@ -14313,11 +14542,11 @@ class DbxHelpContextService {
|
|
|
14313
14542
|
/**
|
|
14314
14543
|
* Observable of all currently active help context strings.
|
|
14315
14544
|
*/
|
|
14316
|
-
activeHelpContextKeys$ = this._contextReferences.pipe(switchMap((allReferences) => combineLatest(
|
|
14545
|
+
activeHelpContextKeys$ = this._contextReferences.pipe(switchMap((allReferences) => combineLatest([...allReferences].map((ref) => ref.helpContextKeys$)).pipe(map((x) => x.flat()), defaultIfEmpty([]), map((x) => new Set(x)))), distinctUntilHasDifferentValues(), shareReplay(1));
|
|
14317
14546
|
/**
|
|
14318
14547
|
* Observable array of all currently active help context key strings.
|
|
14319
14548
|
*/
|
|
14320
|
-
activeHelpContextKeysArray$ = this.activeHelpContextKeys$.pipe(map((x) =>
|
|
14549
|
+
activeHelpContextKeysArray$ = this.activeHelpContextKeys$.pipe(map((x) => [...x]), shareReplay(1));
|
|
14321
14550
|
/**
|
|
14322
14551
|
* Registers a help context reference, adding its keys to the active set.
|
|
14323
14552
|
*
|
|
@@ -14354,6 +14583,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
14354
14583
|
* // In a component or directive constructor
|
|
14355
14584
|
* const destroy = registerHelpContextKeysWithDbxHelpContextService(of(['feature-help', 'general-help']));
|
|
14356
14585
|
* ```
|
|
14586
|
+
*
|
|
14587
|
+
* @param helpContextKeys - Observable or static array of help context keys to register with the service
|
|
14588
|
+
* @returns A destroy function that unregisters the help context keys when called
|
|
14357
14589
|
*/
|
|
14358
14590
|
function registerHelpContextKeysWithDbxHelpContextService(helpContextKeys) {
|
|
14359
14591
|
const helpContextService = inject(DbxHelpContextService);
|
|
@@ -14424,7 +14656,8 @@ class DbxHelpWidgetService {
|
|
|
14424
14656
|
_helpListFooterComponentConfig;
|
|
14425
14657
|
_defaultIcon;
|
|
14426
14658
|
_popoverHeaderComponentConfig;
|
|
14427
|
-
constructor(
|
|
14659
|
+
constructor() {
|
|
14660
|
+
const initialConfig = inject(DbxHelpWidgetServiceConfig, { optional: true });
|
|
14428
14661
|
this.setDefaultWidgetComponentClass(initialConfig?.defaultWidgetComponentClass);
|
|
14429
14662
|
this.setDefaultIcon(initialConfig?.defaultIcon);
|
|
14430
14663
|
this.setPopoverHeaderComponentConfig(initialConfig?.popoverHeaderComponentConfig);
|
|
@@ -14436,6 +14669,8 @@ class DbxHelpWidgetService {
|
|
|
14436
14669
|
}
|
|
14437
14670
|
/**
|
|
14438
14671
|
* Returns the component class used for unrecognized help context keys.
|
|
14672
|
+
*
|
|
14673
|
+
* @returns The default widget component class, or undefined if not set
|
|
14439
14674
|
*/
|
|
14440
14675
|
getDefaultWidgetComponentClass() {
|
|
14441
14676
|
return this._defaultWidgetComponentClass;
|
|
@@ -14445,6 +14680,8 @@ class DbxHelpWidgetService {
|
|
|
14445
14680
|
}
|
|
14446
14681
|
/**
|
|
14447
14682
|
* Returns the default icon used for help entries without a specific icon.
|
|
14683
|
+
*
|
|
14684
|
+
* @returns The default icon string, or undefined if not set
|
|
14448
14685
|
*/
|
|
14449
14686
|
getDefaultIcon() {
|
|
14450
14687
|
return this._defaultIcon;
|
|
@@ -14454,6 +14691,8 @@ class DbxHelpWidgetService {
|
|
|
14454
14691
|
}
|
|
14455
14692
|
/**
|
|
14456
14693
|
* Returns the component config displayed in the popover header, if set.
|
|
14694
|
+
*
|
|
14695
|
+
* @returns The popover header component config, or undefined if not set
|
|
14457
14696
|
*/
|
|
14458
14697
|
getPopoverHeaderComponentConfig() {
|
|
14459
14698
|
return this._popoverHeaderComponentConfig;
|
|
@@ -14463,6 +14702,8 @@ class DbxHelpWidgetService {
|
|
|
14463
14702
|
}
|
|
14464
14703
|
/**
|
|
14465
14704
|
* Returns the component config displayed at the top of the help list view, if set.
|
|
14705
|
+
*
|
|
14706
|
+
* @returns The help list header component config, or undefined if not set
|
|
14466
14707
|
*/
|
|
14467
14708
|
getHelpListHeaderComponentConfig() {
|
|
14468
14709
|
return this._helpListHeaderComponentConfig;
|
|
@@ -14472,6 +14713,8 @@ class DbxHelpWidgetService {
|
|
|
14472
14713
|
}
|
|
14473
14714
|
/**
|
|
14474
14715
|
* Returns the component config displayed at the bottom of the help list view, if set.
|
|
14716
|
+
*
|
|
14717
|
+
* @returns The help list footer component config, or undefined if not set
|
|
14475
14718
|
*/
|
|
14476
14719
|
getHelpListFooterComponentConfig() {
|
|
14477
14720
|
return this._helpListFooterComponentConfig;
|
|
@@ -14486,6 +14729,7 @@ class DbxHelpWidgetService {
|
|
|
14486
14729
|
*
|
|
14487
14730
|
* @param entries The entries to register
|
|
14488
14731
|
* @param override Whether to override existing entries (default: true)
|
|
14732
|
+
* @returns Always returns true after registration completes
|
|
14489
14733
|
*/
|
|
14490
14734
|
register(entries, override = true) {
|
|
14491
14735
|
const entriesArray = asArray(entries);
|
|
@@ -14499,14 +14743,17 @@ class DbxHelpWidgetService {
|
|
|
14499
14743
|
// MARK: Get
|
|
14500
14744
|
/**
|
|
14501
14745
|
* Returns all currently registered help context keys.
|
|
14746
|
+
*
|
|
14747
|
+
* @returns Array of all registered help context keys
|
|
14502
14748
|
*/
|
|
14503
14749
|
getAllRegisteredHelpContextKeys() {
|
|
14504
|
-
return
|
|
14750
|
+
return [...this._entries.keys()];
|
|
14505
14751
|
}
|
|
14506
14752
|
/**
|
|
14507
14753
|
* Retrieves the widget entry for a given help context key. Falls back to a default entry if a default widget component class is configured.
|
|
14508
14754
|
*
|
|
14509
14755
|
* @param helpContextKey - The help context key to look up
|
|
14756
|
+
* @returns The matching widget entry, a default entry if a default component class is configured, or undefined
|
|
14510
14757
|
*/
|
|
14511
14758
|
getHelpWidgetEntry(helpContextKey) {
|
|
14512
14759
|
return this._entries.get(helpContextKey) ?? (this._defaultWidgetComponentClass ? { helpContextKey, title: '<Missing Help Topic>', widgetComponentClass: this._defaultWidgetComponentClass } : undefined);
|
|
@@ -14515,33 +14762,34 @@ class DbxHelpWidgetService {
|
|
|
14515
14762
|
* Retrieves widget entries for multiple help context keys, filtering out any unresolvable keys.
|
|
14516
14763
|
*
|
|
14517
14764
|
* @param helpContextKeys - Array of help context keys to look up
|
|
14765
|
+
* @returns Array of resolved widget entries, excluding any keys that could not be resolved
|
|
14518
14766
|
*/
|
|
14519
14767
|
getHelpWidgetEntriesForHelpContextKeys(helpContextKeys) {
|
|
14520
14768
|
return helpContextKeys.map((context) => this.getHelpWidgetEntry(context)).filter((entry) => !!entry);
|
|
14521
14769
|
}
|
|
14522
14770
|
/**
|
|
14523
14771
|
* Checks whether a widget entry is registered for the given help context key.
|
|
14772
|
+
*
|
|
14773
|
+
* @param context - The help context key to check
|
|
14774
|
+
* @returns True if a widget entry exists for the given key
|
|
14524
14775
|
*/
|
|
14525
14776
|
hasHelpWidgetEntry(context) {
|
|
14526
14777
|
return this._entries.has(context);
|
|
14527
14778
|
}
|
|
14528
14779
|
/**
|
|
14529
14780
|
* Returns a cached map of help context keys to their sort priority values.
|
|
14781
|
+
*
|
|
14782
|
+
* @returns Map of help context keys to their numeric sort priorities
|
|
14530
14783
|
*/
|
|
14531
14784
|
getSortPriorityMap() {
|
|
14532
14785
|
return this._sortPriorityMap();
|
|
14533
14786
|
}
|
|
14534
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxHelpWidgetService, deps: [
|
|
14787
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxHelpWidgetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
14535
14788
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxHelpWidgetService });
|
|
14536
14789
|
}
|
|
14537
14790
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: DbxHelpWidgetService, decorators: [{
|
|
14538
14791
|
type: Injectable
|
|
14539
|
-
}], ctorParameters: () => [
|
|
14540
|
-
type: Optional
|
|
14541
|
-
}, {
|
|
14542
|
-
type: Inject,
|
|
14543
|
-
args: [DbxHelpWidgetServiceConfig]
|
|
14544
|
-
}] }] });
|
|
14792
|
+
}], ctorParameters: () => [] });
|
|
14545
14793
|
|
|
14546
14794
|
/**
|
|
14547
14795
|
* Creates EnvironmentProviders for the help context system.
|
|
@@ -14684,8 +14932,7 @@ class DbxHelpViewListComponent {
|
|
|
14684
14932
|
helpContextKeys = input.required(...(ngDevMode ? [{ debugName: "helpContextKeys" }] : []));
|
|
14685
14933
|
helpContextKeys$ = toObservable(this.helpContextKeys).pipe(switchMap((x) => asObservable(x) ?? of([])), map(asArray), distinctUntilHasDifferentValues(), map((x) => {
|
|
14686
14934
|
const sortPriorityMap = this.helpWidgetService.getSortPriorityMap();
|
|
14687
|
-
|
|
14688
|
-
return sorted;
|
|
14935
|
+
return [...x].sort(sortByNumberFunction((x) => sortPriorityMap.get(x) ?? -2));
|
|
14689
14936
|
}), shareReplay(1));
|
|
14690
14937
|
helpContextKeysSignal = toSignal(this.helpContextKeys$, { initialValue: [] });
|
|
14691
14938
|
helpWidgetEntriesSignal = computed(() => this.helpWidgetService.getHelpWidgetEntriesForHelpContextKeys(this.helpContextKeysSignal()), ...(ngDevMode ? [{ debugName: "helpWidgetEntriesSignal" }] : []));
|
|
@@ -14914,7 +15161,9 @@ function disableRightClickInCdkBackdrop(classes = 'cdk-overlay-container', onEve
|
|
|
14914
15161
|
return () => target.removeEventListener('contextmenu', eventListener);
|
|
14915
15162
|
}
|
|
14916
15163
|
else {
|
|
14917
|
-
return () => {
|
|
15164
|
+
return () => {
|
|
15165
|
+
/* noop */
|
|
15166
|
+
};
|
|
14918
15167
|
}
|
|
14919
15168
|
}
|
|
14920
15169
|
|