@itfin/components 1.4.28 → 1.4.33
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/libs/air-datepicker/air-datepicker.js +1 -1
- package/package.json +1 -1
- package/src/components/app/App.vue +3 -6
- package/src/components/checkbox/Checkbox.vue +1 -1
- package/src/components/checkbox/RadioBox.vue +6 -13
- package/src/components/customize/PropertyItem.vue +13 -5
- package/src/components/datepicker/DatePickerInline.vue +129 -62
- package/src/components/filter/FilterPanel.vue +37 -16
- package/src/components/icon/components/nomi-.DS_Store +0 -0
- package/src/components/icon/components/nomi-arrow_left.vue +4 -0
- package/src/components/icon/components/nomi-balance_turnover.vue +5 -0
- package/src/components/icon/components/nomi-bar-horizontal.vue +7 -0
- package/src/components/icon/components/nomi-chart-funnel.vue +6 -0
- package/src/components/icon/components/nomi-chart-kpi.vue +8 -0
- package/src/components/icon/components/nomi-check-alt.vue +4 -0
- package/src/components/icon/components/nomi-control-panel.vue +8 -0
- package/src/components/icon/components/nomi-credit.vue +4 -0
- package/src/components/icon/components/nomi-goods-turnover.vue +4 -0
- package/src/components/icon/components/nomi-goods.vue +5 -0
- package/src/components/icon/components/nomi-help-alt.vue +4 -0
- package/src/components/icon/components/nomi-link.vue +6 -0
- package/src/components/icon/components/nomi-menu.vue +3 -3
- package/src/components/icon/components/nomi-minus.vue +1 -1
- package/src/components/icon/components/nomi-pc.vue +4 -0
- package/src/components/icon/components/nomi-promo.vue +4 -0
- package/src/components/icon/components/nomi-transactions_delete.vue +5 -0
- package/src/components/icon/components/nomi-types.vue +7 -0
- package/src/components/icon/components/nomi-warning_triangle.vue +6 -0
- package/src/components/panels/PanelItemEdit.vue +6 -8
- package/src/components/panels/PanelLink.vue +6 -15
- package/src/components/panels/PanelList.vue +7 -3
- package/src/components/panels/helpers.ts +10 -4
- package/src/components/table/Table2.vue +65 -61
- package/src/components/table/TableBody.vue +6 -0
- package/src/components/table/TableGroup.vue +14 -4
- package/src/components/table/TableHeader.vue +12 -7
- package/src/components/table/TableRowToggle.vue +9 -1
- package/src/components/table/TableRows.vue +55 -43
- package/src/components/table/table2.scss +15 -25
- package/src/components/view/View.vue +15 -8
|
@@ -25,6 +25,22 @@
|
|
|
25
25
|
<span v-if="indicatorType === 'order'">{{ (n + 1) }}</span>
|
|
26
26
|
<span v-else-if="indicatorType === 'property'">{{ item[idProperty] }}</span>
|
|
27
27
|
<span v-else-if="indicatorType === 'checkbox'"><itf-checkbox :value="item[idProperty]" /></span>
|
|
28
|
+
<a href="" @click.prevent.stop="$emit('toggle', item)" v-else-if="indicatorType === 'toggle'">
|
|
29
|
+
<template v-if="subrowsProperty && item[subrowsProperty] && item[subrowsProperty].length">
|
|
30
|
+
<template v-if="item[subrowsProperty] && item[subrowsProperty].length && !isExpanded(item)">
|
|
31
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus-square" viewBox="0 0 16 16">
|
|
32
|
+
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/>
|
|
33
|
+
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>
|
|
34
|
+
</svg>
|
|
35
|
+
</template>
|
|
36
|
+
<template v-else>
|
|
37
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-dash-square" viewBox="0 0 16 16">
|
|
38
|
+
<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/>
|
|
39
|
+
<path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8"/>
|
|
40
|
+
</svg>
|
|
41
|
+
</template>
|
|
42
|
+
</template>
|
|
43
|
+
</a>
|
|
28
44
|
</div>
|
|
29
45
|
</div>
|
|
30
46
|
<div accept-group="items" class="table-item-inner" @click="$emit('row-click', item)">
|
|
@@ -33,37 +49,37 @@
|
|
|
33
49
|
v-if="column.visible !== false"
|
|
34
50
|
:data-column="k"
|
|
35
51
|
:style="`width: ${column.width}px; max-width: ${column.width}px; left: ${column.left}px;`"
|
|
36
|
-
:class="{'
|
|
52
|
+
:class="{'sticky': column.pinned, 'last-sticky-column': k === lastPinnedIndex, 'editable': column.editable && editable}"
|
|
37
53
|
class="table-view-item-value d-flex h-100">
|
|
38
|
-
<div class="table-view-item-value-content" :class="{'px-2': !(column.editable && editable)}">
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
<div class="table-view-item-value-content align-items-center" :class="{'justify-content-end': column.align === 'end', 'px-2': !(column.editable && editable)}">
|
|
55
|
+
<slot
|
|
56
|
+
:name="`column.${column.property}`"
|
|
57
|
+
:toggle="() => $emit('toggle', item)"
|
|
58
|
+
:hasSubitems="hasSubitems(item)"
|
|
59
|
+
:isExpanded="!!(hasSubitems(item) && !isExpanded(item))"
|
|
60
|
+
:level="level" :editable="column.editable && editable" :item="item" :column="column" :update="(val) => updateValue(item, val, n, column)" :value="getValue(item, column)">
|
|
61
|
+
<template v-if="column.editable && editable && (!editableProperty || item[editableProperty])">
|
|
62
|
+
<slot :name="`edit.${column.type}`" :level="level" :toggle="() => $emit('toggle', item)" :update="(val) => updateValue(item, val, n, column)" :value="getValue(item, column)" :item="item" :column="column">
|
|
63
|
+
<itf-text-field class="w-100 h-100" v-if="column.type === 'text'" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
|
|
64
|
+
<itf-text-field class="w-100 h-100" v-if="column.type === 'number'" type="number" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
|
|
65
|
+
<itf-hours-field
|
|
66
|
+
class="w-100 h-100"
|
|
67
|
+
placeholder="00h 00m"
|
|
68
|
+
v-else-if="column.type === 'time'"
|
|
69
|
+
:hours="getValue(item, column)"
|
|
70
|
+
@update:hours="updateValue(item, $event, n, column)"
|
|
71
|
+
/>
|
|
72
|
+
<itf-textarea class="w-100 h-100" :rows="1" autogrow v-else-if="column.type === 'textarea'" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
|
|
73
|
+
<itf-money-field class="w-100 h-100" currency-disabled :currency="currency" :currencies="currencies" v-else-if="column.type === 'money'" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
|
|
74
|
+
<itf-select class="w-100 h-100" v-else-if="column.type === 'select'" :reduce="(item) => item.value" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" :options="column.options"></itf-select>
|
|
75
|
+
</slot>
|
|
76
|
+
</template>
|
|
77
|
+
<span v-else class="text-truncate">
|
|
78
|
+
<slot :name="`format.${column.type}`" :toggle="() => $emit('toggle', item)" :level="level" :value="getValue(item, column)" :update="(value) => updateValue(item, value, n, column)" :item="item" :column="column">
|
|
79
|
+
{{getValue(item, column)}}
|
|
80
|
+
</slot>
|
|
81
|
+
</span>
|
|
82
|
+
</slot>
|
|
67
83
|
</div>
|
|
68
84
|
</div>
|
|
69
85
|
</template>
|
|
@@ -86,6 +102,7 @@
|
|
|
86
102
|
:columns="columns"
|
|
87
103
|
:id-property="idProperty"
|
|
88
104
|
:subrows-property="subrowsProperty"
|
|
105
|
+
:async-subrows-property="asyncSubrowsProperty"
|
|
89
106
|
:show-add-column="showAddColumn"
|
|
90
107
|
:show-actions="showActions"
|
|
91
108
|
:no-select-all="noSelectAll"
|
|
@@ -145,6 +162,7 @@ class itfTableRows extends Vue {
|
|
|
145
162
|
@Prop() rows;
|
|
146
163
|
@Prop() idProperty;
|
|
147
164
|
@Prop() subrowsProperty;
|
|
165
|
+
@Prop() asyncSubrowsProperty;
|
|
148
166
|
@Prop() dividerProperty;
|
|
149
167
|
@Prop() active;
|
|
150
168
|
@Prop(Boolean) showAddColumn;
|
|
@@ -174,6 +192,12 @@ class itfTableRows extends Vue {
|
|
|
174
192
|
return this.columns.findIndex((column) => column.lastPinned);
|
|
175
193
|
}
|
|
176
194
|
|
|
195
|
+
hasSubitems(item) {
|
|
196
|
+
const hasFactItems = this.subrowsProperty && item[this.subrowsProperty] && item[this.subrowsProperty].length;
|
|
197
|
+
const hasPlanItems = this.asyncSubrowsProperty && item[this.asyncSubrowsProperty] && item[this.asyncSubrowsProperty];
|
|
198
|
+
return !!(hasFactItems || hasPlanItems);
|
|
199
|
+
}
|
|
200
|
+
|
|
177
201
|
updateValue(item, value, index, column) {
|
|
178
202
|
const newItem = { ...item };
|
|
179
203
|
if (newItem[column.property] !== value) {
|
|
@@ -188,20 +212,8 @@ class itfTableRows extends Vue {
|
|
|
188
212
|
}
|
|
189
213
|
}
|
|
190
214
|
|
|
191
|
-
updateValues(item, values, index, column) {
|
|
192
|
-
const newItem = { ...item };
|
|
193
|
-
Object.assign(newItem, values);
|
|
194
|
-
this.$emit('update', {
|
|
195
|
-
index,
|
|
196
|
-
item,
|
|
197
|
-
inputValue: values,
|
|
198
|
-
value: newItem,
|
|
199
|
-
column
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
215
|
isActive(id) {
|
|
204
|
-
if (!this.idProperty) {
|
|
216
|
+
if (!this.idProperty || !this.active) {
|
|
205
217
|
return false;
|
|
206
218
|
}
|
|
207
219
|
if (Array.isArray(this.active)) {
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
--itf-table-alt-bg: #F9FAFB;
|
|
8
8
|
--itf-table-alt-selected-bg: #eff1f3;
|
|
9
9
|
--itf-table-header-bg: #f5f7f8;
|
|
10
|
-
--itf-table-header-color: #
|
|
10
|
+
--itf-table-header-color: #575b63;
|
|
11
11
|
--itf-table-mirror-bg: #F2F4F7;
|
|
12
12
|
--itf-table-border-color: transparent; //var(--itf-table-header-bg);
|
|
13
|
-
--itf-table-header-border-color: #
|
|
13
|
+
--itf-table-header-border-color: #8E97A533;
|
|
14
14
|
--itf-table-border-base-color: var(--itf-table-header-bg); // кольори границь таблиці без внутрішніх рядків
|
|
15
15
|
--itf-table-border-base-width: 2px;
|
|
16
16
|
--itf-table-hover-header-bg: #dfe5ef;
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
--itf-table-summary-text: var(--bs-tertiary-color);
|
|
24
24
|
--itf-table-table-border-radius: 1rem;
|
|
25
25
|
--itf-table-header-height: 2.25rem;
|
|
26
|
+
--itf-table-divider-bg: #F7F8FA;
|
|
27
|
+
--itf-table-divider-border: rgba(238, 238, 238, 1);
|
|
26
28
|
|
|
27
29
|
--group-title-height: 40px;
|
|
28
30
|
--table-row-height: none;
|
|
@@ -43,6 +45,9 @@ body[data-theme="dark"] {
|
|
|
43
45
|
--itf-table-selected-bg: #011534;
|
|
44
46
|
--itf-table-active-bg: #022e72;
|
|
45
47
|
--itf-table-summary-text: #82909d80;
|
|
48
|
+
--itf-table-border-base-color: var(--itf-table-header-bg);
|
|
49
|
+
--itf-table-divider-bg: #0f0f0f;
|
|
50
|
+
--itf-table-divider-border: rgb(100, 100, 100, .1);
|
|
46
51
|
}
|
|
47
52
|
.itf-table2 {
|
|
48
53
|
font-size: var(--itf-table-content-font-size, var(--itf-table-font-size));
|
|
@@ -60,7 +65,7 @@ body[data-theme="dark"] {
|
|
|
60
65
|
height: 100%;
|
|
61
66
|
}
|
|
62
67
|
.scroller {
|
|
63
|
-
margin-bottom:
|
|
68
|
+
//margin-bottom: .5rem;
|
|
64
69
|
}
|
|
65
70
|
.scrollable-x {
|
|
66
71
|
overflow-x: scroll;
|
|
@@ -97,34 +102,18 @@ body[data-theme="dark"] {
|
|
|
97
102
|
position: sticky;
|
|
98
103
|
top: 0;
|
|
99
104
|
bottom: 0;
|
|
100
|
-
right:
|
|
105
|
+
right: -5px;
|
|
101
106
|
z-index: 8;
|
|
107
|
+
padding-right: 5px;
|
|
108
|
+
padding-left: 5px;
|
|
102
109
|
display: flex;
|
|
103
110
|
align-items: center;
|
|
104
|
-
|
|
105
|
-
@media (max-width: 768px) {
|
|
106
|
-
position: relative;
|
|
107
|
-
opacity: 1;
|
|
108
|
-
}
|
|
109
111
|
}
|
|
110
112
|
.on-hover {
|
|
111
113
|
opacity: 0;
|
|
112
|
-
width: 0;
|
|
113
|
-
padding: 4px .5rem;
|
|
114
|
-
overflow: hidden;
|
|
115
114
|
pointer-events: none;
|
|
116
|
-
position: absolute;
|
|
117
|
-
right: 0;
|
|
118
|
-
background: linear-gradient(90deg, transparent 0, var(--itf-table2-row-bg) 10px);
|
|
119
|
-
|
|
120
|
-
@media (max-width: 768px) {
|
|
121
|
-
width: max-content;
|
|
122
|
-
opacity: 1;
|
|
123
|
-
position: relative;
|
|
124
|
-
}
|
|
125
115
|
}
|
|
126
116
|
.table-row-template:hover .on-hover {
|
|
127
|
-
width: max-content;
|
|
128
117
|
opacity: 1;
|
|
129
118
|
pointer-events: all;
|
|
130
119
|
}
|
|
@@ -451,11 +440,11 @@ body[data-theme="dark"] {
|
|
|
451
440
|
}
|
|
452
441
|
|
|
453
442
|
&__row-divider {
|
|
454
|
-
background-color:
|
|
443
|
+
background-color: var(--itf-table-divider-bg);
|
|
455
444
|
height: 5px;
|
|
456
445
|
padding: 0;
|
|
457
|
-
border-top: 1px solid
|
|
458
|
-
border-bottom: 1px solid
|
|
446
|
+
border-top: 1px solid var(--itf-table-divider-border);
|
|
447
|
+
border-bottom: 1px solid var(--itf-table-divider-border);
|
|
459
448
|
}
|
|
460
449
|
//&:hover, &.permanent-editable-border {
|
|
461
450
|
// .table-view-item-value.editable {
|
|
@@ -468,6 +457,7 @@ body[data-theme="dark"] {
|
|
|
468
457
|
position: relative;
|
|
469
458
|
z-index: 2;
|
|
470
459
|
width: 100%;
|
|
460
|
+
display: flex;
|
|
471
461
|
height: 100%;
|
|
472
462
|
background: var(--itf-table2-row-bg)
|
|
473
463
|
}
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
:endpoint="filtersEndpoint"
|
|
11
11
|
:panel="panel"
|
|
12
12
|
v-model="filter"
|
|
13
|
-
@
|
|
13
|
+
@loaded="onFilterSet($event, true)"
|
|
14
|
+
@change="onFilterSet($event, false)"
|
|
14
15
|
@set-table-schema="setTableSchema"
|
|
15
16
|
>
|
|
16
17
|
<template #after-filter-btn>
|
|
@@ -213,7 +214,7 @@ class itfView extends Vue {
|
|
|
213
214
|
|
|
214
215
|
getDownloadLinks() {
|
|
215
216
|
const state = this.$refs.table ? this.$refs.table.getTableState() : null;
|
|
216
|
-
const filter = this.filter;
|
|
217
|
+
const filter = { ...this.filter };
|
|
217
218
|
const sorting = this.sorting;
|
|
218
219
|
const filterableColumnsNames = (state?.columns ?? []).filter(column => column.visible).map(column => column.property);
|
|
219
220
|
|
|
@@ -297,7 +298,7 @@ class itfView extends Vue {
|
|
|
297
298
|
this.$emit('load', this.filter);
|
|
298
299
|
this.loadingData = true;
|
|
299
300
|
await this.$try(async () => {
|
|
300
|
-
let filter = this.filter;
|
|
301
|
+
let filter = { ...this.filter };
|
|
301
302
|
if (this.oldFormat) {
|
|
302
303
|
filter = Object.keys(filter).reduce((acc, key) => {
|
|
303
304
|
acc[`filter[${key}]`] = filter[key];
|
|
@@ -370,7 +371,9 @@ class itfView extends Vue {
|
|
|
370
371
|
sources.forEach(source => {
|
|
371
372
|
if (source && typeof source === 'object') {
|
|
372
373
|
Object.entries(source).forEach(([key, value]) => {
|
|
373
|
-
if (value
|
|
374
|
+
if (key === 'page' && value === null) {
|
|
375
|
+
delete target[key];
|
|
376
|
+
} else if (value !== undefined) {
|
|
374
377
|
target[key] = value;
|
|
375
378
|
}
|
|
376
379
|
});
|
|
@@ -380,10 +383,14 @@ class itfView extends Vue {
|
|
|
380
383
|
}
|
|
381
384
|
}
|
|
382
385
|
|
|
383
|
-
onFilterSet(filter) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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
|
+
}
|
|
387
394
|
this.loadData();
|
|
388
395
|
}
|
|
389
396
|
|