@zohodesk/library-platform 1.1.6 → 1.1.7-exp.2

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 (124) hide show
  1. package/es/bc/sdk/ResourceNamesEnum.js +2 -0
  2. package/es/bc/zform/Properties.js +3 -26
  3. package/es/bc/zform/Symbol.js +2 -0
  4. package/es/bc/zlist/Constants.js +3 -1
  5. package/es/bc/zrecord/Constants.js +1 -0
  6. package/es/cc/breadcrumb/Constants.js +7 -0
  7. package/es/cc/breadcrumb/Events.js +14 -0
  8. package/es/cc/breadcrumb/Properties.js +35 -0
  9. package/es/cc/breadcrumb/index.js +3 -0
  10. package/es/cc/fields/field/FormDefaultUIType.js +37 -0
  11. package/es/cc/fields/index.js +2 -1
  12. package/es/cc/form/Properties.js +54 -0
  13. package/es/cc/form-connected/Constants.js +8 -0
  14. package/es/cc/form-connected/Properties.js +95 -1
  15. package/es/cc/form-connected/SdkContract.js +159 -0
  16. package/es/cc/icon-button/Constants.js +7 -0
  17. package/es/cc/icon-button/Events.js +5 -0
  18. package/es/cc/icon-button/Properties.js +86 -0
  19. package/es/cc/icon-button/index.js +3 -0
  20. package/es/cc/index.js +1 -0
  21. package/es/cc/section/Properties.js +25 -0
  22. package/es/cc/table-connected/Properties.js +8 -0
  23. package/es/cc/table-connected/constants/Events.js +1 -0
  24. package/es/index.js +6 -1
  25. package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +5 -1
  26. package/es/library/dot/components/action-location/usecases/interactors/PropertiesChangeUseCase.js +1 -1
  27. package/es/library/dot/components/form/adapters/presenter/TransformState.js +70 -3
  28. package/es/library/dot/components/form/frameworks/ui/DefaultComponentRegister.js +28 -0
  29. package/es/library/dot/components/form/frameworks/ui/Form.js +2 -0
  30. package/es/library/dot/components/form/frameworks/ui/FormView.js +47 -26
  31. package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +8 -4
  32. package/es/library/dot/components/form/frameworks/ui/sub-components/Sections.js +9 -9
  33. package/es/library/dot/components/section/frameworks/ui/RenderField.js +19 -0
  34. package/es/library/dot/components/section/frameworks/ui/Section.js +13 -4
  35. package/es/library/dot/components/section/frameworks/ui/SectionView.js +7 -28
  36. package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +72 -40
  37. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +7 -13
  38. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +2 -2
  39. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/Breadcrumb.js +12 -0
  40. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/BreadcrumbView.js +47 -0
  41. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/css/Breadcrumb.module.css +19 -0
  42. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/sub-components/BreadcrumbItem.js +58 -0
  43. package/es/library/dot/legacy-to-new-arch/icon-button/frameworks/ui/IconButton.js +12 -0
  44. package/es/library/dot/legacy-to-new-arch/icon-button/frameworks/ui/IconButtonView.js +43 -0
  45. package/es/platform/client-actions/bc/zclient-actions/SdkContract.js +35 -0
  46. package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/ClientActionResource.js +105 -0
  47. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/IClientActionResource.js +1 -0
  48. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/input/GetClientActionLocationInputModel.js +1 -0
  49. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/input/GetClientActionUIComponentPropertiesInputModel.js +1 -0
  50. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/input/GetClientActionsInputModel.js +1 -0
  51. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/input/UpdateClientActionUIComponentPropertiesInputModel.js +1 -0
  52. package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionLocationUseCase.js +20 -0
  53. package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionUIComponentPropertiesUseCase.js +20 -0
  54. package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionsUseCase.js +18 -0
  55. package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/UpdateClientActionUIComponentPropertiesUseCase.js +32 -0
  56. package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientAction.js +12 -0
  57. package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActionManager.js +45 -0
  58. package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/UIComponentMapping.js +10 -0
  59. package/es/platform/client-actions/behaviour/zclient-actions/frameworks/sdk/ClientActionsSDKFactory.js +29 -0
  60. package/es/platform/client-actions/cc/action-event-mediator/Properties.js +9 -0
  61. package/es/platform/client-actions/components/action-event-mediator/applications/usecases/PropertiesChangeUseCase.js +1 -1
  62. package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +7 -3
  63. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediatorView.js +3 -1
  64. package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +4 -2
  65. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +4 -0
  66. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +5 -2
  67. package/es/platform/components/form-connected/adapters/resources/SmartFormResources.js +210 -0
  68. package/es/platform/components/form-connected/application/interfaces/ISmartFormResources.js +1 -0
  69. package/es/platform/components/form-connected/frameworks/EventHandlersFactory.js +16 -8
  70. package/es/platform/components/form-connected/frameworks/FormConnectedFactory.js +27 -3
  71. package/es/platform/components/form-connected/frameworks/FormConnectedView.js +14 -2
  72. package/es/platform/components/form-connected/frameworks/FormSdkFactory.js +33 -13
  73. package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +0 -52
  74. package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +15 -1
  75. package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +6 -1
  76. package/es/platform/data-source/http-template/getClientActions.js +2 -2
  77. package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +52 -1
  78. package/es/platform/sdk/frameworks/Sdk.js +14 -0
  79. package/es/platform/zform/adapters/presenter/FormTranslator.js +90 -46
  80. package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +51 -26
  81. package/es/platform/zform/adapters/presenter/translators/interfaces/ComponentMapping.js +1 -0
  82. package/es/platform/zform/adapters/presenter/translators/interfaces/FieldContract.js +1 -0
  83. package/es/platform/zform/adapters/presenter/translators/interfaces/FormTranslatorState.js +1 -0
  84. package/es/platform/zform/adapters/presenter/translators/interfaces/SectionContract.js +1 -0
  85. package/es/platform/zform/adapters/presenter/utils/DefaultClientActions.js +59 -0
  86. package/es/platform/zform/applications/interfaces/input/DeleteFieldUseCaseInput.js +1 -0
  87. package/es/platform/zform/applications/interfaces/input/GetFieldValueUseCaseInput.js +1 -0
  88. package/es/platform/zform/applications/interfaces/input/HideFieldUseCaseInput.js +1 -0
  89. package/es/platform/zform/applications/interfaces/input/HideSectionUseCaseInput.js +1 -0
  90. package/es/platform/zform/applications/interfaces/input/InsertFieldUseCaseInput.js +1 -0
  91. package/es/platform/zform/applications/interfaces/input/SetFieldValueUseCaseInput.js +1 -0
  92. package/es/platform/zform/applications/interfaces/input/SetFieldsValuesUseCaseInput.js +1 -0
  93. package/es/platform/zform/applications/interfaces/input/ShowFieldUseCaseInput.js +1 -0
  94. package/es/platform/zform/applications/interfaces/input/ShowSectionUseCaseInput.js +1 -0
  95. package/es/platform/zform/applications/interfaces/input/SubmitUseCaseInput.js +1 -0
  96. package/es/platform/zform/applications/interfaces/input/UpdateFieldUseCaseInput.js +1 -0
  97. package/es/platform/zform/applications/usecases/DeleteFieldUseCase.js +22 -0
  98. package/es/platform/zform/applications/usecases/GetFieldValueUseCase.js +23 -0
  99. package/es/platform/zform/applications/usecases/HideFieldUseCase.js +19 -0
  100. package/es/platform/zform/applications/usecases/HideSectionUseCase.js +19 -0
  101. package/es/platform/zform/applications/usecases/InitializeUseCase.js +16 -0
  102. package/es/platform/zform/applications/usecases/InsertFieldUseCase.js +28 -0
  103. package/es/platform/zform/applications/usecases/SetFieldValueUseCase.js +44 -0
  104. package/es/platform/zform/applications/usecases/SetFieldsValuesUseCase.js +51 -0
  105. package/es/platform/zform/applications/usecases/ShowFieldUseCase.js +19 -0
  106. package/es/platform/zform/applications/usecases/ShowSectionUseCase.js +19 -0
  107. package/es/platform/zform/applications/usecases/SubmitUseCase.js +29 -0
  108. package/es/platform/zform/applications/usecases/UpdateFieldUseCase.js +22 -0
  109. package/es/platform/zform/domain/ZField.js +14 -0
  110. package/es/platform/zform/domain/ZForm.js +85 -3
  111. package/es/platform/zform/domain/ZSection.js +6 -0
  112. package/es/platform/zform/frameworks/layout-rules/calculateLayoutRulesResult.js +1 -1
  113. package/es/platform/zform/frameworks/layout-rules/runSingleFieldCondition.js +1 -1
  114. package/es/platform/zform/frameworks/layout-rules/validator.js +0 -1
  115. package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +37 -15
  116. package/es/platform/zlist/adapters/presenters/TableTranslator.js +3 -2
  117. package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +4 -1
  118. package/es/platform/zlist/domain/entities/List.js +9 -3
  119. package/es/platform/zrecord/adapters/controllers/CreateRecordController.js +5 -1
  120. package/es/platform/zrecord/adapters/controllers/SetRecordsController.js +7 -3
  121. package/es/platform/zrecord/applications/usecases/CreateRecordUseCase.js +5 -3
  122. package/es/platform/zrecord/applications/usecases/SetRecordsUseCase.js +11 -1
  123. package/package.json +8 -6
  124. package/es/library/dot/components/section/adapters/presenter/TransFormState.js +0 -26
@@ -1,5 +1,6 @@
1
1
  export const ERROR_OCCURRED = 'SMART_TABLE#ERROR_OCCURRED';
2
2
  export default {
3
+ REORDER_SUCCESS: 'SMART_TABLE#REORDER_SUCCEED',
3
4
  DELETE_RECORDS_SUCCESS: 'SMART_TABLE#RECORD_DELETED',
4
5
  UPDATE_RECORDS_SUCCESS: 'SMART_TABLE#RECORD_UPDATED',
5
6
  SORT: 'SMART_TABLE#SORT',
package/es/index.js CHANGED
@@ -10,4 +10,9 @@ export { _Components as Components };
10
10
  export { platformSDK } from "./platform/sdk/frameworks/Sdk";
11
11
  export { sdkRegistry } from "./platform/sdk/frameworks/SdkRegistry";
12
12
  export { validations as defaultFieldValidations } from "./library/behaviours/field-validation/frameworks/utils/FormBasicValidationAdaptor";
13
- export { getClientActionsAdapter, fetchClientActions } from "./platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter";
13
+ export { getClientActionsAdapter, fetchClientActions } from "./platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter";
14
+ export { renderField } from "./library/dot/components/section/frameworks/ui/RenderField";
15
+ import { FieldSectionEventMappingBehaviourFactory } from "./library/dot/components/section/frameworks/ui/Section";
16
+ export const Behaviours = {
17
+ FieldSectionEventMappingBehaviourFactory
18
+ };
@@ -6,6 +6,8 @@ import TableColumnChooser from "../../../../legacy-to-new-arch/table-column-choo
6
6
  import Checkbox from "../../../../legacy-to-new-arch/checkbox/frameworks/ui/Checkbox";
7
7
  import TableColumnFilter from "../../../../legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilter";
8
8
  import MoreDropdown from "../../../../legacy-to-new-arch/more-dropdown/frameworks/ui/MoreDropdown";
9
+ import Breadcrumb from "../../../../legacy-to-new-arch/breadcrumb/frameworks/ui/Breadcrumb";
10
+ import IconButton from "../../../../legacy-to-new-arch/icon-button/frameworks/ui/IconButton";
9
11
  const ActionComponentMapping = {
10
12
  ['ActionIcon']: ActionIcon,
11
13
  ['Button']: Button,
@@ -14,6 +16,8 @@ const ActionComponentMapping = {
14
16
  ['TableColumnSort']: TableColumnSort,
15
17
  ['TableColumnChooser']: TableColumnChooser,
16
18
  ['TableSelectAll']: Checkbox,
17
- ['TableColumnFilter']: TableColumnFilter
19
+ ['TableColumnFilter']: TableColumnFilter,
20
+ ['Breadcrumb']: Breadcrumb,
21
+ ['IconButton']: IconButton
18
22
  };
19
23
  export default ActionComponentMapping;
@@ -10,7 +10,7 @@ export default class PropertiesChangeUseCase extends AbstractUseCase {
10
10
  currentActions,
11
11
  previousActions
12
12
  } = input;
13
- actionLocation.processActionsChange(currentActions, previousActions);
13
+ actionLocation.processActionsChange(previousActions, currentActions);
14
14
  presenter.updateActionLocation(actionLocation.toObject());
15
15
  }
16
16
 
@@ -32,14 +32,75 @@ function updateFieldValues(_ref) {
32
32
  fields
33
33
  };
34
34
  });
35
- }
35
+ } // const footerLeftActions = [{
36
+ // component: 'Button',
37
+ // location: 'footer_left_actions',
38
+ // properties: {
39
+ // text: 'Submit',
40
+ // palette: 'primaryFilled'
41
+ // },
42
+ // eventMappings: [
43
+ // {
44
+ // payloadValueMapping: {},
45
+ // sourceEvent: "BUTTON#CLICKED",
46
+ // id: "1234567890",
47
+ // targetEvent: "FORM#SUBMIT"
48
+ // }
49
+ // ]
50
+ // },
51
+ // {
52
+ // component: 'Button',
53
+ // location: 'footer_left_actions',
54
+ // properties: {
55
+ // text: 'Cancel',
56
+ // palette: 'secondary'
57
+ // },
58
+ // eventMappings: []
59
+ // }];
36
60
 
61
+
62
+ const headerLeftActions = [{
63
+ component: 'Breadcrumb',
64
+ properties: {
65
+ items: [{
66
+ id: 'customization',
67
+ text: 'Customization',
68
+ isLink: true
69
+ }, {
70
+ id: 'buttons',
71
+ text: 'Buttons',
72
+ isLink: true
73
+ }, {
74
+ id: 'new-button',
75
+ text: 'New Button',
76
+ isActive: true
77
+ }, {
78
+ id: 'kakarot',
79
+ text: 'Kakarot',
80
+ iconName: 'ZD-GN-department'
81
+ }]
82
+ },
83
+ eventMappings: []
84
+ }];
85
+ const headerRightActions = [{
86
+ component: 'IconButton',
87
+ properties: {
88
+ iconName: 'ZD-GN-infoStroke',
89
+ title: 'Help'
90
+ }
91
+ }];
37
92
  export function TransformState(state) {
38
93
  const {
39
94
  sections,
40
95
  isLoading,
41
96
  values,
42
- errorMessages
97
+ errorMessages,
98
+ isHeaderEnabled,
99
+ isFooterEnabled,
100
+ headerLeftActions,
101
+ headerRightActions,
102
+ footerLeftActions,
103
+ footerRightActions
43
104
  } = state.properties; // const { values, errorMessages } = state.behaviours.form;
44
105
 
45
106
  const updatedSections = updateFieldValues({
@@ -50,8 +111,14 @@ export function TransformState(state) {
50
111
  return { ...state,
51
112
  // properties: { ...state.properties, sections: updatedSections }
52
113
  viewModel: {
114
+ isHeaderEnabled,
115
+ isFooterEnabled,
53
116
  sections: updatedSections,
54
- isLoading
117
+ isLoading,
118
+ headerLeftActions,
119
+ headerRightActions,
120
+ footerLeftActions,
121
+ footerRightActions
55
122
  }
56
123
  };
57
124
  }
@@ -0,0 +1,28 @@
1
+ import { DefaultFormSectionUIType } from "../../../../../../cc/fields/field/FormDefaultUIType";
2
+ import ComponentRegistry from "../../../../../custom-component/frameworks/ui/ComponentRegistry";
3
+ import { TextArea, TextBox, Email, PickList, Currency, MultiSelect, Url, Percentage, Phone, Number, Decimal, Date, DateTime, Checkbox } from "../../../form-fields";
4
+ import EPHITag from "../../../form-fields/ephi-tag/frameworks/ui/EPHITag";
5
+ import InfoIcon from "../../../form-fields/info-icon/frameworks/ui/InfoIcon";
6
+ import Section from "../../../section/frameworks/ui/Section";
7
+ export function registerDefaultComponents() {
8
+ // Registering components in the ComponentRegistry
9
+ // NOTE: This is a workaround to avoid dynamic imports
10
+ // NOTE: register these components in place
11
+ ComponentRegistry.register('TextBox', TextBox);
12
+ ComponentRegistry.register('TextArea', TextArea);
13
+ ComponentRegistry.register('PickList', PickList);
14
+ ComponentRegistry.register('Email', Email);
15
+ ComponentRegistry.register('Currency', Currency);
16
+ ComponentRegistry.register('MultiSelect', MultiSelect);
17
+ ComponentRegistry.register('Url', Url);
18
+ ComponentRegistry.register('Percentage', Percentage);
19
+ ComponentRegistry.register('Phone', Phone);
20
+ ComponentRegistry.register('Number', Number);
21
+ ComponentRegistry.register('Decimal', Decimal);
22
+ ComponentRegistry.register('Date', Date);
23
+ ComponentRegistry.register('DateTime', DateTime);
24
+ ComponentRegistry.register('Checkbox', Checkbox);
25
+ ComponentRegistry.register('EPHITag', EPHITag);
26
+ ComponentRegistry.register('InfoIcon', InfoIcon);
27
+ ComponentRegistry.register(DefaultFormSectionUIType, Section);
28
+ }
@@ -3,6 +3,8 @@ import FormProperties from "../../../../../../cc/form/Properties";
3
3
  import FormView from "./FormView";
4
4
  import { TransformState } from "../../adapters/presenter/TransformState";
5
5
  import EventHandlersFactory from "./EventHandlerFactory";
6
+ import { registerDefaultComponents } from "./DefaultComponentRegister";
7
+ registerDefaultComponents();
6
8
  const Form = createCustomComponent({
7
9
  name: 'CustomForm',
8
10
  View: FormView,
@@ -1,8 +1,13 @@
1
1
  import React from 'react';
2
2
  import Loader from '@zohodesk/svg/es/v1/Loader/Loader';
3
+ import Flex from '@zohodesk/layout/es/Flex/Flex';
4
+ import FormAction, { LeftSide, RightSide } from '@zohodesk/dot/es/FormAction/FormAction';
3
5
  import SectionsWrapper from '@zohodesk-private/desk-components/es/form/SectionsWrapper/SectionsWrapper';
6
+ import FormHeader from '@zohodesk-private/desk-components/es/setup/SetupHeader/SetupHeader';
7
+ import MiddleContainer from '@zohodesk-private/desk-components/es/setup/SetupContent/SetupContent';
4
8
  import Sections from "./sub-components/Sections";
5
- import FormConstants from "../../../../../../cc/form/Constants"; // @ts-ignore
9
+ import ActionEventMediator from "../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
10
+ import { ActionViewGap } from "../../../../../../platform/client-actions/components/interfaces/ActionViewModel"; // @ts-ignore
6
11
 
7
12
  import style from "./css/Form.module.css";
8
13
 
@@ -11,36 +16,52 @@ function FormView(_ref, ref) {
11
16
  state,
12
17
  helpers
13
18
  } = _ref;
14
- const {
15
- dispatch
16
- } = helpers;
17
19
  const {
18
20
  sections,
19
- isLoading
21
+ isLoading,
22
+ headerLeftActions,
23
+ headerRightActions,
24
+ footerLeftActions,
25
+ footerRightActions,
26
+ isHeaderEnabled,
27
+ isFooterEnabled
20
28
  } = state.viewModel;
21
-
22
- const handleSubmit = e => {
23
- e.preventDefault();
24
- dispatch({
25
- type: FormConstants.FORM_SUBMIT
26
- });
27
- };
28
-
29
- return /*#__PURE__*/React.createElement("div", {
30
- className: style.formWrapper,
29
+ return /*#__PURE__*/React.createElement(Flex, {
30
+ $ui_tagName: "form",
31
+ $ui_displayMode: "flex",
32
+ $ui_direction: "column",
33
+ $flag_fullsize: true,
31
34
  ref: ref
32
- }, isLoading ?
33
- /*#__PURE__*/
34
- // Check for loading state
35
- React.createElement(Loader, null) : /*#__PURE__*/React.createElement(SectionsWrapper, null, /*#__PURE__*/React.createElement("button", {
36
- type: "submit",
37
- onClick: handleSubmit
38
- }, "Submit"), /*#__PURE__*/React.createElement(Sections, {
35
+ }, isHeaderEnabled && /*#__PURE__*/React.createElement(FormHeader, {
36
+ customId: "formHeader",
37
+ testId: "formHeader",
38
+ $render_leftElement: headerLeftActions.length > 0 ? /*#__PURE__*/React.createElement(ActionEventMediator, {
39
+ actions: headerLeftActions,
40
+ gap: ActionViewGap.MEDIUM
41
+ }) : null,
42
+ $render_rightElement: headerRightActions.length > 0 ? /*#__PURE__*/React.createElement(ActionEventMediator, {
43
+ actions: headerRightActions,
44
+ gap: ActionViewGap.MEDIUM
45
+ }) : null
46
+ }), /*#__PURE__*/React.createElement(MiddleContainer, {
47
+ $flag_padding: true,
48
+ $flag_greyBg: true,
49
+ $flag_childrenWrapper: true
50
+ }, isLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(SectionsWrapper, null, /*#__PURE__*/React.createElement(Sections, {
39
51
  sections: sections
40
- }), /*#__PURE__*/React.createElement("button", {
41
- type: "submit",
42
- onClick: handleSubmit
43
- }, "Submit")));
52
+ }))), isFooterEnabled && /*#__PURE__*/React.createElement(FormAction, {
53
+ size: "small",
54
+ paddingLeftSize: "xmedium",
55
+ paddingRightClass: style.footer
56
+ }, /*#__PURE__*/React.createElement(LeftSide, null, footerLeftActions.length > 0 && /*#__PURE__*/React.createElement(ActionEventMediator, {
57
+ testId: "formFooter_leftActions",
58
+ actions: footerLeftActions,
59
+ gap: ActionViewGap.LARGE
60
+ })), /*#__PURE__*/React.createElement(RightSide, null, footerRightActions.length > 0 && /*#__PURE__*/React.createElement(ActionEventMediator, {
61
+ testId: "formFooter_rightActions",
62
+ actions: footerRightActions,
63
+ gap: ActionViewGap.LARGE
64
+ }))));
44
65
  }
45
66
 
46
67
  export default FormView;
@@ -1,7 +1,3 @@
1
- .formWrapper {
2
- height: 100% ;
3
- }
4
-
5
1
  .fieldWrapper {
6
2
  position: relative
7
3
  }
@@ -30,4 +26,12 @@
30
26
  }
31
27
  .cursor_default {
32
28
  cursor: default
29
+ }
30
+
31
+ [dir=ltr] .footer {
32
+ padding-right: var(--zd_size32)
33
+ }
34
+
35
+ [dir=rtl] .footer {
36
+ padding-left: var(--zd_size32)
33
37
  }
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import DefaultSection from "../../../../section/frameworks/ui/Section";
3
2
  import ComponentRegistry from "../../../../../../custom-component/frameworks/ui/ComponentRegistry";
4
3
  export default function Sections(_ref) {
5
4
  let {
@@ -8,25 +7,26 @@ export default function Sections(_ref) {
8
7
  return sections.map(section => {
9
8
  const {
10
9
  id,
10
+ name,
11
11
  title,
12
12
  description,
13
+ isCollapsed,
13
14
  isVisible,
14
15
  fields,
15
- type
16
+ type,
17
+ additionalDetails
16
18
  } = section;
19
+ const Section = ComponentRegistry.get(type);
17
20
  if (isVisible === false) return null;
18
- let Section = DefaultSection;
19
-
20
- if (type) {
21
- Section = ComponentRegistry.get(type);
22
- }
23
-
24
21
  return /*#__PURE__*/React.createElement(Section, {
25
22
  key: id,
26
23
  id: id,
24
+ name: name,
27
25
  title: title,
28
26
  description: description,
29
- fields: fields
27
+ fields: fields,
28
+ isCollapsed: isCollapsed,
29
+ additionalDetails: additionalDetails
30
30
  });
31
31
  });
32
32
  }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import ComponentRegistry from "../../../../../custom-component/frameworks/ui/ComponentRegistry";
3
+ export function renderField(field, key) {
4
+ const {
5
+ type,
6
+ ...properties
7
+ } = field;
8
+ const Component = ComponentRegistry.get(type);
9
+
10
+ if (!Component) {
11
+ console.warn(`Component for type "${type}" not found.`);
12
+ return null;
13
+ }
14
+
15
+ return /*#__PURE__*/React.createElement(Component, {
16
+ key: key,
17
+ ...properties
18
+ });
19
+ }
@@ -2,14 +2,23 @@
2
2
  import { createCustomComponent } from "../../../../../custom-component";
3
3
  import { SectionProperties } from "../../../../../../cc/section";
4
4
  import SectionView from "./SectionView";
5
- import TransFormState from "../../adapters/presenter/TransFormState";
6
5
  import EventHandlersFactory from "./EventHandlerFactory";
6
+ export class FieldSectionEventMappingBehaviourFactory {
7
+ static create() {
8
+ return {
9
+ name: 'fieldSectionEventMapping',
10
+ setInitialState: () => ({}),
11
+ properties: {},
12
+ eventHandlers: EventHandlersFactory.create()
13
+ };
14
+ }
15
+
16
+ }
7
17
  let WrapSection = createCustomComponent({
8
18
  name: 'Section',
9
19
  View: SectionView,
10
20
  properties: SectionProperties,
11
- transformState: TransFormState,
12
- eventHandlers: EventHandlersFactory.create(),
13
- behaviours: []
21
+ eventHandlers: {},
22
+ behaviours: [FieldSectionEventMappingBehaviourFactory.create()]
14
23
  });
15
24
  export default WrapSection;
@@ -1,51 +1,30 @@
1
1
  import React from 'react';
2
- import ConvertSlotToComponent from "../../../../../slot/frameworks/ui/ConvertSlotToComponent";
3
2
  import Section from '@zohodesk-private/desk-components/es/setup/SetupFormBox/SetupFormBox';
4
3
  import FieldsLayout from '@zohodesk-private/desk-components/es/form/FieldsLayout/FieldsLayout';
5
- import ComponentRegistry from "../../../../../custom-component/frameworks/ui/ComponentRegistry";
6
- import { TextArea, TextBox, Email, PickList, Currency, MultiSelect, Url, Percentage, Phone, Number, Decimal, Date, DateTime, Checkbox } from "../../../form-fields";
7
- import EPHITag from "../../../form-fields/ephi-tag/frameworks/ui/EPHITag";
8
- import InfoIcon from "../../../form-fields/info-icon/frameworks/ui/InfoIcon"; // NOTE: This is a workaround to avoid dynamic imports
9
- // NOTE: register these components in place
10
-
11
- ComponentRegistry.register('TextBox', TextBox);
12
- ComponentRegistry.register('TextArea', TextArea);
13
- ComponentRegistry.register('PickList', PickList);
14
- ComponentRegistry.register('Email', Email);
15
- ComponentRegistry.register('Currency', Currency);
16
- ComponentRegistry.register('MultiSelect', MultiSelect);
17
- ComponentRegistry.register('Url', Url);
18
- ComponentRegistry.register('Percentage', Percentage);
19
- ComponentRegistry.register('Phone', Phone);
20
- ComponentRegistry.register('Number', Number);
21
- ComponentRegistry.register('Decimal', Decimal);
22
- ComponentRegistry.register('Date', Date);
23
- ComponentRegistry.register('DateTime', DateTime);
24
- ComponentRegistry.register('Checkbox', Checkbox);
25
- ComponentRegistry.register('EPHITag', EPHITag);
26
- ComponentRegistry.register('InfoIcon', InfoIcon);
4
+ import { renderField } from "./RenderField";
27
5
 
28
6
  function SectionView(_ref, ref) {
29
7
  let {
30
8
  state
31
9
  } = _ref;
32
10
  const {
33
- id,
11
+ name,
34
12
  title,
35
13
  description,
14
+ isCollapsed,
36
15
  fields
37
16
  } = state.properties;
38
17
  return /*#__PURE__*/React.createElement(Section, {
39
18
  $i18n_heading: title,
40
19
  $i18n_description: description,
41
- testId: id,
42
- customId: id,
20
+ testId: name,
21
+ customId: name,
43
22
  $tagAttributes_container: {
44
23
  ref
45
24
  }
46
- }, /*#__PURE__*/React.createElement(FieldsLayout, {
25
+ }, !isCollapsed && /*#__PURE__*/React.createElement(FieldsLayout, {
47
26
  $flag_topSpace: !!title || !!description
48
- }, ConvertSlotToComponent(fields)));
27
+ }, fields.filter(field => field.isVisible).map(field => renderField(field, field.name || field.apiName))));
49
28
  }
50
29
 
51
30
  export default SectionView;
@@ -1,45 +1,60 @@
1
1
  /* Default: no special styles */
2
2
  .tableListRow {
3
- /* */
3
+ /* Variable:Ignore */
4
+ --local-tableList-row-paddingLeft: var(--zd_size24);
4
5
  }
5
6
 
6
7
  /* Keyboard + Reorder + Selection */
7
8
  .tableListRow-kbdReorderSelection {
8
- --local-tableList-selectionColumn-width: 56px;
9
- --local-tableList-selectionColumn-left: 24px;
10
- --local-tableList-reorder-left: 8px;
9
+ /* Variable:Ignore */
10
+ --local-tableList-selectionColumn-width: var(--zd_size56);
11
+ /* Variable:Ignore */
12
+ --local-tableList-selectionColumn-left: var(--zd_size24);
13
+ /* Variable:Ignore */
14
+ --local-tableList-reorder-left: var(--zd_size8);
11
15
  }
12
16
 
13
17
  /* Keyboard + Reorder, no Selection */
14
18
  .tableListRow-kbdReorder {
15
- --local-tableList-reorder-left: 8px;
19
+ /* Variable:Ignore */
20
+ --local-tableList-reorder-left: var(--zd_size8);
16
21
  }
17
22
 
18
23
  /* Keyboard + Selection, no Reorder */
19
24
  .tableListRow-kbdSelection {
20
- --local-tableList-row-paddingLeft: 8px;
21
- --local-tableList-selectionColumn-width: 72px;
22
- --local-tableList-selectionColumn-left: 8px;
23
- --local-tableList-selectionColumn-paddingRight: 8px;
25
+ /* Variable:Ignore */
26
+ --local-tableList-row-paddingLeft: var(--zd_size8);
27
+ /* Variable:Ignore */
28
+ --local-tableList-selectionColumn-width: var(--zd_size72);
29
+ /* Variable:Ignore */
30
+ --local-tableList-selectionColumn-left: var(--zd_size8);
31
+ /* Variable:Ignore */
32
+ --local-tableList-selectionColumn-paddingRight: var(--zd_size8);
24
33
  --local-tableList-selectionColumn-justifyContent: center;
25
34
  }
26
35
 
27
36
  /* Keyboard only */
28
37
  .tableListRow-kbd {
29
- /* */
38
+ /* Variable:Ignore */
39
+ --local-tableList-row-paddingLeft: var(--zd_size24);
30
40
  }
31
41
 
32
42
  /* Reorder + Selection, no Keyboard */
33
43
  .tableListRow-reorderSelection {
34
- --local-tableList-selectionColumn-width: 56px;
35
- --local-tableList-selectionColumn-left: 24px;
36
- --local-tableList-selectionColumn-paddingRight: 16px;
37
- --local-tableList-reorder-paddingLeft: 8px;
44
+ /* Variable:Ignore */
45
+ --local-tableList-selectionColumn-width: var(--zd_size56);
46
+ /* Variable:Ignore */
47
+ --local-tableList-selectionColumn-left: var(--zd_size24);
48
+ /* Variable:Ignore */
49
+ --local-tableList-selectionColumn-paddingRight: var(--zd_size16);
50
+ /* Variable:Ignore */
51
+ --local-tableList-reorder-paddingLeft: var(--zd_size8);
38
52
  }
39
53
 
40
54
  /* Reorder only */
41
55
  .tableListRow-reorder {
42
- --local-tableList-reorder-paddingLeft: 8px;
56
+ /* Variable:Ignore */
57
+ --local-tableList-reorder-paddingLeft: var(--zd_size8);
43
58
  }
44
59
 
45
60
  /* Selection only */
@@ -49,52 +64,71 @@
49
64
 
50
65
  /* Default: no special styles */
51
66
  .tableListHeader {
52
- /* */
67
+ /* Variable:Ignore */
68
+ --local-tableList-header-paddingLeft: var(--zd_size24);
53
69
  }
54
70
 
55
71
  /* Keyboard + Reorder + Selection */
56
72
  .tableListHeader-kbdReorderSelection {
57
- --local-tableList-reorderHeader-paddingRight: 8px;
58
- --local-tableList-massActionHeader-left: 24px;
59
- --local-tableList-reorderHeader-left: 8px;
60
- --local-tableList-reorderHeader-width: 16px;
73
+ /* Variable:Ignore */
74
+ --local-tableList-reorderHeader-paddingRight: var(--zd_size8);
75
+ /* Variable:Ignore */
76
+ --local-tableList-massActionHeader-left: var(--zd_size24);
77
+ /* Variable:Ignore */
78
+ --local-tableList-reorderHeader-left: var(--zd_size8);
79
+ /* Variable:Ignore */
80
+ --local-tableList-reorderHeader-width: var(--zd_size16);
61
81
 
62
- --local-tableList-massActionHeader-left: 24px;
63
- --local-tableList-massActionHeader-paddingRight: 24px;
64
- --local-tableList-massActionHeader-width: 56px;
82
+ /* Variable:Ignore */
83
+ --local-tableList-massActionHeader-paddingRight: var(--zd_size24);
84
+ /* Variable:Ignore */
85
+ --local-tableList-massActionHeader-width: var(--zd_size56);
65
86
  }
66
87
 
67
88
  /* Keyboard + Reorder, no Selection */
68
89
  .tableListHeader-kbdReorder {
69
- --local-tableList-reorderHeader-left: 8px;
70
- --local-tableList-reorderHeader-paddingRight: 8px;
71
- --local-tableList-reorderHeader-width: 16px;
90
+ /* Variable:Ignore */
91
+ --local-tableList-reorderHeader-left: var(--zd_size8);
92
+ /* Variable:Ignore */
93
+ --local-tableList-reorderHeader-paddingRight: var(--zd_size8);
94
+ /* Variable:Ignore */
95
+ --local-tableList-reorderHeader-width: var(--zd_size16);
72
96
  }
73
97
 
74
98
  /* Reorder only */
75
99
  .tableListHeader-reorder {
76
- --local-tableList-reorderHeader-width: 24px;
100
+ /* Variable:Ignore */
101
+ --local-tableList-reorderHeader-width: var(--zd_size24);
77
102
  }
78
103
 
79
104
  /* Keyboard + Selection, no Reorder */
80
105
  .tableListHeader-kbdSelection {
81
- --local-tableList-header-paddingLeft: 8px;
82
- --local-tableList-massActionHeader-left: 8px;
83
- --local-tableList-massActionHeader-paddingRight: 8px;
84
- --local-tableList-massActionHeader-width: 72px;
106
+ /* Variable:Ignore */
107
+ --local-tableList-header-paddingLeft: var(--zd_size8);
108
+ /* Variable:Ignore */
109
+ --local-tableList-massActionHeader-left: var(--zd_size8);
110
+ /* Variable:Ignore */
111
+ --local-tableList-massActionHeader-paddingRight: var(--zd_size8);
112
+ /* Variable:Ignore */
113
+ --local-tableList-massActionHeader-width: var(--zd_size72);
85
114
  }
86
115
 
87
116
  /* Keyboard only */
88
117
  .tableListHeader-kbd {
89
- --local-tableList-header-paddingLeft: 24px;
118
+ /* Variable:Ignore */
119
+ --local-tableList-header-paddingLeft: var(--zd_size24);
90
120
  }
91
121
 
92
122
  /* Reorder + Selection, no Keyboard */
93
123
  .tableListHeader-reorderSelection {
94
- --local-tableList-reorderHeader-width: 24px;
95
- --local-tableList-massActionHeader-left: 24px;
96
- --local-tableList-massActionHeader-paddingRight: 24px;
97
- --local-tableList-massActionHeader-width: 56px;
124
+ /* Variable:Ignore */
125
+ --local-tableList-reorderHeader-width: var(--zd_size24);
126
+ /* Variable:Ignore */
127
+ --local-tableList-massActionHeader-left: var(--zd_size24);
128
+ /* Variable:Ignore */
129
+ --local-tableList-massActionHeader-paddingRight: var(--zd_size24);
130
+ /* Variable:Ignore */
131
+ --local-tableList-massActionHeader-width: var(--zd_size56);
98
132
  }
99
133
 
100
134
  /* Selection only */
@@ -206,12 +240,12 @@
206
240
 
207
241
  [dir=ltr] .dragHandleWrapper {
208
242
  left: var(--local-tableList-reorder-left, 0);
209
- padding: 0 var(--local-tableList-reorder-paddingRight, 0) 0 var(--local-tableList-reorder-paddingLeft, 0);
243
+ padding: 0 0 0 var(--local-tableList-reorder-paddingLeft, 0);
210
244
  }
211
245
 
212
246
  [dir=rtl] .dragHandleWrapper {
213
247
  right: var(--local-tableList-reorder-left, 0);
214
- padding: 0 var(--local-tableList-reorder-paddingLeft, 0) 0 var(--local-tableList-reorder-paddingRight, 0);
248
+ padding: 0 var(--local-tableList-reorder-paddingLeft, 0) 0 0;
215
249
  }
216
250
 
217
251
  .rowDropIndicator {
@@ -242,13 +276,11 @@
242
276
 
243
277
  [dir=ltr] .tableListSelectContainer {
244
278
  left: var(--local-tableList-selectionColumn-left, 0);
245
- padding-left: var(--local-tableList-selectionColumn-paddingLeft, 0);
246
279
  padding-right: var(--local-tableList-selectionColumn-paddingRight, 0);
247
280
  }
248
281
 
249
282
  [dir=rtl] .tableListSelectContainer {
250
283
  right: var(--local-tableList-selectionColumn-left, 0);
251
- padding-right: var(--local-tableList-selectionColumn-paddingLeft, 0);
252
284
  padding-left: var(--local-tableList-selectionColumn-paddingRight, 0);
253
285
  }
254
286