@zohodesk/library-platform 1.1.6-temp-1 → 1.1.7

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 (67) hide show
  1. package/es/bc/sdk/ResourceNamesEnum.js +1 -0
  2. package/es/bc/zform/Symbol.js +1 -0
  3. package/es/cc/breadcrumb/Constants.js +7 -0
  4. package/es/cc/breadcrumb/Events.js +14 -0
  5. package/es/cc/breadcrumb/Properties.js +35 -0
  6. package/es/cc/breadcrumb/index.js +3 -0
  7. package/es/cc/fields/index.js +2 -1
  8. package/es/cc/form-connected/SdkContract.js +159 -0
  9. package/es/cc/icon-button/Constants.js +7 -0
  10. package/es/cc/icon-button/Events.js +5 -0
  11. package/es/cc/icon-button/Properties.js +86 -0
  12. package/es/cc/icon-button/index.js +3 -0
  13. package/es/cc/section/Properties.js +9 -0
  14. package/es/cc/switch/Properties.js +2 -2
  15. package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +5 -1
  16. package/es/library/dot/components/form/adapters/presenter/TransformState.js +32 -2
  17. package/es/library/dot/components/form/frameworks/ui/sub-components/Sections.js +4 -2
  18. package/es/library/dot/components/section/frameworks/ui/SectionView.js +3 -5
  19. package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +72 -40
  20. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +1 -1
  21. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +2 -2
  22. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/Breadcrumb.js +12 -0
  23. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/BreadcrumbView.js +47 -0
  24. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/css/Breadcrumb.module.css +19 -0
  25. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/sub-components/BreadcrumbItem.js +58 -0
  26. package/es/library/dot/legacy-to-new-arch/icon-button/frameworks/ui/IconButton.js +12 -0
  27. package/es/library/dot/legacy-to-new-arch/icon-button/frameworks/ui/IconButtonView.js +43 -0
  28. package/es/library/dot/legacy-to-new-arch/switch/frameworks/ui/SwitchView.js +5 -5
  29. package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchFieldView.js +1 -0
  30. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +4 -0
  31. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +1 -1
  32. package/es/platform/components/form-connected/adapters/resources/SmartFormResources.js +210 -0
  33. package/es/platform/components/form-connected/application/interfaces/ISmartFormResources.js +1 -0
  34. package/es/platform/components/form-connected/frameworks/EventHandlersFactory.js +13 -6
  35. package/es/platform/components/form-connected/frameworks/FormConnectedFactory.js +27 -4
  36. package/es/platform/components/form-connected/frameworks/FormSdkFactory.js +33 -13
  37. package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +0 -52
  38. package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +52 -1
  39. package/es/platform/sdk/frameworks/Sdk.js +7 -0
  40. package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +13 -3
  41. package/es/platform/zform/applications/interfaces/input/DeleteFieldUseCaseInput.js +1 -0
  42. package/es/platform/zform/applications/interfaces/input/GetFieldValueUseCaseInput.js +1 -0
  43. package/es/platform/zform/applications/interfaces/input/HideFieldUseCaseInput.js +1 -0
  44. package/es/platform/zform/applications/interfaces/input/HideSectionUseCaseInput.js +1 -0
  45. package/es/platform/zform/applications/interfaces/input/InsertFieldUseCaseInput.js +1 -0
  46. package/es/platform/zform/applications/interfaces/input/SetFieldValueUseCaseInput.js +1 -0
  47. package/es/platform/zform/applications/interfaces/input/SetFieldsValuesUseCaseInput.js +1 -0
  48. package/es/platform/zform/applications/interfaces/input/ShowFieldUseCaseInput.js +1 -0
  49. package/es/platform/zform/applications/interfaces/input/ShowSectionUseCaseInput.js +1 -0
  50. package/es/platform/zform/applications/interfaces/input/SubmitUseCaseInput.js +1 -0
  51. package/es/platform/zform/applications/interfaces/input/UpdateFieldUseCaseInput.js +1 -0
  52. package/es/platform/zform/applications/usecases/DeleteFieldUseCase.js +22 -0
  53. package/es/platform/zform/applications/usecases/GetFieldValueUseCase.js +23 -0
  54. package/es/platform/zform/applications/usecases/HideFieldUseCase.js +19 -0
  55. package/es/platform/zform/applications/usecases/HideSectionUseCase.js +19 -0
  56. package/es/platform/zform/applications/usecases/InsertFieldUseCase.js +28 -0
  57. package/es/platform/zform/applications/usecases/SetFieldValueUseCase.js +44 -0
  58. package/es/platform/zform/applications/usecases/SetFieldsValuesUseCase.js +51 -0
  59. package/es/platform/zform/applications/usecases/ShowFieldUseCase.js +19 -0
  60. package/es/platform/zform/applications/usecases/ShowSectionUseCase.js +19 -0
  61. package/es/platform/zform/applications/usecases/SubmitUseCase.js +29 -0
  62. package/es/platform/zform/applications/usecases/UpdateFieldUseCase.js +22 -0
  63. package/es/platform/zform/domain/ZField.js +14 -0
  64. package/es/platform/zform/domain/ZForm.js +85 -3
  65. package/es/platform/zrecord/adapters/controllers/CreateRecordController.js +5 -1
  66. package/es/platform/zrecord/applications/usecases/CreateRecordUseCase.js +5 -3
  67. package/package.json +18 -19
@@ -1,5 +1,6 @@
1
1
  var ResourceNamesEnum = /*#__PURE__*/function (ResourceNamesEnum) {
2
2
  ResourceNamesEnum["SMART_TABLE"] = "smartTable";
3
+ ResourceNamesEnum["SMART_FORM"] = "smartForm";
3
4
  return ResourceNamesEnum;
4
5
  }(ResourceNamesEnum || {});
5
6
 
@@ -18,6 +18,7 @@ export const ZFORM_FIELD_VALUE_CHANGED = 'ZFORM#FIELD_VALUE_CHANGED';
18
18
  export const ZFORM_SET_FIELD_ERROR_MESSAGE = 'ZFORM#SET_FIELD_ERROR_MESSAGE';
19
19
  export const ZFORM_VALIDATE_FIELD_REQUEST = 'ZFORM#VALIDATE_FIELD_REQUEST';
20
20
  export const ZFORM_SUBMIT = 'ZFORM#SUBMIT_REQUEST';
21
+ export const ZFORM_CANCEL = 'ZFORM#CANCEL_REQUEST';
21
22
  export const ZFORM_VALIDATION_ERROR = 'ZFORM#VALIDATION_ERROR';
22
23
  export const ZFORM_VALIDATION_SUCCESS = 'ZFORM#VALIDATION_SUCCESS';
23
24
  export const ZFORM_VALIDATE_SUBMIT_FIELD_HAS_ERROR_MESSAGE = 'ZFORM#VALIDATE_SUBMIT_FIELD_HAS_ERROR_MESSAGE';
@@ -0,0 +1,7 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ class BreadcrumbConstants {}
4
+
5
+ _defineProperty(BreadcrumbConstants, "BREADCRUMB_ITEM_CLICKED", 'BREADCRUMB#ITEM_CLICKED');
6
+
7
+ export default BreadcrumbConstants;
@@ -0,0 +1,14 @@
1
+ import Constants from "./Constants";
2
+ export default [{
3
+ type: Constants.BREADCRUMB_ITEM_CLICKED,
4
+ payload: {
5
+ id: {
6
+ name: 'id',
7
+ typeMetadata: {
8
+ schema: {
9
+ type: 'string'
10
+ }
11
+ }
12
+ }
13
+ }
14
+ }];
@@ -0,0 +1,35 @@
1
+ export default {
2
+ items: {
3
+ defaultValue: [],
4
+ required: true,
5
+ typeMetadata: {
6
+ schema: {
7
+ type: 'array',
8
+ items: {
9
+ type: 'object',
10
+ properties: {
11
+ id: {
12
+ type: 'string'
13
+ },
14
+ text: {
15
+ type: 'string'
16
+ },
17
+ isLink: {
18
+ type: 'boolean'
19
+ },
20
+ iconName: {
21
+ type: 'string'
22
+ },
23
+ iconSize: {
24
+ type: 'string'
25
+ },
26
+ isActive: {
27
+ type: 'boolean'
28
+ }
29
+ }
30
+ },
31
+ required: ['id', 'text']
32
+ }
33
+ }
34
+ }
35
+ };
@@ -0,0 +1,3 @@
1
+ export { default as BreadcrumbProperties } from "./Properties";
2
+ export { default as BreadcrumbEvents } from "./Events";
3
+ export { default as BreadcrumbConstants } from "./Constants";
@@ -17,4 +17,5 @@ export { default as ColouredPickListFieldProperties } from "./coloured-pick-list
17
17
  export { default as TextFieldProperties } from "./text/Properties";
18
18
  export { default as UrlFieldProperties } from "./url/Properties";
19
19
  export { default as FormulaFieldProperties } from "./formula/Properties";
20
- export { default as FieldTypes } from "./field/Types";
20
+ export { default as FieldTypes } from "./field/Types";
21
+ export { default as FieldConstants } from "./field/Constants";
@@ -0,0 +1,159 @@
1
+ export const SdkContracts = {
2
+ hideSectionInputMeta: {
3
+ type: 'object',
4
+ properties: {
5
+ sectionName: {
6
+ type: 'string',
7
+ minLength: 1
8
+ }
9
+ },
10
+ required: ['sectionName']
11
+ },
12
+ showSectionInputMeta: {
13
+ type: 'object',
14
+ properties: {
15
+ sectionName: {
16
+ type: 'string',
17
+ minLength: 1
18
+ }
19
+ },
20
+ required: ['sectionName']
21
+ },
22
+ hideFieldInputMeta: {
23
+ type: 'object',
24
+ properties: {
25
+ fieldName: {
26
+ type: 'string',
27
+ minLength: 1
28
+ }
29
+ },
30
+ required: ['fieldName']
31
+ },
32
+ showFieldInputMeta: {
33
+ type: 'object',
34
+ properties: {
35
+ fieldName: {
36
+ type: 'string',
37
+ minLength: 1
38
+ }
39
+ },
40
+ required: ['fieldName']
41
+ },
42
+ setFieldValueInputMeta: {
43
+ type: 'object',
44
+ properties: {
45
+ fieldName: {
46
+ type: 'string',
47
+ minLength: 1
48
+ },
49
+ newValue: {}
50
+ },
51
+ required: ['fieldName', 'newValue']
52
+ },
53
+ setFieldsValueInputMeta: {
54
+ type: 'object',
55
+ properties: {
56
+ fieldsValuesObj: {
57
+ type: 'object'
58
+ }
59
+ },
60
+ required: ['fieldsValuesObj']
61
+ },
62
+ insertFieldInputMeta: {
63
+ type: 'object',
64
+ properties: {
65
+ sectionName: {
66
+ type: 'string',
67
+ minLength: 1
68
+ },
69
+ fieldsObj: {
70
+ type: 'object'
71
+ },
72
+ fieldIndex: {
73
+ type: 'number'
74
+ }
75
+ },
76
+ required: ['sectionName', 'fieldsObj', 'fieldIndex']
77
+ },
78
+ deleteFieldInputMeta: {
79
+ type: 'object',
80
+ properties: {
81
+ fieldName: {
82
+ type: 'string',
83
+ minLength: 1
84
+ }
85
+ },
86
+ required: ['fieldName']
87
+ },
88
+ updateFieldInputMeta: {
89
+ properties: {
90
+ fieldName: {
91
+ type: 'string',
92
+ minLength: 1
93
+ },
94
+ fieldProperties: {
95
+ type: 'object',
96
+ properties: {
97
+ displayLabel: {
98
+ type: 'string'
99
+ },
100
+ i18NLabel: {
101
+ type: 'string'
102
+ },
103
+ isReadOnly: {
104
+ type: 'boolean'
105
+ },
106
+ maxLength: {
107
+ type: 'number'
108
+ },
109
+ isMandatory: {
110
+ type: 'boolean'
111
+ },
112
+ value: {},
113
+ // You can specify a more detailed type if known
114
+ errorMessage: {
115
+ type: 'string'
116
+ },
117
+ isVisible: {
118
+ type: 'boolean'
119
+ },
120
+ pickListValues: {
121
+ type: 'array',
122
+ items: {
123
+ type: 'object',
124
+ properties: {
125
+ value: {
126
+ type: 'string'
127
+ }
128
+ }
129
+ }
130
+ },
131
+ defaultPickListValues: {
132
+ type: 'array',
133
+ items: {
134
+ type: 'object',
135
+ properties: {
136
+ value: {
137
+ type: 'string'
138
+ }
139
+ }
140
+ }
141
+ },
142
+ toolTip: {
143
+ type: 'string'
144
+ }
145
+ }
146
+ }
147
+ }
148
+ },
149
+ getFieldValueInputMeta: {
150
+ type: 'object',
151
+ properties: {
152
+ fieldName: {
153
+ type: 'string',
154
+ minLength: 1
155
+ }
156
+ },
157
+ required: ['fieldName']
158
+ }
159
+ };
@@ -0,0 +1,7 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ class IconButtonConstants {}
4
+
5
+ _defineProperty(IconButtonConstants, "ICON_BUTTON_CLICKED", 'ICON_BUTTON#CLICKED');
6
+
7
+ export default IconButtonConstants;
@@ -0,0 +1,5 @@
1
+ import Constants from "./Constants";
2
+ export default [{
3
+ type: Constants.ICON_BUTTON_CLICKED,
4
+ payload: {}
5
+ }];
@@ -0,0 +1,86 @@
1
+ export default {
2
+ palette: {
3
+ defaultValue: 'default',
4
+ required: false,
5
+ typeMetadata: {
6
+ schema: {
7
+ type: 'string',
8
+ enum: ['primary', 'primaryFilled', 'default']
9
+ }
10
+ }
11
+ },
12
+ iconSize: {
13
+ defaultValue: '14',
14
+ required: false,
15
+ typeMetadata: {
16
+ schema: {
17
+ type: 'string'
18
+ }
19
+ }
20
+ },
21
+ size: {
22
+ defaultValue: 'large',
23
+ required: false,
24
+ typeMetadata: {
25
+ schema: {
26
+ type: 'string',
27
+ enum: ['xsmall', 'small', 'medium', 'large', 'xlarge']
28
+ }
29
+ }
30
+ },
31
+ iconName: {
32
+ defaultValue: '',
33
+ required: false,
34
+ typeMetadata: {
35
+ schema: {
36
+ type: 'string'
37
+ }
38
+ }
39
+ },
40
+ isActive: {
41
+ defaultValue: false,
42
+ required: false,
43
+ typeMetadata: {
44
+ schema: {
45
+ type: 'boolean'
46
+ }
47
+ }
48
+ },
49
+ isDisabled: {
50
+ defaultValue: false,
51
+ required: false,
52
+ typeMetadata: {
53
+ schema: {
54
+ type: 'boolean'
55
+ }
56
+ }
57
+ },
58
+ hoverType: {
59
+ defaultValue: 'default',
60
+ required: false,
61
+ typeMetadata: {
62
+ schema: {
63
+ type: 'string',
64
+ enum: ['default', 'border', 'bg']
65
+ }
66
+ }
67
+ },
68
+ title: {
69
+ defaultValue: '',
70
+ required: false,
71
+ typeMetadata: {
72
+ schema: {
73
+ type: 'string'
74
+ }
75
+ }
76
+ },
77
+ isBold: {
78
+ defaultValue: false,
79
+ required: false,
80
+ typeMetadata: {
81
+ schema: {
82
+ type: 'boolean'
83
+ }
84
+ }
85
+ }
86
+ };
@@ -0,0 +1,3 @@
1
+ export { default as IconButtonProperties } from "./Properties";
2
+ export { default as IconButtonEvents } from "./Events";
3
+ export { default as IconButtonConstants } from "./Constants";
@@ -74,6 +74,15 @@ export default {
74
74
  }
75
75
  }
76
76
  },
77
+ additionalDetails: {
78
+ required: false,
79
+ defaultValue: {},
80
+ typeMetadata: {
81
+ schema: {
82
+ type: 'object'
83
+ }
84
+ }
85
+ },
77
86
  fields: {
78
87
  required: false,
79
88
  typeMetadata: {
@@ -19,11 +19,11 @@ export default {
19
19
  },
20
20
  size: {
21
21
  required: true,
22
- defaultValue: "medium",
22
+ defaultValue: "small",
23
23
  typeMetadata: {
24
24
  schema: {
25
25
  type: "string",
26
- enum: ["small", "medium", "large", "xlarge"]
26
+ enum: ["small", "medium"]
27
27
  }
28
28
  }
29
29
  },
@@ -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;
@@ -54,6 +54,36 @@ const footerLeftActions = [{
54
54
  },
55
55
  eventMappings: []
56
56
  }];
57
+ const headerLeftActions = [{
58
+ component: 'Breadcrumb',
59
+ properties: {
60
+ items: [{
61
+ id: 'customization',
62
+ text: 'Customization',
63
+ isLink: true
64
+ }, {
65
+ id: 'buttons',
66
+ text: 'Buttons',
67
+ isLink: true
68
+ }, {
69
+ id: 'new-button',
70
+ text: 'New Button',
71
+ isActive: true
72
+ }, {
73
+ id: 'kakarot',
74
+ text: 'Kakarot',
75
+ iconName: 'ZD-GN-department'
76
+ }]
77
+ },
78
+ eventMappings: []
79
+ }];
80
+ const headerRightActions = [{
81
+ component: 'IconButton',
82
+ properties: {
83
+ iconName: 'ZD-GN-infoStroke',
84
+ title: 'Help'
85
+ }
86
+ }];
57
87
  export function TransformState(state) {
58
88
  const {
59
89
  sections,
@@ -72,8 +102,8 @@ export function TransformState(state) {
72
102
  viewModel: {
73
103
  sections: updatedSections,
74
104
  isLoading,
75
- headerLeftActions: [],
76
- headerRightActions: [],
105
+ headerLeftActions: headerLeftActions,
106
+ headerRightActions: headerRightActions,
77
107
  footerLeftActions,
78
108
  footerRightActions: []
79
109
  }
@@ -7,24 +7,26 @@ export default function Sections(_ref) {
7
7
  return sections.map(section => {
8
8
  const {
9
9
  id,
10
+ name,
10
11
  title,
11
12
  description,
12
13
  isCollapsed,
13
14
  isVisible,
14
15
  fields,
15
16
  type,
16
- ...extraProps
17
+ additionalDetails
17
18
  } = section;
18
19
  const Section = ComponentRegistry.get(type);
19
20
  if (isVisible === false) return null;
20
21
  return /*#__PURE__*/React.createElement(Section, {
21
22
  key: id,
22
23
  id: id,
24
+ name: name,
23
25
  title: title,
24
26
  description: description,
25
27
  fields: fields,
26
28
  isCollapsed: isCollapsed,
27
- ...extraProps
29
+ additionalDetails: additionalDetails
28
30
  });
29
31
  });
30
32
  }
@@ -8,7 +8,6 @@ function SectionView(_ref, ref) {
8
8
  state
9
9
  } = _ref;
10
10
  const {
11
- id,
12
11
  name,
13
12
  title,
14
13
  description,
@@ -18,11 +17,10 @@ function SectionView(_ref, ref) {
18
17
  return /*#__PURE__*/React.createElement(Section, {
19
18
  $i18n_heading: title,
20
19
  $i18n_description: description,
21
- testId: id,
22
- customId: id,
20
+ testId: name,
21
+ customId: name,
23
22
  $tagAttributes_container: {
24
- ref,
25
- 'data-section-name': name
23
+ ref
26
24
  }
27
25
  }, !isCollapsed && /*#__PURE__*/React.createElement(FieldsLayout, {
28
26
  $flag_topSpace: !!title || !!description