@acorex/platform 19.4.4 → 19.4.5

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 (44) hide show
  1. package/core/lib/types/core.types.d.ts +13 -0
  2. package/core/lib/types/file.types.d.ts +13 -0
  3. package/core/lib/types/index.d.ts +1 -0
  4. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-layout-builder.mjs +0 -3
  6. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-layout-entity.mjs +92 -2
  8. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-layout-views.mjs +3 -3
  10. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-widgets-file-list-popup.component-TNxbcVav.mjs +68 -0
  12. package/fesm2022/acorex-platform-widgets-file-list-popup.component-TNxbcVav.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-widgets.mjs +114 -826
  14. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-workflow.mjs +6 -2
  16. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  17. package/layout/builder/lib/builder/widget-map.d.ts +0 -3
  18. package/layout/entity/lib/entity-master-list.viewmodel.d.ts +1 -0
  19. package/layout/entity/lib/workflows/show-file-uploader-popup.workflow.d.ts +10 -0
  20. package/package.json +18 -18
  21. package/widgets/lib/widgets/advance/file-uploader/file-list/file-list.component.d.ts +7 -4
  22. package/widgets/lib/widgets/advance/file-uploader/file-list-popup/file-list-popup.component.d.ts +17 -0
  23. package/widgets/lib/widgets/advance/file-uploader/file-uploader-widget-column.component.d.ts +3 -3
  24. package/widgets/lib/widgets/advance/file-uploader/file-uploader-widget-edit.component.d.ts +6 -1
  25. package/widgets/lib/widgets/advance/file-uploader/file-uploader-widget-view.component.d.ts +3 -1
  26. package/widgets/lib/widgets/advance/file-uploader/file-uploader-widget.service.d.ts +13 -11
  27. package/widgets/lib/widgets/index.d.ts +0 -2
  28. package/workflow/index.d.ts +1 -0
  29. package/workflow/lib/task-board.types.d.ts +21 -0
  30. package/widgets/lib/widgets/advance/file/file-box-widget-column.component.d.ts +0 -6
  31. package/widgets/lib/widgets/advance/file/file-box-widget-edit.component.d.ts +0 -33
  32. package/widgets/lib/widgets/advance/file/file-box-widget-filter.component.d.ts +0 -6
  33. package/widgets/lib/widgets/advance/file/file-box-widget-print.component.d.ts +0 -6
  34. package/widgets/lib/widgets/advance/file/file-box-widget-view.component.d.ts +0 -31
  35. package/widgets/lib/widgets/advance/file/file-box-widget.config.d.ts +0 -7
  36. package/widgets/lib/widgets/advance/file/file-box-widget.service.d.ts +0 -12
  37. package/widgets/lib/widgets/advance/file/index.d.ts +0 -7
  38. package/widgets/lib/widgets/editors/single-file-box/index.d.ts +0 -6
  39. package/widgets/lib/widgets/editors/single-file-box/single-file-box-widget-column.component.d.ts +0 -6
  40. package/widgets/lib/widgets/editors/single-file-box/single-file-box-widget-edit.component.d.ts +0 -19
  41. package/widgets/lib/widgets/editors/single-file-box/single-file-box-widget-filter.component.d.ts +0 -6
  42. package/widgets/lib/widgets/editors/single-file-box/single-file-box-widget-print.component.d.ts +0 -6
  43. package/widgets/lib/widgets/editors/single-file-box/single-file-box-widget-view.component.d.ts +0 -8
  44. package/widgets/lib/widgets/editors/single-file-box/single-file-box-widget.config.d.ts +0 -9
@@ -44,7 +44,7 @@ import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
44
44
  import { AXBasePageComponent } from '@acorex/components/page';
45
45
  import * as i6 from '@acorex/components/search-box';
46
46
  import { AXSearchBoxModule } from '@acorex/components/search-box';
47
- import { AXP_DISABLED_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DATA_PROPERTY_GROUP, AXP_ALLOW_MULTIPLE_PROPERTY, AXP_NAME_PROPERTY } from '@acorex/platform/widgets';
47
+ import { AXP_DISABLED_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DATA_PROPERTY_GROUP, AXP_ALLOW_MULTIPLE_PROPERTY, AXP_NAME_PROPERTY, AXPFileUploaderWidgetService } from '@acorex/platform/widgets';
48
48
  import * as i5$1 from '@acorex/components/select-box';
49
49
  import { AXSelectBoxModule } from '@acorex/components/select-box';
50
50
  import * as i2$1 from '@acorex/components/text-box';
@@ -777,6 +777,16 @@ class AXPEntityMasterListViewModel {
777
777
  return this.sortedFields().filter((i) => i.dir).length;
778
778
  };
779
779
  this.sortedFields = signal([]);
780
+ this.evaluateExpressions = async (options, data) => {
781
+ const scope = {
782
+ context: {
783
+ eval: (path) => {
784
+ return get(data, path);
785
+ },
786
+ },
787
+ };
788
+ return await this.expressionEvaluator.evaluate(options, scope);
789
+ };
780
790
  this.workflow.events$
781
791
  .pipe(ofType(AXPRefreshEvent))
782
792
  .pipe(takeUntil(this.destroyed))
@@ -1023,6 +1033,7 @@ class AXPEntityMasterListViewModel {
1023
1033
  c.scope == AXPEntityCommandScope.TypeLevel));
1024
1034
  });
1025
1035
  const command = commandName.split('&')[0];
1036
+ const options = await this.evaluateExpressions(action?.options, data);
1026
1037
  await this.workflow.execute(command, {
1027
1038
  entity: getEntityInfo(this.entityDef).source,
1028
1039
  entityInfo: {
@@ -1033,7 +1044,7 @@ class AXPEntityMasterListViewModel {
1033
1044
  source: this.entityDef.source,
1034
1045
  },
1035
1046
  data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data,
1036
- options: action?.options,
1047
+ options: options,
1037
1048
  metadata: action?.metadata,
1038
1049
  });
1039
1050
  }
@@ -3414,6 +3425,81 @@ const AXPShowListViewWorkflow = {
3414
3425
  },
3415
3426
  };
3416
3427
 
3428
+ class AXPShowFileUploaderPopupAction extends AXPWorkflowAction {
3429
+ constructor() {
3430
+ super(...arguments);
3431
+ this.fileUploaderWidgetService = inject(AXPFileUploaderWidgetService);
3432
+ this.entityRegistryService = inject(AXPEntityDefinitionRegistryService);
3433
+ }
3434
+ async execute(context) {
3435
+ debugger;
3436
+ const key = context.getVariable('options.key');
3437
+ const files = context.getVariable('options.files');
3438
+ const readOnly = context.getVariable('options.readOnly');
3439
+ const multiple = context.getVariable('options.multiple');
3440
+ const accept = context.getVariable('options.accept');
3441
+ const res = await this.fileUploaderWidgetService.showFileList({
3442
+ files: files,
3443
+ readOnly: readOnly,
3444
+ multiple: multiple,
3445
+ accept: accept,
3446
+ });
3447
+ if ((res?.length ?? 0) === 0) {
3448
+ context.setOutput('result', false);
3449
+ return;
3450
+ }
3451
+ const [module, entity] = context.getVariable('entity').split('.');
3452
+ const entityDefinition = await this.entityRegistryService.resolve(module, entity);
3453
+ if (entityDefinition) {
3454
+ const updateExec = entityDefinition.commands?.update?.execute;
3455
+ const entityData = await updateExec({
3456
+ id: context.getVariable('options.id'),
3457
+ [key]: res,
3458
+ });
3459
+ context.setOutput('result', true);
3460
+ context.setVariable('data', cloneDeep(entityData));
3461
+ }
3462
+ }
3463
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXPShowFileUploaderPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
3464
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXPShowFileUploaderPopupAction }); }
3465
+ }
3466
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXPShowFileUploaderPopupAction, decorators: [{
3467
+ type: Injectable
3468
+ }] });
3469
+ const AXPShowFileUploaderPopupWorkflow = {
3470
+ startStepId: 'show-popup',
3471
+ steps: {
3472
+ 'show-popup': {
3473
+ action: 'AXPShowFileUploaderPopupAction',
3474
+ nextSteps: [
3475
+ {
3476
+ conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
3477
+ nextStepId: 'successToast',
3478
+ },
3479
+ ],
3480
+ },
3481
+ successToast: {
3482
+ id: 'successToast',
3483
+ action: 'AXPToastAction',
3484
+ input: {
3485
+ color: 'success',
3486
+ title: 'workflow.entity-modified-title',
3487
+ content: 'workflow.entity-modified-body',
3488
+ },
3489
+ nextSteps: [
3490
+ {
3491
+ conditions: [],
3492
+ nextStepId: 'modifyConfirmed',
3493
+ },
3494
+ ],
3495
+ },
3496
+ modifyConfirmed: {
3497
+ id: 'modifyConfirmed',
3498
+ action: 'AXPEntityModifyConfirmedAction',
3499
+ },
3500
+ },
3501
+ };
3502
+
3417
3503
  function routesFacory() {
3418
3504
  const config = inject(AXP_ENTITY_CONFIG_TOKEN);
3419
3505
  let routes = [];
@@ -3513,6 +3599,7 @@ class AXPEntityModule {
3513
3599
  AXPEntityCreateSubmittedAction,
3514
3600
  AXPShowListViewAction,
3515
3601
  'entity-apply-updates': AXPEntityApplyUpdatesAction,
3602
+ AXPShowFileUploaderPopupAction,
3516
3603
  },
3517
3604
  workflows: {
3518
3605
  'create-entity': AXPCreateEntityWorkflow,
@@ -3521,6 +3608,7 @@ class AXPEntityModule {
3521
3608
  'quick-modify-entity': AXPQuickModifyEntityWorkflow,
3522
3609
  'open-entity': AXPShowDetailsViewWorkflow,
3523
3610
  'show-list-view': AXPShowListViewWorkflow,
3611
+ 'show-file-uploader-popup': AXPShowFileUploaderPopupWorkflow,
3524
3612
  },
3525
3613
  functions: {},
3526
3614
  }),
@@ -3547,6 +3635,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
3547
3635
  AXPEntityCreateSubmittedAction,
3548
3636
  AXPShowListViewAction,
3549
3637
  'entity-apply-updates': AXPEntityApplyUpdatesAction,
3638
+ AXPShowFileUploaderPopupAction,
3550
3639
  },
3551
3640
  workflows: {
3552
3641
  'create-entity': AXPCreateEntityWorkflow,
@@ -3555,6 +3644,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
3555
3644
  'quick-modify-entity': AXPQuickModifyEntityWorkflow,
3556
3645
  'open-entity': AXPShowDetailsViewWorkflow,
3557
3646
  'show-list-view': AXPShowListViewWorkflow,
3647
+ 'show-file-uploader-popup': AXPShowFileUploaderPopupWorkflow,
3558
3648
  },
3559
3649
  functions: {},
3560
3650
  }),