@acorex/platform 18.0.2 → 18.0.4
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.
- package/common/lib/app/application.types.d.ts +43 -26
- package/common/lib/common.module.d.ts +6 -5
- package/common/lib/data/data-provider.types.d.ts +1 -1
- package/common/lib/data/dexie-storage.service.d.ts +15 -0
- package/common/lib/data/entity-data-provider.d.ts +14 -0
- package/common/lib/data/index.d.ts +3 -0
- package/common/lib/data/storage-service.d.ts +22 -0
- package/common/lib/schema/entity/entity.class.d.ts +3 -0
- package/common/lib/utils/data-generator.d.ts +2 -0
- package/esm2022/common/lib/app/application.types.mjs +1 -1
- package/esm2022/common/lib/common.module.mjs +19 -2
- package/esm2022/common/lib/data/data-provider.types.mjs +1 -1
- package/esm2022/common/lib/data/dexie-storage.service.mjs +36 -0
- package/esm2022/common/lib/data/entity-data-provider.mjs +26 -0
- package/esm2022/common/lib/data/index.mjs +4 -1
- package/esm2022/common/lib/data/storage-service.mjs +5 -0
- package/esm2022/common/lib/schema/entity/entity-registery.service.mjs +2 -2
- package/esm2022/common/lib/schema/entity/entity.class.mjs +1 -1
- package/esm2022/common/lib/utils/data-generator.mjs +22 -1
- package/esm2022/common/lib/workflows/common.workflow.mjs +3 -3
- package/esm2022/layout/builder/lib/builder/builder.service.mjs +7 -2
- package/esm2022/layout/builder/lib/builder/widget.types.mjs +5 -1
- package/esm2022/layout/entity/lib/entity-detail-list.viewmodel.mjs +9 -8
- package/esm2022/layout/entity/lib/entity-master-create.viewmodel.mjs +34 -21
- package/esm2022/layout/entity/lib/entity-master-list.viewmodel.mjs +23 -15
- package/esm2022/layout/entity/lib/entity-master-single.viewmodel.mjs +46 -49
- package/esm2022/layout/entity/lib/entity-master-update.viewmodel.mjs +9 -7
- package/esm2022/layout/entity/lib/entity-registery.service.mjs +2 -2
- package/esm2022/layout/entity/lib/entity.module.mjs +13 -4
- package/esm2022/layout/entity/lib/entity.viewmodel.mjs +7 -6
- package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.mjs +127 -39
- package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.component.mjs +83 -37
- package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.viewmodel.mjs +34 -23
- package/esm2022/layout/entity/lib/workflows/create-entity.workflow.mjs +17 -20
- package/esm2022/layout/entity/lib/workflows/delete-entity.workflow.mjs +17 -15
- package/esm2022/layout/entity/lib/workflows/modify-section.workflow.mjs +11 -23
- package/esm2022/layout/entity/lib/workflows/show-details.workflow.mjs +3 -3
- package/esm2022/layout/entity/lib/workflows/show-list.workflow.mjs +35 -0
- package/esm2022/layouts/lib/admin/entity-layout/entity-create-view/entity-create-view.component.mjs +3 -3
- package/esm2022/layouts/lib/admin/entity-layout/workflows/delete-entity.workflow.mjs +2 -2
- package/esm2022/layouts/lib/layout.module.mjs +3 -3
- package/esm2022/themes/default/lib/default.module.mjs +3 -3
- package/esm2022/themes/default/lib/entity-reuse.strategy.mjs +2 -2
- package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-create-view/entity-master-create-view.component.mjs +2 -2
- package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-list-view/{entity-list-view.component.mjs → entity-master-list-view.component.mjs} +8 -2
- package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-list-view/list-view-option-sorting/list-view-option-sorting.component.mjs +2 -1
- package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.mjs +1 -1
- package/esm2022/widgets/lib/editors/date-time-box-widget/date-time-box-widget-column.component.mjs +2 -2
- package/esm2022/widgets/lib/editors/date-time-box-widget/date-time-box-widget-edit.component.mjs +21 -12
- package/esm2022/widgets/lib/editors/date-time-box-widget/date-time-box-widget-view.component.mjs +3 -2
- package/esm2022/widgets/lib/editors/number-box-widget/number-box-widget-column.component.mjs +2 -2
- package/esm2022/widgets/lib/editors/number-box-widget/number-box-widget-view.component.mjs +2 -2
- package/esm2022/workflow/lib/actions/start-workflow.action.mjs +28 -0
- package/esm2022/workflow/lib/workflow.module.mjs +7 -2
- package/esm2022/workflow/lib/workflow.service.mjs +53 -6
- package/esm2022/workflow/lib/workflow.types.mjs +12 -6
- package/fesm2022/{acorex-platform-common-avatar-widget-edit.component-DAmNXjDm.mjs → acorex-platform-common-avatar-widget-edit.component-B-of5ssU.mjs} +3 -2
- package/fesm2022/{acorex-platform-common-avatar-widget-edit.component-DAmNXjDm.mjs.map → acorex-platform-common-avatar-widget-edit.component-B-of5ssU.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-avatar-widget-view.component-BlA_cFkP.mjs → acorex-platform-common-avatar-widget-view.component-CJvrSkTv.mjs} +4 -3
- package/fesm2022/acorex-platform-common-avatar-widget-view.component-CJvrSkTv.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-boolean-widget-filter.component-CEqibiML.mjs → acorex-platform-common-boolean-widget-filter.component-BTcOjuUm.mjs} +4 -3
- package/fesm2022/acorex-platform-common-boolean-widget-filter.component-BTcOjuUm.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-checkbox-widget-column.component-BiUHPDqV.mjs → acorex-platform-common-checkbox-widget-column.component-X9d1iY_F.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-checkbox-widget-column.component-BiUHPDqV.mjs.map → acorex-platform-common-checkbox-widget-column.component-X9d1iY_F.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-checkbox-widget-edit.component-BVG9_XXh.mjs → acorex-platform-common-checkbox-widget-edit.component-_jtT03Vn.mjs} +4 -3
- package/fesm2022/acorex-platform-common-checkbox-widget-edit.component-_jtT03Vn.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-checkbox-widget-view.component-CfGkMcDi.mjs → acorex-platform-common-checkbox-widget-view.component-nYmtb8bK.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-checkbox-widget-view.component-CfGkMcDi.mjs.map → acorex-platform-common-checkbox-widget-view.component-nYmtb8bK.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-dateTime-widget-column.component-BlXTU887.mjs → acorex-platform-common-dateTime-widget-column.component-5ljYmtHI.mjs} +4 -3
- package/fesm2022/acorex-platform-common-dateTime-widget-column.component-5ljYmtHI.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-dateTime-widget-edit.component-B0s6FN-g.mjs → acorex-platform-common-dateTime-widget-edit.component-D8FSiqAo.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-dateTime-widget-edit.component-B0s6FN-g.mjs.map → acorex-platform-common-dateTime-widget-edit.component-D8FSiqAo.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-dateTime-widget-filter.component-B7KBCsUt.mjs → acorex-platform-common-dateTime-widget-filter.component-Df0DuDtw.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-dateTime-widget-filter.component-B7KBCsUt.mjs.map → acorex-platform-common-dateTime-widget-filter.component-Df0DuDtw.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-dateTime-widget-view.component-Dy7pAkGG.mjs → acorex-platform-common-dateTime-widget-view.component-CjVjQkPh.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-dateTime-widget-view.component-Dy7pAkGG.mjs.map → acorex-platform-common-dateTime-widget-view.component-CjVjQkPh.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-email-widget-column.component-D_UNn2dW.mjs → acorex-platform-common-email-widget-column.component-BgNdL62k.mjs} +4 -3
- package/fesm2022/acorex-platform-common-email-widget-column.component-BgNdL62k.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-email-widget-edit.component-DWT24mCM.mjs → acorex-platform-common-email-widget-edit.component-CgHPGccx.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-email-widget-edit.component-DWT24mCM.mjs.map → acorex-platform-common-email-widget-edit.component-CgHPGccx.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-email-widget-view.component-B6puyycL.mjs → acorex-platform-common-email-widget-view.component-C2aQ14k-.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-email-widget-view.component-B6puyycL.mjs.map → acorex-platform-common-email-widget-view.component-C2aQ14k-.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-file-widget-column.component-C1faGR4K.mjs → acorex-platform-common-file-widget-column.component-CwFzLLHt.mjs} +4 -3
- package/fesm2022/acorex-platform-common-file-widget-column.component-CwFzLLHt.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-file-widget-edit.component-CTvS9ls8.mjs → acorex-platform-common-file-widget-edit.component-DxoQR4CU.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-file-widget-edit.component-CTvS9ls8.mjs.map → acorex-platform-common-file-widget-edit.component-DxoQR4CU.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-file-widget-filter.component-D4AMg5M0.mjs → acorex-platform-common-file-widget-filter.component-BvG0iaKU.mjs} +4 -3
- package/fesm2022/acorex-platform-common-file-widget-filter.component-BvG0iaKU.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-file-widget-view.component-CHI4VCvt.mjs → acorex-platform-common-file-widget-view.component-BC9l3YrO.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-file-widget-view.component-CHI4VCvt.mjs.map → acorex-platform-common-file-widget-view.component-BC9l3YrO.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-gallery-widget-edit.component-CAOctYzV.mjs → acorex-platform-common-gallery-widget-edit.component-BihOIJ9T.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-gallery-widget-edit.component-CAOctYzV.mjs.map → acorex-platform-common-gallery-widget-edit.component-BihOIJ9T.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-gallery-widget-filter.component-lgaYDZeD.mjs → acorex-platform-common-gallery-widget-filter.component-DS1PCIJp.mjs} +4 -3
- package/fesm2022/acorex-platform-common-gallery-widget-filter.component-DS1PCIJp.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-gallery-widget-view.component-Ci50jeO5.mjs → acorex-platform-common-gallery-widget-view.component-CnQONVdg.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-gallery-widget-view.component-Ci50jeO5.mjs.map → acorex-platform-common-gallery-widget-view.component-CnQONVdg.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-largetext-widget-edit.component-DFKG-kum.mjs → acorex-platform-common-largetext-widget-edit.component-BCtGkz1a.mjs} +4 -3
- package/fesm2022/acorex-platform-common-largetext-widget-edit.component-BCtGkz1a.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-lookup-widget-column.component-CFzCGcqA.mjs → acorex-platform-common-lookup-widget-column.component-Cl-vO5XW.mjs} +4 -3
- package/fesm2022/acorex-platform-common-lookup-widget-column.component-Cl-vO5XW.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-lookup-widget-edit.component-CYTSeEOq.mjs → acorex-platform-common-lookup-widget-edit.component-D9UhViUG.mjs} +4 -3
- package/fesm2022/acorex-platform-common-lookup-widget-edit.component-D9UhViUG.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-lookup-widget-filter.component-BkxT9_Hh.mjs → acorex-platform-common-lookup-widget-filter.component-RWweQQaO.mjs} +4 -3
- package/fesm2022/acorex-platform-common-lookup-widget-filter.component-RWweQQaO.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-lookup-widget-view.component-5YeixMp7.mjs → acorex-platform-common-lookup-widget-view.component-mXo8VADX.mjs} +4 -3
- package/fesm2022/acorex-platform-common-lookup-widget-view.component-mXo8VADX.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-map-widget-edit.component-CE3QQBmX.mjs → acorex-platform-common-map-widget-edit.component-SSrR3xxv.mjs} +4 -3
- package/fesm2022/acorex-platform-common-map-widget-edit.component-SSrR3xxv.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-map-widget-view.component-Cv4OCTxz.mjs → acorex-platform-common-map-widget-view.component-DrGG3gzg.mjs} +4 -3
- package/fesm2022/acorex-platform-common-map-widget-view.component-DrGG3gzg.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-messenger-widget-column.component-CJdh6TKb.mjs → acorex-platform-common-messenger-widget-column.component-BJ_XzNKc.mjs} +4 -3
- package/fesm2022/acorex-platform-common-messenger-widget-column.component-BJ_XzNKc.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-messenger-widget-edit.component-kiEHxJia.mjs → acorex-platform-common-messenger-widget-edit.component-B_FG_n0O.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-messenger-widget-edit.component-kiEHxJia.mjs.map → acorex-platform-common-messenger-widget-edit.component-B_FG_n0O.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-messenger-widget-view.component-DzbjgZA7.mjs → acorex-platform-common-messenger-widget-view.component-EBiPO9ds.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-messenger-widget-view.component-DzbjgZA7.mjs.map → acorex-platform-common-messenger-widget-view.component-EBiPO9ds.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-number-widget-edit.component-BRuIP96Y.mjs → acorex-platform-common-number-widget-edit.component-B1XXga-9.mjs} +4 -3
- package/fesm2022/acorex-platform-common-number-widget-edit.component-B1XXga-9.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-number-widget-filter.component-jQ4DaFQH.mjs → acorex-platform-common-number-widget-filter.component-B2JCpDjU.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-number-widget-filter.component-jQ4DaFQH.mjs.map → acorex-platform-common-number-widget-filter.component-B2JCpDjU.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-number-widget-view.component-BzUWjT8m.mjs → acorex-platform-common-number-widget-view.component-DD0tkoc4.mjs} +4 -3
- package/fesm2022/acorex-platform-common-number-widget-view.component-DD0tkoc4.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-password-widget-column.component-BRzyuK5c.mjs → acorex-platform-common-password-widget-column.component-eyqgQlAt.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-password-widget-column.component-BRzyuK5c.mjs.map → acorex-platform-common-password-widget-column.component-eyqgQlAt.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-password-widget-edit.component-q6R2dw5k.mjs → acorex-platform-common-password-widget-edit.component-C2yNb9Pl.mjs} +4 -3
- package/fesm2022/acorex-platform-common-password-widget-edit.component-C2yNb9Pl.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-password-widget-view.component-CKaQItON.mjs → acorex-platform-common-password-widget-view.component-o9S7pwJW.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-password-widget-view.component-CKaQItON.mjs.map → acorex-platform-common-password-widget-view.component-o9S7pwJW.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-phone-widget-column.component-BD7BScjW.mjs → acorex-platform-common-phone-widget-column.component-BL9Xl2XH.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-phone-widget-column.component-BD7BScjW.mjs.map → acorex-platform-common-phone-widget-column.component-BL9Xl2XH.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-phone-widget-edit.component-D8tGKfNj.mjs → acorex-platform-common-phone-widget-edit.component-DSh9zoZj.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-phone-widget-edit.component-D8tGKfNj.mjs.map → acorex-platform-common-phone-widget-edit.component-DSh9zoZj.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-phone-widget-view.component-CFiMsGOB.mjs → acorex-platform-common-phone-widget-view.component-Br3xbaDd.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-phone-widget-view.component-CFiMsGOB.mjs.map → acorex-platform-common-phone-widget-view.component-Br3xbaDd.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-rich-text-widget-column.component-BPzwY_8L.mjs → acorex-platform-common-rich-text-widget-column.component-DDT58tca.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-rich-text-widget-column.component-BPzwY_8L.mjs.map → acorex-platform-common-rich-text-widget-column.component-DDT58tca.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-rich-text-widget-edit.component-CA2xRfVg.mjs → acorex-platform-common-rich-text-widget-edit.component-Dz1toc21.mjs} +4 -3
- package/fesm2022/acorex-platform-common-rich-text-widget-edit.component-Dz1toc21.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-rich-text-widget-view.component-DYfTZ64H.mjs → acorex-platform-common-rich-text-widget-view.component-CxTPcEIQ.mjs} +4 -3
- package/fesm2022/acorex-platform-common-rich-text-widget-view.component-CxTPcEIQ.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-selection-list-widget-column.component-_MglaOmo.mjs → acorex-platform-common-selection-list-widget-column.component-BCCmg8MI.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-selection-list-widget-column.component-_MglaOmo.mjs.map → acorex-platform-common-selection-list-widget-column.component-BCCmg8MI.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-selection-list-widget-edit.component-QKw_tyOd.mjs → acorex-platform-common-selection-list-widget-edit.component-B5eUdN2R.mjs} +4 -3
- package/fesm2022/acorex-platform-common-selection-list-widget-edit.component-B5eUdN2R.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-selection-list-widget-filter.component-DRToTnHQ.mjs → acorex-platform-common-selection-list-widget-filter.component-DPpZq1TB.mjs} +4 -3
- package/fesm2022/acorex-platform-common-selection-list-widget-filter.component-DPpZq1TB.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-selection-list-widget-view.component-CjDiuUdj.mjs → acorex-platform-common-selection-list-widget-view.component-Bxvd_AKZ.mjs} +4 -3
- package/fesm2022/acorex-platform-common-selection-list-widget-view.component-Bxvd_AKZ.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-signature-pad-widget-edit.component-DF29uWl2.mjs → acorex-platform-common-signature-pad-widget-edit.component-CNjYCEi6.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-signature-pad-widget-edit.component-DF29uWl2.mjs.map → acorex-platform-common-signature-pad-widget-edit.component-CNjYCEi6.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-signature-pad-widget-view.component-BWzoR4HM.mjs → acorex-platform-common-signature-pad-widget-view.component-CsiBv_7i.mjs} +4 -3
- package/fesm2022/acorex-platform-common-signature-pad-widget-view.component-CsiBv_7i.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-string-widget-filter.component-Di_GFHme.mjs → acorex-platform-common-string-widget-filter.component-CrGt6Bov.mjs} +4 -3
- package/fesm2022/acorex-platform-common-string-widget-filter.component-CrGt6Bov.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-text-widget-column.component-BSYd1CbC.mjs → acorex-platform-common-text-widget-column.component-qXusAevm.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-text-widget-column.component-BSYd1CbC.mjs.map → acorex-platform-common-text-widget-column.component-qXusAevm.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-text-widget-edit.component-K9z9N1qw.mjs → acorex-platform-common-text-widget-edit.component-ed0MUYnD.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-text-widget-edit.component-K9z9N1qw.mjs.map → acorex-platform-common-text-widget-edit.component-ed0MUYnD.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-text-widget-view.component-WbZtm_bf.mjs → acorex-platform-common-text-widget-view.component-BpxTaeQW.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-text-widget-view.component-WbZtm_bf.mjs.map → acorex-platform-common-text-widget-view.component-BpxTaeQW.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-toggle-widget-column.component-ZCBSYMuz.mjs → acorex-platform-common-toggle-widget-column.component-BqiUQrmV.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-toggle-widget-column.component-ZCBSYMuz.mjs.map → acorex-platform-common-toggle-widget-column.component-BqiUQrmV.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-common-toggle-widget-edit.component-rkDfLA-J.mjs → acorex-platform-common-toggle-widget-edit.component-CDG62BJN.mjs} +4 -3
- package/fesm2022/acorex-platform-common-toggle-widget-edit.component-CDG62BJN.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-toggle-widget-view.component-DLDIrci1.mjs → acorex-platform-common-toggle-widget-view.component-DWYcIPTd.mjs} +4 -3
- package/fesm2022/{acorex-platform-common-toggle-widget-view.component-DLDIrci1.mjs.map → acorex-platform-common-toggle-widget-view.component-DWYcIPTd.mjs.map} +1 -1
- package/fesm2022/acorex-platform-common.mjs +252 -149
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +10 -1
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +445 -261
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layouts-entity-create-view.component-BmSMt95H.mjs → acorex-platform-layouts-entity-create-view.component-fkKPKxlb.mjs} +3 -3
- package/fesm2022/acorex-platform-layouts-entity-create-view.component-fkKPKxlb.mjs.map +1 -0
- package/fesm2022/acorex-platform-layouts.mjs +4 -4
- package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-Buanq4is.mjs → acorex-platform-themes-default-entity-master-create-view.component-BxYT9KhH.mjs} +2 -2
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-BxYT9KhH.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +13 -6
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-widgets.mjs +50 -42
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +184 -104
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/lib/builder/widget.types.d.ts +3 -0
- package/layout/entity/lib/entity-master-create.viewmodel.d.ts +6 -5
- package/layout/entity/lib/entity-master-list.viewmodel.d.ts +4 -0
- package/layout/entity/lib/entity-master-single.viewmodel.d.ts +10 -5
- package/layout/entity/lib/entity-master-update.viewmodel.d.ts +0 -1
- package/layout/entity/lib/entity.viewmodel.d.ts +3 -3
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +18 -3
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.component.d.ts +8 -1
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.viewmodel.d.ts +10 -3
- package/layout/entity/lib/workflows/create-entity.workflow.d.ts +0 -2
- package/layout/entity/lib/workflows/delete-entity.workflow.d.ts +2 -4
- package/layout/entity/lib/workflows/modify-section.workflow.d.ts +2 -5
- package/layout/entity/lib/workflows/show-list.workflow.d.ts +10 -0
- package/package.json +1 -1
- package/widgets/lib/editors/date-time-box-widget/date-time-box-widget-edit.component.d.ts +4 -0
- package/workflow/lib/actions/start-workflow.action.d.ts +10 -0
- package/workflow/lib/workflow.service.d.ts +4 -2
- package/workflow/lib/workflow.types.d.ts +3 -1
- package/fesm2022/acorex-platform-common-avatar-widget-view.component-BlA_cFkP.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-boolean-widget-filter.component-CEqibiML.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-checkbox-widget-edit.component-BVG9_XXh.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-dateTime-widget-column.component-BlXTU887.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-email-widget-column.component-D_UNn2dW.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-file-widget-column.component-C1faGR4K.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-file-widget-filter.component-D4AMg5M0.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-gallery-widget-filter.component-lgaYDZeD.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-largetext-widget-edit.component-DFKG-kum.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-lookup-widget-column.component-CFzCGcqA.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-lookup-widget-edit.component-CYTSeEOq.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-lookup-widget-filter.component-BkxT9_Hh.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-lookup-widget-view.component-5YeixMp7.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-map-widget-edit.component-CE3QQBmX.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-map-widget-view.component-Cv4OCTxz.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-messenger-widget-column.component-CJdh6TKb.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-number-widget-edit.component-BRuIP96Y.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-number-widget-view.component-BzUWjT8m.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-password-widget-edit.component-q6R2dw5k.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-rich-text-widget-edit.component-CA2xRfVg.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-rich-text-widget-view.component-DYfTZ64H.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-selection-list-widget-edit.component-QKw_tyOd.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-selection-list-widget-filter.component-DRToTnHQ.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-selection-list-widget-view.component-CjDiuUdj.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-signature-pad-widget-view.component-BWzoR4HM.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-string-widget-filter.component-Di_GFHme.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-toggle-widget-edit.component-rkDfLA-J.mjs.map +0 -1
- package/fesm2022/acorex-platform-layouts-entity-create-view.component-BmSMt95H.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Buanq4is.mjs.map +0 -1
- /package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/{entity-list-view.component.d.ts → entity-master-list-view.component.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AXFormatService } from '@acorex/core/format';
|
|
2
|
-
import { cloneDeep, set, merge } from 'lodash-es';
|
|
2
|
+
import { cloneDeep, set, merge, get } from 'lodash-es';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, inject, Injectable, computed, signal, Injector, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
5
|
-
import * as i1$
|
|
4
|
+
import { InjectionToken, inject, Injectable, computed, signal, Injector, Component, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';
|
|
5
|
+
import * as i1$2 from '@acorex/platform/workflow';
|
|
6
6
|
import { createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowService, ofType, AXPWorkflowModule } from '@acorex/platform/workflow';
|
|
7
7
|
import { AXPSessionService } from '@acorex/platform/auth';
|
|
8
8
|
import { resolveActionLook, AXPLayoutService, AXPEntityCommandScope, AXPWorkflowNavigateAction } from '@acorex/platform/common';
|
|
@@ -10,26 +10,33 @@ import { AXDialogService } from '@acorex/components/dialog';
|
|
|
10
10
|
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
|
11
11
|
import { AXPopupService } from '@acorex/components/popup';
|
|
12
12
|
import { AXPlatform } from '@acorex/core/platform';
|
|
13
|
-
import
|
|
13
|
+
import * as i1 from '@acorex/components/common';
|
|
14
|
+
import { AXDataSource, AXCommonModule } from '@acorex/components/common';
|
|
15
|
+
import { Subject } from 'rxjs';
|
|
14
16
|
import { RouterModule, ROUTES } from '@angular/router';
|
|
15
|
-
import * as
|
|
17
|
+
import * as i6 from '@acorex/platform/layout/builder';
|
|
16
18
|
import { AXPWidgetBase, AXPLayoutBuilderModule, AXPLayoutBuilderService, AXPColumnWidgetBase } from '@acorex/platform/layout/builder';
|
|
17
19
|
import { CommonModule } from '@angular/common';
|
|
18
20
|
import { AXSelectBoxModule } from '@acorex/components/select-box';
|
|
19
|
-
import * as i1 from '@angular/forms';
|
|
21
|
+
import * as i1$1 from '@angular/forms';
|
|
20
22
|
import { FormsModule } from '@angular/forms';
|
|
21
23
|
import * as i2$1 from '@acorex/components/text-box';
|
|
22
|
-
import { AXTextBoxModule } from '@acorex/components/text-box';
|
|
23
|
-
import * as
|
|
24
|
+
import { AXTextBoxComponent, AXTextBoxModule } from '@acorex/components/text-box';
|
|
25
|
+
import * as i3 from '@acorex/components/decorators';
|
|
24
26
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
25
|
-
import * as
|
|
27
|
+
import * as i2 from '@acorex/components/button';
|
|
26
28
|
import { AXButtonModule } from '@acorex/components/button';
|
|
27
|
-
import * as
|
|
29
|
+
import * as i4 from '@acorex/components/data-table';
|
|
28
30
|
import { AXDataTableModule } from '@acorex/components/data-table';
|
|
29
|
-
import * as
|
|
31
|
+
import * as i5 from '@acorex/components/search-box';
|
|
30
32
|
import { AXSearchBoxModule } from '@acorex/components/search-box';
|
|
31
33
|
import { AXBasePageComponent } from '@acorex/components/page';
|
|
32
34
|
import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
|
|
35
|
+
import * as i6$1 from '@acorex/components/form';
|
|
36
|
+
import { AXFormModule } from '@acorex/components/form';
|
|
37
|
+
import * as i5$1 from '@acorex/components/loading';
|
|
38
|
+
import { AXLoadingModule } from '@acorex/components/loading';
|
|
39
|
+
import { AXValidationModule } from '@acorex/core/validation';
|
|
33
40
|
|
|
34
41
|
const AXP_ENTITY_CONFIG_TOKEN = new InjectionToken('AXP_ENTITY_CONFIG_TOKEN');
|
|
35
42
|
const AXP_ENTITY_DEFINITION_LOADER = new InjectionToken('AXP_ENTITY_DEFINITION_LOADER');
|
|
@@ -75,7 +82,7 @@ class AXPEntityDefinitionRegistryService {
|
|
|
75
82
|
throw error; // Rethrow to allow error handling by caller
|
|
76
83
|
}
|
|
77
84
|
if (!config) {
|
|
78
|
-
throw new Error(`Invalid
|
|
85
|
+
throw new Error(`Invalid entity name: ${key}`);
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
return config;
|
|
@@ -113,18 +120,19 @@ class AXPEntityCommandTriggerViewModel {
|
|
|
113
120
|
}
|
|
114
121
|
}
|
|
115
122
|
class AXPEntityListViewColumnViewModel {
|
|
116
|
-
constructor(property) {
|
|
123
|
+
constructor(property, column) {
|
|
117
124
|
this.property = property;
|
|
125
|
+
this.column = column;
|
|
118
126
|
this.name = this.property.name;
|
|
119
|
-
this.title = this.property.title;
|
|
120
|
-
this.
|
|
121
|
-
this.visible = this.property.options?.table?.visible ?? true;
|
|
127
|
+
this.title = this.column.title ?? this.property.title;
|
|
128
|
+
this.visible = this.column?.options?.visible ?? true;
|
|
122
129
|
this.node = computed(() => {
|
|
123
130
|
const widget = this.property.schema.interface;
|
|
124
131
|
return {
|
|
125
132
|
path: this.name,
|
|
126
133
|
type: widget.type,
|
|
127
|
-
|
|
134
|
+
//... this.property.options?.table?.widget
|
|
135
|
+
options: { ...widget?.options }
|
|
128
136
|
};
|
|
129
137
|
});
|
|
130
138
|
}
|
|
@@ -139,9 +147,11 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
|
|
|
139
147
|
this.loadingDialog = inject(AXLoadingDialogService);
|
|
140
148
|
}
|
|
141
149
|
async execute(context) {
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
const
|
|
150
|
+
debugger;
|
|
151
|
+
const moduleEntity = context.getVariable('entity');
|
|
152
|
+
const [moduleName, entityName] = moduleEntity.split(".");
|
|
153
|
+
const items = context.getVariable('data');
|
|
154
|
+
const ids = items.map(c => c.id);
|
|
145
155
|
const entity = await this.entityRegistery.resolve(moduleName, entityName);
|
|
146
156
|
let deletedCount = 0;
|
|
147
157
|
context.setVariable('deleteSuccessful', false);
|
|
@@ -187,14 +197,16 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
|
|
|
187
197
|
if (successfulPromises > 0 && failedPromises === 0) {
|
|
188
198
|
// All items deleted successfully
|
|
189
199
|
await this.dialogService.alert('Deletion Successful', `${successfulPromises} item(s) has been deleted.`, 'success');
|
|
200
|
+
debugger;
|
|
190
201
|
// Dispatch actions
|
|
191
|
-
this.dispatch(AXPEntityDeletedEvent({
|
|
202
|
+
this.dispatch(AXPEntityDeletedEvent({ entity: moduleEntity, ids: ids }));
|
|
192
203
|
}
|
|
193
204
|
else if (successfulPromises > 0 && failedPromises > 0) {
|
|
194
205
|
// Some items deleted successfully, some failed
|
|
195
206
|
await this.dialogService.alert('Partial Deletion Completed', `${successfulPromises} item(s) deleted successfully. However, ${failedPromises} item(s) could not be deleted.`, 'warning');
|
|
207
|
+
debugger;
|
|
196
208
|
// Dispatch actions
|
|
197
|
-
this.dispatch(AXPEntityDeletedEvent({
|
|
209
|
+
this.dispatch(AXPEntityDeletedEvent({ entity: moduleEntity, ids: ids }));
|
|
198
210
|
}
|
|
199
211
|
else if (successfulPromises === 0 && failedPromises > 0) {
|
|
200
212
|
// No items deleted, all failed
|
|
@@ -216,11 +228,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
|
216
228
|
type: Injectable
|
|
217
229
|
}] });
|
|
218
230
|
const AXPDeleteEntityWorkflow = {
|
|
219
|
-
startStepId: '
|
|
231
|
+
startStepId: 'confirm-delete',
|
|
220
232
|
steps: {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
action: 'AXPDialogConfirmAction',
|
|
233
|
+
"confirm-delete": {
|
|
234
|
+
action: 'show-prompt-dialog',
|
|
224
235
|
input: {
|
|
225
236
|
title: 'Warning',
|
|
226
237
|
message: `Are you sure want to delete selected item(s)?`,
|
|
@@ -232,17 +243,16 @@ const AXPDeleteEntityWorkflow = {
|
|
|
232
243
|
{
|
|
233
244
|
type: 'AND',
|
|
234
245
|
conditions: [
|
|
235
|
-
{ type: 'SINGLE', expression: 'context.getOutput("
|
|
246
|
+
{ type: 'SINGLE', expression: 'context.getOutput("result") == true' },
|
|
236
247
|
],
|
|
237
248
|
},
|
|
238
249
|
],
|
|
239
|
-
nextStepId: '
|
|
250
|
+
nextStepId: 'perform-delete',
|
|
240
251
|
},
|
|
241
252
|
],
|
|
242
253
|
},
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
action: 'AXPEntityPerformDeleteAction',
|
|
254
|
+
"perform-delete": {
|
|
255
|
+
action: 'entity-perform-delete',
|
|
246
256
|
},
|
|
247
257
|
},
|
|
248
258
|
};
|
|
@@ -255,15 +265,14 @@ class AXPEntityMasterUpdateElementViewModel {
|
|
|
255
265
|
this.title = signal(this.property.title);
|
|
256
266
|
this.description = signal(this.property.description);
|
|
257
267
|
this.editable = computed(() => {
|
|
258
|
-
return !(this.property.schema.readonly ?? false)
|
|
259
|
-
(this.property.options?.update?.enabled ?? true);
|
|
268
|
+
return !(this.property.schema.readonly ?? false);
|
|
260
269
|
});
|
|
261
|
-
this.order = signal(this.property.options?.view?.layout?.order ?? 0);
|
|
262
270
|
this.isRequired = computed(() => {
|
|
263
271
|
return this.property.validations?.some(c => c.rule == 'required') || false;
|
|
264
272
|
});
|
|
265
273
|
this.layout = computed(() => {
|
|
266
|
-
const
|
|
274
|
+
const updateProp = this.entity.interfaces?.master?.update?.properties?.find(c => c.name == this.property.name);
|
|
275
|
+
const source = cloneDeep(updateProp?.layout ?? {});
|
|
267
276
|
set(source, "positions.default.colSpan", 12);
|
|
268
277
|
return source;
|
|
269
278
|
});
|
|
@@ -277,7 +286,9 @@ class AXPEntityMasterUpdateElementViewModel {
|
|
|
277
286
|
children: widget.children,
|
|
278
287
|
formula: widget.formula,
|
|
279
288
|
triggers: widget.triggers,
|
|
280
|
-
options: merge(schema.interface?.options,
|
|
289
|
+
options: merge(schema.interface?.options,
|
|
290
|
+
//this.property.options?.create?.widget,
|
|
291
|
+
{ validationRules: this.property.validations })
|
|
281
292
|
};
|
|
282
293
|
});
|
|
283
294
|
}
|
|
@@ -293,7 +304,8 @@ class AXPEntityMasterUpdateViewModel {
|
|
|
293
304
|
this.isInProgress = signal(false);
|
|
294
305
|
this.context = signal(cloneDeep(this.entityData));
|
|
295
306
|
this.elements = computed(() => {
|
|
296
|
-
const props = this.entityDef.properties.filter(c => this.props.includes(c.name) &&
|
|
307
|
+
const props = this.entityDef.properties.filter(c => this.props.includes(c.name) &&
|
|
308
|
+
c.schema.hidden != true);
|
|
297
309
|
return props.map(e => {
|
|
298
310
|
return new AXPEntityMasterUpdateElementViewModel(this.entityDef, e);
|
|
299
311
|
});
|
|
@@ -353,10 +365,10 @@ class AXPEntityModifySectionPopupAction extends AXPWorkflowAction {
|
|
|
353
365
|
this.factory = inject(AXPEntityMasterUpdateViewModelFactory);
|
|
354
366
|
}
|
|
355
367
|
async execute(context) {
|
|
356
|
-
const
|
|
357
|
-
const {
|
|
358
|
-
const entityRef = await this.entityRegistery.resolve(
|
|
359
|
-
const vm = await this.factory.create(
|
|
368
|
+
const [moduleName, entityName] = context.getVariable('entity').split(".");
|
|
369
|
+
const { properties, id, title } = context.getVariable('data');
|
|
370
|
+
const entityRef = await this.entityRegistery.resolve(moduleName, entityName);
|
|
371
|
+
const vm = await this.factory.create(moduleName, entityName, id, properties);
|
|
360
372
|
const com = await this.config.viewers.master.modify();
|
|
361
373
|
const popup = await this.popupService.open(com, {
|
|
362
374
|
title: title ?? `Modify ${entityRef.formats.individual}`,
|
|
@@ -367,10 +379,10 @@ class AXPEntityModifySectionPopupAction extends AXPWorkflowAction {
|
|
|
367
379
|
entity: entityRef,
|
|
368
380
|
},
|
|
369
381
|
});
|
|
370
|
-
context.setOutput('
|
|
382
|
+
context.setOutput('result', false);
|
|
371
383
|
if (popup.data?.result == true) {
|
|
372
|
-
context.setOutput('
|
|
373
|
-
context.setVariable('
|
|
384
|
+
context.setOutput('result', true);
|
|
385
|
+
context.setVariable('data', cloneDeep(popup.data.context));
|
|
374
386
|
}
|
|
375
387
|
}
|
|
376
388
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityModifySectionPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -380,15 +392,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
|
380
392
|
type: Injectable
|
|
381
393
|
}] });
|
|
382
394
|
class AXPEntityModifyConfirmedAction extends AXPWorkflowAction {
|
|
383
|
-
constructor() {
|
|
384
|
-
super(...arguments);
|
|
385
|
-
this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
|
|
386
|
-
}
|
|
387
395
|
async execute(context) {
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
const entity = await this.entityRegistery.resolve(payload.module, payload.entity);
|
|
391
|
-
this.dispatch(AXPEntityModifyEvent({ module: entity.module, entity: entity.name, updateValues: updatedData }));
|
|
396
|
+
const updatedData = context.getVariable('data');
|
|
397
|
+
this.dispatch(AXPEntityModifyEvent({ entity: context.getVariable('entity'), values: updatedData }));
|
|
392
398
|
}
|
|
393
399
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityModifyConfirmedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
394
400
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityModifyConfirmedAction }); }
|
|
@@ -404,7 +410,7 @@ const AXPModifyEntitySectionWorkflow = {
|
|
|
404
410
|
action: 'AXPEntityModifySectionPopupAction',
|
|
405
411
|
nextSteps: [
|
|
406
412
|
{
|
|
407
|
-
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("
|
|
413
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
|
408
414
|
nextStepId: 'successToast',
|
|
409
415
|
},
|
|
410
416
|
],
|
|
@@ -427,12 +433,6 @@ const AXPModifyEntitySectionWorkflow = {
|
|
|
427
433
|
modifyConfirmed: {
|
|
428
434
|
id: 'modifyConfirmed',
|
|
429
435
|
action: 'AXPEntityModifyConfirmedAction',
|
|
430
|
-
nextSteps: [
|
|
431
|
-
{
|
|
432
|
-
conditions: [],
|
|
433
|
-
nextStepId: '',
|
|
434
|
-
},
|
|
435
|
-
],
|
|
436
436
|
},
|
|
437
437
|
},
|
|
438
438
|
};
|
|
@@ -500,12 +500,13 @@ class AXPEntityDetailListViewModel {
|
|
|
500
500
|
//****************** Columns ******************//
|
|
501
501
|
this.columns = computed(() => {
|
|
502
502
|
if (this.detailEntity()) {
|
|
503
|
-
const
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
(
|
|
507
|
-
|
|
508
|
-
|
|
503
|
+
const detailColumns = this.detailEntityConfig.columns ?? [];
|
|
504
|
+
const columns = this.detailEntity()?.columns?.map(c => c.name) ?? [];
|
|
505
|
+
const props = this.detailEntity()?.properties.filter(p => p.schema.hidden != true &&
|
|
506
|
+
(detailColumns?.length == 0 || detailColumns?.includes(p.name))) ?? [];
|
|
507
|
+
const displayColumns = props.filter(p => columns.some(c => c == p.name));
|
|
508
|
+
return displayColumns.map(p => {
|
|
509
|
+
return new AXPEntityListViewColumnViewModel(p, this.detailEntity()?.columns?.find(c => c.name == p.name));
|
|
509
510
|
});
|
|
510
511
|
}
|
|
511
512
|
return [];
|
|
@@ -550,7 +551,7 @@ class AXPEntityDetailListViewModel {
|
|
|
550
551
|
return {
|
|
551
552
|
field: c.name,
|
|
552
553
|
operator: c.operator,
|
|
553
|
-
value: this.parent.data
|
|
554
|
+
value: this.parent.data?.id
|
|
554
555
|
};
|
|
555
556
|
}) ?? [];
|
|
556
557
|
const parentFilterWrapper = {
|
|
@@ -586,34 +587,36 @@ class AXPEntityDetailListViewModel {
|
|
|
586
587
|
}
|
|
587
588
|
|
|
588
589
|
class AXPEntityMasterSingleViewGroupViewModel {
|
|
589
|
-
constructor(entity,
|
|
590
|
+
constructor(entity, section) {
|
|
590
591
|
this.entity = entity;
|
|
591
|
-
this.
|
|
592
|
+
this.section = section;
|
|
593
|
+
this.group = this.entity.groups?.find(c => c.id == this.section.id);
|
|
592
594
|
this.name = signal(this.group.id);
|
|
593
595
|
this.isLoading = signal(false);
|
|
594
596
|
this.title = computed(() => {
|
|
595
|
-
|
|
596
|
-
return this.group.title;
|
|
597
|
-
return this.group.id;
|
|
597
|
+
return this.group.title ?? this.group.id;
|
|
598
598
|
});
|
|
599
599
|
this.description = computed(() => {
|
|
600
|
-
|
|
601
|
-
return this.group.description;
|
|
602
|
-
return null;
|
|
600
|
+
return this.group.description;
|
|
603
601
|
});
|
|
604
602
|
this.layout = computed(() => {
|
|
605
|
-
const source = cloneDeep(this.
|
|
603
|
+
const source = cloneDeep(this.section.layout ?? {});
|
|
606
604
|
set(source, "positions.default.colSpan", 12);
|
|
607
605
|
return source;
|
|
608
606
|
});
|
|
609
607
|
this.props = computed(() => {
|
|
610
|
-
const props = this.entity.properties.filter(c => c.groupId == this.group.id &&
|
|
611
|
-
|
|
608
|
+
const props = this.entity.properties.filter(c => c.groupId == this.group.id &&
|
|
609
|
+
c.schema.hidden != true).map(c => c.name);
|
|
610
|
+
const viewProps = this.entity.interfaces?.master?.single?.properties?.filter(c => props.includes(c.name)) ?? [];
|
|
611
|
+
return viewProps.map(e => {
|
|
612
612
|
return new AXPEntityMasterSingleElementViewModel(this.entity, this, e);
|
|
613
613
|
});
|
|
614
614
|
});
|
|
615
615
|
this.editableProps = computed(() => {
|
|
616
|
-
const
|
|
616
|
+
const editableProps = this.entity.interfaces?.master?.update?.properties?.map(c => c.name) ?? [];
|
|
617
|
+
const props = this.entity.properties.filter(c => c.groupId == this.group.id &&
|
|
618
|
+
c.schema.hidden != true &&
|
|
619
|
+
editableProps.includes(c.name));
|
|
617
620
|
return props.map(e => {
|
|
618
621
|
return new AXPEntityMasterSingleElementViewModel(this.entity, this, e);
|
|
619
622
|
});
|
|
@@ -624,16 +627,17 @@ class AXPEntityMasterSingleViewGroupViewModel {
|
|
|
624
627
|
}
|
|
625
628
|
}
|
|
626
629
|
class AXPEntityMasterSingleElementViewModel {
|
|
627
|
-
constructor(entity, section,
|
|
630
|
+
constructor(entity, section, propertyView) {
|
|
628
631
|
this.entity = entity;
|
|
629
632
|
this.section = section;
|
|
630
|
-
this.
|
|
633
|
+
this.propertyView = propertyView;
|
|
634
|
+
this.property = this.entity.properties.find(c => c.name == this.propertyView.name);
|
|
631
635
|
this.name = signal(this.property.name);
|
|
632
636
|
this.title = signal(this.property.title);
|
|
633
637
|
this.description = signal(this.property.description);
|
|
634
|
-
this.order = signal(this.property.options?.view?.layout?.order ?? 0);
|
|
635
638
|
this.layout = computed(() => {
|
|
636
|
-
const
|
|
639
|
+
const viewProp = this.entity.interfaces?.master?.single?.properties?.find(c => c.name == this.property.name);
|
|
640
|
+
const source = cloneDeep(viewProp?.layout ?? {});
|
|
637
641
|
set(source, "positions.default.colSpan", 12);
|
|
638
642
|
return source;
|
|
639
643
|
});
|
|
@@ -646,7 +650,9 @@ class AXPEntityMasterSingleElementViewModel {
|
|
|
646
650
|
path: this.name(),
|
|
647
651
|
children: widget.children,
|
|
648
652
|
formula: widget.formula,
|
|
649
|
-
options: merge(schema.interface?.options,
|
|
653
|
+
options: merge(schema.interface?.options,
|
|
654
|
+
//this.property.options?.create?.widget,
|
|
655
|
+
{ validationRules: this.property.validations })
|
|
650
656
|
};
|
|
651
657
|
});
|
|
652
658
|
}
|
|
@@ -661,6 +667,7 @@ class AXPEntityMasterSingleViewModel {
|
|
|
661
667
|
this.session = this.injector.get(AXPSessionService);
|
|
662
668
|
this.formatService = this.injector.get(AXFormatService);
|
|
663
669
|
this.workflow = this.injector.get(AXPWorkflowService);
|
|
670
|
+
this.events$ = new Subject();
|
|
664
671
|
this.context = signal(cloneDeep(this.entityData));
|
|
665
672
|
this.actions = computed(() => {
|
|
666
673
|
return this.entityDef.interfaces?.master?.single?.actions?.map((tr) => new AXPEntityCommandTriggerViewModel(this.entityDef, tr)) ?? [];
|
|
@@ -672,8 +679,11 @@ class AXPEntityMasterSingleViewModel {
|
|
|
672
679
|
return this.actions().filter(c => c.priority == 'secondary');
|
|
673
680
|
});
|
|
674
681
|
this.sections = computed(() => {
|
|
675
|
-
const
|
|
676
|
-
const
|
|
682
|
+
const viewProps = this.entityDef.interfaces?.master?.single?.properties?.map(c => c.name);
|
|
683
|
+
const props = this.entityDef.properties.filter(c => c.groupId &&
|
|
684
|
+
c.schema.hidden != true &&
|
|
685
|
+
viewProps?.includes(c.name));
|
|
686
|
+
const groups = this.entityDef.interfaces?.master?.single?.sections?.filter(g => props.some(p => p.groupId == g.id)) ?? [];
|
|
677
687
|
const result = groups?.map((section) => {
|
|
678
688
|
return new AXPEntityMasterSingleViewGroupViewModel(this.entityDef, section);
|
|
679
689
|
});
|
|
@@ -712,24 +722,17 @@ class AXPEntityMasterSingleViewModel {
|
|
|
712
722
|
return this.entityDef.relatedEntities?.map(re => new AXPEntityDetailListViewModel(this.injector, re, { entity: this.entityDef, data: this.entityData })) ?? [];
|
|
713
723
|
});
|
|
714
724
|
this.workflow.events$.pipe(ofType(AXPEntityDeletedEvent)).subscribe((event) => {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
// payload: {
|
|
722
|
-
// module: this.loader.entity.module,
|
|
723
|
-
// entity: this.loader.entity.name,
|
|
724
|
-
// },
|
|
725
|
-
// });
|
|
726
|
-
//}
|
|
725
|
+
if (event.payload.entity == this.entityDef.source &&
|
|
726
|
+
event.payload.ids.includes(this.context().id)) {
|
|
727
|
+
this.workflow.execute('show-list-view', {
|
|
728
|
+
entity: this.entityDef.source
|
|
729
|
+
});
|
|
730
|
+
}
|
|
727
731
|
});
|
|
728
732
|
this.workflow.events$.pipe(ofType(AXPEntityModifyEvent)).subscribe(async (event) => {
|
|
729
|
-
if (event.payload.entity == this.entityDef.
|
|
730
|
-
event.payload.
|
|
731
|
-
|
|
732
|
-
this.context.set(event.payload.updateValues);
|
|
733
|
+
if (event.payload.entity == this.entityDef.source &&
|
|
734
|
+
event.payload.values.id === this.context().id) {
|
|
735
|
+
this.context.set(event.payload.values);
|
|
733
736
|
}
|
|
734
737
|
});
|
|
735
738
|
}
|
|
@@ -739,18 +742,16 @@ class AXPEntityMasterSingleViewModel {
|
|
|
739
742
|
switch (commandName) {
|
|
740
743
|
case 'delete-entity':
|
|
741
744
|
this.workflow.execute('delete-entity', {
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
ids: [this.context().id],
|
|
745
|
+
entity: this.entityDef.source,
|
|
746
|
+
data: [this.context()],
|
|
745
747
|
});
|
|
746
748
|
break;
|
|
747
749
|
case 'modify-entity-section': {
|
|
748
750
|
this.workflow.execute('modify-entity-section', {
|
|
749
|
-
|
|
751
|
+
entity: this.entityDef.source,
|
|
752
|
+
data: {
|
|
753
|
+
id: this.context().id,
|
|
750
754
|
properties: data.editableProps().map(m => m.name()),
|
|
751
|
-
id: this.entityData.id,
|
|
752
|
-
module: this.entityDef.module,
|
|
753
|
-
entity: this.entityDef.name,
|
|
754
755
|
},
|
|
755
756
|
});
|
|
756
757
|
break;
|
|
@@ -759,11 +760,8 @@ class AXPEntityMasterSingleViewModel {
|
|
|
759
760
|
{
|
|
760
761
|
const action = this.actions().find(c => c.name == commandName);
|
|
761
762
|
this.workflow.execute(commandName, {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
entity: this.entityDef.name,
|
|
765
|
-
data: action?.scope == AXPEntityCommandScope.Individual ? data : null
|
|
766
|
-
}
|
|
763
|
+
entity: this.entityDef.source,
|
|
764
|
+
data: action?.scope == AXPEntityCommandScope.Individual ? data : null
|
|
767
765
|
});
|
|
768
766
|
}
|
|
769
767
|
}
|
|
@@ -795,7 +793,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
|
795
793
|
args: [{ providedIn: 'root' }]
|
|
796
794
|
}] });
|
|
797
795
|
const AXPEntityDetailViewModelResolver = (route, state, service = inject(AXPEntityDetailViewModelFactory)) => {
|
|
798
|
-
const appName = route.parent?.paramMap.get('app');
|
|
799
796
|
const moduleName = route.parent?.paramMap.get('module');
|
|
800
797
|
const entityName = route.paramMap.get('entity');
|
|
801
798
|
const id = route.paramMap.get('id');
|
|
@@ -804,52 +801,52 @@ const AXPEntityDetailViewModelResolver = (route, state, service = inject(AXPEnti
|
|
|
804
801
|
};
|
|
805
802
|
|
|
806
803
|
class AXPEntityCreateViewSectionViewModel {
|
|
807
|
-
constructor(entity,
|
|
804
|
+
constructor(entity, section) {
|
|
808
805
|
this.entity = entity;
|
|
809
|
-
this.
|
|
806
|
+
this.section = section;
|
|
807
|
+
this.group = this.entity.groups?.find(c => c.id == this.section.id);
|
|
810
808
|
this.name = signal(this.group.id);
|
|
811
809
|
this.title = computed(() => {
|
|
812
|
-
|
|
813
|
-
return this.group.title;
|
|
814
|
-
return this.group.id;
|
|
810
|
+
return this.group.title ?? this.group.id;
|
|
815
811
|
});
|
|
816
812
|
this.description = computed(() => {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
return null;
|
|
813
|
+
return this.group.description;
|
|
814
|
+
;
|
|
820
815
|
});
|
|
821
816
|
this.layout = computed(() => {
|
|
822
|
-
const source = cloneDeep(this.
|
|
817
|
+
const source = cloneDeep(this.section.layout ?? {});
|
|
823
818
|
set(source, "positions.default.colSpan", 12);
|
|
824
819
|
return source;
|
|
825
820
|
});
|
|
826
821
|
this.elements = computed(() => {
|
|
822
|
+
const createProps = this.entity.interfaces?.master?.create?.properties ?? [];
|
|
823
|
+
const createPropsNames = createProps.map(c => c.name);
|
|
827
824
|
const props = this.entity.properties.filter(c => c.groupId == this.group.id &&
|
|
828
825
|
c.schema.hidden != true &&
|
|
829
|
-
c.
|
|
830
|
-
return props.map(
|
|
831
|
-
return new AXPEntityCreateViewElementViewModel(this.entity, this,
|
|
826
|
+
createPropsNames.includes(c.name));
|
|
827
|
+
return props.map(p => {
|
|
828
|
+
return new AXPEntityCreateViewElementViewModel(this.entity, this, p, createProps.find(c => c.name == p.name));
|
|
832
829
|
});
|
|
833
830
|
});
|
|
834
831
|
}
|
|
835
832
|
}
|
|
836
833
|
class AXPEntityCreateViewElementViewModel {
|
|
837
|
-
constructor(entity, section, property) {
|
|
834
|
+
constructor(entity, section, property, createProp) {
|
|
838
835
|
this.entity = entity;
|
|
839
836
|
this.section = section;
|
|
840
837
|
this.property = property;
|
|
838
|
+
this.createProp = createProp;
|
|
841
839
|
this.name = signal(this.property.name);
|
|
842
840
|
this.title = signal(this.property.title);
|
|
843
841
|
this.description = signal(this.property.description);
|
|
844
842
|
this.editable = computed(() => {
|
|
845
843
|
return !(this.property.schema.readonly ?? false);
|
|
846
844
|
});
|
|
847
|
-
this.order = signal(this.property.options?.view?.layout?.order ?? 0);
|
|
848
845
|
this.isRequired = computed(() => {
|
|
849
846
|
return this.property.validations?.some(c => c.rule == 'required') || false;
|
|
850
847
|
});
|
|
851
848
|
this.layout = computed(() => {
|
|
852
|
-
const source = cloneDeep(this.
|
|
849
|
+
const source = cloneDeep(this.createProp.layout ?? {});
|
|
853
850
|
set(source, "positions.default.colSpan", 12);
|
|
854
851
|
return source;
|
|
855
852
|
});
|
|
@@ -863,28 +860,41 @@ class AXPEntityCreateViewElementViewModel {
|
|
|
863
860
|
children: widget.children,
|
|
864
861
|
formula: widget.formula,
|
|
865
862
|
triggers: widget.triggers,
|
|
866
|
-
options: merge(schema.interface?.options,
|
|
863
|
+
options: merge(schema.interface?.options,
|
|
864
|
+
//this.property.options?.create?.widget,
|
|
865
|
+
{ validationRules: this.property.validations })
|
|
867
866
|
};
|
|
868
867
|
});
|
|
869
868
|
}
|
|
870
869
|
}
|
|
871
870
|
class AXPEntityMasterCreateViewModel {
|
|
872
|
-
constructor(injector, config, initialData =
|
|
871
|
+
constructor(injector, config, initialData = {}) {
|
|
873
872
|
this.injector = injector;
|
|
874
873
|
this.config = config;
|
|
875
874
|
this.initialData = initialData;
|
|
876
875
|
this.entityDef = cloneDeep(this.config);
|
|
877
876
|
this.workflow = this.injector.get(AXPWorkflowService);
|
|
878
|
-
this.context = signal({});
|
|
877
|
+
this.context = signal(this.initialData ?? {});
|
|
879
878
|
this.isInProgress = signal(false);
|
|
880
879
|
this.sections = computed(() => {
|
|
881
|
-
const
|
|
882
|
-
const
|
|
880
|
+
const createProps = this.entityDef.interfaces?.master?.create?.properties?.map(c => c.name) ?? [];
|
|
881
|
+
const props = this.entityDef.properties.filter(p => p.groupId && p.schema.hidden != true && createProps.includes(p.name));
|
|
882
|
+
const groups = this.entityDef.interfaces?.master?.create?.sections?.filter(g => props.some(p => p.groupId == g.id)) ?? [];
|
|
883
883
|
const result = groups?.map((section) => {
|
|
884
884
|
return new AXPEntityCreateViewSectionViewModel(this.entityDef, section);
|
|
885
885
|
});
|
|
886
886
|
return (result ?? []);
|
|
887
887
|
});
|
|
888
|
+
if (!initialData)
|
|
889
|
+
initialData = {};
|
|
890
|
+
this.config.properties
|
|
891
|
+
.filter(c => c.schema.defaultValue && typeof c.schema.defaultValue === 'function')
|
|
892
|
+
.forEach(p => {
|
|
893
|
+
debugger;
|
|
894
|
+
const func = p.schema.defaultValue;
|
|
895
|
+
set(initialData, p.name, func(initialData));
|
|
896
|
+
});
|
|
897
|
+
this.context.set(initialData);
|
|
888
898
|
}
|
|
889
899
|
async save() {
|
|
890
900
|
try {
|
|
@@ -946,6 +956,7 @@ class AXPEntityMasterListViewModel {
|
|
|
946
956
|
this.formatService = this.injector.get(AXFormatService);
|
|
947
957
|
this.session = this.injector.get(AXPSessionService);
|
|
948
958
|
this.workflow = this.injector.get(AXPWorkflowService);
|
|
959
|
+
this.events$ = new Subject();
|
|
949
960
|
this.dataSource = new AXDataSource({
|
|
950
961
|
byKey: (key) => {
|
|
951
962
|
const func = this.entityDef.queries.byKey.execute;
|
|
@@ -1020,9 +1031,11 @@ class AXPEntityMasterListViewModel {
|
|
|
1020
1031
|
};
|
|
1021
1032
|
//****************** Columns ******************//
|
|
1022
1033
|
this.allAvailableColumns = () => {
|
|
1023
|
-
const
|
|
1024
|
-
|
|
1025
|
-
|
|
1034
|
+
const columns = this.entityDef.columns?.map(c => c.name) ?? [];
|
|
1035
|
+
const props = this.entityDef.properties.filter(p => p.schema.hidden != true);
|
|
1036
|
+
const displayColumns = props.filter(p => columns.some(c => c == p.name));
|
|
1037
|
+
return displayColumns.map(p => {
|
|
1038
|
+
return new AXPEntityListViewColumnViewModel(p, this.entityDef.columns?.find(c => c.name == p.name));
|
|
1026
1039
|
});
|
|
1027
1040
|
};
|
|
1028
1041
|
this.visibleColumnCount = () => {
|
|
@@ -1060,6 +1073,12 @@ class AXPEntityMasterListViewModel {
|
|
|
1060
1073
|
});
|
|
1061
1074
|
});
|
|
1062
1075
|
this.view = signal(this.views()[0]);
|
|
1076
|
+
this.workflow.events$.pipe(ofType(AXPEntityDeletedEvent)).subscribe((event) => {
|
|
1077
|
+
if (event.payload.entity == this.entityDef.source) {
|
|
1078
|
+
this.selectedItems.set([]);
|
|
1079
|
+
this.events$.next({ action: "refresh" });
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1063
1082
|
}
|
|
1064
1083
|
clearSelection() {
|
|
1065
1084
|
this.selectedItems.set([]);
|
|
@@ -1087,7 +1106,6 @@ class AXPEntityMasterListViewModel {
|
|
|
1087
1106
|
//
|
|
1088
1107
|
const inline = this.inlineFilters.filters?.length ?? 0;
|
|
1089
1108
|
const advance = this.advanceFilters.filters?.length ?? 0;
|
|
1090
|
-
debugger;
|
|
1091
1109
|
if (inline && !advance) {
|
|
1092
1110
|
this.dataSource.filter(this.inlineFilters);
|
|
1093
1111
|
}
|
|
@@ -1115,8 +1133,10 @@ class AXPEntityMasterListViewModel {
|
|
|
1115
1133
|
const cols = this.view().columns;
|
|
1116
1134
|
const cloned = this.allAvailableColumns()
|
|
1117
1135
|
.map(c => {
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1136
|
+
const column = this.entityDef.columns?.find(cc => cc.name == c.name);
|
|
1137
|
+
const prop = this.entityDef.properties.find(p => p.name == c.name);
|
|
1138
|
+
const col = new AXPEntityListViewColumnViewModel(prop, column);
|
|
1139
|
+
col.visible = !cols.some(c => c == col.name) && col.visible != false;
|
|
1120
1140
|
return col;
|
|
1121
1141
|
});
|
|
1122
1142
|
this.columns.set(cloned);
|
|
@@ -1155,14 +1175,10 @@ class AXPEntityMasterListViewModel {
|
|
|
1155
1175
|
}
|
|
1156
1176
|
//****************** Commands ******************//
|
|
1157
1177
|
async executeCommand(commandName, data = null) {
|
|
1158
|
-
// debugger
|
|
1159
1178
|
const action = this.actions().find(c => c.name == commandName);
|
|
1160
|
-
this.workflow.execute(commandName, {
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
entity: this.entityDef.name,
|
|
1164
|
-
data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems : data
|
|
1165
|
-
}
|
|
1179
|
+
await this.workflow.execute(commandName, {
|
|
1180
|
+
entity: this.entityDef.source,
|
|
1181
|
+
data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data
|
|
1166
1182
|
});
|
|
1167
1183
|
}
|
|
1168
1184
|
}
|
|
@@ -1204,21 +1220,23 @@ class AXPEntityCreatePopupAction extends AXPWorkflowAction {
|
|
|
1204
1220
|
this.config = inject(AXP_ENTITY_CONFIG_TOKEN);
|
|
1205
1221
|
}
|
|
1206
1222
|
async execute(context) {
|
|
1207
|
-
const
|
|
1223
|
+
const [module, entity] = context.getVariable('entity').split(".");
|
|
1224
|
+
const dataContext = context.getVariable('context');
|
|
1208
1225
|
const entityRef = await this.entityRegistery.resolve(module, entity);
|
|
1209
1226
|
const com = await this.config.viewers.master.create();
|
|
1210
1227
|
const result = await this.popupService.open(com, {
|
|
1211
1228
|
title: `Create New ${entityRef.formats.individual}`,
|
|
1212
1229
|
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
|
|
1213
1230
|
data: {
|
|
1214
|
-
vm: await this.factory.create(module, entity),
|
|
1231
|
+
vm: await this.factory.create(module, entity, dataContext),
|
|
1215
1232
|
entity,
|
|
1216
1233
|
},
|
|
1217
1234
|
});
|
|
1235
|
+
context.setOutput('result', false);
|
|
1218
1236
|
if (result.data?.save) {
|
|
1219
|
-
context.setOutput('
|
|
1237
|
+
context.setOutput('result', true);
|
|
1220
1238
|
context.setVariable('redirect', result.data.redirect);
|
|
1221
|
-
context.setVariable('
|
|
1239
|
+
context.setVariable('data', result.data.item);
|
|
1222
1240
|
}
|
|
1223
1241
|
}
|
|
1224
1242
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityCreatePopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -1229,25 +1247,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
|
1229
1247
|
}] });
|
|
1230
1248
|
class AXPEntityCreateSubmittedAction extends AXPWorkflowAction {
|
|
1231
1249
|
async execute(context) {
|
|
1232
|
-
|
|
1233
|
-
this.dispatch(AXPEntityCreateEvent({ entity, module }));
|
|
1250
|
+
this.dispatch(AXPEntityCreateEvent({ entity: context.getVariable('entity') }));
|
|
1234
1251
|
}
|
|
1235
1252
|
}
|
|
1236
1253
|
const AXPCreateEntityWorkflow = {
|
|
1237
|
-
startStepId: '
|
|
1254
|
+
startStepId: 'show-popup',
|
|
1238
1255
|
steps: {
|
|
1239
|
-
|
|
1240
|
-
id: 'createPopup',
|
|
1256
|
+
"show-popup": {
|
|
1241
1257
|
action: 'AXPEntityCreatePopupAction',
|
|
1242
1258
|
nextSteps: [
|
|
1243
1259
|
{
|
|
1244
|
-
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("
|
|
1245
|
-
nextStepId: '
|
|
1260
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
|
|
1261
|
+
nextStepId: 'show-toast',
|
|
1246
1262
|
},
|
|
1247
1263
|
],
|
|
1248
1264
|
},
|
|
1249
|
-
|
|
1250
|
-
id: 'successToast',
|
|
1265
|
+
"show-toast": {
|
|
1251
1266
|
action: 'AXPToastAction',
|
|
1252
1267
|
input: {
|
|
1253
1268
|
color: 'success',
|
|
@@ -1257,22 +1272,20 @@ const AXPCreateEntityWorkflow = {
|
|
|
1257
1272
|
nextSteps: [
|
|
1258
1273
|
{
|
|
1259
1274
|
conditions: [],
|
|
1260
|
-
nextStepId: '
|
|
1275
|
+
nextStepId: 'dispatch-event',
|
|
1261
1276
|
},
|
|
1262
1277
|
],
|
|
1263
1278
|
},
|
|
1264
|
-
|
|
1265
|
-
id: 'createSubmitted',
|
|
1279
|
+
"dispatch-event": {
|
|
1266
1280
|
action: 'AXPEntityCreateSubmittedAction',
|
|
1267
1281
|
nextSteps: [
|
|
1268
1282
|
{
|
|
1269
1283
|
conditions: [{ type: 'SINGLE', expression: 'context.getVariable("redirect") == true' }],
|
|
1270
|
-
nextStepId: '
|
|
1284
|
+
nextStepId: 'show-entity',
|
|
1271
1285
|
},
|
|
1272
1286
|
],
|
|
1273
1287
|
},
|
|
1274
|
-
|
|
1275
|
-
id: 'showDetailView',
|
|
1288
|
+
"show-entity": {
|
|
1276
1289
|
action: 'AXPShowDetailViewAction',
|
|
1277
1290
|
},
|
|
1278
1291
|
},
|
|
@@ -1285,8 +1298,8 @@ class AXPShowDetailViewAction extends AXPWorkflowAction {
|
|
|
1285
1298
|
this.sessionService = inject(AXPSessionService);
|
|
1286
1299
|
}
|
|
1287
1300
|
async execute(context) {
|
|
1288
|
-
const
|
|
1289
|
-
const id = data
|
|
1301
|
+
const [module, entity] = context.getVariable('entity').split(".");
|
|
1302
|
+
const { id } = context.getVariable('data');
|
|
1290
1303
|
const newPayload = {
|
|
1291
1304
|
commands: `/${this.sessionService.application?.name}/m/${module}/e/${entity}/${id}/view`,
|
|
1292
1305
|
};
|
|
@@ -1330,9 +1343,24 @@ var lookupWidgetView_component = /*#__PURE__*/Object.freeze({
|
|
|
1330
1343
|
});
|
|
1331
1344
|
|
|
1332
1345
|
class AXPLookupWidgetSelectorComponent extends AXBasePageComponent {
|
|
1346
|
+
// protected override ngOnInit(): void {
|
|
1347
|
+
// super.ngOnInit();
|
|
1348
|
+
// }
|
|
1349
|
+
ngAfterViewInit() {
|
|
1350
|
+
debugger;
|
|
1351
|
+
if (this.searchTerm) {
|
|
1352
|
+
this.vm.applyInlineFilter(this.searchTerm);
|
|
1353
|
+
}
|
|
1354
|
+
else {
|
|
1355
|
+
this.vm.applyFilterAndSort();
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1333
1358
|
handleRowDbClick(e) {
|
|
1334
1359
|
this.close({ items: [e.data] });
|
|
1335
1360
|
}
|
|
1361
|
+
handleRowClick(e) {
|
|
1362
|
+
this.focusedRow = e.data;
|
|
1363
|
+
}
|
|
1336
1364
|
async handleSelectedRowsChange(rows) {
|
|
1337
1365
|
//this.vm.selectedItems.set(rows);
|
|
1338
1366
|
}
|
|
@@ -1341,19 +1369,31 @@ class AXPLookupWidgetSelectorComponent extends AXBasePageComponent {
|
|
|
1341
1369
|
this.vm.applyInlineFilter(e.value);
|
|
1342
1370
|
}
|
|
1343
1371
|
}
|
|
1372
|
+
async handleCreateNewClick() {
|
|
1373
|
+
this.close();
|
|
1374
|
+
await this.vm.create();
|
|
1375
|
+
}
|
|
1376
|
+
handleCloseClick() {
|
|
1377
|
+
this.close();
|
|
1378
|
+
}
|
|
1379
|
+
handleSelectClick() {
|
|
1380
|
+
if (this.focusedRow) {
|
|
1381
|
+
this.close({ items: [this.focusedRow] });
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1344
1384
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPLookupWidgetSelectorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1345
1385
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.2", type: AXPLookupWidgetSelectorComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
1346
1386
|
<div class="ax-p-4 ax-flex ax-flex-col ax-gap-4 ax-overflow-hidden">
|
|
1347
1387
|
@if(vm.hasInlineFilters())
|
|
1348
1388
|
{
|
|
1349
1389
|
<div class="ax-w-full" >
|
|
1350
|
-
<ax-search-box [placeholder]="'Search on '+vm.inlineFiltersPlaceholders().join(', ')"
|
|
1351
|
-
(onValueChanged)="handleChangeSearchValue($event)"><ax-clear-button></ax-clear-button></ax-search-box>
|
|
1390
|
+
<ax-search-box [placeholder]="'Search on '+vm.inlineFiltersPlaceholders().join(', ')" [value]="searchTerm"
|
|
1391
|
+
(onValueChanged)="handleChangeSearchValue($event)" [axAutoFocus]="true"><ax-clear-button></ax-clear-button></ax-search-box>
|
|
1352
1392
|
</div>
|
|
1353
1393
|
}
|
|
1354
|
-
<ax-data-table #grid [showFooter]="false" class="ax-h-[50vh]" [paging]="true" [fetchDataMode]="'
|
|
1355
|
-
[loading]="{ enabled: true, animation: true }" [dataSource]="vm.dataSource"
|
|
1356
|
-
(selectedRowsChange)="handleSelectedRowsChange($event)" (onRowDbClick)="handleRowDbClick($event)">
|
|
1394
|
+
<ax-data-table #grid [showFooter]="false" class="ax-h-[50vh]" [paging]="true" [fetchDataMode]="'manual'"
|
|
1395
|
+
[loading]="{ enabled: true, animation: true }" [dataSource]="vm.dataSource"
|
|
1396
|
+
(selectedRowsChange)="handleSelectedRowsChange($event)" (onRowClick)="handleRowClick($event)" (onRowDbClick)="handleRowDbClick($event)">
|
|
1357
1397
|
<!-- <ax-select-column fixed="start" [width]="'50px'"></ax-select-column> -->
|
|
1358
1398
|
@for(col of vm.columns();track col.name) {
|
|
1359
1399
|
@if(col.visible)
|
|
@@ -1363,19 +1403,21 @@ class AXPLookupWidgetSelectorComponent extends AXBasePageComponent {
|
|
|
1363
1403
|
}
|
|
1364
1404
|
</ax-data-table>
|
|
1365
1405
|
</div>
|
|
1366
|
-
|
|
1406
|
+
<ax-footer>
|
|
1367
1407
|
<ax-suffix>
|
|
1368
|
-
<ax-button look="solid" color="ghost" text="
|
|
1369
|
-
<ax-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
<ax-button
|
|
1373
|
-
<ax-
|
|
1374
|
-
|
|
1375
|
-
|
|
1408
|
+
<ax-button look="solid" color="ghost" text="Close" (onClick)="handleCloseClick()"> </ax-button>
|
|
1409
|
+
<ax-button look="solid" color="primary" text="Select" (onClick)="handleSelectClick()" [disabled]="focusedRow==null"> </ax-button>
|
|
1410
|
+
@if(!vm.canCreate())
|
|
1411
|
+
{
|
|
1412
|
+
<ax-button look="solid" color="primary" text="Create New" (onClick)="handleCreateNewClick()">
|
|
1413
|
+
<ax-prefix>
|
|
1414
|
+
<ax-icon icon="fa-solid fa-add"></ax-icon>
|
|
1415
|
+
</ax-prefix>
|
|
1416
|
+
</ax-button>
|
|
1417
|
+
}
|
|
1376
1418
|
</ax-suffix>
|
|
1377
|
-
</ax-footer>
|
|
1378
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type:
|
|
1419
|
+
</ax-footer>
|
|
1420
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXCommonModule }, { kind: "directive", type: i1.AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "ngmodule", type: AXDataTableModule }, { kind: "component", type: i4.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "rowTemplate", "emptyTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i5.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "delayTime"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i6.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["caption", "node", "footerTemplate", "cellTemplate", "headerTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1379
1421
|
}
|
|
1380
1422
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPLookupWidgetSelectorComponent, decorators: [{
|
|
1381
1423
|
type: Component,
|
|
@@ -1385,13 +1427,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
|
1385
1427
|
@if(vm.hasInlineFilters())
|
|
1386
1428
|
{
|
|
1387
1429
|
<div class="ax-w-full" >
|
|
1388
|
-
<ax-search-box [placeholder]="'Search on '+vm.inlineFiltersPlaceholders().join(', ')"
|
|
1389
|
-
(onValueChanged)="handleChangeSearchValue($event)"><ax-clear-button></ax-clear-button></ax-search-box>
|
|
1430
|
+
<ax-search-box [placeholder]="'Search on '+vm.inlineFiltersPlaceholders().join(', ')" [value]="searchTerm"
|
|
1431
|
+
(onValueChanged)="handleChangeSearchValue($event)" [axAutoFocus]="true"><ax-clear-button></ax-clear-button></ax-search-box>
|
|
1390
1432
|
</div>
|
|
1391
1433
|
}
|
|
1392
|
-
<ax-data-table #grid [showFooter]="false" class="ax-h-[50vh]" [paging]="true" [fetchDataMode]="'
|
|
1393
|
-
[loading]="{ enabled: true, animation: true }" [dataSource]="vm.dataSource"
|
|
1394
|
-
(selectedRowsChange)="handleSelectedRowsChange($event)" (onRowDbClick)="handleRowDbClick($event)">
|
|
1434
|
+
<ax-data-table #grid [showFooter]="false" class="ax-h-[50vh]" [paging]="true" [fetchDataMode]="'manual'"
|
|
1435
|
+
[loading]="{ enabled: true, animation: true }" [dataSource]="vm.dataSource"
|
|
1436
|
+
(selectedRowsChange)="handleSelectedRowsChange($event)" (onRowClick)="handleRowClick($event)" (onRowDbClick)="handleRowDbClick($event)">
|
|
1395
1437
|
<!-- <ax-select-column fixed="start" [width]="'50px'"></ax-select-column> -->
|
|
1396
1438
|
@for(col of vm.columns();track col.name) {
|
|
1397
1439
|
@if(col.visible)
|
|
@@ -1401,29 +1443,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
|
1401
1443
|
}
|
|
1402
1444
|
</ax-data-table>
|
|
1403
1445
|
</div>
|
|
1404
|
-
|
|
1446
|
+
<ax-footer>
|
|
1405
1447
|
<ax-suffix>
|
|
1406
|
-
<ax-button look="solid" color="ghost" text="
|
|
1407
|
-
<ax-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
<ax-button
|
|
1411
|
-
<ax-
|
|
1412
|
-
|
|
1413
|
-
|
|
1448
|
+
<ax-button look="solid" color="ghost" text="Close" (onClick)="handleCloseClick()"> </ax-button>
|
|
1449
|
+
<ax-button look="solid" color="primary" text="Select" (onClick)="handleSelectClick()" [disabled]="focusedRow==null"> </ax-button>
|
|
1450
|
+
@if(!vm.canCreate())
|
|
1451
|
+
{
|
|
1452
|
+
<ax-button look="solid" color="primary" text="Create New" (onClick)="handleCreateNewClick()">
|
|
1453
|
+
<ax-prefix>
|
|
1454
|
+
<ax-icon icon="fa-solid fa-add"></ax-icon>
|
|
1455
|
+
</ax-prefix>
|
|
1456
|
+
</ax-button>
|
|
1457
|
+
}
|
|
1414
1458
|
</ax-suffix>
|
|
1415
|
-
</ax-footer>
|
|
1459
|
+
</ax-footer>
|
|
1416
1460
|
`,
|
|
1417
1461
|
standalone: true,
|
|
1418
1462
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1419
|
-
imports: [
|
|
1463
|
+
imports: [
|
|
1464
|
+
CommonModule,
|
|
1465
|
+
AXCommonModule,
|
|
1466
|
+
AXButtonModule,
|
|
1467
|
+
AXFormModule,
|
|
1468
|
+
AXDecoratorModule,
|
|
1469
|
+
AXDropdownButtonModule,
|
|
1470
|
+
AXDataTableModule,
|
|
1471
|
+
AXSearchBoxModule,
|
|
1472
|
+
AXPLayoutBuilderModule
|
|
1473
|
+
],
|
|
1420
1474
|
inputs: []
|
|
1421
1475
|
}]
|
|
1422
1476
|
}] });
|
|
1423
1477
|
|
|
1424
1478
|
class AXPLookupWidgetSelectorViewModel {
|
|
1425
|
-
constructor(entityDef) {
|
|
1479
|
+
constructor(injector, entityDef, parentFilters = null) {
|
|
1480
|
+
this.injector = injector;
|
|
1426
1481
|
this.entityDef = entityDef;
|
|
1482
|
+
this.parentFilters = parentFilters;
|
|
1483
|
+
this.workflow = this.injector.get(AXPWorkflowService);
|
|
1427
1484
|
this.dataSource = new AXDataSource({
|
|
1428
1485
|
byKey: (key) => {
|
|
1429
1486
|
const func = this.entityDef.queries.byKey.execute;
|
|
@@ -1436,6 +1493,9 @@ class AXPLookupWidgetSelectorViewModel {
|
|
|
1436
1493
|
pageSize: 10,
|
|
1437
1494
|
key: 'id'
|
|
1438
1495
|
});
|
|
1496
|
+
this.canCreate = computed(() => {
|
|
1497
|
+
return this.entityDef.commands?.create?.execute != null;
|
|
1498
|
+
});
|
|
1439
1499
|
this.inlineFiltersPlaceholders = computed(() => {
|
|
1440
1500
|
return this.entityDef.properties.filter(p => p.options?.filter?.inline?.enabled).map(c => c.title);
|
|
1441
1501
|
});
|
|
@@ -1443,9 +1503,12 @@ class AXPLookupWidgetSelectorViewModel {
|
|
|
1443
1503
|
return this.inlineFiltersPlaceholders().length > 0;
|
|
1444
1504
|
});
|
|
1445
1505
|
this.columns = () => {
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1448
|
-
|
|
1506
|
+
const listColumns = this.entityDef.columns ?? [];
|
|
1507
|
+
const columns = listColumns?.map(c => c.name) ?? [];
|
|
1508
|
+
const props = this.entityDef.properties.filter(p => p.schema.hidden != true);
|
|
1509
|
+
const displayColumns = props.filter(p => columns.some(c => c == p.name));
|
|
1510
|
+
return displayColumns.map(p => {
|
|
1511
|
+
return new AXPEntityListViewColumnViewModel(p, listColumns?.find(c => c.name == p.name));
|
|
1449
1512
|
});
|
|
1450
1513
|
};
|
|
1451
1514
|
this.inlineFilters = {
|
|
@@ -1461,7 +1524,12 @@ class AXPLookupWidgetSelectorViewModel {
|
|
|
1461
1524
|
filters: []
|
|
1462
1525
|
};
|
|
1463
1526
|
}
|
|
1464
|
-
|
|
1527
|
+
async create() {
|
|
1528
|
+
await this.workflow.execute('create-entity', {
|
|
1529
|
+
entity: this.entityDef.source,
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1532
|
+
applyInlineFilter(value, refresh = true) {
|
|
1465
1533
|
const props = this.entityDef.properties.filter(c => c.options?.filter?.inline?.enabled);
|
|
1466
1534
|
this.inlineFilters.filters = [];
|
|
1467
1535
|
if (value) {
|
|
@@ -1475,44 +1543,45 @@ class AXPLookupWidgetSelectorViewModel {
|
|
|
1475
1543
|
});
|
|
1476
1544
|
});
|
|
1477
1545
|
}
|
|
1478
|
-
|
|
1546
|
+
if (refresh)
|
|
1547
|
+
this.applyFilterAndSort();
|
|
1479
1548
|
}
|
|
1480
1549
|
applyFilterAndSort() {
|
|
1481
1550
|
this.dataSource.clearFilter();
|
|
1482
1551
|
//
|
|
1483
1552
|
//this.dataSource.sort(...this.sortedFields().map(s => ({ dir: s.dir, field: s.name } as AXDataSourceSortOption)));
|
|
1484
1553
|
//
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
this.dataSource.filter(this.advanceFilters);
|
|
1492
|
-
}
|
|
1493
|
-
else if (inline && advance) {
|
|
1494
|
-
this.dataSource.filter({
|
|
1495
|
-
field: null,
|
|
1496
|
-
logic: 'and',
|
|
1497
|
-
operator: null,
|
|
1498
|
-
filters: [this.inlineFilters, this.advanceFilters]
|
|
1499
|
-
});
|
|
1500
|
-
}
|
|
1554
|
+
this.dataSource.filter({
|
|
1555
|
+
field: null,
|
|
1556
|
+
logic: 'and',
|
|
1557
|
+
operator: null,
|
|
1558
|
+
filters: this.parentFilters ? [this.inlineFilters, this.parentFilters] : [this.inlineFilters]
|
|
1559
|
+
});
|
|
1501
1560
|
//
|
|
1502
1561
|
this.dataSource.refresh();
|
|
1503
1562
|
}
|
|
1563
|
+
async find(value) {
|
|
1564
|
+
this.applyInlineFilter(value.trim(), false);
|
|
1565
|
+
const func = this.entityDef.queries.list?.execute;
|
|
1566
|
+
return await func({ filter: this.inlineFilters, take: 10 }) ?? [];
|
|
1567
|
+
}
|
|
1504
1568
|
}
|
|
1505
1569
|
|
|
1506
1570
|
class AXPLookupWidgetEditComponent extends AXPWidgetBase {
|
|
1507
1571
|
constructor() {
|
|
1508
1572
|
super(...arguments);
|
|
1509
|
-
this.dataSource = [];
|
|
1510
1573
|
this.textField = "title";
|
|
1574
|
+
this.validationRules = [];
|
|
1575
|
+
this.injector = inject(Injector);
|
|
1511
1576
|
this.loader = inject(AXP_ENTITY_DEFINITION_LOADER);
|
|
1512
1577
|
this.formatService = inject(AXFormatService);
|
|
1513
1578
|
this.popupService = inject(AXPopupService);
|
|
1514
1579
|
this.builderService = inject(AXPLayoutBuilderService);
|
|
1515
1580
|
this.displayText = signal("");
|
|
1581
|
+
this.selectedItem = signal(null);
|
|
1582
|
+
this.searchTerm = signal(null);
|
|
1583
|
+
this.isLoading = signal(false);
|
|
1584
|
+
this.isOpen = signal(false);
|
|
1516
1585
|
this.vm = signal(null);
|
|
1517
1586
|
this.placeholder = computed(() => {
|
|
1518
1587
|
return 'Search on ' + this.vm()?.inlineFiltersPlaceholders().join(', ');
|
|
@@ -1524,76 +1593,147 @@ class AXPLookupWidgetEditComponent extends AXPWidgetBase {
|
|
|
1524
1593
|
const [module, entity] = this.entity.split('.');
|
|
1525
1594
|
this.entityDef = await this.loader.get(module, entity);
|
|
1526
1595
|
//
|
|
1527
|
-
this.vm.set(new AXPLookupWidgetSelectorViewModel(this.entityDef));
|
|
1596
|
+
this.vm.set(new AXPLookupWidgetSelectorViewModel(this.injector, this.entityDef, this.filter));
|
|
1528
1597
|
//
|
|
1529
1598
|
this.textField = this.entityDef?.formats.lookup ?? this.entityDef?.properties.find(c => c.name != 'id')?.name ?? "title";
|
|
1530
1599
|
const value = this.getValue();
|
|
1531
1600
|
if (typeof value == 'object')
|
|
1532
1601
|
this.displayText.set(this.formatService.format(this.textField, "string", value));
|
|
1533
1602
|
else if (value != null) {
|
|
1534
|
-
|
|
1535
|
-
const item = await byKey(this.getValue());
|
|
1536
|
-
this.setItems(item);
|
|
1603
|
+
await this.findByValue();
|
|
1537
1604
|
}
|
|
1605
|
+
this.builderService.onChanged.subscribe(async (c) => {
|
|
1606
|
+
if (c.path == this.path) {
|
|
1607
|
+
console.log(c, this.getValue());
|
|
1608
|
+
await this.findByValue();
|
|
1609
|
+
}
|
|
1610
|
+
});
|
|
1611
|
+
}
|
|
1612
|
+
async findByValue() {
|
|
1613
|
+
const byKey = this.entityDef?.queries.byKey?.execute;
|
|
1614
|
+
const item = await byKey(this.getValue());
|
|
1615
|
+
this.setItems(item);
|
|
1538
1616
|
}
|
|
1539
1617
|
handleOnClick(e) {
|
|
1618
|
+
this.showSelector();
|
|
1619
|
+
}
|
|
1620
|
+
showSelector() {
|
|
1621
|
+
this.isOpen.set(true);
|
|
1540
1622
|
this.popupService.open(AXPLookupWidgetSelectorComponent, {
|
|
1541
1623
|
title: `${this.entityDef?.formats.plural} Lookup`,
|
|
1542
|
-
size: 'md',
|
|
1624
|
+
size: (this.vm()?.columns().length ?? 0) > 3 ? 'lg' : 'md',
|
|
1543
1625
|
data: {
|
|
1544
|
-
vm: new AXPLookupWidgetSelectorViewModel(this.entityDef)
|
|
1626
|
+
vm: new AXPLookupWidgetSelectorViewModel(this.injector, this.entityDef, this.filter),
|
|
1627
|
+
searchTerm: this.searchTerm() == this.displayText() ? null : this.searchTerm()
|
|
1545
1628
|
}
|
|
1546
1629
|
}).then((e) => {
|
|
1630
|
+
this.isOpen.set(false);
|
|
1631
|
+
this.textbox.focus();
|
|
1547
1632
|
if (e.data?.items) {
|
|
1548
1633
|
this.setItems(e.data?.items[0]);
|
|
1549
1634
|
}
|
|
1550
1635
|
});
|
|
1551
1636
|
}
|
|
1637
|
+
handleValueChange(e) {
|
|
1638
|
+
this.searchTerm.set(e.value);
|
|
1639
|
+
}
|
|
1640
|
+
handleOnBlur(e) {
|
|
1641
|
+
const com = e.component;
|
|
1642
|
+
const input = com['input'].nativeElement;
|
|
1643
|
+
setTimeout(() => {
|
|
1644
|
+
if (this.selectedItem()) {
|
|
1645
|
+
input.value = this.displayText();
|
|
1646
|
+
}
|
|
1647
|
+
else {
|
|
1648
|
+
if (!this.isOpen()) {
|
|
1649
|
+
input.value = '';
|
|
1650
|
+
this.searchTerm.set(null);
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
}, 100);
|
|
1654
|
+
}
|
|
1655
|
+
async handleKeyDown(e) {
|
|
1656
|
+
const keyEvent = e.nativeEvent;
|
|
1657
|
+
const value = this.searchTerm()?.trim();
|
|
1658
|
+
if ((keyEvent.code == "Enter" || keyEvent.code == "NumpadEnter") && value) {
|
|
1659
|
+
this.isLoading.set(true);
|
|
1660
|
+
const result = await this.vm()?.find(value);
|
|
1661
|
+
if (result?.total == 1) {
|
|
1662
|
+
this.setItems(result.items[0]);
|
|
1663
|
+
}
|
|
1664
|
+
else {
|
|
1665
|
+
this.showSelector();
|
|
1666
|
+
}
|
|
1667
|
+
this.isLoading.set(false);
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1552
1670
|
setItems(item) {
|
|
1671
|
+
this.searchTerm.set(null);
|
|
1672
|
+
this.displayText.set('');
|
|
1673
|
+
this.selectedItem.set(item);
|
|
1553
1674
|
const text = this.formatService.format(this.textField, "string", item);
|
|
1554
1675
|
this.displayText.set(text);
|
|
1555
1676
|
this.setValue(item.id);
|
|
1556
1677
|
if (this.expose) {
|
|
1557
|
-
|
|
1678
|
+
if (typeof this.expose == 'string') {
|
|
1679
|
+
this.builderService.setValue(this.expose, item);
|
|
1680
|
+
}
|
|
1681
|
+
else if (Array.isArray(this.expose)) {
|
|
1682
|
+
this.expose.forEach(i => {
|
|
1683
|
+
if (typeof i == "string") {
|
|
1684
|
+
this.builderService.setValue(i, item);
|
|
1685
|
+
}
|
|
1686
|
+
else {
|
|
1687
|
+
this.builderService.setValue(i.target, get(item, i.source));
|
|
1688
|
+
}
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1558
1691
|
}
|
|
1559
1692
|
}
|
|
1693
|
+
clear() {
|
|
1694
|
+
this.searchTerm.set('');
|
|
1695
|
+
this.displayText.set('');
|
|
1696
|
+
this.selectedItem.set(null);
|
|
1697
|
+
}
|
|
1560
1698
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPLookupWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1561
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
[ngModel]="getValue()"
|
|
1567
|
-
(onValueChanged)="handleValueChange($event);"
|
|
1568
|
-
>
|
|
1569
|
-
</ax-select-box> -->
|
|
1570
|
-
<ax-text-box [ngModel]="displayText()" readonly="true" [placeholder]="placeholder()">
|
|
1699
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.2", type: AXPLookupWidgetEditComponent, isStandalone: true, selector: "ng-component", inputs: { entity: "entity", conditions: "conditions", expose: "expose" }, viewQueries: [{ propertyName: "textbox", first: true, predicate: AXTextBoxComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
1700
|
+
<ax-text-box [ngModel]="displayText()" (onValueChanged)="handleValueChange($event)" [placeholder]="placeholder()" (onKeyUp)="handleKeyDown($event)" (onBlur)="handleOnBlur($event)">
|
|
1701
|
+
@for (validation of validationRules; track $index) {
|
|
1702
|
+
<ax-validation-rule [rule]="validation.rule" [message]="validation.options?.message" [options]="validation.options"></ax-validation-rule>
|
|
1703
|
+
}
|
|
1571
1704
|
<ax-suffix>
|
|
1572
|
-
<ax-button color="ghost" look="twotone" (onClick)="handleOnClick($event)">
|
|
1573
|
-
|
|
1574
|
-
|
|
1705
|
+
<ax-button color="ghost" look="twotone" [disabled]="isLoading()" (onClick)="handleOnClick($event)">
|
|
1706
|
+
@if(isLoading())
|
|
1707
|
+
{
|
|
1708
|
+
<ax-loading></ax-loading>
|
|
1709
|
+
}
|
|
1710
|
+
@else {
|
|
1711
|
+
<ax-icon icon="far fa-search">
|
|
1712
|
+
</ax-icon>
|
|
1713
|
+
}
|
|
1575
1714
|
</ax-button>
|
|
1576
1715
|
</ax-suffix>
|
|
1577
1716
|
</ax-text-box>
|
|
1578
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i2$1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type:
|
|
1717
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i2$1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i5$1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i6$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1579
1718
|
}
|
|
1580
1719
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPLookupWidgetEditComponent, decorators: [{
|
|
1581
1720
|
type: Component,
|
|
1582
1721
|
args: [{
|
|
1583
1722
|
template: `
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
[ngModel]="getValue()"
|
|
1589
|
-
(onValueChanged)="handleValueChange($event);"
|
|
1590
|
-
>
|
|
1591
|
-
</ax-select-box> -->
|
|
1592
|
-
<ax-text-box [ngModel]="displayText()" readonly="true" [placeholder]="placeholder()">
|
|
1723
|
+
<ax-text-box [ngModel]="displayText()" (onValueChanged)="handleValueChange($event)" [placeholder]="placeholder()" (onKeyUp)="handleKeyDown($event)" (onBlur)="handleOnBlur($event)">
|
|
1724
|
+
@for (validation of validationRules; track $index) {
|
|
1725
|
+
<ax-validation-rule [rule]="validation.rule" [message]="validation.options?.message" [options]="validation.options"></ax-validation-rule>
|
|
1726
|
+
}
|
|
1593
1727
|
<ax-suffix>
|
|
1594
|
-
<ax-button color="ghost" look="twotone" (onClick)="handleOnClick($event)">
|
|
1595
|
-
|
|
1596
|
-
|
|
1728
|
+
<ax-button color="ghost" look="twotone" [disabled]="isLoading()" (onClick)="handleOnClick($event)">
|
|
1729
|
+
@if(isLoading())
|
|
1730
|
+
{
|
|
1731
|
+
<ax-loading></ax-loading>
|
|
1732
|
+
}
|
|
1733
|
+
@else {
|
|
1734
|
+
<ax-icon icon="far fa-search">
|
|
1735
|
+
</ax-icon>
|
|
1736
|
+
}
|
|
1597
1737
|
</ax-button>
|
|
1598
1738
|
</ax-suffix>
|
|
1599
1739
|
</ax-text-box>
|
|
@@ -1606,11 +1746,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
|
1606
1746
|
AXSelectBoxModule,
|
|
1607
1747
|
AXTextBoxModule,
|
|
1608
1748
|
AXButtonModule,
|
|
1609
|
-
AXDecoratorModule
|
|
1749
|
+
AXDecoratorModule,
|
|
1750
|
+
AXLoadingModule,
|
|
1751
|
+
AXValidationModule,
|
|
1752
|
+
AXFormModule
|
|
1610
1753
|
],
|
|
1611
1754
|
inputs: ["entity", "conditions", "expose"]
|
|
1612
1755
|
}]
|
|
1613
|
-
}]
|
|
1756
|
+
}], propDecorators: { textbox: [{
|
|
1757
|
+
type: ViewChild,
|
|
1758
|
+
args: [AXTextBoxComponent]
|
|
1759
|
+
}] } });
|
|
1614
1760
|
|
|
1615
1761
|
var lookupWidgetEdit_component = /*#__PURE__*/Object.freeze({
|
|
1616
1762
|
__proto__: null,
|
|
@@ -1721,6 +1867,36 @@ const AXPLookupWidget = {
|
|
|
1721
1867
|
}
|
|
1722
1868
|
};
|
|
1723
1869
|
|
|
1870
|
+
class AXPShowListViewAction extends AXPWorkflowAction {
|
|
1871
|
+
constructor() {
|
|
1872
|
+
super(...arguments);
|
|
1873
|
+
this.navigation = inject(AXPWorkflowNavigateAction);
|
|
1874
|
+
this.sessionService = inject(AXPSessionService);
|
|
1875
|
+
}
|
|
1876
|
+
async execute(context) {
|
|
1877
|
+
const [moduleName, entityName] = context.getVariable('entity').split(".");
|
|
1878
|
+
const newPayload = {
|
|
1879
|
+
commands: `/${this.sessionService.application?.name}/m/${moduleName}/e/${entityName}/list`,
|
|
1880
|
+
};
|
|
1881
|
+
context.setVariable('payload', newPayload);
|
|
1882
|
+
this.navigation.execute(context);
|
|
1883
|
+
}
|
|
1884
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPShowListViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1885
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPShowListViewAction }); }
|
|
1886
|
+
}
|
|
1887
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPShowListViewAction, decorators: [{
|
|
1888
|
+
type: Injectable
|
|
1889
|
+
}] });
|
|
1890
|
+
const AXPShowListViewWorkflow = {
|
|
1891
|
+
startStepId: 'showListView',
|
|
1892
|
+
steps: {
|
|
1893
|
+
showListView: {
|
|
1894
|
+
id: 'showListView',
|
|
1895
|
+
action: 'AXPShowListViewAction',
|
|
1896
|
+
},
|
|
1897
|
+
},
|
|
1898
|
+
};
|
|
1899
|
+
|
|
1724
1900
|
function routesFacory() {
|
|
1725
1901
|
const config = inject(AXP_ENTITY_CONFIG_TOKEN);
|
|
1726
1902
|
let routes = [];
|
|
@@ -1773,7 +1949,7 @@ function routesFacory() {
|
|
|
1773
1949
|
}
|
|
1774
1950
|
class AXPEntityModule {
|
|
1775
1951
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1776
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityModule, imports: [RouterModule, i1$
|
|
1952
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityModule, imports: [RouterModule, i1$2.AXPWorkflowModule, i6.AXPLayoutBuilderModule] }); }
|
|
1777
1953
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityModule, providers: [
|
|
1778
1954
|
{
|
|
1779
1955
|
provide: ROUTES,
|
|
@@ -1785,15 +1961,19 @@ class AXPEntityModule {
|
|
|
1785
1961
|
actions: {
|
|
1786
1962
|
AXPEntityCreatePopupAction,
|
|
1787
1963
|
AXPEntityPerformDeleteAction,
|
|
1964
|
+
"entity-perform-delete": AXPEntityPerformDeleteAction,
|
|
1788
1965
|
AXPEntityModifySectionPopupAction,
|
|
1789
1966
|
AXPEntityModifyConfirmedAction,
|
|
1790
|
-
AXPShowDetailViewAction
|
|
1967
|
+
AXPShowDetailViewAction,
|
|
1968
|
+
AXPEntityCreateSubmittedAction,
|
|
1969
|
+
AXPShowListViewAction
|
|
1791
1970
|
},
|
|
1792
1971
|
workflows: {
|
|
1793
1972
|
'create-entity': AXPCreateEntityWorkflow,
|
|
1794
1973
|
'delete-entity': AXPDeleteEntityWorkflow,
|
|
1795
1974
|
'modify-entity-section': AXPModifyEntitySectionWorkflow,
|
|
1796
1975
|
'open-entity': AXPShowDetailsViewWorkflow,
|
|
1976
|
+
'show-list-view': AXPShowListViewWorkflow
|
|
1797
1977
|
},
|
|
1798
1978
|
}),
|
|
1799
1979
|
AXPLayoutBuilderModule.forChild({
|
|
@@ -1811,15 +1991,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
|
1811
1991
|
actions: {
|
|
1812
1992
|
AXPEntityCreatePopupAction,
|
|
1813
1993
|
AXPEntityPerformDeleteAction,
|
|
1994
|
+
"entity-perform-delete": AXPEntityPerformDeleteAction,
|
|
1814
1995
|
AXPEntityModifySectionPopupAction,
|
|
1815
1996
|
AXPEntityModifyConfirmedAction,
|
|
1816
|
-
AXPShowDetailViewAction
|
|
1997
|
+
AXPShowDetailViewAction,
|
|
1998
|
+
AXPEntityCreateSubmittedAction,
|
|
1999
|
+
AXPShowListViewAction
|
|
1817
2000
|
},
|
|
1818
2001
|
workflows: {
|
|
1819
2002
|
'create-entity': AXPCreateEntityWorkflow,
|
|
1820
2003
|
'delete-entity': AXPDeleteEntityWorkflow,
|
|
1821
2004
|
'modify-entity-section': AXPModifyEntitySectionWorkflow,
|
|
1822
2005
|
'open-entity': AXPShowDetailsViewWorkflow,
|
|
2006
|
+
'show-list-view': AXPShowListViewWorkflow
|
|
1823
2007
|
},
|
|
1824
2008
|
}),
|
|
1825
2009
|
AXPLayoutBuilderModule.forChild({
|