@webitel/ui-sdk 24.6.12 → 24.6.13
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
|
@@ -126,12 +126,15 @@ export default class FiltersStoreModule extends BaseStoreModule {
|
|
|
126
126
|
},
|
|
127
127
|
|
|
128
128
|
FLUSH_SUBSCRIBERS: (context) => {
|
|
129
|
-
return context.state._emitter.
|
|
129
|
+
return context.state._emitter.all.clear();
|
|
130
130
|
},
|
|
131
131
|
|
|
132
132
|
EMIT: async (context, { event, payload }) => {
|
|
133
133
|
return new Promise(async (resolve, reject) => {
|
|
134
|
-
const
|
|
134
|
+
const wildcardListeners = context.state._emitter.all.get('*');
|
|
135
|
+
const eventListeners = context.state._emitter.all.get(event);
|
|
136
|
+
|
|
137
|
+
const listeners = [...(wildcardListeners || []), ...(eventListeners || [])];
|
|
135
138
|
|
|
136
139
|
if (!listeners) {
|
|
137
140
|
console.info(`No listeners for ${event} event`);
|
|
@@ -36,7 +36,7 @@ export const useTableStore = (namespace) => {
|
|
|
36
36
|
return store.dispatch(`${tableNamespace}/DELETE`, payload);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
function sort(
|
|
39
|
+
function sort(header, nextSortOrder) {
|
|
40
40
|
return store.dispatch(`${tableNamespace}/SORT`, {
|
|
41
41
|
header,
|
|
42
42
|
nextSortOrder,
|
|
@@ -101,14 +101,21 @@ export default class TableStoreModule extends BaseStoreModule {
|
|
|
101
101
|
|
|
102
102
|
// FIXME: maybe move to filters module?
|
|
103
103
|
HANDLE_SORT_CHANGE: (context, payload) => {
|
|
104
|
-
const nextSort = queryToSortAdapter(payload.value
|
|
104
|
+
const nextSort = queryToSortAdapter(payload.value?.slice(0, 1) || '');
|
|
105
105
|
const field = nextSort ? payload.value.slice(1) : payload.value;
|
|
106
106
|
|
|
107
107
|
const headers = context.state.headers.map(({
|
|
108
108
|
sort: currentSort,
|
|
109
109
|
...header
|
|
110
110
|
}) => {
|
|
111
|
-
|
|
111
|
+
let sort;
|
|
112
|
+
|
|
113
|
+
if (field) {
|
|
114
|
+
sort = field === header.field ? nextSort : currentSort;
|
|
115
|
+
} else {
|
|
116
|
+
sort = nextSort; // null
|
|
117
|
+
}
|
|
118
|
+
|
|
112
119
|
return { ...header, sort };
|
|
113
120
|
});
|
|
114
121
|
|