@acorex-platform/framework-client 0.0.10 → 0.0.15
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/acorex-platform-framework-client-auth.mjs +285 -50
- package/fesm2022/acorex-platform-framework-client-auth.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-common-common-settings.provider-CbzOYCnI.mjs → acorex-platform-framework-client-common-common-settings.provider-Euotv9l0.mjs} +55 -36
- package/fesm2022/acorex-platform-framework-client-common-common-settings.provider-Euotv9l0.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-common-settings-dialog.helper-DQNOCRL6.mjs +29 -0
- package/fesm2022/acorex-platform-framework-client-common-settings-dialog.helper-DQNOCRL6.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-common.mjs +1576 -408
- package/fesm2022/acorex-platform-framework-client-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-core.mjs +561 -25
- package/fesm2022/acorex-platform-framework-client-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-builder.mjs +154 -42
- package/fesm2022/acorex-platform-framework-client-layout-builder.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-CWVU3wXL.mjs → acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-CjnQ9hAJ.mjs} +7 -7
- package/fesm2022/acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-CjnQ9hAJ.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-fFen8w8M.mjs +77 -0
- package/fesm2022/acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-fFen8w8M.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-layout-components.mjs +2378 -1274
- package/fesm2022/acorex-platform-framework-client-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-designer.mjs +92 -84
- package/fesm2022/acorex-platform-framework-client-layout-designer.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-entity-attachments-page.component-CxBxxpmA.mjs → acorex-platform-framework-client-layout-entity-attachments-page.component-BzUM-JMC.mjs} +3 -3
- package/fesm2022/{acorex-platform-framework-client-layout-entity-attachments-page.component-CxBxxpmA.mjs.map → acorex-platform-framework-client-layout-entity-attachments-page.component-BzUM-JMC.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-entity-file-list-popup.component-l0JAHKIH.mjs → acorex-platform-framework-client-layout-entity-file-list-popup.component-Ci_CTFtq.mjs} +6 -6
- package/fesm2022/acorex-platform-framework-client-layout-entity-file-list-popup.component-Ci_CTFtq.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity-gallery-page.component-DmiB__JR.mjs +256 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity-gallery-page.component-DmiB__JR.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity.mjs +17599 -17114
- package/fesm2022/acorex-platform-framework-client-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-views.mjs +120 -70
- package/fesm2022/acorex-platform-framework-client-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-widget-core.mjs +302 -263
- package/fesm2022/acorex-platform-framework-client-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-button-widget-designer.component-CpkWwygb.mjs → acorex-platform-framework-client-layout-widgets-button-widget-designer.component-CIwpAXbL.mjs} +2 -2
- package/fesm2022/acorex-platform-framework-client-layout-widgets-button-widget-designer.component-CIwpAXbL.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-image-preview.popup-C_EPAvCU.mjs → acorex-platform-framework-client-layout-widgets-image-preview.popup-CazpERbX.mjs} +3 -3
- package/fesm2022/acorex-platform-framework-client-layout-widgets-image-preview.popup-CazpERbX.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-page-widget-designer.component-CmtTq2Mt.mjs → acorex-platform-framework-client-layout-widgets-page-widget-designer.component-DKkJi40s.mjs} +5 -5
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-page-widget-designer.component-CmtTq2Mt.mjs.map → acorex-platform-framework-client-layout-widgets-page-widget-designer.component-DKkJi40s.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DSx0E3NV.mjs → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DtYZfA79.mjs} +3 -3
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DSx0E3NV.mjs.map → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DtYZfA79.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-DdfcGV1C.mjs → acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-nMUtxAyy.mjs} +10 -10
- package/fesm2022/acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-nMUtxAyy.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-CntopmDS.mjs → acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-DvUSZ4hJ.mjs} +5 -5
- package/fesm2022/acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-DvUSZ4hJ.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-BihIfkZW.mjs +61 -0
- package/fesm2022/acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-BihIfkZW.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs +2218 -1504
- package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-realtime.mjs +227 -0
- package/fesm2022/acorex-platform-framework-client-realtime.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-runtime.mjs +201 -13
- package/fesm2022/acorex-platform-framework-client-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-create-view.component-QIFX11dh.mjs +158 -0
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-create-view.component-QIFX11dh.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BBdellyL.mjs +119 -0
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BBdellyL.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-single-view.component-D1a7UI71.mjs → acorex-platform-framework-client-themes-default-entity-master-single-view.component-CIf1VWNW.mjs} +5 -6
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-single-view.component-CIf1VWNW.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-themes-default-error-401.component-C_czT_JC.mjs +48 -0
- package/fesm2022/acorex-platform-framework-client-themes-default-error-401.component-C_czT_JC.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-themes-default-error-404.component-C2Wu0YtF.mjs +42 -0
- package/fesm2022/acorex-platform-framework-client-themes-default-error-404.component-C2Wu0YtF.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-DRz-kVsT.mjs +19 -0
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-DRz-kVsT.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-themes-default.mjs +123 -96
- package/fesm2022/acorex-platform-framework-client-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-shared-icon-chooser-column.component-CXSGiTCK.mjs → acorex-platform-framework-client-themes-shared-icon-chooser-column.component-Ci_oH7NE.mjs} +3 -3
- package/fesm2022/acorex-platform-framework-client-themes-shared-icon-chooser-column.component-Ci_oH7NE.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-themes-shared-icon-chooser-view.component-BY5clQ1J.mjs → acorex-platform-framework-client-themes-shared-icon-chooser-view.component-Lb1G2Xz7.mjs} +3 -3
- package/fesm2022/acorex-platform-framework-client-themes-shared-icon-chooser-view.component-Lb1G2Xz7.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-themes-shared-settings.provider-DEL2YOTP.mjs → acorex-platform-framework-client-themes-shared-settings.provider-D2XPkc71.mjs} +11 -2
- package/fesm2022/acorex-platform-framework-client-themes-shared-settings.provider-D2XPkc71.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-BXl8u4Yp.mjs → acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-D4ubvFYf.mjs} +7 -7
- package/fesm2022/acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-D4ubvFYf.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-i2sOOkVj.mjs → acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-Br8j_BF_.mjs} +7 -7
- package/fesm2022/acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-Br8j_BF_.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-themes-shared.mjs +124 -112
- package/fesm2022/acorex-platform-framework-client-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-workflow.mjs +26 -483
- package/fesm2022/acorex-platform-framework-client-workflow.mjs.map +1 -1
- package/package.json +14 -9
- package/types/acorex-platform-framework-client-auth.d.ts +76 -5
- package/types/acorex-platform-framework-client-common.d.ts +499 -129
- package/types/acorex-platform-framework-client-core.d.ts +291 -10
- package/types/acorex-platform-framework-client-layout-builder.d.ts +81 -31
- package/types/acorex-platform-framework-client-layout-components.d.ts +295 -41
- package/types/acorex-platform-framework-client-layout-entity.d.ts +1895 -1743
- package/types/acorex-platform-framework-client-layout-views.d.ts +8 -18
- package/types/acorex-platform-framework-client-layout-widget-core.d.ts +20 -35
- package/types/acorex-platform-framework-client-layout-widgets.d.ts +167 -33
- package/types/acorex-platform-framework-client-realtime.d.ts +100 -0
- package/types/acorex-platform-framework-client-runtime.d.ts +60 -2
- package/types/acorex-platform-framework-client-themes-default.d.ts +4 -48
- package/types/acorex-platform-framework-client-workflow.d.ts +16 -127
- package/fesm2022/acorex-platform-framework-client-common-common-settings.provider-CbzOYCnI.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-CWVU3wXL.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity-file-list-popup.component-l0JAHKIH.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets-button-widget-designer.component-CpkWwygb.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-DdfcGV1C.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-CntopmDS.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-B5kSWxGk.mjs +0 -34
- package/fesm2022/acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-B5kSWxGk.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-create-view.component-DnTHwsDJ.mjs +0 -160
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-create-view.component-DnTHwsDJ.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BpR9g6QS.mjs +0 -121
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BpR9g6QS.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-single-view.component-D1a7UI71.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-error-401.component-D--_MIar.mjs +0 -48
- package/fesm2022/acorex-platform-framework-client-themes-default-error-401.component-D--_MIar.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-error-404.component-Byyqk8pH.mjs +0 -42
- package/fesm2022/acorex-platform-framework-client-themes-default-error-404.component-Byyqk8pH.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-DR6G8gPC.mjs +0 -19
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-DR6G8gPC.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-shared-icon-chooser-column.component-CXSGiTCK.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-shared-icon-chooser-view.component-BY5clQ1J.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-shared-settings.provider-DEL2YOTP.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-BXl8u4Yp.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-i2sOOkVj.mjs.map +0 -1
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, Injectable, Directive, computed, Injector, ChangeDetectionStrategy, Component, input, ElementRef, ViewContainerRef, signal, effect, runInInjectionContext, Optional, Inject, NgModule, EventEmitter, HostListener, Output, DestroyRef, untracked, provideAppInitializer, Pipe } from '@angular/core';
|
|
3
3
|
import { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';
|
|
4
|
-
import { AXDataSource } from '@acorex/cdk/common';
|
|
4
|
+
import { AXDataSource, convertArrayToDataSource } from '@acorex/cdk/common';
|
|
5
5
|
import { AXPPlatformCoreDataSourceKeys, isFormContextDirty, getSmart, isSelectionValueEqual, isFormValueEqual, setSmart, extractValue, AXPKeyboardShortcutPriority, getSystemActions, isLocaleStringMap } from '@acorex-platform/framework-shared/core';
|
|
6
|
-
import { cloneDeep, isEmpty, isEqual, has, unset, isPlainObject, get, sortBy, set,
|
|
6
|
+
import { cloneDeep, isEmpty, isEqual, has, unset, isPlainObject, get, sortBy, set, isNil, castArray, isString, isUndefined, endsWith, startsWith, includes, lte, gte, lt, gt, orderBy } from 'lodash-es';
|
|
7
7
|
import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
|
|
8
8
|
import { AXFormatService } from '@acorex/core/format';
|
|
9
9
|
import * as i1 from '@acorex/components/skeleton';
|
|
10
10
|
import { AXSkeletonModule } from '@acorex/components/skeleton';
|
|
11
|
-
import { Subject, interval, fromEvent } from 'rxjs';
|
|
11
|
+
import { filter, take, ReplaySubject, Subject, interval, fromEvent } from 'rxjs';
|
|
12
12
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
13
|
-
import
|
|
13
|
+
import * as i1$1 from '@angular/common';
|
|
14
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
14
15
|
import { AXLocaleService } from '@acorex/core/locale';
|
|
16
|
+
import * as i3 from '@acorex/components/decorators';
|
|
17
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
18
|
+
import * as i2 from '@acorex/components/image';
|
|
19
|
+
import { AXImageModule } from '@acorex/components/image';
|
|
15
20
|
import { delay } from '@acorex/core/utils';
|
|
16
21
|
import { AXCalendarService } from '@acorex/core/date-time';
|
|
17
22
|
import { startWith, map, debounceTime } from 'rxjs/operators';
|
|
@@ -1208,7 +1213,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1208
1213
|
class AXPComponentSlotPlaceholderComponent {
|
|
1209
1214
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPComponentSlotPlaceholderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1210
1215
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: AXPComponentSlotPlaceholderComponent, isStandalone: true, selector: "axp-component-slot-placeholder", ngImport: i0, template: `<div>
|
|
1211
|
-
<ax-skeleton class="
|
|
1216
|
+
<ax-skeleton class="w-full h-10 rounded-md"></ax-skeleton>
|
|
1212
1217
|
</div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i1.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1213
1218
|
}
|
|
1214
1219
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPComponentSlotPlaceholderComponent, decorators: [{
|
|
@@ -1216,7 +1221,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1216
1221
|
args: [{
|
|
1217
1222
|
selector: 'axp-component-slot-placeholder',
|
|
1218
1223
|
template: `<div>
|
|
1219
|
-
<ax-skeleton class="
|
|
1224
|
+
<ax-skeleton class="w-full h-10 rounded-md"></ax-skeleton>
|
|
1220
1225
|
</div>`,
|
|
1221
1226
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1222
1227
|
imports: [AXSkeletonModule],
|
|
@@ -1814,6 +1819,246 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1814
1819
|
args: [{ providedIn: 'root' }]
|
|
1815
1820
|
}] });
|
|
1816
1821
|
|
|
1822
|
+
//#region ---- Imports ----
|
|
1823
|
+
//#endregion
|
|
1824
|
+
/**
|
|
1825
|
+
* Resolves registry-backed {@link AXDataSource} instances and exposes readiness (`isReady`, `whenReady`)
|
|
1826
|
+
* so widgets do not bind selected values before the provider datasource is available.
|
|
1827
|
+
*/
|
|
1828
|
+
class AXPDataSourceQueryService {
|
|
1829
|
+
constructor() {
|
|
1830
|
+
//#region ---- Services & State ----
|
|
1831
|
+
this.definitionService = inject(AXPDataSourceDefinitionProviderService);
|
|
1832
|
+
this.entries = new Map();
|
|
1833
|
+
}
|
|
1834
|
+
//#endregion
|
|
1835
|
+
//#region ---- Public API ----
|
|
1836
|
+
/**
|
|
1837
|
+
* Returns true when the named registry datasource has been resolved for the given options.
|
|
1838
|
+
*/
|
|
1839
|
+
isReady(name, options) {
|
|
1840
|
+
const entry = this.entries.get(this.buildCacheKey(name, options));
|
|
1841
|
+
return entry?.result?.ready === true && entry.result.dataSource != null;
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* Emits once when the registry datasource is resolved (or fails) for the given options.
|
|
1845
|
+
*/
|
|
1846
|
+
whenReady(name, options) {
|
|
1847
|
+
return this.ensureLoading(name, options).readySubject.asObservable().pipe(filter((result) => result.ready), take(1));
|
|
1848
|
+
}
|
|
1849
|
+
/**
|
|
1850
|
+
* Resolves and returns the {@link AXDataSource} for a registry name, waiting for providers when needed.
|
|
1851
|
+
*/
|
|
1852
|
+
async getDataSource(name, options) {
|
|
1853
|
+
const result = await this.resolve(name, options);
|
|
1854
|
+
return result.dataSource;
|
|
1855
|
+
}
|
|
1856
|
+
/**
|
|
1857
|
+
* Resolves the registry datasource, then looks up one or more keys via `byKey`.
|
|
1858
|
+
*/
|
|
1859
|
+
async queryByKey(name, key, options) {
|
|
1860
|
+
if (isNil(key)) {
|
|
1861
|
+
return null;
|
|
1862
|
+
}
|
|
1863
|
+
const result = await this.resolve(name, options);
|
|
1864
|
+
const dataSource = result.dataSource;
|
|
1865
|
+
if (!dataSource?.config?.byKey) {
|
|
1866
|
+
return null;
|
|
1867
|
+
}
|
|
1868
|
+
if (Array.isArray(key)) {
|
|
1869
|
+
const items = await Promise.all(key.map((k) => dataSource.config.byKey(k)));
|
|
1870
|
+
return items.filter((item) => item != null);
|
|
1871
|
+
}
|
|
1872
|
+
return (await dataSource.config.byKey(key)) ?? null;
|
|
1873
|
+
}
|
|
1874
|
+
/**
|
|
1875
|
+
* Fully resolves a registry datasource (definition + AXDataSource instance).
|
|
1876
|
+
*/
|
|
1877
|
+
async resolve(name, options) {
|
|
1878
|
+
const entry = this.ensureLoading(name, options);
|
|
1879
|
+
if (entry.result?.ready) {
|
|
1880
|
+
return entry.result;
|
|
1881
|
+
}
|
|
1882
|
+
return entry.loadPromise;
|
|
1883
|
+
}
|
|
1884
|
+
/**
|
|
1885
|
+
* Clears cached query state. Pass a registry name to invalidate one datasource, or omit to clear all.
|
|
1886
|
+
*/
|
|
1887
|
+
invalidate(name) {
|
|
1888
|
+
if (!name) {
|
|
1889
|
+
this.entries.clear();
|
|
1890
|
+
return;
|
|
1891
|
+
}
|
|
1892
|
+
const prefix = `${name}::`;
|
|
1893
|
+
for (const key of [...this.entries.keys()]) {
|
|
1894
|
+
if (key === name || key.startsWith(prefix)) {
|
|
1895
|
+
this.entries.delete(key);
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
//#endregion
|
|
1900
|
+
//#region ---- Loading ----
|
|
1901
|
+
ensureLoading(name, options) {
|
|
1902
|
+
const cacheKey = this.buildCacheKey(name, options);
|
|
1903
|
+
let entry = this.entries.get(cacheKey);
|
|
1904
|
+
if (!entry) {
|
|
1905
|
+
entry = {
|
|
1906
|
+
name,
|
|
1907
|
+
cacheKey,
|
|
1908
|
+
readySubject: new ReplaySubject(1),
|
|
1909
|
+
};
|
|
1910
|
+
this.entries.set(cacheKey, entry);
|
|
1911
|
+
entry.loadPromise = this.loadEntry(entry, name, options);
|
|
1912
|
+
}
|
|
1913
|
+
return entry;
|
|
1914
|
+
}
|
|
1915
|
+
async loadEntry(entry, name, options) {
|
|
1916
|
+
const pending = {
|
|
1917
|
+
name,
|
|
1918
|
+
ready: false,
|
|
1919
|
+
dataSource: null,
|
|
1920
|
+
valueField: options?.valueField ?? 'id',
|
|
1921
|
+
textField: 'title',
|
|
1922
|
+
};
|
|
1923
|
+
try {
|
|
1924
|
+
const definition = await this.waitForDefinition(name, options);
|
|
1925
|
+
if (!definition) {
|
|
1926
|
+
const failed = {
|
|
1927
|
+
...pending,
|
|
1928
|
+
ready: true,
|
|
1929
|
+
error: new Error(`Data source '${name}' was not found in the registry`),
|
|
1930
|
+
};
|
|
1931
|
+
entry.result = failed;
|
|
1932
|
+
entry.readySubject.next(failed);
|
|
1933
|
+
return failed;
|
|
1934
|
+
}
|
|
1935
|
+
const valueField = options?.valueField ?? definition.valueField?.name ?? 'id';
|
|
1936
|
+
const textField = definition.textField?.name ?? 'title';
|
|
1937
|
+
const dataSource = await this.createDataSource(definition, {
|
|
1938
|
+
...options,
|
|
1939
|
+
valueField,
|
|
1940
|
+
});
|
|
1941
|
+
const translated = dataSource ? this.wrapTranslatedDataSource(dataSource, textField) : null;
|
|
1942
|
+
const success = {
|
|
1943
|
+
name,
|
|
1944
|
+
ready: true,
|
|
1945
|
+
dataSource: translated,
|
|
1946
|
+
definition,
|
|
1947
|
+
valueField,
|
|
1948
|
+
textField,
|
|
1949
|
+
};
|
|
1950
|
+
entry.result = success;
|
|
1951
|
+
entry.readySubject.next(success);
|
|
1952
|
+
return success;
|
|
1953
|
+
}
|
|
1954
|
+
catch (error) {
|
|
1955
|
+
const failed = {
|
|
1956
|
+
...pending,
|
|
1957
|
+
ready: true,
|
|
1958
|
+
error,
|
|
1959
|
+
};
|
|
1960
|
+
entry.result = failed;
|
|
1961
|
+
entry.readySubject.next(failed);
|
|
1962
|
+
return failed;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
async waitForDefinition(name, options) {
|
|
1966
|
+
const waitForRegistry = options?.waitForRegistry ?? true;
|
|
1967
|
+
const maxAttempts = options?.maxRegistryAttempts ?? 20;
|
|
1968
|
+
const retryDelayMs = options?.registryRetryDelayMs ?? 50;
|
|
1969
|
+
const attempts = waitForRegistry ? maxAttempts : 1;
|
|
1970
|
+
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
1971
|
+
const definition = await this.definitionService.get(name);
|
|
1972
|
+
if (definition) {
|
|
1973
|
+
return definition;
|
|
1974
|
+
}
|
|
1975
|
+
if (attempt < attempts - 1) {
|
|
1976
|
+
await this.sleep(retryDelayMs);
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
return undefined;
|
|
1980
|
+
}
|
|
1981
|
+
async createDataSource(definition, options) {
|
|
1982
|
+
if (options.useSamples && definition.samples) {
|
|
1983
|
+
const samples = await this.resolveSamples(definition.samples);
|
|
1984
|
+
return convertArrayToDataSource(samples, {
|
|
1985
|
+
key: options.valueField,
|
|
1986
|
+
pageSize: 500,
|
|
1987
|
+
});
|
|
1988
|
+
}
|
|
1989
|
+
const sourceResult = definition.source();
|
|
1990
|
+
const resolved = await Promise.resolve(sourceResult);
|
|
1991
|
+
if (resolved instanceof AXDataSource) {
|
|
1992
|
+
this.applyValueFieldAsKey(resolved, options.valueField);
|
|
1993
|
+
return resolved;
|
|
1994
|
+
}
|
|
1995
|
+
if (Array.isArray(resolved)) {
|
|
1996
|
+
return convertArrayToDataSource(resolved, {
|
|
1997
|
+
key: options.valueField,
|
|
1998
|
+
pageSize: 500,
|
|
1999
|
+
});
|
|
2000
|
+
}
|
|
2001
|
+
return null;
|
|
2002
|
+
}
|
|
2003
|
+
async resolveSamples(samples) {
|
|
2004
|
+
return castArray(await Promise.resolve(samples));
|
|
2005
|
+
}
|
|
2006
|
+
applyValueFieldAsKey(dataSource, valueField) {
|
|
2007
|
+
if (dataSource.config?.key !== valueField) {
|
|
2008
|
+
dataSource.config = { ...dataSource.config, key: valueField };
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
wrapTranslatedDataSource(dataSource, textField) {
|
|
2012
|
+
const config = dataSource.config;
|
|
2013
|
+
if (!config) {
|
|
2014
|
+
return dataSource;
|
|
2015
|
+
}
|
|
2016
|
+
const originalByKey = config.byKey;
|
|
2017
|
+
const originalLoad = config.load;
|
|
2018
|
+
if (originalByKey) {
|
|
2019
|
+
config.byKey = async (key) => this.translateItem(await originalByKey(key), textField);
|
|
2020
|
+
}
|
|
2021
|
+
if (originalLoad) {
|
|
2022
|
+
config.load = async (event) => {
|
|
2023
|
+
const result = await originalLoad(event);
|
|
2024
|
+
if (!result?.items?.length) {
|
|
2025
|
+
return result;
|
|
2026
|
+
}
|
|
2027
|
+
return {
|
|
2028
|
+
...result,
|
|
2029
|
+
items: result.items.map((item) => this.translateItem(item, textField)),
|
|
2030
|
+
};
|
|
2031
|
+
};
|
|
2032
|
+
}
|
|
2033
|
+
return dataSource;
|
|
2034
|
+
}
|
|
2035
|
+
translateItem(item, textField) {
|
|
2036
|
+
if (item == null || typeof item !== 'object') {
|
|
2037
|
+
return item;
|
|
2038
|
+
}
|
|
2039
|
+
const title = get(item, textField);
|
|
2040
|
+
// Keep i18n keys for UI widgets (ax-select-box translate pipe) so labels react to locale changes.
|
|
2041
|
+
if (isString(title) && title.startsWith('@')) {
|
|
2042
|
+
return item;
|
|
2043
|
+
}
|
|
2044
|
+
return item;
|
|
2045
|
+
}
|
|
2046
|
+
buildCacheKey(name, options) {
|
|
2047
|
+
const valueField = options?.valueField ?? '';
|
|
2048
|
+
const useSamples = options?.useSamples ? '1' : '0';
|
|
2049
|
+
return `${name}::${valueField}::${useSamples}`;
|
|
2050
|
+
}
|
|
2051
|
+
sleep(ms) {
|
|
2052
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
2053
|
+
}
|
|
2054
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPDataSourceQueryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2055
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPDataSourceQueryService, providedIn: 'root' }); }
|
|
2056
|
+
}
|
|
2057
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPDataSourceQueryService, decorators: [{
|
|
2058
|
+
type: Injectable,
|
|
2059
|
+
args: [{ providedIn: 'root' }]
|
|
2060
|
+
}] });
|
|
2061
|
+
|
|
1817
2062
|
// src/app/directives/grid-layout.directive.ts
|
|
1818
2063
|
class AXPContentCheckerDirective {
|
|
1819
2064
|
constructor() {
|
|
@@ -1939,13 +2184,13 @@ class AXPGridLayoutDirective {
|
|
|
1939
2184
|
setClasses(placement, prefix) {
|
|
1940
2185
|
if (placement == null)
|
|
1941
2186
|
return;
|
|
1942
|
-
const colStart = placement.colStart ? `${prefix}
|
|
1943
|
-
const colEnd = placement.colEnd ? `${prefix}
|
|
1944
|
-
const colSpan = placement.colSpan ? `${prefix}
|
|
1945
|
-
const rowStart = placement.rowStart ? `${prefix}
|
|
1946
|
-
const rowEnd = placement.rowEnd ? `${prefix}
|
|
1947
|
-
const rowSpan = placement.rowSpan ? `${prefix}
|
|
1948
|
-
const order = placement.order ? `${prefix}
|
|
2187
|
+
const colStart = placement.colStart ? `${prefix}col-start-${placement.colStart}` : '';
|
|
2188
|
+
const colEnd = placement.colEnd ? `${prefix}col-end-${placement.colEnd}` : '';
|
|
2189
|
+
const colSpan = placement.colSpan ? `${prefix}col-span-${placement.colSpan}` : '';
|
|
2190
|
+
const rowStart = placement.rowStart ? `${prefix}row-start-${placement.rowStart}` : '';
|
|
2191
|
+
const rowEnd = placement.rowEnd ? `${prefix}row-end-${placement.rowEnd}` : '';
|
|
2192
|
+
const rowSpan = placement.rowSpan ? `${prefix}row-span-${placement.rowSpan}` : '';
|
|
2193
|
+
const order = placement.order ? `${prefix}order-${placement.order}` : ''; // Handling order
|
|
1949
2194
|
[colStart, colEnd, colSpan, rowStart, rowEnd, rowSpan, order].forEach(cls => {
|
|
1950
2195
|
if (cls) {
|
|
1951
2196
|
this.renderer.addClass(this.el.nativeElement, cls);
|
|
@@ -1955,7 +2200,7 @@ class AXPGridLayoutDirective {
|
|
|
1955
2200
|
clearClasses() {
|
|
1956
2201
|
const currentClasses = this.el.nativeElement.className.split(' ');
|
|
1957
2202
|
currentClasses.forEach((className) => {
|
|
1958
|
-
if (className.startsWith('
|
|
2203
|
+
if (className.startsWith('col-') || className.startsWith('row-') || className.startsWith('order-')) {
|
|
1959
2204
|
this.renderer.removeClass(this.el.nativeElement, className);
|
|
1960
2205
|
}
|
|
1961
2206
|
});
|
|
@@ -3252,6 +3497,261 @@ function setupPopupFooterKeyboardShortcuts(getActions, config) {
|
|
|
3252
3497
|
}
|
|
3253
3498
|
//#endregion
|
|
3254
3499
|
|
|
3500
|
+
//#endregion
|
|
3501
|
+
|
|
3502
|
+
const AXP_LOGO_PROVIDER = new InjectionToken('AXP_LOGO_PROVIDER', {
|
|
3503
|
+
providedIn: 'root',
|
|
3504
|
+
factory: () => [],
|
|
3505
|
+
});
|
|
3506
|
+
|
|
3507
|
+
const AXP_LOGO_THEME_RESOLVER = new InjectionToken('AXP_LOGO_THEME_RESOLVER');
|
|
3508
|
+
|
|
3509
|
+
//#region ---- Logo registry keys ----
|
|
3510
|
+
const AXP_PLATFORM_LOGO_KEY = 'platform';
|
|
3511
|
+
function axpSsoLogoKey(idpId) {
|
|
3512
|
+
return `sso:${idpId}`;
|
|
3513
|
+
}
|
|
3514
|
+
function axpTenantLogoKey(tenantId) {
|
|
3515
|
+
return `tenant:${tenantId}`;
|
|
3516
|
+
}
|
|
3517
|
+
function axpApplicationLogoKey(applicationId) {
|
|
3518
|
+
return `application:${applicationId}`;
|
|
3519
|
+
}
|
|
3520
|
+
//#endregion
|
|
3521
|
+
|
|
3522
|
+
//#region ---- Logo registry ----
|
|
3523
|
+
class AXPLogoRegistryService {
|
|
3524
|
+
constructor() {
|
|
3525
|
+
this.providers = new Map();
|
|
3526
|
+
this.componentCache = new Map();
|
|
3527
|
+
this.revision = signal(0, ...(ngDevMode ? [{ debugName: "revision" }] : /* istanbul ignore next */ []));
|
|
3528
|
+
/** Bumps when a provider is registered or replaced. */
|
|
3529
|
+
this.registryRevision = this.revision.asReadonly();
|
|
3530
|
+
const injected = inject(AXP_LOGO_PROVIDER, { optional: true }) ?? [];
|
|
3531
|
+
for (const provider of injected) {
|
|
3532
|
+
this.register(provider);
|
|
3533
|
+
}
|
|
3534
|
+
}
|
|
3535
|
+
register(provider) {
|
|
3536
|
+
this.providers.set(provider.key, provider);
|
|
3537
|
+
this.revision.update((value) => value + 1);
|
|
3538
|
+
}
|
|
3539
|
+
has(key) {
|
|
3540
|
+
return this.providers.has(key);
|
|
3541
|
+
}
|
|
3542
|
+
async resolve(key, request) {
|
|
3543
|
+
const provider = this.providers.get(key);
|
|
3544
|
+
if (!provider) {
|
|
3545
|
+
return { kind: 'icon', icon: 'fa-solid fa-image', color: 'neutral-400' };
|
|
3546
|
+
}
|
|
3547
|
+
const view = await provider.resolve(request);
|
|
3548
|
+
return this.toResolvedView(key, view);
|
|
3549
|
+
}
|
|
3550
|
+
async toResolvedView(key, view) {
|
|
3551
|
+
if (view.kind !== 'component') {
|
|
3552
|
+
return view;
|
|
3553
|
+
}
|
|
3554
|
+
let component = this.componentCache.get(key);
|
|
3555
|
+
if (!component) {
|
|
3556
|
+
component = await view.load();
|
|
3557
|
+
this.componentCache.set(key, component);
|
|
3558
|
+
}
|
|
3559
|
+
return {
|
|
3560
|
+
kind: 'component',
|
|
3561
|
+
component,
|
|
3562
|
+
inputs: view.inputs,
|
|
3563
|
+
};
|
|
3564
|
+
}
|
|
3565
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLogoRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3566
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLogoRegistryService, providedIn: 'root' }); }
|
|
3567
|
+
}
|
|
3568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLogoRegistryService, decorators: [{
|
|
3569
|
+
type: Injectable,
|
|
3570
|
+
args: [{ providedIn: 'root' }]
|
|
3571
|
+
}], ctorParameters: () => [] });
|
|
3572
|
+
|
|
3573
|
+
const AXP_ENTITY_LOGO_FALLBACK_RESOLVER = new InjectionToken('AXP_ENTITY_LOGO_FALLBACK_RESOLVER');
|
|
3574
|
+
//#endregion
|
|
3575
|
+
|
|
3576
|
+
class AXPEntityLogoRegistrationService {
|
|
3577
|
+
constructor() {
|
|
3578
|
+
this.registry = inject(AXPLogoRegistryService);
|
|
3579
|
+
this.fallbackResolver = inject(AXP_ENTITY_LOGO_FALLBACK_RESOLVER, { optional: true });
|
|
3580
|
+
}
|
|
3581
|
+
registerTenant(tenant) {
|
|
3582
|
+
this.registry.register(this.createEntityProvider(axpTenantLogoKey(tenant.id), tenant.logo));
|
|
3583
|
+
}
|
|
3584
|
+
registerApplication(application) {
|
|
3585
|
+
this.registry.register(this.createEntityProvider(axpApplicationLogoKey(application.id), application.logo ?? application.logoUrl));
|
|
3586
|
+
}
|
|
3587
|
+
registerTenants(tenants) {
|
|
3588
|
+
for (const tenant of tenants) {
|
|
3589
|
+
this.registerTenant(tenant);
|
|
3590
|
+
}
|
|
3591
|
+
}
|
|
3592
|
+
registerApplications(applications) {
|
|
3593
|
+
for (const application of applications) {
|
|
3594
|
+
this.registerApplication(application);
|
|
3595
|
+
}
|
|
3596
|
+
}
|
|
3597
|
+
createEntityProvider(key, logo) {
|
|
3598
|
+
return {
|
|
3599
|
+
key,
|
|
3600
|
+
resolve: (request) => Promise.resolve(this.resolveEntityLogoView(key, logo, request.size)),
|
|
3601
|
+
};
|
|
3602
|
+
}
|
|
3603
|
+
resolveEntityLogoView(key, logo, size) {
|
|
3604
|
+
const src = logo ?? this.fallbackResolver?.resolve(key);
|
|
3605
|
+
if (src) {
|
|
3606
|
+
return { kind: 'image', src, width: size, height: size };
|
|
3607
|
+
}
|
|
3608
|
+
return { kind: 'icon', icon: 'fa-solid fa-building', color: 'neutral-400' };
|
|
3609
|
+
}
|
|
3610
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityLogoRegistrationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3611
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityLogoRegistrationService, providedIn: 'root' }); }
|
|
3612
|
+
}
|
|
3613
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPEntityLogoRegistrationService, decorators: [{
|
|
3614
|
+
type: Injectable,
|
|
3615
|
+
args: [{ providedIn: 'root' }]
|
|
3616
|
+
}] });
|
|
3617
|
+
/** Normalizes API logo payloads (string url or legacy config object). */
|
|
3618
|
+
function axpExtractLogoUrl(logo) {
|
|
3619
|
+
if (typeof logo === 'string' && logo.length > 0) {
|
|
3620
|
+
return logo;
|
|
3621
|
+
}
|
|
3622
|
+
if (logo && typeof logo === 'object' && 'url' in logo) {
|
|
3623
|
+
const url = logo.url;
|
|
3624
|
+
if (typeof url === 'string' && url.length > 0) {
|
|
3625
|
+
return url;
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
return undefined;
|
|
3629
|
+
}
|
|
3630
|
+
|
|
3631
|
+
const AXP_LOGO_IMAGE_SRC_RESOLVER = new InjectionToken('AXP_LOGO_IMAGE_SRC_RESOLVER');
|
|
3632
|
+
//#endregion
|
|
3633
|
+
|
|
3634
|
+
//#region ---- Unified logo component ----
|
|
3635
|
+
class AXPLogoComponent {
|
|
3636
|
+
constructor() {
|
|
3637
|
+
this.logoKey = input.required(...(ngDevMode ? [{ debugName: "logoKey" }] : /* istanbul ignore next */ []));
|
|
3638
|
+
this.appearance = input('auto', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
3639
|
+
this.size = input(20, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3640
|
+
this.format = input('mark', ...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
3641
|
+
this.registry = inject(AXPLogoRegistryService);
|
|
3642
|
+
this.imageSrcResolver = inject(AXP_LOGO_IMAGE_SRC_RESOLVER, { optional: true });
|
|
3643
|
+
this.themeResolver = inject(AXP_LOGO_THEME_RESOLVER, { optional: true });
|
|
3644
|
+
this.resolvedView = signal(null, ...(ngDevMode ? [{ debugName: "resolvedView" }] : /* istanbul ignore next */ []));
|
|
3645
|
+
this.blobObjectUrl = null;
|
|
3646
|
+
this.resolveGeneration = 0;
|
|
3647
|
+
this.resolvedAppearance = computed(() => this.normalizeAppearance(this.appearance()), ...(ngDevMode ? [{ debugName: "resolvedAppearance" }] : /* istanbul ignore next */ []));
|
|
3648
|
+
this.request = computed(() => ({
|
|
3649
|
+
appearance: this.resolvedAppearance(),
|
|
3650
|
+
size: this.size(),
|
|
3651
|
+
format: this.format(),
|
|
3652
|
+
}), ...(ngDevMode ? [{ debugName: "request" }] : /* istanbul ignore next */ []));
|
|
3653
|
+
this.imageView = computed(() => {
|
|
3654
|
+
const view = this.resolvedView();
|
|
3655
|
+
return view?.kind === 'image' ? view : null;
|
|
3656
|
+
}, ...(ngDevMode ? [{ debugName: "imageView" }] : /* istanbul ignore next */ []));
|
|
3657
|
+
this.componentView = computed(() => {
|
|
3658
|
+
const view = this.resolvedView();
|
|
3659
|
+
return view?.kind === 'component' ? view : null;
|
|
3660
|
+
}, ...(ngDevMode ? [{ debugName: "componentView" }] : /* istanbul ignore next */ []));
|
|
3661
|
+
this.iconView = computed(() => {
|
|
3662
|
+
const view = this.resolvedView();
|
|
3663
|
+
return view?.kind === 'icon' ? view : null;
|
|
3664
|
+
}, ...(ngDevMode ? [{ debugName: "iconView" }] : /* istanbul ignore next */ []));
|
|
3665
|
+
this.imageWidth = computed(() => {
|
|
3666
|
+
const view = this.resolvedView();
|
|
3667
|
+
return view?.kind === 'image' ? (view.width ?? this.size()) : this.size();
|
|
3668
|
+
}, ...(ngDevMode ? [{ debugName: "imageWidth" }] : /* istanbul ignore next */ []));
|
|
3669
|
+
this.imageHeight = computed(() => {
|
|
3670
|
+
const view = this.resolvedView();
|
|
3671
|
+
return view?.kind === 'image' ? (view.height ?? this.size()) : this.size();
|
|
3672
|
+
}, ...(ngDevMode ? [{ debugName: "imageHeight" }] : /* istanbul ignore next */ []));
|
|
3673
|
+
this.componentInputs = computed(() => {
|
|
3674
|
+
const view = this.resolvedView();
|
|
3675
|
+
if (view?.kind !== 'component') {
|
|
3676
|
+
return {};
|
|
3677
|
+
}
|
|
3678
|
+
return {
|
|
3679
|
+
appearance: this.resolvedAppearance(),
|
|
3680
|
+
size: this.size(),
|
|
3681
|
+
...view.inputs,
|
|
3682
|
+
};
|
|
3683
|
+
}, ...(ngDevMode ? [{ debugName: "componentInputs" }] : /* istanbul ignore next */ []));
|
|
3684
|
+
effect((onCleanup) => {
|
|
3685
|
+
this.registry.registryRevision();
|
|
3686
|
+
const key = this.logoKey();
|
|
3687
|
+
const request = this.request();
|
|
3688
|
+
const generation = ++this.resolveGeneration;
|
|
3689
|
+
void this.resolveView(key, request, generation).then((view) => {
|
|
3690
|
+
if (generation === this.resolveGeneration) {
|
|
3691
|
+
this.resolvedView.set(view);
|
|
3692
|
+
}
|
|
3693
|
+
});
|
|
3694
|
+
onCleanup(() => {
|
|
3695
|
+
this.revokeBlobUrl();
|
|
3696
|
+
});
|
|
3697
|
+
});
|
|
3698
|
+
}
|
|
3699
|
+
ngOnDestroy() {
|
|
3700
|
+
this.revokeBlobUrl();
|
|
3701
|
+
}
|
|
3702
|
+
async resolveView(key, request, generation) {
|
|
3703
|
+
const view = await this.registry.resolve(key, request);
|
|
3704
|
+
if (view.kind !== 'image') {
|
|
3705
|
+
this.revokeBlobUrl();
|
|
3706
|
+
return view;
|
|
3707
|
+
}
|
|
3708
|
+
const resolver = this.imageSrcResolver;
|
|
3709
|
+
if (!resolver) {
|
|
3710
|
+
return view;
|
|
3711
|
+
}
|
|
3712
|
+
try {
|
|
3713
|
+
const src = await resolver.resolve(view.src);
|
|
3714
|
+
if (!src) {
|
|
3715
|
+
return { kind: 'icon', icon: 'fa-solid fa-building', color: 'neutral-400' };
|
|
3716
|
+
}
|
|
3717
|
+
if (generation !== this.resolveGeneration) {
|
|
3718
|
+
if (src.startsWith('blob:')) {
|
|
3719
|
+
URL.revokeObjectURL(src);
|
|
3720
|
+
}
|
|
3721
|
+
return view;
|
|
3722
|
+
}
|
|
3723
|
+
this.revokeBlobUrl();
|
|
3724
|
+
if (src.startsWith('blob:')) {
|
|
3725
|
+
this.blobObjectUrl = src;
|
|
3726
|
+
}
|
|
3727
|
+
return { ...view, src };
|
|
3728
|
+
}
|
|
3729
|
+
catch {
|
|
3730
|
+
return { kind: 'icon', icon: 'fa-solid fa-building', color: 'neutral-400' };
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
revokeBlobUrl() {
|
|
3734
|
+
if (this.blobObjectUrl) {
|
|
3735
|
+
URL.revokeObjectURL(this.blobObjectUrl);
|
|
3736
|
+
this.blobObjectUrl = null;
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
normalizeAppearance(appearance) {
|
|
3740
|
+
if (appearance !== 'auto') {
|
|
3741
|
+
return appearance;
|
|
3742
|
+
}
|
|
3743
|
+
return this.themeResolver?.isDarkMode() ? 'dark' : 'light';
|
|
3744
|
+
}
|
|
3745
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLogoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3746
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPLogoComponent, isStandalone: true, selector: "axp-logo", inputs: { logoKey: { classPropertyName: "logoKey", publicName: "logoKey", isSignal: true, isRequired: true, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "inline-flex items-center justify-center shrink-0" }, ngImport: i0, template: "@switch (resolvedView()?.kind) {\n @case ('image') {\n @if (imageView(); as view) {\n <ax-image [width]=\"imageWidth()\" [height]=\"imageHeight()\" [src]=\"view.src\"></ax-image>\n }\n }\n @case ('component') {\n @if (componentView(); as view) {\n <ng-container *ngComponentOutlet=\"view.component; inputs: componentInputs()\"></ng-container>\n }\n }\n @case ('icon') {\n @if (iconView(); as view) {\n <ax-icon><i [class]=\"view.icon\" [style.color]=\"view.color\"></i></ax-icon>\n }\n }\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "ngmodule", type: AXImageModule }, { kind: "component", type: i2.AXImageComponent, selector: "ax-image", inputs: ["width", "height", "overlayMode", "src", "alt", "priority", "lazy"], outputs: ["onLoad", "onError"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3747
|
+
}
|
|
3748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPLogoComponent, decorators: [{
|
|
3749
|
+
type: Component,
|
|
3750
|
+
args: [{ selector: 'axp-logo', imports: [CommonModule, AXImageModule, AXDecoratorModule], host: {
|
|
3751
|
+
class: 'inline-flex items-center justify-center shrink-0',
|
|
3752
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "@switch (resolvedView()?.kind) {\n @case ('image') {\n @if (imageView(); as view) {\n <ax-image [width]=\"imageWidth()\" [height]=\"imageHeight()\" [src]=\"view.src\"></ax-image>\n }\n }\n @case ('component') {\n @if (componentView(); as view) {\n <ng-container *ngComponentOutlet=\"view.component; inputs: componentInputs()\"></ng-container>\n }\n }\n @case ('icon') {\n @if (iconView(); as view) {\n <ax-icon><i [class]=\"view.icon\" [style.color]=\"view.color\"></i></ax-icon>\n }\n }\n}\n" }]
|
|
3753
|
+
}], ctorParameters: () => [], propDecorators: { logoKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoKey", required: true }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }] } });
|
|
3754
|
+
|
|
3255
3755
|
/** Global overlay flag + task count ({@link AXPLayoutThemeService}). */
|
|
3256
3756
|
const OVERLAY_LAYOUT_TRACE_NS = 'OVERLAY-LAYOUT';
|
|
3257
3757
|
/** Root shell loading dialog sync ({@link AXPRootLayoutComponent}). */
|
|
@@ -3792,6 +4292,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
3792
4292
|
//#region ---- Idle scheduler types ----
|
|
3793
4293
|
//#endregion
|
|
3794
4294
|
|
|
4295
|
+
const AXP_SETTINGS_DEFINITION_DIALOG_OPENER = new InjectionToken('AXP_SETTINGS_DEFINITION_DIALOG_OPENER');
|
|
4296
|
+
//#endregion
|
|
4297
|
+
|
|
4298
|
+
//#endregion
|
|
4299
|
+
|
|
3795
4300
|
//#region ---- Tag Types ----
|
|
3796
4301
|
//#endregion
|
|
3797
4302
|
|
|
@@ -4571,12 +5076,12 @@ class AXHighlightService {
|
|
|
4571
5076
|
let parts = [];
|
|
4572
5077
|
let match;
|
|
4573
5078
|
let lastIndex = 0;
|
|
4574
|
-
let resultHTML = '<span class="
|
|
5079
|
+
let resultHTML = '<span class="highlight-text">';
|
|
4575
5080
|
while ((match = searchRegex.exec(textContent)) !== null) {
|
|
4576
5081
|
if (match.index > lastIndex) {
|
|
4577
5082
|
resultHTML += `<span>${textContent.slice(lastIndex, match.index)}</span>`;
|
|
4578
5083
|
}
|
|
4579
|
-
resultHTML += `<span class="
|
|
5084
|
+
resultHTML += `<span class="highlight">${match[0]}</span>`;
|
|
4580
5085
|
lastIndex = searchRegex.lastIndex;
|
|
4581
5086
|
}
|
|
4582
5087
|
if (lastIndex < textContent.length) {
|
|
@@ -4595,29 +5100,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
4595
5100
|
}]
|
|
4596
5101
|
}], ctorParameters: () => [] });
|
|
4597
5102
|
|
|
5103
|
+
/**
|
|
5104
|
+
* Instantiates a class inside an injection context.
|
|
5105
|
+
* Use when a lazy provider manually calls `new` on a nested class that relies on `inject()`.
|
|
5106
|
+
*
|
|
5107
|
+
* @example
|
|
5108
|
+
* ```typescript
|
|
5109
|
+
* export class AXMAuthDataSourceProvider implements AXPDataSourceDefinitionProvider {
|
|
5110
|
+
* constructor(private readonly injector: Injector) {}
|
|
5111
|
+
*
|
|
5112
|
+
* async items() {
|
|
5113
|
+
* const userActivity = instantiateWithInjectionContext(
|
|
5114
|
+
* this.injector,
|
|
5115
|
+
* AXMUserActivityDataSourceDefinition,
|
|
5116
|
+
* );
|
|
5117
|
+
* return [...(await userActivity.items())];
|
|
5118
|
+
* }
|
|
5119
|
+
* }
|
|
5120
|
+
* ```
|
|
5121
|
+
*/
|
|
5122
|
+
function instantiateWithInjectionContext(injector, type) {
|
|
5123
|
+
return runInInjectionContext(injector, () => new type(injector));
|
|
5124
|
+
}
|
|
4598
5125
|
/**
|
|
4599
5126
|
* Creates a provider instance within an injection context.
|
|
4600
|
-
*
|
|
5127
|
+
* The injector must be captured synchronously from the useFactory injection context.
|
|
4601
5128
|
*
|
|
5129
|
+
* @param injector - Injector resolved synchronously inside `useFactory`
|
|
4602
5130
|
* @param loader - Function that returns a promise resolving to the provider class
|
|
4603
5131
|
* @returns Promise that resolves to the provider instance
|
|
4604
5132
|
*
|
|
4605
5133
|
* @example
|
|
4606
5134
|
* ```typescript
|
|
4607
|
-
* useFactory: () =>
|
|
4608
|
-
*
|
|
4609
|
-
* )
|
|
5135
|
+
* useFactory: () => {
|
|
5136
|
+
* const injector = inject(Injector);
|
|
5137
|
+
* return createProviderWithInjectionContext(injector, () =>
|
|
5138
|
+
* import('./settings.provider').then((m) => m.AXMSettingProvider),
|
|
5139
|
+
* );
|
|
5140
|
+
* }
|
|
4610
5141
|
* ```
|
|
4611
5142
|
*/
|
|
4612
|
-
async function createProviderWithInjectionContext(loader) {
|
|
4613
|
-
const injector = inject(Injector);
|
|
5143
|
+
async function createProviderWithInjectionContext(injector, loader) {
|
|
4614
5144
|
const ProviderClass = await loader();
|
|
4615
|
-
return runInInjectionContext(injector, () => new ProviderClass());
|
|
5145
|
+
return runInInjectionContext(injector, () => new ProviderClass(injector));
|
|
4616
5146
|
}
|
|
4617
5147
|
/**
|
|
4618
5148
|
* Creates a provider configuration for lazy-loaded providers with injection context.
|
|
4619
5149
|
* Simplifies provider registration in NgModule providers array.
|
|
4620
5150
|
*
|
|
5151
|
+
* Captures `Injector` synchronously in `useFactory` (before any `await`) so injection
|
|
5152
|
+
* context is reliable after dynamic import and cache rebuilds.
|
|
5153
|
+
*
|
|
4621
5154
|
* @param token - The injection token to provide
|
|
4622
5155
|
* @param loader - Function that returns a promise resolving to the provider class
|
|
4623
5156
|
* @param multi - Optional. Whether the provider is a multi-provider (array of values). Defaults to `true`. Pass `false` for a single provider.
|
|
@@ -4642,7 +5175,10 @@ async function createProviderWithInjectionContext(loader) {
|
|
|
4642
5175
|
function provideLazyProvider(token, loader, multi = true) {
|
|
4643
5176
|
return {
|
|
4644
5177
|
provide: token,
|
|
4645
|
-
useFactory: () =>
|
|
5178
|
+
useFactory: () => {
|
|
5179
|
+
const injector = inject(Injector);
|
|
5180
|
+
return createProviderWithInjectionContext(injector, loader);
|
|
5181
|
+
},
|
|
4646
5182
|
multi,
|
|
4647
5183
|
};
|
|
4648
5184
|
}
|
|
@@ -4651,5 +5187,5 @@ function provideLazyProvider(token, loader, multi = true) {
|
|
|
4651
5187
|
* Generated bundle index. Do not edit.
|
|
4652
5188
|
*/
|
|
4653
5189
|
|
|
4654
|
-
export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPCatalogScopeDefinitionProviderService, AXPCatalogScopeDefinitionsDataSourceDefinition, AXPColorPaletteProvider, AXPColorPaletteService, AXPColumnWidthService, AXPComponentLogoConfig, AXPComponentSlot, AXPComponentSlotDirective, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPContentCheckerDirective, AXPContextDefinitionProviderService, AXPContextEvalFactory, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDblClickDirective, AXPDebugService, AXPDefaultColorPalettesProvider, AXPDeviceService, AXPDeviceType, AXPDistributedEventListenerService, AXPElementDataDirective, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPFeatureDefinitionProviderContext, AXPGridLayoutDirective, AXPHookService, AXPIconLogoConfig, AXPIdleSchedulerService, AXPImageUrlLogoConfig, AXPKeyboardShortcutRegistry, AXPModuleManifestModule, AXPModuleManifestRegistry, AXPModuleManifestsDataSourceDefinition, AXPScreenSize, AXPTagProvider, AXPTagService, AXP_ACTIVITY_LOG_PROVIDER, AXP_CATALOG_SCOPE_DEFINITION_PROVIDER, AXP_COLOR_PALETTE_PROVIDER, AXP_COLUMN_WIDTH_PROVIDER, AXP_CONTEXT_DEFINITION_PROVIDER, AXP_DATASOURCE_DEFINITION_PROVIDER, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXP_FEATURE_DEFINITION_PROVIDER, AXP_MODULE_MANIFEST_PROVIDER, AXP_SESSION_SERVICE, AXP_TAG_PROVIDER, AX_OVERLAY_CONTAINER_SELECTOR, AX_OVERLAY_PANE_SELECTOR, DEFAULT_CANCEL_DIALOG_ACTION_SHORTCUTS, DEFAULT_SUBMIT_DIALOG_ACTION_SHORTCUTS, FORM_DIRTY_TRACE_NS, OVERLAY_DETAILS_VIEW_TRACE_NS, OVERLAY_LAYOUT_TRACE_NS, OVERLAY_ROOT_LAYOUT_TRACE_NS, OVERLAY_WIDGET_SETTLE_TRACE_NS, applyContextEvalPipes, applyFilterArray, applyPagination, applyQueryArray, applySortArray, applySystemActionDefault, chordToKbdItemKeys, contextEvalWithPipes, createProviderWithInjectionContext, defaultColumnWidthProvider, findOverlayContainerAncestor, formatKeyboardShortcutChord, formatKeyboardShortcutChords, getNestedVisibleOverlayPanes, getPrimaryKeyboardShortcutChord, getTopVisibleOverlayContainer, getVisibleAnchoredOverlayPanes, getVisibleOverlayContainers, hasForegroundOverlayLayer, isDialogShortcutAllowedInEditableField, isHorizontalDirectionalShortcutKey, isKeyboardTargetInsideEditableField, isMacPlatform, isVisibleOverlayElement, matchesDialogActionShortcut, matchesKeyboardShortcutChord, mirrorHorizontalDirectionalKey, normalizeContextEvalPipes, normalizeDialogActionShortcutChord, normalizeExpressionTemplate, normalizeKeyboardShortcut, normalizeKeyboardShortcuts, objectKeyValueTransforms, parseDialogActionShortcut, parseKeyboardShortcutChord, provideLazyProvider, registerPopupFooterKeyboardShortcuts, resolveConfiguredFooterActionShortcuts, resolveDialogActionShortcuts, resolveDisplayShortcutChord, resolveEffectiveDirectionBehavior, resolveSemanticDirectionalKey, setupPopupFooterKeyboardShortcuts, shouldDeferEscapeToOpenOverlay, shouldTriggerDialogActionShortcut };
|
|
5190
|
+
export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPCatalogScopeDefinitionProviderService, AXPCatalogScopeDefinitionsDataSourceDefinition, AXPColorPaletteProvider, AXPColorPaletteService, AXPColumnWidthService, AXPComponentLogoConfig, AXPComponentSlot, AXPComponentSlotDirective, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPContentCheckerDirective, AXPContextDefinitionProviderService, AXPContextEvalFactory, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDataSourceQueryService, AXPDblClickDirective, AXPDebugService, AXPDefaultColorPalettesProvider, AXPDeviceService, AXPDeviceType, AXPDistributedEventListenerService, AXPElementDataDirective, AXPEntityLogoRegistrationService, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPFeatureDefinitionProviderContext, AXPGridLayoutDirective, AXPHookService, AXPIconLogoConfig, AXPIdleSchedulerService, AXPImageUrlLogoConfig, AXPKeyboardShortcutRegistry, AXPLogoComponent, AXPLogoRegistryService, AXPModuleManifestModule, AXPModuleManifestRegistry, AXPModuleManifestsDataSourceDefinition, AXPScreenSize, AXPTagProvider, AXPTagService, AXP_ACTIVITY_LOG_PROVIDER, AXP_CATALOG_SCOPE_DEFINITION_PROVIDER, AXP_COLOR_PALETTE_PROVIDER, AXP_COLUMN_WIDTH_PROVIDER, AXP_CONTEXT_DEFINITION_PROVIDER, AXP_DATASOURCE_DEFINITION_PROVIDER, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, AXP_ENTITY_LOGO_FALLBACK_RESOLVER, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXP_FEATURE_DEFINITION_PROVIDER, AXP_LOGO_IMAGE_SRC_RESOLVER, AXP_LOGO_PROVIDER, AXP_LOGO_THEME_RESOLVER, AXP_MODULE_MANIFEST_PROVIDER, AXP_PLATFORM_LOGO_KEY, AXP_SESSION_SERVICE, AXP_SETTINGS_DEFINITION_DIALOG_OPENER, AXP_TAG_PROVIDER, AX_OVERLAY_CONTAINER_SELECTOR, AX_OVERLAY_PANE_SELECTOR, DEFAULT_CANCEL_DIALOG_ACTION_SHORTCUTS, DEFAULT_SUBMIT_DIALOG_ACTION_SHORTCUTS, FORM_DIRTY_TRACE_NS, OVERLAY_DETAILS_VIEW_TRACE_NS, OVERLAY_LAYOUT_TRACE_NS, OVERLAY_ROOT_LAYOUT_TRACE_NS, OVERLAY_WIDGET_SETTLE_TRACE_NS, applyContextEvalPipes, applyFilterArray, applyPagination, applyQueryArray, applySortArray, applySystemActionDefault, axpApplicationLogoKey, axpExtractLogoUrl, axpSsoLogoKey, axpTenantLogoKey, chordToKbdItemKeys, contextEvalWithPipes, createProviderWithInjectionContext, defaultColumnWidthProvider, findOverlayContainerAncestor, formatKeyboardShortcutChord, formatKeyboardShortcutChords, getNestedVisibleOverlayPanes, getPrimaryKeyboardShortcutChord, getTopVisibleOverlayContainer, getVisibleAnchoredOverlayPanes, getVisibleOverlayContainers, hasForegroundOverlayLayer, instantiateWithInjectionContext, isDialogShortcutAllowedInEditableField, isHorizontalDirectionalShortcutKey, isKeyboardTargetInsideEditableField, isMacPlatform, isVisibleOverlayElement, matchesDialogActionShortcut, matchesKeyboardShortcutChord, mirrorHorizontalDirectionalKey, normalizeContextEvalPipes, normalizeDialogActionShortcutChord, normalizeExpressionTemplate, normalizeKeyboardShortcut, normalizeKeyboardShortcuts, objectKeyValueTransforms, parseDialogActionShortcut, parseKeyboardShortcutChord, provideLazyProvider, registerPopupFooterKeyboardShortcuts, resolveConfiguredFooterActionShortcuts, resolveDialogActionShortcuts, resolveDisplayShortcutChord, resolveEffectiveDirectionBehavior, resolveSemanticDirectionalKey, setupPopupFooterKeyboardShortcuts, shouldDeferEscapeToOpenOverlay, shouldTriggerDialogActionShortcut };
|
|
4655
5191
|
//# sourceMappingURL=acorex-platform-framework-client-core.mjs.map
|