@itfin/components 1.4.16 → 1.4.18
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 +1 -1
- package/src/components/view/View.vue +15 -24
package/package.json
CHANGED
|
@@ -46,10 +46,9 @@
|
|
|
46
46
|
<itf-segmented-control
|
|
47
47
|
v-if="tabs.length > 1"
|
|
48
48
|
class="small"
|
|
49
|
-
|
|
49
|
+
v-model="currentTab"
|
|
50
50
|
item-key="value"
|
|
51
51
|
:items="tabs"
|
|
52
|
-
@input="updateTabs"
|
|
53
52
|
>
|
|
54
53
|
<template #item="{ item }">
|
|
55
54
|
<div class="d-flex align-items-center">
|
|
@@ -157,7 +156,6 @@ class itfView extends Vue {
|
|
|
157
156
|
@Prop(String) defaultSorting;
|
|
158
157
|
@Prop(String) endpoint;
|
|
159
158
|
@Prop(String) filtersEndpoint;
|
|
160
|
-
@Prop(String) downloadEndpoint;
|
|
161
159
|
@Prop(String) itemsKey;
|
|
162
160
|
@Prop({ type: String, default: null }) groupBy;
|
|
163
161
|
@Prop({ type: String, default: 'totals' }) totalsKey;
|
|
@@ -187,8 +185,7 @@ class itfView extends Vue {
|
|
|
187
185
|
filter = {};
|
|
188
186
|
loadingData = false;
|
|
189
187
|
activeIds = [];
|
|
190
|
-
tableColumns =
|
|
191
|
-
_currentTab = null;
|
|
188
|
+
tableColumns = [];
|
|
192
189
|
totals = null;
|
|
193
190
|
|
|
194
191
|
@Watch('selectedIds', { deep: true, immediate: true })
|
|
@@ -204,6 +201,7 @@ class itfView extends Vue {
|
|
|
204
201
|
|
|
205
202
|
set currentTab(val) {
|
|
206
203
|
this.$emit('update:tab', val);
|
|
204
|
+
this.setPanelPayload({ tab: val });
|
|
207
205
|
}
|
|
208
206
|
|
|
209
207
|
get tabs() {
|
|
@@ -254,21 +252,6 @@ class itfView extends Vue {
|
|
|
254
252
|
}
|
|
255
253
|
}
|
|
256
254
|
|
|
257
|
-
get stateKey() {
|
|
258
|
-
return this.stateName ? `itf-table-${this.stateName}` : null;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
onDownloadTable() {
|
|
262
|
-
const state = this.stateName ? JSON.parse(localStorage.getItem(this.stateKey) || 'null') : null;
|
|
263
|
-
|
|
264
|
-
const filterableColumnsNames = state?.columns?.filter(column => column.visible).map(column => column.property) || [];
|
|
265
|
-
|
|
266
|
-
const filterWithValue = Object.fromEntries(Object.entries(this.filter).filter(([_, value]) => value));
|
|
267
|
-
const queryParams = new URLSearchParams(filterWithValue).toString();
|
|
268
|
-
const path = `${this.downloadEndpoint}?${queryParams}&page=${this.page}&size=${this.size}&sort=${this.sorting}&columns=${filterableColumnsNames.join(',')}`;
|
|
269
|
-
window.open(path, '_blank');
|
|
270
|
-
}
|
|
271
|
-
|
|
272
255
|
async loadData() {
|
|
273
256
|
if (!this.endpoint) {
|
|
274
257
|
return;
|
|
@@ -341,10 +324,6 @@ class itfView extends Vue {
|
|
|
341
324
|
localStorage.setItem('sizePerPage', val);
|
|
342
325
|
}
|
|
343
326
|
|
|
344
|
-
updateTabs(val) {
|
|
345
|
-
this.setPanelPayload({ tab: val });
|
|
346
|
-
}
|
|
347
|
-
|
|
348
327
|
setPanelPayload(payload) {
|
|
349
328
|
this.panel.setPayload(assignWithoutUndefined(this.panel.getPayload(), payload));
|
|
350
329
|
|
|
@@ -373,5 +352,17 @@ class itfView extends Vue {
|
|
|
373
352
|
setTableSchema(tableSchema) {
|
|
374
353
|
this.tableColumns = tableSchema;
|
|
375
354
|
}
|
|
355
|
+
|
|
356
|
+
getSorting() {
|
|
357
|
+
return this.sorting;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
getFilter() {
|
|
361
|
+
return this.filter;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
getTableState() {
|
|
365
|
+
return this.$refs.table.getTableState();
|
|
366
|
+
}
|
|
376
367
|
}
|
|
377
368
|
</script>
|