@acorex/platform 19.2.6 → 19.2.8

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 (81) hide show
  1. package/common/lib/app/application.types.d.ts +4 -1
  2. package/common/lib/settings/settings.service.d.ts +3 -2
  3. package/common/lib/utils/export-popup.d.ts +2 -1
  4. package/common/lib/utils/expression-evaluator.service.d.ts +11 -0
  5. package/common/lib/utils/index.d.ts +1 -0
  6. package/fesm2022/acorex-platform-common.mjs +86 -28
  7. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-layout-builder.mjs +23 -4
  9. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-layout-designer.mjs +5 -5
  11. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-layout-entity.mjs +55 -19
  13. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  14. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-ClNKQnoc.mjs → acorex-platform-themes-default-entity-master-list-view.component-De61n012.mjs} +28 -15
  15. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-De61n012.mjs.map +1 -0
  16. package/fesm2022/{acorex-platform-themes-default-search-popup.component-BZJTLnlM.mjs → acorex-platform-themes-default-search-popup.component-Blkpqvqa.mjs} +4 -4
  17. package/fesm2022/{acorex-platform-themes-default-search-popup.component-BZJTLnlM.mjs.map → acorex-platform-themes-default-search-popup.component-Blkpqvqa.mjs.map} +1 -1
  18. package/fesm2022/{acorex-platform-themes-default-setting-page.component-oA4kM_-3.mjs → acorex-platform-themes-default-setting-page.component-BERYnJnp.mjs} +8 -8
  19. package/fesm2022/acorex-platform-themes-default-setting-page.component-BERYnJnp.mjs.map +1 -0
  20. package/fesm2022/{acorex-platform-themes-default-setting-view.component-CJZBhtKE.mjs → acorex-platform-themes-default-setting-view.component-BagAWM4W.mjs} +2 -2
  21. package/fesm2022/{acorex-platform-themes-default-setting-view.component-CJZBhtKE.mjs.map → acorex-platform-themes-default-setting-view.component-BagAWM4W.mjs.map} +1 -1
  22. package/fesm2022/{acorex-platform-themes-default-theme-palette-preview.page-D_AK8uVB.mjs → acorex-platform-themes-default-theme-palette-preview.page-D-yzbISw.mjs} +25 -5
  23. package/fesm2022/acorex-platform-themes-default-theme-palette-preview.page-D-yzbISw.mjs.map +1 -0
  24. package/fesm2022/acorex-platform-themes-default.mjs +24 -17
  25. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  26. package/fesm2022/acorex-platform-themes-shared.mjs +112 -54
  27. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  28. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-B90if8wb.mjs +272 -0
  29. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-B90if8wb.mjs.map +1 -0
  30. package/fesm2022/acorex-platform-widgets-tabular-data-view-popup.component-BaslkAPS.mjs +63 -0
  31. package/fesm2022/acorex-platform-widgets-tabular-data-view-popup.component-BaslkAPS.mjs.map +1 -0
  32. package/fesm2022/acorex-platform-widgets.mjs +779 -118
  33. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  34. package/layout/builder/lib/builder/widget-groups.d.ts +1 -0
  35. package/layout/builder/lib/builder/widget-map.d.ts +3 -0
  36. package/layout/builder/lib/builder/widget-renderer.directive.d.ts +3 -0
  37. package/layout/builder/lib/builder/widget.types.d.ts +1 -1
  38. package/layout/entity/lib/entity-master-list.viewmodel.d.ts +2 -1
  39. package/layout/entity/lib/entity.viewmodel.d.ts +3 -0
  40. package/layout/setting/lib/setting.viewmodel.d.ts +2 -2
  41. package/package.json +5 -5
  42. package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +4 -3
  43. package/themes/default/lib/layouts/entity-layouts/entity-detail-list-view/entity-detail-list-view.component.d.ts +2 -2
  44. package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +4 -4
  45. package/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.d.ts +2 -2
  46. package/themes/default/lib/layouts/root-layout/components/header/header.component.d.ts +2 -2
  47. package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +2 -2
  48. package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +2 -2
  49. package/themes/default/lib/pages/theme-palette-preview/theme-palette-preview.page.d.ts +3 -2
  50. package/themes/shared/lib/components/layout-elements/index.d.ts +1 -0
  51. package/themes/shared/lib/components/layout-elements/layout-blocks.component.d.ts +1 -1
  52. package/themes/shared/lib/components/layout-elements/layout-footer.component.d.ts +5 -0
  53. package/themes/shared/lib/components/slots/theme-slot.component.d.ts +2 -2
  54. package/themes/shared/lib/theme.service.d.ts +2 -2
  55. package/widgets/lib/widgets/advance/file/file-box-widget-edit.component.d.ts +3 -1
  56. package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget-edit.component.d.ts +33 -0
  57. package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget.config.d.ts +7 -0
  58. package/widgets/lib/widgets/charts/bar-chart/bar-chart.type.d.ts +29 -0
  59. package/widgets/lib/widgets/charts/bar-chart/index.d.ts +2 -0
  60. package/widgets/lib/widgets/charts/chart.type.d.ts +4 -0
  61. package/widgets/lib/widgets/charts/donut-chart/donut-chart-widget-edit.component.d.ts +14 -0
  62. package/widgets/lib/widgets/charts/donut-chart/donut-chart-widget.config.d.ts +7 -0
  63. package/widgets/lib/widgets/charts/donut-chart/donut-chart.type.d.ts +13 -0
  64. package/widgets/lib/widgets/charts/donut-chart/index.d.ts +2 -0
  65. package/widgets/lib/widgets/editors/date-time/date-time-box-widget-edit.component.d.ts +1 -3
  66. package/widgets/lib/widgets/editors/rich-text/rich-text-widget-edit.component.d.ts +4 -1
  67. package/widgets/lib/widgets/editors/tabular-data/index.d.ts +6 -0
  68. package/widgets/lib/widgets/editors/tabular-data/table-widget-column.component.d.ts +6 -0
  69. package/widgets/lib/widgets/editors/tabular-data/table-widget-filter.component.d.ts +6 -0
  70. package/widgets/lib/widgets/editors/tabular-data/table-widget-print.component.d.ts +6 -0
  71. package/widgets/lib/widgets/editors/tabular-data/table-widget.config.d.ts +7 -0
  72. package/widgets/lib/widgets/editors/tabular-data/tabular-data-edit-popup.component.d.ts +27 -0
  73. package/widgets/lib/widgets/editors/tabular-data/tabular-data-view-popup.component.d.ts +12 -0
  74. package/widgets/lib/widgets/editors/tabular-data/tabular-data-widget-edit.component.d.ts +12 -0
  75. package/widgets/lib/widgets/editors/tabular-data/tabular-data-widget-view.component.d.ts +11 -0
  76. package/widgets/lib/widgets/editors/tabular-data/tabular-widget.types.d.ts +11 -0
  77. package/widgets/lib/widgets/editors/text/text-box-widget-edit.component.d.ts +0 -1
  78. package/widgets/lib/widgets/index.d.ts +2 -0
  79. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-ClNKQnoc.mjs.map +0 -1
  80. package/fesm2022/acorex-platform-themes-default-setting-page.component-oA4kM_-3.mjs.map +0 -1
  81. package/fesm2022/acorex-platform-themes-default-theme-palette-preview.page-D_AK8uVB.mjs.map +0 -1
@@ -2,13 +2,13 @@ import * as i2$1 from '@acorex/components/common';
2
2
  import { AXDataSource, AXCommonModule } from '@acorex/components/common';
3
3
  import { AXFormatService } from '@acorex/core/format';
4
4
  import * as i1$3 from '@acorex/platform/common';
5
- import { resolveActionLook, AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPSettingScope, AXPSettingService, AXPRefreshEvent, AXPWorkflowNavigateAction, AXP_SEARCH_DEFINITION_PROVIDER, AXPToastAction } from '@acorex/platform/common';
5
+ import { resolveActionLook, AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPSettingScope, AXPSettingService, AXPExpressionEvaluatorService, AXPRefreshEvent, AXPWorkflowNavigateAction, AXP_SEARCH_DEFINITION_PROVIDER, AXPToastAction } from '@acorex/platform/common';
6
6
  import * as i2$3 from '@acorex/platform/workflow';
7
7
  import { AXPWorkflowService, ofType, createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
8
8
  import * as i0 from '@angular/core';
9
9
  import { InjectionToken, inject, Injectable, computed, signal, Injector, effect, Component, ChangeDetectionStrategy, HostBinding, DestroyRef, ViewChild, NgModule } from '@angular/core';
10
10
  import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
11
- import { cloneDeep, set, merge, isNil, get, sortBy } from 'lodash-es';
11
+ import { cloneDeep, set, merge, get, isNil, sortBy } from 'lodash-es';
12
12
  import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
13
13
  import * as i7 from '@acorex/platform/layout/builder';
14
14
  import { AXPWidgetRegistryService, AXPWidgetComponent, AXPLayoutBuilderModule, AXPColumnWidgetComponent, AXP_WIDGETS_EDITOR_GROUP, AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
@@ -77,7 +77,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
77
77
 
78
78
  class AXPEntityCommandTriggerViewModel {
79
79
  constructor(entity, action) {
80
- this.name = typeof action.command === 'string' ? action.command : action.command.name;
80
+ this.name = `${typeof action.command === 'string' ? action.command : action.command.name}&${action.name}`;
81
81
  this.options = typeof action.command === 'object' ? action.command.options : undefined;
82
82
  const resolvedLook = resolveActionLook(action);
83
83
  this.priority = action.priority;
@@ -85,6 +85,8 @@ class AXPEntityCommandTriggerViewModel {
85
85
  this.separated = action.separated ?? false;
86
86
  this.color = action.color ?? resolvedLook.color;
87
87
  this.icon = action.icon ?? resolvedLook.icon;
88
+ this.hidden = action.hidden ?? false;
89
+ this.disabled = action.disabled ?? false;
88
90
  this.scope = action.scope;
89
91
  }
90
92
  }
@@ -138,7 +140,9 @@ class AXPEntityDetailListViewModel {
138
140
  });
139
141
  //****************** Title ******************//
140
142
  this.title = computed(() => {
141
- return this.detailEntityConfig.title ?? this.detailEntity()?.interfaces?.detail?.list?.title ?? this.detailEntity()?.formats.plural;
143
+ return (this.detailEntityConfig.title ??
144
+ this.detailEntity()?.interfaces?.detail?.list?.title ??
145
+ this.detailEntity()?.formats.plural);
142
146
  });
143
147
  //****************** Inline filter ******************//
144
148
  this.inlineFiltersPlaceholders = computed(() => {
@@ -157,10 +161,14 @@ class AXPEntityDetailListViewModel {
157
161
  return this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Selected).length;
158
162
  });
159
163
  this.primaryActions = computed(() => {
160
- return this.allActions().filter((a) => a.priority == 'primary' && ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) || (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
164
+ return this.allActions().filter((a) => a.priority == 'primary' &&
165
+ ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) ||
166
+ (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
161
167
  });
162
168
  this.secondaryActions = computed(() => {
163
- return this.allActions().filter((a) => a.priority == 'secondary' && ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) || (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
169
+ return this.allActions().filter((a) => a.priority == 'secondary' &&
170
+ ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) ||
171
+ (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
164
172
  });
165
173
  this.primaryRowActions = computed(() => this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Individual && a.priority === 'primary'));
166
174
  this.secondaryRowActions = computed(() => this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Individual && a.priority === 'secondary'));
@@ -256,7 +264,11 @@ class AXPEntityDetailListViewModel {
256
264
  }
257
265
  //****************** Commands ******************//
258
266
  async executeCommand(commandName, data = null) {
259
- const action = this.allActions().find((c) => c.name == commandName && ((this.selectedItems().length ? c.scope == AXPEntityCommandScope.Selected : c.scope == AXPEntityCommandScope.Individual) || c.scope == AXPEntityCommandScope.TypeLevel));
267
+ const action = this.allActions().find((c) => c.name == commandName &&
268
+ ((this.selectedItems().length
269
+ ? c.scope == AXPEntityCommandScope.Selected
270
+ : c.scope == AXPEntityCommandScope.Individual) ||
271
+ c.scope == AXPEntityCommandScope.TypeLevel));
260
272
  if (action?.scope == AXPEntityCommandScope.TypeLevel) {
261
273
  if (data == null) {
262
274
  data = {};
@@ -272,7 +284,8 @@ class AXPEntityDetailListViewModel {
272
284
  }
273
285
  }
274
286
  console.log({ action, detailEntity: this.detailEntity });
275
- await this.workflow.execute(commandName, {
287
+ const command = commandName.split('&')[0];
288
+ await this.workflow.execute(command, {
276
289
  entity: getEntityInfo(this.detailEntity()).source,
277
290
  data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data,
278
291
  entityInfo: {
@@ -580,6 +593,7 @@ class AXPEntityMasterListViewModel {
580
593
  this.workflow = this.injector.get(AXPWorkflowService);
581
594
  this.settings = this.injector.get(AXPSettingService);
582
595
  this.widgetResolver = this.injector.get(AXPWidgetRegistryService);
596
+ this.expressionEvaluator = this.injector.get(AXPExpressionEvaluatorService);
583
597
  this.filterOperatorMiddleware = this.injector.get(AXPFilterOperatorMiddlewareService);
584
598
  this.settingListViewKey = '';
585
599
  this.settingSelectedViewKey = '';
@@ -667,7 +681,6 @@ class AXPEntityMasterListViewModel {
667
681
  return this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Selected).length;
668
682
  });
669
683
  this.primaryRowActions = computed(() => this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Individual && a.priority === 'primary'));
670
- this.secondaryRowActions = computed(() => this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Individual && a.priority === 'secondary'));
671
684
  //****************** Filter ******************//
672
685
  this.simpleFilters = signal({
673
686
  field: null,
@@ -730,7 +743,6 @@ class AXPEntityMasterListViewModel {
730
743
  .pipe(ofType(AXPRefreshEvent))
731
744
  .pipe(takeUntil(this.destroyed))
732
745
  .subscribe((event) => {
733
- debugger;
734
746
  if (event.payload.entity == getEntityInfo(this.entityDef).source) {
735
747
  this.selectedItems.set([]);
736
748
  this.events$.next({ action: 'refresh', meta: event.payload.meta });
@@ -752,6 +764,30 @@ class AXPEntityMasterListViewModel {
752
764
  clearSelection() {
753
765
  this.selectedItems.set([]);
754
766
  }
767
+ // public secondaryRowActions = computed<AXPEntityCommandTriggerViewModel[]>(() =>
768
+ // this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Individual && a.priority === 'secondary')
769
+ // );
770
+ async secondaryRowActions(rowData) {
771
+ const scope = {
772
+ context: {
773
+ eval: (path) => get(rowData, path),
774
+ },
775
+ };
776
+ const actions = await Promise.all(this.allActions()
777
+ .filter((a) => a.scope === AXPEntityCommandScope.Individual && a.priority === 'secondary')
778
+ .map(async (a) => {
779
+ const isHidden = typeof a.hidden === 'string' && a.hidden.includes('{{')
780
+ ? await this.expressionEvaluator.evaluateExpression(rowData, a.hidden, scope)
781
+ : a.hidden;
782
+ if (isHidden)
783
+ return null;
784
+ const disabled = typeof a.disabled === 'string' && a.disabled.includes('{{')
785
+ ? await this.expressionEvaluator.evaluateExpression(rowData, a.disabled, scope)
786
+ : a.disabled;
787
+ return { ...a, disabled };
788
+ }));
789
+ return actions.filter(Boolean);
790
+ }
755
791
  get filtersDef() {
756
792
  const props = this.entityDef.properties.filter((c) => c.options?.filter?.advance?.enabled);
757
793
  return props.map((e) => {
@@ -920,12 +956,15 @@ class AXPEntityMasterListViewModel {
920
956
  }
921
957
  //****************** Commands ******************//
922
958
  async executeCommand(commandName, data = null) {
923
- const action = this.allActions().find((c) => c.name == commandName &&
924
- ((this.selectedItems().length
925
- ? c.scope == AXPEntityCommandScope.Selected
926
- : c.scope == AXPEntityCommandScope.Individual) ||
927
- c.scope == AXPEntityCommandScope.TypeLevel));
928
- await this.workflow.execute(commandName, {
959
+ const action = this.allActions().find((c) => {
960
+ return (c.name == commandName &&
961
+ ((this.selectedItems().length
962
+ ? c.scope == AXPEntityCommandScope.Selected
963
+ : c.scope == AXPEntityCommandScope.Individual) ||
964
+ c.scope == AXPEntityCommandScope.TypeLevel));
965
+ });
966
+ const command = commandName.split('&')[0];
967
+ await this.workflow.execute(command, {
929
968
  entity: getEntityInfo(this.entityDef).source,
930
969
  entityInfo: {
931
970
  name: this.entityDef.name,
@@ -989,7 +1028,6 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
989
1028
  const showResult = process?.showResult ?? true;
990
1029
  const ids = Array.isArray(data) ? data.map((c) => c.id) : [data.id];
991
1030
  const entity = await this.entityRegistery.resolve(moduleName, entityName);
992
- debugger;
993
1031
  if (entity.parentKey && data[entity.parentKey]) {
994
1032
  context.setVariable('meta', { ...meta, refreshTargetId: data[entity.parentKey] });
995
1033
  }
@@ -2539,7 +2577,6 @@ class AXPEntityCreatePopupAction extends AXPWorkflowAction {
2539
2577
  const prevData = context.getVariable('data');
2540
2578
  const prevMeta = context.getVariable('meta');
2541
2579
  context.setVariable('data', { ...prevData, ...result.data.item });
2542
- debugger;
2543
2580
  if (entityRef.parentKey && result.data.item[entityRef.parentKey]) {
2544
2581
  context.setVariable('meta', { ...prevMeta, refreshTargetId: result.data.item[entityRef.parentKey] });
2545
2582
  }
@@ -2614,7 +2651,6 @@ class AXPQuickEntityModifyPopupAction extends AXPWorkflowAction {
2614
2651
  this.factory = inject(AXPEntityMasterUpdateViewModelFactory);
2615
2652
  }
2616
2653
  async execute(context) {
2617
- debugger;
2618
2654
  const [moduleName, entityName] = context.getVariable('entity').split('.');
2619
2655
  const data = context.getVariable('data');
2620
2656
  const entityRef = await this.entityRegistery.resolve(moduleName, entityName);