@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.
Files changed (232) hide show
  1. package/common/lib/app/application.types.d.ts +43 -26
  2. package/common/lib/common.module.d.ts +6 -5
  3. package/common/lib/data/data-provider.types.d.ts +1 -1
  4. package/common/lib/data/dexie-storage.service.d.ts +15 -0
  5. package/common/lib/data/entity-data-provider.d.ts +14 -0
  6. package/common/lib/data/index.d.ts +3 -0
  7. package/common/lib/data/storage-service.d.ts +22 -0
  8. package/common/lib/schema/entity/entity.class.d.ts +3 -0
  9. package/common/lib/utils/data-generator.d.ts +2 -0
  10. package/esm2022/common/lib/app/application.types.mjs +1 -1
  11. package/esm2022/common/lib/common.module.mjs +19 -2
  12. package/esm2022/common/lib/data/data-provider.types.mjs +1 -1
  13. package/esm2022/common/lib/data/dexie-storage.service.mjs +36 -0
  14. package/esm2022/common/lib/data/entity-data-provider.mjs +26 -0
  15. package/esm2022/common/lib/data/index.mjs +4 -1
  16. package/esm2022/common/lib/data/storage-service.mjs +5 -0
  17. package/esm2022/common/lib/schema/entity/entity-registery.service.mjs +2 -2
  18. package/esm2022/common/lib/schema/entity/entity.class.mjs +1 -1
  19. package/esm2022/common/lib/utils/data-generator.mjs +22 -1
  20. package/esm2022/common/lib/workflows/common.workflow.mjs +3 -3
  21. package/esm2022/layout/builder/lib/builder/builder.service.mjs +7 -2
  22. package/esm2022/layout/builder/lib/builder/widget.types.mjs +5 -1
  23. package/esm2022/layout/entity/lib/entity-detail-list.viewmodel.mjs +9 -8
  24. package/esm2022/layout/entity/lib/entity-master-create.viewmodel.mjs +34 -21
  25. package/esm2022/layout/entity/lib/entity-master-list.viewmodel.mjs +23 -15
  26. package/esm2022/layout/entity/lib/entity-master-single.viewmodel.mjs +46 -49
  27. package/esm2022/layout/entity/lib/entity-master-update.viewmodel.mjs +9 -7
  28. package/esm2022/layout/entity/lib/entity-registery.service.mjs +2 -2
  29. package/esm2022/layout/entity/lib/entity.module.mjs +13 -4
  30. package/esm2022/layout/entity/lib/entity.viewmodel.mjs +7 -6
  31. package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.mjs +127 -39
  32. package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.component.mjs +83 -37
  33. package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.viewmodel.mjs +34 -23
  34. package/esm2022/layout/entity/lib/workflows/create-entity.workflow.mjs +17 -20
  35. package/esm2022/layout/entity/lib/workflows/delete-entity.workflow.mjs +17 -15
  36. package/esm2022/layout/entity/lib/workflows/modify-section.workflow.mjs +11 -23
  37. package/esm2022/layout/entity/lib/workflows/show-details.workflow.mjs +3 -3
  38. package/esm2022/layout/entity/lib/workflows/show-list.workflow.mjs +35 -0
  39. package/esm2022/layouts/lib/admin/entity-layout/entity-create-view/entity-create-view.component.mjs +3 -3
  40. package/esm2022/layouts/lib/admin/entity-layout/workflows/delete-entity.workflow.mjs +2 -2
  41. package/esm2022/layouts/lib/layout.module.mjs +3 -3
  42. package/esm2022/themes/default/lib/default.module.mjs +3 -3
  43. package/esm2022/themes/default/lib/entity-reuse.strategy.mjs +2 -2
  44. package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-create-view/entity-master-create-view.component.mjs +2 -2
  45. 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
  46. package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-list-view/list-view-option-sorting/list-view-option-sorting.component.mjs +2 -1
  47. package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.mjs +1 -1
  48. package/esm2022/widgets/lib/editors/date-time-box-widget/date-time-box-widget-column.component.mjs +2 -2
  49. package/esm2022/widgets/lib/editors/date-time-box-widget/date-time-box-widget-edit.component.mjs +21 -12
  50. package/esm2022/widgets/lib/editors/date-time-box-widget/date-time-box-widget-view.component.mjs +3 -2
  51. package/esm2022/widgets/lib/editors/number-box-widget/number-box-widget-column.component.mjs +2 -2
  52. package/esm2022/widgets/lib/editors/number-box-widget/number-box-widget-view.component.mjs +2 -2
  53. package/esm2022/workflow/lib/actions/start-workflow.action.mjs +28 -0
  54. package/esm2022/workflow/lib/workflow.module.mjs +7 -2
  55. package/esm2022/workflow/lib/workflow.service.mjs +53 -6
  56. package/esm2022/workflow/lib/workflow.types.mjs +12 -6
  57. package/fesm2022/{acorex-platform-common-avatar-widget-edit.component-DAmNXjDm.mjs → acorex-platform-common-avatar-widget-edit.component-B-of5ssU.mjs} +3 -2
  58. 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
  59. package/fesm2022/{acorex-platform-common-avatar-widget-view.component-BlA_cFkP.mjs → acorex-platform-common-avatar-widget-view.component-CJvrSkTv.mjs} +4 -3
  60. package/fesm2022/acorex-platform-common-avatar-widget-view.component-CJvrSkTv.mjs.map +1 -0
  61. package/fesm2022/{acorex-platform-common-boolean-widget-filter.component-CEqibiML.mjs → acorex-platform-common-boolean-widget-filter.component-BTcOjuUm.mjs} +4 -3
  62. package/fesm2022/acorex-platform-common-boolean-widget-filter.component-BTcOjuUm.mjs.map +1 -0
  63. package/fesm2022/{acorex-platform-common-checkbox-widget-column.component-BiUHPDqV.mjs → acorex-platform-common-checkbox-widget-column.component-X9d1iY_F.mjs} +4 -3
  64. 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
  65. package/fesm2022/{acorex-platform-common-checkbox-widget-edit.component-BVG9_XXh.mjs → acorex-platform-common-checkbox-widget-edit.component-_jtT03Vn.mjs} +4 -3
  66. package/fesm2022/acorex-platform-common-checkbox-widget-edit.component-_jtT03Vn.mjs.map +1 -0
  67. package/fesm2022/{acorex-platform-common-checkbox-widget-view.component-CfGkMcDi.mjs → acorex-platform-common-checkbox-widget-view.component-nYmtb8bK.mjs} +4 -3
  68. package/fesm2022/{acorex-platform-common-checkbox-widget-view.component-CfGkMcDi.mjs.map → acorex-platform-common-checkbox-widget-view.component-nYmtb8bK.mjs.map} +1 -1
  69. package/fesm2022/{acorex-platform-common-dateTime-widget-column.component-BlXTU887.mjs → acorex-platform-common-dateTime-widget-column.component-5ljYmtHI.mjs} +4 -3
  70. package/fesm2022/acorex-platform-common-dateTime-widget-column.component-5ljYmtHI.mjs.map +1 -0
  71. package/fesm2022/{acorex-platform-common-dateTime-widget-edit.component-B0s6FN-g.mjs → acorex-platform-common-dateTime-widget-edit.component-D8FSiqAo.mjs} +4 -3
  72. 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
  73. package/fesm2022/{acorex-platform-common-dateTime-widget-filter.component-B7KBCsUt.mjs → acorex-platform-common-dateTime-widget-filter.component-Df0DuDtw.mjs} +4 -3
  74. package/fesm2022/{acorex-platform-common-dateTime-widget-filter.component-B7KBCsUt.mjs.map → acorex-platform-common-dateTime-widget-filter.component-Df0DuDtw.mjs.map} +1 -1
  75. package/fesm2022/{acorex-platform-common-dateTime-widget-view.component-Dy7pAkGG.mjs → acorex-platform-common-dateTime-widget-view.component-CjVjQkPh.mjs} +4 -3
  76. package/fesm2022/{acorex-platform-common-dateTime-widget-view.component-Dy7pAkGG.mjs.map → acorex-platform-common-dateTime-widget-view.component-CjVjQkPh.mjs.map} +1 -1
  77. package/fesm2022/{acorex-platform-common-email-widget-column.component-D_UNn2dW.mjs → acorex-platform-common-email-widget-column.component-BgNdL62k.mjs} +4 -3
  78. package/fesm2022/acorex-platform-common-email-widget-column.component-BgNdL62k.mjs.map +1 -0
  79. package/fesm2022/{acorex-platform-common-email-widget-edit.component-DWT24mCM.mjs → acorex-platform-common-email-widget-edit.component-CgHPGccx.mjs} +4 -3
  80. package/fesm2022/{acorex-platform-common-email-widget-edit.component-DWT24mCM.mjs.map → acorex-platform-common-email-widget-edit.component-CgHPGccx.mjs.map} +1 -1
  81. package/fesm2022/{acorex-platform-common-email-widget-view.component-B6puyycL.mjs → acorex-platform-common-email-widget-view.component-C2aQ14k-.mjs} +4 -3
  82. package/fesm2022/{acorex-platform-common-email-widget-view.component-B6puyycL.mjs.map → acorex-platform-common-email-widget-view.component-C2aQ14k-.mjs.map} +1 -1
  83. package/fesm2022/{acorex-platform-common-file-widget-column.component-C1faGR4K.mjs → acorex-platform-common-file-widget-column.component-CwFzLLHt.mjs} +4 -3
  84. package/fesm2022/acorex-platform-common-file-widget-column.component-CwFzLLHt.mjs.map +1 -0
  85. package/fesm2022/{acorex-platform-common-file-widget-edit.component-CTvS9ls8.mjs → acorex-platform-common-file-widget-edit.component-DxoQR4CU.mjs} +4 -3
  86. package/fesm2022/{acorex-platform-common-file-widget-edit.component-CTvS9ls8.mjs.map → acorex-platform-common-file-widget-edit.component-DxoQR4CU.mjs.map} +1 -1
  87. package/fesm2022/{acorex-platform-common-file-widget-filter.component-D4AMg5M0.mjs → acorex-platform-common-file-widget-filter.component-BvG0iaKU.mjs} +4 -3
  88. package/fesm2022/acorex-platform-common-file-widget-filter.component-BvG0iaKU.mjs.map +1 -0
  89. package/fesm2022/{acorex-platform-common-file-widget-view.component-CHI4VCvt.mjs → acorex-platform-common-file-widget-view.component-BC9l3YrO.mjs} +4 -3
  90. package/fesm2022/{acorex-platform-common-file-widget-view.component-CHI4VCvt.mjs.map → acorex-platform-common-file-widget-view.component-BC9l3YrO.mjs.map} +1 -1
  91. package/fesm2022/{acorex-platform-common-gallery-widget-edit.component-CAOctYzV.mjs → acorex-platform-common-gallery-widget-edit.component-BihOIJ9T.mjs} +4 -3
  92. package/fesm2022/{acorex-platform-common-gallery-widget-edit.component-CAOctYzV.mjs.map → acorex-platform-common-gallery-widget-edit.component-BihOIJ9T.mjs.map} +1 -1
  93. package/fesm2022/{acorex-platform-common-gallery-widget-filter.component-lgaYDZeD.mjs → acorex-platform-common-gallery-widget-filter.component-DS1PCIJp.mjs} +4 -3
  94. package/fesm2022/acorex-platform-common-gallery-widget-filter.component-DS1PCIJp.mjs.map +1 -0
  95. package/fesm2022/{acorex-platform-common-gallery-widget-view.component-Ci50jeO5.mjs → acorex-platform-common-gallery-widget-view.component-CnQONVdg.mjs} +4 -3
  96. package/fesm2022/{acorex-platform-common-gallery-widget-view.component-Ci50jeO5.mjs.map → acorex-platform-common-gallery-widget-view.component-CnQONVdg.mjs.map} +1 -1
  97. package/fesm2022/{acorex-platform-common-largetext-widget-edit.component-DFKG-kum.mjs → acorex-platform-common-largetext-widget-edit.component-BCtGkz1a.mjs} +4 -3
  98. package/fesm2022/acorex-platform-common-largetext-widget-edit.component-BCtGkz1a.mjs.map +1 -0
  99. package/fesm2022/{acorex-platform-common-lookup-widget-column.component-CFzCGcqA.mjs → acorex-platform-common-lookup-widget-column.component-Cl-vO5XW.mjs} +4 -3
  100. package/fesm2022/acorex-platform-common-lookup-widget-column.component-Cl-vO5XW.mjs.map +1 -0
  101. package/fesm2022/{acorex-platform-common-lookup-widget-edit.component-CYTSeEOq.mjs → acorex-platform-common-lookup-widget-edit.component-D9UhViUG.mjs} +4 -3
  102. package/fesm2022/acorex-platform-common-lookup-widget-edit.component-D9UhViUG.mjs.map +1 -0
  103. package/fesm2022/{acorex-platform-common-lookup-widget-filter.component-BkxT9_Hh.mjs → acorex-platform-common-lookup-widget-filter.component-RWweQQaO.mjs} +4 -3
  104. package/fesm2022/acorex-platform-common-lookup-widget-filter.component-RWweQQaO.mjs.map +1 -0
  105. package/fesm2022/{acorex-platform-common-lookup-widget-view.component-5YeixMp7.mjs → acorex-platform-common-lookup-widget-view.component-mXo8VADX.mjs} +4 -3
  106. package/fesm2022/acorex-platform-common-lookup-widget-view.component-mXo8VADX.mjs.map +1 -0
  107. package/fesm2022/{acorex-platform-common-map-widget-edit.component-CE3QQBmX.mjs → acorex-platform-common-map-widget-edit.component-SSrR3xxv.mjs} +4 -3
  108. package/fesm2022/acorex-platform-common-map-widget-edit.component-SSrR3xxv.mjs.map +1 -0
  109. package/fesm2022/{acorex-platform-common-map-widget-view.component-Cv4OCTxz.mjs → acorex-platform-common-map-widget-view.component-DrGG3gzg.mjs} +4 -3
  110. package/fesm2022/acorex-platform-common-map-widget-view.component-DrGG3gzg.mjs.map +1 -0
  111. package/fesm2022/{acorex-platform-common-messenger-widget-column.component-CJdh6TKb.mjs → acorex-platform-common-messenger-widget-column.component-BJ_XzNKc.mjs} +4 -3
  112. package/fesm2022/acorex-platform-common-messenger-widget-column.component-BJ_XzNKc.mjs.map +1 -0
  113. package/fesm2022/{acorex-platform-common-messenger-widget-edit.component-kiEHxJia.mjs → acorex-platform-common-messenger-widget-edit.component-B_FG_n0O.mjs} +4 -3
  114. 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
  115. package/fesm2022/{acorex-platform-common-messenger-widget-view.component-DzbjgZA7.mjs → acorex-platform-common-messenger-widget-view.component-EBiPO9ds.mjs} +4 -3
  116. package/fesm2022/{acorex-platform-common-messenger-widget-view.component-DzbjgZA7.mjs.map → acorex-platform-common-messenger-widget-view.component-EBiPO9ds.mjs.map} +1 -1
  117. package/fesm2022/{acorex-platform-common-number-widget-edit.component-BRuIP96Y.mjs → acorex-platform-common-number-widget-edit.component-B1XXga-9.mjs} +4 -3
  118. package/fesm2022/acorex-platform-common-number-widget-edit.component-B1XXga-9.mjs.map +1 -0
  119. package/fesm2022/{acorex-platform-common-number-widget-filter.component-jQ4DaFQH.mjs → acorex-platform-common-number-widget-filter.component-B2JCpDjU.mjs} +4 -3
  120. package/fesm2022/{acorex-platform-common-number-widget-filter.component-jQ4DaFQH.mjs.map → acorex-platform-common-number-widget-filter.component-B2JCpDjU.mjs.map} +1 -1
  121. package/fesm2022/{acorex-platform-common-number-widget-view.component-BzUWjT8m.mjs → acorex-platform-common-number-widget-view.component-DD0tkoc4.mjs} +4 -3
  122. package/fesm2022/acorex-platform-common-number-widget-view.component-DD0tkoc4.mjs.map +1 -0
  123. package/fesm2022/{acorex-platform-common-password-widget-column.component-BRzyuK5c.mjs → acorex-platform-common-password-widget-column.component-eyqgQlAt.mjs} +4 -3
  124. package/fesm2022/{acorex-platform-common-password-widget-column.component-BRzyuK5c.mjs.map → acorex-platform-common-password-widget-column.component-eyqgQlAt.mjs.map} +1 -1
  125. package/fesm2022/{acorex-platform-common-password-widget-edit.component-q6R2dw5k.mjs → acorex-platform-common-password-widget-edit.component-C2yNb9Pl.mjs} +4 -3
  126. package/fesm2022/acorex-platform-common-password-widget-edit.component-C2yNb9Pl.mjs.map +1 -0
  127. package/fesm2022/{acorex-platform-common-password-widget-view.component-CKaQItON.mjs → acorex-platform-common-password-widget-view.component-o9S7pwJW.mjs} +4 -3
  128. package/fesm2022/{acorex-platform-common-password-widget-view.component-CKaQItON.mjs.map → acorex-platform-common-password-widget-view.component-o9S7pwJW.mjs.map} +1 -1
  129. package/fesm2022/{acorex-platform-common-phone-widget-column.component-BD7BScjW.mjs → acorex-platform-common-phone-widget-column.component-BL9Xl2XH.mjs} +4 -3
  130. package/fesm2022/{acorex-platform-common-phone-widget-column.component-BD7BScjW.mjs.map → acorex-platform-common-phone-widget-column.component-BL9Xl2XH.mjs.map} +1 -1
  131. package/fesm2022/{acorex-platform-common-phone-widget-edit.component-D8tGKfNj.mjs → acorex-platform-common-phone-widget-edit.component-DSh9zoZj.mjs} +4 -3
  132. package/fesm2022/{acorex-platform-common-phone-widget-edit.component-D8tGKfNj.mjs.map → acorex-platform-common-phone-widget-edit.component-DSh9zoZj.mjs.map} +1 -1
  133. package/fesm2022/{acorex-platform-common-phone-widget-view.component-CFiMsGOB.mjs → acorex-platform-common-phone-widget-view.component-Br3xbaDd.mjs} +4 -3
  134. package/fesm2022/{acorex-platform-common-phone-widget-view.component-CFiMsGOB.mjs.map → acorex-platform-common-phone-widget-view.component-Br3xbaDd.mjs.map} +1 -1
  135. 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
  136. 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
  137. package/fesm2022/{acorex-platform-common-rich-text-widget-edit.component-CA2xRfVg.mjs → acorex-platform-common-rich-text-widget-edit.component-Dz1toc21.mjs} +4 -3
  138. package/fesm2022/acorex-platform-common-rich-text-widget-edit.component-Dz1toc21.mjs.map +1 -0
  139. package/fesm2022/{acorex-platform-common-rich-text-widget-view.component-DYfTZ64H.mjs → acorex-platform-common-rich-text-widget-view.component-CxTPcEIQ.mjs} +4 -3
  140. package/fesm2022/acorex-platform-common-rich-text-widget-view.component-CxTPcEIQ.mjs.map +1 -0
  141. package/fesm2022/{acorex-platform-common-selection-list-widget-column.component-_MglaOmo.mjs → acorex-platform-common-selection-list-widget-column.component-BCCmg8MI.mjs} +4 -3
  142. 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
  143. 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
  144. package/fesm2022/acorex-platform-common-selection-list-widget-edit.component-B5eUdN2R.mjs.map +1 -0
  145. package/fesm2022/{acorex-platform-common-selection-list-widget-filter.component-DRToTnHQ.mjs → acorex-platform-common-selection-list-widget-filter.component-DPpZq1TB.mjs} +4 -3
  146. package/fesm2022/acorex-platform-common-selection-list-widget-filter.component-DPpZq1TB.mjs.map +1 -0
  147. 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
  148. package/fesm2022/acorex-platform-common-selection-list-widget-view.component-Bxvd_AKZ.mjs.map +1 -0
  149. package/fesm2022/{acorex-platform-common-signature-pad-widget-edit.component-DF29uWl2.mjs → acorex-platform-common-signature-pad-widget-edit.component-CNjYCEi6.mjs} +4 -3
  150. 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
  151. 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
  152. package/fesm2022/acorex-platform-common-signature-pad-widget-view.component-CsiBv_7i.mjs.map +1 -0
  153. package/fesm2022/{acorex-platform-common-string-widget-filter.component-Di_GFHme.mjs → acorex-platform-common-string-widget-filter.component-CrGt6Bov.mjs} +4 -3
  154. package/fesm2022/acorex-platform-common-string-widget-filter.component-CrGt6Bov.mjs.map +1 -0
  155. package/fesm2022/{acorex-platform-common-text-widget-column.component-BSYd1CbC.mjs → acorex-platform-common-text-widget-column.component-qXusAevm.mjs} +4 -3
  156. package/fesm2022/{acorex-platform-common-text-widget-column.component-BSYd1CbC.mjs.map → acorex-platform-common-text-widget-column.component-qXusAevm.mjs.map} +1 -1
  157. package/fesm2022/{acorex-platform-common-text-widget-edit.component-K9z9N1qw.mjs → acorex-platform-common-text-widget-edit.component-ed0MUYnD.mjs} +4 -3
  158. package/fesm2022/{acorex-platform-common-text-widget-edit.component-K9z9N1qw.mjs.map → acorex-platform-common-text-widget-edit.component-ed0MUYnD.mjs.map} +1 -1
  159. package/fesm2022/{acorex-platform-common-text-widget-view.component-WbZtm_bf.mjs → acorex-platform-common-text-widget-view.component-BpxTaeQW.mjs} +4 -3
  160. 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
  161. package/fesm2022/{acorex-platform-common-toggle-widget-column.component-ZCBSYMuz.mjs → acorex-platform-common-toggle-widget-column.component-BqiUQrmV.mjs} +4 -3
  162. package/fesm2022/{acorex-platform-common-toggle-widget-column.component-ZCBSYMuz.mjs.map → acorex-platform-common-toggle-widget-column.component-BqiUQrmV.mjs.map} +1 -1
  163. package/fesm2022/{acorex-platform-common-toggle-widget-edit.component-rkDfLA-J.mjs → acorex-platform-common-toggle-widget-edit.component-CDG62BJN.mjs} +4 -3
  164. package/fesm2022/acorex-platform-common-toggle-widget-edit.component-CDG62BJN.mjs.map +1 -0
  165. package/fesm2022/{acorex-platform-common-toggle-widget-view.component-DLDIrci1.mjs → acorex-platform-common-toggle-widget-view.component-DWYcIPTd.mjs} +4 -3
  166. package/fesm2022/{acorex-platform-common-toggle-widget-view.component-DLDIrci1.mjs.map → acorex-platform-common-toggle-widget-view.component-DWYcIPTd.mjs.map} +1 -1
  167. package/fesm2022/acorex-platform-common.mjs +252 -149
  168. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  169. package/fesm2022/acorex-platform-layout-builder.mjs +10 -1
  170. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  171. package/fesm2022/acorex-platform-layout-entity.mjs +445 -261
  172. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  173. package/fesm2022/{acorex-platform-layouts-entity-create-view.component-BmSMt95H.mjs → acorex-platform-layouts-entity-create-view.component-fkKPKxlb.mjs} +3 -3
  174. package/fesm2022/acorex-platform-layouts-entity-create-view.component-fkKPKxlb.mjs.map +1 -0
  175. package/fesm2022/acorex-platform-layouts.mjs +4 -4
  176. package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
  177. 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
  178. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-BxYT9KhH.mjs.map +1 -0
  179. package/fesm2022/acorex-platform-themes-default.mjs +13 -6
  180. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  181. package/fesm2022/acorex-platform-widgets.mjs +50 -42
  182. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  183. package/fesm2022/acorex-platform-workflow.mjs +184 -104
  184. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  185. package/layout/builder/lib/builder/widget.types.d.ts +3 -0
  186. package/layout/entity/lib/entity-master-create.viewmodel.d.ts +6 -5
  187. package/layout/entity/lib/entity-master-list.viewmodel.d.ts +4 -0
  188. package/layout/entity/lib/entity-master-single.viewmodel.d.ts +10 -5
  189. package/layout/entity/lib/entity-master-update.viewmodel.d.ts +0 -1
  190. package/layout/entity/lib/entity.viewmodel.d.ts +3 -3
  191. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +18 -3
  192. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.component.d.ts +8 -1
  193. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.viewmodel.d.ts +10 -3
  194. package/layout/entity/lib/workflows/create-entity.workflow.d.ts +0 -2
  195. package/layout/entity/lib/workflows/delete-entity.workflow.d.ts +2 -4
  196. package/layout/entity/lib/workflows/modify-section.workflow.d.ts +2 -5
  197. package/layout/entity/lib/workflows/show-list.workflow.d.ts +10 -0
  198. package/package.json +1 -1
  199. package/widgets/lib/editors/date-time-box-widget/date-time-box-widget-edit.component.d.ts +4 -0
  200. package/workflow/lib/actions/start-workflow.action.d.ts +10 -0
  201. package/workflow/lib/workflow.service.d.ts +4 -2
  202. package/workflow/lib/workflow.types.d.ts +3 -1
  203. package/fesm2022/acorex-platform-common-avatar-widget-view.component-BlA_cFkP.mjs.map +0 -1
  204. package/fesm2022/acorex-platform-common-boolean-widget-filter.component-CEqibiML.mjs.map +0 -1
  205. package/fesm2022/acorex-platform-common-checkbox-widget-edit.component-BVG9_XXh.mjs.map +0 -1
  206. package/fesm2022/acorex-platform-common-dateTime-widget-column.component-BlXTU887.mjs.map +0 -1
  207. package/fesm2022/acorex-platform-common-email-widget-column.component-D_UNn2dW.mjs.map +0 -1
  208. package/fesm2022/acorex-platform-common-file-widget-column.component-C1faGR4K.mjs.map +0 -1
  209. package/fesm2022/acorex-platform-common-file-widget-filter.component-D4AMg5M0.mjs.map +0 -1
  210. package/fesm2022/acorex-platform-common-gallery-widget-filter.component-lgaYDZeD.mjs.map +0 -1
  211. package/fesm2022/acorex-platform-common-largetext-widget-edit.component-DFKG-kum.mjs.map +0 -1
  212. package/fesm2022/acorex-platform-common-lookup-widget-column.component-CFzCGcqA.mjs.map +0 -1
  213. package/fesm2022/acorex-platform-common-lookup-widget-edit.component-CYTSeEOq.mjs.map +0 -1
  214. package/fesm2022/acorex-platform-common-lookup-widget-filter.component-BkxT9_Hh.mjs.map +0 -1
  215. package/fesm2022/acorex-platform-common-lookup-widget-view.component-5YeixMp7.mjs.map +0 -1
  216. package/fesm2022/acorex-platform-common-map-widget-edit.component-CE3QQBmX.mjs.map +0 -1
  217. package/fesm2022/acorex-platform-common-map-widget-view.component-Cv4OCTxz.mjs.map +0 -1
  218. package/fesm2022/acorex-platform-common-messenger-widget-column.component-CJdh6TKb.mjs.map +0 -1
  219. package/fesm2022/acorex-platform-common-number-widget-edit.component-BRuIP96Y.mjs.map +0 -1
  220. package/fesm2022/acorex-platform-common-number-widget-view.component-BzUWjT8m.mjs.map +0 -1
  221. package/fesm2022/acorex-platform-common-password-widget-edit.component-q6R2dw5k.mjs.map +0 -1
  222. package/fesm2022/acorex-platform-common-rich-text-widget-edit.component-CA2xRfVg.mjs.map +0 -1
  223. package/fesm2022/acorex-platform-common-rich-text-widget-view.component-DYfTZ64H.mjs.map +0 -1
  224. package/fesm2022/acorex-platform-common-selection-list-widget-edit.component-QKw_tyOd.mjs.map +0 -1
  225. package/fesm2022/acorex-platform-common-selection-list-widget-filter.component-DRToTnHQ.mjs.map +0 -1
  226. package/fesm2022/acorex-platform-common-selection-list-widget-view.component-CjDiuUdj.mjs.map +0 -1
  227. package/fesm2022/acorex-platform-common-signature-pad-widget-view.component-BWzoR4HM.mjs.map +0 -1
  228. package/fesm2022/acorex-platform-common-string-widget-filter.component-Di_GFHme.mjs.map +0 -1
  229. package/fesm2022/acorex-platform-common-toggle-widget-edit.component-rkDfLA-J.mjs.map +0 -1
  230. package/fesm2022/acorex-platform-layouts-entity-create-view.component-BmSMt95H.mjs.map +0 -1
  231. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Buanq4is.mjs.map +0 -1
  232. /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$1 from '@acorex/platform/workflow';
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 { AXDataSource } from '@acorex/components/common';
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 i4$1 from '@acorex/platform/layout/builder';
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 i4 from '@acorex/components/decorators';
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 i3$1 from '@acorex/components/button';
27
+ import * as i2 from '@acorex/components/button';
26
28
  import { AXButtonModule } from '@acorex/components/button';
27
- import * as i2 from '@acorex/components/data-table';
29
+ import * as i4 from '@acorex/components/data-table';
28
30
  import { AXDataTableModule } from '@acorex/components/data-table';
29
- import * as i3 from '@acorex/components/search-box';
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 Entity name: ${key}`);
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.description = this.property.description;
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
- options: { ...widget?.options, ...this.property.options?.table?.widget }
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
- const moduleName = context.getVariable('module');
143
- const entityName = context.getVariable('entity');
144
- const ids = context.getVariable('ids');
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({ module: moduleName, entity: entityName, id: ids }));
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({ module: moduleName, entity: entityName, id: ids }));
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: 'confirmDelete',
231
+ startStepId: 'confirm-delete',
220
232
  steps: {
221
- confirmDelete: {
222
- id: 'confirmDelete',
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("deleteConfirmed") == true' },
246
+ { type: 'SINGLE', expression: 'context.getOutput("result") == true' },
236
247
  ],
237
248
  },
238
249
  ],
239
- nextStepId: 'performDelete',
250
+ nextStepId: 'perform-delete',
240
251
  },
241
252
  ],
242
253
  },
243
- performDelete: {
244
- id: 'performDelete',
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 source = cloneDeep(this.property.options?.update?.layout ?? this.property.options?.view?.layout ?? {});
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, this.property.options?.create?.widget, { validationRules: this.property.validations })
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) && c.schema.hidden != true && c.options?.update?.enabled != false);
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 payload = context.getVariable('payload');
357
- const { module, entity, properties, id, title } = payload;
358
- const entityRef = await this.entityRegistery.resolve(module, entity);
359
- const vm = await this.factory.create(module, entity, id, properties);
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('popupResult', false);
382
+ context.setOutput('result', false);
371
383
  if (popup.data?.result == true) {
372
- context.setOutput('popupResult', true);
373
- context.setVariable('updatedData', cloneDeep(popup.data.context));
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 payload = context.getVariable('payload');
389
- const updatedData = context.getVariable('updatedData');
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("popupResult") == true' }],
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 columns = this.detailEntityConfig.columns ?? [];
504
- const props = this.detailEntity()?.properties.filter(c => c.schema.hidden != true &&
505
- c.options?.table?.enabled &&
506
- (columns?.length == 0 || columns?.includes(c.name))) ?? [];
507
- return props.map(e => {
508
- return new AXPEntityListViewColumnViewModel(e);
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.id
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, group) {
590
+ constructor(entity, section) {
590
591
  this.entity = entity;
591
- this.group = group;
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
- if (this.group.title)
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
- if (this.group.description)
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.group.layout ?? {});
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 && c.schema.hidden != true && c.options?.view?.enabled != false);
611
- return props.map(e => {
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 props = this.entity.properties.filter(c => c.groupId == this.group.id && c.schema.hidden != true && c.options?.update?.enabled != false);
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, property) {
630
+ constructor(entity, section, propertyView) {
628
631
  this.entity = entity;
629
632
  this.section = section;
630
- this.property = property;
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 source = cloneDeep(this.property.options?.view?.layout ?? {});
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, this.property.options?.create?.widget, { validationRules: this.property.validations })
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 props = this.entityDef.properties.filter(c => c.groupId && c.schema.hidden != true && c.options?.view?.enabled != false);
676
- const groups = this.entityDef.groups?.filter(g => props.some(p => p.groupId == g.id));
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
- // if (
716
- // event.payload.entity == this.loader.entity.name &&
717
- // event.payload.module == this.loader.entity.module &&
718
- // event.payload.id.includes(this.loader.data.id)
719
- // ) {
720
- // this.workflow.execute('show-list-view', {
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.name &&
730
- event.payload.module == this.entityDef.module &&
731
- event.payload.updateValues.id === this.context().id) {
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
- module: this.entityDef.module,
743
- entity: this.entityDef.name,
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
- payload: {
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
- payload: {
763
- module: this.entityDef.module,
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, group) {
804
+ constructor(entity, section) {
808
805
  this.entity = entity;
809
- this.group = group;
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
- if (this.group.title)
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
- if (this.group.description)
818
- return this.group.description;
819
- return null;
813
+ return this.group.description;
814
+ ;
820
815
  });
821
816
  this.layout = computed(() => {
822
- const source = cloneDeep(this.group.layout ?? {});
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.options?.create?.enabled != false);
830
- return props.map(e => {
831
- return new AXPEntityCreateViewElementViewModel(this.entity, this, e);
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.property.options?.create?.layout ?? this.property.options?.view?.layout ?? {});
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, this.property.options?.create?.widget, { validationRules: this.property.validations })
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 = null) {
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 props = this.entityDef.properties.filter(p => p.groupId && p.schema.hidden != true && p.options?.create?.enabled == true);
882
- const groups = this.entityDef.groups?.filter(g => props.some(p => p.groupId == g.id));
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 props = cloneDeep(this.entityDef.properties.filter(c => c.schema.hidden != true && c.options?.table?.enabled));
1024
- return props.map(e => {
1025
- return new AXPEntityListViewColumnViewModel(e);
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 col = new AXPEntityListViewColumnViewModel(this.entityDef.properties.find(p => p.name == c.name));
1119
- col.visible = !cols.some(c => c == col.name);
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
- payload: {
1162
- module: this.entityDef.module,
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 { module, entity: entity } = context.getVariable('payload');
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('popupResult', true);
1237
+ context.setOutput('result', true);
1220
1238
  context.setVariable('redirect', result.data.redirect);
1221
- context.setVariable('id', result.data.recordId);
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
- const { module, entity: entity } = context.getVariable('payload');
1233
- this.dispatch(AXPEntityCreateEvent({ entity, module }));
1250
+ this.dispatch(AXPEntityCreateEvent({ entity: context.getVariable('entity') }));
1234
1251
  }
1235
1252
  }
1236
1253
  const AXPCreateEntityWorkflow = {
1237
- startStepId: 'createPopup',
1254
+ startStepId: 'show-popup',
1238
1255
  steps: {
1239
- createPopup: {
1240
- id: 'createPopup',
1256
+ "show-popup": {
1241
1257
  action: 'AXPEntityCreatePopupAction',
1242
1258
  nextSteps: [
1243
1259
  {
1244
- conditions: [{ type: 'SINGLE', expression: 'context.getOutput("popupResult") == true' }],
1245
- nextStepId: 'successToast',
1260
+ conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
1261
+ nextStepId: 'show-toast',
1246
1262
  },
1247
1263
  ],
1248
1264
  },
1249
- successToast: {
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: 'createSubmitted',
1275
+ nextStepId: 'dispatch-event',
1261
1276
  },
1262
1277
  ],
1263
1278
  },
1264
- createSubmitted: {
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: 'showDetailView',
1284
+ nextStepId: 'show-entity',
1271
1285
  },
1272
1286
  ],
1273
1287
  },
1274
- showDetailView: {
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 { module, entity, data } = context.getVariable('payload');
1289
- const id = data.id;
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]="'auto'"
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
- <!-- <ax-footer>
1406
+ <ax-footer>
1367
1407
  <ax-suffix>
1368
- <ax-button look="solid" color="ghost" text="Cancel" (onClick)="handleCloseClick()"> </ax-button>
1369
- <ax-dropdown-button [disabled]="vm.isInProgress()" color="primary" text="Save" look="solid"
1370
- (onClick)="handleSaveClick(form)">
1371
- <ax-loading *ngIf="vm.isInProgress()"></ax-loading>
1372
- <ax-button-item-list>
1373
- <ax-button-item text="Save & Create New" (onClick)="handleSaveAndNewClick(form)"> </ax-button-item>
1374
- </ax-button-item-list>
1375
- </ax-dropdown-button>
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: i4.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "ngmodule", type: AXDataTableModule }, { kind: "component", type: i2.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: i3.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: i4$1.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["caption", "node", "footerTemplate", "cellTemplate", "headerTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
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]="'auto'"
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
- <!-- <ax-footer>
1446
+ <ax-footer>
1405
1447
  <ax-suffix>
1406
- <ax-button look="solid" color="ghost" text="Cancel" (onClick)="handleCloseClick()"> </ax-button>
1407
- <ax-dropdown-button [disabled]="vm.isInProgress()" color="primary" text="Save" look="solid"
1408
- (onClick)="handleSaveClick(form)">
1409
- <ax-loading *ngIf="vm.isInProgress()"></ax-loading>
1410
- <ax-button-item-list>
1411
- <ax-button-item text="Save & Create New" (onClick)="handleSaveAndNewClick(form)"> </ax-button-item>
1412
- </ax-button-item-list>
1413
- </ax-dropdown-button>
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: [CommonModule, AXDecoratorModule, AXDropdownButtonModule, AXDataTableModule, AXSearchBoxModule, AXPLayoutBuilderModule],
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 props = this.entityDef.properties.filter(c => c.schema.hidden != true && c.options?.table?.enabled);
1447
- return props.map(e => {
1448
- return new AXPEntityListViewColumnViewModel(e);
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
- applyInlineFilter(value) {
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
- this.applyFilterAndSort();
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
- const inline = this.inlineFilters.filters?.length ?? 0;
1486
- const advance = this.advanceFilters.filters?.length ?? 0;
1487
- if (inline && !advance) {
1488
- this.dataSource.filter(this.inlineFilters);
1489
- }
1490
- else if (!inline && advance) {
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
- const byKey = this.entityDef?.queries.byKey?.execute;
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
- this.builderService.setValue(this.expose, item);
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: "14.0.0", version: "18.0.2", type: AXPLookupWidgetEditComponent, isStandalone: true, selector: "ng-component", inputs: { entity: "entity", conditions: "conditions", expose: "expose" }, usesInheritance: true, ngImport: i0, template: `
1562
- <!-- <ax-select-box
1563
- [dataSource]="dataSource"
1564
- [valueField]="'id'"
1565
- [textField]="textField"
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
- <ax-icon icon="far fa-search">
1574
- </ax-icon>
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: i3$1.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: i4.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4.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" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
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
- <!-- <ax-select-box
1585
- [dataSource]="dataSource"
1586
- [valueField]="'id'"
1587
- [textField]="textField"
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
- <ax-icon icon="far fa-search">
1596
- </ax-icon>
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$1.AXPWorkflowModule, i4$1.AXPLayoutBuilderModule] }); }
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({