@zohodesk/library-platform 1.1.11 → 1.1.12-temp-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 (21) hide show
  1. package/es/cc/fields/lookup/Properties.js +38 -25
  2. package/es/cc/table-column-filter/Properties.js +9 -0
  3. package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +13 -13
  4. package/es/library/dot/components/form-fields/field/css/FieldItem.module.css +2 -2
  5. package/es/library/dot/components/section/frameworks/ui/css/Section.module.css +3 -3
  6. package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +21 -21
  7. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/css/Breadcrumb.module.css +4 -4
  8. package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/css/DateView.module.css +1 -1
  9. package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/css/Label.module.css +4 -4
  10. package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/css/MultiSelectView.module.css +7 -7
  11. package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/css/Select.module.css +2 -2
  12. package/es/library/dot/legacy-to-new-arch/table-column-chooser/frameworks/ui/css/TableColumnChooserView.module.css +1 -1
  13. package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +2 -1
  14. package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/css/TextAreaView.module.css +3 -3
  15. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.module.css +5 -5
  16. package/es/platform/data-source/http-template/fetchLookupFields.js +0 -6
  17. package/es/platform/zform/adapters/gateway/FormRepository.js +3 -1
  18. package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +11 -11
  19. package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +9 -10
  20. package/es/platform/zform/domain/ZForm.js +2 -0
  21. package/package.json +2 -2
@@ -10,35 +10,48 @@ export default { ...FieldProperties,
10
10
  }
11
11
  },
12
12
  value: {
13
- required: true,
14
- defaultValue: '',
13
+ required: false,
14
+ defaultValue: null,
15
15
  typeMetadata: {
16
16
  schema: {
17
- // Accepts either object or string
18
- anyOf: [{
19
- // NOTE: object type is used in Table Lookup field translator
17
+ oneOf: [{
20
18
  type: 'object',
21
- properties: {
22
- id: {
23
- type: 'string'
24
- },
25
- name: {
26
- type: 'string'
27
- },
28
- photoURL: {
29
- type: ['string', 'null']
30
- },
31
- url: {
32
- type: ['string', 'null']
33
- }
34
- },
35
- required: ['id', 'name'],
36
- additionalProperties: true
19
+ additionalProperties: {
20
+ oneOf: [{
21
+ type: ['string', 'null', 'number', 'boolean', 'array']
22
+ }, {
23
+ $ref: '#/definitions/value'
24
+ }]
25
+ }
37
26
  }, {
38
- // NOTE: string type is used in Form Lookup field translator
39
- type: 'string' // Allowing string type for backward compatibility or alternative usage
40
-
41
- }]
27
+ type: 'array',
28
+ items: {
29
+ $ref: '#/definitions/value'
30
+ }
31
+ }, {
32
+ type: ['string', 'null', 'number', 'boolean']
33
+ }],
34
+ definitions: {
35
+ value: {
36
+ type: 'object',
37
+ additionalProperties: {
38
+ oneOf: [{
39
+ type: ['string', 'null', 'number', 'boolean', 'array']
40
+ }, {
41
+ $ref: '#/definitions/value'
42
+ }]
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ },
49
+ maxLength: {
50
+ required: false,
51
+ defaultValue: '',
52
+ typeMetadata: {
53
+ schema: {
54
+ type: 'number'
42
55
  }
43
56
  }
44
57
  }
@@ -70,6 +70,15 @@ export default {
70
70
  }
71
71
  }
72
72
  },
73
+ hasClearButton: {
74
+ defaultValue: false,
75
+ required: false,
76
+ typeMetadata: {
77
+ schema: {
78
+ type: "boolean"
79
+ }
80
+ }
81
+ },
73
82
  hasSearch: {
74
83
  defaultValue: false,
75
84
  required: false,
@@ -3,17 +3,17 @@
3
3
  }
4
4
 
5
5
  .field {
6
- margin-top: 5px;
6
+ margin-top: var(--zd_size5) ;
7
7
  }
8
8
 
9
9
  .multiSelectField {
10
- margin-top: 2px
10
+ margin-top: var(--zd_size2)
11
11
  }
12
12
 
13
13
  .checkboxField {
14
14
  composes: dInflex alignFstart from '~@zohodesk/components/es/common/common.module.css';
15
- max-width: 100%;
16
- gap: 8px
15
+ max-width: 100% ;
16
+ gap: var(--zd_size8)
17
17
  }
18
18
 
19
19
  .cursor_pointer {
@@ -27,36 +27,36 @@
27
27
  }
28
28
 
29
29
  [dir=ltr] .footer {
30
- padding-right: 32px
30
+ padding-right: var(--zd_size32)
31
31
  }
32
32
 
33
33
  [dir=rtl] .footer {
34
- padding-left: 32px
34
+ padding-left: var(--zd_size32)
35
35
  }
36
36
 
37
37
  /* Sections layout */
38
38
 
39
39
  .sectionsWrapper {
40
- padding-bottom: 8px
40
+ padding-bottom: var(--zd_size8)
41
41
  }
42
42
 
43
43
  .sectionsLayout, .sectionsTwoLayout {
44
- margin: 0 auto
44
+ margin: 0 auto
45
45
  }
46
46
 
47
47
  .sectionsLayout {
48
- max-width: var(--local-form-layout-max-width, 1080px)
48
+ max-width: var(--local-form-layout-max-width, var(--zd_size1080))
49
49
  }
50
50
 
51
51
  .sectionsTwoLayout {
52
- column-gap: 8px;
53
- max-width: var(--local-form-layout-max-width, 1210px)
52
+ column-gap: var(--zd_size8) ;
53
+ max-width: var(--local-form-layout-max-width, var(--zd_size1210))
54
54
  }
55
55
 
56
56
  .rightPanel {
57
57
  height: var(--local-form-right-panel-height, 100%);
58
58
  position: -webkit-sticky;
59
59
  position: sticky;
60
- top: 0;
61
- padding: 8px 0
60
+ top: 0 ;
61
+ padding: var(--zd_size8) 0
62
62
  }
@@ -1,7 +1,7 @@
1
1
  .fieldItem {
2
2
  position: relative;
3
- min-width: 0;
4
- min-height: 0
3
+ min-width: 0 ;
4
+ min-height: 0
5
5
  }
6
6
 
7
7
  .largeSize {
@@ -1,11 +1,11 @@
1
1
  .fieldsContainer {
2
- padding-top: 1px
2
+ padding-top: var(--zd_size1)
3
3
  }
4
4
 
5
5
  [dir=ltr] .actionContainer {
6
- margin-left: 8px;
6
+ margin-left: var(--zd_size8) ;
7
7
  }
8
8
 
9
9
  [dir=rtl] .actionContainer {
10
- margin-right: 8px;
10
+ margin-right: var(--zd_size8) ;
11
11
  }
@@ -137,35 +137,35 @@
137
137
  }
138
138
 
139
139
  .loader {
140
- padding: 40px 0
140
+ padding: var(--zd_size40) 0
141
141
  }
142
142
 
143
143
  .wrapper {
144
- height: 100%;
145
- width: 100%;
144
+ height: 100% ;
145
+ width: 100% ;
146
146
  z-index: 1;
147
147
  position: relative
148
148
  }
149
149
 
150
150
  .hiddenDummyRow {
151
- height: 40px;
152
- width: 0;
151
+ height: var(--zd_size40) ;
152
+ width: 0 ;
153
153
  position: absolute;
154
154
  z-index: -100;
155
- top: 0;
155
+ top: 0 ;
156
156
  pointer-events: none;
157
157
  }
158
158
 
159
159
  [dir=ltr] .hiddenDummyRow {
160
- left: 0;
160
+ left: 0 ;
161
161
  }
162
162
 
163
163
  [dir=rtl] .hiddenDummyRow {
164
- right: 0;
164
+ right: 0 ;
165
165
  }
166
166
 
167
167
  .resizerSpace {
168
- width: calc(var(--local_table_resizer_extra_space, 0) * 1px);
168
+ width: calc(var(--local_table_resizer_extra_space, 0) * var(--zd_size1));
169
169
  flex-shrink: 0
170
170
  }
171
171
 
@@ -174,32 +174,32 @@
174
174
  }
175
175
 
176
176
  [dir=ltr] .contentWrapper {
177
- left: 0;
177
+ left: 0 ;
178
178
  }
179
179
 
180
180
  [dir=rtl] .contentWrapper {
181
- right: 0;
181
+ right: 0 ;
182
182
  }
183
183
 
184
184
  .initialLoading {
185
- height: calc(100% - 100px)
185
+ height: calc(100% - (var(--zd_size100)))
186
186
  }
187
187
 
188
188
  .emptyContent {
189
- padding: 160px 0 60px
189
+ padding: var(--zd_size160) 0 var(--zd_size60)
190
190
  }
191
191
 
192
192
  .errorContent {
193
- padding: 60px 0
193
+ padding: var(--zd_size60) 0
194
194
  }
195
195
 
196
196
  .headerWithActions,
197
197
  .fieldWithActions {
198
- gap: 6px
198
+ gap: var(--zd_size6)
199
199
  }
200
200
 
201
201
  .actions {
202
- gap: 8px
202
+ gap: var(--zd_size8)
203
203
  }
204
204
 
205
205
  .rowCursor_default {
@@ -244,7 +244,7 @@
244
244
  }
245
245
 
246
246
  .dragHandleContainer {
247
- height: 100%;
247
+ height: 100% ;
248
248
  opacity: 0;
249
249
  visibility: hidden;
250
250
  }
@@ -268,8 +268,8 @@
268
268
  }
269
269
 
270
270
  .rowDropIndicator {
271
- width: 100%;
272
- height: 2px;
271
+ width: 100% ;
272
+ height: var(--zd_size2) ;
273
273
  /* css:theme-validation:ignore */
274
274
  position: absolute;
275
275
  z-index: 2;
@@ -277,11 +277,11 @@
277
277
  }
278
278
 
279
279
  .dropIndicatorTop {
280
- top: 0;
280
+ top: 0 ;
281
281
  }
282
282
 
283
283
  .dropIndicatorBottom {
284
- bottom: -3px;
284
+ bottom: calc( var(--zd_size3) * -1 ) ;
285
285
  }
286
286
 
287
287
  .row {
@@ -1,19 +1,19 @@
1
1
  .wrapper, .itemContainer {
2
- max-width: 100%
2
+ max-width: 100%
3
3
  }
4
4
 
5
5
  .itemContainer {
6
- column-gap: 4px;
6
+ column-gap: var(--zd_size4) ;
7
7
  }
8
8
 
9
9
  .separator {
10
10
  --separator_fontSize: 14px;
11
- margin: 0 10px;
11
+ margin: 0 var(--zd_size10) ;
12
12
  }
13
13
 
14
14
  .buttonStyle {
15
15
  --button_font_size: 14px;
16
16
  --button_padding: 0px;
17
17
  --button_letter_spacing: 0px;
18
- max-width: 100%;
18
+ max-width: 100% ;
19
19
  }
@@ -1,3 +1,3 @@
1
1
  .actionContainer {
2
- margin-top: 2px;
2
+ margin-top: var(--zd_size2) ;
3
3
  }
@@ -1,9 +1,9 @@
1
1
  .label {
2
2
  --label_cursor: inherit
3
3
  }[dir=ltr] .label {
4
- padding-right: 6px
4
+ padding-right: var(--zd_size6)
5
5
  }[dir=rtl] .label {
6
- padding-left: 6px
6
+ padding-left: var(--zd_size6)
7
7
  }
8
8
 
9
9
  .mandatory::after {
@@ -11,9 +11,9 @@
11
11
  }
12
12
 
13
13
  [dir=ltr] .mandatory::after {
14
- padding-left: 2px
14
+ padding-left: var(--zd_size2)
15
15
  }
16
16
 
17
17
  [dir=rtl] .mandatory::after {
18
- padding-right: 2px
18
+ padding-right: var(--zd_size2)
19
19
  }
@@ -1,27 +1,27 @@
1
1
  .fieldActionsContainer {
2
- margin-top: 4px;
2
+ margin-top: var(--zd_size4) ;
3
3
  }
4
4
 
5
5
  [dir=ltr] .optionActionsContainer {
6
- margin-left: 4px;
6
+ margin-left: var(--zd_size4) ;
7
7
  }
8
8
 
9
9
  [dir=rtl] .optionActionsContainer {
10
- margin-right: 4px;
10
+ margin-right: var(--zd_size4) ;
11
11
  }
12
12
 
13
13
  .custmInputWrapper {
14
14
  position: absolute;
15
- top: 0;
16
- width: 100%;
15
+ top: 0 ;
16
+ width: 100% ;
17
17
  }
18
18
 
19
19
  [dir=ltr] .custmInputWrapper {
20
- left: 0;
20
+ left: 0 ;
21
21
  }
22
22
 
23
23
  [dir=rtl] .custmInputWrapper {
24
- right: 0;
24
+ right: 0 ;
25
25
  }
26
26
 
27
27
  .clearIconContainer {
@@ -1,5 +1,5 @@
1
1
  [dir=ltr] .optionActionsContainer {
2
- margin-left: 4px;
2
+ margin-left: var(--zd_size4) ;
3
3
  }[dir=rtl] .optionActionsContainer {
4
- margin-right: 4px;
4
+ margin-right: var(--zd_size4) ;
5
5
  }
@@ -4,5 +4,5 @@
4
4
  }
5
5
 
6
6
  .textOverflowOptions {
7
- margin-top: 10px
7
+ margin-top: var(--zd_size10)
8
8
  }
@@ -22,6 +22,7 @@ function TableColumnFilterView(_ref, ref) {
22
22
  heading,
23
23
  hasSearch,
24
24
  searchPlaceholder,
25
+ hasClearButton,
25
26
  clearFilterLabel,
26
27
  optionTagLabel,
27
28
  taggedOption
@@ -86,7 +87,7 @@ function TableColumnFilterView(_ref, ref) {
86
87
  options,
87
88
  hasSearch,
88
89
  searchPlaceholder,
89
- hasClearButton: true,
90
+ hasClearButton,
90
91
  isClearButtonDisabled: !isFiltered,
91
92
  clearFilterLabel,
92
93
  optionTagLabel,
@@ -4,13 +4,13 @@
4
4
 
5
5
  .rightPlaceholder {
6
6
  position: absolute;
7
- bottom: 4px;
7
+ bottom: var(--zd_size4) ;
8
8
  }
9
9
 
10
10
  [dir=ltr] .rightPlaceholder {
11
- right: 12px;
11
+ right: var(--zd_size12) ;
12
12
  }
13
13
 
14
14
  [dir=rtl] .rightPlaceholder {
15
- left: 12px;
15
+ left: var(--zd_size12) ;
16
16
  }
@@ -1,19 +1,19 @@
1
1
  .wrapper {
2
- max-width: 100%
2
+ max-width: 100%
3
3
  }
4
4
 
5
5
  .gap_small {
6
- gap: 4px
6
+ gap: var(--zd_size4)
7
7
  }
8
8
 
9
9
  .gap_xmedium {
10
- gap: 6px
10
+ gap: var(--zd_size6)
11
11
  }
12
12
 
13
13
  .gap_medium {
14
- gap: 8px
14
+ gap: var(--zd_size8)
15
15
  }
16
16
 
17
17
  .gap_large {
18
- gap: 10px
18
+ gap: var(--zd_size10)
19
19
  }
@@ -4,12 +4,6 @@ const fetchLookupFields = {
4
4
  parameters: `{}`,
5
5
  type: 'GET',
6
6
  transformer: data => data,
7
- getResponse: async _ref => {
8
- let {
9
- params,
10
- payload
11
- } = _ref;
12
- },
13
7
  properties: {
14
8
  layoutId: {
15
9
  required: true,
@@ -25,7 +25,8 @@ class FormRepository {
25
25
  validationRules = [],
26
26
  sections = [],
27
27
  layoutRules = [],
28
- dependencyMappings = []
28
+ dependencyMappings = [],
29
+ layoutId
29
30
  } = zform;
30
31
  let validationRuleEntities = validationRules.map(rule => {
31
32
  return new ZValidationRule(rule);
@@ -59,6 +60,7 @@ class FormRepository {
59
60
  dependencyMappings: dependencyMappingsEntities,
60
61
  layoutRules: layoutRulesEntities,
61
62
  context,
63
+ layoutId: layoutId,
62
64
  isMyFormFetching: zform.isMyFormFetching,
63
65
  isDependencyFetching: zform.isDependencyFetching,
64
66
  isLayoutRulesFetching: zform.isLayoutRulesFetching,
@@ -5,20 +5,20 @@ const LookUpFieldTranslator = _ref => {
5
5
  fieldPreModified,
6
6
  uiConfig
7
7
  } = _ref;
8
- const fieldModified = {
9
- type,
10
- uiConfig,
11
- value: field.value || '',
12
- //state.behaviours.zform.values[field.apiName],
13
- name: field.apiName,
14
- ...fieldPreModified,
8
+ const fieldModified = { ...fieldPreModified,
9
+ uiConfig: uiConfig,
10
+ type: field.type,
11
+ value: field.value,
12
+ name: field.name,
15
13
  id: field.id,
16
14
  label: field.i18NLabel,
17
- required: field.isMandatory,
18
- readonly: field.isReadOnly,
19
- // visibility: field.isVisible,
15
+ apiName: field.apiName,
16
+ errorMessage: field.errorMessage,
20
17
  isVisible: field.isVisible,
21
- errorMessage: field.errorMessage || '',
18
+ readonly: field.isReadOnly,
19
+ required: field.isMandatory,
20
+ isCustomField: field.isCustomField,
21
+ maxLength: field.maxLength,
22
22
  lookup: field.lookup
23
23
  };
24
24
  return fieldModified;
@@ -21,8 +21,9 @@ class MyFormSuccessUseCase extends AbstractUseCase {
21
21
  sections
22
22
  } = myForm;
23
23
  const zFormEntity = repository.getFormEntity();
24
+ const layoutId = zFormEntity.getLayoutId();
24
25
  const context = { ...zFormEntity.getContext(),
25
- layoutId: zFormEntity.getLayoutId()
26
+ layoutId: layoutId
26
27
  };
27
28
  const lookupFields = sections.flatMap(section => section.fields.filter(field => field.type === 'LookUp'));
28
29
  const sectionEntities = sections.map(section => {
@@ -63,24 +64,22 @@ class MyFormSuccessUseCase extends AbstractUseCase {
63
64
  type: DATA_SOURCE_EXECUTE,
64
65
  payload: {
65
66
  actionName: 'fetchLookupFields',
66
- props: { ...context
67
- }
67
+ props: context
68
68
  },
69
69
  metaData: {
70
70
  actionName: 'fetchLookupFields',
71
- //hack
72
71
  [DATA_SOURCE_NO_CONTENT]: {
73
72
  type: ZFORM_LOOKUP_FIELD_SUCCESS,
74
73
  metaData: {
75
74
  actionName: 'fetchLookupFields'
76
75
  }
77
76
  },
78
- // [DATA_SOURCE_FAILURE]: {
79
- // type: ZFORM_LOOKUP_FIELD_SUCCESS,
80
- // metaData: {
81
- // actionName: 'fetchValidationRules'
82
- // }
83
- // },
77
+ [DATA_SOURCE_FAILURE]: {
78
+ type: ZFORM_API_FAILURE,
79
+ metaData: {
80
+ actionName: 'fetchLookupFields'
81
+ }
82
+ },
84
83
  [DATA_SOURCE_SUCCESS]: {
85
84
  type: ZFORM_LOOKUP_FIELD_SUCCESS,
86
85
  metaData: {
@@ -21,6 +21,7 @@ export default class ZForm {
21
21
  dependencyMappings,
22
22
  context,
23
23
  focusedFieldName,
24
+ layoutId,
24
25
 
25
26
  /*hack*/
26
27
  isMyFormFetching,
@@ -45,6 +46,7 @@ export default class ZForm {
45
46
  this.dependencyMappings = dependencyMappings;
46
47
  this.context = context;
47
48
  this.focusedFieldName = focusedFieldName || null;
49
+ this.layoutId = layoutId;
48
50
  /*hack*/
49
51
 
50
52
  this.isMyFormFetching = isMyFormFetching;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/library-platform",
3
- "version": "1.1.11",
3
+ "version": "1.1.12-temp-1",
4
4
  "description": "",
5
5
  "main": "es/index.js",
6
6
  "files": [
@@ -97,4 +97,4 @@
97
97
  "jsep": "0.3.5",
98
98
  "object-path-immutable": "4.1.2"
99
99
  }
100
- }
100
+ }