@acorex/platform 19.2.9 → 19.2.11

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 (57) hide show
  1. package/common/lib/app/application.types.d.ts +3 -2
  2. package/common/lib/settings/settings.service.d.ts +1 -0
  3. package/common/lib/utils/expression-evaluator.service.d.ts +3 -1
  4. package/fesm2022/acorex-platform-common.mjs +49 -15
  5. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  6. package/fesm2022/acorex-platform-layout-builder.mjs +25 -6
  7. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-layout-designer.mjs +31 -12
  9. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-layout-entity.mjs +102 -86
  11. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  12. 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
  13. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Bvwr0PVk.mjs.map +1 -0
  14. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-De61n012.mjs → acorex-platform-themes-default-entity-master-list-view.component-7KY7G6qo.mjs} +9 -16
  15. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-7KY7G6qo.mjs.map +1 -0
  16. 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
  17. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BAU_s90_.mjs.map +1 -0
  18. package/fesm2022/{acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs → acorex-platform-themes-default-setting-page.component-DYumYm5k.mjs} +3 -3
  19. package/fesm2022/{acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs.map → acorex-platform-themes-default-setting-page.component-DYumYm5k.mjs.map} +1 -1
  20. package/fesm2022/acorex-platform-themes-default.mjs +15 -16
  21. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  22. package/fesm2022/acorex-platform-widgets.mjs +546 -341
  23. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  24. package/layout/builder/lib/builder/widget-column-renderer.d.ts +2 -1
  25. package/layout/builder/lib/builder/widget-map.d.ts +2 -0
  26. package/layout/builder/lib/builder/widget.types.d.ts +13 -0
  27. package/layout/designer/lib/designer/components/drawers/data-sources/data-sources.component.d.ts +3 -0
  28. package/layout/entity/lib/entity-master-create.viewmodel.d.ts +2 -1
  29. package/layout/entity/lib/entity-master-list.viewmodel.d.ts +2 -2
  30. package/layout/entity/lib/entity-master-update.viewmodel.d.ts +4 -3
  31. package/layout/entity/lib/entity.viewmodel.d.ts +3 -0
  32. package/package.json +5 -5
  33. package/themes/default/lib/layouts/entity-layouts/entity-master-create-view/entity-master-create-view.component.d.ts +2 -0
  34. package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +2 -1
  35. package/themes/default/lib/layouts/entity-layouts/entity-master-modify-view/entity-master-modify-view.component.d.ts +2 -0
  36. package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +0 -1
  37. package/widgets/lib/widgets/advance/file/file-box-widget-edit.component.d.ts +6 -4
  38. package/widgets/lib/widgets/advance/file/file-box-widget-view.component.d.ts +9 -7
  39. package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget-edit.component.d.ts +21 -14
  40. package/widgets/lib/widgets/charts/bar-chart/bar-chart.type.d.ts +4 -12
  41. package/widgets/lib/widgets/charts/gauge-chart/gauge-chart-widget-edit.component.d.ts +42 -0
  42. package/widgets/lib/widgets/charts/gauge-chart/gauge-chart-widget.config.d.ts +7 -0
  43. package/widgets/lib/widgets/charts/gauge-chart/gauge-chart.type.d.ts +21 -0
  44. package/widgets/lib/widgets/charts/gauge-chart/index.d.ts +2 -0
  45. package/widgets/lib/widgets/charts/sticky-note/index.d.ts +2 -0
  46. package/widgets/lib/widgets/charts/sticky-note/sticky-note-widget-edit.component.d.ts +9 -0
  47. package/widgets/lib/widgets/charts/sticky-note/sticky-note-widget.config.d.ts +7 -0
  48. package/widgets/lib/widgets/editors/tabular-data/index.d.ts +3 -3
  49. package/widgets/lib/widgets/editors/tabular-data/{table-widget-column.component.d.ts → tabular-data-column.component.d.ts} +3 -3
  50. package/widgets/lib/widgets/editors/tabular-data/tabular-data-filter.component.d.ts +6 -0
  51. package/widgets/lib/widgets/editors/tabular-data/tabular-data-widget-edit.component.d.ts +3 -3
  52. package/widgets/lib/widgets/editors/tabular-data/{table-widget-print.component.d.ts → tabular-data-widget-print.component.d.ts} +3 -3
  53. package/widgets/lib/widgets/index.d.ts +2 -0
  54. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-BK8BItxL.mjs.map +0 -1
  55. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-De61n012.mjs.map +0 -1
  56. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-U8aBv1Ql.mjs.map +0 -1
  57. package/widgets/lib/widgets/editors/tabular-data/table-widget-filter.component.d.ts +0 -6
@@ -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;
@@ -32,5 +32,6 @@ declare class ScopedSettingService {
32
32
  defaultValues(): Promise<Record<string, unknown>>;
33
33
  set<T = any>(key: string, value: T): Promise<void>;
34
34
  set<T = any>(values: Record<string, T>): Promise<void>;
35
+ update<T = any>(key: string, updateFn: (currentValue: T) => T): Promise<void>;
35
36
  }
36
37
  export {};
@@ -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
  }
@@ -2273,7 +2287,12 @@ class AXPSettingService {
2273
2287
  this.onChanged = new Subject();
2274
2288
  this.broadcastChannel = new BroadcastChannel('AXPSettingChannel'); // BroadcastChannel for sync
2275
2289
  // Initialize scoped caches for dynamic scopes
2276
- const staticScopes = [AXPSettingScope.Environment, AXPSettingScope.Global, AXPSettingScope.Tenant, AXPSettingScope.User];
2290
+ const staticScopes = [
2291
+ AXPSettingScope.Environment,
2292
+ AXPSettingScope.Global,
2293
+ AXPSettingScope.Tenant,
2294
+ AXPSettingScope.User,
2295
+ ];
2277
2296
  staticScopes.forEach((scope) => {
2278
2297
  if (!this.scopedSettingsCache.has(scope)) {
2279
2298
  this.scopedSettingsCache.set(scope, new Map());
@@ -2310,7 +2329,12 @@ class AXPSettingService {
2310
2329
  if (this.scopedSettingsCache.size === 0) {
2311
2330
  await this.load();
2312
2331
  }
2313
- const scopeOrder = [AXPSettingScope.User, AXPSettingScope.Tenant, AXPSettingScope.Global, AXPSettingScope.Environment];
2332
+ const scopeOrder = [
2333
+ AXPSettingScope.User,
2334
+ AXPSettingScope.Tenant,
2335
+ AXPSettingScope.Global,
2336
+ AXPSettingScope.Environment,
2337
+ ];
2314
2338
  for (const scope of scopeOrder) {
2315
2339
  const scopeCache = this.scopedSettingsCache.get(scope);
2316
2340
  if (scopeCache && scopeCache.has(key)) {
@@ -2325,7 +2349,12 @@ class AXPSettingService {
2325
2349
  return get(defaults, key); // Fallback if no value is found
2326
2350
  }
2327
2351
  async defaultValues(scope) {
2328
- let scopeOrder = [AXPSettingScope.Environment, AXPSettingScope.Global, AXPSettingScope.Tenant, AXPSettingScope.User].reverse();
2352
+ let scopeOrder = [
2353
+ AXPSettingScope.Environment,
2354
+ AXPSettingScope.Global,
2355
+ AXPSettingScope.Tenant,
2356
+ AXPSettingScope.User,
2357
+ ].reverse();
2329
2358
  const scopeIndex = scopeOrder.indexOf(scope);
2330
2359
  if (scopeIndex === -1) {
2331
2360
  throw new Error(`Invalid scope: ${scope}`);
@@ -2412,6 +2441,11 @@ class ScopedSettingService {
2412
2441
  });
2413
2442
  }
2414
2443
  }
2444
+ async update(key, updateFn) {
2445
+ const currentValue = await this.get(key);
2446
+ const newValue = updateFn(currentValue);
2447
+ await this.set(key, newValue);
2448
+ }
2415
2449
  }
2416
2450
 
2417
2451
  //TODO Loading, Redirect, Drawer, Show toast