@itfin/components 1.3.34 → 1.3.36
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 +2 -1
- package/src/ITFSettings.js +8 -0
- package/src/assets/fonts/bootstrap-icons.woff +0 -0
- package/src/assets/fonts/bootstrap-icons.woff2 +0 -0
- package/src/assets/scss/icons.scss +2085 -0
- package/src/assets/scss/main.scss +1 -0
- package/src/components/avatar/index.stories.js +0 -1
- package/src/components/button/1.html +30 -0
- package/src/components/button/NativeButton.js +116 -0
- package/src/components/button/index.stories.js +10 -6
- package/src/components/checkbox/Checkbox.vue +5 -1
- package/src/components/dropdown/Dropdown.vue +6 -4
- package/src/components/dropdown/DropdownMenu.vue +14 -2
- package/src/components/sortable/sortable-shopify.js +1 -1
- package/src/components/table/Table2.vue +111 -33
- package/src/components/table/TableBody.vue +72 -47
- package/src/components/table/TableGroup.vue +167 -114
- package/src/components/table/TableHeader.vue +153 -36
- package/src/components/table/index.stories.js +152 -4
- package/src/components/table/sticky.js +439 -0
- package/src/components/text-field/MoneyField.vue +3 -2
- package/src/locales/en.js +1 -0
- package/src/locales/uk.js +1 -0
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
key-field="Id"
|
|
9
|
-
v-slot="{ item }"
|
|
10
|
-
direction="vertical"
|
|
11
|
-
>
|
|
12
|
-
<div group="items" data-test="table-item" class="table-view-item grouped draggable-item">
|
|
3
|
+
<div class="scroller">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(item, n) in rows"
|
|
6
|
+
:key="n"
|
|
7
|
+
group="items" data-test="table-item" class="table-view-item grouped draggable-item">
|
|
13
8
|
<div class="table-row-template">
|
|
14
9
|
<div accept-group="items" class="table-view-body-space"></div>
|
|
15
10
|
<div class="shadow-area">
|
|
@@ -24,32 +19,35 @@
|
|
|
24
19
|
</div>
|
|
25
20
|
<div class="indicator sticky">
|
|
26
21
|
<div class="fill on-rest table-view-row-count">
|
|
27
|
-
<span>{{ item
|
|
22
|
+
<!-- <span>{{ item[idProperty] }}</span>-->
|
|
28
23
|
</div>
|
|
29
24
|
<div class="fill on-hover">
|
|
30
|
-
<
|
|
31
|
-
<i class="ic-expand"></i>
|
|
32
|
-
</a>
|
|
33
|
-
<div class="">
|
|
34
|
-
<a data-test="table-row-generator" href="">
|
|
35
|
-
<i class="ic-plus"></i>
|
|
36
|
-
</a>
|
|
37
|
-
</div>
|
|
25
|
+
<itf-checkbox :value="item[idProperty]" />
|
|
38
26
|
</div>
|
|
39
27
|
</div>
|
|
40
28
|
<div accept-group="items" class="table-item-inner">
|
|
41
|
-
<template v-for="(column,
|
|
29
|
+
<template v-for="(column, k) in visibleAttributes">
|
|
42
30
|
<div
|
|
43
31
|
v-if="column.visible !== false"
|
|
44
|
-
:data-column="
|
|
32
|
+
:data-column="k"
|
|
45
33
|
:style="`width: ${column.width}px; left: ${column.left}px;`"
|
|
46
|
-
:class="{'sticky': column.pinned, 'last-sticky-column':
|
|
47
|
-
class="table-view-item-value d-flex h-100 align-items-stretch
|
|
34
|
+
:class="{'sticky': column.pinned, 'last-sticky-column': k === lastPinnedIndex, 'flex-grow-1': column.grow}"
|
|
35
|
+
class="table-view-item-value d-flex h-100 align-items-stretch">
|
|
48
36
|
<slot :name="`column.${column.name}`" :item="item" :column="column">
|
|
49
|
-
<template v-if="
|
|
50
|
-
<
|
|
37
|
+
<template v-if="column.editable">
|
|
38
|
+
<slot :name="`edit.${column.type}`" :value="getValue(item, column)" :item="item" :column="column">
|
|
39
|
+
<div class="px-1 py-1 w-100">
|
|
40
|
+
<itf-text-field v-if="column.type === 'text'" :value="getValue(item, column)" @input="updateValue(item, $event, n)" />
|
|
41
|
+
<itf-textarea autogrow v-else-if="column.type === 'textarea'" :value="getValue(item, column)" @input="updateValue(item, $event)" />
|
|
42
|
+
<itf-money-field v-else-if="column.type === 'money'" no-currency-sign currency-disabled :currency-select="false" :value="getValue(item, column)" @input="updateValue(item, $event)" />
|
|
43
|
+
</div>
|
|
44
|
+
</slot>
|
|
45
|
+
</template>
|
|
46
|
+
<template v-else>
|
|
47
|
+
<slot :name="`format.${column.type}`" :value="getValue(item, column)" :item="item" :column="column">
|
|
48
|
+
<div class="px-2 w-100">{{getValue(item, column)}}</div>
|
|
49
|
+
</slot>
|
|
51
50
|
</template>
|
|
52
|
-
<div v-else v-text="item.Name" />
|
|
53
51
|
</slot>
|
|
54
52
|
</div>
|
|
55
53
|
</template>
|
|
@@ -61,7 +59,7 @@
|
|
|
61
59
|
</div>
|
|
62
60
|
</div>
|
|
63
61
|
</div>
|
|
64
|
-
</
|
|
62
|
+
</div>
|
|
65
63
|
</template>
|
|
66
64
|
<style lang="scss">
|
|
67
65
|
.table-row-template {
|
|
@@ -70,7 +68,6 @@
|
|
|
70
68
|
align-items: stretch;
|
|
71
69
|
}
|
|
72
70
|
.table-item-inner {
|
|
73
|
-
height: 100%;
|
|
74
71
|
flex-grow: 1;
|
|
75
72
|
position: relative;
|
|
76
73
|
display: flex;
|
|
@@ -83,7 +80,6 @@
|
|
|
83
80
|
border-right: 1px solid var(--bs-border-color);
|
|
84
81
|
border-bottom: 1px solid var(--bs-border-color);
|
|
85
82
|
align-items: stretch;
|
|
86
|
-
height: 100%;
|
|
87
83
|
display: flex;
|
|
88
84
|
position: relative;
|
|
89
85
|
line-height: var(--itf-table-line-height);
|
|
@@ -108,7 +104,7 @@
|
|
|
108
104
|
}
|
|
109
105
|
}
|
|
110
106
|
&:hover {
|
|
111
|
-
background-color: var(--
|
|
107
|
+
background-color: var(--bs-tertiary-bg);
|
|
112
108
|
}
|
|
113
109
|
|
|
114
110
|
&.sticky {
|
|
@@ -119,20 +115,19 @@
|
|
|
119
115
|
}
|
|
120
116
|
|
|
121
117
|
.table-item-inner .extra {
|
|
122
|
-
height: 100%;
|
|
123
118
|
flex-grow: 1;
|
|
124
119
|
border-color: var(--bs-border-color);
|
|
125
120
|
}
|
|
126
121
|
|
|
127
122
|
.indicator {
|
|
128
|
-
height: 100%;
|
|
123
|
+
//height: 100%;
|
|
129
124
|
left: var(--shadow-area-width);
|
|
130
125
|
width: var(--indicator-area-width);
|
|
131
126
|
z-index: 4;
|
|
132
127
|
position: -webkit-sticky;
|
|
133
128
|
position: sticky;
|
|
134
129
|
background-color: var(--bs-body-bg);
|
|
135
|
-
border-right: 1px solid var(--bs-border-color);
|
|
130
|
+
//border-right: 1px solid var(--bs-border-color);
|
|
136
131
|
border-bottom: 1px solid var(--bs-border-color);
|
|
137
132
|
display: flex;
|
|
138
133
|
align-items: center;
|
|
@@ -140,6 +135,31 @@
|
|
|
140
135
|
min-width: var(--itf-table-min-width);
|
|
141
136
|
}
|
|
142
137
|
|
|
138
|
+
.table-row-template, .table-view-header-value {
|
|
139
|
+
.form-check {
|
|
140
|
+
padding: 0;
|
|
141
|
+
margin-bottom: 0;
|
|
142
|
+
|
|
143
|
+
.form-check-input {
|
|
144
|
+
margin-left: 0;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.table-row-template {
|
|
149
|
+
.on-hover {
|
|
150
|
+
display: none;
|
|
151
|
+
}
|
|
152
|
+
&:hover, .permanent-checkboxes & {
|
|
153
|
+
.on-rest {
|
|
154
|
+
display: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.on-hover {
|
|
158
|
+
display: block;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
143
163
|
.table-item-inner .boundary {
|
|
144
164
|
z-index: 3;
|
|
145
165
|
position: absolute;
|
|
@@ -172,7 +192,7 @@
|
|
|
172
192
|
bottom: 0;
|
|
173
193
|
}
|
|
174
194
|
.table-small-row .table-view-item {
|
|
175
|
-
height: var(--table-row-height);
|
|
195
|
+
// height: var(--table-row-height);
|
|
176
196
|
}
|
|
177
197
|
.resize-observer {
|
|
178
198
|
position: absolute;
|
|
@@ -191,26 +211,33 @@
|
|
|
191
211
|
</style>
|
|
192
212
|
<script>
|
|
193
213
|
import { Vue, Component, Prop } from 'vue-property-decorator';
|
|
194
|
-
import
|
|
195
|
-
import
|
|
196
|
-
import
|
|
197
|
-
import
|
|
198
|
-
import '
|
|
214
|
+
import get from 'lodash/get';
|
|
215
|
+
// import { RecycleScroller } from 'vue-virtual-scroller'
|
|
216
|
+
import itfCheckbox from '../checkbox/Checkbox.vue';
|
|
217
|
+
import itfTextField from '../text-field/TextField.vue';
|
|
218
|
+
import itfMoneyField from '../text-field/MoneyField.vue';
|
|
219
|
+
import itfTextarea from '../text-field/Textarea.vue';
|
|
220
|
+
// import 'vue-virtual-scroller/dist/vue-virtual-scroller.css';
|
|
199
221
|
|
|
200
222
|
export default @Component({
|
|
201
223
|
name: 'itfTableBody',
|
|
202
224
|
components: {
|
|
203
|
-
|
|
204
|
-
|
|
225
|
+
itfCheckbox,
|
|
226
|
+
itfMoneyField,
|
|
227
|
+
itfTextarea,
|
|
228
|
+
itfTextField,
|
|
229
|
+
// RecycleScroller
|
|
205
230
|
}
|
|
206
231
|
})
|
|
207
232
|
class itfTableBody extends Vue {
|
|
208
233
|
@Prop() columns;
|
|
209
234
|
@Prop() rows;
|
|
235
|
+
@Prop() idProperty;
|
|
210
236
|
@Prop(Boolean) showAddColumn;
|
|
211
|
-
@Prop({ type: Number, default: 40 }) rowHeight;
|
|
212
237
|
|
|
213
|
-
|
|
238
|
+
getValue(item, column) {
|
|
239
|
+
return get(item, column.property);
|
|
240
|
+
}
|
|
214
241
|
|
|
215
242
|
get visibleAttributes() {
|
|
216
243
|
return this.columns;
|
|
@@ -220,10 +247,8 @@ class itfTableBody extends Vue {
|
|
|
220
247
|
return this.columns.findIndex((column) => column.lastPinned);
|
|
221
248
|
}
|
|
222
249
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
this.editTypes[Type] = true;
|
|
226
|
-
}
|
|
250
|
+
updateValue(item, value, index) {
|
|
251
|
+
this.$emit('update', { index, item, value });
|
|
227
252
|
}
|
|
228
253
|
}
|
|
229
254
|
</script>
|
|
@@ -7,31 +7,19 @@
|
|
|
7
7
|
</div-->
|
|
8
8
|
|
|
9
9
|
<div data-test="table-group-wrapper" class="table-group-wrapper flex-grow-1 w-100 d-block"
|
|
10
|
-
:style="`--row-count: ${isShowTable ? rows.length : 0}`">
|
|
11
|
-
<div class="">
|
|
12
|
-
<div
|
|
13
|
-
<itf-table-header
|
|
14
|
-
v-if="showHeader"
|
|
15
|
-
:columns="visibleColumns"
|
|
16
|
-
@sort:columns="onColumnsSorted"
|
|
17
|
-
:column-resizing="columnResizing"
|
|
18
|
-
:column-sorting="columnSorting"
|
|
19
|
-
:show-add-column="showAddColumn"
|
|
20
|
-
:row-height="rowHeight"
|
|
21
|
-
@update:columns="$emit('update:columns', $event)"
|
|
22
|
-
@add-column="$emit('add-column', $event)"
|
|
23
|
-
/>
|
|
24
|
-
|
|
10
|
+
:style="`--row-count: ${isShowTable ? rows.length : 0}`" data-sticky-container>
|
|
11
|
+
<div data-test="table-group" class="position-relative">
|
|
12
|
+
<div :class="stickyId" class="sticky-group">
|
|
25
13
|
<div v-if="title" group="tablegroups" class="draggable-item"
|
|
26
14
|
data-draggable-mirror="{"xAxis":false}">
|
|
27
15
|
<div class="table-row-template d-flex align-items-stretch"
|
|
28
|
-
style="height: var(--group-title-height)">
|
|
16
|
+
style="min-height: var(--group-title-height)">
|
|
29
17
|
<div class="shadow-area"></div>
|
|
30
|
-
<div class="header-wrapper">
|
|
31
|
-
<
|
|
32
|
-
<
|
|
18
|
+
<div class="header-wrapper" :class="{'header-additional-column': showAddColumn}" @click.prevent="toggleGroup">
|
|
19
|
+
<a class="header-content position-sticky d-flex align-items-center">
|
|
20
|
+
<span class="collapse-arrow">
|
|
33
21
|
<itf-icon :name="isShowTable ? 'chevron_down' : 'chevron_right'"/>
|
|
34
|
-
</
|
|
22
|
+
</span>
|
|
35
23
|
<span class="d-flex align-items-center line-overflow group-header-value"
|
|
36
24
|
data-test="group-value-group-label-value">
|
|
37
25
|
{{ title }}
|
|
@@ -39,97 +27,114 @@
|
|
|
39
27
|
<div data-test="table-group-item-count" class="table-group-item-count">
|
|
40
28
|
{{ rows.length }}
|
|
41
29
|
</div>
|
|
42
|
-
</
|
|
30
|
+
</a>
|
|
43
31
|
</div>
|
|
44
32
|
</div>
|
|
45
33
|
</div>
|
|
46
34
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
35
|
+
<itf-table-header
|
|
36
|
+
v-if="isShowTable"
|
|
37
|
+
:visible-header="showHeader"
|
|
38
|
+
:columns="visibleColumns"
|
|
39
|
+
@sort:columns="onColumnsSorted"
|
|
40
|
+
:column-resizing="columnResizing"
|
|
41
|
+
:column-sorting="columnSorting"
|
|
42
|
+
:show-add-column="showAddColumn"
|
|
43
|
+
:rows="rows"
|
|
44
|
+
:schema="schema"
|
|
45
|
+
:selected-ids="selectedIds"
|
|
46
|
+
@update:selectedIds="$emit('update:selectedIds', $event)"
|
|
47
|
+
@update:columns="$emit('update:columns', $event)"
|
|
48
|
+
@add-column="$emit('add-column', $event)"
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
62
51
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
</
|
|
74
|
-
|
|
52
|
+
<!-- Сама таблиця -->
|
|
53
|
+
<div v-if="isShowTable">
|
|
54
|
+
<itf-table-body
|
|
55
|
+
@update="$emit('update', $event)"
|
|
56
|
+
:id-property="idProperty"
|
|
57
|
+
:rows="rows"
|
|
58
|
+
:columns="visibleColumns"
|
|
59
|
+
:show-add-column="showAddColumn">
|
|
60
|
+
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
61
|
+
<slot :name="name" v-bind="slotData || {}"/>
|
|
62
|
+
</template>
|
|
63
|
+
<template v-for="(_, name) in $scopedSlots" #[name]="slotData">
|
|
64
|
+
<slot :name="name" v-bind="slotData || {}"/>
|
|
65
|
+
</template>
|
|
66
|
+
</itf-table-body>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<!-- Лінія додати нову -->
|
|
70
|
+
<div v-if="isShowTable && addNewRows"
|
|
71
|
+
class="table-row-template d-flex align-items-stretch">
|
|
72
|
+
<div class="shadow-area"></div>
|
|
73
|
+
<a href="" @click.prevent="$emit('new', title)" data-test="table-add-new-item"
|
|
74
|
+
class="d-flex align-items-center flex-grow-1 table-add-new-item py-1 text-decoration-none">
|
|
75
|
+
<span class="d-sticky d-flex align-items-center">
|
|
76
|
+
<itf-icon name="plus"/>
|
|
77
|
+
<span>{{ newLabel }}</span>
|
|
78
|
+
</span>
|
|
79
|
+
</a>
|
|
80
|
+
</div>
|
|
75
81
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</span>
|
|
82
|
+
<!-- Групування -->
|
|
83
|
+
<div v-if="isShowTable && showSummary" class="table-row-template d-flex align-items-stretch table-summary">
|
|
84
|
+
<div class="shadow-area"></div>
|
|
85
|
+
|
|
86
|
+
<div class="table-summary-columns d-flex tw-flex-row align-items-center">
|
|
87
|
+
<span
|
|
88
|
+
v-for="(column, n) in visibleColumns"
|
|
89
|
+
:key="n"
|
|
90
|
+
:data-column="n"
|
|
91
|
+
class="table-summary-column position-relative line-overflow"
|
|
92
|
+
:style="`width: ${column.width}px;`">
|
|
93
|
+
<itf-dropdown text>
|
|
94
|
+
<template #button>
|
|
95
|
+
<span data-test="summary-column" class="invisible-summary d-flex align-items-center justify-content-end flex-auto">
|
|
96
|
+
<span class="summary-placeholder align-items-center justify-content-center">
|
|
97
|
+
Summary
|
|
98
|
+
<itf-icon name="chevron_down" />
|
|
94
99
|
</span>
|
|
95
|
-
</
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
</
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
</
|
|
122
|
-
</
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</
|
|
129
|
-
</
|
|
130
|
-
</
|
|
131
|
-
</
|
|
132
|
-
</
|
|
100
|
+
</span>
|
|
101
|
+
</template>
|
|
102
|
+
|
|
103
|
+
<ul class="dropdown-menu show ps-0" aria-labelledby="dropdownMenuOffset">
|
|
104
|
+
<li v-if="column.sortable">
|
|
105
|
+
<a class="dropdown-item d-flex align-items-center" href="javascript:;">
|
|
106
|
+
<itf-icon name="arrow_up" :size="16" class="me-1" />
|
|
107
|
+
Sort By Asc
|
|
108
|
+
</a>
|
|
109
|
+
</li>
|
|
110
|
+
<li v-if="column.sortable">
|
|
111
|
+
<a class="dropdown-item d-flex align-items-center" href="javascript:;">
|
|
112
|
+
<itf-icon name="arrow_down" :size="16" class="me-1" />
|
|
113
|
+
Sort By Desc
|
|
114
|
+
</a>
|
|
115
|
+
</li>
|
|
116
|
+
<li v-if="column.groupable">
|
|
117
|
+
<a class="dropdown-item d-flex align-items-center" href="javascript:;">
|
|
118
|
+
<itf-icon name="episodes" :size="16" class="me-1" />
|
|
119
|
+
Group By
|
|
120
|
+
</a>
|
|
121
|
+
</li>
|
|
122
|
+
<li>
|
|
123
|
+
<a class="dropdown-item d-flex align-items-center" href="javascript:;" @click="togglePinned(n)">
|
|
124
|
+
<itf-icon :name="column.pinned ? 'checkbox_checked' : 'checkbox_empty'" :size="16" class="me-1" />
|
|
125
|
+
<span v-if="column.pinned">Unpin Column</span>
|
|
126
|
+
<span v-else>Pin Column</span>
|
|
127
|
+
</a>
|
|
128
|
+
</li>
|
|
129
|
+
<li>
|
|
130
|
+
<a class="dropdown-item d-flex align-items-center" href="javascript:;" @click="hideColumn(n)">
|
|
131
|
+
<itf-icon name="eye_no" :size="16" class="me-1" />
|
|
132
|
+
Hide
|
|
133
|
+
</a>
|
|
134
|
+
</li>
|
|
135
|
+
</ul>
|
|
136
|
+
</itf-dropdown>
|
|
137
|
+
</span>
|
|
133
138
|
</div>
|
|
134
139
|
</div>
|
|
135
140
|
</div>
|
|
@@ -144,6 +149,7 @@
|
|
|
144
149
|
--table-small-row-size: var(--table-row-height);
|
|
145
150
|
--shadow-area-width: 12px;
|
|
146
151
|
--indicator-area-width: 38px;
|
|
152
|
+
--hover-bg: var(--bs-tertiary-bg);
|
|
147
153
|
|
|
148
154
|
flex-direction: column;
|
|
149
155
|
min-width: 100%;
|
|
@@ -162,15 +168,31 @@
|
|
|
162
168
|
border-bottom: 4px solid rgb(71 190 255 / 1);
|
|
163
169
|
}
|
|
164
170
|
}
|
|
171
|
+
.sticky-group {
|
|
172
|
+
transition: transform 0.02s;
|
|
173
|
+
}
|
|
174
|
+
.sticky-group.sticky {
|
|
175
|
+
z-index: 5;
|
|
176
|
+
|
|
177
|
+
&:before {
|
|
178
|
+
content: '';
|
|
179
|
+
position: absolute;
|
|
180
|
+
left: 0;
|
|
181
|
+
right: 0;
|
|
182
|
+
top: -50px;
|
|
183
|
+
height: 50px;
|
|
184
|
+
background: var(--bs-body-bg);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
165
187
|
|
|
166
188
|
.table-group-wrapper {
|
|
167
189
|
display: flex;
|
|
168
|
-
height: calc(var(--group-title-height) + var(--table-small-row-size) * 1 + var(--row-count) * var(--table-row-height));
|
|
190
|
+
//height: calc(var(--group-title-height) + var(--table-small-row-size) * 1 + var(--row-count) * var(--table-row-height));
|
|
169
191
|
}
|
|
170
192
|
|
|
171
193
|
.shadow-area {
|
|
172
194
|
z-index: 4;
|
|
173
|
-
height: 100%;
|
|
195
|
+
//height: 100%;
|
|
174
196
|
width: var(--shadow-area-width);
|
|
175
197
|
justify-content: center;
|
|
176
198
|
align-items: center;
|
|
@@ -180,7 +202,7 @@
|
|
|
180
202
|
position: sticky;
|
|
181
203
|
left: 0;
|
|
182
204
|
background: var(--bs-body-bg);
|
|
183
|
-
border-right: 1px solid var(--bs-border-color);
|
|
205
|
+
//border-right: 1px solid var(--bs-border-color);
|
|
184
206
|
}
|
|
185
207
|
|
|
186
208
|
.header-wrapper:not(.collapsed *) {
|
|
@@ -190,6 +212,7 @@
|
|
|
190
212
|
}
|
|
191
213
|
|
|
192
214
|
.header-wrapper {
|
|
215
|
+
cursor: pointer;
|
|
193
216
|
background-color: var(--bs-body-bg);
|
|
194
217
|
left: var(--shadow-area-width);
|
|
195
218
|
align-items: center;
|
|
@@ -197,13 +220,23 @@
|
|
|
197
220
|
position: -webkit-sticky;
|
|
198
221
|
position: sticky;
|
|
199
222
|
border-radius: 0.1875rem;
|
|
200
|
-
border-bottom-width: 1px;
|
|
201
|
-
border-bottom-style: solid;
|
|
202
223
|
font-weight: 500;
|
|
203
224
|
font-size: 1.25rem;
|
|
204
|
-
border-
|
|
225
|
+
border-left: 0;
|
|
226
|
+
border-bottom: 0;
|
|
227
|
+
border-right: 1px solid var(--bs-border-color);
|
|
228
|
+
|
|
229
|
+
&.header-additional-column {
|
|
230
|
+
border-radius: 0;
|
|
231
|
+
}
|
|
232
|
+
&:hover {
|
|
233
|
+
background: var(--hover-bg);
|
|
234
|
+
}
|
|
205
235
|
}
|
|
206
236
|
|
|
237
|
+
.header-content {
|
|
238
|
+
text-decoration: none;
|
|
239
|
+
}
|
|
207
240
|
.header-content:not(.draggable-mirror *) {
|
|
208
241
|
left: var(--shadow-area-width);
|
|
209
242
|
padding-left: 0.75rem;
|
|
@@ -227,7 +260,7 @@
|
|
|
227
260
|
}
|
|
228
261
|
|
|
229
262
|
.table-row-template {
|
|
230
|
-
height: var(--table-small-row-size);
|
|
263
|
+
min-height: var(--table-small-row-size);
|
|
231
264
|
}
|
|
232
265
|
|
|
233
266
|
.table-add-new-item {
|
|
@@ -237,6 +270,10 @@
|
|
|
237
270
|
& > span {
|
|
238
271
|
left: var(--shadow-area-width);
|
|
239
272
|
position: sticky;
|
|
273
|
+
padding-left: var(--shadow-area-width);
|
|
274
|
+
}
|
|
275
|
+
&:hover {
|
|
276
|
+
background: var(--hover-bg);
|
|
240
277
|
}
|
|
241
278
|
}
|
|
242
279
|
|
|
@@ -263,12 +300,13 @@
|
|
|
263
300
|
</style>
|
|
264
301
|
<script>
|
|
265
302
|
import sortBy from 'lodash/sortBy';
|
|
266
|
-
import {Vue, Component, Prop} from 'vue-property-decorator';
|
|
303
|
+
import {Vue, Component, Prop, Watch} from 'vue-property-decorator';
|
|
267
304
|
import itfDropdown from '../dropdown/Dropdown.vue';
|
|
268
305
|
import itfButton from '../button/Button.vue';
|
|
269
306
|
import itfIcon from '../icon/Icon.vue';
|
|
270
307
|
import itfTableBody from './TableBody.vue';
|
|
271
308
|
import itfTableHeader from './TableHeader.vue';
|
|
309
|
+
import Sticky from "./sticky";
|
|
272
310
|
|
|
273
311
|
export default @Component({
|
|
274
312
|
name: 'itfTableGroup',
|
|
@@ -283,7 +321,9 @@ export default @Component({
|
|
|
283
321
|
class itfTableGroup extends Vue {
|
|
284
322
|
@Prop() columns;
|
|
285
323
|
@Prop() rows;
|
|
324
|
+
@Prop() selectedIds;
|
|
286
325
|
@Prop() title;
|
|
326
|
+
@Prop() idProperty;
|
|
287
327
|
@Prop(Boolean) showGrouping;
|
|
288
328
|
@Prop(Boolean) showSummary;
|
|
289
329
|
@Prop(Boolean) addNewRows;
|
|
@@ -291,13 +331,14 @@ class itfTableGroup extends Vue {
|
|
|
291
331
|
@Prop(Boolean) columnResizing;
|
|
292
332
|
@Prop(Boolean) showAddColumn;
|
|
293
333
|
@Prop(Boolean) showHeader;
|
|
294
|
-
@Prop({type:
|
|
334
|
+
@Prop({type: String, default: function() { return this.$t('components.new'); } }) newLabel;
|
|
335
|
+
@Prop({type: Object, default: () => ({})}) schema;
|
|
295
336
|
|
|
296
337
|
isShowTable = true;
|
|
297
338
|
|
|
298
339
|
get visibleColumns() {
|
|
299
340
|
let list = this.columns;
|
|
300
|
-
list = sortBy(list, (column) => column.
|
|
341
|
+
list = sortBy(list, (column) => column.index);
|
|
301
342
|
let left = 57; // sum of first 2 cells
|
|
302
343
|
const pinned = list.filter((column) => column.pinned && column.visible !== false);
|
|
303
344
|
list = list.map((column, index) => {
|
|
@@ -318,5 +359,17 @@ class itfTableGroup extends Vue {
|
|
|
318
359
|
toggleGroup() {
|
|
319
360
|
this.isShowTable = !this.isShowTable;
|
|
320
361
|
}
|
|
362
|
+
|
|
363
|
+
get stickyId() {
|
|
364
|
+
return `sticky-group-${this._uid}`;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
mounted() {
|
|
368
|
+
this.sticky = new Sticky(`.${this.stickyId}`, {
|
|
369
|
+
wrap: true,
|
|
370
|
+
stickyClass: 'sticky',
|
|
371
|
+
});
|
|
372
|
+
console.info(this.sticky);
|
|
373
|
+
}
|
|
321
374
|
}
|
|
322
375
|
</script>
|