@itfin/components 1.4.33 → 1.4.35

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.
@@ -10,8 +10,7 @@
10
10
  :endpoint="filtersEndpoint"
11
11
  :panel="panel"
12
12
  v-model="filter"
13
- @loaded="onFilterSet($event, true)"
14
- @change="onFilterSet($event, false)"
13
+ @input="onFilterSet"
15
14
  @set-table-schema="setTableSchema"
16
15
  >
17
16
  <template #after-filter-btn>
@@ -214,7 +213,7 @@ class itfView extends Vue {
214
213
 
215
214
  getDownloadLinks() {
216
215
  const state = this.$refs.table ? this.$refs.table.getTableState() : null;
217
- const filter = { ...this.filter };
216
+ const filter = this.filter;
218
217
  const sorting = this.sorting;
219
218
  const filterableColumnsNames = (state?.columns ?? []).filter(column => column.visible).map(column => column.property);
220
219
 
@@ -298,7 +297,7 @@ class itfView extends Vue {
298
297
  this.$emit('load', this.filter);
299
298
  this.loadingData = true;
300
299
  await this.$try(async () => {
301
- let filter = { ...this.filter };
300
+ let filter = this.filter;
302
301
  if (this.oldFormat) {
303
302
  filter = Object.keys(filter).reduce((acc, key) => {
304
303
  acc[`filter[${key}]`] = filter[key];
@@ -371,9 +370,7 @@ class itfView extends Vue {
371
370
  sources.forEach(source => {
372
371
  if (source && typeof source === 'object') {
373
372
  Object.entries(source).forEach(([key, value]) => {
374
- if (key === 'page' && value === null) {
375
- delete target[key];
376
- } else if (value !== undefined) {
373
+ if (value !== undefined) {
377
374
  target[key] = value;
378
375
  }
379
376
  });
@@ -383,14 +380,10 @@ class itfView extends Vue {
383
380
  }
384
381
  }
385
382
 
386
- onFilterSet(filter, keepPage = false) {
387
- if (keepPage) {
388
- // при завантаженні сторінки не потрібно скидувати сторінку
389
- this.setPanelPayload({ ...filter });
390
- } else {
391
- this.page = 1;
392
- this.setPanelPayload({ ...filter, page: null });
393
- }
383
+ onFilterSet(filter) {
384
+ this.page = 1;
385
+ this.selectedIds = [];
386
+ this.setPanelPayload({ ...filter, page: 1 });
394
387
  this.loadData();
395
388
  }
396
389