@itfin/components 1.4.7 → 1.4.9
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
|
@@ -27,18 +27,21 @@
|
|
|
27
27
|
<slot name="after-filter-btn"></slot>
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
|
-
<div
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
<div class="d-flex align-items-center justify-content-between w-100">
|
|
31
|
+
<div v-if="showFilters && showFilter" class="d-flex gap-2 flex-nowrap filters-row">
|
|
32
|
+
<filter-badge
|
|
33
|
+
v-for="(facet, n) in visibleFilters"
|
|
34
|
+
:key="n"
|
|
35
|
+
v-model="filter[facet.name]"
|
|
36
|
+
:is-default="filter[facet.name].isDefault"
|
|
37
|
+
:text="filter[facet.name].label"
|
|
38
|
+
:type="facet.type"
|
|
39
|
+
:icon="facet.icon"
|
|
40
|
+
:options="facet.options"
|
|
41
|
+
@change="onFilterChange(facet, $event)"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
<slot name="after-filters"></slot>
|
|
42
45
|
</div>
|
|
43
46
|
<div v-if="loading">
|
|
44
47
|
<span class="itf-spinner"></span>
|
|
@@ -292,7 +295,7 @@ class FilterPanel extends Vue {
|
|
|
292
295
|
value.isDefault = facet.options.defaultValue ? JSON.stringify(value.value) === JSON.stringify(facet.options.defaultValue.value) : false;
|
|
293
296
|
value.label = item ? item.label : facet.options.defaultValue.label;
|
|
294
297
|
} else if (facet.type === 'text') {
|
|
295
|
-
value.value = value.value.length ? value.value : undefined;
|
|
298
|
+
value.value = value.value.length ? value.value : (facet.options?.defaultValue ?? undefined);
|
|
296
299
|
value.isDefault = !value.value;
|
|
297
300
|
}
|
|
298
301
|
value.hidden = facet.options?.hidden ?? false;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
:search="currentTab !== 'list'"
|
|
7
7
|
:show-filter="currentTab !== 'list'"
|
|
8
8
|
class="py-2 px-3"
|
|
9
|
+
:static-filters="filters"
|
|
9
10
|
:endpoint="filtersEndpoint"
|
|
10
11
|
:panel="panel"
|
|
11
12
|
v-model="filter"
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
</itf-dropdown>
|
|
42
43
|
|
|
43
44
|
<itf-segmented-control
|
|
44
|
-
v-if="tabs.length"
|
|
45
|
+
v-if="tabs.length > 1"
|
|
45
46
|
class="small"
|
|
46
47
|
v-model="currentTab"
|
|
47
48
|
item-key="value"
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
clickable
|
|
72
73
|
column-sorting
|
|
73
74
|
column-resizing
|
|
74
|
-
indicator-type="
|
|
75
|
+
:indicator-type="indicatorType"
|
|
75
76
|
class="permanent-checkboxes"
|
|
76
77
|
:state-name="stateName"
|
|
77
78
|
id-property="id"
|
|
@@ -154,6 +155,7 @@ class itfView extends Vue {
|
|
|
154
155
|
@Prop(String) itemsKey;
|
|
155
156
|
@Prop(String) panelKey;
|
|
156
157
|
@Prop(String) stateName;
|
|
158
|
+
@Prop({ type: String, default: 'checkbox' }) indicatorType;
|
|
157
159
|
@Prop({ type: String, default: 'table' }) tab;
|
|
158
160
|
@Prop({ type: String, default () { return this.$t('components.table.search'); } }) searchPlaceholder;
|
|
159
161
|
@Prop() panel;
|
|
@@ -162,7 +164,8 @@ class itfView extends Vue {
|
|
|
162
164
|
@Prop(Boolean) listViewEnabled;
|
|
163
165
|
@Prop(Boolean) kanbanViewEnabled;
|
|
164
166
|
@Prop(Boolean) calendarViewEnabled;
|
|
165
|
-
@Prop(Boolean) tableViewEnabled;
|
|
167
|
+
@Prop({ type: Boolean, default: true }) tableViewEnabled;
|
|
168
|
+
@Prop(Boolean) oldFormat;
|
|
166
169
|
|
|
167
170
|
page = 1;
|
|
168
171
|
total = 0;
|
|
@@ -172,7 +175,7 @@ class itfView extends Vue {
|
|
|
172
175
|
filter = {};
|
|
173
176
|
loadingData = false;
|
|
174
177
|
activeIds = [];
|
|
175
|
-
tableColumns =
|
|
178
|
+
tableColumns = undefined;
|
|
176
179
|
_currentTab = null;
|
|
177
180
|
|
|
178
181
|
get currentTab() {
|
|
@@ -240,19 +243,32 @@ class itfView extends Vue {
|
|
|
240
243
|
this.$emit('load', this.filter);
|
|
241
244
|
this.loadingData = true;
|
|
242
245
|
await this.$try(async () => {
|
|
243
|
-
|
|
244
|
-
|
|
246
|
+
let filter = this.filter;
|
|
247
|
+
if (this.oldFormat) {
|
|
248
|
+
filter = Object.keys(filter).reduce((acc, key) => {
|
|
249
|
+
acc[`filter[${key}]`] = filter[key];
|
|
250
|
+
return acc;
|
|
251
|
+
}, {})
|
|
252
|
+
}
|
|
253
|
+
const { data, headers } = await this.$axios.get(this.endpoint, {
|
|
245
254
|
params: {
|
|
246
|
-
...
|
|
255
|
+
...filter,
|
|
247
256
|
page: this.page,
|
|
248
257
|
size: this.size,
|
|
249
258
|
sort: this.sorting
|
|
250
259
|
}
|
|
251
260
|
});
|
|
252
|
-
this.
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
261
|
+
if (this.oldFormat) {
|
|
262
|
+
this.items = data;
|
|
263
|
+
this.page = Number(headers['x-page'] ?? 1);
|
|
264
|
+
this.total = Number(headers['x-count'] ?? 0);
|
|
265
|
+
this.size = Number(headers['x-size'] ?? 20);
|
|
266
|
+
} else {
|
|
267
|
+
this.items = data[this.itemsKey];
|
|
268
|
+
this.page = data.meta.page;
|
|
269
|
+
this.total = data.meta.total;
|
|
270
|
+
this.size = data.meta.size;
|
|
271
|
+
}
|
|
256
272
|
});
|
|
257
273
|
this.loadingData = false;
|
|
258
274
|
this.$emit('loaded', this.filter);
|