@zohodesk/library-platform 1.1.0-exp.2 → 1.1.1

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 (287) hide show
  1. package/README.md +2 -2
  2. package/es/bc/list-selection/Constants.js +8 -1
  3. package/es/bc/list-selection/Properties.js +6 -2
  4. package/es/bc/{zdata-broker → zdata-source}/Actions.js +6 -6
  5. package/es/bc/{zdata-broker → zdata-source}/Constants.js +6 -5
  6. package/es/bc/zdata-source/EventHandlers.js +2 -0
  7. package/es/bc/zdata-source/Symbols.js +5 -0
  8. package/es/bc/zfield/ActionHandlers.js +1 -1
  9. package/es/bc/zlist/EventHandlers.js +1 -1
  10. package/es/bc/zlist/Properties.js +25 -32
  11. package/es/cc/action-icon/Properties.js +31 -0
  12. package/es/cc/action-location/Properties.js +9 -24
  13. package/es/cc/table-connected/Properties.js +11 -57
  14. package/es/cc/table-connected/constants/Events.js +7 -0
  15. package/es/cc/table-connected/constants/index.js +1 -0
  16. package/es/cc/table-connected/index.js +4 -0
  17. package/es/cc/table-list/Properties.js +44 -2
  18. package/es/cc/table-list/data-types/Header.js +6 -0
  19. package/es/desk-frameworks/table-connected/frameworks/EventHandlersFactory.js +33 -1
  20. package/es/desk-frameworks/table-connected/frameworks/ListSdkFactory.js +118 -2
  21. package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +24 -9
  22. package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +7 -2
  23. package/es/library/behaviours/list-selection/adapters/controllers/AllSelectionController.js +5 -2
  24. package/es/library/behaviours/list-selection/adapters/controllers/DeselectController.js +26 -0
  25. package/es/library/behaviours/list-selection/adapters/controllers/RangeSelectionController.js +4 -2
  26. package/es/library/behaviours/list-selection/adapters/controllers/SelectController.js +26 -0
  27. package/es/library/behaviours/list-selection/adapters/controllers/SelectionController.js +4 -2
  28. package/es/library/behaviours/list-selection/adapters/gateways/Repository.js +3 -3
  29. package/es/library/behaviours/list-selection/adapters/gateways/Service.js +8 -0
  30. package/es/library/behaviours/list-selection/applications/usecases/AllItemSelection.js +5 -1
  31. package/es/library/behaviours/list-selection/applications/usecases/Deselect.js +21 -0
  32. package/es/library/behaviours/list-selection/applications/usecases/ItemsSelection.js +3 -1
  33. package/es/library/behaviours/list-selection/applications/usecases/RangeSelection.js +3 -1
  34. package/es/library/behaviours/list-selection/applications/usecases/Select.js +21 -0
  35. package/es/library/behaviours/list-selection/domain/entities/ListItemSelection.js +86 -28
  36. package/es/library/behaviours/list-selection/frameworks/ActionHandlerFactory.js +5 -1
  37. package/es/library/custom-component/domain/entities/{Events.js → Event.js} +12 -3
  38. package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +4 -2
  39. package/es/library/dot/components/table-list/adapters/presenters/TableTranslator.js +9 -4
  40. package/es/library/dot/components/table-list/frameworks/ui/TableList.js +1 -2
  41. package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +3 -2
  42. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +5 -2
  43. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +16 -3
  44. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/SelectAll.js +2 -1
  45. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +6 -4
  46. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +16 -3
  47. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +1 -2
  48. package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon.js +18 -2
  49. package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +75 -1
  50. package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupFieldView.js +7 -6
  51. package/es/platform/client-actions/Readme.md +31 -0
  52. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/Readme.md +14 -21
  53. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/ExecuteActionBehaviourUseCase.js +1 -1
  54. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/InitializeUseCase.js +2 -2
  55. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientAction.js +12 -4
  56. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientActionManager.js +9 -9
  57. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/ClientActions.js +0 -4
  58. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/EventMapping.js +5 -1
  59. package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/UIComponentMapping.js +7 -3
  60. package/es/platform/{zclient-actions/frameworks/ClientActionBehaviourFactory.js → client-actions/behaviour/zclient-actions/frameworks/ClientActionsBehaviourFactory.js} +1 -1
  61. package/es/platform/client-actions/cc/action-event-mediator/Properties.js +34 -0
  62. package/es/platform/client-actions/cc/dynamic-action-component/Properties.js +51 -0
  63. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/MountController.js +18 -0
  64. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/PropertiesChangeController.js +26 -0
  65. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/UnmountController.js +18 -0
  66. package/es/platform/client-actions/components/action-event-mediator/adapters/gateway/Repository.js +36 -0
  67. package/es/platform/client-actions/components/action-event-mediator/adapters/presenters/Presenter.js +22 -0
  68. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/AbstractUseCase.js +15 -0
  69. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/DestroyUseCase.js +13 -0
  70. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/InitializeUseCase.js +13 -0
  71. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/PropertiesChangeUseCase.js +17 -0
  72. package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +108 -0
  73. package/es/platform/client-actions/components/action-event-mediator/domain/entities/interfaces/IState.js +1 -0
  74. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator.js +13 -0
  75. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediatorView.js +19 -0
  76. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +30 -0
  77. package/es/platform/client-actions/components/dynamic-component/domain/entities/interfaces/IState.js +1 -0
  78. package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponent.js +9 -0
  79. package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +34 -0
  80. package/es/platform/client-actions/components/interfaces/ActionViewModel.js +7 -0
  81. package/es/platform/client-actions/components/interfaces/EventMappingViewModel.js +0 -0
  82. package/es/platform/client-actions/components/row-actions-renderer/domain/entities/interfaces/IState.js +1 -0
  83. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.js +12 -0
  84. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +17 -0
  85. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +30 -0
  86. package/es/platform/client-actions/template-resolver/index.js +44 -0
  87. package/es/platform/client-actions/template-resolver/interfaces/ITemplate.js +1 -0
  88. package/es/platform/client-actions/translators/client-actions-translator/index.js +29 -0
  89. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEmptyString.js +4 -0
  90. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEndsWith.js +4 -0
  91. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEquals.js +4 -0
  92. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalGreaterThan.js +4 -0
  93. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalGreaterThanOrEquals.js +4 -0
  94. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIn.js +4 -0
  95. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIsEmpty.js +4 -0
  96. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIsNotEmpty.js +4 -0
  97. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLessThan.js +4 -0
  98. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLessThanOrEquals.js +4 -0
  99. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLike.js +4 -0
  100. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalNotEquals.js +4 -0
  101. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalNotLike.js +4 -0
  102. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalStartsWith.js +4 -0
  103. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/GetResolvedContextFieldValue.js +8 -0
  104. package/es/platform/client-actions/translators/condition-resolver/field-evaluators/index.js +58 -0
  105. package/es/platform/client-actions/translators/condition-resolver/index.js +33 -0
  106. package/es/platform/client-actions/translators/condition-resolver/pattern-evaluator/PatternValidator.js +86 -0
  107. package/es/platform/client-actions/translators/condition-resolver/pattern-evaluator/index.js +96 -0
  108. package/es/platform/client-actions/translators/context-resolver/index.js +54 -0
  109. package/es/platform/client-actions/translators/interfaces/IContext.js +1 -0
  110. package/es/platform/client-actions/translators/interfaces/IState.js +1 -0
  111. package/es/platform/data-source/dbc/index.js +1 -0
  112. package/es/platform/{data-broker → data-source}/http-template/getAvailableFields.js +5 -5
  113. package/es/platform/{data-broker → data-source}/http-template/getClientActions.js +4 -4
  114. package/es/platform/{data-broker → data-source}/http-template/getSelectedFields.js +5 -5
  115. package/es/platform/{data-broker → data-source}/index.js +2 -2
  116. package/es/platform/{data-broker → data-source}/utils/transformer/CreateCf.js +1 -1
  117. package/es/platform/{zdata-broker/adapters/controllers/DataBrokerExecutorController.js → zdata-source/adapters/controllers/DataSourceExecutorController.js} +1 -1
  118. package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Repository.js +5 -5
  119. package/es/platform/{zdata-broker → zdata-source}/adapters/presenters/Presenter.js +4 -4
  120. package/es/platform/{zdata-broker/applications/entities-factory/DataBrokerFactory.js → zdata-source/applications/entities-factory/DataSourceFactory.js} +3 -4
  121. package/es/platform/zdata-source/applications/interfaces/InputDependencies.js +1 -0
  122. package/es/platform/zdata-source/applications/interfaces/gateways/IRepository.js +1 -0
  123. package/es/platform/zdata-source/applications/interfaces/gateways/IService.js +0 -0
  124. package/es/platform/zdata-source/applications/interfaces/gateways/State.js +1 -0
  125. package/es/platform/zdata-source/applications/interfaces/input/ExecuteActionInputModel.js +1 -0
  126. package/es/platform/zdata-source/applications/interfaces/input/FailureInputModel.js +1 -0
  127. package/es/platform/zdata-source/applications/interfaces/input/NoContentInputModel.js +1 -0
  128. package/es/platform/zdata-source/applications/interfaces/input/RegisterInputModel.js +1 -0
  129. package/es/platform/zdata-source/applications/interfaces/input/SuccessInputModel.js +1 -0
  130. package/es/platform/zdata-source/applications/interfaces/output/IPresenter.js +1 -0
  131. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/ExecuteActionUseCase.js +3 -3
  132. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/FailureUseCase.js +3 -3
  133. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/NoContentUseCase.js +3 -3
  134. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/SuccessUseCase.js +4 -4
  135. package/es/platform/{zdata-broker/domain/entities/DataBroker.js → zdata-source/domain/entities/DataSource.js} +12 -12
  136. package/es/platform/zdata-source/domain/entities/interfaces/APIDetailsModel.js +1 -0
  137. package/es/platform/zdata-source/domain/entities/interfaces/APITemplateModel.js +1 -0
  138. package/es/platform/zdata-source/domain/entities/interfaces/APITemplatesModel.js +1 -0
  139. package/es/platform/zdata-source/domain/entities/interfaces/BehaviourState.js +1 -0
  140. package/es/platform/zdata-source/domain/entities/interfaces/EventModel.js +1 -0
  141. package/es/platform/zdata-source/domain/entities/interfaces/IAPITemplate.js +1 -0
  142. package/es/platform/zdata-source/domain/entities/interfaces/IAPITemplates.js +1 -0
  143. package/es/platform/zdata-source/domain/entities/interfaces/IDataSource.js +0 -0
  144. package/es/platform/zdata-source/domain/entities/interfaces/ITemplateHelpers.js +1 -0
  145. package/es/platform/zdata-source/domain/entities/interfaces/MetaData.js +1 -0
  146. package/es/platform/{zdata-broker → zdata-source}/frameworks/DataBrokerBehaviourFactory.js +2 -2
  147. package/es/platform/{zdata-broker → zdata-source}/frameworks/EventHandlersFactory.js +7 -12
  148. package/es/platform/zfield/applications/usecases/ExecuteActionUseCase.js +1 -1
  149. package/es/platform/zfield/applications/usecases/InitializeUseCase.js +2 -2
  150. package/es/platform/zfield/applications/usecases/RefetchUseCase.js +1 -1
  151. package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +5 -5
  152. package/es/platform/zfield/frameworks/ActionHandlerFactory.js +4 -4
  153. package/es/platform/zlist/adapters/controllers/DeleteSuccessController.js +25 -0
  154. package/es/platform/zlist/adapters/controllers/UpdateSuccessController.js +25 -0
  155. package/es/platform/zlist/adapters/gateways/Repository.js +11 -10
  156. package/es/platform/zlist/adapters/gateways/Service.js +8 -0
  157. package/es/platform/zlist/adapters/presenters/TableTranslator.js +47 -34
  158. package/es/platform/zlist/adapters/presenters/translators/ColumnSizeTranslator.js +2 -2
  159. package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +16 -8
  160. package/es/platform/zlist/adapters/presenters/translators/Header.js +7 -2
  161. package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +4 -2
  162. package/es/platform/zlist/adapters/presenters/translators/Row.js +10 -6
  163. package/es/platform/zlist/adapters/presenters/translators/RowActionTranslator.js +6 -6
  164. package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +7 -5
  165. package/es/platform/zlist/adapters/presenters/translators/actions/ActionsTranslator.js +89 -0
  166. package/es/platform/zlist/adapters/presenters/translators/interfaces/Context.js +1 -0
  167. package/es/platform/zlist/adapters/presenters/translators/interfaces/FieldComponentMapping.js +1 -0
  168. package/es/platform/zlist/applications/entities-factory/ListFactory.js +3 -3
  169. package/es/platform/zlist/applications/usecases/DeleteSuccessUseCase.js +19 -0
  170. package/es/platform/zlist/applications/usecases/UpdateSuccessUseCase.js +19 -0
  171. package/es/platform/zlist/domain/entities/List.js +50 -11
  172. package/es/platform/zlist/frameworks/EventHandlersFactory.js +17 -23
  173. package/es/platform/zrecord/applications/usecases/ExecuteActionUseCase.js +1 -1
  174. package/es/platform/zrecord/applications/usecases/FetchMoreUseCase.js +1 -1
  175. package/es/platform/zrecord/applications/usecases/InitializeUseCase.js +2 -2
  176. package/es/platform/zrecord/applications/usecases/RefetchUseCase.js +1 -1
  177. package/es/platform/zrecord/domain/entities/RecordsManager.js +10 -10
  178. package/package.json +4 -3
  179. package/es/bc/zdata-broker/EventHandlers.js +0 -2
  180. package/es/bc/zdata-broker/Symbols.js +0 -5
  181. package/es/desk-frameworks/table-connected/frameworks/__tests__/TableConnectedFactory.spec.js +0 -453
  182. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getAvailableFields.js +0 -86
  183. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getRecords.js +0 -81
  184. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getSelectedFields.js +0 -32
  185. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/index.js +0 -11
  186. package/es/platform/zdata-broker/domain/entities/interfaces/MetaData.js +0 -1
  187. /package/es/bc/{zdata-broker → zdata-source}/Properties.js +0 -0
  188. /package/es/{platform/data-broker/dbc/index.js → library/behaviours/list-selection/applications/interfaces/input/DeselectInputModel.js} +0 -0
  189. /package/es/{platform/zclient-actions/applications/interfaces/InputDependencies.js → library/behaviours/list-selection/applications/interfaces/input/SelectInputModel.js} +0 -0
  190. /package/es/{platform/zclient-actions → library/custom-component}/domain/entities/interfaces/EventModel.js +0 -0
  191. /package/es/{bc → platform/client-actions/bc}/zclient-actions/Constants.js +0 -0
  192. /package/es/{bc → platform/client-actions/bc}/zclient-actions/EventHandlers.js +0 -0
  193. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/AbstractController.js +0 -0
  194. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/ClientActionBehaviourExecutorController.js +0 -0
  195. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/FailureController.js +0 -0
  196. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/FetchStateStopController.js +0 -0
  197. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/MountController.js +0 -0
  198. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/NoContentController.js +0 -0
  199. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/SetClientActionsController.js +0 -0
  200. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/controllers/SuccessController.js +0 -0
  201. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/gateways/Repository.js +0 -0
  202. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/gateways/Service.js +0 -0
  203. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/adapters/presenters/Presenter.js +0 -0
  204. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/entities-factory/ClientActionFactory.js +0 -0
  205. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/entities-factory/ClientActionManagerFactory.js +0 -0
  206. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/ClientActionModel.js +0 -0
  207. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/ComponentPropertiesModel.js +0 -0
  208. /package/es/platform/{zclient-actions/applications/interfaces/gateways/IRepository.js → client-actions/behaviour/zclient-actions/applications/interfaces/ConditionFieldModel.js} +0 -0
  209. /package/es/platform/{zclient-actions/applications/interfaces/gateways/State.js → client-actions/behaviour/zclient-actions/applications/interfaces/ConditionModel.js} +0 -0
  210. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/EventMappingModel.js +0 -0
  211. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/IError.js +0 -0
  212. /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/applications/interfaces/InputDependencies.js +0 -0
  213. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/PayloadValueMappingModel.js +0 -0
  214. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/PropsMeta.js +0 -0
  215. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/StrategyMeta.js +0 -0
  216. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/UIComponentMappingModel.js +0 -0
  217. /package/es/platform/{zclient-actions/domain/entities → client-actions/behaviour/zclient-actions/applications}/interfaces/UserDetailsModel.js +0 -0
  218. /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/IRepository.js +0 -0
  219. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/IService.js +0 -0
  220. /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/State.js +0 -0
  221. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/ExecuteActionBehaviourInputModel.js +0 -0
  222. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/FailureInputModel.js +0 -0
  223. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/FetchStateStopInputModel.js +0 -0
  224. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/InitializeInputModel.js +0 -0
  225. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/NoContentInputModel.js +0 -0
  226. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/SetClientActionsInputModel.js +0 -0
  227. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/input/SuccessInputModel.js +0 -0
  228. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/interfaces/output/IPresenter.js +0 -0
  229. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/AbstractUseCase.js +0 -0
  230. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/FailureUseCase.js +0 -0
  231. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/FetchStateStopUseCase.js +0 -0
  232. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/NoContentUseCase.js +0 -0
  233. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/SetClientActionsUseCase.js +0 -0
  234. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/applications/usecases/SuccessUseCase.js +0 -0
  235. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/EventMappings.js +0 -0
  236. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/GetClientActionsStrategy.js +0 -0
  237. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/BehaviourState.js +0 -0
  238. /package/es/platform/{zclient-actions/domain/entities/interfaces/ClientActionsModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionModel.js} +0 -0
  239. /package/es/platform/{zclient-actions/domain/entities/interfaces/IAction.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionsModel.js} +0 -0
  240. /package/es/platform/{zclient-actions/domain/entities/interfaces/IEvent.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ComponentPropertiesModel.js} +0 -0
  241. /package/es/platform/{zclient-actions/domain/entities/interfaces/SubMeta.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ConditionFieldModel.js} +0 -0
  242. /package/es/platform/{zdata-broker/applications/interfaces/input/ExecuteActionInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ConditionModel.js} +0 -0
  243. /package/es/platform/{zdata-broker/applications/interfaces/input/FailureInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/EventMappingModel.js} +0 -0
  244. /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/EventModel.js +0 -0
  245. /package/es/platform/{zdata-broker/applications/interfaces/input/NoContentInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IAction.js} +0 -0
  246. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientAction.js +0 -0
  247. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActionExecuteStrategy.js +0 -0
  248. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActionManager.js +0 -0
  249. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IClientActions.js +0 -0
  250. /package/es/platform/{zdata-broker/applications/interfaces/input/RegisterInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IError.js} +0 -0
  251. /package/es/platform/{zdata-broker/applications/interfaces/input/SuccessInputModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IEvent.js} +0 -0
  252. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IEventMapping.js +0 -0
  253. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IEventMappings.js +0 -0
  254. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IPayload.js +0 -0
  255. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/domain/entities/interfaces/IUIComponentMapping.js +0 -0
  256. /package/es/platform/{zdata-broker/applications/interfaces/output/IPresenter.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/PayloadValueMappingModel.js} +0 -0
  257. /package/es/platform/{zdata-broker/domain/entities/interfaces/APIDetailsModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/PropsMeta.js} +0 -0
  258. /package/es/platform/{zdata-broker/domain/entities/interfaces/APITemplateModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/State.js} +0 -0
  259. /package/es/platform/{zdata-broker/domain/entities/interfaces/APITemplatesModel.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/StrategyMeta.js} +0 -0
  260. /package/es/platform/{zdata-broker/domain/entities/interfaces/BehaviourState.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/SubMeta.js} +0 -0
  261. /package/es/platform/{zdata-broker/domain/entities/interfaces/IAPITemplate.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/UIComponentMappingModel.js} +0 -0
  262. /package/es/platform/{zdata-broker/domain/entities/interfaces/IAPITemplates.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/UserDetailsModel.js} +0 -0
  263. /package/es/platform/{zclient-actions → client-actions/behaviour/zclient-actions}/frameworks/ActionsHandlersFactory.js +0 -0
  264. /package/es/platform/{zdata-broker/domain/entities/interfaces/ITemplateHelpers.js → client-actions/components/action-event-mediator/applications/interfaces/UseCaseDependencies.js} +0 -0
  265. /package/es/platform/{zdata-broker/applications/interfaces/gateways/IService.js → client-actions/components/action-event-mediator/applications/interfaces/gateways/IRepository.js} +0 -0
  266. /package/es/platform/{zlist/adapters/presenters/translators/interfaces/FieldUiMapping.js → client-actions/components/action-event-mediator/applications/interfaces/input/PropertiesChangeUseCaseInputModel.js} +0 -0
  267. /package/es/platform/{zdata-broker/domain/entities/interfaces/IDataBroker.js → client-actions/components/action-event-mediator/applications/interfaces/output/IPresenter.js} +0 -0
  268. /package/es/platform/{zlist/adapters/presenters/translators/interfaces/PageContext.js → client-actions/components/action-event-mediator/domain/entities/interfaces/IActionLocation.js} +0 -0
  269. /package/es/platform/{data-broker → data-source}/http-template/deleteRecord.js +0 -0
  270. /package/es/platform/{data-broker → data-source}/http-template/deleteRecords.js +0 -0
  271. /package/es/platform/{data-broker → data-source}/http-template/getRecords.js +0 -0
  272. /package/es/platform/{data-broker → data-source}/http-template/updateRecord.js +0 -0
  273. /package/es/platform/{data-broker → data-source}/utils/transformer/Transformer.js +0 -0
  274. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/AbstractController.js +0 -0
  275. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/FailureController.js +0 -0
  276. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/NoContentController.js +0 -0
  277. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/RegisterController.js +0 -0
  278. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/SuccessController.js +0 -0
  279. /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Service.js +0 -0
  280. /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/TemplateHelpers.js +0 -0
  281. /package/es/platform/{zdata-broker → zdata-source}/applications/entities-factory/APITemplatesFactory.js +0 -0
  282. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/gateways/ITemplateHelpers.js +0 -0
  283. /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/AbstractUseCase.js +0 -0
  284. /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/RegisterUseCase.js +0 -0
  285. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplate.js +0 -0
  286. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplates.js +0 -0
  287. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/ApiEnum.js +0 -0
@@ -9,14 +9,17 @@ export default class UIComponentMapping {
9
9
 
10
10
  _defineProperty(this, "component", void 0);
11
11
 
12
- _defineProperty(this, "properties", void 0);
12
+ _defineProperty(this, "propertiesValueMapping", void 0);
13
+
14
+ _defineProperty(this, "propertiesValueMappingMeta", void 0);
13
15
 
14
16
  _defineProperty(this, "eventMappings", void 0);
15
17
 
16
18
  this.id = uiComponentMappingObj.id;
17
19
  this.name = uiComponentMappingObj.name;
18
20
  this.component = uiComponentMappingObj.component;
19
- this.properties = uiComponentMappingObj.properties;
21
+ this.propertiesValueMapping = uiComponentMappingObj.propertiesValueMapping;
22
+ this.propertiesValueMappingMeta = uiComponentMappingObj.propertiesValueMapping;
20
23
  this.eventMappings = new EventMappings(uiComponentMappingObj.eventMappings);
21
24
  }
22
25
 
@@ -25,7 +28,8 @@ export default class UIComponentMapping {
25
28
  id: this.id,
26
29
  name: this.name,
27
30
  component: this.component,
28
- properties: this.properties,
31
+ propertiesValueMapping: this.propertiesValueMapping,
32
+ propertiesValueMappingMeta: this.propertiesValueMappingMeta,
29
33
  eventMappings: this.eventMappings.toArray().map(eventMapping => eventMapping.toObject())
30
34
  };
31
35
  }
@@ -1,5 +1,5 @@
1
1
  import ActionsHandlersFactory from "./ActionsHandlersFactory";
2
- export default class ClientActionBehaviourFactory {
2
+ export default class ClientActionsBehaviourFactory {
3
3
  static create(apiDetails) {
4
4
  return {
5
5
  name: 'zclientAction',
@@ -0,0 +1,34 @@
1
+ import { ActionViewGap } from "../../components/interfaces/ActionViewModel";
2
+ import { actionSchema } from "../dynamic-action-component/Properties";
3
+ export const actionsSchema = {
4
+ type: 'array',
5
+ minItems: 0,
6
+ items: actionSchema
7
+ };
8
+ export default {
9
+ actions: {
10
+ required: true,
11
+ typeMetadata: {
12
+ schema: actionsSchema
13
+ }
14
+ },
15
+ renderComponentType: {
16
+ required: false,
17
+ typeMetadata: {
18
+ schema: {
19
+ type: 'string'
20
+ }
21
+ },
22
+ defaultValue: ''
23
+ },
24
+ gap: {
25
+ required: false,
26
+ defaultValue: ActionViewGap.NONE,
27
+ typeMetadata: {
28
+ schema: {
29
+ type: 'string',
30
+ enum: Object.values(ActionViewGap)
31
+ }
32
+ }
33
+ }
34
+ };
@@ -0,0 +1,51 @@
1
+ export const actionSchema = {
2
+ type: 'object',
3
+ properties: {
4
+ component: {
5
+ type: 'string'
6
+ },
7
+ id: {
8
+ type: 'string'
9
+ },
10
+ properties: {
11
+ type: 'object'
12
+ },
13
+ eventMappings: {
14
+ type: 'array',
15
+ minItems: 0,
16
+ items: {
17
+ type: 'object',
18
+ properties: {
19
+ action: {
20
+ type: 'object',
21
+ properties: {
22
+ event: {
23
+ type: 'string'
24
+ },
25
+ payload: {
26
+ type: 'object'
27
+ }
28
+ },
29
+ required: ['event', 'payload']
30
+ },
31
+ id: {
32
+ type: 'string'
33
+ },
34
+ sourceEvent: {
35
+ type: 'string'
36
+ }
37
+ },
38
+ required: ['sourceEvent', 'id']
39
+ }
40
+ }
41
+ },
42
+ required: ['component', 'properties']
43
+ };
44
+ export default {
45
+ action: {
46
+ required: true,
47
+ typeMetadata: {
48
+ schema: actionSchema
49
+ }
50
+ }
51
+ };
@@ -0,0 +1,18 @@
1
+ export default class MountController {
2
+ constructor(initializeUseCase) {
3
+ this.initializeUseCase = initializeUseCase;
4
+ this.handle = this.handle.bind(this);
5
+ }
6
+
7
+ handle(input) {
8
+ const {
9
+ host,
10
+ dispatch,
11
+ state,
12
+ updateState
13
+ } = input;
14
+ this.initializeUseCase.updateDependencies(host, state, dispatch, updateState);
15
+ this.initializeUseCase.execute();
16
+ }
17
+
18
+ }
@@ -0,0 +1,26 @@
1
+ export default class PropertiesChangeController {
2
+ constructor(propertiesChangeUseCase) {
3
+ this.propertiesChangeUseCase = propertiesChangeUseCase;
4
+ this.handle = this.handle.bind(this);
5
+ }
6
+
7
+ handle(input) {
8
+ const {
9
+ host,
10
+ dispatch,
11
+ state,
12
+ action,
13
+ updateState
14
+ } = input;
15
+ const {
16
+ currentProperties,
17
+ previousProperties
18
+ } = action.payload;
19
+ this.propertiesChangeUseCase.updateDependencies(host, state, dispatch, updateState);
20
+ this.propertiesChangeUseCase.execute({
21
+ currentActions: currentProperties.actions,
22
+ previousActions: previousProperties.actions
23
+ });
24
+ }
25
+
26
+ }
@@ -0,0 +1,18 @@
1
+ export default class UnmountController {
2
+ constructor(destroyUseCase) {
3
+ this.destroyUseCase = destroyUseCase;
4
+ this.handle = this.handle.bind(this);
5
+ }
6
+
7
+ handle(input) {
8
+ const {
9
+ host,
10
+ dispatch,
11
+ state,
12
+ updateState
13
+ } = input;
14
+ this.destroyUseCase.updateDependencies(host, state, dispatch, updateState);
15
+ this.destroyUseCase.execute();
16
+ }
17
+
18
+ }
@@ -0,0 +1,36 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ import ActionEventMediatorEntity from "../../domain/entities/ActionEventMediatorEntity";
4
+ export default class Repository {
5
+ init(state) {
6
+ this.state = state;
7
+ }
8
+
9
+ constructor() {
10
+ _defineProperty(this, "element", void 0);
11
+
12
+ _defineProperty(this, "dispatch", void 0);
13
+
14
+ _defineProperty(this, "state", void 0);
15
+
16
+ this.element = null;
17
+ }
18
+
19
+ updateDependencies(element, state, dispatch) {
20
+ this.element = element;
21
+ this.dispatch = dispatch;
22
+ this.state = state;
23
+ }
24
+
25
+ getActionEventMediator() {
26
+ const {
27
+ actions
28
+ } = this.state.properties;
29
+ const {
30
+ handlers
31
+ } = this.state;
32
+ const actionEventMediator = new ActionEventMediatorEntity(handlers, actions, this.element, this.dispatch);
33
+ return actionEventMediator;
34
+ }
35
+
36
+ }
@@ -0,0 +1,22 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ export default class Presenter {
4
+ constructor() {
5
+ _defineProperty(this, "updateState", void 0);
6
+
7
+ _defineProperty(this, "state", void 0);
8
+ }
9
+
10
+ updateDependencies(state, updateState) {
11
+ this.updateState = updateState;
12
+ this.state = state;
13
+ }
14
+
15
+ updateActionEventMediator(newState) {
16
+ this.state = { ...this.state,
17
+ ...newState
18
+ };
19
+ this.updateState(this.state);
20
+ }
21
+
22
+ }
@@ -0,0 +1,15 @@
1
+ export class AbstractUseCase {
2
+ constructor(dependencies) {
3
+ this.dependencies = dependencies;
4
+ }
5
+
6
+ updateDependencies(element, state, dispatch, updateState) {
7
+ const {
8
+ repository,
9
+ presenter
10
+ } = this.dependencies;
11
+ repository.updateDependencies(element, state, dispatch);
12
+ presenter.updateDependencies(state, updateState);
13
+ }
14
+
15
+ }
@@ -0,0 +1,13 @@
1
+ import { AbstractUseCase } from "./AbstractUseCase";
2
+ export default class DestroyUseCase extends AbstractUseCase {
3
+ execute() {
4
+ const {
5
+ repository,
6
+ presenter
7
+ } = this.dependencies;
8
+ const actionLocation = repository.getActionEventMediator();
9
+ actionLocation.destroy();
10
+ presenter.updateActionEventMediator(actionLocation.toObject());
11
+ }
12
+
13
+ }
@@ -0,0 +1,13 @@
1
+ import { AbstractUseCase } from "./AbstractUseCase";
2
+ export default class InitializeUseCase extends AbstractUseCase {
3
+ execute() {
4
+ const {
5
+ repository,
6
+ presenter
7
+ } = this.dependencies;
8
+ const actionLocation = repository.getActionEventMediator();
9
+ actionLocation.initialize();
10
+ presenter.updateActionEventMediator(actionLocation.toObject());
11
+ }
12
+
13
+ }
@@ -0,0 +1,17 @@
1
+ import { AbstractUseCase } from "./AbstractUseCase";
2
+ export default class PropertiesChangeUseCase extends AbstractUseCase {
3
+ execute(input) {
4
+ const {
5
+ repository,
6
+ presenter
7
+ } = this.dependencies;
8
+ const actionLocation = repository.getActionEventMediator();
9
+ const {
10
+ currentActions,
11
+ previousActions
12
+ } = input;
13
+ actionLocation.processActionsChange(currentActions, previousActions);
14
+ presenter.updateActionEventMediator(actionLocation.toObject());
15
+ }
16
+
17
+ }
@@ -0,0 +1,108 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ import TemplateResolver from "../../../../template-resolver";
4
+ export default class ActionEventMediatorEntity {
5
+ constructor(handlers, actions, element, dispatch) {
6
+ this.handlers = handlers;
7
+ this.actions = actions;
8
+ this.element = element;
9
+ this.dispatch = dispatch;
10
+
11
+ _defineProperty(this, "contextResolver", void 0);
12
+ }
13
+
14
+ createEventHandlers(event) {
15
+ // TODO: this code needs to move to custom component or somewhere else
16
+ return e => {
17
+ const {
18
+ eventMappings,
19
+ ...payloadItems
20
+ } = e.detail.payload;
21
+ const eventMapping = eventMappings.find(eventMapping => eventMapping.sourceEvent === event);
22
+
23
+ if (!eventMapping) {
24
+ return;
25
+ }
26
+
27
+ const dispatchEvent = eventMapping.targetEvent;
28
+ const payload = eventMapping.payload;
29
+ const replacementContext = {
30
+ "@payload": payloadItems
31
+ };
32
+ const resolvedPayload = TemplateResolver.replaceContextVariablesInObject(payload, replacementContext);
33
+ this.dispatch({
34
+ type: dispatchEvent,
35
+ payload: resolvedPayload
36
+ });
37
+ };
38
+ }
39
+
40
+ getEventNames(actions) {
41
+ const eventNames = [];
42
+ actions.forEach(action => {
43
+ action.eventMappings.forEach(eventMapping => {
44
+ if (!eventNames.includes(eventMapping.sourceEvent)) {
45
+ eventNames.push(eventMapping.sourceEvent);
46
+ }
47
+ });
48
+ });
49
+ return eventNames;
50
+ }
51
+
52
+ listen(eventName) {
53
+ var _this$element;
54
+
55
+ const handler = this.createEventHandlers(eventName);
56
+ this.handlers[eventName] = handler;
57
+ (_this$element = this.element) === null || _this$element === void 0 ? void 0 : _this$element.addEventListener(eventName, handler);
58
+ }
59
+
60
+ unListen(eventName) {
61
+ var _this$element2;
62
+
63
+ const handler = this.handlers[eventName];
64
+ (_this$element2 = this.element) === null || _this$element2 === void 0 ? void 0 : _this$element2.removeEventListener(eventName, handler);
65
+ this.handlers[eventName] = undefined;
66
+ }
67
+
68
+ compareEventNames(previousEventNames, currentEventNames) {
69
+ return previousEventNames.length === currentEventNames.length && previousEventNames.every((eventName, index) => eventName === currentEventNames[index]);
70
+ }
71
+
72
+ initialize() {
73
+ const eventNames = this.getEventNames(this.actions);
74
+ eventNames.forEach(eventName => {
75
+ this.listen(eventName);
76
+ });
77
+ }
78
+
79
+ processActionsChange(previousActions, currentActions) {
80
+ const previousEventNames = this.getEventNames(previousActions).sort();
81
+ const currentEventNames = this.getEventNames(currentActions).sort();
82
+
83
+ if (this.compareEventNames(previousEventNames, currentEventNames)) {
84
+ return;
85
+ }
86
+
87
+ previousEventNames.forEach(eventName => {
88
+ this.unListen(eventName);
89
+ });
90
+ currentEventNames.forEach(eventName => {
91
+ this.listen(eventName);
92
+ });
93
+ }
94
+
95
+ destroy() {
96
+ const eventNames = this.getEventNames(this.actions);
97
+ eventNames.forEach(eventName => {
98
+ this.unListen(eventName);
99
+ });
100
+ }
101
+
102
+ toObject() {
103
+ return {
104
+ handlers: this.handlers
105
+ };
106
+ }
107
+
108
+ }
@@ -0,0 +1,13 @@
1
+ import { createCustomComponent } from "../../../../../../library/custom-component";
2
+ import ActionEventMediatorProperties from "../../../../cc/action-event-mediator/Properties";
3
+ import EventHandlersFactory from "./EventHandlersFactory";
4
+ import ActionEventMediatorView from "./ActionEventMediatorView";
5
+ export default createCustomComponent({
6
+ name: 'ActionEventMediator',
7
+ properties: ActionEventMediatorProperties,
8
+ setInitialState: () => ({
9
+ handlers: {}
10
+ }),
11
+ eventHandlers: EventHandlersFactory.create(),
12
+ View: ActionEventMediatorView
13
+ });
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import RowActionsRenderer from "../../../row-actions-renderer/frameworks/ui/RowActionsRenderer";
3
+ import { ComponentRegistry } from "../../../../../../library";
4
+ export default function ActionEventMediatorView(_ref, ref) {
5
+ let {
6
+ state
7
+ } = _ref;
8
+ const {
9
+ actions,
10
+ renderComponentType,
11
+ gap
12
+ } = state.properties;
13
+ const ActionRenderComponent = ComponentRegistry.get(renderComponentType) || RowActionsRenderer;
14
+ return /*#__PURE__*/React.createElement(ActionRenderComponent, {
15
+ actions: actions,
16
+ gap: gap,
17
+ getRef: ref
18
+ });
19
+ }
@@ -0,0 +1,30 @@
1
+ import Repository from "../../adapters/gateway/Repository";
2
+ import Presenter from "../../adapters/presenters/Presenter";
3
+ import InitializeUseCase from "../../applications/usecases/InitializeUseCase";
4
+ import DestroyUseCase from "../../applications/usecases/DestroyUseCase";
5
+ import PropertiesChangeUseCase from "../../applications/usecases/PropertiesChangeUseCase";
6
+ import MountController from "../../adapters/controllers/MountController";
7
+ import UnmountController from "../../adapters/controllers/UnmountController";
8
+ import PropertiesChangeController from "../../adapters/controllers/PropertiesChangeController";
9
+ export default class EventHandlersFactory {
10
+ static create() {
11
+ const repository = new Repository();
12
+ const presenter = new Presenter();
13
+ const dependencies = {
14
+ repository,
15
+ presenter
16
+ };
17
+ const initializeUseCase = new InitializeUseCase(dependencies);
18
+ const destroyUseCase = new DestroyUseCase(dependencies);
19
+ const propertiesChangeUseCase = new PropertiesChangeUseCase(dependencies);
20
+ const initializeController = new MountController(initializeUseCase);
21
+ const unmountController = new UnmountController(destroyUseCase);
22
+ const propertiesChangeController = new PropertiesChangeController(propertiesChangeUseCase);
23
+ return {
24
+ ['ActionEventMediator#MOUNT']: initializeController.handle,
25
+ ['ActionEventMediator#UPDATE_PROPERTIES']: propertiesChangeController.handle,
26
+ ['ActionEventMediator#UNMOUNT']: unmountController.handle
27
+ };
28
+ }
29
+
30
+ }
@@ -0,0 +1,9 @@
1
+ import { createCustomComponent } from "../../../../../../library/custom-component";
2
+ import DynamicActionComponentProperties from "../../../../cc/dynamic-action-component/Properties";
3
+ import DynamicActionComponentView from "./DynamicActionComponentView";
4
+ export default createCustomComponent({
5
+ name: 'DynamicActionComponent',
6
+ properties: DynamicActionComponentProperties,
7
+ eventHandlers: {},
8
+ View: DynamicActionComponentView
9
+ });
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import ComponentRegistry from "../../../../../../library/custom-component/frameworks/ui/ComponentRegistry";
3
+ import ActionComponentMapping from "../../../../../../library/dot/components/action-location/frameworks/ui/ActionComponentMapping";
4
+
5
+ function DynamicComponentView(_ref, ref) {
6
+ let {
7
+ state
8
+ } = _ref;
9
+ const {
10
+ action
11
+ } = state.properties;
12
+ const {
13
+ component,
14
+ properties,
15
+ eventMappings
16
+ } = action;
17
+ const Component = ComponentRegistry.get(component) || ActionComponentMapping[component];
18
+
19
+ if (!Component) {
20
+ return /*#__PURE__*/React.createElement("div", {
21
+ ref: ref
22
+ }, "Error");
23
+ }
24
+
25
+ return /*#__PURE__*/React.createElement(Component, {
26
+ getRef: ref,
27
+ ...properties,
28
+ appendToActionPayload: {
29
+ eventMappings
30
+ }
31
+ });
32
+ }
33
+
34
+ export default DynamicComponentView;
@@ -0,0 +1,7 @@
1
+ export let ActionViewGap = /*#__PURE__*/function (ActionViewGap) {
2
+ ActionViewGap["NONE"] = "none";
3
+ ActionViewGap["SMALL"] = "small";
4
+ ActionViewGap["MEDIUM"] = "medium";
5
+ ActionViewGap["LARGE"] = "large";
6
+ return ActionViewGap;
7
+ }({});
@@ -0,0 +1,12 @@
1
+ import { createCustomComponent } from "../../../../../../library/custom-component";
2
+ import RowActionsRendererProperties from "../../../../cc/action-event-mediator/Properties";
3
+ import RowActionsRendererView from "./RowActionsRendererView";
4
+ import { ComponentRegistry } from "../../../../../../library";
5
+ const RowActionsRendererComponent = createCustomComponent({
6
+ name: 'RowActionsRenderer',
7
+ properties: RowActionsRendererProperties,
8
+ eventHandlers: {},
9
+ View: RowActionsRendererView
10
+ });
11
+ ComponentRegistry.register("RowActionsRenderer", RowActionsRendererComponent);
12
+ export default RowActionsRendererComponent;
@@ -0,0 +1,17 @@
1
+ [dir=ltr] .actions {
2
+ padding-left: var(--zd_size4)
3
+ }[dir=rtl] .actions {
4
+ padding-right: var(--zd_size4)
5
+ }
6
+
7
+ .gap_small {
8
+ gap: var(--zd_size4)
9
+ }
10
+
11
+ .gap_medium {
12
+ gap: var(--zd_size8)
13
+ }
14
+
15
+ .gap_large {
16
+ gap: var(--zd_size12)
17
+ }
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import Flex from '@zohodesk/layout/es/Flex/Flex';
3
+ import DynamicActionComponent from "../../../dynamic-component/frameworks/ui/DynamicActionComponent";
4
+ import { ActionViewGap } from "../../../interfaces/ActionViewModel";
5
+ // @ts-ignore
6
+ import style from "./RowActionsRenderer.module.css";
7
+
8
+ function RowActionsRendererView(_ref, ref) {
9
+ let {
10
+ state
11
+ } = _ref;
12
+ const {
13
+ actions,
14
+ gap
15
+ } = state.properties;
16
+ return /*#__PURE__*/React.createElement(Flex, {
17
+ ref: ref,
18
+ $ui_displayMode: "inline",
19
+ $ui_alignItems: "center",
20
+ $ui_className: `${style.actions} ${gap !== ActionViewGap.NONE ? style[`gap_${gap}`] : ''}`
21
+ }, actions.map((action, index) => {
22
+ return /*#__PURE__*/React.createElement(DynamicActionComponent, {
23
+ action: action,
24
+ key: index
25
+ });
26
+ }));
27
+ }
28
+
29
+ ;
30
+ export default RowActionsRendererView;
@@ -0,0 +1,44 @@
1
+ export default class TemplateResolver {
2
+ static getPathValue(path, obj) {
3
+ return path.split('.').reduce(function (prev, curr) {
4
+ return prev !== undefined ? prev[curr] : undefined;
5
+ }, obj);
6
+ }
7
+
8
+ static replaceContextVariables(inputString, replacementObj) {
9
+ return inputString.replace(/{{(.*?)}}/g, (match, key) => {
10
+ let value = this.getPathValue(key.trim(), replacementObj);
11
+
12
+ if (Array.isArray(value) || value instanceof Object) {
13
+ return JSON.stringify(value);
14
+ }
15
+
16
+ return value !== undefined ? value.toString() : match;
17
+ });
18
+ }
19
+
20
+ static isOnlyContextVariables(inputString) {
21
+ return /^{{(.*?)}}$/.test(inputString);
22
+ }
23
+
24
+ static replaceContextVariablesInObject(properties, replacementObj) {
25
+ const replaced = {};
26
+ Object.entries(properties).forEach(_ref => {
27
+ let [key, value] = _ref;
28
+
29
+ if (typeof value === 'string' && this.isOnlyContextVariables(value)) {
30
+ const path = value.replace(/{{(.*?)}}/g, '$1');
31
+ const pathValue = this.getPathValue(path, replacementObj);
32
+ replaced[key] = pathValue !== undefined ? pathValue : `{{${path}}}`;
33
+ } else if (typeof value === 'string' && value.includes('{{')) {
34
+ replaced[key] = this.replaceContextVariables(value, replacementObj);
35
+ } else if (typeof value === 'object' && value !== null) {
36
+ replaced[key] = this.replaceContextVariablesInObject(value, replacementObj);
37
+ } else {
38
+ replaced[key] = value;
39
+ }
40
+ });
41
+ return Array.isArray(properties) ? Object.values(replaced) : replaced;
42
+ }
43
+
44
+ }