@zohodesk/library-platform 1.2.0-exp.4 → 1.2.0-exp.45

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 (167) hide show
  1. package/es/.DS_Store +0 -0
  2. package/es/bc/sort-by/SortOrderEnum.js +8 -0
  3. package/es/cc/date/Properties.js +0 -15
  4. package/es/cc/fields/field/Properties.js +1 -8
  5. package/es/cc/flex-container/Properties.js +79 -0
  6. package/es/cc/flex-container/Types.js +39 -0
  7. package/es/cc/flex-container/index.js +2 -0
  8. package/es/cc/form/Properties.js +0 -8
  9. package/es/cc/label/Properties.js +5 -12
  10. package/es/cc/multi-select/Properties.js +1 -8
  11. package/es/cc/section/Properties.js +1 -8
  12. package/es/cc/select/Properties.js +1 -8
  13. package/es/cc/tags/model/TagModel.js +26 -0
  14. package/es/cc/textarea/Properties.js +0 -15
  15. package/es/cc/textbox/Properties.js +1 -8
  16. package/es/flex-layout/.DS_Store +0 -0
  17. package/es/index.js +6 -4
  18. package/es/library/behaviours/sort-by/adapters/controllers/SortBy.js +28 -0
  19. package/es/library/behaviours/sort-by/applications/usecases/SortBy.js +28 -0
  20. package/es/library/behaviours/sort-by/frameworks/ui/DemoBehaviour.js +20 -0
  21. package/es/library/custom-component/domain/entities/SlotValidator.js +84 -0
  22. package/es/library/custom-component/frameworks/ui/CustomComponentFactory.js +56 -0
  23. package/es/library/dot/components/form/adapters/presenter/TransformState.js +1 -3
  24. package/es/library/dot/components/form/frameworks/ui/FormView.js +3 -6
  25. package/es/library/dot/components/form/frameworks/ui/sub-components/Footer.js +6 -16
  26. package/es/library/dot/components/form/frameworks/ui/sub-components/Header.js +6 -16
  27. package/es/library/dot/components/form/frameworks/ui/sub-components/Sections.js +2 -4
  28. package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +3 -6
  29. package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +3 -6
  30. package/es/library/dot/components/form-fields/date/frameworks/ui/DateView.js +3 -6
  31. package/es/library/dot/components/form-fields/datetime/frameworks/ui/DateTimeView.js +3 -6
  32. package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +3 -6
  33. package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +3 -6
  34. package/es/library/dot/components/form-fields/field/FieldItem.js +2 -4
  35. package/es/library/dot/components/form-fields/lookup/frameworks/ui/LookupView.js +3 -6
  36. package/es/library/dot/components/form-fields/multi-select/frameworks/ui/MultiSelectView.js +4 -7
  37. package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +3 -6
  38. package/es/library/dot/components/form-fields/percentage/frameworks/ui/PercentageView.js +4 -7
  39. package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +3 -6
  40. package/es/library/dot/components/form-fields/pick-list/frameworks/ui/PickListView.js +4 -7
  41. package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +3 -6
  42. package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +3 -6
  43. package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +3 -6
  44. package/es/library/dot/components/part-wrapper/POC_DOCUMENT.md +648 -0
  45. package/es/library/dot/components/part-wrapper/domain/entities/interfaces/Properties.js +52 -0
  46. package/es/library/dot/components/part-wrapper/frameworks/ui/PartWrapper.js +24 -0
  47. package/es/library/dot/components/part-wrapper/frameworks/ui/PartWrapperFactory.js +27 -0
  48. package/es/library/dot/components/part-wrapper/frameworks/ui/PartWrapperView.js +45 -0
  49. package/es/library/dot/components/part-wrapper/frameworks/ui/css/PartWrapper.module.css +16 -0
  50. package/es/library/dot/components/part-wrapper/poc/index.js +9 -0
  51. package/es/library/dot/components/part-wrapper/poc/layouts/POCFormLayout.js +130 -0
  52. package/es/library/dot/components/part-wrapper/poc/layouts/POCMixedLayout.js +128 -0
  53. package/es/library/dot/components/part-wrapper/poc/layouts/POCTableCellLayout.js +105 -0
  54. package/es/library/dot/components/part-wrapper/poc/layouts/css/poc-form-layout.module.css +46 -0
  55. package/es/library/dot/components/part-wrapper/poc/layouts/css/poc-mixed-layout.module.css +89 -0
  56. package/es/library/dot/components/part-wrapper/poc/layouts/css/poc-table-cell-layout.module.css +70 -0
  57. package/es/library/dot/components/section/frameworks/ui/RenderField.js +1 -3
  58. package/es/library/dot/components/section/frameworks/ui/SectionView.js +8 -14
  59. package/es/library/dot/components/table-list/adapters/controllers/SortByController.js +25 -0
  60. package/es/library/dot/components/table-list/adapters/controllers/SortedController.js +18 -0
  61. package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +4 -8
  62. package/es/library/dot/components/table-list/frameworks/ui/handlers/HandleSortClick.js +12 -0
  63. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +4 -6
  64. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +5 -11
  65. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +5 -11
  66. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +4 -8
  67. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +5 -12
  68. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +4 -12
  69. package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/DateView.js +4 -10
  70. package/es/library/dot/legacy-to-new-arch/flex-container/frameworks/ui/FlexContainer.js +11 -0
  71. package/es/library/dot/legacy-to-new-arch/flex-container/frameworks/ui/FlexContainerView.js +37 -0
  72. package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/LabelView.js +5 -11
  73. package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/MultiSelectView.js +8 -21
  74. package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/SelectView.js +8 -18
  75. package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +4 -10
  76. package/es/library/dot/legacy-to-new-arch/textbox/frameworks/ui/TextBoxView.js +4 -10
  77. package/es/library/poc-slot-usage/employee-card/adapters/presenters/EmployeeCardStateMapper.js +14 -0
  78. package/es/library/poc-slot-usage/employee-card/applications/usecases/BuildEmployeeCardUseCase.js +25 -0
  79. package/es/library/poc-slot-usage/employee-card/domain/entities/EmployeeCardSlots.js +68 -0
  80. package/es/library/poc-slot-usage/employee-card/frameworks/ui/EmployeeCard.js +13 -0
  81. package/es/library/poc-slot-usage/employee-card/frameworks/ui/EmployeeCardView.js +42 -0
  82. package/es/library/poc-slot-usage/flex-container/adapters/presenters/FlexContainerStateMapper.js +8 -0
  83. package/es/library/poc-slot-usage/flex-container/applications/usecases/BuildFlexContainerUseCase.js +44 -0
  84. package/es/library/poc-slot-usage/flex-container/domain/entities/FlexContainerSlots.js +18 -0
  85. package/es/library/poc-slot-usage/flex-container/frameworks/ui/FlexContainer.js +5 -0
  86. package/es/library/poc-slot-usage/flex-container/frameworks/ui/FlexContainerView.js +40 -0
  87. package/es/library/poc-slot-usage/index.js +7 -0
  88. package/es/library/poc-slot-usage/mismatched-card/applications/usecases/BuildMismatchedCardUseCase.js +23 -0
  89. package/es/library/poc-slot-usage/mismatched-card/domain/entities/MismatchedCardSlots.js +39 -0
  90. package/es/library/poc-slot-usage/mismatched-card/frameworks/ui/MismatchedCard.js +9 -0
  91. package/es/library/poc-slot-usage/mismatched-card/frameworks/ui/MismatchedCardView.js +39 -0
  92. package/es/library/poc-slot-usage/product-action/applications/usecases/BuildProductActionUseCase.js +21 -0
  93. package/es/library/poc-slot-usage/product-action/frameworks/ui/ProductAction.js +5 -0
  94. package/es/library/poc-slot-usage/product-action/frameworks/ui/ProductActionView.js +24 -0
  95. package/es/library/poc-slot-usage/product-body/applications/usecases/BuildProductBodyUseCase.js +21 -0
  96. package/es/library/poc-slot-usage/product-body/frameworks/ui/ProductBody.js +5 -0
  97. package/es/library/poc-slot-usage/product-body/frameworks/ui/ProductBodyView.js +20 -0
  98. package/es/library/poc-slot-usage/product-card/adapters/presenters/ProductCardStateMapper.js +8 -0
  99. package/es/library/poc-slot-usage/product-card/applications/usecases/BuildProductCardUseCase.js +34 -0
  100. package/es/library/poc-slot-usage/product-card/domain/entities/ProductCardSlots.js +70 -0
  101. package/es/library/poc-slot-usage/product-card/frameworks/ui/ProductCard.js +5 -0
  102. package/es/library/poc-slot-usage/product-card/frameworks/ui/ProductCardView.js +40 -0
  103. package/es/library/poc-slot-usage/product-title/applications/usecases/BuildProductTitleUseCase.js +21 -0
  104. package/es/library/poc-slot-usage/product-title/frameworks/ui/ProductTitle.js +5 -0
  105. package/es/library/poc-slot-usage/product-title/frameworks/ui/ProductTitleView.js +20 -0
  106. package/es/platform/client-actions/cc/action-event-mediator/Properties.js +43 -0
  107. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter.js +2 -1
  108. package/es/platform/client-scripts/cc/zclient-scripts-execution/clientScriptsSchema.js +1 -4
  109. package/es/platform/components/form-connected/frameworks/FormConnectedView.js +0 -2
  110. package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js +10 -7
  111. package/es/platform/components/smart-action-band/frameworks/SmartActionBandView.js +5 -18
  112. package/es/platform/components/table-connected/adapters/controllers/ColumnChooserOpenedController.js +28 -0
  113. package/es/platform/components/table-connected/adapters/controllers/ColumnChooserUpdateController.js +31 -0
  114. package/es/platform/zform/adapters/presenter/FormTranslator.js +12 -8
  115. package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +14 -10
  116. package/es/platform/zform/adapters/presenter/translators/fields/BooleanFieldTranslator.js +2 -4
  117. package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +1 -2
  118. package/es/platform/zform/adapters/presenter/translators/fields/DateFieldTranslator.js +2 -4
  119. package/es/platform/zform/adapters/presenter/translators/fields/DateTimeFieldTranslator.js +2 -4
  120. package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +2 -4
  121. package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +2 -4
  122. package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +2 -4
  123. package/es/platform/zform/adapters/presenter/translators/fields/MultiselectFieldTranslator.js +8 -13
  124. package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +2 -4
  125. package/es/platform/zform/adapters/presenter/translators/fields/PercentageFieldTranslator.js +2 -4
  126. package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +2 -4
  127. package/es/platform/zform/adapters/presenter/translators/fields/PicklistFieldTranslator.js +12 -11
  128. package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +2 -4
  129. package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +2 -4
  130. package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +2 -4
  131. package/es/platform/zlist/adapters/gateways/SortBy.js +38 -0
  132. package/es/platform/zlist/adapters/presenters/SelectionTranslator.js +4 -2
  133. package/es/platform/zlist/adapters/presenters/TableTranslator.js +1 -6
  134. package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +1 -7
  135. package/es/platform/zlist/adapters/presenters/translators/Header.js +6 -7
  136. package/es/platform/zlist/adapters/presenters/translators/Row.js +5 -6
  137. package/es/platform/zlist/adapters/presenters/translators/fields/DateFieldTranslator.js +3 -7
  138. package/es/platform/zlist/adapters/presenters/translators/fields/DateTimeFieldTranslator.js +3 -7
  139. package/es/platform/zlist/domain/entities/SortBy.js +58 -0
  140. package/es/platform/zlist/domain/entities/interfaces/ISortBy.js +1 -0
  141. package/es/to-do-app/ToDo.js +10 -0
  142. package/es/to-do-app/cc/button/Constants.js +0 -0
  143. package/es/to-do-app/cc/button/Events.js +0 -0
  144. package/es/to-do-app/cc/button/Properties.js +4 -0
  145. package/es/to-do-app/cc/button/index.js +0 -0
  146. package/es/to-do-app/cc/textbox/Constants.js +7 -0
  147. package/es/to-do-app/cc/textbox/Events.js +20 -0
  148. package/es/to-do-app/cc/textbox/Properties.js +51 -0
  149. package/es/to-do-app/cc/textbox/index.js +3 -0
  150. package/es/to-do-app/component/textbox/framework/TextBox.js +30 -0
  151. package/es/to-do-app/component/textbox/framework/TextBoxView.js +42 -0
  152. package/package.json +2 -2
  153. package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/__test__/ClientActionsFetchSDK.test.js +0 -183
  154. package/es/platform/client-actions/cc/client-actions-renderer/Properties.js +0 -58
  155. package/es/platform/client-actions/cc/client-actions-renderer/ViewMetaSchema.js +0 -17
  156. package/es/platform/client-actions/components/client-actions-renderer/adapters/presenters/ClientActionsRendererTranslator.js +0 -24
  157. package/es/platform/client-actions/components/client-actions-renderer/domain/entities/State.js +0 -8
  158. package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRenderer.js +0 -11
  159. package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRenderer.module.css +0 -23
  160. package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRendererView.js +0 -25
  161. package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/views/DefaultActionsRendererView.js +0 -66
  162. package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/more-actions-renderer/MoreActionsRenderer.js +0 -9
  163. package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/more-actions-renderer/MoreActionsRendererView.js +0 -81
  164. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/resources/__test__/ClientScriptsFetchSDK.test.js +0 -163
  165. /package/es/{platform/client-actions/components/client-actions-renderer/domain/entities/ClientActionsRendererDatatype.js → library/behaviours/sort-by/applications/interfaces/output/SortByOutputModel.js} +0 -0
  166. /package/es/{platform/client-actions/components/client-actions-renderer/domain/entities/ClientActionsRendererViewProps.js → library/dot/components/part-wrapper/applications/interfaces/State.js} +0 -0
  167. /package/es/platform/{client-actions/components/client-actions-renderer/domain/entities/Context.js → zlist/applications/interfaces/gateways/ISortBy.js} +0 -0
@@ -3,8 +3,7 @@ const LookUpFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  fieldPreModified,
6
- uiConfig,
7
- context
6
+ uiConfig
8
7
  } = _ref;
9
8
  const fieldModified = {
10
9
  // Need to check if value is an object or string (ID)
@@ -24,8 +23,7 @@ const LookUpFieldTranslator = _ref => {
24
23
  required: field.isMandatory,
25
24
  isCustomField: field.isCustomField,
26
25
  maxLength: field.maxLength,
27
- lookup: field.lookup,
28
- context
26
+ lookup: field.lookup
29
27
  };
30
28
  return fieldModified;
31
29
  };
@@ -1,3 +1,5 @@
1
+ import ClientActionsTranslator from "../../../../../client-actions/translators/client-actions-translator";
2
+
1
3
  const MultiSelectFieldTranslator = _ref => {
2
4
  let {
3
5
  field,
@@ -6,33 +8,27 @@ const MultiSelectFieldTranslator = _ref => {
6
8
  fieldPreModified,
7
9
  fieldOptionActions,
8
10
  instanceName,
9
- moduleName,
10
- context
11
+ moduleName
11
12
  } = _ref;
12
13
  const fieldModified = { ...fieldPreModified,
13
14
  id: field.id,
14
15
  label: field.i18NLabel,
15
16
  options: field.pickListValues ? field.pickListValues.map(picklistValue => {
16
17
  const optionActions = {};
17
- let fieldOptionsContext = {};
18
18
  Object.entries(fieldOptionActions).forEach(_ref2 => {
19
19
  let [key, value] = _ref2;
20
20
  const {
21
21
  value: _omit,
22
22
  ...fieldWithoutValue
23
23
  } = field;
24
- optionActions[key] = value;
25
- fieldOptionsContext = { ...picklistValue,
26
- ...fieldWithoutValue,
27
- instanceName,
28
- moduleName
29
- };
24
+ optionActions[key] = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...picklistValue,
25
+ ...fieldWithoutValue
26
+ });
30
27
  });
31
28
  return {
32
29
  optionActions: optionActions.fieldOptionRightActions,
33
30
  value: picklistValue.value,
34
- label: picklistValue.value,
35
- context: fieldOptionsContext
31
+ label: picklistValue.value
36
32
  };
37
33
  }) : [],
38
34
  type,
@@ -45,8 +41,7 @@ const MultiSelectFieldTranslator = _ref => {
45
41
  readonly: field.isReadOnly,
46
42
  // visibility: field.isVisible,
47
43
  isVisible: field.isVisible,
48
- errorMessage: field.errorMessage || '',
49
- context
44
+ errorMessage: field.errorMessage || ''
50
45
  };
51
46
  return fieldModified;
52
47
  };
@@ -3,8 +3,7 @@ const NumberFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  fieldPreModified,
6
- uiConfig,
7
- context
6
+ uiConfig
8
7
  } = _ref;
9
8
  const fieldModified = {
10
9
  type,
@@ -21,8 +20,7 @@ const NumberFieldTranslator = _ref => {
21
20
  readonly: field.isReadOnly,
22
21
  // visibility: field.isVisible,
23
22
  isVisible: field.isVisible,
24
- errorMessage: field.errorMessage || '',
25
- context
23
+ errorMessage: field.errorMessage || ''
26
24
  };
27
25
  return fieldModified;
28
26
  };
@@ -3,8 +3,7 @@ const PercentageFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  fieldPreModified,
6
- uiConfig,
7
- context
6
+ uiConfig
8
7
  } = _ref;
9
8
  const fieldModified = {
10
9
  type,
@@ -20,8 +19,7 @@ const PercentageFieldTranslator = _ref => {
20
19
  readonly: field.isReadOnly,
21
20
  // visibility: field.isVisible,
22
21
  isVisible: field.isVisible,
23
- errorMessage: field.errorMessage || '',
24
- context
22
+ errorMessage: field.errorMessage || ''
25
23
  };
26
24
  return fieldModified;
27
25
  };
@@ -3,8 +3,7 @@ const PhoneFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  fieldPreModified,
6
- uiConfig,
7
- context
6
+ uiConfig
8
7
  } = _ref;
9
8
  const fieldModified = {
10
9
  type,
@@ -20,8 +19,7 @@ const PhoneFieldTranslator = _ref => {
20
19
  maxLength: field.maxLength,
21
20
  readonly: field.isReadOnly,
22
21
  isVisible: field.isVisible,
23
- errorMessage: field.errorMessage || '',
24
- context
22
+ errorMessage: field.errorMessage || ''
25
23
  };
26
24
  return fieldModified;
27
25
  };
@@ -1,3 +1,5 @@
1
+ import ClientActionsTranslator from "../../../../../client-actions/translators/client-actions-translator";
2
+
1
3
  const PickListFieldTranslator = _ref => {
2
4
  let {
3
5
  field,
@@ -6,27 +8,27 @@ const PickListFieldTranslator = _ref => {
6
8
  fieldPreModified,
7
9
  fieldOptionActions,
8
10
  instanceName,
9
- moduleName,
10
- context
11
+ moduleName
11
12
  } = _ref;
12
13
  const fieldModified = { ...fieldPreModified,
13
14
  id: field.id,
14
15
  label: field.i18NLabel,
15
16
  options: field.pickListValues.map(picklistValue => {
16
17
  const optionActions = {};
17
- const context = { ...picklistValue,
18
- ...field
19
- };
20
18
  Object.entries(fieldOptionActions).forEach(_ref2 => {
21
19
  let [key, value] = _ref2;
22
- // const { value: _omit, ...fieldWithoutValue } = field;
23
- optionActions[key] = value; // optionActions[key] = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...picklistValue, ...fieldWithoutValue });
20
+ const {
21
+ value: _omit,
22
+ ...fieldWithoutValue
23
+ } = field;
24
+ optionActions[key] = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...picklistValue,
25
+ ...fieldWithoutValue
26
+ });
24
27
  });
25
28
  return {
26
29
  optionActions: optionActions.fieldOptionRightActions,
27
30
  value: picklistValue.value,
28
- label: picklistValue.value,
29
- context
31
+ label: picklistValue.value
30
32
  };
31
33
  }),
32
34
  type,
@@ -39,8 +41,7 @@ const PickListFieldTranslator = _ref => {
39
41
  readonly: field.isReadOnly,
40
42
  // visibility: field.isVisible,
41
43
  isVisible: field.isVisible,
42
- errorMessage: field.errorMessage || '',
43
- context
44
+ errorMessage: field.errorMessage || ''
44
45
  };
45
46
  return fieldModified;
46
47
  };
@@ -3,8 +3,7 @@ const TextAreaFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  fieldPreModified,
6
- uiConfig,
7
- context
6
+ uiConfig
8
7
  } = _ref;
9
8
  const fieldModified = {
10
9
  type,
@@ -20,8 +19,7 @@ const TextAreaFieldTranslator = _ref => {
20
19
  maxLength: field.maxLength,
21
20
  // visibility: field.isVisible,
22
21
  isVisible: field.isVisible,
23
- errorMessage: field.errorMessage || '',
24
- context
22
+ errorMessage: field.errorMessage || ''
25
23
  };
26
24
  return fieldModified;
27
25
  };
@@ -3,8 +3,7 @@ const TextFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  fieldPreModified,
6
- uiConfig,
7
- context
6
+ uiConfig
8
7
  } = _ref;
9
8
  const fieldModified = {
10
9
  type,
@@ -21,8 +20,7 @@ const TextFieldTranslator = _ref => {
21
20
  maxLength: field.maxLength,
22
21
  // visibility: field.isVisible,
23
22
  isVisible: field.isVisible,
24
- errorMessage: field.errorMessage || '',
25
- context
23
+ errorMessage: field.errorMessage || ''
26
24
  };
27
25
  return fieldModified;
28
26
  };
@@ -3,8 +3,7 @@ const URLFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  fieldPreModified,
6
- uiConfig,
7
- context
6
+ uiConfig
8
7
  } = _ref;
9
8
  const fieldModified = {
10
9
  type,
@@ -21,8 +20,7 @@ const URLFieldTranslator = _ref => {
21
20
  readonly: field.isReadOnly,
22
21
  // visibility: field.isVisible,
23
22
  isVisible: field.isVisible,
24
- errorMessage: field.errorMessage || '',
25
- context
23
+ errorMessage: field.errorMessage || ''
26
24
  };
27
25
  return fieldModified;
28
26
  };
@@ -0,0 +1,38 @@
1
+ import SortOrder from "../../../../bc/sort-by/SortOrderEnum";
2
+
3
+ class SortBy {
4
+ toQueryString(sortBy) {
5
+ const {
6
+ name,
7
+ order
8
+ } = sortBy;
9
+ let sortQueryString = '';
10
+
11
+ if (order === SortOrder.ASC) {
12
+ sortQueryString = name;
13
+ } else if (order === SortOrder.DES) {
14
+ sortQueryString = `-${name}`;
15
+ }
16
+
17
+ return sortQueryString;
18
+ }
19
+
20
+ toObject(sortBy) {
21
+ let sortByParsed = sortBy.split('-');
22
+
23
+ if (sortByParsed[0] === '-') {
24
+ return {
25
+ name: sortByParsed[1],
26
+ order: SortOrder.DES
27
+ };
28
+ } else {
29
+ return {
30
+ name: sortByParsed[0],
31
+ order: SortOrder.ASC
32
+ };
33
+ }
34
+ }
35
+
36
+ }
37
+
38
+ export default SortBy;
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable @zohodesk/architecturerules/define-property-schema */
2
2
 
3
3
  /* eslint-disable max-lines-per-function */
4
+ import ClientActionsTranslator from "../../../client-actions/translators/client-actions-translator";
4
5
  import DefaultClientActions from "./utils/DefaultClientActions";
5
6
  import { i18NProviderUtils } from '@zohodesk/i18n';
6
7
  export default function SelectionTranslator(state) {
@@ -12,6 +13,7 @@ export default function SelectionTranslator(state) {
12
13
  columnChooserConfig,
13
14
  selectionConfig,
14
15
  moduleName,
16
+ instanceName,
15
17
  textOverflowConfig
16
18
  } = properties;
17
19
  const {
@@ -33,11 +35,11 @@ export default function SelectionTranslator(state) {
33
35
  isEnabled: textOverflowConfig.isEnabled,
34
36
  mode: textOverflow.mode
35
37
  });
38
+ const contextAppliedActions = ClientActionsTranslator.transform(clientActions, instanceName, moduleName, context);
36
39
  return {
37
40
  selected,
38
41
  hasAllSelected,
39
- actions: clientActions,
40
- context
42
+ actions: contextAppliedActions
41
43
  };
42
44
  }
43
45
 
@@ -157,18 +157,13 @@ export default class TableTranslator {
157
157
  field.uiType = uiType;
158
158
  }
159
159
  });
160
- const massActionsContext = {
161
- instanceName,
162
- moduleName
163
- };
164
160
  const headersTranslator = new HeadersTranslator(fields, headerActions, context, modifiedWidths, sortConfig, records, instanceName, moduleName);
165
161
  const rowsTranslator = new RowsTranslator(isLocalSearchEnabled ? localRecords : recordsForDisplay, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, textOverflowData, moduleName, nameFieldsConfig, recordReadStatusConfig, Array.isArray(zfield.componentMapping) ? [...zfield.componentMapping] : []); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
166
162
  // const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator(), actionTranslator.getTranslator()];
167
163
 
168
164
  const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator()];
169
165
  let data = Pipeline.run(translators, {});
170
- data.clientScripts = clientScripts;
171
- data.massActionsContext = massActionsContext; // TODO: Implement ModuleTableModel, and move data and isLoading to tableViewModel Object
166
+ data.clientScripts = clientScripts; // TODO: Implement ModuleTableModel, and move data and isLoading to tableViewModel Object
172
167
 
173
168
  return {
174
169
  properties,
@@ -82,13 +82,7 @@ function ColumnTranslator(_ref) {
82
82
  }
83
83
 
84
84
  const viewModel = {
85
- actions: fieldActions,
86
- context: {
87
- field,
88
- record,
89
- instanceName,
90
- moduleName
91
- },
85
+ actions,
92
86
  ...fieldTranslator(translatorArgs)
93
87
  };
94
88
 
@@ -1,4 +1,5 @@
1
1
  import { Alignment } from "../../../../../cc/table-list/data-types/Header";
2
+ import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
2
3
  import { SortModelOrder } from "../../../../zlist/domain/entities/interfaces/Properties";
3
4
  import { i18NProviderUtils } from '@zohodesk/i18n';
4
5
  import { SortOrder } from "../../../../../bc/zlist/Types";
@@ -13,6 +14,10 @@ function HeaderTranslator(field, actions, context, modifiedWidths, sortConfig, r
13
14
  const newField = { ...field,
14
15
  sort: translateSortBy(field.name, sortConfig)
15
16
  };
17
+ const transformedActions = ClientActionsTranslator.transform(actions, instanceName, moduleName, { ...context,
18
+ field: newField,
19
+ recordsLength: records.length.toString()
20
+ });
16
21
  const width = modifiedWidths[name];
17
22
  return {
18
23
  id: id,
@@ -21,13 +26,7 @@ function HeaderTranslator(field, actions, context, modifiedWidths, sortConfig, r
21
26
  sortable: isSortable,
22
27
  alignment: Alignment.Left,
23
28
  width,
24
- actions,
25
- context: { ...context,
26
- field: newField,
27
- recordsLength: records.length.toString(),
28
- instanceName,
29
- moduleName
30
- }
29
+ actions: transformedActions
31
30
  };
32
31
  }
33
32
 
@@ -1,4 +1,5 @@
1
1
  import ColumnTranslator from "./ColumnTranslator";
2
+ import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
2
3
  export default function RowTranslator(_ref) {
3
4
  let {
4
5
  record,
@@ -16,6 +17,9 @@ export default function RowTranslator(_ref) {
16
17
  recordReadStatusConfig,
17
18
  componentMapping
18
19
  } = _ref;
20
+ const actions = ClientActionsTranslator.transform(rowActions, instanceName, moduleName, { ...context,
21
+ record
22
+ });
19
23
  return {
20
24
  id: record.id,
21
25
  columns: fields.map(field => ColumnTranslator({
@@ -34,12 +38,7 @@ export default function RowTranslator(_ref) {
34
38
  })),
35
39
  rowActionLocation: {
36
40
  type: rowActionsUiType,
37
- actions: rowActions,
38
- context: { ...context,
39
- record,
40
- instanceName,
41
- moduleName
42
- }
41
+ actions
43
42
  }
44
43
  };
45
44
  }
@@ -15,18 +15,14 @@ const DateFieldTranslator = _ref => {
15
15
  uiType,
16
16
  name
17
17
  } = field;
18
- const defaultDateTimeFormat = {
19
- dateFormat: 'dd MM yyyy',
20
- timeFormat: '12-hour',
21
- delimiter: 'space',
22
- isShortenDateTimeInfo: false
23
- };
24
18
  const {
25
19
  dateFormat,
26
20
  timeFormat,
27
21
  delimiter,
28
22
  isShortenDateTimeInfo
29
- } = context?.dateTimeFormat || defaultDateTimeFormat;
23
+ } = context.dateTimeFormat; // const appContext = platformSDK.app.getContext();
24
+ // const { dateFormat, timeFormat, delimiter } = appContext.dateTimeFormat;
25
+
30
26
  const newDateValue = DateAndTimeFormat({
31
27
  dateFormatType: dateFormat,
32
28
  timeFormatType: timeFormat,
@@ -15,18 +15,14 @@ const DateTimeFieldTranslator = _ref => {
15
15
  uiType,
16
16
  name
17
17
  } = field;
18
- const defaultDateTimeFormat = {
19
- dateFormat: 'dd MM yyyy',
20
- timeFormat: '12-hour',
21
- delimiter: 'space',
22
- isShortenDateTimeInfo: false
23
- };
24
18
  const {
25
19
  dateFormat,
26
20
  timeFormat,
27
21
  delimiter,
28
22
  isShortenDateTimeInfo
29
- } = context?.dateTimeFormat || defaultDateTimeFormat;
23
+ } = context.dateTimeFormat; // const appContext = platformSDK.app.getContext();
24
+ // const { dateFormat, timeFormat, delimiter } = appContext.dateTimeFormat;
25
+
30
26
  const newDateValue = DateAndTimeFormat({
31
27
  dateFormatType: dateFormat,
32
28
  timeFormatType: timeFormat,
@@ -0,0 +1,58 @@
1
+ import { SortOrder } from "./interfaces/Properties";
2
+
3
+ class SortBy {
4
+ constructor(id, name, order) {
5
+ this.id = id;
6
+ this.name = name;
7
+ this.order = order;
8
+ }
9
+
10
+ toObject() {
11
+ return {
12
+ id: this.id,
13
+ name: this.name,
14
+ order: this.order
15
+ };
16
+ }
17
+
18
+ toQueryString() {
19
+ const {
20
+ name,
21
+ order
22
+ } = this;
23
+ let sortQueryString = '';
24
+
25
+ if (order === SortOrder.DES) {
26
+ sortQueryString = `-${name}`;
27
+ } else if (order === SortOrder.ASC) {
28
+ sortQueryString = name;
29
+ }
30
+
31
+ return sortQueryString;
32
+ }
33
+
34
+ doSorting(id, name) {
35
+ if (this.id === id) {
36
+ this.toggleSort();
37
+ } else {
38
+ this.resetSortBy(id, name);
39
+ }
40
+ }
41
+
42
+ toggleSort() {
43
+ if (this.order === SortOrder.ASC) {
44
+ this.order = SortOrder.DES;
45
+ } else {
46
+ this.order = SortOrder.ASC;
47
+ }
48
+ }
49
+
50
+ resetSortBy(id, name) {
51
+ this.id = id;
52
+ this.name = name;
53
+ this.order = SortOrder.ASC;
54
+ }
55
+
56
+ }
57
+
58
+ export default SortBy;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import TextBox from "./component/textbox/framework/TextBox";
3
+
4
+ function ToDoApp() {
5
+ return /*#__PURE__*/React.createElement("div", {
6
+ className: "ToDoApp"
7
+ }, /*#__PURE__*/React.createElement("h1", null, "To-Do Application"), /*#__PURE__*/React.createElement(TextBox, null));
8
+ }
9
+
10
+ export default ToDoApp;
File without changes
File without changes
@@ -0,0 +1,4 @@
1
+ export default {}; //todo app
2
+ //text
3
+ //button
4
+ //list
File without changes
@@ -0,0 +1,7 @@
1
+ class TextBoxConstants {
2
+ static TEXTBOX_FOCUS = 'TEXTBOX#FOCUSED';
3
+ static TEXTBOX_BLUR = 'TEXTBOX#BLURRED';
4
+ static TEXTBOX_CHANGE = 'TEXTBOX#CHANGED';
5
+ }
6
+
7
+ export default TextBoxConstants;
@@ -0,0 +1,20 @@
1
+ import TextBoxConstants from "./Constants";
2
+ export default [{
3
+ type: TextBoxConstants.TEXTBOX_FOCUS,
4
+ payload: {
5
+ value: {
6
+ name: 'value',
7
+ typeMetadata: {
8
+ schema: {
9
+ type: 'string'
10
+ }
11
+ }
12
+ }
13
+ }
14
+ }, {
15
+ type: TextBoxConstants.TEXTBOX_BLUR,
16
+ payload: {}
17
+ }, {
18
+ type: TextBoxConstants.TEXTBOX_CHANGE,
19
+ payload: {}
20
+ }];
@@ -0,0 +1,51 @@
1
+ export default {
2
+ id: {
3
+ required: false,
4
+ typeMetadata: {
5
+ schema: {
6
+ type: 'string'
7
+ }
8
+ }
9
+ },
10
+ name: {
11
+ required: false,
12
+ typeMetadata: {
13
+ schema: {
14
+ type: 'string'
15
+ }
16
+ }
17
+ },
18
+ type: {
19
+ required: false,
20
+ typeMetadata: {
21
+ schema: {
22
+ type: 'string'
23
+ }
24
+ }
25
+ },
26
+ maxLength: {
27
+ required: false,
28
+ typeMetadata: {
29
+ schema: {
30
+ type: 'number'
31
+ }
32
+ }
33
+ },
34
+ placeholder: {
35
+ required: false,
36
+ typeMetadata: {
37
+ schema: {
38
+ type: 'string'
39
+ }
40
+ }
41
+ },
42
+ value: {
43
+ defaultValue: '',
44
+ required: false,
45
+ typeMetadata: {
46
+ schema: {
47
+ type: 'string'
48
+ }
49
+ }
50
+ }
51
+ };
@@ -0,0 +1,3 @@
1
+ export { default as TextBoxProperties } from "./Properties";
2
+ export { default as TextBoxEvents } from "./Events";
3
+ export { default as TextBoxConstants } from "./Constants";
@@ -0,0 +1,30 @@
1
+ import { createCustomComponent } from "../../../../library/custom-component";
2
+ import TextBoxProperties from "../../../cc/textbox/Properties";
3
+ import TextBoxEvents from "../../../cc/textbox/Events";
4
+ import TextBoxView from "./TextBoxView";
5
+ import { TextBoxConstants } from "../../../cc/textbox";
6
+ const TextBox = createCustomComponent({
7
+ name: "TextBox",
8
+ View: TextBoxView,
9
+ properties: TextBoxProperties,
10
+ events: TextBoxEvents,
11
+ eventHandlers: {
12
+ [TextBoxConstants.TEXTBOX_CHANGE]: _ref => {
13
+ let {
14
+ action,
15
+ state,
16
+ updateState
17
+ } = _ref;
18
+ updateState({ ...state,
19
+ value: action.payload.value
20
+ }); // console.log("TextBox value changed:", payload.value);
21
+ }
22
+ },
23
+ transformState: state => {
24
+ console.log("TextBox transformState ::::::::", state);
25
+ return { ...state,
26
+ value: state.value || ''
27
+ };
28
+ }
29
+ });
30
+ export default TextBox;