@itfin/components 1.4.36 → 1.5.0
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 +17 -20
- package/src/ITFSettings.js +6 -0
- package/src/assets/scss/_css_variables.scss +2 -7
- package/src/assets/scss/_dark-theme.scss +2 -12
- package/src/assets/scss/_variables.scss +34 -9
- package/src/assets/scss/components/_button.scss +147 -10
- package/src/assets/scss/components/_checkbox.scss +9 -0
- package/src/assets/scss/components/_datepicker.scss +3 -3
- package/src/assets/scss/components/_pagination.scss +4 -1
- package/src/assets/scss/components/_popover.scss +22 -0
- package/src/assets/scss/components/_segmeneted-control.scss +19 -8
- package/src/assets/scss/components/_select.scss +6 -8
- package/src/assets/scss/components/_text-field.scss +27 -11
- package/src/assets/scss/components/select/_dropdown-menu.scss +1 -0
- package/src/assets/scss/components/select/_dropdown-toggle.scss +0 -1
- package/src/assets/scss/directives/tooltip.scss +10 -5
- package/src/assets/scss/main.scss +48 -0
- package/src/components/alert/AlertBanner.vue +75 -0
- package/src/components/app/App.vue +6 -3
- package/src/components/button/Button.vue +3 -1
- package/src/components/button/NativeButton.js +4 -0
- package/src/components/button/index.stories.js +2 -2
- package/src/components/checkbox/Checkbox.vue +2 -1
- package/src/components/checkbox/RadioBox.vue +13 -7
- package/src/components/copyToClipboard/CopyToClipboard.vue +4 -1
- package/src/components/customize/PropertiesList.vue +0 -2
- package/src/components/customize/PropertiesPopupMenu.vue +1 -1
- package/src/components/customize/PropertyItem.vue +6 -24
- package/src/components/datepicker/DatePicker.vue +3 -1
- package/src/components/datepicker/DatePickerInline.vue +2 -2
- package/src/components/datepicker/DateRangePickerInline.vue +6 -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 +20 -1
- package/src/components/filter/FilterFacetsList.vue +67 -13
- package/src/components/filter/FilterPanel.vue +8 -4
- package/src/components/filter/NewFilter.vue +305 -0
- package/src/components/form/Label.vue +5 -5
- package/src/components/icon/components/nomi-ai-alt.vue +5 -0
- package/src/components/icon/components/nomi-arrow-right.vue +4 -0
- package/src/components/icon/components/nomi-bell.vue +5 -0
- package/src/components/icon/components/nomi-calendar-payment.vue +10 -0
- package/src/components/icon/components/nomi-card-plus.vue +1 -0
- package/src/components/icon/components/nomi-cash-provider.vue +9 -0
- package/src/components/icon/components/nomi-cash-repeat.vue +6 -0
- package/src/components/icon/components/nomi-category-edit.vue +5 -0
- package/src/components/icon/components/nomi-chavron-up.vue +4 -0
- package/src/components/icon/components/nomi-chavron_down.vue +4 -0
- package/src/components/icon/components/nomi-chavron_up.vue +4 -0
- package/src/components/icon/components/nomi-chevron-up.vue +4 -0
- package/src/components/icon/components/nomi-exit-right.vue +4 -0
- package/src/components/icon/components/nomi-help.vue +2 -3
- package/src/components/icon/components/nomi-history.vue +7 -0
- package/src/components/icon/components/nomi-lock.vue +1 -1
- package/src/components/icon/components/nomi-pen-alt.vue +4 -0
- package/src/components/icon/components/nomi-project.vue +2 -2
- package/src/components/icon/components/nomi-refresh-off.vue +4 -0
- package/src/components/icon/components/nomi-refresh.vue +4 -0
- package/src/components/icon/components/nomi-scissors.vue +1 -1
- package/src/components/icon/components/nomi-start.vue +28 -0
- package/src/components/icon/components/nomi-table-view.vue +1 -4
- package/src/components/icon/components/nomi-transactions-delete.vue +5 -0
- package/src/components/icon/components/nomi-type-array.vue +6 -0
- package/src/components/icon/components/nomi-type-boolean.vue +5 -0
- package/src/components/icon/components/nomi-type-date.vue +4 -0
- package/src/components/icon/components/nomi-type-null.vue +4 -0
- package/src/components/icon/components/nomi-type-number.vue +4 -0
- package/src/components/icon/components/nomi-type-object.vue +4 -0
- package/src/components/icon/components/nomi-type-string.vue +4 -0
- package/src/components/icon/components/nomi-unarchive.vue +17 -0
- package/src/components/icon/components/nomi-unlink.vue +10 -0
- package/src/components/icon/components/nomi-user.vue +3 -3
- package/src/components/icon/components/nomi-warning-triangle.vue +6 -0
- package/src/components/icon/components/nomi-warning_triangle_filled.vue +6 -0
- package/src/components/icon/convert-icons.js +3 -0
- package/src/components/icon/icons.js +390 -312
- package/src/components/icon/new-icons/ai-alt.svg +4 -0
- package/src/components/icon/new-icons/arrow-right-alt.svg +3 -0
- package/src/components/icon/new-icons/arrow-right.svg +3 -0
- package/src/components/icon/new-icons/arrow_left.svg +3 -0
- package/src/components/icon/new-icons/automation.svg +4 -0
- package/src/components/icon/new-icons/balance.svg +3 -0
- package/src/components/icon/new-icons/balance_turnover.svg +4 -0
- package/src/components/icon/new-icons/bar-horizontal.svg +6 -0
- package/src/components/icon/new-icons/bell.svg +4 -0
- package/src/components/icon/new-icons/calendar-payment.svg +9 -0
- package/src/components/icon/new-icons/card-plus.svg +1 -0
- package/src/components/icon/new-icons/cash-provider.svg +8 -0
- package/src/components/icon/new-icons/cash-repeat.svg +5 -0
- package/src/components/icon/new-icons/cash.svg +3 -0
- package/src/components/icon/new-icons/cashflow.svg +3 -0
- package/src/components/icon/new-icons/category-edit.svg +4 -0
- package/src/components/icon/new-icons/category.svg +4 -0
- package/src/components/icon/new-icons/category_alt.svg +3 -0
- package/src/components/icon/new-icons/chart-bars.svg +5 -0
- package/src/components/icon/new-icons/chart-donut.svg +3 -0
- package/src/components/icon/new-icons/chart-funnel.svg +5 -0
- package/src/components/icon/new-icons/chart-kpi.svg +7 -0
- package/src/components/icon/new-icons/chart-line.svg +4 -0
- package/src/components/icon/new-icons/chart-lines.svg +5 -0
- package/src/components/icon/new-icons/check-alt.svg +3 -0
- package/src/components/icon/new-icons/check.svg +3 -0
- package/src/components/icon/new-icons/chevron-down.svg +3 -0
- package/src/components/icon/new-icons/chevron-left.svg +3 -0
- package/src/components/icon/new-icons/chevron-right.svg +3 -0
- package/src/components/icon/new-icons/chevron-up.svg +3 -0
- package/src/components/icon/new-icons/collapse.svg +6 -0
- package/src/components/icon/new-icons/control-panel.svg +7 -0
- package/src/components/icon/new-icons/credit.svg +3 -0
- package/src/components/icon/new-icons/currencies.svg +3 -0
- package/src/components/icon/new-icons/debt.svg +3 -0
- package/src/components/icon/new-icons/demo.svg +6 -0
- package/src/components/icon/new-icons/dev.svg +3 -0
- package/src/components/icon/new-icons/dots.svg +5 -0
- package/src/components/icon/new-icons/duplicate.svg +4 -0
- package/src/components/icon/new-icons/exit-right.svg +3 -0
- package/src/components/icon/new-icons/export.svg +3 -0
- package/src/components/icon/new-icons/file.svg +3 -0
- package/src/components/icon/new-icons/folder.svg +3 -0
- package/src/components/icon/new-icons/goods-turnover.svg +3 -0
- package/src/components/icon/new-icons/goods.svg +4 -0
- package/src/components/icon/new-icons/help-alt.svg +3 -0
- package/src/components/icon/new-icons/help.svg +2 -3
- package/src/components/icon/new-icons/history.svg +6 -0
- package/src/components/icon/new-icons/integration.svg +3 -0
- package/src/components/icon/new-icons/link.svg +5 -0
- package/src/components/icon/new-icons/lock.svg +1 -1
- package/src/components/icon/new-icons/menu.svg +5 -0
- package/src/components/icon/new-icons/minus.svg +3 -0
- package/src/components/icon/new-icons/payment_calendar.svg +3 -0
- package/src/components/icon/new-icons/pc.svg +3 -0
- package/src/components/icon/new-icons/pen-alt.svg +3 -0
- package/src/components/icon/new-icons/planFact.svg +4 -0
- package/src/components/icon/new-icons/pnl.svg +7 -0
- package/src/components/icon/new-icons/project.svg +2 -2
- package/src/components/icon/new-icons/project_alt.svg +3 -0
- package/src/components/icon/new-icons/project_alt2.svg +3 -0
- package/src/components/icon/new-icons/promo.svg +3 -0
- package/src/components/icon/new-icons/refresh-off.svg +3 -0
- package/src/components/icon/new-icons/refresh.svg +3 -0
- package/src/components/icon/new-icons/scissors.svg +1 -1
- package/src/components/icon/new-icons/segment.svg +3 -0
- package/src/components/icon/new-icons/start.svg +27 -0
- package/src/components/icon/new-icons/strongbox.svg +3 -0
- package/src/components/icon/new-icons/subscription.svg +3 -0
- package/src/components/icon/new-icons/table-view.svg +1 -4
- package/src/components/icon/new-icons/time.svg +3 -0
- package/src/components/icon/new-icons/transactions_alt.svg +6 -0
- package/src/components/icon/new-icons/transactions_delete.svg +4 -0
- package/src/components/icon/new-icons/type-array.svg +5 -0
- package/src/components/icon/new-icons/type-boolean.svg +4 -0
- package/src/components/icon/new-icons/type-date.svg +3 -0
- package/src/components/icon/new-icons/type-null.svg +3 -0
- package/src/components/icon/new-icons/type-number.svg +3 -0
- package/src/components/icon/new-icons/type-object.svg +3 -0
- package/src/components/icon/new-icons/type-string.svg +3 -0
- package/src/components/icon/new-icons/types.svg +6 -0
- package/src/components/icon/new-icons/unarchive.svg +16 -0
- package/src/components/icon/new-icons/unlink.svg +9 -0
- package/src/components/icon/new-icons/user.svg +3 -3
- package/src/components/icon/new-icons/user_plus.svg +10 -0
- package/src/components/icon/new-icons/warehouse.svg +3 -0
- package/src/components/icon/new-icons/warning_triangle.svg +5 -0
- package/src/components/icon/new-icons/warning_triangle_filled.svg +5 -0
- package/src/components/kanban/BoardCard.vue +1 -1
- package/src/components/kanban/BoardCardTimer.vue +1 -1
- package/src/components/modal/DeleteConfirmModal.vue +10 -6
- package/src/components/modal/ItemEditor.vue +1 -1
- package/src/components/modal/Modal.vue +1 -1
- package/src/components/overlay/SensitiveOverlay.vue +2 -4
- package/src/components/panels/Panel.vue +110 -23
- package/src/components/panels/PanelItemEdit.vue +8 -6
- package/src/components/panels/PanelList.vue +163 -40
- package/src/components/panels/helpers.ts +29 -11
- package/src/components/popover/Popover.vue +105 -22
- package/src/components/segmented-control/SegmentedControl.vue +9 -3
- package/src/components/sortable/draggable.js +1 -1
- package/src/components/table/Table2.vue +68 -67
- package/src/components/table/TableBody.vue +17 -22
- package/src/components/table/TableGroup.vue +40 -24
- package/src/components/table/TableHeader.vue +86 -81
- package/src/components/table/TableRowToggle.vue +1 -9
- package/src/components/table/TableRows.vue +49 -55
- package/src/components/table/mobile.js +4 -0
- package/src/components/table/table2.scss +34 -15
- package/src/components/text-field/MoneyField.vue +10 -4
- package/src/components/text-field/TextField.vue +17 -8
- package/src/components/tree/TreeEditor.vue +3 -2
- package/src/components/view/View.vue +73 -208
- package/src/directives/appendToBody.js +1 -0
- package/src/helpers/validators.js +9 -35
- package/src/helpers/validators.spec.js +11 -48
- package/src/locales/en.js +4 -6
- package/src/locales/pl.js +158 -0
- package/src/locales/uk.js +6 -7
- package/src/components/icon/components/nomi-calendar-view.vue +0 -4
- package/src/components/icon/components/nomi-kanban-view.vue +0 -6
- package/src/components/icon/components/nomi-list-view.vue +0 -7
- package/src/components/icon/components/nomi-table-config.vue +0 -9
- package/src/components/icon/new-icons/calendar-view.svg +0 -3
- package/src/components/icon/new-icons/kanban-view.svg +0 -5
- package/src/components/icon/new-icons/list-view.svg +0 -6
- package/src/components/icon/new-icons/table-config.svg +0 -8
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div class="itf-segmeneted-control d-none d-lg-grid">
|
|
3
|
+
<div class="itf-segmeneted-control d-none d-lg-grid" :class="{'small': small}">
|
|
4
4
|
<span v-if="!isUndefined" ref="slider" class="selection" :class="{'elevation-1': !disabled}"></span>
|
|
5
5
|
|
|
6
6
|
<div class="option" v-for="(item, n) in itemsWithNames" :key="n">
|
|
7
|
-
<label>
|
|
7
|
+
<label v-tooltip="tooltipCallback(item)" :key="n" :class="{'disabled': disabled || item[itemDisabled]}">
|
|
8
8
|
<slot name="itemMarkup" :item="item" />
|
|
9
9
|
<input
|
|
10
10
|
ref="input"
|
|
11
11
|
type="radio"
|
|
12
12
|
:name="name"
|
|
13
13
|
:value="n"
|
|
14
|
-
|
|
14
|
+
:disabled="disabled || item[itemDisabled]"
|
|
15
15
|
:checked="isChecked(item)"
|
|
16
16
|
@change="onItemChanged(item)" />
|
|
17
17
|
<span>
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
<itf-select
|
|
25
25
|
:value="value"
|
|
26
26
|
@input="$emit('input', $event)"
|
|
27
|
+
:disabled="disabled"
|
|
27
28
|
:options="itemsWithNames"
|
|
28
29
|
:reduce="(item) => item[itemKey]"
|
|
29
30
|
:get-option-label="(item) => item[itemText]"
|
|
@@ -50,8 +51,10 @@ class itfSegmentedControl extends Vue {
|
|
|
50
51
|
@Prop({ type: Array, required: true }) items;
|
|
51
52
|
@Prop({ type: String, default: 'Id' }) itemKey;
|
|
52
53
|
@Prop({ type: String, default: 'Name' }) itemText;
|
|
54
|
+
@Prop({ type: String, default: 'Disabled' }) itemDisabled;
|
|
53
55
|
@Prop({ type: Boolean, default: false }) returnObject;
|
|
54
56
|
@Prop({ type: Boolean, default: false }) disabled;
|
|
57
|
+
@Prop({ type: Boolean, default: false }) small;
|
|
55
58
|
@Prop({ type: Function, default: () => null }) tooltipCallback;
|
|
56
59
|
|
|
57
60
|
timers = [];
|
|
@@ -127,6 +130,9 @@ class itfSegmentedControl extends Vue {
|
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
onItemChanged (item) {
|
|
133
|
+
if (this.disabled) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
130
136
|
this.$emit('input', this.returnObject ? item : item[this.itemKey]);
|
|
131
137
|
}
|
|
132
138
|
}
|
|
@@ -7,7 +7,7 @@ const SORTABLE_ATTRIBUTES = ['drag-ignore-handle', 'scrollable'];
|
|
|
7
7
|
|
|
8
8
|
const DEFAULT_OPTIONS = {
|
|
9
9
|
draggableClass: DRAGGABLE_CLASS,
|
|
10
|
-
dragHandleClass: DRAG_HANDLE_CLASS,
|
|
10
|
+
// dragHandleClass: DRAG_HANDLE_CLASS,
|
|
11
11
|
delay: 200,
|
|
12
12
|
tresholdDistance: 2,
|
|
13
13
|
draggable: `.${DRAGGABLE_CLASS}`,
|
|
@@ -7,9 +7,11 @@
|
|
|
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-
|
|
11
|
-
<
|
|
12
|
-
|
|
10
|
+
<div class="d-flex gap-2 ps-2 align-items-center small itf-table2_mass-operations">
|
|
11
|
+
<slot name="group-operations-count">
|
|
12
|
+
<div>{{$tc('components.table.selectedItems', selectedIds.length, { n: selectedIds.length })}}</div>
|
|
13
|
+
<div class="opacity-50">•</div>
|
|
14
|
+
</slot>
|
|
13
15
|
<a href="" class="me-3 opacity-50 text-white text-decoration-none" @click.stop.prevent="selectedIds = []">{{$t('components.table.cancelSelected')}}</a>
|
|
14
16
|
<div>
|
|
15
17
|
<slot name="group-operations"></slot>
|
|
@@ -17,64 +19,64 @@
|
|
|
17
19
|
</div>
|
|
18
20
|
</itf-notice-popout>
|
|
19
21
|
<div class="scrollable scrollable-x">
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
22
|
+
<itf-checkbox-group v-model="selectedIds" class="d-flex flex-column" style="min-width: 100%; width: max-content">
|
|
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
|
+
:shadow-width="shadowWidth"
|
|
37
|
+
:column-sorting="columnSorting"
|
|
38
|
+
:column-resizing="columnResizing"
|
|
39
|
+
:show-grouping="showGrouping"
|
|
40
|
+
:show-summary="showSummary"
|
|
41
|
+
:show-add-column="showAddColumn"
|
|
42
|
+
:show-actions="showActions"
|
|
43
|
+
:show-header="!noHeader"
|
|
44
|
+
:schema="schema"
|
|
45
|
+
:editable="editable"
|
|
46
|
+
:no-column-menu="noColumnMenu"
|
|
47
|
+
:no-select-all="noSelectAll"
|
|
48
|
+
:currencies="currencies"
|
|
49
|
+
:currency="currency"
|
|
50
|
+
:subrows-property="subrowsProperty"
|
|
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
|
+
:new-label="newLabel"
|
|
63
|
+
:collapsed-group-ids="collapsedGroupIds"
|
|
64
|
+
@update:expanded-ids="$emit('update:expanded-ids', $event)"
|
|
65
|
+
@update:collapsed-group-ids="$emit('update:collapsed-group-ids', $event)"
|
|
66
|
+
@new="$emit('new', $event)"
|
|
67
|
+
@filter="$emit('filter', $event)"
|
|
68
|
+
@add-column="$emit('add-column', $event)"
|
|
69
|
+
>
|
|
70
|
+
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
71
|
+
<slot :name="name" v-bind="slotData || {}" />
|
|
72
|
+
</template>
|
|
73
|
+
<template v-for="(_, name) in $scopedSlots" #[name]="slotData">
|
|
74
|
+
<slot :name="name" v-bind="slotData || {}" />
|
|
75
|
+
</template>
|
|
76
|
+
</itf-table-group>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
</itf-checkbox-group>
|
|
78
80
|
</div>
|
|
79
81
|
</div>
|
|
80
82
|
|
|
@@ -105,13 +107,11 @@ export default @Component({
|
|
|
105
107
|
})
|
|
106
108
|
class itfTable2 extends Vue {
|
|
107
109
|
// @Prop({ required: true, type: Array }) columns;
|
|
108
|
-
@Prop(Boolean) sortAsString;
|
|
109
110
|
@Prop({ required: true, type: Array }) rows;
|
|
110
111
|
@Prop({ type: String, default: null }) groupBy;
|
|
111
112
|
@Prop({ type: String, default: null }) idProperty;
|
|
112
113
|
@Prop({ type: String, default: null }) cssProperty;
|
|
113
114
|
@Prop({ type: String, default: null }) subrowsProperty;
|
|
114
|
-
@Prop({ type: String, default: null }) asyncSubrowsProperty;
|
|
115
115
|
@Prop({ type: String, default: null }) dividerProperty;
|
|
116
116
|
@Prop({ type: String, default: null }) editableProperty;
|
|
117
117
|
@Prop({ default: null }) active;
|
|
@@ -123,6 +123,7 @@ class itfTable2 extends Vue {
|
|
|
123
123
|
@ModelSync('value', 'input', { type: Array, default: () => ([]) }) selectedIds;
|
|
124
124
|
@PropSync('sorting') _sorting;
|
|
125
125
|
@Prop({ type: Array, default: () => [] }) expandedIds;
|
|
126
|
+
@Prop({ type: Array }) collapsedGroupIds;
|
|
126
127
|
@Prop() currency;
|
|
127
128
|
@Prop() currencies;
|
|
128
129
|
@Prop(Boolean) stickyHeader;
|
|
@@ -141,6 +142,7 @@ class itfTable2 extends Vue {
|
|
|
141
142
|
@Prop(Boolean) striped;
|
|
142
143
|
@Prop(Boolean) absolute;
|
|
143
144
|
@Prop(Boolean) clickable;
|
|
145
|
+
@Prop({type: String, default: function() { return this.$t('components.table.new'); } }) newLabel;
|
|
144
146
|
|
|
145
147
|
state = {
|
|
146
148
|
selectedIds: [],
|
|
@@ -189,7 +191,7 @@ class itfTable2 extends Vue {
|
|
|
189
191
|
if (stateColumnIndex === -1) {
|
|
190
192
|
state.columns.push(column);
|
|
191
193
|
} else {
|
|
192
|
-
state.columns[stateColumnIndex] = { ...column, width: state.columns[stateColumnIndex].width };
|
|
194
|
+
state.columns[stateColumnIndex] = { ...column, width: state.columns[stateColumnIndex].width, visible: state.columns[stateColumnIndex].visible };
|
|
193
195
|
}
|
|
194
196
|
}
|
|
195
197
|
for (const column of state.columns) {
|
|
@@ -209,7 +211,7 @@ class itfTable2 extends Vue {
|
|
|
209
211
|
if (!this.stateName) {
|
|
210
212
|
return;
|
|
211
213
|
}
|
|
212
|
-
const columns = this.state.columns.map((s) => ({ property: s.property, width: s.width, index: s.index }));
|
|
214
|
+
const columns = this.state.columns.map((s) => ({ property: s.property, width: s.width, index: s.index, visible: s.visible }));
|
|
213
215
|
localStorage.setItem(this.stateKey, JSON.stringify({ columns }));
|
|
214
216
|
}
|
|
215
217
|
|
|
@@ -247,8 +249,7 @@ class itfTable2 extends Vue {
|
|
|
247
249
|
@Watch('selectedIds')
|
|
248
250
|
onSelectedIdsUpdate(selectedIds) {
|
|
249
251
|
this.state.selectedIds = selectedIds;
|
|
250
|
-
|
|
251
|
-
// this.saveTableState();
|
|
252
|
+
this.saveTableState();
|
|
252
253
|
}
|
|
253
254
|
|
|
254
255
|
onColumnsUpdate(columns) {
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
<div v-if="!rows.length" data-test="table-no-results" class="scroller">
|
|
4
|
+
<div class="table-view-item">
|
|
5
|
+
<div class="table-row-template">
|
|
6
|
+
<div accept-group="items" class="table-view-body-space"></div>
|
|
7
|
+
<div class="shadow-area"></div>
|
|
8
|
+
<div class="indicator sticky"></div>
|
|
9
|
+
<div class="table-item-inner">
|
|
10
|
+
<div class="table-view-item-value w-100 align-items-center p-3 no-results">
|
|
11
|
+
{{$t('components.table.noResults')}}
|
|
12
|
+
</div>
|
|
13
|
+
<div class="boundary right"></div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
3
18
|
<itf-table-rows
|
|
19
|
+
v-else
|
|
4
20
|
class="scroller"
|
|
5
21
|
:rows="rows"
|
|
6
22
|
:selected-ids="selectedIds"
|
|
7
23
|
:columns="columns"
|
|
8
24
|
:id-property="idProperty"
|
|
9
25
|
:subrows-property="subrowsProperty"
|
|
10
|
-
:async-subrows-property="asyncSubrowsProperty"
|
|
11
26
|
:divider-property="dividerProperty"
|
|
12
27
|
:show-add-column="showAddColumn"
|
|
13
28
|
:show-actions="showActions"
|
|
@@ -34,21 +49,6 @@
|
|
|
34
49
|
<slot :name="name" v-bind="slotData || {}"/>
|
|
35
50
|
</template>
|
|
36
51
|
</itf-table-rows>
|
|
37
|
-
<div v-if="!rows.length" data-test="table-no-results" class="scroller">
|
|
38
|
-
<div class="table-view-item">
|
|
39
|
-
<div class="table-row-template">
|
|
40
|
-
<div accept-group="items" class="table-view-body-space"></div>
|
|
41
|
-
<div class="shadow-area"></div>
|
|
42
|
-
<div class="indicator sticky"></div>
|
|
43
|
-
<div class="table-item-inner">
|
|
44
|
-
<div class="table-view-item-value w-100 align-items-center p-3 no-results">
|
|
45
|
-
{{$t('components.table.noResults')}}
|
|
46
|
-
</div>
|
|
47
|
-
<div class="boundary right"></div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
52
|
</div>
|
|
53
53
|
</template>
|
|
54
54
|
<style lang="scss">
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
display: flex;
|
|
94
94
|
align-items: center;
|
|
95
95
|
justify-content: center;
|
|
96
|
-
min-width: 1rem
|
|
96
|
+
min-width: 1rem; // важливо для скруглення //var(--itf-table-min-width);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
.table-row-template, .table-view-header-value {
|
|
@@ -145,7 +145,6 @@ class itfTableBody extends Vue {
|
|
|
145
145
|
@Prop() rows;
|
|
146
146
|
@Prop() idProperty;
|
|
147
147
|
@Prop() subrowsProperty;
|
|
148
|
-
@Prop() asyncSubrowsProperty;
|
|
149
148
|
@Prop() dividerProperty;
|
|
150
149
|
@Prop() active;
|
|
151
150
|
@Prop(Boolean) showAddColumn;
|
|
@@ -166,10 +165,6 @@ class itfTableBody extends Vue {
|
|
|
166
165
|
this.$emit('update:expanded-ids', this.expandedIds.includes(item[this.idProperty])
|
|
167
166
|
? this.expandedIds.filter((id) => id !== item[this.idProperty])
|
|
168
167
|
: [...this.expandedIds, item[this.idProperty]]);
|
|
169
|
-
|
|
170
|
-
if (this.asyncSubrowsProperty && item[this.asyncSubrowsProperty] && item[this.asyncSubrowsProperty]) {
|
|
171
|
-
this.$emit('loadChildren', item);
|
|
172
|
-
}
|
|
173
168
|
}
|
|
174
169
|
}
|
|
175
170
|
</script>
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
<div class="table-row-template d-flex align-items-stretch"
|
|
16
16
|
style="min-height: var(--group-title-height)">
|
|
17
17
|
<div class="shadow-area"></div>
|
|
18
|
-
<div class="header-wrapper" :class="{'header-additional-column': showAddColumn}" @click.prevent="toggleGroup">
|
|
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 icon small secondary class="collapse-arrow">
|
|
20
|
+
<itf-button squircle 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"
|
|
24
24
|
data-test="group-value-group-label-value">
|
|
25
|
-
<slot name="group-title" :rows="rows" :title="title">{{ title }}</slot>
|
|
25
|
+
<slot name="group-title" :rows="rows" :title="title" :collapsed="!isShowTable">{{ title }}</slot>
|
|
26
26
|
</span>
|
|
27
27
|
</a>
|
|
28
28
|
</div>
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
:show-add-column="showAddColumn"
|
|
40
40
|
:show-actions="showActions"
|
|
41
41
|
:id-property="idProperty"
|
|
42
|
-
:sort-as-string="sortAsString"
|
|
43
42
|
:rows="rows"
|
|
44
43
|
:schema="schema"
|
|
45
44
|
:editable="editable"
|
|
@@ -52,7 +51,14 @@
|
|
|
52
51
|
@update:columns="$emit('update:columns', $event)"
|
|
53
52
|
@filter="$emit('filter', $event)"
|
|
54
53
|
@add-column="$emit('add-column', $event)"
|
|
55
|
-
|
|
54
|
+
>
|
|
55
|
+
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
56
|
+
<slot :name="name" v-bind="slotData || {}"/>
|
|
57
|
+
</template>
|
|
58
|
+
<template v-for="(_, name) in $scopedSlots" #[name]="slotData">
|
|
59
|
+
<slot :name="name" v-bind="slotData || {}"/>
|
|
60
|
+
</template>
|
|
61
|
+
</itf-table-header>
|
|
56
62
|
</div>
|
|
57
63
|
|
|
58
64
|
<!-- Сама таблиця -->
|
|
@@ -62,13 +68,11 @@
|
|
|
62
68
|
@row-click="$emit('row-click', $event)"
|
|
63
69
|
:id-property="idProperty"
|
|
64
70
|
:subrows-property="subrowsProperty"
|
|
65
|
-
:async-subrows-property="asyncSubrowsProperty"
|
|
66
71
|
:divider-property="dividerProperty"
|
|
67
72
|
:rows="rows"
|
|
68
73
|
:editable="editable"
|
|
69
74
|
:currency="currency"
|
|
70
75
|
:currencies="currencies"
|
|
71
|
-
:sort-as-string="sortAsString"
|
|
72
76
|
:columns="visibleColumns"
|
|
73
77
|
:no-select-all="noSelectAll"
|
|
74
78
|
:selected-ids="selectedIds"
|
|
@@ -81,7 +85,6 @@
|
|
|
81
85
|
:css-property="cssProperty"
|
|
82
86
|
:editable-property="editableProperty"
|
|
83
87
|
:active="active"
|
|
84
|
-
@loadChildren="$emit('loadChildren', $event)"
|
|
85
88
|
@update:expanded-ids="$emit('update:expanded-ids', $event)"
|
|
86
89
|
>
|
|
87
90
|
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
@@ -95,11 +98,11 @@
|
|
|
95
98
|
|
|
96
99
|
<!-- Лінія додати нову -->
|
|
97
100
|
<div v-if="isShowTable && addNewRows"
|
|
98
|
-
class="
|
|
101
|
+
class="d-flex align-items-stretch">
|
|
99
102
|
<div class="shadow-area"></div>
|
|
100
103
|
<a href="" @click.prevent="$emit('new', title)" data-test="table-add-new-item"
|
|
101
104
|
class="d-flex align-items-center flex-grow-1 table-add-new-item text-decoration-none">
|
|
102
|
-
<span class="d-sticky d-flex align-items-center py-
|
|
105
|
+
<span class="d-sticky d-flex align-items-center py-2 px-2">
|
|
103
106
|
<itf-icon name="plus"/>
|
|
104
107
|
<span>{{ newLabel }}</span>
|
|
105
108
|
</span>
|
|
@@ -268,20 +271,21 @@
|
|
|
268
271
|
min-height: var(--table-small-row-size);
|
|
269
272
|
}
|
|
270
273
|
|
|
271
|
-
.table-row-template.table-row-template__new-row {
|
|
272
|
-
min-height: 2rem;
|
|
273
|
-
}
|
|
274
274
|
.table-add-new-item {
|
|
275
|
-
|
|
276
|
-
border-right:var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
|
|
277
|
-
border-left:var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
|
|
275
|
+
margin-top: -12px;
|
|
278
276
|
border-bottom: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
|
|
279
277
|
outline: none;
|
|
280
278
|
border-bottom-left-radius: var(--itf-table-table-border-radius);
|
|
281
279
|
border-bottom-right-radius: var(--itf-table-table-border-radius);
|
|
280
|
+
border-right: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
|
|
281
|
+
|
|
282
|
+
> .d-sticky {
|
|
283
|
+
border-left: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
|
|
284
|
+
border-bottom-left-radius: var(--itf-table-table-border-radius);
|
|
285
|
+
}
|
|
282
286
|
|
|
283
287
|
& > span {
|
|
284
|
-
left:
|
|
288
|
+
left: var(--shadow-area-width);
|
|
285
289
|
position: sticky;
|
|
286
290
|
padding-left: var(--shadow-area-width);
|
|
287
291
|
//border-left: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
|
|
@@ -344,6 +348,7 @@ import itfIcon from '../icon/Icon.vue';
|
|
|
344
348
|
import itfTableBody from './TableBody.vue';
|
|
345
349
|
import itfTableHeader from './TableHeader.vue';
|
|
346
350
|
import Sticky from "./sticky";
|
|
351
|
+
import { getIsMobileView } from "./mobile";
|
|
347
352
|
|
|
348
353
|
function getNumber(item, prop) {
|
|
349
354
|
const num = Number(get(item, prop));
|
|
@@ -367,7 +372,6 @@ class itfTableGroup extends Vue {
|
|
|
367
372
|
@Prop() title;
|
|
368
373
|
@Prop() idProperty;
|
|
369
374
|
@Prop() subrowsProperty;
|
|
370
|
-
@Prop() asyncSubrowsProperty;
|
|
371
375
|
@Prop() dividerProperty;
|
|
372
376
|
@Prop() currency;
|
|
373
377
|
@Prop() currencies;
|
|
@@ -387,7 +391,6 @@ class itfTableGroup extends Vue {
|
|
|
387
391
|
@Prop(Boolean) expandedAll;
|
|
388
392
|
@Prop(Boolean) striped;
|
|
389
393
|
@Prop(Boolean) stickyHeader;
|
|
390
|
-
@Prop(Boolean) sortAsString;
|
|
391
394
|
@Prop() indicatorWidth;
|
|
392
395
|
@Prop() shadowWidth;
|
|
393
396
|
@Prop() cssProperty;
|
|
@@ -396,10 +399,14 @@ class itfTableGroup extends Vue {
|
|
|
396
399
|
@Prop({type: String, default: function() { return this.$t('components.table.new'); } }) newLabel;
|
|
397
400
|
@Prop({type: Object, default: () => ({})}) schema;
|
|
398
401
|
@Prop() expandedIds;
|
|
402
|
+
@Prop() collapsedGroupIds;
|
|
399
403
|
|
|
400
|
-
isShowTable = true;
|
|
401
404
|
persistSummary = false;
|
|
402
405
|
|
|
406
|
+
get isShowTable() {
|
|
407
|
+
return typeof this.collapsedGroupIds !== 'undefined' ? !this.collapsedGroupIds.includes(this.title) : true;
|
|
408
|
+
}
|
|
409
|
+
|
|
403
410
|
get visibleColumns() {
|
|
404
411
|
let list = this.columns;
|
|
405
412
|
list = sortBy(list, (column) => column.index);
|
|
@@ -407,8 +414,8 @@ class itfTableGroup extends Vue {
|
|
|
407
414
|
const pinned = list.filter((column) => column.pinned && column.visible !== false);
|
|
408
415
|
list = list.map((column, index) => {
|
|
409
416
|
const item = {...column};
|
|
410
|
-
item.left = (item.pinned && item.visible !== false) ? left : 0;
|
|
411
|
-
left = (item.pinned && item.visible !== false) ? left + column.width : left;
|
|
417
|
+
item.left = (item.pinned && !getIsMobileView() && item.visible !== false) ? left : 0;
|
|
418
|
+
left = (item.pinned && !getIsMobileView() && item.visible !== false) ? left + column.width : left;
|
|
412
419
|
item.lastPinned = index === pinned.length - 1;
|
|
413
420
|
return item
|
|
414
421
|
});
|
|
@@ -420,8 +427,17 @@ class itfTableGroup extends Vue {
|
|
|
420
427
|
this.$emit('update:columns', columns);
|
|
421
428
|
}
|
|
422
429
|
|
|
423
|
-
toggleGroup() {
|
|
424
|
-
this.
|
|
430
|
+
toggleGroup(val) {
|
|
431
|
+
let expanded = this.collapsedGroupIds ? [...this.collapsedGroupIds] : [];
|
|
432
|
+
if (!val) {
|
|
433
|
+
if (!expanded.includes(this.title)) {
|
|
434
|
+
expanded.push(this.title);
|
|
435
|
+
}
|
|
436
|
+
} else {
|
|
437
|
+
expanded = expanded.filter(id => id !== this.title);
|
|
438
|
+
}
|
|
439
|
+
console.info(expanded, this.title, val);
|
|
440
|
+
this.$emit('update:collapsed-group-ids', expanded);
|
|
425
441
|
}
|
|
426
442
|
|
|
427
443
|
get stickyId() {
|