@acorex/platform 21.0.0-next.41 → 21.0.0-next.43
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-common-settings.provider-G9XcXXOG.mjs → acorex-platform-common-common-settings.provider-lWz_f-Ia.mjs} +22 -24
- package/fesm2022/acorex-platform-common-common-settings.provider-lWz_f-Ia.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +115 -23
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +172 -19
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +164 -24
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +235 -15
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +40 -5
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +166 -8
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widgets.mjs +161 -130
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +65 -2
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-settings.provider-D13QB3Hr.mjs → acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs} +23 -24
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +2 -2
- package/package.json +1 -1
- package/types/acorex-platform-common.d.ts +38 -4
- package/types/acorex-platform-core.d.ts +20 -2
- package/types/acorex-platform-layout-builder.d.ts +63 -21
- package/types/acorex-platform-layout-components.d.ts +54 -3
- package/types/acorex-platform-layout-entity.d.ts +19 -2
- package/types/acorex-platform-layout-widgets.d.ts +19 -5
- package/types/acorex-platform-runtime.d.ts +6 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-G9XcXXOG.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-D13QB3Hr.mjs.map +0 -1
|
@@ -3677,6 +3677,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
3677
3677
|
}] });
|
|
3678
3678
|
|
|
3679
3679
|
const loggingEnabled = false; // Set to true to enable logging, false to disable
|
|
3680
|
+
//#region ---- Multilingual string helpers ----
|
|
3681
|
+
/**
|
|
3682
|
+
* Per-locale string map as produced by multilingual editors (e.g. `{ "en-US": "...", "fa-IR": "..." }`).
|
|
3683
|
+
*/
|
|
3684
|
+
function isLocaleStringMap(value) {
|
|
3685
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value) || value instanceof Date) {
|
|
3686
|
+
return false;
|
|
3687
|
+
}
|
|
3688
|
+
const values = Object.values(value);
|
|
3689
|
+
return values.length > 0 && values.every((v) => typeof v === 'string');
|
|
3690
|
+
}
|
|
3691
|
+
/**
|
|
3692
|
+
* Lowercased text for client-side filtering: plain string or all locale values joined.
|
|
3693
|
+
*/
|
|
3694
|
+
function toFilterSearchText(value) {
|
|
3695
|
+
if (typeof value === 'string') {
|
|
3696
|
+
return value.toLowerCase();
|
|
3697
|
+
}
|
|
3698
|
+
if (isLocaleStringMap(value)) {
|
|
3699
|
+
return Object.values(value).join(' ').toLowerCase();
|
|
3700
|
+
}
|
|
3701
|
+
return undefined;
|
|
3702
|
+
}
|
|
3703
|
+
function filterValuesAreEqual(itemRaw, condRaw) {
|
|
3704
|
+
if (typeof condRaw === 'string' && isLocaleStringMap(itemRaw)) {
|
|
3705
|
+
return Object.values(itemRaw).some((v) => v.toLowerCase() === condRaw.toLowerCase());
|
|
3706
|
+
}
|
|
3707
|
+
if (typeof itemRaw === 'string' && isLocaleStringMap(condRaw)) {
|
|
3708
|
+
return Object.values(condRaw).some((v) => v.toLowerCase() === itemRaw.toLowerCase());
|
|
3709
|
+
}
|
|
3710
|
+
const itemScalar = typeof itemRaw === 'string' ? itemRaw.toLowerCase() : itemRaw;
|
|
3711
|
+
const condScalar = typeof condRaw === 'string' ? condRaw.toLowerCase() : condRaw;
|
|
3712
|
+
return isEqual(itemScalar, condScalar);
|
|
3713
|
+
}
|
|
3714
|
+
//#endregion
|
|
3680
3715
|
function applyCondition(item, condition) {
|
|
3681
3716
|
const rawValue = condition.field ? get(item, condition.field) : null;
|
|
3682
3717
|
const itemValue = typeof rawValue === 'string' ? rawValue.toLowerCase() : rawValue;
|
|
@@ -3697,7 +3732,12 @@ function applyCondition(item, condition) {
|
|
|
3697
3732
|
switch (op) {
|
|
3698
3733
|
case 'equal':
|
|
3699
3734
|
case 'eq':
|
|
3700
|
-
|
|
3735
|
+
if (!isNil(condition.field) && condition.field !== '') {
|
|
3736
|
+
result = filterValuesAreEqual(rawValue, condition.value);
|
|
3737
|
+
}
|
|
3738
|
+
else {
|
|
3739
|
+
result = isEqual(valueToCompare, conditionValue);
|
|
3740
|
+
}
|
|
3701
3741
|
if (loggingEnabled) {
|
|
3702
3742
|
console.log('Equal check result:', result);
|
|
3703
3743
|
}
|
|
@@ -3705,7 +3745,12 @@ function applyCondition(item, condition) {
|
|
|
3705
3745
|
case 'notEqual':
|
|
3706
3746
|
case 'ne':
|
|
3707
3747
|
case 'neq':
|
|
3708
|
-
|
|
3748
|
+
if (!isNil(condition.field) && condition.field !== '') {
|
|
3749
|
+
result = !filterValuesAreEqual(rawValue, condition.value);
|
|
3750
|
+
}
|
|
3751
|
+
else {
|
|
3752
|
+
result = !isEqual(valueToCompare, conditionValue);
|
|
3753
|
+
}
|
|
3709
3754
|
if (loggingEnabled) {
|
|
3710
3755
|
console.log('Not equal check result:', result);
|
|
3711
3756
|
}
|
|
@@ -3738,12 +3783,15 @@ function applyCondition(item, condition) {
|
|
|
3738
3783
|
console.log('Less than or equal check result:', result);
|
|
3739
3784
|
}
|
|
3740
3785
|
break;
|
|
3741
|
-
case 'contains':
|
|
3742
|
-
|
|
3743
|
-
|
|
3786
|
+
case 'contains': {
|
|
3787
|
+
const needle = toFilterSearchText(condition.value) ??
|
|
3788
|
+
(condition.value == null ? '' : String(condition.value).toLowerCase());
|
|
3789
|
+
const haystack = toFilterSearchText(rawValue);
|
|
3790
|
+
if (haystack !== undefined) {
|
|
3791
|
+
result = includes(haystack, needle);
|
|
3744
3792
|
}
|
|
3745
|
-
else if (Array.isArray(
|
|
3746
|
-
result = includes(
|
|
3793
|
+
else if (Array.isArray(rawValue)) {
|
|
3794
|
+
result = includes(rawValue.map((val) => toFilterSearchText(val) ?? val.toString().toLowerCase()), needle);
|
|
3747
3795
|
}
|
|
3748
3796
|
else {
|
|
3749
3797
|
result = false;
|
|
@@ -3752,13 +3800,18 @@ function applyCondition(item, condition) {
|
|
|
3752
3800
|
console.log('Contains check result:', result);
|
|
3753
3801
|
}
|
|
3754
3802
|
break;
|
|
3803
|
+
}
|
|
3755
3804
|
case 'in':
|
|
3756
3805
|
if (Array.isArray(conditionValue)) {
|
|
3757
3806
|
if (typeof valueToCompare === 'string') {
|
|
3758
|
-
result = conditionValue.some(val => typeof val === 'string' ? val.toLowerCase() === valueToCompare : val === valueToCompare);
|
|
3807
|
+
result = conditionValue.some((val) => typeof val === 'string' ? val.toLowerCase() === valueToCompare : val === valueToCompare);
|
|
3808
|
+
}
|
|
3809
|
+
else if (isLocaleStringMap(rawValue)) {
|
|
3810
|
+
const localeValues = Object.values(rawValue).map((v) => v.toLowerCase());
|
|
3811
|
+
result = localeValues.some((localeVal) => conditionValue.some((val) => typeof val === 'string' ? val.toLowerCase() === localeVal : val === localeVal));
|
|
3759
3812
|
}
|
|
3760
3813
|
else if (Array.isArray(valueToCompare)) {
|
|
3761
|
-
result = valueToCompare.some(val => conditionValue.some(condVal => typeof val === 'string' && typeof condVal === 'string'
|
|
3814
|
+
result = valueToCompare.some((val) => conditionValue.some((condVal) => typeof val === 'string' && typeof condVal === 'string'
|
|
3762
3815
|
? val.toLowerCase() === condVal.toLowerCase()
|
|
3763
3816
|
: val === condVal));
|
|
3764
3817
|
}
|
|
@@ -3773,12 +3826,15 @@ function applyCondition(item, condition) {
|
|
|
3773
3826
|
console.log('In check result:', result);
|
|
3774
3827
|
}
|
|
3775
3828
|
break;
|
|
3776
|
-
case 'notContains':
|
|
3777
|
-
|
|
3778
|
-
|
|
3829
|
+
case 'notContains': {
|
|
3830
|
+
const needleNc = toFilterSearchText(condition.value) ??
|
|
3831
|
+
(condition.value == null ? '' : String(condition.value).toLowerCase());
|
|
3832
|
+
const haystackNc = toFilterSearchText(rawValue);
|
|
3833
|
+
if (haystackNc !== undefined) {
|
|
3834
|
+
result = !includes(haystackNc, needleNc);
|
|
3779
3835
|
}
|
|
3780
|
-
else if (Array.isArray(
|
|
3781
|
-
result = !includes(
|
|
3836
|
+
else if (Array.isArray(rawValue)) {
|
|
3837
|
+
result = !includes(rawValue.map((val) => toFilterSearchText(val) ?? val.toString().toLowerCase()), needleNc);
|
|
3782
3838
|
}
|
|
3783
3839
|
else {
|
|
3784
3840
|
result = false;
|
|
@@ -3787,18 +3843,27 @@ function applyCondition(item, condition) {
|
|
|
3787
3843
|
console.log('Not contains check result:', result);
|
|
3788
3844
|
}
|
|
3789
3845
|
break;
|
|
3790
|
-
|
|
3791
|
-
|
|
3846
|
+
}
|
|
3847
|
+
case 'startsWith': {
|
|
3848
|
+
const prefix = toFilterSearchText(condition.value) ??
|
|
3849
|
+
(condition.value == null ? '' : String(condition.value).toLowerCase());
|
|
3850
|
+
const haystackSw = toFilterSearchText(rawValue);
|
|
3851
|
+
result = haystackSw !== undefined && startsWith(haystackSw, prefix);
|
|
3792
3852
|
if (loggingEnabled) {
|
|
3793
3853
|
console.log('Starts with check result:', result);
|
|
3794
3854
|
}
|
|
3795
3855
|
break;
|
|
3796
|
-
|
|
3797
|
-
|
|
3856
|
+
}
|
|
3857
|
+
case 'endsWith': {
|
|
3858
|
+
const suffix = toFilterSearchText(condition.value) ??
|
|
3859
|
+
(condition.value == null ? '' : String(condition.value).toLowerCase());
|
|
3860
|
+
const haystackEw = toFilterSearchText(rawValue);
|
|
3861
|
+
result = haystackEw !== undefined && endsWith(haystackEw, suffix);
|
|
3798
3862
|
if (loggingEnabled) {
|
|
3799
3863
|
console.log('Ends with check result:', result);
|
|
3800
3864
|
}
|
|
3801
3865
|
break;
|
|
3866
|
+
}
|
|
3802
3867
|
case 'isEmpty':
|
|
3803
3868
|
result = isEmpty(valueToCompare);
|
|
3804
3869
|
if (loggingEnabled) {
|
|
@@ -4223,6 +4288,94 @@ function provideLazyProvider(token, loader, multi = true) {
|
|
|
4223
4288
|
};
|
|
4224
4289
|
}
|
|
4225
4290
|
|
|
4291
|
+
//#region ---- Unwrapping ----
|
|
4292
|
+
/**
|
|
4293
|
+
* If `raw` is a plain non-array object with a `value` property, returns `value`; otherwise returns `raw`.
|
|
4294
|
+
*/
|
|
4295
|
+
function unwrapValueProperty(raw) {
|
|
4296
|
+
if (raw && typeof raw === 'object' && !Array.isArray(raw) && !(raw instanceof Date) && 'value' in raw) {
|
|
4297
|
+
return raw.value;
|
|
4298
|
+
}
|
|
4299
|
+
return raw;
|
|
4300
|
+
}
|
|
4301
|
+
//#endregion
|
|
4302
|
+
//#region ---- Scalar coercion ----
|
|
4303
|
+
/**
|
|
4304
|
+
* Coerces to a trimmed string. Plain objects may carry `{ value }` from setting widgets or `{ id }` from select payloads using `valueField: 'id'`.
|
|
4305
|
+
*/
|
|
4306
|
+
function coerceUnknownToTrimmedString(raw) {
|
|
4307
|
+
if (typeof raw === 'string') {
|
|
4308
|
+
return raw.trim();
|
|
4309
|
+
}
|
|
4310
|
+
if (raw && typeof raw === 'object' && !Array.isArray(raw) && !(raw instanceof Date)) {
|
|
4311
|
+
const r = raw;
|
|
4312
|
+
if ('value' in r && r['value'] != null) {
|
|
4313
|
+
return String(r['value']).trim();
|
|
4314
|
+
}
|
|
4315
|
+
if ('id' in r && r['id'] != null) {
|
|
4316
|
+
return String(r['id']).trim();
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
return '';
|
|
4320
|
+
}
|
|
4321
|
+
/**
|
|
4322
|
+
* Coerces to boolean: direct booleans pass through; wrapped `{ value: true | 'true' }` is respected; otherwise false.
|
|
4323
|
+
*/
|
|
4324
|
+
function coerceUnknownToBoolean(raw) {
|
|
4325
|
+
if (typeof raw === 'boolean') {
|
|
4326
|
+
return raw;
|
|
4327
|
+
}
|
|
4328
|
+
if (raw && typeof raw === 'object' && 'value' in raw) {
|
|
4329
|
+
const v = raw.value;
|
|
4330
|
+
return v === true || v === 'true';
|
|
4331
|
+
}
|
|
4332
|
+
return false;
|
|
4333
|
+
}
|
|
4334
|
+
/** Parses a finite number after optional `{ value }` unwrap; non-finite or empty string yields NaN. */
|
|
4335
|
+
function coerceUnknownToFiniteNumber(raw) {
|
|
4336
|
+
const v = unwrapValueProperty(raw);
|
|
4337
|
+
if (v === null || v === undefined) {
|
|
4338
|
+
return NaN;
|
|
4339
|
+
}
|
|
4340
|
+
if (typeof v === 'number') {
|
|
4341
|
+
return Number.isFinite(v) ? v : NaN;
|
|
4342
|
+
}
|
|
4343
|
+
if (typeof v === 'boolean') {
|
|
4344
|
+
return v ? 1 : 0;
|
|
4345
|
+
}
|
|
4346
|
+
if (typeof v === 'string') {
|
|
4347
|
+
const t = v.trim();
|
|
4348
|
+
if (t === '') {
|
|
4349
|
+
return NaN;
|
|
4350
|
+
}
|
|
4351
|
+
const n = Number(t);
|
|
4352
|
+
return Number.isFinite(n) ? n : NaN;
|
|
4353
|
+
}
|
|
4354
|
+
return NaN;
|
|
4355
|
+
}
|
|
4356
|
+
/** Parses a Date after optional `{ value }` unwrap; invalid input yields Invalid Date. */
|
|
4357
|
+
function coerceUnknownToDate(raw) {
|
|
4358
|
+
const v = unwrapValueProperty(raw);
|
|
4359
|
+
if (v === null || v === undefined) {
|
|
4360
|
+
return new Date(NaN);
|
|
4361
|
+
}
|
|
4362
|
+
if (v instanceof Date) {
|
|
4363
|
+
return new Date(v.getTime());
|
|
4364
|
+
}
|
|
4365
|
+
if (typeof v === 'number' && Number.isFinite(v)) {
|
|
4366
|
+
return new Date(v);
|
|
4367
|
+
}
|
|
4368
|
+
if (typeof v === 'string') {
|
|
4369
|
+
const t = v.trim();
|
|
4370
|
+
if (t === '') {
|
|
4371
|
+
return new Date(NaN);
|
|
4372
|
+
}
|
|
4373
|
+
return new Date(t);
|
|
4374
|
+
}
|
|
4375
|
+
return new Date(NaN);
|
|
4376
|
+
}
|
|
4377
|
+
//#endregion
|
|
4378
|
+
|
|
4226
4379
|
function extractTextFromHtml(value) {
|
|
4227
4380
|
const div = document.createElement('div');
|
|
4228
4381
|
div.innerHTML = value;
|
|
@@ -4259,5 +4412,5 @@ function generateKebabCase(title) {
|
|
|
4259
4412
|
* Generated bundle index. Do not edit.
|
|
4260
4413
|
*/
|
|
4261
4414
|
|
|
4262
|
-
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, normalizeDefinitionCategories, objectKeyValueTransforms, provideLazyProvider, resolveActionLook, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart, sortByMultiLanguageString };
|
|
4415
|
+
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, coerceUnknownToBoolean, coerceUnknownToDate, coerceUnknownToFiniteNumber, coerceUnknownToTrimmedString, compareMultiLanguageStrings, containsHtmlMarkup, createProviderWithInjectionContext, defaultColumnWidthProvider, extractNestedFieldsWildcard, extractTextFromHtml, extractValue, generateKebabCase, getActionButton, getChangedPaths, getDetailedChanges, getEnumValues, getNestedKeys, getSmart, getSystemActions, normalizeDefinitionCategories, objectKeyValueTransforms, provideLazyProvider, resolveActionLook, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart, sortByMultiLanguageString, unwrapValueProperty };
|
|
4263
4416
|
//# sourceMappingURL=acorex-platform-core.mjs.map
|