@zohodesk/library-platform 1.1.10-exp.1 → 1.1.10-exp.3

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 (209) hide show
  1. package/es/.DS_Store +0 -0
  2. package/es/bc/app-context/Properties.js +12 -2
  3. package/es/bc/sdk/ResourceNamesEnum.js +1 -0
  4. package/es/bc/zform/Constants.js +11 -1
  5. package/es/bc/zform/Properties.js +29 -33
  6. package/es/bc/zform/Symbol.js +1 -3
  7. package/es/bc/zlist/Properties.js +0 -51
  8. package/es/bc/zrecord/Constants.js +1 -0
  9. package/es/cc/fields/currency/Properties.js +2 -1
  10. package/es/cc/fields/field/Properties.js +14 -8
  11. package/es/cc/fields/lookup/Properties.js +34 -1
  12. package/es/cc/fields/text/Properties.js +0 -9
  13. package/es/cc/form/Properties.js +8 -0
  14. package/es/cc/form-connected/ExternalConstants.js +3 -0
  15. package/es/cc/form-connected/Properties.js +19 -11
  16. package/es/cc/table-connected/SdkContract.js +14 -0
  17. package/es/cc/table-connected/constants/Events.js +2 -1
  18. package/es/cc/table-list/row/Properties.js +8 -0
  19. package/es/index.js +13 -3
  20. package/es/library/analytics/Analytics.js +36 -0
  21. package/es/library/analytics/AnalyticsContract.js +13 -0
  22. package/es/library/analytics/index.js +2 -0
  23. package/es/library/custom-component/adapters/controllers/Controller.js +9 -0
  24. package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +4 -0
  25. package/es/library/custom-component/adapters/gateways/service/Service.js +2 -0
  26. package/es/library/custom-component/applications/entities-factory/ComponentFactory.js +12 -9
  27. package/es/library/custom-component/applications/usecases/DispatchUseCase.js +28 -5
  28. package/es/library/custom-component/applications/usecases/InitializeUseCase.js +5 -4
  29. package/es/library/custom-component/applications/usecases/MountUseCase.js +10 -6
  30. package/es/library/custom-component/applications/usecases/UnmountUseCase.js +6 -5
  31. package/es/library/custom-component/applications/usecases/UpdatePropertyUseCase.js +23 -18
  32. package/es/library/custom-component/applications/usecases/UpdateStateUseCase.js +4 -3
  33. package/es/library/custom-component/domain/entities/Behaviour.js +4 -0
  34. package/es/library/custom-component/domain/entities/Component.js +89 -83
  35. package/es/library/custom-component/domain/entities/Properties.js +10 -137
  36. package/es/library/custom-component/domain/entities/Property.js +29 -0
  37. package/es/library/custom-component/frameworks/json-schema-validator/Validator.js +65 -28
  38. package/es/library/custom-component/frameworks/ui/CreateCustomComponent.js +26 -13
  39. package/es/library/custom-component/frameworks/ui/DependencyFactory.js +1 -2
  40. package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +2 -1
  41. package/es/library/dot/components/form/adapters/presenter/TransformState.js +3 -1
  42. package/es/library/dot/components/form/frameworks/ui/DefaultComponentRegister.js +10 -2
  43. package/es/library/dot/components/form/frameworks/ui/Form.js +2 -0
  44. package/es/library/dot/components/form/frameworks/ui/FormView.js +8 -4
  45. package/es/library/dot/components/form/frameworks/ui/sub-components/Footer.js +7 -4
  46. package/es/library/dot/components/form/frameworks/ui/sub-components/Header.js +7 -4
  47. package/es/library/dot/components/form-fields/currency/frameworks/ui/Currency.js +3 -3
  48. package/es/library/dot/components/form-fields/lookup/frameworks/ui/Lookup.js +1 -1
  49. package/es/library/dot/components/section/frameworks/ui/SectionView.js +12 -4
  50. package/es/library/dot/components/section/frameworks/ui/css/Section.module.css +3 -0
  51. package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +14 -7
  52. package/es/library/dot/components/table-list/frameworks/ui/sub-components/ErrorState.js +4 -7
  53. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +9 -6
  54. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +6 -4
  55. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +6 -4
  56. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/Headers.js +4 -2
  57. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +6 -4
  58. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Columns.js +4 -2
  59. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +14 -7
  60. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +5 -4
  61. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +5 -3
  62. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +32 -7
  63. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/sub-components/BreadcrumbItem.js +1 -1
  64. package/es/library/dot/legacy-to-new-arch/button/frameworks/ui/ButtonView.js +2 -2
  65. package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/DateView.js +4 -4
  66. package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/LabelView.js +2 -2
  67. package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/MultiSelectView.js +2 -2
  68. package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/SelectView.js +2 -2
  69. package/es/library/dot/legacy-to-new-arch/table-field-components/index.js +1 -0
  70. package/es/library/dot/legacy-to-new-arch/text/frameworks/ui/TextView.js +1 -1
  71. package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +2 -2
  72. package/es/library/dot/legacy-to-new-arch/textbox/frameworks/ui/TextBoxView.js +2 -2
  73. package/es/platform/.DS_Store +0 -0
  74. package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/SetClientActionsUseCase.js +6 -1
  75. package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActionManager.js +58 -19
  76. package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActions.js +8 -8
  77. package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IClientActionFetchResponse.js +0 -0
  78. package/es/platform/client-actions/cc/action-event-mediator/Properties.js +75 -3
  79. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/MountController.js +1 -1
  80. package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/PropertiesChangeController.js +2 -2
  81. package/es/platform/client-actions/components/action-event-mediator/adapters/gateway/Repository.js +2 -2
  82. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/InitializeUseCase.js +15 -1
  83. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/PropertiesChangeUseCase.js +3 -3
  84. package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +41 -24
  85. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator.js +3 -1
  86. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediatorView.js +31 -14
  87. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter.js +2 -48
  88. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +3 -11
  89. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/AdaptiveRowActions/AdaptiveRowActionsRenderer.js +12 -0
  90. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/AdaptiveRowActions/AdaptiveRowActionsRendererView.js +42 -0
  91. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/MoreActions/MoreActionsRenderer.js +10 -0
  92. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/MoreActions/MoreActionsRendererView.js +79 -0
  93. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.js +12 -0
  94. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.module.css +19 -0
  95. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRendererView.js +37 -0
  96. package/es/platform/client-actions/translators/client-actions-translator/index.js +14 -2
  97. package/es/platform/client-actions/translators/condition-resolver/index.js +6 -1
  98. package/es/platform/client-scripts/bc/zclient-scripts-execution/Constants.js +11 -0
  99. package/es/platform/client-scripts/bc/zclient-scripts-execution/EventHandlers.js +1 -0
  100. package/es/platform/client-scripts/bc/zclient-scripts-fetch/Constants.js +11 -0
  101. package/es/platform/client-scripts/bc/zclient-scripts-fetch/EventHandlers.js +1 -0
  102. package/es/platform/{app-context-behaviour → client-scripts/behaviour/zclient-scripts-execution}/adapters/controllers/AbstractController.js +2 -1
  103. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/controllers/ClientScriptExecutionController.js +10 -0
  104. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/controllers/SetClientScriptsMappingController.js +10 -0
  105. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/gateways/Repository.js +24 -0
  106. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/gateways/Service.js +9 -0
  107. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/presenters/Presenter.js +21 -0
  108. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/interfaces/gateways/IService.js +0 -0
  109. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/usecases/AbstractUseCase.js +15 -0
  110. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/usecases/ExecuteClientScriptsUseCase.js +23 -0
  111. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/usecases/SetClientScriptsMappingUseCase.js +16 -0
  112. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/domain/entities/ClientScriptExecutor.js +142 -0
  113. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/domain/entities/types/ClientScriptExectionTypeDefintions.js +7 -0
  114. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/frameworks/ClientScriptsExecutionBehaviourFactory.js +12 -0
  115. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/frameworks/ClientScriptsExecutionHandlersFactory.js +30 -0
  116. package/es/platform/client-scripts/behaviour/zclient-scripts-execution/frameworks/ClientScriptsUtils.js +25 -0
  117. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/AbstractController.js +8 -0
  118. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/FetchClientScriptsController.js +27 -0
  119. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/FetchClientScriptsFailureController.js +28 -0
  120. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/FetchClientScriptsNoContentController.js +23 -0
  121. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/FetchClientScriptsStopController.js +21 -0
  122. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/FetchClientScriptsSuccessController.js +28 -0
  123. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/MountController.js +22 -0
  124. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/SetClientScriptsController.js +24 -0
  125. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/gateways/Repository.js +22 -0
  126. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/gateways/Service.js +19 -0
  127. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/presenters/Presenter.js +16 -0
  128. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/entities-factory/ClientScriptsFactory.js +11 -0
  129. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/entities-factory/ClientScriptsManagerFactory.js +10 -0
  130. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/gateways/IService.js +0 -0
  131. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/AbstractUseCase.js +17 -0
  132. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/FetchClientScriptUseCase.js +33 -0
  133. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/FetchClientScriptsFailureUseCase.js +22 -0
  134. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/FetchClientScriptsNoContentUseCase.js +27 -0
  135. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/FetchClientScriptsStopUseCase.js +25 -0
  136. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/FetchClientScriptsSuccessUseCase.js +22 -0
  137. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/InitializeUseCase.js +17 -0
  138. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/SetClientScriptsUseCase.js +21 -0
  139. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/ClientScript.js +24 -0
  140. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/ClientScripts.js +41 -0
  141. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/GetClientScriptsStrategy.js +44 -0
  142. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/State.js +1 -0
  143. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/ClientScriptEventMappingState.js +1 -0
  144. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/ClientScriptModel.js +1 -0
  145. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/ClientScriptsModel.js +1 -0
  146. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/IClientScript.js +0 -0
  147. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/IClientScripts.js +0 -0
  148. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/IEvent.js +1 -0
  149. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/frameworks/ClientScriptsBehaviourFactory.js +12 -0
  150. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/frameworks/ClientScriptsHandlersFactory.js +47 -0
  151. package/es/platform/client-scripts/cc/zclient-scripts-execution/clientScriptsSchema.js +15 -0
  152. package/es/platform/components/app/adapters/resources/AppResource.js +13 -3
  153. package/es/platform/components/form-connected/frameworks/FormConnectedFactory.js +7 -1
  154. package/es/platform/components/form-connected/frameworks/FormConnectedView.js +4 -2
  155. package/es/platform/components/table-connected/adapters/controllers/ColumnChooserUpdateController.js +7 -1
  156. package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +50 -0
  157. package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +216 -2
  158. package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +4 -2
  159. package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +6 -2
  160. package/es/platform/data-source/http-template/getClientScripts.js +23 -0
  161. package/es/platform/data-source/http-template/updateSelectedFields.js +1 -1
  162. package/es/platform/data-source/index.js +14 -11
  163. package/es/platform/data-source/utils/validation-rules/TransFormValidationRules.js +1 -0
  164. package/es/platform/sdk/frameworks/Sdk.js +1 -1
  165. package/es/platform/zdata-source/domain/entities/APITemplate.js +2 -1
  166. package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +6 -1
  167. package/es/platform/zform/adapters/controllers/IntializeController.js +4 -2
  168. package/es/platform/zform/adapters/controllers/MyLayoutSuccessController.js +4 -2
  169. package/es/platform/zform/adapters/controllers/SubmitValidationCompletedController.js +5 -1
  170. package/es/platform/zform/adapters/gateway/FormRepository.js +4 -2
  171. package/es/platform/zform/adapters/gateway/Service.js +2 -0
  172. package/es/platform/zform/adapters/presenter/FormTranslator.js +21 -15
  173. package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +5 -3
  174. package/es/platform/zform/applications/usecases/InitializeUseCase.js +54 -26
  175. package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +7 -7
  176. package/es/platform/zform/applications/usecases/MyLayoutSuccessUseCase.js +60 -36
  177. package/es/platform/zform/applications/usecases/SubmitValidationCompletedUseCase.js +12 -8
  178. package/es/platform/zform/domain/ZForm.js +65 -0
  179. package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +11 -2
  180. package/es/platform/zhttp/adapters/controllers/FetchController.js +5 -1
  181. package/es/platform/zlist/adapters/gateways/Repository.js +4 -2
  182. package/es/platform/zlist/adapters/presenters/SelectionTranslator.js +6 -3
  183. package/es/platform/zlist/adapters/presenters/TableTranslator.js +15 -6
  184. package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +30 -19
  185. package/es/platform/zlist/adapters/presenters/translators/Header.js +5 -6
  186. package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +4 -2
  187. package/es/platform/zlist/adapters/presenters/translators/Row.js +5 -3
  188. package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +6 -2
  189. package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +1 -1
  190. package/es/platform/zlist/domain/entities/List.js +17 -2
  191. package/package.json +3 -3
  192. package/es/library/custom-component/applications/usecases/MountUseCase copy.js +0 -28
  193. package/es/platform/app-context-behaviour/adapters/controllers/InitializeController.js +0 -19
  194. package/es/platform/app-context-behaviour/adapters/gateways/Service.js +0 -7
  195. package/es/platform/app-context-behaviour/adapters/presenters/Presenter.js +0 -18
  196. package/es/platform/app-context-behaviour/adapters/resources/AppResource.js +0 -25
  197. package/es/platform/app-context-behaviour/applications/AbstractUseCase.js +0 -6
  198. package/es/platform/app-context-behaviour/applications/usecases/InitializeUseCase.js +0 -15
  199. package/es/platform/app-context-behaviour/frameworks/EventHandlerFactory.js +0 -25
  200. package/es/platform/components/form-connected/frameworks/FallbackView.js +0 -23
  201. package/es/platform/components/form-connected/frameworks/FormFallbackView.js +0 -23
  202. /package/es/platform/{app-context-behaviour/applications/interfaces/UsecaseDependencies.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionResponse.js} +0 -0
  203. /package/es/platform/{app-context-behaviour/applications/interfaces/gateways/IService.js → client-scripts/behaviour/zclient-scripts-execution/applications/interfaces/InputDependencies.js} +0 -0
  204. /package/es/platform/{app-context-behaviour/applications/interfaces/input/InitializeUseCaseInputModel.js → client-scripts/behaviour/zclient-scripts-execution/applications/interfaces/gateways/IRepository.js} +0 -0
  205. /package/es/platform/{app-context-behaviour → client-scripts/behaviour/zclient-scripts-execution}/applications/interfaces/output/IPresenter.js +0 -0
  206. /package/es/platform/{app-context-behaviour/applications/interfaces/output/BehaviourState.js → client-scripts/behaviour/zclient-scripts-execution/domain/entities/State.js} +0 -0
  207. /package/es/platform/{app-context-behaviour/applications/interfaces/resources/ApiHeaderContract.js → client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/InputDependencies.js} +0 -0
  208. /package/es/platform/{app-context-behaviour/applications/interfaces/resources/ContextContract.js → client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/gateways/IRepository.js} +0 -0
  209. /package/es/platform/{app-context-behaviour/applications/interfaces/resources/IAppResource.js → client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/output/IPresenter.js} +0 -0
@@ -17,7 +17,7 @@ function getLookupUrlConstructions(_ref) {
17
17
  return `/agent/${orgName}/${departmentName}/${lookupModuleName}/details/${value.id}`;
18
18
  }
19
19
 
20
- function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences) {
20
+ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences, instanceName, moduleName) {
21
21
  const {
22
22
  isCustomField,
23
23
  name,
@@ -32,7 +32,7 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
32
32
 
33
33
  let tempValue = undefined;
34
34
  let value = isCustomField ? record.cf?.[name] : record[name];
35
- const actions = ClientActionsTranslator.transform(fieldActions, {
35
+ const actions = ClientActionsTranslator.transform(fieldActions, instanceName, moduleName, {
36
36
  field,
37
37
  record
38
38
  });
@@ -71,28 +71,39 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
71
71
  finalValue = fieldToUiValue;
72
72
  }
73
73
 
74
- if (fieldEntry && typeof fieldEntry === 'object') {
75
- let data = {
76
- actions,
77
- ...fieldTranslator(field, tempValue ? tempValue : finalValue, {
78
- recordId: record.id
79
- }, context, preferences)
80
- };
81
- data.value = fieldEntry.fieldToUIComponentTranslator({
82
- field,
83
- record,
84
- context
85
- });
86
- data.type = fieldEntry.UIComponentName;
87
- return data;
88
- }
89
-
90
- return {
74
+ finalValue = tempValue ? tempValue : finalValue;
75
+ const viewModel = {
91
76
  actions,
92
77
  ...fieldTranslator(field, finalValue, {
93
78
  recordId: record.id
94
79
  }, context, preferences)
95
80
  };
81
+
82
+ if (fieldEntry && typeof fieldEntry === 'object') {
83
+ viewModel.type = fieldEntry.UIComponentName;
84
+
85
+ if (fieldEntry.fieldToUIComponentTranslator) {
86
+ viewModel.value = fieldEntry.fieldToUIComponentTranslator({
87
+ field,
88
+ record,
89
+ context
90
+ });
91
+ }
92
+
93
+ if (fieldEntry.translator) {
94
+ const newViewModel = fieldEntry.translator({
95
+ viewModel,
96
+ field,
97
+ context
98
+ });
99
+ newViewModel.type = fieldEntry.UIComponentName;
100
+ return newViewModel;
101
+ }
102
+
103
+ return viewModel;
104
+ }
105
+
106
+ return viewModel;
96
107
  }
97
108
 
98
109
  export default ColumnTranslator;
@@ -1,20 +1,19 @@
1
- import ColumnAlignmentTranslator from "./ColumnAlignmentTranslator";
1
+ import { Alignment } from "../../../../../cc/table-list/data-types/Header";
2
2
  import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
3
3
  import { SortOrder } from "../../../../zlist/domain/entities/interfaces/Properties";
4
4
  import { i18NProviderUtils } from '@zohodesk/i18n';
5
5
 
6
- function HeaderTranslator(field, actions, context, modifiedWidths, sortBy, records) {
6
+ function HeaderTranslator(field, actions, context, modifiedWidths, sortBy, records, instanceName, moduleName) {
7
7
  const {
8
8
  id,
9
9
  name,
10
10
  displayLabel,
11
- isSortable,
12
- type
11
+ isSortable
13
12
  } = field;
14
13
  const newField = { ...field,
15
14
  sort: translateSortBy(field.id, sortBy)
16
15
  };
17
- const transformedActions = ClientActionsTranslator.transform(actions, { ...context,
16
+ const transformedActions = ClientActionsTranslator.transform(actions, instanceName, moduleName, { ...context,
18
17
  field: newField,
19
18
  recordsLength: records.length.toString()
20
19
  });
@@ -24,7 +23,7 @@ function HeaderTranslator(field, actions, context, modifiedWidths, sortBy, recor
24
23
  name: name,
25
24
  text: displayLabel,
26
25
  sortable: isSortable,
27
- alignment: ColumnAlignmentTranslator(type),
26
+ alignment: Alignment.Left,
28
27
  width,
29
28
  actions: transformedActions
30
29
  };
@@ -1,12 +1,14 @@
1
1
  import HeaderTranslator from "./Header";
2
2
  export default class HeadersTranslator {
3
- constructor(fields, actions, context, modifiedWidths, sortBy, records) {
3
+ constructor(fields, actions, context, modifiedWidths, sortBy, records, instanceName, moduleName) {
4
4
  this.fields = fields;
5
5
  this.actions = actions;
6
6
  this.context = context;
7
7
  this.modifiedWidths = modifiedWidths;
8
8
  this.sortBy = sortBy;
9
9
  this.records = records;
10
+ this.instanceName = instanceName;
11
+ this.moduleName = moduleName;
10
12
  this.pipe = this.pipe.bind(this);
11
13
  }
12
14
 
@@ -15,7 +17,7 @@ export default class HeadersTranslator {
15
17
  return [];
16
18
  }
17
19
 
18
- return this.fields.map(field => HeaderTranslator(field, this.actions, this.context, this.modifiedWidths, this.sortBy, this.records));
20
+ return this.fields.map(field => HeaderTranslator(field, this.actions, this.context, this.modifiedWidths, this.sortBy, this.records, this.instanceName, this.moduleName));
19
21
  }
20
22
 
21
23
  pipe(viewModel) {
@@ -9,14 +9,16 @@ export default function RowTranslator(_ref) {
9
9
  rowActions,
10
10
  fieldActions,
11
11
  context,
12
- preferences
12
+ preferences,
13
+ instanceName,
14
+ moduleName
13
15
  } = _ref;
14
- const actions = ClientActionsTranslator.transform(rowActions, { ...context,
16
+ const actions = ClientActionsTranslator.transform(rowActions, instanceName, moduleName, { ...context,
15
17
  record
16
18
  });
17
19
  return {
18
20
  id: record.id,
19
- columns: fields.map(field => ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences)),
21
+ columns: fields.map(field => ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences, instanceName, moduleName)),
20
22
  rowActionLocation: {
21
23
  type: rowActionsUiType,
22
24
  actions
@@ -1,6 +1,6 @@
1
1
  import RowTranslator from "./Row";
2
2
  export default class RowsTranslator {
3
- constructor(records, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions) {
3
+ constructor(records, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, moduleName) {
4
4
  this.records = records;
5
5
  this.fields = fields;
6
6
  this.rowActions = rowActions;
@@ -9,6 +9,8 @@ export default class RowsTranslator {
9
9
  this.fieldComponentMapping = fieldComponentMapping;
10
10
  this.rowActionsUiType = rowActionsUiType;
11
11
  this.fieldActions = fieldActions;
12
+ this.instanceName = instanceName;
13
+ this.moduleName = moduleName;
12
14
  this.pipe = this.pipe.bind(this);
13
15
  }
14
16
 
@@ -25,7 +27,9 @@ export default class RowsTranslator {
25
27
  rowActions: this.rowActions,
26
28
  fieldActions: this.fieldActions,
27
29
  context: this.context,
28
- preferences: this.preferences
30
+ preferences: this.preferences,
31
+ instanceName: this.instanceName,
32
+ moduleName: this.moduleName
29
33
  }));
30
34
  }
31
35
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable max-lines-per-function */
2
- import ClientAction from "../../../../client-actions/behaviour/zclient-actions/domain/entities/ClientAction";
3
2
  import { TableListConstants } from "../../../../../cc/table-list";
4
3
  import { CheckboxConstants } from "../../../../../cc/checkbox";
4
+ import ClientAction from "../../../../client-actions/behaviour/zclient-actions/domain/entities/ClientAction";
5
5
  const CHECKBOX_TOGGLED = CheckboxConstants.CHECKBOX_TOGGLED;
6
6
  const TABLE_LIST_TOGGLE_ALL_SELECTION = TableListConstants.TABLE_LIST_TOGGLE_ALL_SELECTION;
7
7
 
@@ -1,9 +1,10 @@
1
1
  import { RECORD_EXECUTE, RECORD_FETCH_MORE, RECORD_REFETCH, RecordApiActionName } from "../../../../bc/zrecord/Constants";
2
2
  import { FIELD_EXECUTE, FIELD_REFETCH } from "../../../../bc/zfield/Constants";
3
- import { CLIENT_ACTION_TABLE_LIST_COMPONENT_NAME, ZLIST_RECORD_DELETE_SUCCEEDED, ZLIST_RECORD_UPDATE_SUCCEEDED } from "../../../../bc/zlist/Constants";
4
3
  import { CLIENTACTION_BEHAVIOUR_EXECUTE } from "../../../client-actions/bc/zclient-actions/Constants";
4
+ import { CLIENT_ACTION_TABLE_LIST_COMPONENT_NAME, ZLIST_RECORD_DELETE_SUCCEEDED, ZLIST_RECORD_UPDATE_SUCCEEDED } from "../../../../bc/zlist/Constants";
5
5
  import { SmartTableConstants } from "../../../../cc/table-connected";
6
6
  import SortBy from "./SortBy";
7
+ import { CLIENTSCRIPT_FETCH } from "../../../client-scripts/bc/zclient-scripts-fetch/Constants";
7
8
 
8
9
  class List {
9
10
  constructor(limit, sortBy, query, context, isReOrderLoading, errorState) {
@@ -75,7 +76,7 @@ class List {
75
76
  }
76
77
 
77
78
  getInitialMountFetchActions() {
78
- return [this.createRecordsFetchAction(), this.createAvailableFieldsFetchAction(), this.createSelectedFieldsFetchAction(), this.createClientActionsFetchAction()];
79
+ return [this.createRecordsFetchAction(), this.createAvailableFieldsFetchAction(), this.createSelectedFieldsFetchAction(), this.createClientActionsFetchAction(), this.createClientScriptsFetchAction()];
79
80
  }
80
81
 
81
82
  shallowDiff(obj1, obj2) {
@@ -333,6 +334,20 @@ class List {
333
334
  };
334
335
  }
335
336
 
337
+ createClientScriptsFetchAction() {
338
+ const props = this.createApiProps();
339
+ props.components = 'TableList';
340
+ props.modules = props.moduleName;
341
+ return {
342
+ type: CLIENTSCRIPT_FETCH,
343
+ payload: {
344
+ actionName: 'getClientScripts',
345
+ props,
346
+ apiName: 'clientScripts'
347
+ }
348
+ };
349
+ }
350
+
336
351
  createRecordsRefetchAction(triggerer) {
337
352
  const props = this.createApiProps();
338
353
  const metaData = triggerer === 'sortBy' && {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/library-platform",
3
- "version": "1.1.10-exp.1",
3
+ "version": "1.1.10-exp.3",
4
4
  "description": "",
5
5
  "main": "es/index.js",
6
6
  "files": [
@@ -42,7 +42,7 @@
42
42
  "@typescript-eslint/parser": "^7.11.0",
43
43
  "@zoho/SecurityJS": "7.2.4",
44
44
  "@zohodesk-private/css-variable-migrator": "^1.0.8",
45
- "@zohodesk-private/desk-components": "1.0.0-temp-57.1",
45
+ "@zohodesk-private/desk-components": "1.3.13",
46
46
  "@zohodesk-private/dot-registry": "0.0.2",
47
47
  "@zohodesk-private/node-plugins": "1.1.9",
48
48
  "@zohodesk/a11y": "2.3.6",
@@ -77,7 +77,7 @@
77
77
  "typescript": "4.9.5"
78
78
  },
79
79
  "peerDependencies": {
80
- "@zohodesk-private/desk-components": "1.0.0-temp-57.1",
80
+ "@zohodesk-private/desk-components": "1.3.13",
81
81
  "@zohodesk-private/dot-registry": "0.0.2",
82
82
  "@zohodesk/a11y": "2.3.6",
83
83
  "@zohodesk/components": "1.4.5",
@@ -1,28 +0,0 @@
1
- import AbstractUseCase from "./AbstractUseCase";
2
-
3
- class MountUsecase extends AbstractUseCase {
4
- execute() {
5
- const {
6
- repository,
7
- presenter,
8
- eventManager
9
- } = this.dependencies;
10
- const component = repository.getComponent();
11
- const mountAction = component.getMountAction();
12
- const eventHandlers = component.getEventHandlersWrapper();
13
-
14
- try {
15
- eventManager.subscribe(eventHandlers);
16
-
17
- if (!component.hasBreakingError()) {
18
- eventManager.dispatch(mountAction);
19
- }
20
- } catch (e) {
21
- component.setError(e);
22
- presenter.setError(e);
23
- }
24
- }
25
-
26
- }
27
-
28
- export default MountUsecase;
@@ -1,19 +0,0 @@
1
- import { AbstractController } from "./AbstractController";
2
- export class InitializeController extends AbstractController {
3
- handle(_ref) {
4
- let {
5
- state
6
- } = _ref;
7
- const {
8
- service
9
- } = this;
10
- const context = state.properties.context;
11
- const {
12
- initializeUseCase
13
- } = service;
14
- initializeUseCase.execute({
15
- context
16
- });
17
- }
18
-
19
- }
@@ -1,7 +0,0 @@
1
- import { InitializeUseCase } from "../../applications/usecases/InitializeUseCase";
2
- export class Service {
3
- constructor(dependencies) {
4
- this.initializeUseCase = new InitializeUseCase(dependencies);
5
- }
6
-
7
- }
@@ -1,18 +0,0 @@
1
- // import { State } from '../gateways/State';
2
- class Presenter {
3
- updateDependencies(state, updateState) {
4
- this.state = state;
5
- this.updateState = updateState;
6
- }
7
-
8
- updateView(view) {
9
- this.updateState({ ...this.state,
10
- behaviours: { ...this.state.behaviours,
11
- appContext: view
12
- }
13
- });
14
- }
15
-
16
- }
17
-
18
- export default Presenter;
@@ -1,25 +0,0 @@
1
- import { AbstractResource } from "../../../sdk/application/interfaces/gateways/AbstractResource";
2
-
3
- /** Sample Implementation of AppResource */
4
- export class AppResource extends AbstractResource {
5
- initialize() {}
6
-
7
- destroy() {}
8
-
9
- initializeContext(context) {
10
- this.context = context;
11
- }
12
-
13
- initializeApiHeader(headers) {
14
- this.headers = headers;
15
- }
16
-
17
- getContext() {
18
- return this.context;
19
- }
20
-
21
- getApiHeader() {
22
- return this.headers;
23
- }
24
-
25
- }
@@ -1,6 +0,0 @@
1
- export default class AbstractUseCase {
2
- constructor(dependencies) {
3
- this.dependencies = dependencies;
4
- }
5
-
6
- }
@@ -1,15 +0,0 @@
1
- import AbstractUseCase from "../AbstractUseCase";
2
- export class InitializeUseCase extends AbstractUseCase {
3
- execute(_ref) {
4
- let {
5
- instanceName
6
- } = _ref;
7
- const {
8
- appResource,
9
- presenter
10
- } = this.dependencies;
11
- const context = appResource.getContext();
12
- presenter.updateView(context);
13
- }
14
-
15
- }
@@ -1,25 +0,0 @@
1
- import LifeCycleEvents from "../../../cc/component/LifeCycleEventsEnum";
2
- import ResourceNamesEnum from "../../../bc/sdk/ResourceNamesEnum";
3
- import { Service } from "../adapters/gateways/Service";
4
- import { InitializeController } from "../adapters/controllers/InitializeController";
5
- import { platformSDK } from "../../sdk/frameworks/Sdk";
6
- import Presenter from "../adapters/presenters/Presenter";
7
-
8
- class EventHandlerFactory {
9
- static create() {
10
- const appResource = platformSDK[ResourceNamesEnum.APP]; // NOTE: here 'app' should match the resource name in the sdk registry
11
-
12
- const presenter = new Presenter();
13
- const dependencies = {
14
- appResource,
15
- presenter
16
- };
17
- const service = new Service(dependencies);
18
- return {
19
- [LifeCycleEvents.MOUNT]: new InitializeController(service).handle
20
- };
21
- }
22
-
23
- }
24
-
25
- export default EventHandlerFactory;
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import ErrorState from "../../../../library/dot/legacy-to-new-arch/error-state/frameworks/ui/ErrorState";
3
- import { ErrorCodes } from "../../../../cc/component/ErrorStructure";
4
- import ErrorTypes from "../../../../cc/error-state/ErrorTypes";
5
-
6
- function FallbackView(_ref, ref) {
7
- let {
8
- error
9
- } = _ref;
10
- const map = {
11
- [ErrorCodes.API_FAILED]: ErrorTypes.UrlNotFound,
12
- [ErrorCodes.PROPERTY_VALIDATION_FAILED]: ErrorTypes.OopsSomethingMiss,
13
- [ErrorCodes.EVENT_HANDLER_FAILED]: ErrorTypes.Inconvenience,
14
- [ErrorCodes.UNKNOWN_ERROR]: ErrorTypes.Inconvenience
15
- };
16
- const errorType = map[error.code] === undefined ? ErrorTypes.Inconvenience : map[error.code];
17
- return /*#__PURE__*/React.createElement(ErrorState, {
18
- type: errorType,
19
- getRef: ref
20
- });
21
- }
22
-
23
- export default /*#__PURE__*/React.forwardRef(FallbackView);
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import ErrorState from "../../../../library/dot/legacy-to-new-arch/error-state/frameworks/ui/ErrorState";
3
- import { ErrorCodes } from "../../../../cc/component/ErrorStructure";
4
- import ErrorTypes from "../../../../cc/error-state/ErrorTypes";
5
-
6
- function FormFallbackView(_ref, ref) {
7
- let {
8
- error
9
- } = _ref;
10
- const map = {
11
- [ErrorCodes.API_FAILED]: ErrorTypes.UrlNotFound,
12
- [ErrorCodes.PROPERTY_VALIDATION_FAILED]: ErrorTypes.OopsSomethingMiss,
13
- [ErrorCodes.EVENT_HANDLER_FAILED]: ErrorTypes.Inconvenience,
14
- [ErrorCodes.UNKNOWN_ERROR]: ErrorTypes.Inconvenience
15
- };
16
- const errorType = map[error.code] === undefined ? ErrorTypes.Inconvenience : map[error.code];
17
- return /*#__PURE__*/React.createElement(ErrorState, {
18
- type: errorType,
19
- getRef: ref
20
- });
21
- }
22
-
23
- export default /*#__PURE__*/React.forwardRef(FormFallbackView);