@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.
Files changed (42) hide show
  1. package/common/lib/app/application.types.d.ts +3 -2
  2. package/common/lib/utils/expression-evaluator.service.d.ts +3 -1
  3. package/fesm2022/acorex-platform-common.mjs +26 -12
  4. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-layout-builder.mjs +20 -4
  6. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-layout-designer.mjs +31 -12
  8. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-layout-entity.mjs +45 -64
  10. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  11. 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
  12. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Bvwr0PVk.mjs.map +1 -0
  13. 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
  14. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BzLgFr7D.mjs.map +1 -0
  15. 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
  16. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BAU_s90_.mjs.map +1 -0
  17. package/fesm2022/{acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs → acorex-platform-themes-default-setting-page.component-DYumYm5k.mjs} +3 -3
  18. package/fesm2022/{acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs.map → acorex-platform-themes-default-setting-page.component-DYumYm5k.mjs.map} +1 -1
  19. package/fesm2022/acorex-platform-themes-default.mjs +14 -15
  20. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-widgets.mjs +215 -124
  22. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  23. package/layout/builder/lib/builder/widget-map.d.ts +1 -0
  24. package/layout/builder/lib/builder/widget.types.d.ts +13 -0
  25. package/layout/designer/lib/designer/components/drawers/data-sources/data-sources.component.d.ts +3 -0
  26. package/layout/entity/lib/entity-master-create.viewmodel.d.ts +2 -1
  27. package/layout/entity/lib/entity-master-update.viewmodel.d.ts +4 -3
  28. package/layout/entity/lib/entity.viewmodel.d.ts +2 -0
  29. package/package.json +5 -5
  30. package/themes/default/lib/layouts/entity-layouts/entity-master-create-view/entity-master-create-view.component.d.ts +2 -0
  31. package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +2 -1
  32. package/themes/default/lib/layouts/entity-layouts/entity-master-modify-view/entity-master-modify-view.component.d.ts +2 -0
  33. package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +0 -1
  34. package/widgets/lib/widgets/advance/file/file-box-widget-edit.component.d.ts +6 -4
  35. package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget-edit.component.d.ts +3 -3
  36. package/widgets/lib/widgets/charts/gauge-chart/gauge-chart-widget-edit.component.d.ts +14 -0
  37. package/widgets/lib/widgets/charts/gauge-chart/gauge-chart-widget.config.d.ts +7 -0
  38. package/widgets/lib/widgets/charts/gauge-chart/gauge-chart.type.d.ts +17 -0
  39. package/widgets/lib/widgets/charts/gauge-chart/index.d.ts +2 -0
  40. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-BK8BItxL.mjs.map +0 -1
  41. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-De61n012.mjs.map +0 -1
  42. 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: string, scope: AXPExpressionEvaluatorScope): Promise<any>;
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
- // Check cache first, but cache the function for evaluation, not the evaluated value
632
- const expressionMatch = templateExpression.match(/\{\{\s*(.*?)\s*\}\}/);
633
- if (!expressionMatch) {
634
- throw Error(`No valid expression found in "${templateExpression}"`);
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
  }