@zohodesk/library-platform 1.1.3-exp.4 → 1.1.3-temp-1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/ChangeLogs.md +201 -0
  2. package/README.md +1 -1
  3. package/es/bc/zform/Symbol.js +1 -0
  4. package/es/cc/form/Constants.js +2 -0
  5. package/es/cc/form/Events.js +20 -0
  6. package/es/cc/form-connected/Constants.js +13 -0
  7. package/es/cc/section/Constants.js +2 -0
  8. package/es/cc/section/Events.js +20 -0
  9. package/es/library/dot/components/form/frameworks/ui/EventHandlerFactory.js +23 -3
  10. package/es/library/dot/components/form/frameworks/ui/FormView.js +6 -3
  11. package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +4 -0
  12. package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +1 -0
  13. package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +1 -0
  14. package/es/library/dot/components/form-fields/date/frameworks/ui/DateView.js +1 -0
  15. package/es/library/dot/components/form-fields/datetime/frameworks/ui/DateTimeView.js +1 -0
  16. package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +1 -0
  17. package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +1 -0
  18. package/es/library/dot/components/form-fields/multi-select/frameworks/ui/MultiSelectView.js +1 -0
  19. package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +1 -0
  20. package/es/library/dot/components/form-fields/percentage/frameworks/ui/PercentageView.js +1 -0
  21. package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +1 -0
  22. package/es/library/dot/components/form-fields/pick-list/frameworks/ui/PickListView.js +1 -0
  23. package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +1 -0
  24. package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +1 -0
  25. package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +1 -0
  26. package/es/library/dot/components/section/frameworks/ui/EventHandlerFactory.js +26 -3
  27. package/es/platform/components/form-connected/frameworks/EventHandlersFactory.js +68 -1
  28. package/es/platform/zform/adapters/controllers/FieldValueChangeController.js +10 -3
  29. package/es/platform/zform/applications/usecases/FieldValueChangeRequestUseCase.js +13 -1
  30. package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +8 -2
  31. package/package.json +9 -9
  32. package/es/library/custom-component/frameworks/object-path-immutable/ImmutableHelper.js +0 -5
package/ChangeLogs.md ADDED
@@ -0,0 +1,201 @@
1
+ # Change Logs
2
+
3
+
4
+ ### 1.1.3-exp.4
5
+ **Issue Fix**
6
+ - Global SDK
7
+ - i18n support
8
+ - custom-component props translator
9
+
10
+ - supported client actions context variable recordsLength ex : {{@context.recordsLength}}
11
+ -
12
+ **Breaking Changes**
13
+ - removed `desk-frameworks` and moved TableConnected and FormConnected into `platform/components` folder, So you should only import package not path inside (NOTE: those are un recommenced way, So we removed )
14
+
15
+
16
+ ### 1.1.3-exp.1
17
+ **Issue Fix**
18
+ - Global SDK
19
+ - i18n support
20
+ - custom-component props translator
21
+
22
+
23
+ ### 1.1.4 – Context resolution fix
24
+ - Fixed: Resolved an issue where "record.name" was working for condition field in client action instead of {{@context.record.name}}.
25
+
26
+ - Syntax matches documentation for condition field in client actions
27
+
28
+ ### 1.1.3 – Bug Fixes
29
+ - Fixed: Resolved an issue in infinite scroll where API calls were repeatedly triggered unnecessarily or failed to stop at the end of the list.
30
+
31
+ - Prevented redundant API calls during fast scroll.
32
+ - Ensured correct detection of end-of-data to stop further fetching.
33
+
34
+ ### 1.1.2-exp.0
35
+ **Issue Fix**
36
+ - More scroll issue fix (record-api infinite fail handling)
37
+
38
+
39
+ ### 1.1.2
40
+ **Feature**
41
+ - In core component , Added the SLOT
42
+ ### 1.1.1-exp.6
43
+ **Feature**
44
+ - Supported the `routing` param in `context` for **filter** and added the **TableColumnFilter** component for client actions.
45
+
46
+ ## 🔄 Breaking Changes
47
+
48
+ ### 1. `dataBroker` → `dataSource`
49
+ - **Old:** `dataBroker` → **New:** `dataSource`
50
+ - **Update your configurations to use `dataSource` instead of `dataBroker`.**
51
+
52
+ ### 2. `limit` (Deprecated)
53
+ - **`limit` is now deprecated.**
54
+ - **Module-based usage:** Fetch count is managed internally.
55
+ - **Non-module use cases:** Use `get-records` in `apiTemplates` for customization.
56
+
57
+ ### 3. `uiMapping` → `componentMapping`
58
+ - **Old:** `uiMapping` → **New:** `componentMapping`
59
+ - **Customization for fields, `emptyState`, and UI parts.**
60
+ - **Row Actions:** Now handled through `clientActions` (deprecated in `componentMapping`).
61
+
62
+ ### 4. `pageContext` → `context`
63
+ - **Old:** `pageContext` → **New:** `context`
64
+ - **Used for variable replacement in `apiTemplates` and `clientActions`.**
65
+ - **Allowed Keys:** `departmentName`, `orgName`, `orgId`
66
+
67
+ ### 5. `record.name`,`field.name`,`departmentId` → `{{@context.record.name}}`,`{{@context.field.name}}`,`{{@context.departmentId}}`
68
+ - **Old:** `record.name`,`field.name`,`departmentId` → **New:** `{{@context.record.name}}`,`{{@context.field.name}}`,`{{@context.departmentId}}`
69
+ - **Used for variable replacement in `clientActions`.**
70
+ - **Allowed Keys:** `departmentName`, `orgName`, `orgId`,`record`,`field`
71
+
72
+
73
+ ## 📥 Filter Changes
74
+ - **`departmentId` and `viewId` moved to top-level properties in `smart-table-list`.**
75
+ - **On `departmentId` change:** Fields & records are re-fetched.
76
+ - **On `viewId` change:** Only records are re-fetched (UI updates on client-side).
77
+
78
+
79
+ ## 🛠️ New: `preference` Object
80
+ - **Holds user-facing display preferences.**
81
+ - **`isFlexibleColumns` moved to `preference.autoColumnSizing`.**
82
+ - **`autoColumnSizing` (boolean):** Adjusts column width to fit content (avoids scrolling).
83
+
84
+ **Feature**
85
+
86
+ - Row Actions `properties` template support added
87
+
88
+ **Internal Changes**
89
+
90
+ - Component and Behaviour properties are merged in custom-component
91
+ - defaultValue not assigned from JSON schema - **Issue Fixed**
92
+ - In Row data, "rowActions" renamed as "rowActionLocation"
93
+ - Properties properly defined for table-list, table-connected, action-location, zlist, zhttp, sort-by, list-selection
94
+ - `PropertiesConverter` implemented in cc/component
95
+ - refactor: update field types to use simplified naming conventions
96
+ - chore: remove unused redux-modules dependency and update testing libraries
97
+ - TableListView - hasRowActions property removed. rowActionsConfig property added with hasActions and columnWidth.
98
+ - Column size and align translator added
99
+ - `rowCursor` property introduced in the TableListView
100
+ - TableListView - Select All checkbox component updated
101
+ - TableListView - Header size property updated as width
102
+
103
+ **Bug Fixes**
104
+
105
+ - Set initial state not working for SortBy behaviour - **Issue Fixed**
106
+
107
+ ### `1.0.2`
108
+
109
+ **Changes**:
110
+ add new exports for BC and CC modules, including SortBy and ZHttp constants
111
+
112
+ ### `1.0.1`
113
+
114
+ **Changes**: add new index files for BC and CC modules, export field properties and components
115
+
116
+ **Bug Fixes**
117
+
118
+ Resolved an issue with case-sensitive file names in the npm registry that was causing errors with the **cases-sensitive-webpack-plugin**. The following files were affected due to discrepancies in case sensitivity:
119
+
120
+ - `@zohodesk/library-platform/es/platform/data-broker/utils/transformer/CreateCf.js`
121
+ - `@zohodesk/library-platform/es/platform/data-broker/utils/transformer/createCf.js`
122
+ - `@zohodesk/library-platform/es/platform/data-broker/utils/transformer/Transformer.js`
123
+ - `@zohodesk/library-platform/es/platform/data-broker/utils/transformer/transformer.js`
124
+
125
+ The case sensitivity issue has now been fixed.
126
+
127
+ ### `1.0.0`
128
+
129
+ with changes from `1.0.0-exp.6`
130
+ **Features:**
131
+
132
+ - From this version on below fields custom events will receive `rowId` as payload on table level event listeners
133
+ - Currency
134
+ - SingleLine
135
+ - MultiLine
136
+ - Number
137
+ - Decimal
138
+ - URL
139
+ - Email
140
+ - Phone
141
+ - Currency
142
+ - Percentage
143
+ - Date
144
+ - DateTime
145
+ - PickList
146
+ - MultiSelect
147
+ - LookUp
148
+
149
+ **Bug Fixes**
150
+
151
+ - in http-behaviour if fetch response status code 422 or some similar status code did not consider
152
+ as failed **issue fixed**
153
+
154
+ **Internal Changes**
155
+
156
+ - add initial interfaces and types for zdata-broker module
157
+ - zdata-broker behaviour separated form zrecord and zfield
158
+ - add FetchStateStop use case and controller, enhance event handling
159
+
160
+ ### `1.0.0-exp.6`
161
+
162
+ with changes from `1.0.0-exp.4`
163
+ **Features:**
164
+
165
+ - `isFlexibleColumns` support added for TableConnected
166
+
167
+ **Bug Fixes**
168
+
169
+ - in record actions post and patch request goes as GET **issue fixed**
170
+
171
+ ### `1.0.0-exp.4`
172
+
173
+ **Features:**
174
+
175
+ - `getRecord` zlist sdk added
176
+ - `deleteRecord` zlist sdk added
177
+ - Success and Failure Events of updateRecord and deleteRecord support added
178
+ - `ZLIST#RECORD_UPDATE_SUCCEEDED`
179
+ - `ZLIST#RECORD_UPDATE_FAILED`
180
+ - `ZLIST#RECORD_DELETE_SUCCEEDED`
181
+ - `ZLIST#RECORD_DELETE_FAILED`
182
+ - **Boolean** Field appendToActionPayload logic added for custom event, for table level event listen and `rowId` payload
183
+ - data-broker `getResponse` support for json support added
184
+
185
+ **Bug Fixes**
186
+
187
+ - unwanted loading state other then Record Fetch removed
188
+ - no content `records` api 204 issue fix
189
+ - when refetch triggered before record success then refetch and record Fetch data both appended issue fixed
190
+ - when next record Fetch call from value triggered one number previous, So duplicate data added end of each set next record request
191
+
192
+ ### `1.0.0-exp.2`
193
+
194
+ #### Added
195
+
196
+ - Initial experimental release.
197
+
198
+
199
+ ***Features:**
200
+
201
+ - `Client Action : zclient-actions` behaviour added
package/README.md CHANGED
@@ -80,4 +80,4 @@ The `TableConnectedFactory.create` method accepts the following parameters:
80
80
  - **EventHandlersFactory**: Factory to manage event handlers for the component.
81
81
  - **Behaviour Factories**: Include various behaviours such as HTTP requests, field management, and list rendering.
82
82
  - **ComponentRegistry**: Singleton for managing component instances across your application.
83
- - **createCustomComponent**: Function to create custom components with necessary dependencies and lifecycle methods.
83
+ - **createCustomComponent**: Function to create custom components with necessary dependencies and lifecycle methods.
@@ -14,6 +14,7 @@ export const ZFORM_LAYOUT_RULES_REQUEST = 'ZFORM#LAYOUT_RULES_REQUEST';
14
14
  export const ZFORM_LAYOUT_RULES_SUCCESS = 'ZFORM#LAYOUT_RULES_SUCCESS';
15
15
  export const ZFORM_LAYOUT_RULES_FAILURE = 'ZFORM#LAYOUT_RULES_FAILURE';
16
16
  export const ZFORM_FIELD_VALUE_CHANGE_REQUEST = 'ZFORM#FIELD_VALUE_CHANGE_REQUEST';
17
+ export const ZFORM_FIELD_VALUE_CHANGED = 'ZFORM#FIELD_VALUE_CHANGED';
17
18
  export const ZFORM_SET_FIELD_ERROR_MESSAGE = 'ZFORM#SET_FIELD_ERROR_MESSAGE';
18
19
  export const ZFORM_VALIDATE_FIELD_REQUEST = 'ZFORM#VALIDATE_FIELD_REQUEST';
19
20
  export const ZFORM_SUBMIT = 'ZFORM#SUBMIT_REQUEST';
@@ -2,6 +2,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
2
2
 
3
3
  class FormConstants {}
4
4
 
5
+ _defineProperty(FormConstants, "FORM_FIELD_FOCUSED", 'FORM#FIELD_FOCUSED');
6
+
5
7
  _defineProperty(FormConstants, "FORM_FIELD_BLURRED", 'FORM#FIELD_BLURRED');
6
8
 
7
9
  _defineProperty(FormConstants, "FORM_FIELD_VALUE_CHANGE_REQUEST", 'FORM#FIELD_VALUE_CHANGE_REQUEST');
@@ -1,5 +1,25 @@
1
1
  import FormConstants from "./Constants";
2
2
  const Events = [{
3
+ type: FormConstants.FORM_FIELD_FOCUSED,
4
+ payload: {
5
+ sectionId: {
6
+ name: 'sectionId',
7
+ typeMetadata: {
8
+ schema: {
9
+ type: 'string'
10
+ }
11
+ }
12
+ },
13
+ fieldName: {
14
+ name: 'fieldName',
15
+ typeMetadata: {
16
+ schema: {
17
+ type: 'string'
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }, {
3
23
  type: FormConstants.FORM_FIELD_BLURRED,
4
24
  payload: {
5
25
  sectionId: {
@@ -0,0 +1,13 @@
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 SmartFormConstants {}
4
+
5
+ _defineProperty(SmartFormConstants, "SMART_FORM_FIELD_FOCUSED", 'SMART_FORM#FIELD_FOCUSED');
6
+
7
+ _defineProperty(SmartFormConstants, "SMART_FORM_FIELD_BLURRED", 'SMART_FORM#FIELD_BLURRED');
8
+
9
+ _defineProperty(SmartFormConstants, "SMART_FORM_FIELD_VALUE_CHANGED", 'SMART_FORM#FIELD_VALUE_CHANGED');
10
+
11
+ _defineProperty(SmartFormConstants, "SMART_FORM_SUBMIT", 'SMART_FORM#SUBMIT');
12
+
13
+ export default SmartFormConstants;
@@ -2,6 +2,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
2
2
 
3
3
  class SectionConstants {}
4
4
 
5
+ _defineProperty(SectionConstants, "SECTION_FIELD_FOCUSED", 'SECTION#FIELD_FOCUSED');
6
+
5
7
  _defineProperty(SectionConstants, "SECTION_FIELD_BLURRED", 'SECTION#FIELD_BLURRED');
6
8
 
7
9
  _defineProperty(SectionConstants, "SECTION_FIELD_CHANGED", 'SECTION#FIELD_VALUE_CHANGED');
@@ -1,5 +1,25 @@
1
1
  import SectionConstants from "./Constants";
2
2
  const Events = [{
3
+ type: SectionConstants.SECTION_FIELD_FOCUSED,
4
+ payload: {
5
+ id: {
6
+ name: 'id',
7
+ typeMetadata: {
8
+ schema: {
9
+ type: 'string'
10
+ }
11
+ }
12
+ },
13
+ fieldName: {
14
+ name: 'fieldName',
15
+ typeMetadata: {
16
+ schema: {
17
+ type: 'string'
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }, {
3
23
  type: SectionConstants.SECTION_FIELD_BLURRED,
4
24
  payload: {
5
25
  id: {
@@ -4,12 +4,13 @@ import FormConstants from "../../../../../../cc/form/Constants";
4
4
  class EventHandlersFactory {
5
5
  static create() {
6
6
  return {
7
+ [SectionConstants.SECTION_FIELD_FOCUSED]: this.handleSectionFieldFocused,
7
8
  [SectionConstants.SECTION_FIELD_BLURRED]: this.handleSectionFieldBlurred,
8
9
  [SectionConstants.SECTION_FIELD_CHANGED]: this.handleSectionFieldChanged
9
10
  };
10
11
  }
11
12
 
12
- static handleSectionFieldBlurred(_ref) {
13
+ static handleSectionFieldFocused(_ref) {
13
14
  let {
14
15
  action,
15
16
  dispatch
@@ -19,7 +20,7 @@ class EventHandlersFactory {
19
20
  fieldName
20
21
  } = action.payload;
21
22
  dispatch({
22
- type: FormConstants.FORM_FIELD_BLURRED,
23
+ type: FormConstants.FORM_FIELD_FOCUSED,
23
24
  payload: {
24
25
  sectionId,
25
26
  fieldName
@@ -28,11 +29,30 @@ class EventHandlersFactory {
28
29
  });
29
30
  }
30
31
 
31
- static handleSectionFieldChanged(_ref2) {
32
+ static handleSectionFieldBlurred(_ref2) {
32
33
  let {
33
34
  action,
34
35
  dispatch
35
36
  } = _ref2;
37
+ const {
38
+ id: sectionId,
39
+ fieldName
40
+ } = action.payload;
41
+ dispatch({
42
+ type: FormConstants.FORM_FIELD_BLURRED,
43
+ payload: {
44
+ sectionId,
45
+ fieldName
46
+ },
47
+ metaData: {}
48
+ });
49
+ }
50
+
51
+ static handleSectionFieldChanged(_ref3) {
52
+ let {
53
+ action,
54
+ dispatch
55
+ } = _ref3;
36
56
  const {
37
57
  id: sectionId,
38
58
  fieldName,
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
- import FormConstants from "../../../../../../cc/form/Constants";
2
+ import Loader from '@zohodesk/svg/es/v1/Loader/Loader';
3
3
  import SectionsWrapper from '@zohodesk-private/desk-components/es/form/SectionsWrapper/SectionsWrapper';
4
4
  import Sections from "./sub-components/Sections";
5
+ import FormConstants from "../../../../../../cc/form/Constants"; // @ts-ignore
6
+
7
+ import style from "./css/Form.module.css";
5
8
 
6
9
  function FormView(_ref, ref) {
7
10
  let {
@@ -24,12 +27,12 @@ function FormView(_ref, ref) {
24
27
  };
25
28
 
26
29
  return /*#__PURE__*/React.createElement("div", {
30
+ className: style.formWrapper,
27
31
  ref: ref
28
32
  }, isLoading ?
29
33
  /*#__PURE__*/
30
34
  // Check for loading state
31
- React.createElement("div", null, "Loading...") // Display loading indicator
32
- : /*#__PURE__*/React.createElement(SectionsWrapper, null, /*#__PURE__*/React.createElement("button", {
35
+ React.createElement(Loader, null) : /*#__PURE__*/React.createElement(SectionsWrapper, null, /*#__PURE__*/React.createElement("button", {
33
36
  type: "submit",
34
37
  onClick: handleSubmit
35
38
  }, "Submit"), /*#__PURE__*/React.createElement(Sections, {
@@ -1,3 +1,7 @@
1
+ .formWrapper {
2
+ height: 100% ;
3
+ }
4
+
1
5
  .fieldWrapper {
2
6
  position: relative
3
7
  }
@@ -37,6 +37,7 @@ function CheckboxView(_ref2, ref) {
37
37
  } = state.viewModel;
38
38
  const isEditable = !disabled && !readonly;
39
39
  return /*#__PURE__*/React.createElement("div", {
40
+ "data-test-id": "smart_form_field_checkbox",
40
41
  ref: ref,
41
42
  className: style.fieldWrapper
42
43
  }, /*#__PURE__*/React.createElement(FieldController, {
@@ -21,6 +21,7 @@ function CurrencyView(_ref, ref) {
21
21
  actions
22
22
  } = state.properties;
23
23
  return /*#__PURE__*/React.createElement("div", {
24
+ "data-test-id": "smart_form_field_currency",
24
25
  ref: ref,
25
26
  className: style.fieldWrapper
26
27
  }, /*#__PURE__*/React.createElement(Label, {
@@ -20,6 +20,7 @@ function DateView(_ref, ref) {
20
20
  required
21
21
  } = state.viewModel;
22
22
  return /*#__PURE__*/React.createElement("div", {
23
+ "data-test-id": "smart_form_field_date",
23
24
  ref: ref,
24
25
  className: style.fieldWrapper
25
26
  }, /*#__PURE__*/React.createElement(Label, {
@@ -20,6 +20,7 @@ function DateView(_ref, ref) {
20
20
  required
21
21
  } = state.viewModel;
22
22
  return /*#__PURE__*/React.createElement("div", {
23
+ "data-test-id": "smart_form_field_datetime",
23
24
  ref: ref,
24
25
  className: style.fieldWrapper
25
26
  }, /*#__PURE__*/React.createElement(Label, {
@@ -21,6 +21,7 @@ function DecimalView(_ref, ref) {
21
21
  required
22
22
  } = state.viewModel;
23
23
  return /*#__PURE__*/React.createElement("div", {
24
+ "data-test-id": "smart_form_field_decimal",
24
25
  ref: ref,
25
26
  className: style.fieldWrapper
26
27
  }, /*#__PURE__*/React.createElement(Label, {
@@ -21,6 +21,7 @@ function EmailView(_ref, ref) {
21
21
  required
22
22
  } = state.properties;
23
23
  return /*#__PURE__*/React.createElement("div", {
24
+ "data-test-id": "smart_form_field_email",
24
25
  ref: ref,
25
26
  className: style.fieldWrapper
26
27
  }, /*#__PURE__*/React.createElement(Label, {
@@ -27,6 +27,7 @@ function MultiSelectView(_ref, ref) {
27
27
  actions
28
28
  } = state.properties;
29
29
  return /*#__PURE__*/React.createElement("div", {
30
+ "data-test-id": "smart_form_field_multiselect",
30
31
  ref: ref,
31
32
  className: style.fieldWrapper
32
33
  }, /*#__PURE__*/React.createElement(Label, {
@@ -21,6 +21,7 @@ function NumberView(_ref, ref) {
21
21
  required
22
22
  } = state.viewModel;
23
23
  return /*#__PURE__*/React.createElement("div", {
24
+ "data-test-id": "smart_form_field_number",
24
25
  ref: ref,
25
26
  className: style.fieldWrapper
26
27
  }, /*#__PURE__*/React.createElement(Label, {
@@ -21,6 +21,7 @@ function PercentageView(_ref, ref) {
21
21
  required
22
22
  } = state.viewModel;
23
23
  return /*#__PURE__*/React.createElement("div", {
24
+ "data-test-id": "smart_form_field_percentage",
24
25
  ref: ref,
25
26
  className: style.fieldWrapper
26
27
  }, /*#__PURE__*/React.createElement(Label, {
@@ -21,6 +21,7 @@ function PhoneView(_ref, ref) {
21
21
  required
22
22
  } = state.viewModel;
23
23
  return /*#__PURE__*/React.createElement("div", {
24
+ "data-test-id": "smart_form_field_phone",
24
25
  ref: ref,
25
26
  className: style.fieldWrapper
26
27
  }, /*#__PURE__*/React.createElement(Label, {
@@ -27,6 +27,7 @@ function PickListView(_ref, ref) {
27
27
  actions
28
28
  } = state.properties;
29
29
  return /*#__PURE__*/React.createElement("div", {
30
+ "data-test-id": "smart_form_field_picklist",
30
31
  ref: ref,
31
32
  className: style.fieldWrapper
32
33
  }, /*#__PURE__*/React.createElement(Label, {
@@ -21,6 +21,7 @@ function TextAreaView(_ref, ref) {
21
21
  required
22
22
  } = state.properties;
23
23
  return /*#__PURE__*/React.createElement("div", {
24
+ "data-test-id": "smart_form_field_textarea",
24
25
  ref: ref,
25
26
  className: style.fieldWrapper
26
27
  }, /*#__PURE__*/React.createElement(Label, {
@@ -21,6 +21,7 @@ function TextBoxView(_ref, ref) {
21
21
  required
22
22
  } = state.properties;
23
23
  return /*#__PURE__*/React.createElement("div", {
24
+ "data-test-id": "smart_form_field_textbox",
24
25
  ref: ref,
25
26
  className: style.fieldWrapper
26
27
  }, /*#__PURE__*/React.createElement(Label, {
@@ -21,6 +21,7 @@ function UrlView(_ref, ref) {
21
21
  required
22
22
  } = state.viewModel;
23
23
  return /*#__PURE__*/React.createElement("div", {
24
+ "data-test-id": "smart_form_field_url",
24
25
  ref: ref,
25
26
  className: style.fieldWrapper
26
27
  }, /*#__PURE__*/React.createElement(Label, {
@@ -4,12 +4,13 @@ import FieldConstants from "../../../../../../cc/fields/field/Constants";
4
4
  class EventHandlersFactory {
5
5
  static create() {
6
6
  return {
7
+ [FieldConstants.FIELD_FOCUSED]: this.handleFieldFocused,
7
8
  [FieldConstants.FIELD_BLURRED]: this.handleFieldBlurred,
8
9
  [FieldConstants.FIELD_CHANGED]: this.handleFieldChanged
9
10
  };
10
11
  }
11
12
 
12
- static handleFieldBlurred(_ref) {
13
+ static handleFieldFocused(_ref) {
13
14
  let {
14
15
  action,
15
16
  state,
@@ -22,7 +23,7 @@ class EventHandlersFactory {
22
23
  fieldName
23
24
  } = action.payload;
24
25
  dispatch({
25
- type: SectionConstants.SECTION_FIELD_BLURRED,
26
+ type: SectionConstants.SECTION_FIELD_FOCUSED,
26
27
  payload: {
27
28
  id,
28
29
  fieldName
@@ -31,7 +32,7 @@ class EventHandlersFactory {
31
32
  });
32
33
  }
33
34
 
34
- static handleFieldChanged(_ref2) {
35
+ static handleFieldBlurred(_ref2) {
35
36
  let {
36
37
  action,
37
38
  state,
@@ -40,6 +41,28 @@ class EventHandlersFactory {
40
41
  const {
41
42
  id
42
43
  } = state.properties;
44
+ const {
45
+ fieldName
46
+ } = action.payload;
47
+ dispatch({
48
+ type: SectionConstants.SECTION_FIELD_BLURRED,
49
+ payload: {
50
+ id,
51
+ fieldName
52
+ },
53
+ metaData: {}
54
+ });
55
+ }
56
+
57
+ static handleFieldChanged(_ref3) {
58
+ let {
59
+ action,
60
+ state,
61
+ dispatch
62
+ } = _ref3;
63
+ const {
64
+ id
65
+ } = state.properties;
43
66
  const {
44
67
  fieldName,
45
68
  value
@@ -1,4 +1,12 @@
1
+ import SmartFormConstants from "../../../../cc/form-connected/Constants";
1
2
  import FormSdkFactory from "./FormSdkFactory";
3
+ import FormConstants from "../../../../cc/form/Constants";
4
+ import { ZFORM_FIELD_VALUE_CHANGED } from "../../../../bc/zform/Symbol";
5
+ const {
6
+ SMART_FORM_FIELD_FOCUSED,
7
+ SMART_FORM_FIELD_BLURRED,
8
+ SMART_FORM_FIELD_VALUE_CHANGED
9
+ } = SmartFormConstants;
2
10
 
3
11
  function createHandlerWithSdk(handler) {
4
12
  return input => {
@@ -14,11 +22,70 @@ function createHandlerWithSdk(handler) {
14
22
  }
15
23
 
16
24
  export default class EventHandlersFactory {
17
- static create(eventHandlers) {
25
+ static createWrapped(eventHandlers) {
18
26
  return Object.fromEntries(Object.keys(eventHandlers).map(eventName => {
19
27
  const handler = createHandlerWithSdk(eventHandlers[eventName]);
20
28
  return [eventName, handler];
21
29
  }));
22
30
  }
23
31
 
32
+ static create(eventHandlers) {
33
+ const wrapped = EventHandlersFactory.createWrapped(eventHandlers);
34
+ return { ...wrapped,
35
+ [FormConstants.FORM_FIELD_FOCUSED]: _ref => {
36
+ let {
37
+ action,
38
+ dispatch
39
+ } = _ref;
40
+ const {
41
+ sectionId,
42
+ fieldName
43
+ } = action.payload;
44
+ dispatch({
45
+ type: SMART_FORM_FIELD_FOCUSED,
46
+ payload: {
47
+ sectionId,
48
+ fieldName
49
+ }
50
+ });
51
+ },
52
+ [FormConstants.FORM_FIELD_BLURRED]: _ref2 => {
53
+ let {
54
+ action,
55
+ dispatch
56
+ } = _ref2;
57
+ const {
58
+ sectionId,
59
+ fieldName
60
+ } = action.payload;
61
+ dispatch({
62
+ type: SMART_FORM_FIELD_BLURRED,
63
+ payload: {
64
+ sectionId,
65
+ fieldName
66
+ }
67
+ });
68
+ },
69
+ [ZFORM_FIELD_VALUE_CHANGED]: _ref3 => {
70
+ let {
71
+ action,
72
+ dispatch
73
+ } = _ref3;
74
+ const {
75
+ sectionId,
76
+ fieldName,
77
+ value
78
+ } = action.payload;
79
+ dispatch({
80
+ type: SMART_FORM_FIELD_VALUE_CHANGED,
81
+ payload: {
82
+ sectionId,
83
+ fieldName,
84
+ value
85
+ }
86
+ });
87
+ }
88
+ };
89
+ }
90
+
24
91
  }
@@ -5,16 +5,23 @@ class FieldValueChangeController extends AbstractController {
5
5
  const {
6
6
  fieldValueChangeRequestUseCase
7
7
  } = this.service;
8
- let {
8
+ const {
9
9
  state,
10
10
  updateState,
11
11
  action,
12
12
  dispatch
13
13
  } = event;
14
+ const {
15
+ fieldName,
16
+ value,
17
+ sectionId
18
+ } = action.payload;
14
19
  fieldValueChangeRequestUseCase.updateDependency(state, updateState);
15
20
  fieldValueChangeRequestUseCase.execute({
16
- fieldName: action.payload.fieldName,
17
- newValue: action.payload.newValue
21
+ fieldName,
22
+ newValue: value,
23
+ sectionId,
24
+ dispatch
18
25
  });
19
26
  }
20
27
 
@@ -1,10 +1,13 @@
1
1
  import AbstractUseCase from "./AbstractUseCase";
2
+ import { ZFORM_FIELD_VALUE_CHANGED } from "../../../../bc/zform/Symbol";
2
3
 
3
4
  class FieldValueChangeRequestUseCase extends AbstractUseCase {
4
5
  execute(input) {
5
6
  let {
7
+ sectionId,
6
8
  fieldName,
7
- newValue
9
+ newValue,
10
+ dispatch
8
11
  } = input;
9
12
  let {
10
13
  layoutRuleApplier
@@ -29,6 +32,15 @@ class FieldValueChangeRequestUseCase extends AbstractUseCase {
29
32
  // zform=zformEntitiy.toObject();
30
33
 
31
34
  this.dependencies.presenter.updateFormResponse(zform);
35
+ dispatch({
36
+ type: ZFORM_FIELD_VALUE_CHANGED,
37
+ payload: {
38
+ sectionId,
39
+ fieldName,
40
+ value: newValue
41
+ },
42
+ metaData: {}
43
+ });
32
44
  }
33
45
 
34
46
  }
@@ -209,11 +209,17 @@ class EventHandlersFactory {
209
209
  action,
210
210
  dispatch
211
211
  } = _ref8;
212
+ const {
213
+ sectionId,
214
+ fieldName,
215
+ value
216
+ } = action.payload;
212
217
  dispatch({
213
218
  type: ZFORM_FIELD_VALUE_CHANGE_REQUEST,
214
219
  payload: {
215
- fieldName: action.payload.fieldName,
216
- newValue: action.payload.value
220
+ sectionId,
221
+ fieldName,
222
+ value
217
223
  },
218
224
  metaData: {}
219
225
  });
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@zohodesk/library-platform",
3
- "version": "1.1.3-exp.4",
3
+ "version": "1.1.3-temp-1.1",
4
4
  "description": "",
5
5
  "main": "es/index.js",
6
6
  "files": [
7
+ "ChangeLogs.md",
7
8
  "es/",
8
9
  "!es/*.test.js",
9
10
  "!es/*.spec.js"
@@ -22,6 +23,7 @@
22
23
  "publish:alpha": "npm publish --tag alpha",
23
24
  "publish:beta": "npm publish --tag beta",
24
25
  "publish:exp": "npm publish --tag experimental",
26
+ "publish:temp": "npm publish --tag temp",
25
27
  "postpublish": "node ./post_publish.js",
26
28
  "lint:setup": "ZDPrecommit setupPlugins",
27
29
  "lint": "eslint -c .eslintrc.js --ext .ts,.js,.tsx",
@@ -44,7 +46,7 @@
44
46
  "@typescript-eslint/parser": "^7.11.0",
45
47
  "@zoho/SecurityJS": "5.0.2",
46
48
  "@zohodesk-private/css-variable-migrator": "^1.0.7",
47
- "@zohodesk-private/desk-components": "1.0.0-temp-53.3",
49
+ "@zohodesk-private/desk-components": "1.3.9",
48
50
  "@zohodesk-private/node-plugins": "1.1.9",
49
51
  "@zohodesk/a11y": "2.2.6",
50
52
  "@zohodesk/codestandard-analytics": "0.0.2",
@@ -54,6 +56,7 @@
54
56
  "@zohodesk/eslint-plugin-architecturerules": "0.0.5-exp-3",
55
57
  "@zohodesk/eslint-plugin-no-hardcoding": "1.0.6",
56
58
  "@zohodesk/hooks": "2.0.5",
59
+ "@zohodesk/i18n": "1.0.0-beta.31",
57
60
  "@zohodesk/icons": "1.0.72",
58
61
  "@zohodesk/layout": "3.1.0",
59
62
  "@zohodesk/svg": "1.1.27",
@@ -76,7 +79,7 @@
76
79
  "typescript": "4.9.5"
77
80
  },
78
81
  "peerDependencies": {
79
- "@zohodesk-private/desk-components": "1.0.0-temp-53.3",
82
+ "@zohodesk-private/desk-components": "1.3.9",
80
83
  "@zohodesk/a11y": "2.2.6",
81
84
  "@zohodesk/components": "1.2.62",
82
85
  "@zohodesk/dot": "1.7.8",
@@ -87,13 +90,10 @@
87
90
  "@zohodesk/svg": "1.1.27",
88
91
  "@zohodesk/utils": "1.3.14",
89
92
  "color": "4.2.3",
93
+ "jsep": "0.3.5",
90
94
  "react-sortable-hoc": "1.11.0"
91
95
  },
92
96
  "dependencies": {
93
- "@zohodesk/i18n": "^1.0.0-beta.33",
94
- "ajv": "6.12.6",
95
- "array-move": "^4.0.0",
96
- "jsep": "0.3.5",
97
- "object-path-immutable": "4.1.2"
97
+ "ajv": "6.12.6"
98
98
  }
99
- }
99
+ }
@@ -1,5 +0,0 @@
1
- /* eslint-disable @zohodesk/architecturerules/no-unused-vars */
2
- // REVIEW: Class never used
3
- class ImmutableHelper {}
4
-
5
- export {};