@itfin/components 1.3.35 → 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 +1 -1
- package/src/assets/scss/icons.scss +1 -1
- package/src/components/dropdown/Dropdown.vue +1 -0
- package/src/components/dropdown/DropdownMenu.vue +7 -2
- package/src/components/table/Table2.vue +3 -0
- package/src/components/table/TableBody.vue +18 -15
- package/src/components/table/TableGroup.vue +2 -1
- package/src/components/table/TableHeader.vue +1 -1
- package/src/components/table/index.stories.js +1 -1
- package/src/components/text-field/MoneyField.vue +3 -2
- package/src/locales/en.js +1 -0
- package/src/locales/uk.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
$bootstrap-icons-font: "bootstrap-icons" !default;
|
|
3
|
-
$bootstrap-icons-font-dir: "
|
|
3
|
+
$bootstrap-icons-font-dir: "/fonts" !default;
|
|
4
4
|
$bootstrap-icons-font-file: "#{$bootstrap-icons-font-dir}/#{$bootstrap-icons-font}" !default;
|
|
5
5
|
$bootstrap-icons-font-hash: "24e3eb84d0bcaf83d77f904c78ac1f47" !default;
|
|
6
6
|
$bootstrap-icons-font-src: url("#{$bootstrap-icons-font-file}.woff2?#{$bootstrap-icons-font-hash}") format("woff2"),
|
|
@@ -24,6 +24,7 @@ class itfDropdown extends Vue {
|
|
|
24
24
|
@Prop({ type: Boolean }) disabled;
|
|
25
25
|
@Prop({ type: Boolean }) text;
|
|
26
26
|
@Prop({ type: Boolean }) appendToBody;
|
|
27
|
+
@Prop({ type: Boolean }) appendToContext;
|
|
27
28
|
@Prop({ validator: (value) => [true, false, 'inside', 'outside'].includes(value), default: true }) autoclose;
|
|
28
29
|
@Prop({ type: Object, default: () => ({}) }) buttonOptions;
|
|
29
30
|
@Prop({ type: Object, default: () => ({}) }) menuOptions;
|
|
@@ -22,6 +22,7 @@ class itfDropdownMenu extends Vue {
|
|
|
22
22
|
@Prop({ type: Boolean }) disabled;
|
|
23
23
|
@Prop({ type: Boolean }) text;
|
|
24
24
|
@Prop({ type: Boolean }) appendToBody;
|
|
25
|
+
@Prop({ type: Boolean }) appendToContext;
|
|
25
26
|
@Prop({ type: String }) toggleId;
|
|
26
27
|
@Prop({ validator: (value) => [true, false, 'inside', 'outside'].includes(value), default: true }) autoclose;
|
|
27
28
|
@Prop({ type: Object, default: () => ({}) }) buttonOptions;
|
|
@@ -39,10 +40,14 @@ class itfDropdownMenu extends Vue {
|
|
|
39
40
|
const { default: Dropdown } = await import('bootstrap/js/src/dropdown.js');
|
|
40
41
|
let context = document.body;
|
|
41
42
|
this.modalEl = new Dropdown(toggle, {
|
|
42
|
-
reference: '
|
|
43
|
+
reference: 'parent',
|
|
43
44
|
autoClose: this.autoclose
|
|
44
45
|
});
|
|
45
|
-
if (this.
|
|
46
|
+
if (this.appendToContext && this.$el instanceof Node && this.$el.parentNode) {
|
|
47
|
+
context = this.$el.closest('.itf-append-context') || document.body;
|
|
48
|
+
this.$el.parentNode.removeChild(this.$el);
|
|
49
|
+
context.appendChild(this.$el); // should append only to body
|
|
50
|
+
} else if (this.appendToBody && this.$el instanceof Node && this.$el.parentNode) {
|
|
46
51
|
this.$el.parentNode.removeChild(this.$el);
|
|
47
52
|
context.appendChild(this.$el); // should append only to body
|
|
48
53
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<div class="table-view-body">
|
|
7
7
|
<itf-table-group
|
|
8
8
|
:key="index"
|
|
9
|
+
@update="$emit('update', { ...$event, group, groupIndex: index })"
|
|
9
10
|
:id-property="idProperty"
|
|
10
11
|
:columns="columns"
|
|
11
12
|
@update:columns="onColumnsUpdate"
|
|
@@ -75,6 +76,7 @@ import itfButton from '../button/Button.vue';
|
|
|
75
76
|
import itfIcon from '../icon/Icon.vue';
|
|
76
77
|
import itfTableGroup from './TableGroup.vue';
|
|
77
78
|
import itfTableHeader from './TableHeader.vue';
|
|
79
|
+
import itfTableBody from "@/components/table/TableBody.vue";
|
|
78
80
|
|
|
79
81
|
export default @Component({
|
|
80
82
|
name: 'itfTable2',
|
|
@@ -82,6 +84,7 @@ export default @Component({
|
|
|
82
84
|
return { tableEl: this }; // do not use Provide from vue-property-decorator
|
|
83
85
|
},
|
|
84
86
|
components: {
|
|
87
|
+
itfTableBody,
|
|
85
88
|
itfCheckboxGroup,
|
|
86
89
|
itfTableHeader,
|
|
87
90
|
itfButton,
|
|
@@ -19,24 +19,28 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
<div class="indicator sticky">
|
|
21
21
|
<div class="fill on-rest table-view-row-count">
|
|
22
|
-
<!-- <span>{{ item[idProperty] }}</span>-->
|
|
22
|
+
<!-- <span>{{ item[idProperty] }}</span>-->
|
|
23
23
|
</div>
|
|
24
24
|
<div class="fill on-hover">
|
|
25
25
|
<itf-checkbox :value="item[idProperty]" />
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
28
|
<div accept-group="items" class="table-item-inner">
|
|
29
|
-
<template v-for="(column,
|
|
29
|
+
<template v-for="(column, k) in visibleAttributes">
|
|
30
30
|
<div
|
|
31
31
|
v-if="column.visible !== false"
|
|
32
|
-
:data-column="
|
|
32
|
+
:data-column="k"
|
|
33
33
|
:style="`width: ${column.width}px; left: ${column.left}px;`"
|
|
34
|
-
:class="{'sticky': column.pinned, 'last-sticky-column':
|
|
34
|
+
:class="{'sticky': column.pinned, 'last-sticky-column': k === lastPinnedIndex, 'flex-grow-1': column.grow}"
|
|
35
35
|
class="table-view-item-value d-flex h-100 align-items-stretch">
|
|
36
36
|
<slot :name="`column.${column.name}`" :item="item" :column="column">
|
|
37
37
|
<template v-if="column.editable">
|
|
38
38
|
<slot :name="`edit.${column.type}`" :value="getValue(item, column)" :item="item" :column="column">
|
|
39
|
-
<div class="px-1 py-1 w-100"
|
|
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>
|
|
40
44
|
</slot>
|
|
41
45
|
</template>
|
|
42
46
|
<template v-else>
|
|
@@ -208,18 +212,21 @@
|
|
|
208
212
|
<script>
|
|
209
213
|
import { Vue, Component, Prop } from 'vue-property-decorator';
|
|
210
214
|
import get from 'lodash/get';
|
|
211
|
-
import { RecycleScroller } from 'vue-virtual-scroller'
|
|
215
|
+
// import { RecycleScroller } from 'vue-virtual-scroller'
|
|
212
216
|
import itfCheckbox from '../checkbox/Checkbox.vue';
|
|
213
217
|
import itfTextField from '../text-field/TextField.vue';
|
|
214
|
-
import
|
|
215
|
-
import '
|
|
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';
|
|
216
221
|
|
|
217
222
|
export default @Component({
|
|
218
223
|
name: 'itfTableBody',
|
|
219
224
|
components: {
|
|
220
225
|
itfCheckbox,
|
|
226
|
+
itfMoneyField,
|
|
227
|
+
itfTextarea,
|
|
221
228
|
itfTextField,
|
|
222
|
-
RecycleScroller
|
|
229
|
+
// RecycleScroller
|
|
223
230
|
}
|
|
224
231
|
})
|
|
225
232
|
class itfTableBody extends Vue {
|
|
@@ -228,8 +235,6 @@ class itfTableBody extends Vue {
|
|
|
228
235
|
@Prop() idProperty;
|
|
229
236
|
@Prop(Boolean) showAddColumn;
|
|
230
237
|
|
|
231
|
-
editTypes = {};
|
|
232
|
-
|
|
233
238
|
getValue(item, column) {
|
|
234
239
|
return get(item, column.property);
|
|
235
240
|
}
|
|
@@ -242,10 +247,8 @@ class itfTableBody extends Vue {
|
|
|
242
247
|
return this.columns.findIndex((column) => column.lastPinned);
|
|
243
248
|
}
|
|
244
249
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
this.editTypes[Type] = true;
|
|
248
|
-
}
|
|
250
|
+
updateValue(item, value, index) {
|
|
251
|
+
this.$emit('update', { index, item, value });
|
|
249
252
|
}
|
|
250
253
|
}
|
|
251
254
|
</script>
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
<!-- Сама таблиця -->
|
|
53
53
|
<div v-if="isShowTable">
|
|
54
54
|
<itf-table-body
|
|
55
|
+
@update="$emit('update', $event)"
|
|
55
56
|
:id-property="idProperty"
|
|
56
57
|
:rows="rows"
|
|
57
58
|
:columns="visibleColumns"
|
|
@@ -305,7 +306,7 @@ import itfButton from '../button/Button.vue';
|
|
|
305
306
|
import itfIcon from '../icon/Icon.vue';
|
|
306
307
|
import itfTableBody from './TableBody.vue';
|
|
307
308
|
import itfTableHeader from './TableHeader.vue';
|
|
308
|
-
import Sticky from "
|
|
309
|
+
import Sticky from "./sticky";
|
|
309
310
|
|
|
310
311
|
export default @Component({
|
|
311
312
|
name: 'itfTableGroup',
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
</div>
|
|
86
86
|
</template>
|
|
87
87
|
<div v-if="showAddColumn" class="table-view-header-value flex-grow-1 justify-content-start">
|
|
88
|
-
<itf-dropdown v-if="visibleHeader" ref="newDd" text append-to-
|
|
88
|
+
<itf-dropdown v-if="visibleHeader" ref="newDd" text append-to-context shadow autoclose="outside" class="table-header table-header-add-column" data-test="table-header-add-column">
|
|
89
89
|
<template #button>
|
|
90
90
|
<span class="nom-layout-three-columns"></span>
|
|
91
91
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="itf-money-field" :class="{'currency-arrow': !currencyDisabled, 'currency-select': currencySelect}">
|
|
3
|
-
<div :style="`--itf-money-field-padding-left: ${selectedCurrencySymbol.length * 0.6 + 1}rem`">
|
|
4
|
-
<span class="itf-money-field__prepend">{{ selectedCurrencySymbol }}</span>
|
|
3
|
+
<div :style="`--itf-money-field-padding-left: ${noCurrencySign ? 0 : selectedCurrencySymbol.length * 0.6 + 1}rem`">
|
|
4
|
+
<span class="itf-money-field__prepend" v-if="!noCurrencySign">{{ selectedCurrencySymbol }}</span>
|
|
5
5
|
<i-mask-component
|
|
6
6
|
ref="input"
|
|
7
7
|
v-bind="mask"
|
|
@@ -93,6 +93,7 @@ class itfMoneyField extends Vue {
|
|
|
93
93
|
|
|
94
94
|
@Model('input', { default: '' }) value;
|
|
95
95
|
@Prop({ type: Object, default: null }) currency;
|
|
96
|
+
@Prop({ type: Boolean, default: false }) noCurrencySign;
|
|
96
97
|
@Prop({ type: Boolean, default: false }) disabled;
|
|
97
98
|
@Prop({ type: Boolean, default: true }) currencySelect;
|
|
98
99
|
@Prop({ type: Array, default: () => ([]) }) currencies;
|
package/src/locales/en.js
CHANGED