@itfin/components 1.3.93 → 1.3.94
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/popover/NoticePopout.vue +48 -0
- package/src/components/table/Table2.vue +19 -2
- package/src/components/table/TableBody.vue +1 -0
- package/src/components/table/TableGroup.vue +1 -0
- package/src/components/table/TableHeader.vue +2 -1
- package/src/components/table/TableRows.vue +2 -2
- package/src/components/table/table2.scss +15 -0
package/package.json
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="notice p-2" ref="notice">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<style scoped lang="scss">
|
|
7
|
+
.notice {
|
|
8
|
+
position: absolute;
|
|
9
|
+
bottom: 10px;
|
|
10
|
+
left: 50%;
|
|
11
|
+
max-width: 740px;
|
|
12
|
+
z-index: 10;
|
|
13
|
+
opacity: 0;
|
|
14
|
+
transition: all 0.3s ease;
|
|
15
|
+
transform: translateX(-50%) translateY(100%) translateZ(0px);
|
|
16
|
+
background: var(--bs-body-bg);
|
|
17
|
+
box-shadow: 0 2px 10px 0 hsl(0 calc(1 * 0%) 0% /.1);
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
border-radius: 5px;
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
|
|
22
|
+
&.show {
|
|
23
|
+
opacity: 1;
|
|
24
|
+
pointer-events: all;
|
|
25
|
+
transform: translate3d(-50%, 0%, 0px);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
29
|
+
<script>
|
|
30
|
+
import { Vue, Prop, Watch, Component } from 'vue-property-decorator';
|
|
31
|
+
|
|
32
|
+
export default @Component({
|
|
33
|
+
components: {
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
class NoticePopout extends Vue {
|
|
37
|
+
@Prop(Boolean) visible;
|
|
38
|
+
|
|
39
|
+
@Watch('visible')
|
|
40
|
+
toggle(show = true) {
|
|
41
|
+
if (show) {
|
|
42
|
+
this.$refs.notice.classList.add('show');
|
|
43
|
+
} else {
|
|
44
|
+
this.$refs.notice.classList.remove('show');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
|
-
<div class="itf-table2
|
|
3
|
+
<div class="itf-table2" :class="{
|
|
4
4
|
'table-striped': striped,
|
|
5
5
|
'table-absolute': absolute,
|
|
6
6
|
'table-clickable': clickable,
|
|
7
7
|
'permanent-checkboxes': selectedIds.length
|
|
8
8
|
}" :style="{ '--indicator-area-width': `${indicatorType === 'none' ? 1 : indicatorWidth}px` }">
|
|
9
|
+
<itf-notice-popout :visible="showGroupOperations" class="rounded-pill bg-dark text-light">
|
|
10
|
+
<div class="d-flex gap-3 px-3 align-items-center">
|
|
11
|
+
<div><strong>{{selectedIds.length}}</strong> selected</div>
|
|
12
|
+
<div>
|
|
13
|
+
<slot name="group-operations"></slot>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</itf-notice-popout>
|
|
17
|
+
<div class="scrollable scrollable-x">
|
|
9
18
|
<itf-checkbox-group v-model="selectedIds">
|
|
10
19
|
<template v-for="(group, index) in groups">
|
|
11
20
|
<div class="table-view-body">
|
|
@@ -58,6 +67,7 @@
|
|
|
58
67
|
</div>
|
|
59
68
|
</template>
|
|
60
69
|
</itf-checkbox-group>
|
|
70
|
+
</div>
|
|
61
71
|
</div>
|
|
62
72
|
|
|
63
73
|
</template>
|
|
@@ -68,6 +78,7 @@ import itfButton from '../button/Button.vue';
|
|
|
68
78
|
import itfIcon from '../icon/Icon.vue';
|
|
69
79
|
import itfTableGroup from './TableGroup.vue';
|
|
70
80
|
import itfTableHeader from './TableHeader.vue';
|
|
81
|
+
import itfNoticePopout from '../popover/NoticePopout.vue';
|
|
71
82
|
import './table2.scss';
|
|
72
83
|
|
|
73
84
|
export default @Component({
|
|
@@ -80,7 +91,8 @@ export default @Component({
|
|
|
80
91
|
itfTableHeader,
|
|
81
92
|
itfButton,
|
|
82
93
|
itfIcon,
|
|
83
|
-
itfTableGroup
|
|
94
|
+
itfTableGroup,
|
|
95
|
+
itfNoticePopout
|
|
84
96
|
}
|
|
85
97
|
})
|
|
86
98
|
class itfTable2 extends Vue {
|
|
@@ -123,6 +135,10 @@ class itfTable2 extends Vue {
|
|
|
123
135
|
columns: []
|
|
124
136
|
};
|
|
125
137
|
|
|
138
|
+
get showGroupOperations() {
|
|
139
|
+
return !!this.$slots['group-operations'] && this.selectedIds.length > 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
126
142
|
getTableState() {
|
|
127
143
|
const list = this.schema?.properties || [];
|
|
128
144
|
let state = this.stateName ? JSON.parse(localStorage.getItem(this.stateKey) || 'null') : null;
|
|
@@ -163,6 +179,7 @@ class itfTable2 extends Vue {
|
|
|
163
179
|
}
|
|
164
180
|
|
|
165
181
|
mounted() {
|
|
182
|
+
console.info(this.$scopedSlots)
|
|
166
183
|
this.onSchemaUpdate();
|
|
167
184
|
}
|
|
168
185
|
|
|
@@ -174,6 +174,7 @@ class itfTableHeader extends Vue {
|
|
|
174
174
|
@Prop(Boolean) noColumnMenu;
|
|
175
175
|
@Prop(Boolean) noSelectAll;
|
|
176
176
|
@Prop(Boolean) editable;
|
|
177
|
+
@Prop() idProperty;
|
|
177
178
|
@Prop() indicatorType;
|
|
178
179
|
|
|
179
180
|
@Watch('selectedIds')
|
|
@@ -211,7 +212,7 @@ class itfTableHeader extends Vue {
|
|
|
211
212
|
|
|
212
213
|
set selectAll(val) {
|
|
213
214
|
if (val) {
|
|
214
|
-
this.$emit('update:selectedIds', this.rows.map(r => r.
|
|
215
|
+
this.$emit('update:selectedIds', this.rows.map(r => r[this.idProperty]));
|
|
215
216
|
} else {
|
|
216
217
|
this.$emit('update:selectedIds', []);
|
|
217
218
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
23
23
|
<div v-if="indicatorType !== 'none'" class="indicator sticky">
|
|
24
|
-
<div class="fill table-view-row-count" :class="{'on-rest':
|
|
24
|
+
<div class="fill table-view-row-count" :class="{'on-rest': indicatorType !== 'checkbox'}">
|
|
25
25
|
<span v-if="indicatorType === 'order'">{{ (n + 1) }}</span>
|
|
26
26
|
<span v-else-if="indicatorType === 'property'">{{ item[idProperty] }}</span>
|
|
27
27
|
<a href="" @click.prevent.stop="$emit('toggle', item)" v-else-if="indicatorType === 'toggle'">
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
</template>
|
|
42
42
|
</a>
|
|
43
43
|
</div>
|
|
44
|
-
<div
|
|
44
|
+
<div class="fill" :class="{'on-hover': indicatorType !== 'checkbox'}">
|
|
45
45
|
<itf-checkbox :value="item[idProperty]" />
|
|
46
46
|
</div>
|
|
47
47
|
</div>
|
|
@@ -365,4 +365,19 @@ body[data-theme="dark"] {
|
|
|
365
365
|
bottom: 0;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
+
|
|
369
|
+
.table-group-operations {
|
|
370
|
+
background: red;
|
|
371
|
+
position: absolute;
|
|
372
|
+
bottom: 1rem;
|
|
373
|
+
left: 1rem;
|
|
374
|
+
right: 1rem;
|
|
375
|
+
height: 2rem;
|
|
376
|
+
transform: rotateX(90deg);
|
|
377
|
+
transition: transform 0.3s;
|
|
378
|
+
|
|
379
|
+
&.visible {
|
|
380
|
+
transform: rotateX(0deg);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
368
383
|
}
|