@acorex/platform 19.2.7 → 19.2.9

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 (97) hide show
  1. package/common/lib/app/application.types.d.ts +8 -0
  2. package/common/lib/utils/index.d.ts +2 -0
  3. package/common/lib/utils/regional-util.service.d.ts +15 -0
  4. package/common/lib/utils/regional.types.d.ts +55 -0
  5. package/fesm2022/acorex-platform-common.mjs +4 -2
  6. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-core.mjs +35 -16
  8. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-layout-builder.mjs +83 -23
  10. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-layout-designer.mjs +27 -26
  12. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-entity.mjs +123 -63
  14. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  15. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-Bl9f4Rtk.mjs → acorex-platform-themes-default-entity-master-create-view.component-BK8BItxL.mjs} +2 -2
  16. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-BK8BItxL.mjs.map +1 -0
  17. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-B4aBmc5H.mjs → acorex-platform-themes-default-entity-master-single-view.component-BGUrwL2P.mjs} +3 -3
  18. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BGUrwL2P.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs +74 -0
  20. package/fesm2022/acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-themes-default-setting-view.component-CsCug3Vu.mjs +71 -0
  22. package/fesm2022/acorex-platform-themes-default-setting-view.component-CsCug3Vu.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-themes-default.mjs +24 -14
  24. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-themes-shared.mjs +10 -1
  26. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  27. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-BiCinIok.mjs +274 -0
  28. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-BiCinIok.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-BBRVgZLu.mjs → acorex-platform-widgets-tabular-data-view-popup.component-BaslkAPS.mjs} +16 -1
  30. package/fesm2022/acorex-platform-widgets-tabular-data-view-popup.component-BaslkAPS.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-widgets.mjs +512 -342
  32. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  33. package/layout/builder/lib/builder/datasource-provider.service.d.ts +3 -1
  34. package/layout/builder/lib/builder/widget-renderer.directive.d.ts +3 -0
  35. package/layout/builder/lib/builder/widget.types.d.ts +2 -0
  36. package/layout/designer/lib/property-viewer/widget-property-viewer.component.d.ts +2 -0
  37. package/layout/entity/lib/entity-detail-list.viewmodel.d.ts +3 -0
  38. package/layout/entity/lib/entity-master-create.viewmodel.d.ts +3 -1
  39. package/layout/entity/lib/entity-master-single.viewmodel.d.ts +1 -1
  40. package/layout/entity/lib/entity.viewmodel.d.ts +1 -0
  41. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +0 -2
  42. package/layout/entity/lib/widgets/widget-selector/widget-selector-widget-edit.component.d.ts +0 -2
  43. package/layout/setting/lib/setting.viewmodel.d.ts +3 -0
  44. package/package.json +5 -5
  45. package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +3 -0
  46. package/themes/default/lib/layouts/entity-layouts/entity-detail-list-view/entity-detail-list-view.component.d.ts +3 -0
  47. package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +3 -0
  48. package/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.d.ts +3 -0
  49. package/themes/default/lib/layouts/root-layout/components/header/header.component.d.ts +3 -0
  50. package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +6 -0
  51. package/themes/default/lib/layouts/root-layout/root-layout.module.d.ts +2 -1
  52. package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +3 -0
  53. package/themes/default/lib/pages/theme-palette-preview/theme-palette-preview.page.d.ts +3 -0
  54. package/themes/shared/lib/components/slots/theme-slot.component.d.ts +3 -0
  55. package/themes/shared/lib/setting.keys.d.ts +2 -1
  56. package/themes/shared/lib/theme.service.d.ts +3 -0
  57. package/widgets/lib/properties/data-source.props.d.ts +3 -0
  58. package/widgets/lib/properties/editors.props.d.ts +0 -1
  59. package/widgets/lib/properties/index.d.ts +1 -0
  60. package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget-edit.component.d.ts +18 -3
  61. package/widgets/lib/widgets/charts/bar-chart/bar-chart.type.d.ts +20 -6
  62. package/widgets/lib/widgets/editors/checkbox/checkbox-widget-edit.component.d.ts +0 -2
  63. package/widgets/lib/widgets/editors/color/color-box-widget-edit.component.d.ts +0 -2
  64. package/widgets/lib/widgets/editors/contact/contact-widget-edit.component.d.ts +0 -4
  65. package/widgets/lib/widgets/editors/date-time/date-time-box-widget-edit.component.d.ts +0 -4
  66. package/widgets/lib/widgets/editors/email/email-box-widget-edit.component.d.ts +0 -4
  67. package/widgets/lib/widgets/editors/large-text/large-text-widget-edit.component.d.ts +0 -2
  68. package/widgets/lib/widgets/editors/link/link-widget-edit.component.d.ts +0 -4
  69. package/widgets/lib/widgets/editors/number/number-box-widget-edit.component.d.ts +0 -2
  70. package/widgets/lib/widgets/editors/phone/phone-box-widget-edit.component.d.ts +0 -4
  71. package/widgets/lib/widgets/editors/rich-text/rich-text-widget-edit.component.d.ts +4 -3
  72. package/widgets/lib/widgets/editors/select/select-box-widget-edit.component.d.ts +0 -2
  73. package/widgets/lib/widgets/editors/selection-list/selection-list-widget-edit.component.d.ts +0 -2
  74. package/widgets/lib/widgets/editors/tabular-data/tabular-data-edit-popup.component.d.ts +11 -3
  75. package/widgets/lib/widgets/editors/tabular-data/tabular-data-view-popup.component.d.ts +3 -1
  76. package/widgets/lib/widgets/editors/tabular-data/tabular-data-widget-edit.component.d.ts +1 -1
  77. package/widgets/lib/widgets/editors/tabular-data/tabular-data-widget-view.component.d.ts +0 -2
  78. package/widgets/lib/widgets/editors/text/text-box-widget-edit.component.d.ts +0 -2
  79. package/widgets/lib/widgets/validations/base-validation/base-validation.d.ts +3 -2
  80. package/widgets/lib/widgets/validations/between-validation/between-validation-widget-edit.component.d.ts +1 -7
  81. package/widgets/lib/widgets/validations/callback-validation/callback-validation-widget-edit.component.d.ts +1 -7
  82. package/widgets/lib/widgets/validations/equal-validation/equal-validation-widget-edit.component.d.ts +1 -7
  83. package/widgets/lib/widgets/validations/greater-than-validation/greater-than-validation-widget-edit.component.d.ts +1 -7
  84. package/widgets/lib/widgets/validations/less-than-validation/less-than-validation-widget-edit.component.d.ts +1 -7
  85. package/widgets/lib/widgets/validations/max-length-validation/max-length-validation-widget-edit.component.d.ts +1 -7
  86. package/widgets/lib/widgets/validations/min-length-validation/min-length-validation-widget-edit.component.d.ts +1 -7
  87. package/widgets/lib/widgets/validations/regular-expression-validation/regular-expression-validation-widget-edit.component.d.ts +1 -7
  88. package/widgets/lib/widgets/validations/required-validation/required-validation-widget-edit.component.d.ts +1 -7
  89. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Bl9f4Rtk.mjs.map +0 -1
  90. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B4aBmc5H.mjs.map +0 -1
  91. package/fesm2022/acorex-platform-themes-default-setting-page.component-BERYnJnp.mjs +0 -74
  92. package/fesm2022/acorex-platform-themes-default-setting-page.component-BERYnJnp.mjs.map +0 -1
  93. package/fesm2022/acorex-platform-themes-default-setting-view.component-BagAWM4W.mjs +0 -71
  94. package/fesm2022/acorex-platform-themes-default-setting-view.component-BagAWM4W.mjs.map +0 -1
  95. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-D2-nHqYy.mjs +0 -144
  96. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-D2-nHqYy.mjs.map +0 -1
  97. package/fesm2022/acorex-platform-widgets-tabular-data-view-popup.component-BBRVgZLu.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, AXPExpressionEvaluatorService, AXPRefreshEvent, AXPWorkflowNavigateAction, AXP_SEARCH_DEFINITION_PROVIDER, AXPToastAction } from '@acorex/platform/common';
5
+ import { resolveActionLook, AXPFilterOperatorMiddlewareService, AXPExpressionEvaluatorService, AXPEntityCommandScope, getEntityInfo, AXPSettingScope, AXPSettingService, 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
+ import { get, cloneDeep, set, merge, isNil, sortBy } from 'lodash-es';
10
11
  import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
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;
@@ -119,6 +119,7 @@ class AXPEntityDetailListViewModel {
119
119
  this.formatService = this.injector.get(AXFormatService);
120
120
  this.workflow = this.injector.get(AXPWorkflowService);
121
121
  this.filterOperatorMiddleware = this.injector.get(AXPFilterOperatorMiddlewareService);
122
+ this.expressionEvaluator = this.injector.get(AXPExpressionEvaluatorService);
122
123
  this.dataSource = new AXDataSource({
123
124
  byKey: (key) => {
124
125
  const func = this.detailEntity()?.queries.byKey.execute;
@@ -140,7 +141,25 @@ class AXPEntityDetailListViewModel {
140
141
  });
141
142
  //****************** Title ******************//
142
143
  this.title = computed(() => {
143
- return this.detailEntityConfig.title ?? this.detailEntity()?.interfaces?.detail?.list?.title ?? this.detailEntity()?.formats.plural;
144
+ return (this.detailEntityConfig.title ??
145
+ this.detailEntity()?.interfaces?.detail?.list?.title ??
146
+ this.detailEntity()?.formats.plural);
147
+ });
148
+ //****************** Visibility ******************//
149
+ this.hidden = computed(async () => {
150
+ if (typeof this.detailEntityConfig.hidden == 'string') {
151
+ const scope = {
152
+ context: {
153
+ eval: (path) => {
154
+ return get(this.parent.data, path);
155
+ },
156
+ },
157
+ };
158
+ return await this.expressionEvaluator.evaluateExpression(this.parent.data, this.detailEntityConfig.hidden, scope);
159
+ }
160
+ else {
161
+ return this.detailEntityConfig.hidden ?? false;
162
+ }
144
163
  });
145
164
  //****************** Inline filter ******************//
146
165
  this.inlineFiltersPlaceholders = computed(() => {
@@ -153,16 +172,29 @@ class AXPEntityDetailListViewModel {
153
172
  //****************** Actions ******************//
154
173
  this.allActions = computed(() => {
155
174
  const list = this.detailEntity()?.interfaces?.master?.list?.actions ?? [];
156
- return list.map((tr) => new AXPEntityCommandTriggerViewModel(this.detailEntity(), tr)) ?? [];
175
+ const detailEntityActionList = this.detailEntityConfig.actions ?? [];
176
+ const mergedActions = list.map((tr) => {
177
+ const commandName = typeof tr.command === 'string' ? tr.command : tr.command.name;
178
+ const overrideAction = detailEntityActionList.find((action) => {
179
+ const actionCommandName = typeof action.command === 'string' ? action.command : action.command.name;
180
+ return actionCommandName === commandName && action.name === tr.name;
181
+ });
182
+ return new AXPEntityCommandTriggerViewModel(this.detailEntity(), overrideAction ?? tr);
183
+ });
184
+ return mergedActions;
157
185
  });
158
186
  this.selectedScopeActionsCount = computed(() => {
159
187
  return this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Selected).length;
160
188
  });
161
189
  this.primaryActions = computed(() => {
162
- return this.allActions().filter((a) => a.priority == 'primary' && ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) || (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
190
+ return this.allActions().filter((a) => a.priority == 'primary' &&
191
+ ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) ||
192
+ (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
163
193
  });
164
194
  this.secondaryActions = computed(() => {
165
- return this.allActions().filter((a) => a.priority == 'secondary' && ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) || (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
195
+ return this.allActions().filter((a) => a.priority == 'secondary' &&
196
+ ((a.scope == AXPEntityCommandScope.Selected && this.hasSelectedItems()) ||
197
+ (a.scope == AXPEntityCommandScope.TypeLevel && !this.hasSelectedItems())));
166
198
  });
167
199
  this.primaryRowActions = computed(() => this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Individual && a.priority === 'primary'));
168
200
  this.secondaryRowActions = computed(() => this.allActions().filter((a) => a.scope == AXPEntityCommandScope.Individual && a.priority === 'secondary'));
@@ -186,6 +218,32 @@ class AXPEntityDetailListViewModel {
186
218
  }
187
219
  return [];
188
220
  });
221
+ this.evaluateExpressions = async (actionData) => {
222
+ const parentData = this.parent.data;
223
+ const scope = {
224
+ context: {
225
+ eval: (path) => {
226
+ return get(parentData, path);
227
+ },
228
+ },
229
+ };
230
+ const evaluateRecursive = async (data) => {
231
+ const evaluatedData = {};
232
+ for (const key in data) {
233
+ if (typeof data[key] === 'object' && data[key] !== null) {
234
+ evaluatedData[key] = await evaluateRecursive(data[key]);
235
+ }
236
+ else if (typeof data[key] === 'string' && data[key].includes('{{')) {
237
+ evaluatedData[key] = await this.expressionEvaluator.evaluateExpression(parentData, data[key], scope);
238
+ }
239
+ else {
240
+ evaluatedData[key] = data[key];
241
+ }
242
+ }
243
+ return evaluatedData;
244
+ };
245
+ return await evaluateRecursive(actionData);
246
+ };
189
247
  this.initialize();
190
248
  }
191
249
  async initialize() {
@@ -258,25 +316,34 @@ class AXPEntityDetailListViewModel {
258
316
  }
259
317
  //****************** Commands ******************//
260
318
  async executeCommand(commandName, data = null) {
261
- const action = this.allActions().find((c) => c.name == commandName && ((this.selectedItems().length ? c.scope == AXPEntityCommandScope.Selected : c.scope == AXPEntityCommandScope.Individual) || c.scope == AXPEntityCommandScope.TypeLevel));
262
- if (action?.scope == AXPEntityCommandScope.TypeLevel) {
263
- if (data == null) {
264
- data = {};
265
- }
266
- let relatedColumn = null;
267
- this.detailEntityConfig.conditions?.forEach((condition) => {
268
- if (condition.value == 'id') {
269
- relatedColumn = condition.name;
270
- }
271
- });
272
- if (relatedColumn != null) {
273
- data[relatedColumn] = this.parent.data['id'];
274
- }
319
+ const action = this.allActions().find((c) => c.name == commandName &&
320
+ ((this.selectedItems().length
321
+ ? c.scope == AXPEntityCommandScope.Selected
322
+ : c.scope == AXPEntityCommandScope.Individual) ||
323
+ c.scope == AXPEntityCommandScope.TypeLevel));
324
+ // if (action?.scope == AXPEntityCommandScope.TypeLevel) {
325
+ // if (data == null) {
326
+ // data = {};
327
+ // }
328
+ // let relatedColumn: string | null = null;
329
+ // this.detailEntityConfig.conditions?.forEach((condition) => {
330
+ // if (condition.value == 'id') {
331
+ // relatedColumn = condition.name;
332
+ // }
333
+ // });
334
+ // if (relatedColumn != null) {
335
+ // data[relatedColumn] = this.parent.data['id'];
336
+ // }
337
+ // }
338
+ const actionData = action?.options?.process?.data;
339
+ let initialData = {};
340
+ if (actionData) {
341
+ initialData = await this.evaluateExpressions(actionData);
275
342
  }
276
- console.log({ action, detailEntity: this.detailEntity });
277
- await this.workflow.execute(commandName, {
343
+ const command = commandName.split('&')[0];
344
+ await this.workflow.execute(command, {
278
345
  entity: getEntityInfo(this.detailEntity()).source,
279
- data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data,
346
+ data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : initialData,
280
347
  entityInfo: {
281
348
  name: this.detailEntity()?.name,
282
349
  module: this.detailEntity()?.module,
@@ -457,21 +524,23 @@ class AXPEntityCreateViewElementViewModel {
457
524
  formula: widget.formula,
458
525
  triggers: widget.triggers,
459
526
  valueTransforms: widget.valueTransforms,
460
- options: merge(schema.interface?.options,
461
- //this.property.options?.create?.widget,
462
- { validationRules: this.property.validations }),
527
+ options: merge(schema.interface?.options, {
528
+ validations: this.property.validations?.map((c) => ({ rule: c.rule, message: c.message, options: c.options })),
529
+ }),
463
530
  };
464
531
  });
465
532
  }
466
533
  }
467
534
  class AXPEntityMasterCreateViewModel {
468
- constructor(injector, config, initialData = {}, canCreateNewOne = true, redirect = false) {
535
+ constructor(injector, config, initialData = {}, commandOptions) {
469
536
  this.injector = injector;
470
537
  this.config = config;
471
538
  this.initialData = initialData;
539
+ this.commandOptions = commandOptions;
472
540
  this.entityDef = cloneDeep(this.config);
473
541
  this.workflow = this.injector.get(AXPWorkflowService);
474
542
  this.context = signal(this.initialData ?? {});
543
+ this.options = signal(this.commandOptions ?? {});
475
544
  this.isInProgress = signal(false);
476
545
  this.canCreateNewOne = signal(false);
477
546
  this.redirect = signal(false);
@@ -496,7 +565,9 @@ class AXPEntityMasterCreateViewModel {
496
565
  }
497
566
  });
498
567
  this.context.set(initialData);
568
+ this.options.set(commandOptions);
499
569
  //
570
+ const { redirect = false, canCreateNewOne = false } = commandOptions['process'];
500
571
  this.canCreateNewOne.set(canCreateNewOne);
501
572
  this.redirect.set(redirect);
502
573
  }
@@ -513,12 +584,9 @@ class AXPEntityMasterCreateViewModel {
513
584
  async createNewOne() {
514
585
  await this.workflow.execute('create-entity', {
515
586
  entity: getEntityInfo(this.entityDef).source,
516
- options: {
517
- process: {
518
- redirect: this.redirect(),
519
- canCreateNewOne: this.canCreateNewOne(),
520
- },
521
- },
587
+ options: this.options(),
588
+ data: this.initialData,
589
+ // entityInfo
522
590
  });
523
591
  }
524
592
  }
@@ -529,11 +597,10 @@ class AXPEntityCreateViewModelFactory {
529
597
  this.injector = inject(Injector);
530
598
  }
531
599
  async create(moduleName, entityName, initialData = null, options = { canCreateNewOne: false, redirect: true }) {
532
- console.log(options);
533
600
  this.layout.setNavigationLoading(true);
534
601
  const config = await this.entityService.resolve(moduleName, entityName);
535
602
  this.layout.setNavigationLoading(false);
536
- return new AXPEntityMasterCreateViewModel(this.injector, config, initialData, options.canCreateNewOne, options.redirect);
603
+ return new AXPEntityMasterCreateViewModel(this.injector, config, initialData, options);
537
604
  }
538
605
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreateViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
539
606
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPEntityCreateViewModelFactory, providedIn: 'root' }); }
@@ -885,7 +952,7 @@ class AXPEntityMasterListViewModel {
885
952
  filters: cleanedNestedFilters.filter(Boolean),
886
953
  };
887
954
  }
888
- if (filter.value === null || filter.value === undefined || filter.value === 'unknown') {
955
+ if (!filter.value || filter.value === 'unknown') {
889
956
  return undefined;
890
957
  }
891
958
  return filter;
@@ -945,12 +1012,15 @@ class AXPEntityMasterListViewModel {
945
1012
  }
946
1013
  //****************** Commands ******************//
947
1014
  async executeCommand(commandName, data = null) {
948
- const action = this.allActions().find((c) => c.name == commandName &&
949
- ((this.selectedItems().length
950
- ? c.scope == AXPEntityCommandScope.Selected
951
- : c.scope == AXPEntityCommandScope.Individual) ||
952
- c.scope == AXPEntityCommandScope.TypeLevel));
953
- await this.workflow.execute(commandName, {
1015
+ const action = this.allActions().find((c) => {
1016
+ return (c.name == commandName &&
1017
+ ((this.selectedItems().length
1018
+ ? c.scope == AXPEntityCommandScope.Selected
1019
+ : c.scope == AXPEntityCommandScope.Individual) ||
1020
+ c.scope == AXPEntityCommandScope.TypeLevel));
1021
+ });
1022
+ const command = commandName.split('&')[0];
1023
+ await this.workflow.execute(command, {
954
1024
  entity: getEntityInfo(this.entityDef).source,
955
1025
  entityInfo: {
956
1026
  name: this.entityDef.name,
@@ -1163,9 +1233,7 @@ class AXPEntityMasterUpdateElementViewModel {
1163
1233
  formula: widget.formula,
1164
1234
  triggers: widget.triggers,
1165
1235
  valueTransforms: widget.valueTransforms,
1166
- options: merge(schema.interface?.options,
1167
- //this.property.options?.create?.widget,
1168
- { validationRules: this.property.validations })
1236
+ options: merge(schema.interface?.options, { validations: this.property.validations?.map(c => ({ rule: c.rule, message: c.message, options: c.options })) })
1169
1237
  };
1170
1238
  });
1171
1239
  }
@@ -1348,7 +1416,6 @@ class AXPEntityMasterSingleViewGroupViewModel {
1348
1416
  });
1349
1417
  this.props = computed(() => {
1350
1418
  const { properties, interfaces } = this.entity;
1351
- console.log({ properties });
1352
1419
  const groupProperties = properties
1353
1420
  .filter(({ groupId, schema }) => groupId === this.group.id && !schema.hidden)
1354
1421
  .map(({ name }) => name);
@@ -1392,10 +1459,7 @@ class AXPEntityMasterSingleElementViewModel {
1392
1459
  children: widget.children,
1393
1460
  formula: widget.formula,
1394
1461
  valueTransforms: widget.valueTransforms,
1395
- options: merge(schema.interface?.options
1396
- //this.property.options?.create?.widget,
1397
- //{ validationRules: this.property.validations },
1398
- ),
1462
+ options: merge(schema.interface?.options),
1399
1463
  };
1400
1464
  });
1401
1465
  }
@@ -1467,8 +1531,10 @@ class AXPEntityMasterSingleViewModel {
1467
1531
  },
1468
1532
  ];
1469
1533
  });
1470
- this.relatedEntities = computed(() => {
1471
- return (this.entityDef.relatedEntities?.map((re) => new AXPEntityDetailListViewModel(this.injector, re, { entity: this.entityDef, data: this.entityData })) ?? []);
1534
+ this.relatedEntities = computed(async () => {
1535
+ const relatedEntities = this.entityDef.relatedEntities?.map((re) => new AXPEntityDetailListViewModel(this.injector, re, { entity: this.entityDef, data: this.entityData })) ?? [];
1536
+ const filteredEntities = await Promise.all(relatedEntities.map(async (re) => ((await re.hidden()) ? null : re)));
1537
+ return filteredEntities.filter((re) => re !== null);
1472
1538
  });
1473
1539
  this.workflow.events$
1474
1540
  .pipe(ofType(AXPEntityDeletedEvent))
@@ -2012,7 +2078,6 @@ class AXPLookupWidgetEditComponent extends AXPWidgetComponent {
2012
2078
  this.translateService = inject(AXTranslationService);
2013
2079
  this.expose = computed(() => this.options()['expose']);
2014
2080
  this.entity = computed(() => this.options()['entity']);
2015
- this.validationRules = computed(() => this.options()['validationRules'] ?? []);
2016
2081
  this.textField = computed(() => {
2017
2082
  return (this.entityDef()?.formats.lookup ?? this.entityDef()?.properties.find((c) => c.name != 'id')?.name ?? 'title');
2018
2083
  });
@@ -2380,7 +2445,6 @@ class AXPWidgetSelectorWidgetEditComponent extends AXPWidgetComponent {
2380
2445
  this.selectedItem = signal(null);
2381
2446
  this.placeholder = computed(() => this.options()['placeholder'] ?? '');
2382
2447
  this.loading = computed(() => this.options()['loading'] ?? false);
2383
- this.validationRules = computed(() => this.options()['validationRules']);
2384
2448
  }
2385
2449
  ngAfterViewInit() {
2386
2450
  if (this.getValue()) {
@@ -2535,9 +2599,9 @@ class AXPEntityCreatePopupAction extends AXPWorkflowAction {
2535
2599
  console.log('data', data);
2536
2600
  const process = options?.['process'];
2537
2601
  const decoration = options?.['decoration'];
2602
+ const layout = options?.['layout'];
2538
2603
  const headerTitle = decoration?.header?.title;
2539
- const redirect = process?.redirect;
2540
- const canCreateNewOne = process?.canCreateNewOne;
2604
+ const size = layout?.size;
2541
2605
  const entityRef = await this.entityRegistery.resolve(module, entity);
2542
2606
  const com = await this.config.viewers.master.create();
2543
2607
  if (entityRef.parentKey) {
@@ -2547,18 +2611,14 @@ class AXPEntityCreatePopupAction extends AXPWorkflowAction {
2547
2611
  title: headerTitle
2548
2612
  ? headerTitle
2549
2613
  : `${await this.translateService.translateAsync('create-new')} ${await this.translateService.translateAsync(entityRef.formats.individual)}`,
2550
- size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
2614
+ size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : size ? size : 'md',
2551
2615
  data: {
2552
- vm: await this.factory.create(module, entity, data, {
2553
- canCreateNewOne,
2554
- redirect,
2555
- }),
2616
+ vm: await this.factory.create(module, entity, data, options),
2556
2617
  entity,
2557
2618
  },
2558
2619
  });
2559
2620
  context.setOutput('result', false);
2560
2621
  if (result.data?.save) {
2561
- console.log(result);
2562
2622
  context.setOutput('result', true);
2563
2623
  const prevData = context.getVariable('data');
2564
2624
  const prevMeta = context.getVariable('meta');