@acorex/platform 21.0.0-next.37 → 21.0.0-next.39
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-common.mjs +19 -1
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +11 -172
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +7 -8
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +39 -29
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +8 -9
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +468 -255
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +171 -86
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +36 -13
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-9uCkMxcc.mjs → acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs} +5 -60
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CDYAGBku.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +101 -128
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +16 -4
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +25 -5
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/package.json +1 -1
- package/types/acorex-platform-common.d.ts +11 -6
- package/types/acorex-platform-core.d.ts +56 -101
- package/types/acorex-platform-layout-builder.d.ts +0 -1
- package/types/acorex-platform-layout-components.d.ts +4 -3
- package/types/acorex-platform-layout-designer.d.ts +1 -1
- package/types/acorex-platform-layout-entity.d.ts +36 -30
- package/types/acorex-platform-layout-views.d.ts +31 -29
- package/types/acorex-platform-layout-widget-core.d.ts +30 -14
- package/types/acorex-platform-layout-widgets.d.ts +17 -11
- package/types/acorex-platform-themes-default.d.ts +1 -0
- package/types/acorex-platform-workflow.d.ts +28 -51
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-9uCkMxcc.mjs.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable, Directive, computed, Injector, ChangeDetectionStrategy, Component, input, ElementRef, ViewContainerRef, signal, effect, runInInjectionContext, Optional, Inject, NgModule, EventEmitter, HostListener, Output, provideAppInitializer,
|
|
2
|
+
import { InjectionToken, inject, Injectable, Directive, computed, Injector, ChangeDetectionStrategy, Component, input, ElementRef, ViewContainerRef, signal, effect, runInInjectionContext, Optional, Inject, NgModule, EventEmitter, HostListener, Output, provideAppInitializer, Pipe } from '@angular/core';
|
|
3
3
|
import { get, isPlainObject, set, isNil, isEmpty, isArray, merge, isObjectLike, transform, isEqual, differenceWith, union, cloneDeep, has, sortBy, isUndefined, endsWith, startsWith, includes, lte, gte, lt, gt, orderBy } from 'lodash-es';
|
|
4
4
|
import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
|
|
5
5
|
import * as i1 from '@acorex/components/skeleton';
|
|
6
6
|
import { AXSkeletonModule } from '@acorex/components/skeleton';
|
|
7
|
-
import { Subject,
|
|
7
|
+
import { Subject, interval, fromEvent } from 'rxjs';
|
|
8
8
|
import { AXDataSource } from '@acorex/cdk/common';
|
|
9
|
-
import {
|
|
10
|
-
import { map, distinctUntilChanged, startWith, debounceTime } from 'rxjs/operators';
|
|
9
|
+
import { resolveMultiLanguageString } from '@acorex/core/translation';
|
|
11
10
|
import { AXCalendarService } from '@acorex/core/date-time';
|
|
11
|
+
import { startWith, map, debounceTime } from 'rxjs/operators';
|
|
12
12
|
|
|
13
13
|
const AXP_ACTIVITY_LOG_PROVIDER = new InjectionToken('AXP_ACTIVITY_LOGS_PROVIDER');
|
|
14
14
|
class AXPActivityLogService {
|
|
@@ -937,7 +937,12 @@ class AXPExpressionEvaluatorScopeProviderService {
|
|
|
937
937
|
: [];
|
|
938
938
|
const context = new AXPExpressionEvaluatorScopeProviderContext();
|
|
939
939
|
for (const provider of providers) {
|
|
940
|
-
|
|
940
|
+
// Resolve lazy-loaded providers (provideLazyProvider useFactory returns Promise<Provider>)
|
|
941
|
+
const resolved = await Promise.resolve(provider);
|
|
942
|
+
if (!resolved || typeof resolved.provide !== 'function') {
|
|
943
|
+
continue;
|
|
944
|
+
}
|
|
945
|
+
await resolved.provide(context);
|
|
941
946
|
}
|
|
942
947
|
this.cache = context.getScopes();
|
|
943
948
|
}
|
|
@@ -2448,172 +2453,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
2448
2453
|
}]
|
|
2449
2454
|
}], ctorParameters: () => [{ type: AXPAppStartUpService }, { type: i0.Injector }] });
|
|
2450
2455
|
|
|
2451
|
-
//#region ---- Imports ----
|
|
2452
|
-
//#endregion
|
|
2453
|
-
//#region ---- Public API ----
|
|
2454
|
-
const LOCALE_KEY_REGEX = /^(\*-\*|[a-z]{2}-[A-Z]{2})$/;
|
|
2455
|
-
/**
|
|
2456
|
-
* Checks whether value is a valid locale map (`xx-XX` or `*-*` keys, string values).
|
|
2457
|
-
*/
|
|
2458
|
-
function isValidMultiLanguageObject(value) {
|
|
2459
|
-
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
2460
|
-
return false;
|
|
2461
|
-
}
|
|
2462
|
-
const entries = Object.entries(value);
|
|
2463
|
-
if (!entries.length) {
|
|
2464
|
-
return false;
|
|
2465
|
-
}
|
|
2466
|
-
return entries.every(([key, entryValue]) => LOCALE_KEY_REGEX.test(key) && typeof entryValue === 'string');
|
|
2467
|
-
}
|
|
2468
|
-
/**
|
|
2469
|
-
* Resolves {@link AXPMultiLanguageString} to a single string for the given locale.
|
|
2470
|
-
* Fallback order: `currentLocale` → `en-US` → first map value.
|
|
2471
|
-
*/
|
|
2472
|
-
function resolveMultiLanguageString(content, currentLocale) {
|
|
2473
|
-
if (content == null || content === '') {
|
|
2474
|
-
return '';
|
|
2475
|
-
}
|
|
2476
|
-
if (typeof content === 'string') {
|
|
2477
|
-
return content;
|
|
2478
|
-
}
|
|
2479
|
-
if (!isValidMultiLanguageObject(content)) {
|
|
2480
|
-
return String(content);
|
|
2481
|
-
}
|
|
2482
|
-
const record = content;
|
|
2483
|
-
const pick = record[currentLocale] ??
|
|
2484
|
-
record['en-US'] ??
|
|
2485
|
-
Object.values(record).find((v) => v != null);
|
|
2486
|
-
if (pick == null || pick === '') {
|
|
2487
|
-
return '';
|
|
2488
|
-
}
|
|
2489
|
-
if (typeof pick === 'string') {
|
|
2490
|
-
return pick;
|
|
2491
|
-
}
|
|
2492
|
-
return String(pick);
|
|
2493
|
-
}
|
|
2494
|
-
/**
|
|
2495
|
-
* Creates an {@link AXPMultiLanguageString} with `en-US` and `fa-IR` entries.
|
|
2496
|
-
* Use for seed data, tests, and demos that supply English and Persian copy explicitly.
|
|
2497
|
-
*/
|
|
2498
|
-
function createMultiLanguageString(enUs, faIr) {
|
|
2499
|
-
return { 'en-US': enUs, 'fa-IR': faIr };
|
|
2500
|
-
}
|
|
2501
|
-
/**
|
|
2502
|
-
* True when there is no displayable text in any locale (plain string or ML map).
|
|
2503
|
-
* Pure helper for predicates (e.g. default section detection); prefer widgets / pipes for display.
|
|
2504
|
-
*/
|
|
2505
|
-
function isEffectivelyEmptyLocalizedValue(value) {
|
|
2506
|
-
if (value == null)
|
|
2507
|
-
return true;
|
|
2508
|
-
if (typeof value === 'string')
|
|
2509
|
-
return value.trim() === '';
|
|
2510
|
-
if (typeof value !== 'object' || Array.isArray(value))
|
|
2511
|
-
return false;
|
|
2512
|
-
const record = value;
|
|
2513
|
-
return Object.values(record).every((v) => v == null || String(v).trim() === '');
|
|
2514
|
-
}
|
|
2515
|
-
//#endregion
|
|
2516
|
-
|
|
2517
|
-
//#region ---- Imports ----
|
|
2518
|
-
//#endregion
|
|
2519
|
-
//#region ---- AXPMultiLanguageStringResolverService ----
|
|
2520
|
-
/**
|
|
2521
|
-
* Resolves {@link AXPMultiLanguageString} using the active app locale, and exposes
|
|
2522
|
-
* {@link currentLocale$} for code that prefers an observable (e.g. manual subscriptions).
|
|
2523
|
-
* Templates usually use {@link AXPResolveMultiLanguageStringPipe} instead.
|
|
2524
|
-
*/
|
|
2525
|
-
class AXPMultiLanguageStringResolverService {
|
|
2526
|
-
constructor() {
|
|
2527
|
-
//#region ---- Services & Dependencies ----
|
|
2528
|
-
this.translation = inject(AXTranslationService);
|
|
2529
|
-
//#endregion
|
|
2530
|
-
//#region ---- Locale stream ----
|
|
2531
|
-
/**
|
|
2532
|
-
* Emits the active locale on subscribe and whenever the language changes.
|
|
2533
|
-
*/
|
|
2534
|
-
this.currentLocale$ = merge$1(of(this.translation.getActiveLang()), this.translation.langChanges$).pipe(map(() => this.translation.getActiveLang()), distinctUntilChanged());
|
|
2535
|
-
}
|
|
2536
|
-
//#endregion
|
|
2537
|
-
//#region ---- Resolve ----
|
|
2538
|
-
/**
|
|
2539
|
-
* Resolves multi-language content for an optional locale (defaults to active).
|
|
2540
|
-
*/
|
|
2541
|
-
resolve(content, locale) {
|
|
2542
|
-
if (content && typeof content === 'object' && !isValidMultiLanguageObject(content)) {
|
|
2543
|
-
return '';
|
|
2544
|
-
}
|
|
2545
|
-
return resolveMultiLanguageString(content, locale ?? this.translation.getActiveLang());
|
|
2546
|
-
}
|
|
2547
|
-
/**
|
|
2548
|
-
* Checks if a value is a valid multi-language object map.
|
|
2549
|
-
* Key format must be `xx-XX` (e.g. en-US, fa-IR) or fallback `*-*`.
|
|
2550
|
-
* All values must be strings.
|
|
2551
|
-
*/
|
|
2552
|
-
isValidMultiLanguageObject(value) {
|
|
2553
|
-
return isValidMultiLanguageObject(value);
|
|
2554
|
-
}
|
|
2555
|
-
/**
|
|
2556
|
-
* Normalizes multi-language content to a locale map for editors (e.g. multi-language popup `values`).
|
|
2557
|
-
* If `content` is already a locale-to-string map, returns a shallow copy.
|
|
2558
|
-
* If it is a plain string or empty, wraps it as `{ [activeLocale]: text }`.
|
|
2559
|
-
*/
|
|
2560
|
-
toLocaleMap(content, activeLocale) {
|
|
2561
|
-
if (this.isValidMultiLanguageObject(content)) {
|
|
2562
|
-
return { ...content };
|
|
2563
|
-
}
|
|
2564
|
-
const txt = typeof content === 'string' ? content : '';
|
|
2565
|
-
return { [activeLocale]: txt };
|
|
2566
|
-
}
|
|
2567
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPMultiLanguageStringResolverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2568
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPMultiLanguageStringResolverService, providedIn: 'root' }); }
|
|
2569
|
-
}
|
|
2570
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPMultiLanguageStringResolverService, decorators: [{
|
|
2571
|
-
type: Injectable,
|
|
2572
|
-
args: [{ providedIn: 'root' }]
|
|
2573
|
-
}] });
|
|
2574
|
-
|
|
2575
|
-
//#region ---- Imports ----
|
|
2576
|
-
//#endregion
|
|
2577
|
-
//#region ---- AXPResolveMultiLanguageStringPipe ----
|
|
2578
|
-
/**
|
|
2579
|
-
* Resolves {@link AXPMultiLanguageString} via {@link AXPMultiLanguageStringResolverService}.
|
|
2580
|
-
* Impure and subscribes to {@link AXPMultiLanguageStringResolverService#currentLocale$} so
|
|
2581
|
-
* OnPush hosts (e.g. grid cells) still refresh when the language changes.
|
|
2582
|
-
*
|
|
2583
|
-
* Optional second argument: explicit locale (e.g. from a host `locale` input). When omitted or null/empty,
|
|
2584
|
-
* the active language is used.
|
|
2585
|
-
*
|
|
2586
|
-
* @example
|
|
2587
|
-
* ```html
|
|
2588
|
-
* {{ value | axpResolveMultiLanguageString }}
|
|
2589
|
-
* {{ value | axpResolveMultiLanguageString: locale() }}
|
|
2590
|
-
* ```
|
|
2591
|
-
*/
|
|
2592
|
-
class AXPResolveMultiLanguageStringPipe {
|
|
2593
|
-
constructor() {
|
|
2594
|
-
this.resolver = inject(AXPMultiLanguageStringResolverService);
|
|
2595
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
2596
|
-
this.localeSubscription = this.resolver.currentLocale$.subscribe(() => this.cdr.markForCheck());
|
|
2597
|
-
}
|
|
2598
|
-
transform(value, locale) {
|
|
2599
|
-
const explicitLocale = locale != null && locale !== '' ? locale : undefined;
|
|
2600
|
-
return this.resolver.resolve(value, explicitLocale);
|
|
2601
|
-
}
|
|
2602
|
-
ngOnDestroy() {
|
|
2603
|
-
this.localeSubscription.unsubscribe();
|
|
2604
|
-
}
|
|
2605
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPResolveMultiLanguageStringPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
2606
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: AXPResolveMultiLanguageStringPipe, isStandalone: true, name: "axpResolveMultiLanguageString", pure: false }); }
|
|
2607
|
-
}
|
|
2608
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPResolveMultiLanguageStringPipe, decorators: [{
|
|
2609
|
-
type: Pipe,
|
|
2610
|
-
args: [{
|
|
2611
|
-
name: 'axpResolveMultiLanguageString',
|
|
2612
|
-
standalone: true,
|
|
2613
|
-
pure: false,
|
|
2614
|
-
}]
|
|
2615
|
-
}] });
|
|
2616
|
-
|
|
2617
2456
|
//#region ---- Imports ----
|
|
2618
2457
|
//#endregion
|
|
2619
2458
|
//#region ---- Compare & sort ----
|
|
@@ -4413,5 +4252,5 @@ function generateKebabCase(title) {
|
|
|
4413
4252
|
* Generated bundle index. Do not edit.
|
|
4414
4253
|
*/
|
|
4415
4254
|
|
|
4416
|
-
export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPColorPaletteProvider, AXPColorPaletteService, AXPColumnWidthService, AXPComponentLogoConfig, AXPComponentSlot, AXPComponentSlotDirective, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPContentCheckerDirective, AXPContextChangeEvent, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDblClickDirective, AXPDefaultColorPalettesProvider, AXPDeviceService, AXPDeviceType, AXPDistributedEventListenerService, AXPElementDataDirective, AXPExportTemplateToken, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPFeatureDefinitionProviderContext, AXPGridLayoutDirective, AXPHookService, AXPIconLogoConfig, AXPImageUrlLogoConfig, AXPModuleManifestModule, AXPModuleManifestRegistry, AXPModuleManifestsDataSourceDefinition,
|
|
4255
|
+
export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPColorPaletteProvider, AXPColorPaletteService, AXPColumnWidthService, AXPComponentLogoConfig, AXPComponentSlot, AXPComponentSlotDirective, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPContentCheckerDirective, AXPContextChangeEvent, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDblClickDirective, AXPDefaultColorPalettesProvider, AXPDeviceService, AXPDeviceType, AXPDistributedEventListenerService, AXPElementDataDirective, AXPExportTemplateToken, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPFeatureDefinitionProviderContext, AXPGridLayoutDirective, AXPHookService, AXPIconLogoConfig, AXPImageUrlLogoConfig, AXPModuleManifestModule, AXPModuleManifestRegistry, AXPModuleManifestsDataSourceDefinition, AXPPlatformScope, AXPScreenSize, AXPSystemActionType, AXPSystemActions, AXPTagProvider, AXPTagService, AXP_ACTIVITY_LOG_PROVIDER, AXP_COLOR_PALETTE_PROVIDER, AXP_COLUMN_WIDTH_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, MODULE_MANIFESTS_DATASOURCE_NAME, applyFilterArray, applyPagination, applyQueryArray, applySortArray, applySystemActionDefault, cleanDeep, compareMultiLanguageStrings, containsHtmlMarkup, createProviderWithInjectionContext, defaultColumnWidthProvider, extractNestedFieldsWildcard, extractTextFromHtml, extractValue, generateKebabCase, getActionButton, getChangedPaths, getDetailedChanges, getEnumValues, getNestedKeys, getSmart, getSystemActions, objectKeyValueTransforms, provideLazyProvider, resolveActionLook, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart, sortByMultiLanguageString };
|
|
4417
4256
|
//# sourceMappingURL=acorex-platform-core.mjs.map
|