@acorex/platform 18.0.2 → 18.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) 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 +14 -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/layout/grid-layout/grid-layout.types.d.ts +1 -2
  9. package/common/lib/schema/entity/entity.class.d.ts +3 -0
  10. package/common/lib/schema/widgets/lookup/lookup-widget-filter.component.d.ts +1 -1
  11. package/common/lib/schema/widgets/lookup/lookup-widget-view.component.d.ts +2 -1
  12. package/common/lib/utils/data-generator.d.ts +15 -1
  13. package/common/lib/utils/index.d.ts +1 -0
  14. package/common/lib/utils/pdf.service.d.ts +25 -0
  15. package/esm2022/common/lib/app/application.types.mjs +1 -1
  16. package/esm2022/common/lib/common.module.mjs +19 -2
  17. package/esm2022/common/lib/data/data-provider.types.mjs +1 -1
  18. package/esm2022/common/lib/data/dexie-storage.service.mjs +34 -0
  19. package/esm2022/common/lib/data/entity-data-provider.mjs +26 -0
  20. package/esm2022/common/lib/data/index.mjs +4 -1
  21. package/esm2022/common/lib/data/storage-service.mjs +5 -0
  22. package/esm2022/common/lib/layout/grid-layout/grid-layout.directive.mjs +5 -5
  23. package/esm2022/common/lib/layout/grid-layout/grid-layout.types.mjs +1 -1
  24. package/esm2022/common/lib/schema/entity/entity-registery.service.mjs +2 -2
  25. package/esm2022/common/lib/schema/entity/entity.class.mjs +1 -1
  26. package/esm2022/common/lib/schema/widgets/lookup/lookup-widget-edit.component.mjs +20 -3
  27. package/esm2022/common/lib/schema/widgets/lookup/lookup-widget-filter.component.mjs +20 -3
  28. package/esm2022/common/lib/schema/widgets/lookup/lookup-widget-view.component.mjs +5 -5
  29. package/esm2022/common/lib/utils/data-generator.mjs +88 -2
  30. package/esm2022/common/lib/utils/index.mjs +2 -1
  31. package/esm2022/common/lib/utils/pdf.service.mjs +85 -0
  32. package/esm2022/common/lib/workflows/common.workflow.mjs +3 -3
  33. package/esm2022/layout/builder/lib/builder/builder.service.mjs +7 -2
  34. package/esm2022/layout/builder/lib/builder/widget.types.mjs +5 -1
  35. package/esm2022/layout/entity/lib/entity-detail-list.viewmodel.mjs +9 -8
  36. package/esm2022/layout/entity/lib/entity-master-create.viewmodel.mjs +44 -27
  37. package/esm2022/layout/entity/lib/entity-master-list.viewmodel.mjs +42 -15
  38. package/esm2022/layout/entity/lib/entity-master-single.viewmodel.mjs +64 -62
  39. package/esm2022/layout/entity/lib/entity-master-update.viewmodel.mjs +9 -7
  40. package/esm2022/layout/entity/lib/entity-registery.service.mjs +2 -2
  41. package/esm2022/layout/entity/lib/entity.module.mjs +13 -4
  42. package/esm2022/layout/entity/lib/entity.viewmodel.mjs +7 -6
  43. package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.mjs +142 -39
  44. package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.component.mjs +82 -37
  45. package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.viewmodel.mjs +45 -22
  46. package/esm2022/layout/entity/lib/workflows/create-entity.workflow.mjs +17 -21
  47. package/esm2022/layout/entity/lib/workflows/delete-entity.workflow.mjs +14 -15
  48. package/esm2022/layout/entity/lib/workflows/modify-section.workflow.mjs +11 -23
  49. package/esm2022/layout/entity/lib/workflows/show-details.workflow.mjs +3 -3
  50. package/esm2022/layout/entity/lib/workflows/show-list.workflow.mjs +35 -0
  51. package/esm2022/layouts/lib/admin/entity-layout/entity-create-view/entity-create-view.component.mjs +3 -3
  52. package/esm2022/layouts/lib/admin/entity-layout/workflows/delete-entity.workflow.mjs +2 -2
  53. package/esm2022/layouts/lib/layout.module.mjs +3 -3
  54. package/esm2022/themes/default/lib/default.module.mjs +3 -3
  55. package/esm2022/themes/default/lib/entity-reuse.strategy.mjs +2 -2
  56. package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-create-view/entity-master-create-view.component.mjs +2 -2
  57. package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-list-view/{entity-list-view.component.mjs → entity-master-list-view.component.mjs} +11 -2
  58. package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-list-view/list-view-option-sorting/list-view-option-sorting.component.mjs +2 -1
  59. package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.mjs +6 -3
  60. package/esm2022/widgets/lib/editors/date-time-box-widget/date-time-box-widget-column.component.mjs +2 -2
  61. package/esm2022/widgets/lib/editors/date-time-box-widget/date-time-box-widget-edit.component.mjs +21 -12
  62. package/esm2022/widgets/lib/editors/date-time-box-widget/date-time-box-widget-view.component.mjs +2 -2
  63. package/esm2022/widgets/lib/editors/number-box-widget/number-box-widget-column.component.mjs +2 -2
  64. package/esm2022/widgets/lib/editors/number-box-widget/number-box-widget-view.component.mjs +2 -2
  65. package/esm2022/widgets/lib/editors/rich-text-widget/rich-text-widget-edit.component.mjs +3 -3
  66. package/esm2022/widgets/lib/editors/rich-text-widget/rich-text-widget-view.component.mjs +14 -8
  67. package/esm2022/widgets/lib/editors/selection-list-widget/selection-list-widget-view.component.mjs +3 -2
  68. package/esm2022/widgets/lib/editors/signature-pad-widget/signature-pad-widget-edit.component.mjs +3 -2
  69. package/esm2022/widgets/lib/editors/signature-pad-widget/signature-pad-widget-view.component.mjs +3 -2
  70. package/esm2022/widgets/lib/editors/text-box-widget/text-box-widget-edit.component.mjs +3 -2
  71. package/esm2022/widgets/lib/editors/text-box-widget/text-box-widget-view.component.mjs +3 -2
  72. package/esm2022/workflow/lib/actions/start-workflow.action.mjs +32 -0
  73. package/esm2022/workflow/lib/workflow.module.mjs +7 -2
  74. package/esm2022/workflow/lib/workflow.service.mjs +54 -7
  75. package/esm2022/workflow/lib/workflow.types.mjs +17 -10
  76. package/fesm2022/{acorex-platform-common-avatar-widget-edit.component-DAmNXjDm.mjs → acorex-platform-common-avatar-widget-edit.component-B-of5ssU.mjs} +3 -2
  77. 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
  78. package/fesm2022/{acorex-platform-common-avatar-widget-view.component-BlA_cFkP.mjs → acorex-platform-common-avatar-widget-view.component-CJvrSkTv.mjs} +4 -3
  79. package/fesm2022/acorex-platform-common-avatar-widget-view.component-CJvrSkTv.mjs.map +1 -0
  80. package/fesm2022/{acorex-platform-common-boolean-widget-filter.component-CEqibiML.mjs → acorex-platform-common-boolean-widget-filter.component-BTcOjuUm.mjs} +4 -3
  81. package/fesm2022/acorex-platform-common-boolean-widget-filter.component-BTcOjuUm.mjs.map +1 -0
  82. package/fesm2022/{acorex-platform-common-checkbox-widget-column.component-BiUHPDqV.mjs → acorex-platform-common-checkbox-widget-column.component-X9d1iY_F.mjs} +4 -3
  83. 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
  84. package/fesm2022/{acorex-platform-common-checkbox-widget-edit.component-BVG9_XXh.mjs → acorex-platform-common-checkbox-widget-edit.component-_jtT03Vn.mjs} +4 -3
  85. package/fesm2022/acorex-platform-common-checkbox-widget-edit.component-_jtT03Vn.mjs.map +1 -0
  86. package/fesm2022/{acorex-platform-common-checkbox-widget-view.component-CfGkMcDi.mjs → acorex-platform-common-checkbox-widget-view.component-nYmtb8bK.mjs} +4 -3
  87. package/fesm2022/{acorex-platform-common-checkbox-widget-view.component-CfGkMcDi.mjs.map → acorex-platform-common-checkbox-widget-view.component-nYmtb8bK.mjs.map} +1 -1
  88. package/fesm2022/{acorex-platform-common-dateTime-widget-column.component-BlXTU887.mjs → acorex-platform-common-dateTime-widget-column.component-5ljYmtHI.mjs} +4 -3
  89. package/fesm2022/acorex-platform-common-dateTime-widget-column.component-5ljYmtHI.mjs.map +1 -0
  90. package/fesm2022/{acorex-platform-common-dateTime-widget-edit.component-B0s6FN-g.mjs → acorex-platform-common-dateTime-widget-edit.component-D8FSiqAo.mjs} +4 -3
  91. 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
  92. package/fesm2022/{acorex-platform-common-dateTime-widget-filter.component-B7KBCsUt.mjs → acorex-platform-common-dateTime-widget-filter.component-Df0DuDtw.mjs} +4 -3
  93. package/fesm2022/{acorex-platform-common-dateTime-widget-filter.component-B7KBCsUt.mjs.map → acorex-platform-common-dateTime-widget-filter.component-Df0DuDtw.mjs.map} +1 -1
  94. package/fesm2022/{acorex-platform-common-dateTime-widget-view.component-Dy7pAkGG.mjs → acorex-platform-common-dateTime-widget-view.component-CjVjQkPh.mjs} +4 -3
  95. package/fesm2022/{acorex-platform-common-dateTime-widget-view.component-Dy7pAkGG.mjs.map → acorex-platform-common-dateTime-widget-view.component-CjVjQkPh.mjs.map} +1 -1
  96. package/fesm2022/{acorex-platform-common-email-widget-column.component-D_UNn2dW.mjs → acorex-platform-common-email-widget-column.component-BgNdL62k.mjs} +4 -3
  97. package/fesm2022/acorex-platform-common-email-widget-column.component-BgNdL62k.mjs.map +1 -0
  98. package/fesm2022/{acorex-platform-common-email-widget-edit.component-DWT24mCM.mjs → acorex-platform-common-email-widget-edit.component-CgHPGccx.mjs} +4 -3
  99. package/fesm2022/{acorex-platform-common-email-widget-edit.component-DWT24mCM.mjs.map → acorex-platform-common-email-widget-edit.component-CgHPGccx.mjs.map} +1 -1
  100. package/fesm2022/{acorex-platform-common-email-widget-view.component-B6puyycL.mjs → acorex-platform-common-email-widget-view.component-C2aQ14k-.mjs} +4 -3
  101. package/fesm2022/{acorex-platform-common-email-widget-view.component-B6puyycL.mjs.map → acorex-platform-common-email-widget-view.component-C2aQ14k-.mjs.map} +1 -1
  102. package/fesm2022/{acorex-platform-common-file-widget-column.component-C1faGR4K.mjs → acorex-platform-common-file-widget-column.component-CwFzLLHt.mjs} +4 -3
  103. package/fesm2022/acorex-platform-common-file-widget-column.component-CwFzLLHt.mjs.map +1 -0
  104. package/fesm2022/{acorex-platform-common-file-widget-edit.component-CTvS9ls8.mjs → acorex-platform-common-file-widget-edit.component-DxoQR4CU.mjs} +4 -3
  105. package/fesm2022/{acorex-platform-common-file-widget-edit.component-CTvS9ls8.mjs.map → acorex-platform-common-file-widget-edit.component-DxoQR4CU.mjs.map} +1 -1
  106. package/fesm2022/{acorex-platform-common-file-widget-filter.component-D4AMg5M0.mjs → acorex-platform-common-file-widget-filter.component-BvG0iaKU.mjs} +4 -3
  107. package/fesm2022/acorex-platform-common-file-widget-filter.component-BvG0iaKU.mjs.map +1 -0
  108. package/fesm2022/{acorex-platform-common-file-widget-view.component-CHI4VCvt.mjs → acorex-platform-common-file-widget-view.component-BC9l3YrO.mjs} +4 -3
  109. package/fesm2022/{acorex-platform-common-file-widget-view.component-CHI4VCvt.mjs.map → acorex-platform-common-file-widget-view.component-BC9l3YrO.mjs.map} +1 -1
  110. package/fesm2022/{acorex-platform-common-gallery-widget-edit.component-CAOctYzV.mjs → acorex-platform-common-gallery-widget-edit.component-BihOIJ9T.mjs} +4 -3
  111. package/fesm2022/{acorex-platform-common-gallery-widget-edit.component-CAOctYzV.mjs.map → acorex-platform-common-gallery-widget-edit.component-BihOIJ9T.mjs.map} +1 -1
  112. package/fesm2022/{acorex-platform-common-gallery-widget-filter.component-lgaYDZeD.mjs → acorex-platform-common-gallery-widget-filter.component-DS1PCIJp.mjs} +4 -3
  113. package/fesm2022/acorex-platform-common-gallery-widget-filter.component-DS1PCIJp.mjs.map +1 -0
  114. package/fesm2022/{acorex-platform-common-gallery-widget-view.component-Ci50jeO5.mjs → acorex-platform-common-gallery-widget-view.component-CnQONVdg.mjs} +4 -3
  115. package/fesm2022/{acorex-platform-common-gallery-widget-view.component-Ci50jeO5.mjs.map → acorex-platform-common-gallery-widget-view.component-CnQONVdg.mjs.map} +1 -1
  116. package/fesm2022/{acorex-platform-common-largetext-widget-edit.component-DFKG-kum.mjs → acorex-platform-common-largetext-widget-edit.component-BCtGkz1a.mjs} +4 -3
  117. package/fesm2022/acorex-platform-common-largetext-widget-edit.component-BCtGkz1a.mjs.map +1 -0
  118. package/fesm2022/{acorex-platform-common-lookup-widget-column.component-CFzCGcqA.mjs → acorex-platform-common-lookup-widget-column.component-Cl-vO5XW.mjs} +4 -3
  119. package/fesm2022/acorex-platform-common-lookup-widget-column.component-Cl-vO5XW.mjs.map +1 -0
  120. package/fesm2022/{acorex-platform-common-lookup-widget-edit.component-CYTSeEOq.mjs → acorex-platform-common-lookup-widget-edit.component-Do_yV2hi.mjs} +22 -4
  121. package/fesm2022/acorex-platform-common-lookup-widget-edit.component-Do_yV2hi.mjs.map +1 -0
  122. package/fesm2022/{acorex-platform-common-lookup-widget-filter.component-BkxT9_Hh.mjs → acorex-platform-common-lookup-widget-filter.component-AKqbYe-l.mjs} +22 -4
  123. package/fesm2022/acorex-platform-common-lookup-widget-filter.component-AKqbYe-l.mjs.map +1 -0
  124. package/fesm2022/{acorex-platform-common-lookup-widget-view.component-5YeixMp7.mjs → acorex-platform-common-lookup-widget-view.component-BHqYDEuU.mjs} +8 -7
  125. package/fesm2022/acorex-platform-common-lookup-widget-view.component-BHqYDEuU.mjs.map +1 -0
  126. package/fesm2022/{acorex-platform-common-map-widget-edit.component-CE3QQBmX.mjs → acorex-platform-common-map-widget-edit.component-SSrR3xxv.mjs} +4 -3
  127. package/fesm2022/acorex-platform-common-map-widget-edit.component-SSrR3xxv.mjs.map +1 -0
  128. package/fesm2022/{acorex-platform-common-map-widget-view.component-Cv4OCTxz.mjs → acorex-platform-common-map-widget-view.component-DrGG3gzg.mjs} +4 -3
  129. package/fesm2022/acorex-platform-common-map-widget-view.component-DrGG3gzg.mjs.map +1 -0
  130. package/fesm2022/{acorex-platform-common-messenger-widget-column.component-CJdh6TKb.mjs → acorex-platform-common-messenger-widget-column.component-BJ_XzNKc.mjs} +4 -3
  131. package/fesm2022/acorex-platform-common-messenger-widget-column.component-BJ_XzNKc.mjs.map +1 -0
  132. package/fesm2022/{acorex-platform-common-messenger-widget-edit.component-kiEHxJia.mjs → acorex-platform-common-messenger-widget-edit.component-B_FG_n0O.mjs} +4 -3
  133. 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
  134. package/fesm2022/{acorex-platform-common-messenger-widget-view.component-DzbjgZA7.mjs → acorex-platform-common-messenger-widget-view.component-EBiPO9ds.mjs} +4 -3
  135. package/fesm2022/{acorex-platform-common-messenger-widget-view.component-DzbjgZA7.mjs.map → acorex-platform-common-messenger-widget-view.component-EBiPO9ds.mjs.map} +1 -1
  136. package/fesm2022/{acorex-platform-common-number-widget-edit.component-BRuIP96Y.mjs → acorex-platform-common-number-widget-edit.component-B1XXga-9.mjs} +4 -3
  137. package/fesm2022/acorex-platform-common-number-widget-edit.component-B1XXga-9.mjs.map +1 -0
  138. package/fesm2022/{acorex-platform-common-number-widget-filter.component-jQ4DaFQH.mjs → acorex-platform-common-number-widget-filter.component-B2JCpDjU.mjs} +4 -3
  139. package/fesm2022/{acorex-platform-common-number-widget-filter.component-jQ4DaFQH.mjs.map → acorex-platform-common-number-widget-filter.component-B2JCpDjU.mjs.map} +1 -1
  140. package/fesm2022/{acorex-platform-common-number-widget-view.component-BzUWjT8m.mjs → acorex-platform-common-number-widget-view.component-DD0tkoc4.mjs} +4 -3
  141. package/fesm2022/acorex-platform-common-number-widget-view.component-DD0tkoc4.mjs.map +1 -0
  142. package/fesm2022/{acorex-platform-common-password-widget-column.component-BRzyuK5c.mjs → acorex-platform-common-password-widget-column.component-eyqgQlAt.mjs} +4 -3
  143. package/fesm2022/{acorex-platform-common-password-widget-column.component-BRzyuK5c.mjs.map → acorex-platform-common-password-widget-column.component-eyqgQlAt.mjs.map} +1 -1
  144. package/fesm2022/{acorex-platform-common-password-widget-edit.component-q6R2dw5k.mjs → acorex-platform-common-password-widget-edit.component-C2yNb9Pl.mjs} +4 -3
  145. package/fesm2022/acorex-platform-common-password-widget-edit.component-C2yNb9Pl.mjs.map +1 -0
  146. package/fesm2022/{acorex-platform-common-password-widget-view.component-CKaQItON.mjs → acorex-platform-common-password-widget-view.component-o9S7pwJW.mjs} +4 -3
  147. package/fesm2022/{acorex-platform-common-password-widget-view.component-CKaQItON.mjs.map → acorex-platform-common-password-widget-view.component-o9S7pwJW.mjs.map} +1 -1
  148. package/fesm2022/{acorex-platform-common-phone-widget-column.component-BD7BScjW.mjs → acorex-platform-common-phone-widget-column.component-BL9Xl2XH.mjs} +4 -3
  149. package/fesm2022/{acorex-platform-common-phone-widget-column.component-BD7BScjW.mjs.map → acorex-platform-common-phone-widget-column.component-BL9Xl2XH.mjs.map} +1 -1
  150. package/fesm2022/{acorex-platform-common-phone-widget-edit.component-D8tGKfNj.mjs → acorex-platform-common-phone-widget-edit.component-DSh9zoZj.mjs} +4 -3
  151. package/fesm2022/{acorex-platform-common-phone-widget-edit.component-D8tGKfNj.mjs.map → acorex-platform-common-phone-widget-edit.component-DSh9zoZj.mjs.map} +1 -1
  152. package/fesm2022/{acorex-platform-common-phone-widget-view.component-CFiMsGOB.mjs → acorex-platform-common-phone-widget-view.component-Br3xbaDd.mjs} +4 -3
  153. package/fesm2022/{acorex-platform-common-phone-widget-view.component-CFiMsGOB.mjs.map → acorex-platform-common-phone-widget-view.component-Br3xbaDd.mjs.map} +1 -1
  154. 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
  155. 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
  156. package/fesm2022/{acorex-platform-common-rich-text-widget-edit.component-CA2xRfVg.mjs → acorex-platform-common-rich-text-widget-edit.component-Dz1toc21.mjs} +4 -3
  157. package/fesm2022/acorex-platform-common-rich-text-widget-edit.component-Dz1toc21.mjs.map +1 -0
  158. package/fesm2022/{acorex-platform-common-rich-text-widget-view.component-DYfTZ64H.mjs → acorex-platform-common-rich-text-widget-view.component-CxTPcEIQ.mjs} +4 -3
  159. package/fesm2022/acorex-platform-common-rich-text-widget-view.component-CxTPcEIQ.mjs.map +1 -0
  160. package/fesm2022/{acorex-platform-common-selection-list-widget-column.component-_MglaOmo.mjs → acorex-platform-common-selection-list-widget-column.component-BCCmg8MI.mjs} +4 -3
  161. 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
  162. 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
  163. package/fesm2022/acorex-platform-common-selection-list-widget-edit.component-B5eUdN2R.mjs.map +1 -0
  164. package/fesm2022/{acorex-platform-common-selection-list-widget-filter.component-DRToTnHQ.mjs → acorex-platform-common-selection-list-widget-filter.component-DPpZq1TB.mjs} +4 -3
  165. package/fesm2022/acorex-platform-common-selection-list-widget-filter.component-DPpZq1TB.mjs.map +1 -0
  166. 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
  167. package/fesm2022/acorex-platform-common-selection-list-widget-view.component-Bxvd_AKZ.mjs.map +1 -0
  168. package/fesm2022/{acorex-platform-common-signature-pad-widget-edit.component-DF29uWl2.mjs → acorex-platform-common-signature-pad-widget-edit.component-CNjYCEi6.mjs} +4 -3
  169. 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
  170. 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
  171. package/fesm2022/acorex-platform-common-signature-pad-widget-view.component-CsiBv_7i.mjs.map +1 -0
  172. package/fesm2022/{acorex-platform-common-string-widget-filter.component-Di_GFHme.mjs → acorex-platform-common-string-widget-filter.component-CrGt6Bov.mjs} +4 -3
  173. package/fesm2022/acorex-platform-common-string-widget-filter.component-CrGt6Bov.mjs.map +1 -0
  174. package/fesm2022/{acorex-platform-common-text-widget-column.component-BSYd1CbC.mjs → acorex-platform-common-text-widget-column.component-qXusAevm.mjs} +4 -3
  175. package/fesm2022/{acorex-platform-common-text-widget-column.component-BSYd1CbC.mjs.map → acorex-platform-common-text-widget-column.component-qXusAevm.mjs.map} +1 -1
  176. package/fesm2022/{acorex-platform-common-text-widget-edit.component-K9z9N1qw.mjs → acorex-platform-common-text-widget-edit.component-ed0MUYnD.mjs} +4 -3
  177. package/fesm2022/{acorex-platform-common-text-widget-edit.component-K9z9N1qw.mjs.map → acorex-platform-common-text-widget-edit.component-ed0MUYnD.mjs.map} +1 -1
  178. package/fesm2022/{acorex-platform-common-text-widget-view.component-WbZtm_bf.mjs → acorex-platform-common-text-widget-view.component-BpxTaeQW.mjs} +4 -3
  179. 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
  180. package/fesm2022/{acorex-platform-common-toggle-widget-column.component-ZCBSYMuz.mjs → acorex-platform-common-toggle-widget-column.component-BqiUQrmV.mjs} +4 -3
  181. package/fesm2022/{acorex-platform-common-toggle-widget-column.component-ZCBSYMuz.mjs.map → acorex-platform-common-toggle-widget-column.component-BqiUQrmV.mjs.map} +1 -1
  182. package/fesm2022/{acorex-platform-common-toggle-widget-edit.component-rkDfLA-J.mjs → acorex-platform-common-toggle-widget-edit.component-CDG62BJN.mjs} +4 -3
  183. package/fesm2022/acorex-platform-common-toggle-widget-edit.component-CDG62BJN.mjs.map +1 -0
  184. package/fesm2022/{acorex-platform-common-toggle-widget-view.component-DLDIrci1.mjs → acorex-platform-common-toggle-widget-view.component-DWYcIPTd.mjs} +4 -3
  185. package/fesm2022/{acorex-platform-common-toggle-widget-view.component-DLDIrci1.mjs.map → acorex-platform-common-toggle-widget-view.component-DWYcIPTd.mjs.map} +1 -1
  186. package/fesm2022/acorex-platform-common.mjs +389 -140
  187. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  188. package/fesm2022/acorex-platform-layout-builder.mjs +10 -1
  189. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  190. package/fesm2022/acorex-platform-layout-entity.mjs +514 -280
  191. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  192. package/fesm2022/{acorex-platform-layouts-entity-create-view.component-BmSMt95H.mjs → acorex-platform-layouts-entity-create-view.component-fkKPKxlb.mjs} +3 -3
  193. package/fesm2022/acorex-platform-layouts-entity-create-view.component-fkKPKxlb.mjs.map +1 -0
  194. package/fesm2022/acorex-platform-layouts.mjs +4 -4
  195. package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
  196. 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
  197. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-BxYT9KhH.mjs.map +1 -0
  198. package/fesm2022/acorex-platform-themes-default.mjs +21 -8
  199. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  200. package/fesm2022/acorex-platform-widgets.mjs +73 -56
  201. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  202. package/fesm2022/acorex-platform-workflow.mjs +194 -109
  203. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  204. package/layout/builder/lib/builder/widget.types.d.ts +3 -0
  205. package/layout/entity/lib/entity-master-create.viewmodel.d.ts +6 -5
  206. package/layout/entity/lib/entity-master-list.viewmodel.d.ts +11 -5
  207. package/layout/entity/lib/entity-master-single.viewmodel.d.ts +17 -10
  208. package/layout/entity/lib/entity-master-update.viewmodel.d.ts +0 -1
  209. package/layout/entity/lib/entity.viewmodel.d.ts +3 -3
  210. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +20 -3
  211. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.component.d.ts +8 -1
  212. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.viewmodel.d.ts +10 -3
  213. package/layout/entity/lib/workflows/create-entity.workflow.d.ts +0 -2
  214. package/layout/entity/lib/workflows/delete-entity.workflow.d.ts +2 -4
  215. package/layout/entity/lib/workflows/modify-section.workflow.d.ts +2 -5
  216. package/layout/entity/lib/workflows/show-list.workflow.d.ts +10 -0
  217. package/package.json +1 -1
  218. package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/{entity-list-view.component.d.ts → entity-master-list-view.component.d.ts} +1 -0
  219. package/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.d.ts +1 -0
  220. package/widgets/lib/editors/date-time-box-widget/date-time-box-widget-edit.component.d.ts +4 -0
  221. package/widgets/lib/editors/rich-text-widget/rich-text-widget-edit.component.d.ts +1 -1
  222. package/widgets/lib/editors/rich-text-widget/rich-text-widget-view.component.d.ts +3 -2
  223. package/widgets/lib/editors/signature-pad-widget/signature-pad-widget-edit.component.d.ts +1 -1
  224. package/widgets/lib/editors/signature-pad-widget/signature-pad-widget-view.component.d.ts +1 -1
  225. package/widgets/lib/editors/text-box-widget/text-box-widget-edit.component.d.ts +1 -1
  226. package/widgets/lib/editors/text-box-widget/text-box-widget-view.component.d.ts +1 -1
  227. package/workflow/lib/actions/start-workflow.action.d.ts +10 -0
  228. package/workflow/lib/workflow.service.d.ts +4 -2
  229. package/workflow/lib/workflow.types.d.ts +6 -3
  230. package/fesm2022/acorex-platform-common-avatar-widget-view.component-BlA_cFkP.mjs.map +0 -1
  231. package/fesm2022/acorex-platform-common-boolean-widget-filter.component-CEqibiML.mjs.map +0 -1
  232. package/fesm2022/acorex-platform-common-checkbox-widget-edit.component-BVG9_XXh.mjs.map +0 -1
  233. package/fesm2022/acorex-platform-common-dateTime-widget-column.component-BlXTU887.mjs.map +0 -1
  234. package/fesm2022/acorex-platform-common-email-widget-column.component-D_UNn2dW.mjs.map +0 -1
  235. package/fesm2022/acorex-platform-common-file-widget-column.component-C1faGR4K.mjs.map +0 -1
  236. package/fesm2022/acorex-platform-common-file-widget-filter.component-D4AMg5M0.mjs.map +0 -1
  237. package/fesm2022/acorex-platform-common-gallery-widget-filter.component-lgaYDZeD.mjs.map +0 -1
  238. package/fesm2022/acorex-platform-common-largetext-widget-edit.component-DFKG-kum.mjs.map +0 -1
  239. package/fesm2022/acorex-platform-common-lookup-widget-column.component-CFzCGcqA.mjs.map +0 -1
  240. package/fesm2022/acorex-platform-common-lookup-widget-edit.component-CYTSeEOq.mjs.map +0 -1
  241. package/fesm2022/acorex-platform-common-lookup-widget-filter.component-BkxT9_Hh.mjs.map +0 -1
  242. package/fesm2022/acorex-platform-common-lookup-widget-view.component-5YeixMp7.mjs.map +0 -1
  243. package/fesm2022/acorex-platform-common-map-widget-edit.component-CE3QQBmX.mjs.map +0 -1
  244. package/fesm2022/acorex-platform-common-map-widget-view.component-Cv4OCTxz.mjs.map +0 -1
  245. package/fesm2022/acorex-platform-common-messenger-widget-column.component-CJdh6TKb.mjs.map +0 -1
  246. package/fesm2022/acorex-platform-common-number-widget-edit.component-BRuIP96Y.mjs.map +0 -1
  247. package/fesm2022/acorex-platform-common-number-widget-view.component-BzUWjT8m.mjs.map +0 -1
  248. package/fesm2022/acorex-platform-common-password-widget-edit.component-q6R2dw5k.mjs.map +0 -1
  249. package/fesm2022/acorex-platform-common-rich-text-widget-edit.component-CA2xRfVg.mjs.map +0 -1
  250. package/fesm2022/acorex-platform-common-rich-text-widget-view.component-DYfTZ64H.mjs.map +0 -1
  251. package/fesm2022/acorex-platform-common-selection-list-widget-edit.component-QKw_tyOd.mjs.map +0 -1
  252. package/fesm2022/acorex-platform-common-selection-list-widget-filter.component-DRToTnHQ.mjs.map +0 -1
  253. package/fesm2022/acorex-platform-common-selection-list-widget-view.component-CjDiuUdj.mjs.map +0 -1
  254. package/fesm2022/acorex-platform-common-signature-pad-widget-view.component-BWzoR4HM.mjs.map +0 -1
  255. package/fesm2022/acorex-platform-common-string-widget-filter.component-Di_GFHme.mjs.map +0 -1
  256. package/fesm2022/acorex-platform-common-toggle-widget-edit.component-rkDfLA-J.mjs.map +0 -1
  257. package/fesm2022/acorex-platform-layouts-entity-create-view.component-BmSMt95H.mjs.map +0 -1
  258. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Buanq4is.mjs.map +0 -1
@@ -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, DestroyRef, 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,34 @@ 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, takeUntil } 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';
40
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
33
41
 
34
42
  const AXP_ENTITY_CONFIG_TOKEN = new InjectionToken('AXP_ENTITY_CONFIG_TOKEN');
35
43
  const AXP_ENTITY_DEFINITION_LOADER = new InjectionToken('AXP_ENTITY_DEFINITION_LOADER');
@@ -75,7 +83,7 @@ class AXPEntityDefinitionRegistryService {
75
83
  throw error; // Rethrow to allow error handling by caller
76
84
  }
77
85
  if (!config) {
78
- throw new Error(`Invalid Entity name: ${key}`);
86
+ throw new Error(`Invalid entity name: ${key}`);
79
87
  }
80
88
  }
81
89
  return config;
@@ -113,18 +121,19 @@ class AXPEntityCommandTriggerViewModel {
113
121
  }
114
122
  }
115
123
  class AXPEntityListViewColumnViewModel {
116
- constructor(property) {
124
+ constructor(property, column) {
117
125
  this.property = property;
126
+ this.column = column;
118
127
  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;
128
+ this.title = this.column.title ?? this.property.title;
129
+ this.visible = this.column?.options?.visible ?? true;
122
130
  this.node = computed(() => {
123
131
  const widget = this.property.schema.interface;
124
132
  return {
125
133
  path: this.name,
126
134
  type: widget.type,
127
- options: { ...widget?.options, ...this.property.options?.table?.widget }
135
+ //... this.property.options?.table?.widget
136
+ options: { ...widget?.options }
128
137
  };
129
138
  });
130
139
  }
@@ -139,9 +148,10 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
139
148
  this.loadingDialog = inject(AXLoadingDialogService);
140
149
  }
141
150
  async execute(context) {
142
- const moduleName = context.getVariable('module');
143
- const entityName = context.getVariable('entity');
144
- const ids = context.getVariable('ids');
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);
@@ -188,13 +198,13 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
188
198
  // All items deleted successfully
189
199
  await this.dialogService.alert('Deletion Successful', `${successfulPromises} item(s) has been deleted.`, 'success');
190
200
  // Dispatch actions
191
- this.dispatch(AXPEntityDeletedEvent({ module: moduleName, entity: entityName, id: ids }));
201
+ this.dispatch(AXPEntityDeletedEvent({ entity: moduleEntity, ids: ids }));
192
202
  }
193
203
  else if (successfulPromises > 0 && failedPromises > 0) {
194
204
  // Some items deleted successfully, some failed
195
205
  await this.dialogService.alert('Partial Deletion Completed', `${successfulPromises} item(s) deleted successfully. However, ${failedPromises} item(s) could not be deleted.`, 'warning');
196
206
  // Dispatch actions
197
- this.dispatch(AXPEntityDeletedEvent({ module: moduleName, entity: entityName, id: ids }));
207
+ this.dispatch(AXPEntityDeletedEvent({ entity: moduleEntity, ids: ids }));
198
208
  }
199
209
  else if (successfulPromises === 0 && failedPromises > 0) {
200
210
  // No items deleted, all failed
@@ -216,11 +226,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
216
226
  type: Injectable
217
227
  }] });
218
228
  const AXPDeleteEntityWorkflow = {
219
- startStepId: 'confirmDelete',
229
+ startStepId: 'confirm-delete',
220
230
  steps: {
221
- confirmDelete: {
222
- id: 'confirmDelete',
223
- action: 'AXPDialogConfirmAction',
231
+ "confirm-delete": {
232
+ action: 'show-prompt-dialog',
224
233
  input: {
225
234
  title: 'Warning',
226
235
  message: `Are you sure want to delete selected item(s)?`,
@@ -232,17 +241,16 @@ const AXPDeleteEntityWorkflow = {
232
241
  {
233
242
  type: 'AND',
234
243
  conditions: [
235
- { type: 'SINGLE', expression: 'context.getOutput("deleteConfirmed") == true' },
244
+ { type: 'SINGLE', expression: 'context.getOutput("result") == true' },
236
245
  ],
237
246
  },
238
247
  ],
239
- nextStepId: 'performDelete',
248
+ nextStepId: 'perform-delete',
240
249
  },
241
250
  ],
242
251
  },
243
- performDelete: {
244
- id: 'performDelete',
245
- action: 'AXPEntityPerformDeleteAction',
252
+ "perform-delete": {
253
+ action: 'entity-perform-delete',
246
254
  },
247
255
  },
248
256
  };
@@ -255,15 +263,14 @@ class AXPEntityMasterUpdateElementViewModel {
255
263
  this.title = signal(this.property.title);
256
264
  this.description = signal(this.property.description);
257
265
  this.editable = computed(() => {
258
- return !(this.property.schema.readonly ?? false) &&
259
- (this.property.options?.update?.enabled ?? true);
266
+ return !(this.property.schema.readonly ?? false);
260
267
  });
261
- this.order = signal(this.property.options?.view?.layout?.order ?? 0);
262
268
  this.isRequired = computed(() => {
263
269
  return this.property.validations?.some(c => c.rule == 'required') || false;
264
270
  });
265
271
  this.layout = computed(() => {
266
- const source = cloneDeep(this.property.options?.update?.layout ?? this.property.options?.view?.layout ?? {});
272
+ const updateProp = this.entity.interfaces?.master?.update?.properties?.find(c => c.name == this.property.name);
273
+ const source = cloneDeep(updateProp?.layout ?? {});
267
274
  set(source, "positions.default.colSpan", 12);
268
275
  return source;
269
276
  });
@@ -277,7 +284,9 @@ class AXPEntityMasterUpdateElementViewModel {
277
284
  children: widget.children,
278
285
  formula: widget.formula,
279
286
  triggers: widget.triggers,
280
- options: merge(schema.interface?.options, this.property.options?.create?.widget, { validationRules: this.property.validations })
287
+ options: merge(schema.interface?.options,
288
+ //this.property.options?.create?.widget,
289
+ { validationRules: this.property.validations })
281
290
  };
282
291
  });
283
292
  }
@@ -293,7 +302,8 @@ class AXPEntityMasterUpdateViewModel {
293
302
  this.isInProgress = signal(false);
294
303
  this.context = signal(cloneDeep(this.entityData));
295
304
  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);
305
+ const props = this.entityDef.properties.filter(c => this.props.includes(c.name) &&
306
+ c.schema.hidden != true);
297
307
  return props.map(e => {
298
308
  return new AXPEntityMasterUpdateElementViewModel(this.entityDef, e);
299
309
  });
@@ -353,10 +363,10 @@ class AXPEntityModifySectionPopupAction extends AXPWorkflowAction {
353
363
  this.factory = inject(AXPEntityMasterUpdateViewModelFactory);
354
364
  }
355
365
  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);
366
+ const [moduleName, entityName] = context.getVariable('entity').split(".");
367
+ const { properties, id, title } = context.getVariable('data');
368
+ const entityRef = await this.entityRegistery.resolve(moduleName, entityName);
369
+ const vm = await this.factory.create(moduleName, entityName, id, properties);
360
370
  const com = await this.config.viewers.master.modify();
361
371
  const popup = await this.popupService.open(com, {
362
372
  title: title ?? `Modify ${entityRef.formats.individual}`,
@@ -367,10 +377,10 @@ class AXPEntityModifySectionPopupAction extends AXPWorkflowAction {
367
377
  entity: entityRef,
368
378
  },
369
379
  });
370
- context.setOutput('popupResult', false);
380
+ context.setOutput('result', false);
371
381
  if (popup.data?.result == true) {
372
- context.setOutput('popupResult', true);
373
- context.setVariable('updatedData', cloneDeep(popup.data.context));
382
+ context.setOutput('result', true);
383
+ context.setVariable('data', cloneDeep(popup.data.context));
374
384
  }
375
385
  }
376
386
  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 +390,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
380
390
  type: Injectable
381
391
  }] });
382
392
  class AXPEntityModifyConfirmedAction extends AXPWorkflowAction {
383
- constructor() {
384
- super(...arguments);
385
- this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
386
- }
387
393
  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 }));
394
+ const updatedData = context.getVariable('data');
395
+ this.dispatch(AXPEntityModifyEvent({ entity: context.getVariable('entity'), values: updatedData }));
392
396
  }
393
397
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityModifyConfirmedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
394
398
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityModifyConfirmedAction }); }
@@ -404,7 +408,7 @@ const AXPModifyEntitySectionWorkflow = {
404
408
  action: 'AXPEntityModifySectionPopupAction',
405
409
  nextSteps: [
406
410
  {
407
- conditions: [{ type: 'SINGLE', expression: 'context.getOutput("popupResult") == true' }],
411
+ conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
408
412
  nextStepId: 'successToast',
409
413
  },
410
414
  ],
@@ -427,12 +431,6 @@ const AXPModifyEntitySectionWorkflow = {
427
431
  modifyConfirmed: {
428
432
  id: 'modifyConfirmed',
429
433
  action: 'AXPEntityModifyConfirmedAction',
430
- nextSteps: [
431
- {
432
- conditions: [],
433
- nextStepId: '',
434
- },
435
- ],
436
434
  },
437
435
  },
438
436
  };
@@ -500,12 +498,13 @@ class AXPEntityDetailListViewModel {
500
498
  //****************** Columns ******************//
501
499
  this.columns = computed(() => {
502
500
  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);
501
+ const detailColumns = this.detailEntityConfig.columns ?? [];
502
+ const columns = this.detailEntity()?.columns?.map(c => c.name) ?? [];
503
+ const props = this.detailEntity()?.properties.filter(p => p.schema.hidden != true &&
504
+ (detailColumns?.length == 0 || detailColumns?.includes(p.name))) ?? [];
505
+ const displayColumns = props.filter(p => columns.some(c => c == p.name));
506
+ return displayColumns.map(p => {
507
+ return new AXPEntityListViewColumnViewModel(p, this.detailEntity()?.columns?.find(c => c.name == p.name));
509
508
  });
510
509
  }
511
510
  return [];
@@ -550,7 +549,7 @@ class AXPEntityDetailListViewModel {
550
549
  return {
551
550
  field: c.name,
552
551
  operator: c.operator,
553
- value: this.parent.data.id
552
+ value: this.parent.data?.id
554
553
  };
555
554
  }) ?? [];
556
555
  const parentFilterWrapper = {
@@ -586,37 +585,36 @@ class AXPEntityDetailListViewModel {
586
585
  }
587
586
 
588
587
  class AXPEntityMasterSingleViewGroupViewModel {
589
- constructor(entity, group) {
588
+ constructor(entity, section) {
590
589
  this.entity = entity;
591
- this.group = group;
590
+ this.section = section;
591
+ this.group = this.entity.groups?.find(c => c.id == this.section.id);
592
592
  this.name = signal(this.group.id);
593
593
  this.isLoading = signal(false);
594
594
  this.title = computed(() => {
595
- if (this.group.title)
596
- return this.group.title;
597
- return this.group.id;
595
+ return this.group.title ?? this.group.id;
598
596
  });
599
597
  this.description = computed(() => {
600
- if (this.group.description)
601
- return this.group.description;
602
- return null;
598
+ return this.group.description;
603
599
  });
604
600
  this.layout = computed(() => {
605
- const source = cloneDeep(this.group.layout ?? {});
601
+ const source = cloneDeep(this.section.layout ?? {});
606
602
  set(source, "positions.default.colSpan", 12);
607
603
  return source;
608
604
  });
609
605
  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 => {
612
- return new AXPEntityMasterSingleElementViewModel(this.entity, this, e);
613
- });
606
+ const { properties, interfaces } = this.entity;
607
+ const groupProperties = properties
608
+ .filter(({ groupId, schema }) => groupId === this.group.id && !schema.hidden)
609
+ .map(({ name }) => name);
610
+ const viewProperties = interfaces?.master?.single?.properties?.filter(({ name }) => groupProperties.includes(name)) ?? [];
611
+ return viewProperties.map(prop => new AXPEntityMasterSingleElementViewModel(this.entity, this, prop));
614
612
  });
615
613
  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);
617
- return props.map(e => {
618
- return new AXPEntityMasterSingleElementViewModel(this.entity, this, e);
619
- });
614
+ const { properties, interfaces } = this.entity;
615
+ const editablePropertyNames = interfaces?.master?.update?.properties?.map(({ name }) => name) ?? [];
616
+ const filteredProperties = properties.filter(({ groupId, schema, name }) => groupId === this.group.id && !schema.hidden && editablePropertyNames.includes(name));
617
+ return filteredProperties.map(prop => new AXPEntityMasterSingleElementViewModel(this.entity, this, prop));
620
618
  });
621
619
  this.editable = computed(() => {
622
620
  return this.editableProps().length > 0;
@@ -624,16 +622,17 @@ class AXPEntityMasterSingleViewGroupViewModel {
624
622
  }
625
623
  }
626
624
  class AXPEntityMasterSingleElementViewModel {
627
- constructor(entity, section, property) {
625
+ constructor(entity, section, propertyView) {
628
626
  this.entity = entity;
629
627
  this.section = section;
630
- this.property = property;
628
+ this.propertyView = propertyView;
629
+ this.property = this.entity.properties.find(c => c.name == this.propertyView.name);
631
630
  this.name = signal(this.property.name);
632
631
  this.title = signal(this.property.title);
633
632
  this.description = signal(this.property.description);
634
- this.order = signal(this.property.options?.view?.layout?.order ?? 0);
635
633
  this.layout = computed(() => {
636
- const source = cloneDeep(this.property.options?.view?.layout ?? {});
634
+ const viewProp = this.entity.interfaces?.master?.single?.properties?.find(c => c.name == this.property.name);
635
+ const source = cloneDeep(viewProp?.layout ?? {});
637
636
  set(source, "positions.default.colSpan", 12);
638
637
  return source;
639
638
  });
@@ -646,7 +645,9 @@ class AXPEntityMasterSingleElementViewModel {
646
645
  path: this.name(),
647
646
  children: widget.children,
648
647
  formula: widget.formula,
649
- options: merge(schema.interface?.options, this.property.options?.create?.widget, { validationRules: this.property.validations })
648
+ options: merge(schema.interface?.options,
649
+ //this.property.options?.create?.widget,
650
+ { validationRules: this.property.validations })
650
651
  };
651
652
  });
652
653
  }
@@ -661,6 +662,8 @@ class AXPEntityMasterSingleViewModel {
661
662
  this.session = this.injector.get(AXPSessionService);
662
663
  this.formatService = this.injector.get(AXFormatService);
663
664
  this.workflow = this.injector.get(AXPWorkflowService);
665
+ this.destroyed = new Subject();
666
+ this.events$ = new Subject();
664
667
  this.context = signal(cloneDeep(this.entityData));
665
668
  this.actions = computed(() => {
666
669
  return this.entityDef.interfaces?.master?.single?.actions?.map((tr) => new AXPEntityCommandTriggerViewModel(this.entityDef, tr)) ?? [];
@@ -672,12 +675,11 @@ class AXPEntityMasterSingleViewModel {
672
675
  return this.actions().filter(c => c.priority == 'secondary');
673
676
  });
674
677
  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));
677
- const result = groups?.map((section) => {
678
- return new AXPEntityMasterSingleViewGroupViewModel(this.entityDef, section);
679
- });
680
- return (result ?? []);
678
+ const { interfaces, properties } = this.entityDef;
679
+ const viewProps = interfaces?.master?.single?.properties?.map(({ name }) => name) ?? [];
680
+ const filteredProperties = properties.filter(({ groupId, schema, name }) => groupId && !schema.hidden && viewProps.includes(name));
681
+ const groups = interfaces?.master?.single?.sections?.filter(({ id }) => filteredProperties.some(({ groupId }) => groupId === id)) ?? [];
682
+ return groups.map(section => new AXPEntityMasterSingleViewGroupViewModel(this.entityDef, section));
681
683
  });
682
684
  //****************** Title ******************//
683
685
  this.title = computed(() => {
@@ -711,46 +713,42 @@ class AXPEntityMasterSingleViewModel {
711
713
  this.relatedEntities = computed(() => {
712
714
  return this.entityDef.relatedEntities?.map(re => new AXPEntityDetailListViewModel(this.injector, re, { entity: this.entityDef, data: this.entityData })) ?? [];
713
715
  });
714
- 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
- //}
727
- });
728
- 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);
716
+ this.workflow.events$
717
+ .pipe(ofType(AXPEntityDeletedEvent))
718
+ .pipe(takeUntil(this.destroyed))
719
+ .subscribe((event) => {
720
+ if (event.payload.entity == this.entityDef.source &&
721
+ event.payload.ids.includes(this.context().id)) {
722
+ this.workflow.execute('show-list-view', {
723
+ entity: this.entityDef.source
724
+ });
725
+ }
726
+ });
727
+ this.workflow.events$
728
+ .pipe(ofType(AXPEntityModifyEvent))
729
+ .pipe(takeUntil(this.destroyed))
730
+ .subscribe(async (event) => {
731
+ if (event.payload.entity == this.entityDef.source &&
732
+ event.payload.values.id === this.context().id) {
733
+ this.context.set(event.payload.values);
733
734
  }
734
735
  });
735
736
  }
736
737
  async executeCommand(commandName, data = null) {
737
- // debugger
738
738
  //TODO: syntact for workflow
739
739
  switch (commandName) {
740
740
  case 'delete-entity':
741
741
  this.workflow.execute('delete-entity', {
742
- module: this.entityDef.module,
743
- entity: this.entityDef.name,
744
- ids: [this.context().id],
742
+ entity: this.entityDef.source,
743
+ data: [this.context()],
745
744
  });
746
745
  break;
747
746
  case 'modify-entity-section': {
748
747
  this.workflow.execute('modify-entity-section', {
749
- payload: {
748
+ entity: this.entityDef.source,
749
+ data: {
750
+ id: this.context().id,
750
751
  properties: data.editableProps().map(m => m.name()),
751
- id: this.entityData.id,
752
- module: this.entityDef.module,
753
- entity: this.entityDef.name,
754
752
  },
755
753
  });
756
754
  break;
@@ -759,15 +757,18 @@ class AXPEntityMasterSingleViewModel {
759
757
  {
760
758
  const action = this.actions().find(c => c.name == commandName);
761
759
  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
- }
760
+ entity: this.entityDef.source,
761
+ data: action?.scope == AXPEntityCommandScope.Individual ? this.context() : null
767
762
  });
768
763
  }
769
764
  }
770
765
  }
766
+ //
767
+ //
768
+ destroy() {
769
+ this.destroyed.next();
770
+ this.destroyed.complete();
771
+ }
771
772
  }
772
773
  class AXPEntityDetailViewModelFactory {
773
774
  constructor() {
@@ -795,7 +796,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
795
796
  args: [{ providedIn: 'root' }]
796
797
  }] });
797
798
  const AXPEntityDetailViewModelResolver = (route, state, service = inject(AXPEntityDetailViewModelFactory)) => {
798
- const appName = route.parent?.paramMap.get('app');
799
799
  const moduleName = route.parent?.paramMap.get('module');
800
800
  const entityName = route.paramMap.get('entity');
801
801
  const id = route.paramMap.get('id');
@@ -804,52 +804,54 @@ const AXPEntityDetailViewModelResolver = (route, state, service = inject(AXPEnti
804
804
  };
805
805
 
806
806
  class AXPEntityCreateViewSectionViewModel {
807
- constructor(entity, group) {
807
+ constructor(entity, section) {
808
808
  this.entity = entity;
809
- this.group = group;
809
+ this.section = section;
810
+ this.group = this.entity.groups?.find(c => c.id == this.section.id);
810
811
  this.name = signal(this.group.id);
811
812
  this.title = computed(() => {
812
- if (this.group.title)
813
- return this.group.title;
814
- return this.group.id;
813
+ return this.group.title ?? this.group.id;
815
814
  });
816
815
  this.description = computed(() => {
817
- if (this.group.description)
818
- return this.group.description;
819
- return null;
816
+ return this.group.description;
817
+ ;
820
818
  });
821
819
  this.layout = computed(() => {
822
- const source = cloneDeep(this.group.layout ?? {});
820
+ const source = cloneDeep(this.section.layout ?? {});
823
821
  set(source, "positions.default.colSpan", 12);
824
822
  return source;
825
823
  });
826
824
  this.elements = computed(() => {
827
- const props = this.entity.properties.filter(c => c.groupId == this.group.id &&
828
- c.schema.hidden != true &&
829
- c.options?.create?.enabled != false);
830
- return props.map(e => {
831
- return new AXPEntityCreateViewElementViewModel(this.entity, this, e);
825
+ const { interfaces, properties } = this.entity;
826
+ const createProps = interfaces?.master?.create?.properties ?? [];
827
+ const createPropNames = new Set(createProps.map(({ name }) => name));
828
+ const filteredProperties = properties.filter(({ groupId, schema, name }) => groupId === this.group.id &&
829
+ !schema.hidden &&
830
+ createPropNames.has(name));
831
+ return filteredProperties.map(property => {
832
+ const createProp = createProps.find(({ name }) => name === property.name);
833
+ return new AXPEntityCreateViewElementViewModel(this.entity, this, property, createProp);
832
834
  });
833
835
  });
834
836
  }
835
837
  }
836
838
  class AXPEntityCreateViewElementViewModel {
837
- constructor(entity, section, property) {
839
+ constructor(entity, section, property, createProp) {
838
840
  this.entity = entity;
839
841
  this.section = section;
840
842
  this.property = property;
843
+ this.createProp = createProp;
841
844
  this.name = signal(this.property.name);
842
845
  this.title = signal(this.property.title);
843
846
  this.description = signal(this.property.description);
844
847
  this.editable = computed(() => {
845
848
  return !(this.property.schema.readonly ?? false);
846
849
  });
847
- this.order = signal(this.property.options?.view?.layout?.order ?? 0);
848
850
  this.isRequired = computed(() => {
849
851
  return this.property.validations?.some(c => c.rule == 'required') || false;
850
852
  });
851
853
  this.layout = computed(() => {
852
- const source = cloneDeep(this.property.options?.create?.layout ?? this.property.options?.view?.layout ?? {});
854
+ const source = cloneDeep(this.createProp.layout ?? {});
853
855
  set(source, "positions.default.colSpan", 12);
854
856
  return source;
855
857
  });
@@ -863,28 +865,43 @@ class AXPEntityCreateViewElementViewModel {
863
865
  children: widget.children,
864
866
  formula: widget.formula,
865
867
  triggers: widget.triggers,
866
- options: merge(schema.interface?.options, this.property.options?.create?.widget, { validationRules: this.property.validations })
868
+ options: merge(schema.interface?.options,
869
+ //this.property.options?.create?.widget,
870
+ { validationRules: this.property.validations })
867
871
  };
868
872
  });
869
873
  }
870
874
  }
871
875
  class AXPEntityMasterCreateViewModel {
872
- constructor(injector, config, initialData = null) {
876
+ constructor(injector, config, initialData = {}) {
873
877
  this.injector = injector;
874
878
  this.config = config;
875
879
  this.initialData = initialData;
876
880
  this.entityDef = cloneDeep(this.config);
877
881
  this.workflow = this.injector.get(AXPWorkflowService);
878
- this.context = signal({});
882
+ this.context = signal(this.initialData ?? {});
879
883
  this.isInProgress = signal(false);
880
884
  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));
883
- const result = groups?.map((section) => {
884
- return new AXPEntityCreateViewSectionViewModel(this.entityDef, section);
885
- });
886
- return (result ?? []);
885
+ const { interfaces, properties } = this.entityDef;
886
+ const createProps = interfaces?.master?.create?.properties?.map(({ name }) => name) ?? [];
887
+ const visibleProperties = properties.filter(({ groupId, schema, name }) => groupId && !schema.hidden && createProps.includes(name));
888
+ const sections = interfaces?.master?.create?.sections?.filter(({ id }) => visibleProperties.some(({ groupId }) => groupId === id)) ?? [];
889
+ return sections.map(section => new AXPEntityCreateViewSectionViewModel(this.entityDef, section));
890
+ });
891
+ if (!initialData)
892
+ initialData = {};
893
+ this.config.properties
894
+ .filter(c => c.schema.defaultValue != null)
895
+ .forEach(p => {
896
+ if (typeof p.schema.defaultValue === 'function') {
897
+ const func = p.schema.defaultValue;
898
+ set(initialData, p.name, func(initialData));
899
+ }
900
+ else {
901
+ set(initialData, p.name, p.schema.defaultValue);
902
+ }
887
903
  });
904
+ this.context.set(initialData);
888
905
  }
889
906
  async save() {
890
907
  try {
@@ -946,6 +963,8 @@ class AXPEntityMasterListViewModel {
946
963
  this.formatService = this.injector.get(AXFormatService);
947
964
  this.session = this.injector.get(AXPSessionService);
948
965
  this.workflow = this.injector.get(AXPWorkflowService);
966
+ this.destroyed = new Subject();
967
+ this.events$ = new Subject();
949
968
  this.dataSource = new AXDataSource({
950
969
  byKey: (key) => {
951
970
  const func = this.entityDef.queries.byKey.execute;
@@ -1020,9 +1039,14 @@ class AXPEntityMasterListViewModel {
1020
1039
  };
1021
1040
  //****************** Columns ******************//
1022
1041
  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);
1042
+ const { columns = [], properties } = this.entityDef;
1043
+ const visibleProperties = properties.filter(({ schema }) => !schema?.hidden);
1044
+ const visiblePropNames = new Set(visibleProperties.map(({ name }) => name));
1045
+ return columns
1046
+ .filter(({ name }) => visiblePropNames.has(name))
1047
+ .map(column => {
1048
+ const property = visibleProperties.find(({ name }) => name === column.name);
1049
+ return new AXPEntityListViewColumnViewModel(property, column);
1026
1050
  });
1027
1051
  };
1028
1052
  this.visibleColumnCount = () => {
@@ -1060,6 +1084,16 @@ class AXPEntityMasterListViewModel {
1060
1084
  });
1061
1085
  });
1062
1086
  this.view = signal(this.views()[0]);
1087
+ this.workflow.events$
1088
+ .pipe(ofType(AXPEntityDeletedEvent))
1089
+ .pipe(takeUntil(this.destroyed))
1090
+ .subscribe((event) => {
1091
+ debugger;
1092
+ if (event.payload.entity == this.entityDef.source) {
1093
+ this.selectedItems.set([]);
1094
+ this.events$.next({ action: "refresh" });
1095
+ }
1096
+ });
1063
1097
  }
1064
1098
  clearSelection() {
1065
1099
  this.selectedItems.set([]);
@@ -1085,9 +1119,14 @@ class AXPEntityMasterListViewModel {
1085
1119
  //
1086
1120
  this.dataSource.sort(...this.sortedFields().map(s => ({ dir: s.dir, field: s.name })));
1087
1121
  //
1122
+ this.advanceFilters.filters = this.view().conditions.map(f => ({
1123
+ field: f.name,
1124
+ operator: f.operator,
1125
+ value: f.value
1126
+ }));
1127
+ //
1088
1128
  const inline = this.inlineFilters.filters?.length ?? 0;
1089
1129
  const advance = this.advanceFilters.filters?.length ?? 0;
1090
- debugger;
1091
1130
  if (inline && !advance) {
1092
1131
  this.dataSource.filter(this.inlineFilters);
1093
1132
  }
@@ -1115,8 +1154,10 @@ class AXPEntityMasterListViewModel {
1115
1154
  const cols = this.view().columns;
1116
1155
  const cloned = this.allAvailableColumns()
1117
1156
  .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);
1157
+ const column = this.entityDef.columns?.find(cc => cc.name == c.name);
1158
+ const prop = this.entityDef.properties.find(p => p.name == c.name);
1159
+ const col = new AXPEntityListViewColumnViewModel(prop, column);
1160
+ col.visible = !cols.some(c => c == col.name) && col.visible != false;
1120
1161
  return col;
1121
1162
  });
1122
1163
  this.columns.set(cloned);
@@ -1155,16 +1196,17 @@ class AXPEntityMasterListViewModel {
1155
1196
  }
1156
1197
  //****************** Commands ******************//
1157
1198
  async executeCommand(commandName, data = null) {
1158
- // debugger
1159
1199
  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
- }
1200
+ await this.workflow.execute(commandName, {
1201
+ entity: this.entityDef.source,
1202
+ data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data
1166
1203
  });
1167
1204
  }
1205
+ //
1206
+ destroy() {
1207
+ this.destroyed.next();
1208
+ this.destroyed.complete();
1209
+ }
1168
1210
  }
1169
1211
  class AXPEntityListViewModelFactory {
1170
1212
  constructor() {
@@ -1204,21 +1246,22 @@ class AXPEntityCreatePopupAction extends AXPWorkflowAction {
1204
1246
  this.config = inject(AXP_ENTITY_CONFIG_TOKEN);
1205
1247
  }
1206
1248
  async execute(context) {
1207
- const { module, entity: entity } = context.getVariable('payload');
1249
+ const [module, entity] = context.getVariable('entity').split(".");
1250
+ const data = context.getVariable('data');
1208
1251
  const entityRef = await this.entityRegistery.resolve(module, entity);
1209
1252
  const com = await this.config.viewers.master.create();
1210
1253
  const result = await this.popupService.open(com, {
1211
1254
  title: `Create New ${entityRef.formats.individual}`,
1212
1255
  size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : 'md',
1213
1256
  data: {
1214
- vm: await this.factory.create(module, entity),
1257
+ vm: await this.factory.create(module, entity, data),
1215
1258
  entity,
1216
1259
  },
1217
1260
  });
1261
+ context.setOutput('result', false);
1218
1262
  if (result.data?.save) {
1219
- context.setOutput('popupResult', true);
1220
- context.setVariable('redirect', result.data.redirect);
1221
- context.setVariable('id', result.data.recordId);
1263
+ context.setOutput('result', true);
1264
+ context.setVariable('data', result.data.item);
1222
1265
  }
1223
1266
  }
1224
1267
  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 +1272,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
1229
1272
  }] });
1230
1273
  class AXPEntityCreateSubmittedAction extends AXPWorkflowAction {
1231
1274
  async execute(context) {
1232
- const { module, entity: entity } = context.getVariable('payload');
1233
- this.dispatch(AXPEntityCreateEvent({ entity, module }));
1275
+ this.dispatch(AXPEntityCreateEvent({ entity: context.getVariable('entity') }));
1234
1276
  }
1235
1277
  }
1236
1278
  const AXPCreateEntityWorkflow = {
1237
- startStepId: 'createPopup',
1279
+ startStepId: 'show-popup',
1238
1280
  steps: {
1239
- createPopup: {
1240
- id: 'createPopup',
1281
+ "show-popup": {
1241
1282
  action: 'AXPEntityCreatePopupAction',
1242
1283
  nextSteps: [
1243
1284
  {
1244
- conditions: [{ type: 'SINGLE', expression: 'context.getOutput("popupResult") == true' }],
1245
- nextStepId: 'successToast',
1285
+ conditions: [{ type: 'SINGLE', expression: 'context.getOutput("result") == true' }],
1286
+ nextStepId: 'show-toast',
1246
1287
  },
1247
1288
  ],
1248
1289
  },
1249
- successToast: {
1250
- id: 'successToast',
1290
+ "show-toast": {
1251
1291
  action: 'AXPToastAction',
1252
1292
  input: {
1253
1293
  color: 'success',
@@ -1257,22 +1297,20 @@ const AXPCreateEntityWorkflow = {
1257
1297
  nextSteps: [
1258
1298
  {
1259
1299
  conditions: [],
1260
- nextStepId: 'createSubmitted',
1300
+ nextStepId: 'dispatch-event',
1261
1301
  },
1262
1302
  ],
1263
1303
  },
1264
- createSubmitted: {
1265
- id: 'createSubmitted',
1304
+ "dispatch-event": {
1266
1305
  action: 'AXPEntityCreateSubmittedAction',
1267
1306
  nextSteps: [
1268
1307
  {
1269
1308
  conditions: [{ type: 'SINGLE', expression: 'context.getVariable("redirect") == true' }],
1270
- nextStepId: 'showDetailView',
1309
+ nextStepId: 'show-entity',
1271
1310
  },
1272
1311
  ],
1273
1312
  },
1274
- showDetailView: {
1275
- id: 'showDetailView',
1313
+ "show-entity": {
1276
1314
  action: 'AXPShowDetailViewAction',
1277
1315
  },
1278
1316
  },
@@ -1285,8 +1323,8 @@ class AXPShowDetailViewAction extends AXPWorkflowAction {
1285
1323
  this.sessionService = inject(AXPSessionService);
1286
1324
  }
1287
1325
  async execute(context) {
1288
- const { module, entity, data } = context.getVariable('payload');
1289
- const id = data.id;
1326
+ const [module, entity] = context.getVariable('entity').split(".");
1327
+ const { id } = context.getVariable('data');
1290
1328
  const newPayload = {
1291
1329
  commands: `/${this.sessionService.application?.name}/m/${module}/e/${entity}/${id}/view`,
1292
1330
  };
@@ -1330,9 +1368,23 @@ var lookupWidgetView_component = /*#__PURE__*/Object.freeze({
1330
1368
  });
1331
1369
 
1332
1370
  class AXPLookupWidgetSelectorComponent extends AXBasePageComponent {
1371
+ // protected override ngOnInit(): void {
1372
+ // super.ngOnInit();
1373
+ // }
1374
+ ngAfterViewInit() {
1375
+ if (this.searchTerm) {
1376
+ this.vm.applyInlineFilter(this.searchTerm);
1377
+ }
1378
+ else {
1379
+ this.vm.applyFilterAndSort();
1380
+ }
1381
+ }
1333
1382
  handleRowDbClick(e) {
1334
1383
  this.close({ items: [e.data] });
1335
1384
  }
1385
+ handleRowClick(e) {
1386
+ this.focusedRow = e.data;
1387
+ }
1336
1388
  async handleSelectedRowsChange(rows) {
1337
1389
  //this.vm.selectedItems.set(rows);
1338
1390
  }
@@ -1341,19 +1393,31 @@ class AXPLookupWidgetSelectorComponent extends AXBasePageComponent {
1341
1393
  this.vm.applyInlineFilter(e.value);
1342
1394
  }
1343
1395
  }
1396
+ async handleCreateNewClick() {
1397
+ this.close();
1398
+ await this.vm.create();
1399
+ }
1400
+ handleCloseClick() {
1401
+ this.close();
1402
+ }
1403
+ handleSelectClick() {
1404
+ if (this.focusedRow) {
1405
+ this.close({ items: [this.focusedRow] });
1406
+ }
1407
+ }
1344
1408
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPLookupWidgetSelectorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1345
1409
  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
1410
  <div class="ax-p-4 ax-flex ax-flex-col ax-gap-4 ax-overflow-hidden">
1347
1411
  @if(vm.hasInlineFilters())
1348
1412
  {
1349
1413
  <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>
1414
+ <ax-search-box [placeholder]="'Search on '+vm.inlineFiltersPlaceholders().join(', ')" [value]="searchTerm"
1415
+ (onValueChanged)="handleChangeSearchValue($event)" [axAutoFocus]="true"><ax-clear-button></ax-clear-button></ax-search-box>
1352
1416
  </div>
1353
1417
  }
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)">
1418
+ <ax-data-table #grid [showFooter]="false" class="ax-h-[50vh]" [paging]="true" [fetchDataMode]="'manual'"
1419
+ [loading]="{ enabled: true, animation: true }" [dataSource]="vm.dataSource"
1420
+ (selectedRowsChange)="handleSelectedRowsChange($event)" (onRowClick)="handleRowClick($event)" (onRowDbClick)="handleRowDbClick($event)">
1357
1421
  <!-- <ax-select-column fixed="start" [width]="'50px'"></ax-select-column> -->
1358
1422
  @for(col of vm.columns();track col.name) {
1359
1423
  @if(col.visible)
@@ -1363,19 +1427,21 @@ class AXPLookupWidgetSelectorComponent extends AXBasePageComponent {
1363
1427
  }
1364
1428
  </ax-data-table>
1365
1429
  </div>
1366
- <!-- <ax-footer>
1430
+ <ax-footer>
1367
1431
  <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>
1432
+ <ax-button look="solid" color="ghost" text="Close" (onClick)="handleCloseClick()"> </ax-button>
1433
+ <ax-button look="solid" color="primary" text="Select" (onClick)="handleSelectClick()" [disabled]="focusedRow==null"> </ax-button>
1434
+ @if(!vm.canCreate())
1435
+ {
1436
+ <ax-button look="solid" color="primary" text="Create New" (onClick)="handleCreateNewClick()">
1437
+ <ax-prefix>
1438
+ <ax-icon icon="fa-solid fa-add"></ax-icon>
1439
+ </ax-prefix>
1440
+ </ax-button>
1441
+ }
1376
1442
  </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 }); }
1443
+ </ax-footer>
1444
+ `, 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
1445
  }
1380
1446
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPLookupWidgetSelectorComponent, decorators: [{
1381
1447
  type: Component,
@@ -1385,13 +1451,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
1385
1451
  @if(vm.hasInlineFilters())
1386
1452
  {
1387
1453
  <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>
1454
+ <ax-search-box [placeholder]="'Search on '+vm.inlineFiltersPlaceholders().join(', ')" [value]="searchTerm"
1455
+ (onValueChanged)="handleChangeSearchValue($event)" [axAutoFocus]="true"><ax-clear-button></ax-clear-button></ax-search-box>
1390
1456
  </div>
1391
1457
  }
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)">
1458
+ <ax-data-table #grid [showFooter]="false" class="ax-h-[50vh]" [paging]="true" [fetchDataMode]="'manual'"
1459
+ [loading]="{ enabled: true, animation: true }" [dataSource]="vm.dataSource"
1460
+ (selectedRowsChange)="handleSelectedRowsChange($event)" (onRowClick)="handleRowClick($event)" (onRowDbClick)="handleRowDbClick($event)">
1395
1461
  <!-- <ax-select-column fixed="start" [width]="'50px'"></ax-select-column> -->
1396
1462
  @for(col of vm.columns();track col.name) {
1397
1463
  @if(col.visible)
@@ -1401,29 +1467,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
1401
1467
  }
1402
1468
  </ax-data-table>
1403
1469
  </div>
1404
- <!-- <ax-footer>
1470
+ <ax-footer>
1405
1471
  <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>
1472
+ <ax-button look="solid" color="ghost" text="Close" (onClick)="handleCloseClick()"> </ax-button>
1473
+ <ax-button look="solid" color="primary" text="Select" (onClick)="handleSelectClick()" [disabled]="focusedRow==null"> </ax-button>
1474
+ @if(!vm.canCreate())
1475
+ {
1476
+ <ax-button look="solid" color="primary" text="Create New" (onClick)="handleCreateNewClick()">
1477
+ <ax-prefix>
1478
+ <ax-icon icon="fa-solid fa-add"></ax-icon>
1479
+ </ax-prefix>
1480
+ </ax-button>
1481
+ }
1414
1482
  </ax-suffix>
1415
- </ax-footer> -->
1483
+ </ax-footer>
1416
1484
  `,
1417
1485
  standalone: true,
1418
1486
  changeDetection: ChangeDetectionStrategy.OnPush,
1419
- imports: [CommonModule, AXDecoratorModule, AXDropdownButtonModule, AXDataTableModule, AXSearchBoxModule, AXPLayoutBuilderModule],
1487
+ imports: [
1488
+ CommonModule,
1489
+ AXCommonModule,
1490
+ AXButtonModule,
1491
+ AXFormModule,
1492
+ AXDecoratorModule,
1493
+ AXDropdownButtonModule,
1494
+ AXDataTableModule,
1495
+ AXSearchBoxModule,
1496
+ AXPLayoutBuilderModule
1497
+ ],
1420
1498
  inputs: []
1421
1499
  }]
1422
1500
  }] });
1423
1501
 
1424
1502
  class AXPLookupWidgetSelectorViewModel {
1425
- constructor(entityDef) {
1503
+ constructor(injector, entityDef, parentFilters = null) {
1504
+ this.injector = injector;
1426
1505
  this.entityDef = entityDef;
1506
+ this.parentFilters = parentFilters;
1507
+ this.workflow = this.injector.get(AXPWorkflowService);
1427
1508
  this.dataSource = new AXDataSource({
1428
1509
  byKey: (key) => {
1429
1510
  const func = this.entityDef.queries.byKey.execute;
@@ -1436,6 +1517,9 @@ class AXPLookupWidgetSelectorViewModel {
1436
1517
  pageSize: 10,
1437
1518
  key: 'id'
1438
1519
  });
1520
+ this.canCreate = computed(() => {
1521
+ return this.entityDef.commands?.create?.execute != null;
1522
+ });
1439
1523
  this.inlineFiltersPlaceholders = computed(() => {
1440
1524
  return this.entityDef.properties.filter(p => p.options?.filter?.inline?.enabled).map(c => c.title);
1441
1525
  });
@@ -1443,9 +1527,12 @@ class AXPLookupWidgetSelectorViewModel {
1443
1527
  return this.inlineFiltersPlaceholders().length > 0;
1444
1528
  });
1445
1529
  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);
1530
+ const listColumns = this.entityDef.columns ?? [];
1531
+ const columns = listColumns?.map(c => c.name) ?? [];
1532
+ const props = this.entityDef.properties.filter(p => p.schema.hidden != true);
1533
+ const displayColumns = props.filter(p => columns.some(c => c == p.name));
1534
+ return displayColumns.map(p => {
1535
+ return new AXPEntityListViewColumnViewModel(p, listColumns?.find(c => c.name == p.name));
1449
1536
  });
1450
1537
  };
1451
1538
  this.inlineFilters = {
@@ -1461,7 +1548,12 @@ class AXPLookupWidgetSelectorViewModel {
1461
1548
  filters: []
1462
1549
  };
1463
1550
  }
1464
- applyInlineFilter(value) {
1551
+ async create() {
1552
+ await this.workflow.execute('create-entity', {
1553
+ entity: this.entityDef.source,
1554
+ });
1555
+ }
1556
+ applyInlineFilter(value, refresh = true) {
1465
1557
  const props = this.entityDef.properties.filter(c => c.options?.filter?.inline?.enabled);
1466
1558
  this.inlineFilters.filters = [];
1467
1559
  if (value) {
@@ -1475,44 +1567,58 @@ class AXPLookupWidgetSelectorViewModel {
1475
1567
  });
1476
1568
  });
1477
1569
  }
1478
- this.applyFilterAndSort();
1570
+ if (refresh)
1571
+ this.applyFilterAndSort();
1479
1572
  }
1480
1573
  applyFilterAndSort() {
1481
1574
  this.dataSource.clearFilter();
1482
1575
  //
1483
1576
  //this.dataSource.sort(...this.sortedFields().map(s => ({ dir: s.dir, field: s.name } as AXDataSourceSortOption)));
1484
1577
  //
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);
1578
+ // Check if inlineFilters or parentFilters have any filters
1579
+ const hasInlineFilters = (this.inlineFilters?.filters?.length ?? 0) > 0;
1580
+ const hasParentFilters = (this.parentFilters?.filters?.length ?? 0) > 0;
1581
+ // Construct the filters array based on the presence of filters
1582
+ const filters = [];
1583
+ if (hasInlineFilters) {
1584
+ filters.push(this.inlineFilters);
1489
1585
  }
1490
- else if (!inline && advance) {
1491
- this.dataSource.filter(this.advanceFilters);
1586
+ if (hasParentFilters && this.parentFilters) {
1587
+ filters.push(this.parentFilters);
1492
1588
  }
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
- }
1501
- //
1589
+ // Apply the filters to the dataSource
1590
+ this.dataSource.filter({
1591
+ field: null,
1592
+ logic: 'and',
1593
+ operator: null,
1594
+ filters: filters
1595
+ });
1596
+ // Refresh the dataSource
1502
1597
  this.dataSource.refresh();
1503
1598
  }
1599
+ async find(value) {
1600
+ this.applyInlineFilter(value.trim(), false);
1601
+ const func = this.entityDef.queries.list?.execute;
1602
+ return await func({ filter: this.inlineFilters, take: 10 }) ?? [];
1603
+ }
1504
1604
  }
1505
1605
 
1506
1606
  class AXPLookupWidgetEditComponent extends AXPWidgetBase {
1507
1607
  constructor() {
1508
1608
  super(...arguments);
1509
- this.dataSource = [];
1510
1609
  this.textField = "title";
1610
+ this.validationRules = [];
1611
+ this.injector = inject(Injector);
1511
1612
  this.loader = inject(AXP_ENTITY_DEFINITION_LOADER);
1512
1613
  this.formatService = inject(AXFormatService);
1513
1614
  this.popupService = inject(AXPopupService);
1514
1615
  this.builderService = inject(AXPLayoutBuilderService);
1616
+ this.destroyRef = inject(DestroyRef);
1515
1617
  this.displayText = signal("");
1618
+ this.selectedItem = signal(null);
1619
+ this.searchTerm = signal(null);
1620
+ this.isLoading = signal(false);
1621
+ this.isOpen = signal(false);
1516
1622
  this.vm = signal(null);
1517
1623
  this.placeholder = computed(() => {
1518
1624
  return 'Search on ' + this.vm()?.inlineFiltersPlaceholders().join(', ');
@@ -1524,76 +1630,160 @@ class AXPLookupWidgetEditComponent extends AXPWidgetBase {
1524
1630
  const [module, entity] = this.entity.split('.');
1525
1631
  this.entityDef = await this.loader.get(module, entity);
1526
1632
  //
1527
- this.vm.set(new AXPLookupWidgetSelectorViewModel(this.entityDef));
1633
+ this.vm.set(new AXPLookupWidgetSelectorViewModel(this.injector, this.entityDef, this.filter));
1528
1634
  //
1529
1635
  this.textField = this.entityDef?.formats.lookup ?? this.entityDef?.properties.find(c => c.name != 'id')?.name ?? "title";
1530
1636
  const value = this.getValue();
1531
1637
  if (typeof value == 'object')
1532
1638
  this.displayText.set(this.formatService.format(this.textField, "string", value));
1533
1639
  else if (value != null) {
1534
- const byKey = this.entityDef?.queries.byKey?.execute;
1535
- const item = await byKey(this.getValue());
1536
- this.setItems(item);
1640
+ await this.findByValue();
1537
1641
  }
1642
+ //
1643
+ this.builderService
1644
+ .onChanged
1645
+ .pipe(takeUntilDestroyed(this.destroyRef))
1646
+ .subscribe(async (c) => {
1647
+ if (c.path == this.path) {
1648
+ if (this.getValue())
1649
+ await this.findByValue();
1650
+ }
1651
+ });
1652
+ }
1653
+ async findByValue() {
1654
+ const byKey = this.entityDef?.queries.byKey?.execute;
1655
+ const item = await byKey(this.getValue());
1656
+ this.setItems(item);
1538
1657
  }
1539
1658
  handleOnClick(e) {
1659
+ this.showSelector();
1660
+ }
1661
+ showSelector() {
1662
+ this.isOpen.set(true);
1540
1663
  this.popupService.open(AXPLookupWidgetSelectorComponent, {
1541
1664
  title: `${this.entityDef?.formats.plural} Lookup`,
1542
- size: 'md',
1665
+ size: (this.vm()?.columns().length ?? 0) > 3 ? 'lg' : 'md',
1543
1666
  data: {
1544
- vm: new AXPLookupWidgetSelectorViewModel(this.entityDef)
1667
+ vm: new AXPLookupWidgetSelectorViewModel(this.injector, this.entityDef, this.filter),
1668
+ searchTerm: this.searchTerm() == this.displayText() ? null : this.searchTerm()
1545
1669
  }
1546
1670
  }).then((e) => {
1671
+ this.isOpen.set(false);
1672
+ this.textbox.focus();
1547
1673
  if (e.data?.items) {
1548
1674
  this.setItems(e.data?.items[0]);
1549
1675
  }
1550
1676
  });
1551
1677
  }
1678
+ handleValueChange(e) {
1679
+ this.searchTerm.set(e.value);
1680
+ }
1681
+ handleOnBlur(e) {
1682
+ const com = e.component;
1683
+ const input = com['input'].nativeElement;
1684
+ setTimeout(() => {
1685
+ if (this.selectedItem()) {
1686
+ input.value = this.displayText();
1687
+ }
1688
+ else {
1689
+ if (!this.isOpen()) {
1690
+ input.value = '';
1691
+ this.searchTerm.set(null);
1692
+ }
1693
+ }
1694
+ }, 100);
1695
+ }
1696
+ async handleKeyDown(e) {
1697
+ const keyEvent = e.nativeEvent;
1698
+ const value = this.searchTerm()?.trim();
1699
+ if ((keyEvent.code == "Enter" || keyEvent.code == "NumpadEnter") && value) {
1700
+ this.isLoading.set(true);
1701
+ const result = await this.vm()?.find(value);
1702
+ if (result?.total == 1) {
1703
+ this.setItems(result.items[0]);
1704
+ }
1705
+ else {
1706
+ this.showSelector();
1707
+ }
1708
+ this.isLoading.set(false);
1709
+ }
1710
+ }
1552
1711
  setItems(item) {
1712
+ this.searchTerm.set(null);
1713
+ this.displayText.set('');
1714
+ this.selectedItem.set(item);
1553
1715
  const text = this.formatService.format(this.textField, "string", item);
1554
1716
  this.displayText.set(text);
1555
1717
  this.setValue(item.id);
1556
1718
  if (this.expose) {
1557
- this.builderService.setValue(this.expose, item);
1719
+ if (typeof this.expose == 'string') {
1720
+ this.builderService.setValue(this.expose, item);
1721
+ }
1722
+ else if (Array.isArray(this.expose)) {
1723
+ this.expose.forEach(i => {
1724
+ if (typeof i == "string") {
1725
+ this.builderService.setValue(i, item);
1726
+ }
1727
+ else {
1728
+ const key = get(item, i.source);
1729
+ this.builderService.setValue(i.target, key);
1730
+ }
1731
+ });
1732
+ }
1558
1733
  }
1559
1734
  }
1735
+ handleClearClick() {
1736
+ this.clear();
1737
+ this.setValue(null);
1738
+ }
1739
+ clear() {
1740
+ this.searchTerm.set('');
1741
+ this.displayText.set('');
1742
+ this.selectedItem.set(null);
1743
+ }
1560
1744
  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()">
1745
+ 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: `
1746
+ <ax-text-box [ngModel]="displayText()" (onValueChanged)="handleValueChange($event)" [placeholder]="placeholder()" (onKeyUp)="handleKeyDown($event)" (onBlur)="handleOnBlur($event)">
1747
+ @for (validation of validationRules; track $index) {
1748
+ <ax-validation-rule [rule]="validation.rule" [message]="validation.options?.message" [options]="validation.options"></ax-validation-rule>
1749
+ }
1750
+ <ax-clear-button (click)="handleClearClick()"></ax-clear-button>
1751
+
1571
1752
  <ax-suffix>
1572
- <ax-button color="ghost" look="twotone" (onClick)="handleOnClick($event)">
1573
- <ax-icon icon="far fa-search">
1574
- </ax-icon>
1753
+ <ax-button color="ghost" look="twotone" [disabled]="isLoading()" (onClick)="handleOnClick($event)">
1754
+ @if(isLoading())
1755
+ {
1756
+ <ax-loading></ax-loading>
1757
+ }
1758
+ @else {
1759
+ <ax-icon icon="far fa-search">
1760
+ </ax-icon>
1761
+ }
1575
1762
  </ax-button>
1576
1763
  </ax-suffix>
1577
1764
  </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 }); }
1765
+ `, 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.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: 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
1766
  }
1580
1767
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPLookupWidgetEditComponent, decorators: [{
1581
1768
  type: Component,
1582
1769
  args: [{
1583
1770
  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()">
1771
+ <ax-text-box [ngModel]="displayText()" (onValueChanged)="handleValueChange($event)" [placeholder]="placeholder()" (onKeyUp)="handleKeyDown($event)" (onBlur)="handleOnBlur($event)">
1772
+ @for (validation of validationRules; track $index) {
1773
+ <ax-validation-rule [rule]="validation.rule" [message]="validation.options?.message" [options]="validation.options"></ax-validation-rule>
1774
+ }
1775
+ <ax-clear-button (click)="handleClearClick()"></ax-clear-button>
1776
+
1593
1777
  <ax-suffix>
1594
- <ax-button color="ghost" look="twotone" (onClick)="handleOnClick($event)">
1595
- <ax-icon icon="far fa-search">
1596
- </ax-icon>
1778
+ <ax-button color="ghost" look="twotone" [disabled]="isLoading()" (onClick)="handleOnClick($event)">
1779
+ @if(isLoading())
1780
+ {
1781
+ <ax-loading></ax-loading>
1782
+ }
1783
+ @else {
1784
+ <ax-icon icon="far fa-search">
1785
+ </ax-icon>
1786
+ }
1597
1787
  </ax-button>
1598
1788
  </ax-suffix>
1599
1789
  </ax-text-box>
@@ -1606,11 +1796,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
1606
1796
  AXSelectBoxModule,
1607
1797
  AXTextBoxModule,
1608
1798
  AXButtonModule,
1609
- AXDecoratorModule
1799
+ AXDecoratorModule,
1800
+ AXLoadingModule,
1801
+ AXValidationModule,
1802
+ AXFormModule
1610
1803
  ],
1611
1804
  inputs: ["entity", "conditions", "expose"]
1612
1805
  }]
1613
- }] });
1806
+ }], propDecorators: { textbox: [{
1807
+ type: ViewChild,
1808
+ args: [AXTextBoxComponent]
1809
+ }] } });
1614
1810
 
1615
1811
  var lookupWidgetEdit_component = /*#__PURE__*/Object.freeze({
1616
1812
  __proto__: null,
@@ -1721,6 +1917,36 @@ const AXPLookupWidget = {
1721
1917
  }
1722
1918
  };
1723
1919
 
1920
+ class AXPShowListViewAction extends AXPWorkflowAction {
1921
+ constructor() {
1922
+ super(...arguments);
1923
+ this.navigation = inject(AXPWorkflowNavigateAction);
1924
+ this.sessionService = inject(AXPSessionService);
1925
+ }
1926
+ async execute(context) {
1927
+ const [moduleName, entityName] = context.getVariable('entity').split(".");
1928
+ const newPayload = {
1929
+ commands: `/${this.sessionService.application?.name}/m/${moduleName}/e/${entityName}/list`,
1930
+ };
1931
+ context.setVariable('payload', newPayload);
1932
+ this.navigation.execute(context);
1933
+ }
1934
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPShowListViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1935
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPShowListViewAction }); }
1936
+ }
1937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPShowListViewAction, decorators: [{
1938
+ type: Injectable
1939
+ }] });
1940
+ const AXPShowListViewWorkflow = {
1941
+ startStepId: 'showListView',
1942
+ steps: {
1943
+ showListView: {
1944
+ id: 'showListView',
1945
+ action: 'AXPShowListViewAction',
1946
+ },
1947
+ },
1948
+ };
1949
+
1724
1950
  function routesFacory() {
1725
1951
  const config = inject(AXP_ENTITY_CONFIG_TOKEN);
1726
1952
  let routes = [];
@@ -1773,7 +1999,7 @@ function routesFacory() {
1773
1999
  }
1774
2000
  class AXPEntityModule {
1775
2001
  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] }); }
2002
+ 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
2003
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AXPEntityModule, providers: [
1778
2004
  {
1779
2005
  provide: ROUTES,
@@ -1785,15 +2011,19 @@ class AXPEntityModule {
1785
2011
  actions: {
1786
2012
  AXPEntityCreatePopupAction,
1787
2013
  AXPEntityPerformDeleteAction,
2014
+ "entity-perform-delete": AXPEntityPerformDeleteAction,
1788
2015
  AXPEntityModifySectionPopupAction,
1789
2016
  AXPEntityModifyConfirmedAction,
1790
- AXPShowDetailViewAction
2017
+ AXPShowDetailViewAction,
2018
+ AXPEntityCreateSubmittedAction,
2019
+ AXPShowListViewAction
1791
2020
  },
1792
2021
  workflows: {
1793
2022
  'create-entity': AXPCreateEntityWorkflow,
1794
2023
  'delete-entity': AXPDeleteEntityWorkflow,
1795
2024
  'modify-entity-section': AXPModifyEntitySectionWorkflow,
1796
2025
  'open-entity': AXPShowDetailsViewWorkflow,
2026
+ 'show-list-view': AXPShowListViewWorkflow
1797
2027
  },
1798
2028
  }),
1799
2029
  AXPLayoutBuilderModule.forChild({
@@ -1811,15 +2041,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
1811
2041
  actions: {
1812
2042
  AXPEntityCreatePopupAction,
1813
2043
  AXPEntityPerformDeleteAction,
2044
+ "entity-perform-delete": AXPEntityPerformDeleteAction,
1814
2045
  AXPEntityModifySectionPopupAction,
1815
2046
  AXPEntityModifyConfirmedAction,
1816
- AXPShowDetailViewAction
2047
+ AXPShowDetailViewAction,
2048
+ AXPEntityCreateSubmittedAction,
2049
+ AXPShowListViewAction
1817
2050
  },
1818
2051
  workflows: {
1819
2052
  'create-entity': AXPCreateEntityWorkflow,
1820
2053
  'delete-entity': AXPDeleteEntityWorkflow,
1821
2054
  'modify-entity-section': AXPModifyEntitySectionWorkflow,
1822
2055
  'open-entity': AXPShowDetailsViewWorkflow,
2056
+ 'show-list-view': AXPShowListViewWorkflow
1823
2057
  },
1824
2058
  }),
1825
2059
  AXPLayoutBuilderModule.forChild({