@webitel/ui-datalist 26.8.2 → 26.8.3
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import deepEqual from 'deep-equal';
|
|
2
2
|
import set from 'lodash/set';
|
|
3
|
-
import { type Ref, ref, toRaw, watch } from 'vue';
|
|
3
|
+
import { nextTick, type Ref, ref, toRaw, watch } from 'vue';
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
createDatalistStore,
|
|
@@ -247,6 +247,53 @@ export const tableStoreBody = <Entity extends Identifiable>(
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
|
|
250
|
+
let loadingAfterFiltersChange = false;
|
|
251
|
+
|
|
252
|
+
watch(
|
|
253
|
+
[
|
|
254
|
+
() => filtersManager.value.getAllValues(),
|
|
255
|
+
sort,
|
|
256
|
+
fields,
|
|
257
|
+
size,
|
|
258
|
+
],
|
|
259
|
+
async () => {
|
|
260
|
+
if (!isStoreSetUp.value) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/*
|
|
265
|
+
* @author @Lera24
|
|
266
|
+
* https://webitel.atlassian.net/browse/WTEL-7597?focusedCommentId=697115
|
|
267
|
+
* */
|
|
268
|
+
if (isReorderingColumn.value) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
loadingAfterFiltersChange = true;
|
|
272
|
+
updatePage(1);
|
|
273
|
+
await loadDataList();
|
|
274
|
+
loadingAfterFiltersChange = false;
|
|
275
|
+
},
|
|
276
|
+
/* filtersManager requires deep watching for its values */
|
|
277
|
+
{
|
|
278
|
+
deep: true,
|
|
279
|
+
},
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
watch(
|
|
283
|
+
[
|
|
284
|
+
page,
|
|
285
|
+
],
|
|
286
|
+
() => {
|
|
287
|
+
if (!isStoreSetUp.value) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (!loadingAfterFiltersChange && !isAppendDataList) {
|
|
292
|
+
return loadDataList();
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
);
|
|
296
|
+
|
|
250
297
|
const setupStore = async () => {
|
|
251
298
|
if (isStoreSetUp.value) {
|
|
252
299
|
return;
|
|
@@ -260,44 +307,13 @@ export const tableStoreBody = <Entity extends Identifiable>(
|
|
|
260
307
|
]);
|
|
261
308
|
}
|
|
262
309
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
size,
|
|
271
|
-
],
|
|
272
|
-
async () => {
|
|
273
|
-
/*
|
|
274
|
-
* @author @Lera24
|
|
275
|
-
* https://webitel.atlassian.net/browse/WTEL-7597?focusedCommentId=697115
|
|
276
|
-
* */
|
|
277
|
-
if (isReorderingColumn.value) {
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
loadingAfterFiltersChange = true;
|
|
281
|
-
updatePage(1);
|
|
282
|
-
await loadDataList();
|
|
283
|
-
loadingAfterFiltersChange = false;
|
|
284
|
-
},
|
|
285
|
-
/* filtersManager requires deep watching for its values */
|
|
286
|
-
{
|
|
287
|
-
deep: true,
|
|
288
|
-
},
|
|
289
|
-
);
|
|
290
|
-
|
|
291
|
-
watch(
|
|
292
|
-
[
|
|
293
|
-
page,
|
|
294
|
-
],
|
|
295
|
-
() => {
|
|
296
|
-
if (!loadingAfterFiltersChange && !isAppendDataList) {
|
|
297
|
-
return loadDataList();
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
);
|
|
310
|
+
/*
|
|
311
|
+
* lets any reactive updates the restore above just made (e.g. to
|
|
312
|
+
* sort/fields/filters) finish flushing through the watchers above
|
|
313
|
+
* while `isStoreSetUp` is still false, before they start reacting to
|
|
314
|
+
* real changes
|
|
315
|
+
*/
|
|
316
|
+
await nextTick();
|
|
301
317
|
|
|
302
318
|
isStoreSetUp.value = true;
|
|
303
319
|
};
|