@acorex/platform 19.2.9 → 19.2.10
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/common/lib/app/application.types.d.ts +3 -2
- package/common/lib/utils/expression-evaluator.service.d.ts +3 -1
- package/fesm2022/acorex-platform-common.mjs +26 -12
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +20 -4
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +31 -12
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +45 -64
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-BK8BItxL.mjs → acorex-platform-themes-default-entity-master-create-view.component-Bvwr0PVk.mjs} +8 -4
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Bvwr0PVk.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-De61n012.mjs → acorex-platform-themes-default-entity-master-list-view.component-BzLgFr7D.mjs} +8 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BzLgFr7D.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-U8aBv1Ql.mjs → acorex-platform-themes-default-entity-master-modify-view.component-BAU_s90_.mjs} +8 -4
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BAU_s90_.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs → acorex-platform-themes-default-setting-page.component-DYumYm5k.mjs} +3 -3
- package/fesm2022/{acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs.map → acorex-platform-themes-default-setting-page.component-DYumYm5k.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +14 -15
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-widgets.mjs +215 -124
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/layout/builder/lib/builder/widget-map.d.ts +1 -0
- package/layout/builder/lib/builder/widget.types.d.ts +13 -0
- package/layout/designer/lib/designer/components/drawers/data-sources/data-sources.component.d.ts +3 -0
- package/layout/entity/lib/entity-master-create.viewmodel.d.ts +2 -1
- package/layout/entity/lib/entity-master-update.viewmodel.d.ts +4 -3
- package/layout/entity/lib/entity.viewmodel.d.ts +2 -0
- package/package.json +5 -5
- package/themes/default/lib/layouts/entity-layouts/entity-master-create-view/entity-master-create-view.component.d.ts +2 -0
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +2 -1
- package/themes/default/lib/layouts/entity-layouts/entity-master-modify-view/entity-master-modify-view.component.d.ts +2 -0
- package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +0 -1
- package/widgets/lib/widgets/advance/file/file-box-widget-edit.component.d.ts +6 -4
- package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget-edit.component.d.ts +3 -3
- package/widgets/lib/widgets/charts/gauge-chart/gauge-chart-widget-edit.component.d.ts +14 -0
- package/widgets/lib/widgets/charts/gauge-chart/gauge-chart-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/charts/gauge-chart/gauge-chart.type.d.ts +17 -0
- package/widgets/lib/widgets/charts/gauge-chart/index.d.ts +2 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-BK8BItxL.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-De61n012.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-U8aBv1Ql.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AXDataSourceOperator, AXStyleColorType } from '@acorex/components/common';
|
|
2
2
|
import { AXPopupSizeType } from '@acorex/components/popup';
|
|
3
|
-
import { AXPValidationRules } from '@acorex/platform/core';
|
|
3
|
+
import { AXPMetaData, AXPValidationRules } from '@acorex/platform/core';
|
|
4
4
|
import { AXPWidgetTypesMap, AXPWidgetValueTransformFunctions } from '@acorex/platform/layout/builder';
|
|
5
5
|
import { AXPGridLayoutOptions } from '../layout';
|
|
6
6
|
export interface AXEntityPropertyWidget {
|
|
@@ -138,7 +138,7 @@ export interface AXPCommandActionLook {
|
|
|
138
138
|
export type AXPCommandActionPriority = 'primary' | 'secondary';
|
|
139
139
|
export type AXPCommandActionCallback = string | {
|
|
140
140
|
name: string;
|
|
141
|
-
options
|
|
141
|
+
options?: {
|
|
142
142
|
decoration?: {
|
|
143
143
|
header?: {
|
|
144
144
|
title?: string;
|
|
@@ -153,6 +153,7 @@ export type AXPCommandActionCallback = string | {
|
|
|
153
153
|
};
|
|
154
154
|
[name: string]: any;
|
|
155
155
|
};
|
|
156
|
+
metadata?: AXPMetaData;
|
|
156
157
|
};
|
|
157
158
|
export interface AXPCommandAction extends Partial<AXPCommandActionLook> {
|
|
158
159
|
name?: string;
|
|
@@ -4,8 +4,10 @@ export type AXPExpressionEvaluatorScope = {
|
|
|
4
4
|
[name: string]: Function;
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
|
+
export type AXPExpression = string;
|
|
7
8
|
export declare class AXPExpressionEvaluatorService {
|
|
8
|
-
evaluateExpression(obj: any, templateExpression:
|
|
9
|
+
evaluateExpression(obj: any, templateExpression: any, scope: AXPExpressionEvaluatorScope): Promise<any>;
|
|
10
|
+
private evaluateStringExpression;
|
|
9
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPExpressionEvaluatorService, never>;
|
|
10
12
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPExpressionEvaluatorService>;
|
|
11
13
|
}
|
|
@@ -628,25 +628,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
628
628
|
class AXPExpressionEvaluatorService {
|
|
629
629
|
async evaluateExpression(obj, templateExpression, scope) {
|
|
630
630
|
try {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
631
|
+
if (typeof templateExpression === 'string' && templateExpression.includes('{{')) {
|
|
632
|
+
return await this.evaluateStringExpression(templateExpression, scope);
|
|
633
|
+
}
|
|
634
|
+
else if (typeof templateExpression === 'object') {
|
|
635
|
+
const evaluatedObject = {};
|
|
636
|
+
for (const key in templateExpression) {
|
|
637
|
+
if (templateExpression.hasOwnProperty(key)) {
|
|
638
|
+
evaluatedObject[key] = await this.evaluateExpression(obj, templateExpression[key], scope);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return evaluatedObject;
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
return templateExpression;
|
|
635
645
|
}
|
|
636
|
-
const expression = expressionMatch[1];
|
|
637
|
-
// Cache the evaluation function instead of the result.
|
|
638
|
-
const evaluationFunction = async () => {
|
|
639
|
-
const sandbox = new Function('scope', `with (scope) { return (async function() { return ${expression}; })(); }`);
|
|
640
|
-
// Call the sandbox passing in the current global scope and the object.
|
|
641
|
-
return await sandbox(scope);
|
|
642
|
-
};
|
|
643
|
-
return await evaluationFunction();
|
|
644
646
|
}
|
|
645
647
|
catch (error) {
|
|
646
648
|
console.error('Error evaluating expression:', error);
|
|
647
649
|
return false;
|
|
648
650
|
}
|
|
649
651
|
}
|
|
652
|
+
async evaluateStringExpression(templateExpression, scope) {
|
|
653
|
+
const expressionMatch = templateExpression.match(/\{\{\s*(.*?)\s*\}\}/);
|
|
654
|
+
if (!expressionMatch) {
|
|
655
|
+
throw Error(`No valid expression found in "${templateExpression}"`);
|
|
656
|
+
}
|
|
657
|
+
const expression = expressionMatch[1];
|
|
658
|
+
const evaluationFunction = async () => {
|
|
659
|
+
const sandbox = new Function('scope', `with (scope) { return (async function() { return ${expression}; })(); }`);
|
|
660
|
+
return await sandbox(scope);
|
|
661
|
+
};
|
|
662
|
+
return await evaluationFunction();
|
|
663
|
+
}
|
|
650
664
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPExpressionEvaluatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
651
665
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPExpressionEvaluatorService, providedIn: 'root' }); }
|
|
652
666
|
}
|