@itfin/components 1.3.96 → 2.0.2
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/assets/scss/_css_variables.scss +2 -2
- package/src/assets/scss/_variables.scss +31 -9
- package/src/assets/scss/components/_button.scss +10 -0
- package/src/assets/scss/components/_datepicker.scss +3 -3
- package/src/assets/scss/components/_pagination.scss +4 -1
- package/src/assets/scss/components/_select.scss +4 -6
- package/src/assets/scss/components/_text-field.scss +19 -11
- package/src/assets/scss/main.scss +41 -2
- package/src/components/app/message.js +1 -1
- package/src/components/button/Button.vue +4 -2
- package/src/components/filter/FilterAmountRange.vue +50 -42
- package/src/components/filter/FilterBadge.vue +27 -22
- package/src/components/filter/FilterFacetsList.vue +20 -17
- package/src/components/filter/FilterPanel.vue +82 -27
- package/src/components/filter/index.stories.js +0 -2
- package/src/components/icon/Icon.vue +4 -2
- package/src/components/icon/components/fi_fingerprint.vue +4 -0
- package/src/components/icon/components/nomi-arrow-down.vue +4 -0
- package/src/components/icon/components/nomi-arrow-right-top.vue +4 -0
- package/src/components/icon/components/nomi-arrow-up.vue +4 -0
- package/src/components/icon/components/nomi-arrows.vue +7 -0
- package/src/components/icon/components/nomi-calendar-alt.vue +4 -0
- package/src/components/icon/components/nomi-calendar.vue +11 -0
- package/src/components/icon/components/nomi-card.vue +4 -0
- package/src/components/icon/components/nomi-clear.vue +4 -0
- package/src/components/icon/components/nomi-close.vue +5 -0
- package/src/components/icon/components/nomi-eye-close.vue +4 -0
- package/src/components/icon/components/nomi-eye-open.vue +4 -0
- package/src/components/icon/components/nomi-filter.vue +4 -0
- package/src/components/icon/components/nomi-hide.vue +4 -0
- package/src/components/icon/components/nomi-money.vue +4 -0
- package/src/components/icon/components/nomi-move-left.vue +4 -0
- package/src/components/icon/components/nomi-move-right.vue +4 -0
- package/src/components/icon/components/nomi-person.vue +5 -0
- package/src/components/icon/components/nomi-pin.vue +7 -0
- package/src/components/icon/components/nomi-scissors.vue +4 -0
- package/src/components/icon/components/nomi-sort-asc.vue +7 -0
- package/src/components/icon/components/nomi-sort-desc.vue +7 -0
- package/src/components/icon/components/nomi-table-view.vue +4 -0
- package/src/components/icon/components/nomi-tag.vue +4 -0
- package/src/components/icon/components/nomi-target.vue +4 -0
- package/src/components/icon/components/nomi-text.vue +6 -0
- package/src/components/icon/components/nomi-unpin.vue +7 -0
- package/src/components/icon/convert-icons.js +11 -0
- package/src/components/icon/icons.js +311 -284
- package/src/components/icon/new-icons/arrow-down.svg +3 -0
- package/src/components/icon/new-icons/arrow-right-top.svg +3 -0
- package/src/components/icon/new-icons/arrow-up.svg +3 -0
- package/src/components/icon/new-icons/arrows.svg +6 -0
- package/src/components/icon/new-icons/calendar-alt.svg +3 -0
- package/src/components/icon/new-icons/calendar.svg +10 -0
- package/src/components/icon/new-icons/card.svg +3 -0
- package/src/components/icon/new-icons/clear.svg +3 -0
- package/src/components/icon/new-icons/close.svg +4 -0
- package/src/components/icon/new-icons/eye-close.svg +3 -0
- package/src/components/icon/new-icons/eye-open.svg +3 -0
- package/src/components/icon/new-icons/filter.svg +3 -0
- package/src/components/icon/new-icons/hide.svg +3 -0
- package/src/components/icon/new-icons/money.svg +3 -0
- package/src/components/icon/new-icons/move-left.svg +3 -0
- package/src/components/icon/new-icons/move-right.svg +3 -0
- package/src/components/icon/new-icons/person.svg +4 -0
- package/src/components/icon/new-icons/pin.svg +6 -0
- package/src/components/icon/new-icons/scissors.svg +3 -0
- package/src/components/icon/new-icons/sort-asc.svg +6 -0
- package/src/components/icon/new-icons/sort-desc.svg +6 -0
- package/src/components/icon/new-icons/table-view.svg +3 -0
- package/src/components/icon/new-icons/tag.svg +3 -0
- package/src/components/icon/new-icons/target.svg +3 -0
- package/src/components/icon/new-icons/text.svg +5 -0
- package/src/components/icon/new-icons/unpin.svg +6 -0
- package/src/components/modal/DeleteConfirmModal.vue +0 -2
- package/src/components/modal/ItemEditor.vue +1 -5
- package/src/components/pagination/Pagination.vue +3 -2
- package/src/components/pagination/Pagination2.vue +176 -0
- package/src/components/panels/Panel.vue +1 -1
- package/src/components/popover/NoticePopout.vue +1 -1
- package/src/components/sortable/draggable.js +2 -1
- package/src/components/table/Table2.vue +24 -1
- package/src/components/table/TableBody.vue +7 -2
- package/src/components/table/TableGroup.vue +25 -10
- package/src/components/table/TableHeader.vue +101 -61
- package/src/components/table/TableRows.vue +9 -7
- package/src/components/table/index.stories.js +22 -200
- package/src/components/table/table2.scss +203 -65
- package/src/components/text-field/MoneyField.vue +9 -52
- package/src/components/text-field/TextField.vue +12 -8
- package/src/components/view/View.vue +154 -0
- package/src/components/view/index.stories.js +588 -0
- package/src/helpers/formatters.js +14 -1
- package/src/locales/en.js +13 -0
- package/src/locales/uk.js +11 -0
- package/src/components/table/TableRow.vue +0 -221
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<div v-loading="loading || loadingData" class="flex-grow-1 w-100 d-flex flex-column">
|
|
4
|
+
<itf-filter-panel
|
|
5
|
+
search-placeholder="Search by text"
|
|
6
|
+
search
|
|
7
|
+
class="py-2 px-3"
|
|
8
|
+
:endpoint="filtersEndpoint"
|
|
9
|
+
v-model="filter"
|
|
10
|
+
@input="loadData"
|
|
11
|
+
>
|
|
12
|
+
<template #after-filter-btn>
|
|
13
|
+
<itf-dropdown v-if="$refs.table && schema" shadow :button-options="{ default: true, icon: true }" autoclose="outside">
|
|
14
|
+
<template #button>
|
|
15
|
+
<itf-icon new name="table-view" />
|
|
16
|
+
</template>
|
|
17
|
+
<div class="dropdown-header">
|
|
18
|
+
{{ $t('components.table.columns') }}
|
|
19
|
+
</div>
|
|
20
|
+
<a v-for="(property, n) of schema.properties" :key="n" href="" @click.stop.prevent="$refs.table.toggleVisibility(property.property)" class="dropdown-item justify-content-between d-flex gap-3">
|
|
21
|
+
<div class="d-flex align-items-center gap-1">
|
|
22
|
+
<itf-icon v-if="property.icon" :size="24" new :name="property.icon" />
|
|
23
|
+
{{getTitle(property.title)}}
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<itf-icon v-if="$refs.table.getColumnVisibility(property.property)" new :size="24" name="eye-open" />
|
|
27
|
+
<itf-icon v-else new name="eye-close" />
|
|
28
|
+
</a>
|
|
29
|
+
<div class="dropdown-header">
|
|
30
|
+
{{ $t('components.table.actions') }}
|
|
31
|
+
</div>
|
|
32
|
+
<a href="" @click.stop.prevent="$refs.table.resetSettings()" class="dropdown-item justify-content-between d-flex gap-3">
|
|
33
|
+
<div class="d-flex align-items-center gap-1">
|
|
34
|
+
<itf-icon new :size="24" name="download" />
|
|
35
|
+
{{ $t('components.table.resetTableSettings') }}
|
|
36
|
+
</div>
|
|
37
|
+
</a>
|
|
38
|
+
</itf-dropdown>
|
|
39
|
+
</template>
|
|
40
|
+
</itf-filter-panel>
|
|
41
|
+
|
|
42
|
+
<div class="flex-grow-1 px-3 d-flex flex-column">
|
|
43
|
+
<div class="position-relative flex-grow-1">
|
|
44
|
+
<itf-table
|
|
45
|
+
ref="table"
|
|
46
|
+
style="--shadow-area-width: 0px;"
|
|
47
|
+
absolute
|
|
48
|
+
striped
|
|
49
|
+
column-sorting
|
|
50
|
+
column-resizing
|
|
51
|
+
:rows="items"
|
|
52
|
+
:schema="schema"
|
|
53
|
+
>
|
|
54
|
+
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
55
|
+
<slot :name="name" v-bind="slotData || {}"/>
|
|
56
|
+
</template>
|
|
57
|
+
<template v-for="(_, name) in $scopedSlots" #[name]="slotData">
|
|
58
|
+
<slot :name="name" v-bind="slotData || {}"/>
|
|
59
|
+
</template>
|
|
60
|
+
</itf-table>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<itf-pagination
|
|
65
|
+
class="my-2 px-3"
|
|
66
|
+
show-size
|
|
67
|
+
:size="size"
|
|
68
|
+
:items="items"
|
|
69
|
+
:pages="countPages"
|
|
70
|
+
:value="page"
|
|
71
|
+
@input="$emit('update:page', $event)"
|
|
72
|
+
>
|
|
73
|
+
<template #center>
|
|
74
|
+
<slot name="pagination-center" />
|
|
75
|
+
</template>
|
|
76
|
+
</itf-pagination>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
</template>
|
|
80
|
+
<script>
|
|
81
|
+
import { Vue, Component, Prop } from 'vue-property-decorator';
|
|
82
|
+
import loading from '../../directives/loading';
|
|
83
|
+
import itfTable from '../table/Table2.vue';
|
|
84
|
+
import itfFilterPanel from '../filter/FilterPanel.vue';
|
|
85
|
+
import itfPagination from '../pagination/Pagination2.vue';
|
|
86
|
+
import itfTableBody from "../table/TableBody.vue";
|
|
87
|
+
import itfIcon from "../icon/Icon.vue";
|
|
88
|
+
import itfDropdown from "../dropdown/Dropdown.vue";
|
|
89
|
+
|
|
90
|
+
export default @Component({
|
|
91
|
+
name: 'itfView',
|
|
92
|
+
components: {
|
|
93
|
+
itfDropdown, itfIcon,
|
|
94
|
+
itfPagination,
|
|
95
|
+
itfFilterPanel,
|
|
96
|
+
itfTableBody,
|
|
97
|
+
itfTable
|
|
98
|
+
},
|
|
99
|
+
directives: {
|
|
100
|
+
loading
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
class itfView extends Vue {
|
|
104
|
+
@Prop({ type: Boolean }) loading;
|
|
105
|
+
@Prop({ type: Array }) filters;
|
|
106
|
+
@Prop({ type: Object, required: true }) schema;
|
|
107
|
+
@Prop({ default: 20 }) size;
|
|
108
|
+
@Prop({ default: 100 }) total;
|
|
109
|
+
@Prop({ default: 1 }) page;
|
|
110
|
+
@Prop(String) sorting;
|
|
111
|
+
@Prop(String) endpoint;
|
|
112
|
+
@Prop(String) filtersEndpoint;
|
|
113
|
+
@Prop(String) itemsKey;
|
|
114
|
+
|
|
115
|
+
items = [];
|
|
116
|
+
filter = {};
|
|
117
|
+
loadingData = false;
|
|
118
|
+
|
|
119
|
+
mounted() {
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async loadData() {
|
|
123
|
+
if (!this.endpoint) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
this.$emit('load', this.filter);
|
|
127
|
+
this.loadingData = true;
|
|
128
|
+
await this.$try(async () => {
|
|
129
|
+
const res = await this.$axios.$get(this.endpoint, {
|
|
130
|
+
params: {
|
|
131
|
+
...this.filter,
|
|
132
|
+
page: this.page,
|
|
133
|
+
size: this.size,
|
|
134
|
+
sorting: this.sorting
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
this.items = res[this.itemsKey];
|
|
138
|
+
});
|
|
139
|
+
this.loadingData = false;
|
|
140
|
+
this.$emit('loaded', this.filter);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
getTitle(title) {
|
|
144
|
+
if (typeof title === 'string') {
|
|
145
|
+
return title;
|
|
146
|
+
}
|
|
147
|
+
return title[this.locale] || title['en_US'];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
get countPages() {
|
|
151
|
+
return Math.ceil(this.total / this.size);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
</script>
|