@zohodesk/library-platform 1.1.11 → 1.1.12-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 (128) hide show
  1. package/es/bc/index.js +0 -1
  2. package/es/bc/zlist/Constants.js +0 -1
  3. package/es/bc/zlist/Types.js +10 -0
  4. package/es/bc/zrecord/Constants.js +1 -0
  5. package/es/bc/zrecord/Schemas.js +29 -0
  6. package/es/bc/zrecord/Types.js +45 -0
  7. package/es/cc/fields/lookup/Properties.js +10 -26
  8. package/es/cc/radio-dropdown/Constants.js +6 -0
  9. package/es/cc/radio-dropdown/Data.js +1 -0
  10. package/es/cc/radio-dropdown/Events.js +42 -0
  11. package/es/cc/radio-dropdown/Properties.js +142 -0
  12. package/es/cc/radio-dropdown/index.js +4 -0
  13. package/es/cc/table-column-filter/Properties.js +9 -0
  14. package/es/cc/table-connected/SdkContract.js +21 -0
  15. package/es/cc/table-connected/constants/Events.js +2 -0
  16. package/es/cc/table-list/Actions.js +0 -2
  17. package/es/cc/table-list/Constants.js +0 -1
  18. package/es/cc/table-list/Events.js +0 -2
  19. package/es/cc/table-list/Properties.js +0 -3
  20. package/es/cc/tag/Constants.js +6 -0
  21. package/es/cc/tag/Data.js +14 -0
  22. package/es/cc/tag/EventHandlers.js +1 -0
  23. package/es/cc/tag/Events.js +26 -0
  24. package/es/cc/tag/Model.js +30 -0
  25. package/es/cc/tag/Properties.js +104 -0
  26. package/es/cc/tag/index.js +6 -0
  27. package/es/cc/tags-list-dropdown/Constants.js +5 -0
  28. package/es/cc/tags-list-dropdown/Data.js +1 -0
  29. package/es/cc/tags-list-dropdown/Events.js +14 -0
  30. package/es/cc/tags-list-dropdown/Properties.js +96 -0
  31. package/es/cc/tags-list-dropdown/index.js +4 -0
  32. package/es/library/custom-component/frameworks/ui/CustomComponentFactory.js +56 -0
  33. package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +13 -13
  34. package/es/library/dot/components/form-fields/field/css/FieldItem.module.css +2 -2
  35. package/es/library/dot/components/section/frameworks/ui/css/Section.module.css +3 -3
  36. package/es/library/dot/components/table-list/adapters/controllers/index.js +0 -2
  37. package/es/library/dot/components/table-list/frameworks/ui/EventHandlersFactory.js +1 -2
  38. package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +21 -21
  39. package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/css/Breadcrumb.module.css +4 -4
  40. package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/css/DateView.module.css +1 -1
  41. package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/css/Label.module.css +4 -4
  42. package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/css/MultiSelectView.module.css +7 -7
  43. package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/RadioDropdown.js +12 -0
  44. package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/RadioDropdownView.js +124 -0
  45. package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/css/RadioDropdown.module.css +23 -0
  46. package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/css/Select.module.css +2 -2
  47. package/es/library/dot/legacy-to-new-arch/table-column-chooser/frameworks/ui/css/TableColumnChooserView.module.css +1 -1
  48. package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +2 -1
  49. package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/EventHandlersFactory.js +26 -0
  50. package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/HighlightedValueField.js +23 -0
  51. package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/HighlightedValueFieldView.js +24 -0
  52. package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/EventHandlersFactory.js +26 -0
  53. package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/LabeledAvatarField.js +23 -0
  54. package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/LabeledAvatarFieldView.js +22 -0
  55. package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/EventHandlersFactory.js +26 -0
  56. package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/LinkField.js +23 -0
  57. package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/LinkFieldView.js +26 -0
  58. package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/EventHandlersFactory.js +32 -0
  59. package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/RadioDropdownField.js +32 -0
  60. package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/RadioDropdownFieldView.js +43 -0
  61. package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/css/RadioDropdownField.module.css +3 -0
  62. package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/EventHandlersFactory.js +26 -0
  63. package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/TagField.js +23 -0
  64. package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/TagFieldView.js +34 -0
  65. package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/EventHandlersFactory.js +26 -0
  66. package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/TagsField.js +23 -0
  67. package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/TagsFieldView.js +18 -0
  68. package/es/library/dot/legacy-to-new-arch/table-field-components/tags-list-dropdown-field/frameworks/ui/TagsListDropdownField.js +12 -0
  69. package/es/library/dot/legacy-to-new-arch/table-field-components/tags-list-dropdown-field/frameworks/ui/TagsListDropdownFieldView.js +24 -0
  70. package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/EventHandlersFactory.js +26 -0
  71. package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/TextField.js +23 -0
  72. package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/TextFieldView.js +20 -0
  73. package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/Tag.js +11 -0
  74. package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/Tag.module.css +8 -0
  75. package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/TagView.js +96 -0
  76. package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagContractAdapter.js +24 -0
  77. package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdown.js +12 -0
  78. package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdownView.js +42 -0
  79. package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/css/TextAreaView.module.css +3 -3
  80. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.module.css +5 -5
  81. package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +169 -8
  82. package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +11 -2
  83. package/es/platform/data-source/http-template/fetchLookupFields.js +0 -6
  84. package/es/platform/data-source/http-template/getComponentMapping.js +17 -0
  85. package/es/platform/data-source/http-template/getRecords.js +1 -0
  86. package/es/platform/zform/adapters/gateway/FormRepository.js +3 -1
  87. package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +12 -11
  88. package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +9 -10
  89. package/es/platform/zform/domain/ZForm.js +2 -0
  90. package/es/platform/zlist/adapters/controllers/RefreshRecordsRequestedController.js +21 -0
  91. package/es/platform/zlist/adapters/controllers/SortController.js +2 -2
  92. package/es/platform/zlist/adapters/gateways/Repository.js +6 -11
  93. package/es/platform/zlist/adapters/gateways/Service.js +2 -0
  94. package/es/platform/zlist/adapters/presenters/TableTranslator.js +9 -6
  95. package/es/platform/zlist/adapters/presenters/translators/FieldVariations.js +25 -0
  96. package/es/platform/zlist/adapters/presenters/translators/Header.js +29 -21
  97. package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +3 -3
  98. package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +7 -4
  99. package/es/platform/zlist/applications/entities-factory/ListFactory.js +2 -2
  100. package/es/platform/zlist/applications/interfaces/input/GetSortConfigUseCaseInputModel.js +1 -0
  101. package/es/platform/zlist/applications/interfaces/input/RefreshRecordsRequestedUseCaseInputModel.js +1 -0
  102. package/es/platform/zlist/applications/interfaces/input/SetSortConfigUseCaseInputModel.js +1 -0
  103. package/es/platform/zlist/applications/usecases/GetSortConfigUseCase.js +17 -0
  104. package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +1 -1
  105. package/es/platform/zlist/applications/usecases/RefreshRecordsRequestedUseCase.js +17 -0
  106. package/es/platform/zlist/applications/usecases/SetSortConfigUseCase.js +26 -0
  107. package/es/platform/zlist/applications/usecases/SortUseCase.js +6 -6
  108. package/es/platform/zlist/domain/entities/List.js +27 -15
  109. package/es/platform/zlist/domain/entities/interfaces/Properties.js +5 -5
  110. package/es/platform/zlist/frameworks/EventHandlersFactory.js +3 -4
  111. package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +2 -5
  112. package/es/platform/zrecord/adapters/gateways/Repository.js +5 -2
  113. package/es/platform/zrecord/applications/entities-factory/RecordsManagerFactory.js +2 -2
  114. package/es/platform/zrecord/applications/interfaces/input/ClearAllFiltersUseCaseInputModel.js +1 -0
  115. package/es/platform/zrecord/applications/interfaces/input/GetFilterConditionUseCaseInputModel.js +1 -0
  116. package/es/platform/zrecord/applications/interfaces/input/GetFilterConfigUseCaseInputModel.js +1 -0
  117. package/es/platform/zrecord/applications/interfaces/input/RefreshRecordsUseCaseInputModel.js +1 -0
  118. package/es/platform/zrecord/applications/interfaces/input/SetFilterUseCaseInputModel.js +1 -0
  119. package/es/platform/zrecord/applications/usecases/ClearAllFiltersUseCase.js +24 -0
  120. package/es/platform/zrecord/applications/usecases/GetFilterConditionUseCase.js +15 -0
  121. package/es/platform/zrecord/applications/usecases/GetFilterConfigUseCase.js +15 -0
  122. package/es/platform/zrecord/applications/usecases/RefreshRecordsUseCase.js +14 -0
  123. package/es/platform/zrecord/applications/usecases/SetFilterUseCase.js +24 -0
  124. package/es/platform/zrecord/domain/entities/Filter.js +247 -0
  125. package/es/platform/zrecord/domain/entities/RecordsManager.js +19 -1
  126. package/es/platform/zrecord/domain/entities/interfaces/IFilter.js +1 -0
  127. package/es/platform/zrecord/frameworks/RecordBehaviourFactory.js +11 -1
  128. package/package.json +2 -2
@@ -0,0 +1,15 @@
1
+ import AbstractUseCase from "./AbstractUseCase";
2
+ export default class GetFilterConditionUseCase extends AbstractUseCase {
3
+ execute(_ref) {
4
+ let {
5
+ callback
6
+ } = _ref;
7
+ const {
8
+ repository
9
+ } = this.dependencies;
10
+ const recordManager = repository.getRecordsManagerEntity();
11
+ const filterCondition = recordManager.getFilterCondition();
12
+ callback?.(filterCondition);
13
+ }
14
+
15
+ }
@@ -0,0 +1,15 @@
1
+ import AbstractUseCase from "./AbstractUseCase";
2
+ export default class GetFilterConfigUseCase extends AbstractUseCase {
3
+ execute(_ref) {
4
+ let {
5
+ callback
6
+ } = _ref;
7
+ const {
8
+ repository
9
+ } = this.dependencies;
10
+ const recordManager = repository.getRecordsManagerEntity();
11
+ const filterConfig = recordManager.getFilterConfig();
12
+ callback?.(filterConfig);
13
+ }
14
+
15
+ }
@@ -0,0 +1,14 @@
1
+ import AbstractUseCase from "./AbstractUseCase";
2
+ import { REFRESH_RECORDS_REQUESTED } from "../../../../bc/zrecord/Constants";
3
+ export default class RefreshRecordsUseCase extends AbstractUseCase {
4
+ execute(_ref) {
5
+ let {
6
+ dispatch
7
+ } = _ref;
8
+ dispatch({
9
+ type: REFRESH_RECORDS_REQUESTED,
10
+ metaData: {}
11
+ });
12
+ }
13
+
14
+ }
@@ -0,0 +1,24 @@
1
+ import AbstractUseCase from "./AbstractUseCase";
2
+ import { REFRESH_RECORDS_REQUESTED } from "../../../../bc/zrecord/Constants";
3
+ export default class SetFilterUseCase extends AbstractUseCase {
4
+ execute(_ref) {
5
+ let {
6
+ filterConfig,
7
+ dispatch
8
+ } = _ref;
9
+ const {
10
+ repository,
11
+ presenter
12
+ } = this.dependencies;
13
+ const recordManager = repository.getRecordsManagerEntity();
14
+ recordManager.setFilterConfig(filterConfig);
15
+ presenter.updateRecord(recordManager.toObject());
16
+ dispatch({
17
+ type: REFRESH_RECORDS_REQUESTED,
18
+ metaData: {
19
+ filterConfig
20
+ }
21
+ });
22
+ }
23
+
24
+ }
@@ -0,0 +1,247 @@
1
+ import { CommonComparators, TextComparators, NumberComparators, DateComparators, ConditionTokens } from "../../../../bc/zrecord/Types";
2
+ export class Filter {
3
+ constructor(config, condition, queryString) {
4
+ this.config = config;
5
+ this.condition = condition;
6
+ this.queryString = queryString;
7
+ }
8
+
9
+ getFilterQuery() {
10
+ return this.queryString;
11
+ }
12
+
13
+ getConfig() {
14
+ return this.config;
15
+ }
16
+
17
+ getCondition() {
18
+ return this.condition;
19
+ }
20
+
21
+ toObject() {
22
+ return {
23
+ config: this.config,
24
+ condition: this.condition,
25
+ queryString: this.queryString
26
+ };
27
+ }
28
+
29
+ setConfig(config) {
30
+ const condition = this.convertConfigToCondition(config);
31
+ const queryString = this.convertConditionToQueryStringRecursive(condition);
32
+ this.config = config;
33
+ this.condition = condition;
34
+ this.queryString = queryString;
35
+ }
36
+ /**
37
+ * input:
38
+ * {
39
+ * conditions: [
40
+ * { fieldName: 'productCode', condition: "isn't", value: '12345' },
41
+ * { fieldName: 'quantity', condition: 'is', value: 100 },
42
+ * { fieldName: 'category', condition: 'contains', value: 'electronics' },
43
+ * { fieldName: 'discount', condition: 'is not empty', value: null }
44
+ * ],
45
+ * pattern: "((1and2)or(3and4))"
46
+ * }
47
+ *
48
+ * output:
49
+ * {
50
+ * type: 'OR',
51
+ * conditions: [
52
+ * {
53
+ * type: 'AND',
54
+ * conditions: [
55
+ * { type: 'CONDITION', fieldName: 'productCode', condition: "isn't", value: '12345' },
56
+ * { type: 'CONDITION', fieldName: 'quantity', condition: 'is', value: 100 }
57
+ * ]
58
+ * },
59
+ * {
60
+ * type: 'AND',
61
+ * conditions: [
62
+ * { type: 'CONDITION', fieldName: 'category', condition: 'contains', value: 'electronics' },
63
+ * { type: 'CONDITION', fieldName: 'discount', condition: 'is not empty', value: null }
64
+ * ]
65
+ * }
66
+ * ]
67
+ * }
68
+ */
69
+
70
+
71
+ convertConfigToCondition(config) {
72
+ const {
73
+ conditions,
74
+ pattern
75
+ } = config;
76
+
77
+ if (conditions.length === 0 || pattern.trim() === '') {
78
+ return null;
79
+ } // Tokenize the pattern
80
+
81
+
82
+ const tokens = this.tokenizePattern(pattern);
83
+ const aliases = this.generateAliases(conditions);
84
+ let pos = 0;
85
+
86
+ const parseExpression = () => {
87
+ if (tokens[pos] === '(') {
88
+ pos++; // skip '('
89
+
90
+ const left = parseExpression();
91
+
92
+ if (pos < tokens.length && tokens[pos] === ')') {
93
+ pos++; // skip ')'
94
+
95
+ return left;
96
+ }
97
+
98
+ const operator = tokens[pos];
99
+ pos++; // skip operator
100
+
101
+ const right = parseExpression();
102
+
103
+ if (tokens[pos] === ')') {
104
+ pos++; // skip ')'
105
+ }
106
+
107
+ return {
108
+ type: operator === 'AND' ? ConditionTokens.AND : ConditionTokens.OR,
109
+ conditions: [left, right]
110
+ };
111
+ } else if (/^\d+$/.test(tokens[pos])) {
112
+ const alias = tokens[pos];
113
+ pos++;
114
+ return aliases[alias];
115
+ }
116
+
117
+ throw new Error('Invalid pattern');
118
+ };
119
+
120
+ return parseExpression();
121
+ } // Helper method to tokenize the pattern string (e.g. "(1and2)")
122
+
123
+
124
+ tokenizePattern(pattern) {
125
+ return pattern.replace(/\(/g, ' ( ').replace(/\)/g, ' ) ').replace(/and/g, ' AND ').replace(/or/g, ' OR ').replace(/not/g, ' NOT ').split(/\s+/).filter(token => token.length > 0);
126
+ } // Helper method to create aliases for the conditions (e.g. "1", "2")
127
+
128
+
129
+ generateAliases(conditions) {
130
+ const aliases = {};
131
+ conditions.forEach((condition, index) => {
132
+ const alias = String(index + 1); // Starting with "1"
133
+
134
+ aliases[alias] = {
135
+ type: ConditionTokens.CONDITION,
136
+ fieldName: condition.fieldName,
137
+ condition: condition.condition,
138
+ value: condition.value
139
+ };
140
+ });
141
+ return aliases;
142
+ }
143
+ /**
144
+ * input:
145
+ * {
146
+ * type: 'OR',
147
+ * conditions: [
148
+ * {
149
+ * type: 'AND',
150
+ * conditions: [
151
+ * { type: 'CONDITION', fieldName: 'productCode', condition: "isn't", value: '12345' },
152
+ * { type: 'CONDITION', fieldName: 'quantity', condition: 'is', value: 100 }
153
+ * ]
154
+ * },
155
+ * {
156
+ * type: 'AND',
157
+ * conditions: [
158
+ * { type: 'CONDITION', fieldName: 'category', condition: 'contains', value: 'electronics' },
159
+ * { type: 'CONDITION', fieldName: 'discount', condition: 'is not empty', value: null }
160
+ * ]
161
+ * }
162
+ * ]
163
+ * }
164
+ *
165
+ * output:
166
+ * "((productCode != 12345 AND quantity = 100) OR (category.contains('electronics') AND discount.isNotEmpty()))"
167
+ */
168
+
169
+
170
+ convertConditionToQueryStringRecursive(condition) {
171
+ if (!condition) {
172
+ return '';
173
+ }
174
+
175
+ if (condition.type === ConditionTokens.CONDITION) {
176
+ const {
177
+ fieldName,
178
+ condition: comp,
179
+ value
180
+ } = condition;
181
+
182
+ switch (comp) {
183
+ case CommonComparators.ISEMPTY:
184
+ return `${fieldName}.isEmpty()`;
185
+
186
+ case CommonComparators.ISNOTEMPTY:
187
+ return `${fieldName}.isNotEmpty()`;
188
+
189
+ case TextComparators.IS:
190
+ return `${fieldName} = '${value}'`;
191
+
192
+ case TextComparators.ISNT:
193
+ return `${fieldName} != '${value}'`;
194
+
195
+ case TextComparators.STARTSWITH:
196
+ return `${fieldName}.startsWith('${value}')`;
197
+
198
+ case TextComparators.ENDSWITH:
199
+ return `${fieldName}.endsWith('${value}')`;
200
+
201
+ case TextComparators.CONTAINS:
202
+ return `${fieldName}.contains('${value}')`;
203
+
204
+ case TextComparators.DOESNTCONTAIN:
205
+ return `!${fieldName}.contains('${value}')`;
206
+
207
+ case NumberComparators.EQUAL:
208
+ return `${fieldName} = ${value}`;
209
+
210
+ case NumberComparators.NOTEQUAL:
211
+ return `${fieldName} != ${value}`;
212
+
213
+ case NumberComparators.LESSTHAN:
214
+ return `${fieldName} < ${value}`;
215
+
216
+ case NumberComparators.LESSTHANEQUAL:
217
+ return `${fieldName} <= ${value}`;
218
+
219
+ case NumberComparators.GREATERTHAN:
220
+ return `${fieldName} > ${value}`;
221
+
222
+ case NumberComparators.GREATERTHANEQUAL:
223
+ return `${fieldName} >= ${value}`;
224
+
225
+ case DateComparators.ISAFTER:
226
+ return `${fieldName} > '${value}'`;
227
+
228
+ case DateComparators.ISBEFORE:
229
+ return `${fieldName} < '${value}'`;
230
+
231
+ case DateComparators.BETWEEN:
232
+ return `${fieldName}.between('${value.start}', '${value.end}')`;
233
+
234
+ case DateComparators.NOTBETWEEN:
235
+ return `!${fieldName}.between('${value.start}', '${value.end}')`;
236
+
237
+ default:
238
+ return '';
239
+ }
240
+ } else {
241
+ const operator = condition.type === ConditionTokens.AND ? ' AND ' : ' OR ';
242
+ const parts = condition.conditions.map(c => this.convertConditionToQueryStringRecursive(c));
243
+ return `(${parts.join(operator)})`;
244
+ }
245
+ }
246
+
247
+ }
@@ -14,11 +14,16 @@ const recordExecuteStrategiesMap = {
14
14
  [RecordApiActionName.GET_REORDERRECORD]: new GetReOrderRecordsStrategy()
15
15
  };
16
16
  export default class RecordsManager {
17
- constructor(records) {
17
+ constructor(records, filter) {
18
18
  this.records = records;
19
+ this.filter = filter;
19
20
  }
20
21
 
21
22
  createDataSourceExecuteEvent(props, actionName, metaData) {
23
+ if (actionName === RecordApiActionName.GET_RECORDS && props.filter === undefined) {
24
+ props.filter = this.filter.getFilterQuery();
25
+ }
26
+
22
27
  return {
23
28
  type: DATA_SOURCE_EXECUTE,
24
29
  payload: {
@@ -249,6 +254,18 @@ export default class RecordsManager {
249
254
  this.records.updateRecord(recordId, record);
250
255
  }
251
256
 
257
+ getFilterCondition() {
258
+ return this.filter.getCondition();
259
+ }
260
+
261
+ getFilterConfig() {
262
+ return this.filter.getConfig();
263
+ }
264
+
265
+ setFilterConfig(filterConfig) {
266
+ this.filter.setConfig(filterConfig);
267
+ }
268
+
252
269
  deleteMultipleRecord(recordIds) {
253
270
  this.records.deleteMultipleRecord(recordIds);
254
271
  }
@@ -260,6 +277,7 @@ export default class RecordsManager {
260
277
  toObject() {
261
278
  const recordsObj = this.records.toObject();
262
279
  return {
280
+ filter: this.filter.toObject(),
263
281
  records: recordsObj.data,
264
282
  hasMore: recordsObj.hasMore,
265
283
  isFetching: recordsObj.isFetching
@@ -1,11 +1,21 @@
1
1
  import ActionsHandlersFactory from "./ActionsHandlersFactory";
2
+ import { initialFilterConfig } from "../../../bc/zrecord/Types";
2
3
  export default class RecordBehaviourFactory {
3
4
  static create(apiDetails) {
4
5
  return {
5
6
  name: 'zrecord',
6
7
  eventHandlers: ActionsHandlersFactory.create(apiDetails),
7
8
  properties: {},
8
- setInitialState: () => ({})
9
+ setInitialState: () => {
10
+ const filterRestoreObjectInitial = {
11
+ config: initialFilterConfig,
12
+ condition: null,
13
+ queryString: ''
14
+ };
15
+ return {
16
+ filter: filterRestoreObjectInitial
17
+ };
18
+ }
9
19
  };
10
20
  }
11
21
 
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-exp.2",
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
+ }