@itfin/components 1.5.1 → 1.5.3
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/dist/ITFComponents.common.js +87 -0
- package/dist/ITFComponents.common.js.map +1 -0
- package/dist/ITFComponents.umd.js +98 -0
- package/dist/ITFComponents.umd.js.map +1 -0
- package/dist/ITFComponents.umd.min.js +2 -0
- package/dist/ITFComponents.umd.min.js.map +1 -0
- package/dist/demo.html +1 -0
- package/package.json +12 -1
- package/src/ITFSettings.js +0 -6
- package/src/components/alert/AlertBanner.vue +70 -14
- package/src/components/button/Button.vue +1 -3
- package/src/components/button/NativeButton.js +0 -4
- package/src/components/button/index.stories.js +2 -2
- package/src/components/checkbox/NestedCheckboxGroup.vue +109 -0
- package/src/components/customize/PropertiesList.vue +2 -0
- package/src/components/customize/PropertiesPopupMenu.vue +1 -1
- package/src/components/customize/PropertyItem.vue +24 -6
- package/src/components/datepicker/DatePicker.vue +1 -1
- package/src/components/datepicker/MonthPicker.vue +21 -1
- package/src/components/dropdown/Dropdown.vue +1 -1
- package/src/components/dropdown/DropdownMenu.vue +1 -1
- package/src/components/editable/EditButton.vue +1 -1
- package/src/components/filter/FilterBadge.vue +4 -3
- package/src/components/filter/FilterFacetsList.vue +16 -9
- package/src/components/filter/FilterPanel.vue +20 -6
- package/src/components/icon/components/nomi-.DS_Store +0 -0
- package/src/components/icon/components/nomi-approval-chain.vue +5 -0
- package/src/components/icon/components/nomi-calendar-view.vue +4 -0
- package/src/components/icon/components/nomi-close-alt.vue +5 -0
- package/src/components/icon/components/nomi-cog-lightning.vue +5 -0
- package/src/components/icon/components/nomi-comment-add.vue +5 -0
- package/src/components/icon/components/nomi-comment.vue +4 -0
- package/src/components/icon/components/nomi-comments.vue +5 -0
- package/src/components/icon/components/nomi-copy.vue +5 -0
- package/src/components/icon/components/nomi-dollar.vue +4 -0
- package/src/components/icon/components/nomi-expense-requests.vue +5 -0
- package/src/components/icon/components/nomi-file-doc.vue +7 -0
- package/src/components/icon/components/nomi-file-excel.vue +9 -0
- package/src/components/icon/components/nomi-file-image.vue +6 -0
- package/src/components/icon/components/nomi-file-pdf.vue +5 -0
- package/src/components/icon/components/nomi-help.vue +3 -2
- package/src/components/icon/components/nomi-kanban-view.vue +6 -0
- package/src/components/icon/components/nomi-light-bulb.vue +4 -0
- package/src/components/icon/components/nomi-list-view.vue +7 -0
- package/src/components/icon/components/nomi-lock.vue +1 -1
- package/src/components/icon/components/nomi-money-alt.vue +4 -0
- package/src/components/icon/components/nomi-money-requests.vue +12 -0
- package/src/components/icon/components/nomi-pending.vue +4 -0
- package/src/components/icon/components/nomi-plus.vue +5 -0
- package/src/components/icon/components/nomi-project.vue +2 -2
- package/src/components/icon/components/nomi-scissors.vue +1 -1
- package/src/components/icon/components/nomi-secure.vue +4 -0
- package/src/components/icon/components/nomi-stop.vue +4 -0
- package/src/components/icon/components/nomi-table-config.vue +9 -0
- package/src/components/icon/components/nomi-table-view.vue +4 -1
- package/src/components/icon/components/nomi-thumbs-down.vue +4 -0
- package/src/components/icon/components/nomi-thumbs-up.vue +4 -0
- package/src/components/icon/components/nomi-undo.vue +4 -0
- package/src/components/icon/components/nomi-user-settings.vue +5 -0
- package/src/components/icon/components/nomi-user.vue +3 -3
- package/src/components/icon/convert-icons.js +0 -3
- package/src/components/icon/icons.js +403 -372
- package/src/components/icon/new-icons/approval-chain.svg +4 -0
- package/src/components/icon/new-icons/budget.svg +3 -0
- package/src/components/icon/new-icons/calendar-view.svg +3 -0
- package/src/components/icon/new-icons/close-alt.svg +4 -0
- package/src/components/icon/new-icons/cog-lightning.svg +4 -0
- package/src/components/icon/new-icons/comment-add.svg +4 -0
- package/src/components/icon/new-icons/comment.svg +3 -0
- package/src/components/icon/new-icons/comments.svg +4 -0
- package/src/components/icon/new-icons/copy.svg +4 -0
- package/src/components/icon/new-icons/dollar.svg +3 -0
- package/src/components/icon/new-icons/expense-requests.svg +4 -0
- package/src/components/icon/new-icons/file-doc.svg +6 -0
- package/src/components/icon/new-icons/file-excel.svg +8 -0
- package/src/components/icon/new-icons/file-image.svg +5 -0
- package/src/components/icon/new-icons/file-pdf.svg +4 -0
- package/src/components/icon/new-icons/help.svg +3 -2
- package/src/components/icon/new-icons/kanban-view.svg +5 -0
- package/src/components/icon/new-icons/light-bulb.svg +3 -0
- package/src/components/icon/new-icons/list-view.svg +6 -0
- package/src/components/icon/new-icons/lock.svg +1 -1
- package/src/components/icon/new-icons/money-alt.svg +3 -0
- package/src/components/icon/new-icons/money-requests.svg +11 -0
- package/src/components/icon/new-icons/pending.svg +3 -0
- package/src/components/icon/new-icons/plus.svg +4 -0
- package/src/components/icon/new-icons/project.svg +2 -2
- package/src/components/icon/new-icons/scissors.svg +1 -1
- package/src/components/icon/new-icons/secure.svg +3 -0
- package/src/components/icon/new-icons/stop.svg +3 -0
- package/src/components/icon/new-icons/table-config.svg +8 -0
- package/src/components/icon/new-icons/table-view.svg +4 -1
- package/src/components/icon/new-icons/thumbs-down.svg +3 -0
- package/src/components/icon/new-icons/thumbs-up.svg +3 -0
- package/src/components/icon/new-icons/undo.svg +3 -0
- package/src/components/icon/new-icons/user-settings.svg +4 -0
- package/src/components/icon/new-icons/user.svg +3 -3
- package/src/components/kanban/BoardCard.vue +1 -1
- package/src/components/kanban/BoardCardTimer.vue +1 -1
- package/src/components/modal/Modal.vue +6 -1
- package/src/components/overlay/SensitiveOverlay.vue +4 -2
- package/src/components/pagination/Pagination2.vue +4 -3
- package/src/components/panels/Panel.vue +23 -1
- package/src/components/panels/PanelItemEdit.vue +91 -10
- package/src/components/panels/PanelList.vue +19 -6
- package/src/components/table/Table2.vue +65 -60
- package/src/components/table/TableBody.vue +6 -0
- package/src/components/table/TableGroup.vue +13 -4
- package/src/components/table/TableHeader.vue +77 -76
- package/src/components/table/TableRowToggle.vue +9 -1
- package/src/components/table/TableRows.vue +54 -30
- package/src/components/table/table2.scss +15 -34
- package/src/components/text-field/TextField.vue +8 -0
- package/src/components/tree/TreeEditor.vue +2 -3
- package/src/components/view/View.vue +217 -56
- package/src/helpers/validators.js +35 -9
- package/src/helpers/validators.spec.js +48 -11
- package/src/locales/en.js +8 -2
- package/src/locales/pl.js +2 -1
- package/src/locales/uk.js +7 -6
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
v-loading="loading"
|
|
4
|
+
@dragover.prevent="onDragOver"
|
|
5
|
+
@dragleave="onDragLeave"
|
|
6
|
+
@drop.prevent="onDrop"
|
|
7
|
+
:class="{ 'is-drag-over': isDragOver }"
|
|
8
|
+
class="px-3 pt-2 h-100 d-flex flex-column itf-append-context">
|
|
3
9
|
<itf-form
|
|
4
10
|
ref="editForm"
|
|
5
|
-
class="d-flex flex-column justify-content-between flex-grow-1"
|
|
11
|
+
class="d-flex flex-column justify-content-between flex-grow-1 b-append-context__form"
|
|
6
12
|
@keydown.native.shift.enter.stop.prevent="onSaveClick"
|
|
7
13
|
@keydown.native.esc.stop.prevent="$emit('cancel')"
|
|
8
14
|
>
|
|
9
15
|
<slot></slot>
|
|
10
16
|
<div class="py-3 justify-content-end d-flex align-items-center sticky-container">
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
<slot name="footer">
|
|
18
|
+
<div v-if="!hideFooter">
|
|
19
|
+
<itf-button v-tooltip.delay="'Hot key: Esc'" secondary squircle :loading="loading" :disabled="loading" @click="$emit('cancel')">
|
|
20
|
+
<span>{{ cancelBtnText }}</span>
|
|
21
|
+
</itf-button>
|
|
22
|
+
<itf-button v-tooltip.delay="'Hot key: Shift + Enter'" primary squircle :loading="loading" :disabled="loading" @click="onSaveClick">
|
|
23
|
+
<span>{{ saveBtnText }}</span>
|
|
24
|
+
</itf-button>
|
|
25
|
+
</div>
|
|
26
|
+
</slot>
|
|
19
27
|
</div>
|
|
20
28
|
</itf-form>
|
|
29
|
+
<div class="b-drag-overlay">
|
|
30
|
+
<span>{{ $t('components.dropzoneText') }}</span>
|
|
31
|
+
</div>
|
|
21
32
|
</div>
|
|
22
33
|
</template>
|
|
23
34
|
<style lang="scss" scoped>
|
|
@@ -28,6 +39,37 @@
|
|
|
28
39
|
z-index: 999;
|
|
29
40
|
background-color: var(--bs-body-bg);
|
|
30
41
|
}
|
|
42
|
+
.is-drag-over .b-append-context__form {
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
user-select: none;
|
|
45
|
+
filter: blur(2px);
|
|
46
|
+
}
|
|
47
|
+
.b-drag-overlay {
|
|
48
|
+
display: none;
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 0;
|
|
51
|
+
left: 0;
|
|
52
|
+
right: 0;
|
|
53
|
+
bottom: 0;
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
user-select: none;
|
|
56
|
+
z-index: 1000;
|
|
57
|
+
|
|
58
|
+
.is-drag-over & {
|
|
59
|
+
margin: 1rem;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
border-radius: 8px;
|
|
64
|
+
border: 3px dashed var(--bs-border-color);
|
|
65
|
+
background-color: rgba(255, 255, 255, 0.6);
|
|
66
|
+
}
|
|
67
|
+
span {
|
|
68
|
+
font-size: 1.25rem;
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
color: var(--bs-secondary-color);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
31
73
|
</style>
|
|
32
74
|
<script>
|
|
33
75
|
import { Vue, Component, Prop } from 'vue-property-decorator';
|
|
@@ -35,6 +77,7 @@ import tooltip from '../../directives/tooltip';
|
|
|
35
77
|
import loading from '../../directives/loading';
|
|
36
78
|
import itfForm from '../form/Form.vue';
|
|
37
79
|
import itfButton from '../button/Button.vue';
|
|
80
|
+
import debounce from 'lodash/debounce';
|
|
38
81
|
|
|
39
82
|
@Component({
|
|
40
83
|
components: {
|
|
@@ -51,14 +94,52 @@ import itfButton from '../button/Button.vue';
|
|
|
51
94
|
export default class PanelItemEdit extends Vue {
|
|
52
95
|
@Prop(Boolean) loading;
|
|
53
96
|
@Prop(Boolean) hideFooter;
|
|
97
|
+
@Prop(Boolean) dropzone;
|
|
98
|
+
@Prop() droptarget;
|
|
54
99
|
@Prop({ type: String, default: function() { return this.$t('components.modal.save') } }) saveBtnText;
|
|
55
100
|
@Prop({ type: String, default: function() { return this.$t('components.modal.cancel') } }) cancelBtnText;
|
|
56
101
|
|
|
102
|
+
isDragOver = false;
|
|
103
|
+
handleDragLeaveDebounced = null;
|
|
104
|
+
|
|
105
|
+
created() {
|
|
106
|
+
this.handleDragLeaveDebounced = debounce(() => {
|
|
107
|
+
this.isDragOver = false;
|
|
108
|
+
}, 200);
|
|
109
|
+
}
|
|
110
|
+
|
|
57
111
|
onSaveClick() {
|
|
58
112
|
if (this.$refs.editForm && !this.$refs.editForm.doValidation()) {
|
|
59
113
|
return;
|
|
60
114
|
}
|
|
61
115
|
this.$emit('save');
|
|
62
116
|
}
|
|
117
|
+
|
|
118
|
+
onDragOver(e) {
|
|
119
|
+
if (!this.dropzone) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
this.isDragOver = true;
|
|
123
|
+
|
|
124
|
+
// якщо знову зайшли — відміняємо leave
|
|
125
|
+
this.handleDragLeaveDebounced.cancel();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
onDragLeave(e) {
|
|
129
|
+
if (!this.dropzone) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
this.handleDragLeaveDebounced();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
onDrop(e) {
|
|
136
|
+
if (!this.dropzone) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this.isDragOver = false;
|
|
140
|
+
if (this.droptarget) {
|
|
141
|
+
this.droptarget.onFileChange(e)
|
|
142
|
+
}
|
|
143
|
+
}
|
|
63
144
|
}
|
|
64
145
|
</script>
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
:title="panel.title"
|
|
17
17
|
:nocard="panel.nocard"
|
|
18
18
|
:icon="panel.icon"
|
|
19
|
+
:css-class="panel.cssClass"
|
|
19
20
|
:payload="panel.payload"
|
|
20
21
|
:expandable="panelsStack.length > 1"
|
|
21
22
|
:isFullSize="isFullSize"
|
|
@@ -150,6 +151,17 @@ $double-an-time: $an-time * 2;
|
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
153
|
|
|
154
|
+
@media (max-width: 768px) {
|
|
155
|
+
@keyframes slidein {
|
|
156
|
+
0% {
|
|
157
|
+
max-width: 100%;
|
|
158
|
+
}
|
|
159
|
+
100% {
|
|
160
|
+
max-width: 100%;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
153
165
|
.b-panel {
|
|
154
166
|
transition: min-width $an-time linear, flex-grow $an-time linear;
|
|
155
167
|
|
|
@@ -166,10 +178,10 @@ $double-an-time: $an-time * 2;
|
|
|
166
178
|
//}
|
|
167
179
|
</style>
|
|
168
180
|
<script lang="ts">
|
|
169
|
-
import { Vue, Component, Prop
|
|
181
|
+
import { Vue, Component, Prop } from 'vue-property-decorator';
|
|
182
|
+
import Panel from './Panel';
|
|
170
183
|
import itfIcon from '../icon/Icon.vue';
|
|
171
|
-
import
|
|
172
|
-
import {hashToStack, stackToHash} from "@itfin/components/src/components/panels/helpers";
|
|
184
|
+
import {hashToStack, stackToHash} from "./helpers";
|
|
173
185
|
import {emitGlobalEvent, setRootPanelList} from "@itfin/components/src/components/panels";
|
|
174
186
|
|
|
175
187
|
interface VisualOptions {
|
|
@@ -184,6 +196,7 @@ export interface IPanel {
|
|
|
184
196
|
type: string;
|
|
185
197
|
payload: any;
|
|
186
198
|
nocard?: boolean;
|
|
199
|
+
cssClass?: string;
|
|
187
200
|
isCollapsed: boolean;
|
|
188
201
|
isExpanded: boolean;
|
|
189
202
|
isCloseable: boolean;
|
|
@@ -222,7 +235,6 @@ export default class PanelList extends Vue {
|
|
|
222
235
|
@Prop() panels: Record<string, Component>;
|
|
223
236
|
@Prop({ default: () => {} }) searchPanel: (type: string) => boolean;
|
|
224
237
|
@Prop({ type: String, default: 'path' }) routeType: string;
|
|
225
|
-
@Prop({ type: String, default: '' }) routePrefix: string;
|
|
226
238
|
|
|
227
239
|
panelsStack:IPanel[] = [];
|
|
228
240
|
|
|
@@ -313,6 +325,7 @@ export default class PanelList extends Vue {
|
|
|
313
325
|
const newPanel:any = {
|
|
314
326
|
id: this.nextId++,
|
|
315
327
|
nocard: panel.nocard,
|
|
328
|
+
cssClass: panel.cssClass,
|
|
316
329
|
title: panel.caption(this.$t.bind(this), payload),
|
|
317
330
|
icon: panel.icon ? panel.icon(this.$t.bind(this), payload) : null,
|
|
318
331
|
components: {
|
|
@@ -504,7 +517,7 @@ export default class PanelList extends Vue {
|
|
|
504
517
|
}
|
|
505
518
|
|
|
506
519
|
setPanelHash() {
|
|
507
|
-
const hash = stackToHash(this.panelsStack, this.
|
|
520
|
+
const hash = stackToHash(this.panelsStack, this.routeType === 'path').replace(/^#/, '');
|
|
508
521
|
if (this.routeType === 'path') {
|
|
509
522
|
this.$router.push({ path: `${hash}` });
|
|
510
523
|
} else {
|
|
@@ -516,7 +529,7 @@ export default class PanelList extends Vue {
|
|
|
516
529
|
async parsePanelHash() {
|
|
517
530
|
const hash = this.routeType === 'path' ? location.pathname : location.hash;
|
|
518
531
|
if (hash) {
|
|
519
|
-
const panels = hashToStack(hash, this.
|
|
532
|
+
const panels = hashToStack(hash, this.routeType === 'path');
|
|
520
533
|
const newStack = [];
|
|
521
534
|
this.panelsStack = [];
|
|
522
535
|
for (const panelIndex in panels) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
'permanent-checkboxes': selectedIds.length
|
|
8
8
|
}" :style="{ '--indicator-area-width': `${indicatorType === 'none' ? 1 : indicatorWidth}px`, '--shadow-area-width': `${shadowWidth}px` }">
|
|
9
9
|
<itf-notice-popout :visible="showGroupOperations" class="rounded-3 bg-black text-white">
|
|
10
|
-
<div class="d-flex gap-2 ps-
|
|
10
|
+
<div class="d-flex gap-2 ps-3 align-items-center small itf-table2_mass-operations">
|
|
11
11
|
<slot name="group-operations-count">
|
|
12
12
|
<div>{{$tc('components.table.selectedItems', selectedIds.length, { n: selectedIds.length })}}</div>
|
|
13
13
|
<div class="opacity-50">•</div>
|
|
@@ -19,64 +19,66 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
</itf-notice-popout>
|
|
21
21
|
<div class="scrollable scrollable-x">
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
22
|
+
<itf-checkbox-group v-model="selectedIds">
|
|
23
|
+
<template v-for="(group, index) in groups">
|
|
24
|
+
<div class="table-view-body">
|
|
25
|
+
<itf-table-group
|
|
26
|
+
:key="index"
|
|
27
|
+
@update="$emit('update', { ...$event, group, groupIndex: index })"
|
|
28
|
+
@row-click="$emit('row-click', $event)"
|
|
29
|
+
:id-property="idProperty"
|
|
30
|
+
:columns="columns"
|
|
31
|
+
@update:columns="onColumnsUpdate"
|
|
32
|
+
:rows="group.rows"
|
|
33
|
+
:title="group.name"
|
|
34
|
+
:selected-ids.sync="selectedIds"
|
|
35
|
+
:add-new-rows="addNewRows"
|
|
36
|
+
:column-sorting="columnSorting"
|
|
37
|
+
:column-resizing="columnResizing"
|
|
38
|
+
:show-grouping="showGrouping"
|
|
39
|
+
:show-summary="showSummary"
|
|
40
|
+
:show-add-column="showAddColumn"
|
|
41
|
+
:show-actions="showActions"
|
|
42
|
+
:show-header="!noHeader"
|
|
43
|
+
:schema="schema"
|
|
44
|
+
:editable="editable"
|
|
45
|
+
:no-column-menu="noColumnMenu"
|
|
46
|
+
:no-select-all="noSelectAll"
|
|
47
|
+
:currencies="currencies"
|
|
48
|
+
:currency="currency"
|
|
49
|
+
:subrows-property="subrowsProperty"
|
|
50
|
+
:async-subrows-property="asyncSubrowsProperty"
|
|
51
|
+
:divider-property="dividerProperty"
|
|
52
|
+
:indicator-type="indicatorType"
|
|
53
|
+
:expanded-all="expandedAll"
|
|
54
|
+
:indicatorWidth="indicatorWidth"
|
|
55
|
+
:striped="striped"
|
|
56
|
+
:expanded-ids="expandedIds"
|
|
57
|
+
:css-property="cssProperty"
|
|
58
|
+
:sticky-header="stickyHeader"
|
|
59
|
+
:editable-property="editableProperty"
|
|
60
|
+
:sorting.sync="_sorting"
|
|
61
|
+
:active="active"
|
|
62
|
+
:sort-as-string="sortAsString"
|
|
63
|
+
:new-label="newLabel"
|
|
64
|
+
:collapsed-group-ids="collapsedGroupIds"
|
|
65
|
+
@loadChildren="$emit('loadChildren', $event)"
|
|
66
|
+
@update:expanded-ids="$emit('update:expanded-ids', $event)"
|
|
67
|
+
@update:collapsed-group-ids="$emit('update:collapsed-group-ids', $event)"
|
|
68
|
+
@new="$emit('new', $event)"
|
|
69
|
+
@filter="$emit('filter', $event)"
|
|
70
|
+
@add-column="$emit('add-column', $event)"
|
|
71
|
+
>
|
|
72
|
+
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
73
|
+
<slot :name="name" v-bind="slotData || {}" />
|
|
74
|
+
</template>
|
|
75
|
+
<template v-for="(_, name) in $scopedSlots" #[name]="slotData">
|
|
76
|
+
<slot :name="name" v-bind="slotData || {}" />
|
|
77
|
+
</template>
|
|
78
|
+
</itf-table-group>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
81
|
+
</itf-checkbox-group>
|
|
80
82
|
</div>
|
|
81
83
|
</div>
|
|
82
84
|
|
|
@@ -107,11 +109,13 @@ export default @Component({
|
|
|
107
109
|
})
|
|
108
110
|
class itfTable2 extends Vue {
|
|
109
111
|
// @Prop({ required: true, type: Array }) columns;
|
|
112
|
+
@Prop(Boolean) sortAsString;
|
|
110
113
|
@Prop({ required: true, type: Array }) rows;
|
|
111
114
|
@Prop({ type: String, default: null }) groupBy;
|
|
112
115
|
@Prop({ type: String, default: null }) idProperty;
|
|
113
116
|
@Prop({ type: String, default: null }) cssProperty;
|
|
114
117
|
@Prop({ type: String, default: null }) subrowsProperty;
|
|
118
|
+
@Prop({ type: String, default: null }) asyncSubrowsProperty;
|
|
115
119
|
@Prop({ type: String, default: null }) dividerProperty;
|
|
116
120
|
@Prop({ type: String, default: null }) editableProperty;
|
|
117
121
|
@Prop({ default: null }) active;
|
|
@@ -249,7 +253,8 @@ class itfTable2 extends Vue {
|
|
|
249
253
|
@Watch('selectedIds')
|
|
250
254
|
onSelectedIdsUpdate(selectedIds) {
|
|
251
255
|
this.state.selectedIds = selectedIds;
|
|
252
|
-
|
|
256
|
+
// метод saveTableState не зберігає selectedIds в localStorage, не впевнений що він тут треба
|
|
257
|
+
// this.saveTableState();
|
|
253
258
|
}
|
|
254
259
|
|
|
255
260
|
onColumnsUpdate(columns) {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
:columns="columns"
|
|
24
24
|
:id-property="idProperty"
|
|
25
25
|
:subrows-property="subrowsProperty"
|
|
26
|
+
:async-subrows-property="asyncSubrowsProperty"
|
|
26
27
|
:divider-property="dividerProperty"
|
|
27
28
|
:show-add-column="showAddColumn"
|
|
28
29
|
:show-actions="showActions"
|
|
@@ -145,6 +146,7 @@ class itfTableBody extends Vue {
|
|
|
145
146
|
@Prop() rows;
|
|
146
147
|
@Prop() idProperty;
|
|
147
148
|
@Prop() subrowsProperty;
|
|
149
|
+
@Prop() asyncSubrowsProperty;
|
|
148
150
|
@Prop() dividerProperty;
|
|
149
151
|
@Prop() active;
|
|
150
152
|
@Prop(Boolean) showAddColumn;
|
|
@@ -165,6 +167,10 @@ class itfTableBody extends Vue {
|
|
|
165
167
|
this.$emit('update:expanded-ids', this.expandedIds.includes(item[this.idProperty])
|
|
166
168
|
? this.expandedIds.filter((id) => id !== item[this.idProperty])
|
|
167
169
|
: [...this.expandedIds, item[this.idProperty]]);
|
|
170
|
+
|
|
171
|
+
if (this.asyncSubrowsProperty && item[this.asyncSubrowsProperty] && item[this.asyncSubrowsProperty]) {
|
|
172
|
+
this.$emit('loadChildren', item);
|
|
173
|
+
}
|
|
168
174
|
}
|
|
169
175
|
}
|
|
170
176
|
</script>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<div class="shadow-area"></div>
|
|
18
18
|
<div class="header-wrapper" :class="{'header-additional-column': showAddColumn}" @click.prevent="() => toggleGroup(!isShowTable)">
|
|
19
19
|
<a class="header-content position-sticky d-flex align-items-center">
|
|
20
|
-
<itf-button
|
|
20
|
+
<itf-button icon small secondary class="collapse-arrow">
|
|
21
21
|
<itf-icon :name="isShowTable ? 'chevron_down' : 'chevron_right'"/>
|
|
22
22
|
</itf-button>
|
|
23
23
|
<span class="d-flex align-items-center line-overflow group-header-value text-primary"
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
:show-add-column="showAddColumn"
|
|
40
40
|
:show-actions="showActions"
|
|
41
41
|
:id-property="idProperty"
|
|
42
|
+
:sort-as-string="sortAsString"
|
|
42
43
|
:rows="rows"
|
|
43
44
|
:schema="schema"
|
|
44
45
|
:editable="editable"
|
|
@@ -68,11 +69,13 @@
|
|
|
68
69
|
@row-click="$emit('row-click', $event)"
|
|
69
70
|
:id-property="idProperty"
|
|
70
71
|
:subrows-property="subrowsProperty"
|
|
72
|
+
:async-subrows-property="asyncSubrowsProperty"
|
|
71
73
|
:divider-property="dividerProperty"
|
|
72
74
|
:rows="rows"
|
|
73
75
|
:editable="editable"
|
|
74
76
|
:currency="currency"
|
|
75
77
|
:currencies="currencies"
|
|
78
|
+
:sort-as-string="sortAsString"
|
|
76
79
|
:columns="visibleColumns"
|
|
77
80
|
:no-select-all="noSelectAll"
|
|
78
81
|
:selected-ids="selectedIds"
|
|
@@ -85,6 +88,7 @@
|
|
|
85
88
|
:css-property="cssProperty"
|
|
86
89
|
:editable-property="editableProperty"
|
|
87
90
|
:active="active"
|
|
91
|
+
@loadChildren="$emit('loadChildren', $event)"
|
|
88
92
|
@update:expanded-ids="$emit('update:expanded-ids', $event)"
|
|
89
93
|
>
|
|
90
94
|
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
@@ -98,11 +102,11 @@
|
|
|
98
102
|
|
|
99
103
|
<!-- Лінія додати нову -->
|
|
100
104
|
<div v-if="isShowTable && addNewRows"
|
|
101
|
-
class="d-flex align-items-stretch">
|
|
105
|
+
class="table-row-template table-row-template__new-row d-flex align-items-stretch">
|
|
102
106
|
<div class="shadow-area"></div>
|
|
103
107
|
<a href="" @click.prevent="$emit('new', title)" data-test="table-add-new-item"
|
|
104
108
|
class="d-flex align-items-center flex-grow-1 table-add-new-item text-decoration-none">
|
|
105
|
-
<span class="d-sticky d-flex align-items-center py-
|
|
109
|
+
<span class="d-sticky d-flex align-items-center py-1 px-2 small">
|
|
106
110
|
<itf-icon name="plus"/>
|
|
107
111
|
<span>{{ newLabel }}</span>
|
|
108
112
|
</span>
|
|
@@ -271,6 +275,9 @@
|
|
|
271
275
|
min-height: var(--table-small-row-size);
|
|
272
276
|
}
|
|
273
277
|
|
|
278
|
+
.table-row-template.table-row-template__new-row {
|
|
279
|
+
min-height: 2rem;
|
|
280
|
+
}
|
|
274
281
|
.table-add-new-item {
|
|
275
282
|
margin-top: -12px;
|
|
276
283
|
border-bottom: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
|
|
@@ -285,7 +292,7 @@
|
|
|
285
292
|
}
|
|
286
293
|
|
|
287
294
|
& > span {
|
|
288
|
-
left: var(--shadow-area-width);
|
|
295
|
+
left: calc(var(--shadow-area-width) + 4px);
|
|
289
296
|
position: sticky;
|
|
290
297
|
padding-left: var(--shadow-area-width);
|
|
291
298
|
//border-left: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
|
|
@@ -372,6 +379,7 @@ class itfTableGroup extends Vue {
|
|
|
372
379
|
@Prop() title;
|
|
373
380
|
@Prop() idProperty;
|
|
374
381
|
@Prop() subrowsProperty;
|
|
382
|
+
@Prop() asyncSubrowsProperty;
|
|
375
383
|
@Prop() dividerProperty;
|
|
376
384
|
@Prop() currency;
|
|
377
385
|
@Prop() currencies;
|
|
@@ -391,6 +399,7 @@ class itfTableGroup extends Vue {
|
|
|
391
399
|
@Prop(Boolean) expandedAll;
|
|
392
400
|
@Prop(Boolean) striped;
|
|
393
401
|
@Prop(Boolean) stickyHeader;
|
|
402
|
+
@Prop(Boolean) sortAsString;
|
|
394
403
|
@Prop() indicatorWidth;
|
|
395
404
|
@Prop() shadowWidth;
|
|
396
405
|
@Prop() cssProperty;
|