@webitel/ui-sdk 3.2.44 → 3.2.46
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.
package/package.json
CHANGED
|
@@ -22,10 +22,19 @@ export default class TableStoreModule extends BaseStoreModule {
|
|
|
22
22
|
GET_LIST_PARAMS: (state, getters) => (overrideFilters) => {
|
|
23
23
|
const filters = getters.GET_FILTERS || getters['filters/GET_FILTERS'];
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const defaultFields = state.headers.filter((header) => header.show)
|
|
26
|
+
.map((header) => header.field);
|
|
27
|
+
|
|
28
|
+
const getFieldsByFieldValues = (values) => {
|
|
29
|
+
values.map((passedValue) => state.headers.find(({ value }) => passedValue ===
|
|
30
|
+
value));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const fields = [
|
|
34
|
+
...new Set(filters.fields
|
|
35
|
+
? getFieldsByFieldValues(filters.fields)
|
|
36
|
+
: defaultFields),
|
|
37
|
+
].concat(getters.REQUIRED_FIELDS);
|
|
29
38
|
|
|
30
39
|
return {
|
|
31
40
|
...filters,
|
|
@@ -92,10 +101,9 @@ export default class TableStoreModule extends BaseStoreModule {
|
|
|
92
101
|
context.commit('SET_PAGE', page);
|
|
93
102
|
},
|
|
94
103
|
RESTORE_FIELDS_FROM_FILTER: (context, { value }) => {
|
|
95
|
-
console.info(value, context.state.headers);
|
|
96
104
|
const headers = context.state.headers.map((header) => ({
|
|
97
105
|
...header,
|
|
98
|
-
show: value.includes(header.
|
|
106
|
+
show: value.includes(header.value),
|
|
99
107
|
}));
|
|
100
108
|
return context.dispatch('SET_HEADERS', headers);
|
|
101
109
|
},
|