@itfin/components 1.3.66 → 1.3.68
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
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
:striped="striped"
|
|
40
40
|
:expanded-ids="expandedIds"
|
|
41
41
|
:css-property="cssProperty"
|
|
42
|
+
:editable-property="editableProperty"
|
|
42
43
|
:sorting.sync="_sorting"
|
|
43
44
|
@update:expanded-ids="$emit('update:expanded-ids', $event)"
|
|
44
45
|
@new="$emit('new', $event)"
|
|
@@ -86,6 +87,7 @@ class itfTable2 extends Vue {
|
|
|
86
87
|
@Prop({ type: String, default: null }) idProperty;
|
|
87
88
|
@Prop({ type: String, default: null }) cssProperty;
|
|
88
89
|
@Prop({ type: String, default: null }) subrowsProperty;
|
|
90
|
+
@Prop({ type: String, default: null }) editableProperty;
|
|
89
91
|
@Prop({ default: 45 }) indicatorWidth;
|
|
90
92
|
@Prop({ type: String, default: null, validator: (val) => ['order', 'checkbox', 'toggle', 'property'].includes(val) }) indicatorType;
|
|
91
93
|
@Prop({ type: String, default: null }) stateName; // save state to storage
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
:striped="striped"
|
|
18
18
|
:expanded-all="expandedAll"
|
|
19
19
|
:css-property="cssProperty"
|
|
20
|
+
:editable-property="editableProperty"
|
|
20
21
|
@update:expanded-ids="$emit('update:expanded-ids', $event)"
|
|
21
22
|
@row-click="$emit('row-click', $event)"
|
|
22
23
|
@update="$emit('update', $event)"
|
|
@@ -186,6 +187,7 @@ class itfTableBody extends Vue {
|
|
|
186
187
|
@Prop(Boolean) editable;
|
|
187
188
|
@Prop(Boolean) expandedAll;
|
|
188
189
|
@Prop(Boolean) striped;
|
|
190
|
+
@Prop() editableProperty;
|
|
189
191
|
@Prop() selectedIds;
|
|
190
192
|
@Prop() currency;
|
|
191
193
|
@Prop() currencies;
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
:show-add-column="showAddColumn"
|
|
72
72
|
:expanded-ids="expandedIds"
|
|
73
73
|
:css-property="cssProperty"
|
|
74
|
+
:editable-property="editableProperty"
|
|
74
75
|
@update:expanded-ids="$emit('update:expanded-ids', $event)"
|
|
75
76
|
>
|
|
76
77
|
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
@@ -99,14 +100,14 @@
|
|
|
99
100
|
<div v-if="isShowTable && showSummary" class="table-row-template d-flex align-items-stretch table-summary" :class="{'table-summary-persist': persistSummary}">
|
|
100
101
|
<div class="shadow-area"></div>
|
|
101
102
|
|
|
102
|
-
<div class="table-summary-columns d-flex tw-flex-row align-items-center">
|
|
103
|
+
<div class="table-summary-columns d-flex tw-flex-row align-items-center w-100 flex-grow-1">
|
|
103
104
|
<span
|
|
104
105
|
v-for="(column, n) in visibleColumns"
|
|
105
106
|
v-if="column.visible !== false"
|
|
106
107
|
:key="n"
|
|
107
108
|
:data-column="n"
|
|
108
|
-
class="position-relative line-overflow"
|
|
109
|
-
:style="`width: ${column.width}px; max-width: ${column.width}px;`">
|
|
109
|
+
class="position-relative line-overflow px-1"
|
|
110
|
+
:style="column.grow ? `min-width: ${column.minWidth}px; flex-grow: 1;` : `width: ${column.width}px; max-width: ${column.width}px;`">
|
|
110
111
|
<itf-dropdown append-to-context text right @open="persistSummary = true" @close="persistSummary = false" autoclose="outside">
|
|
111
112
|
<template #button>
|
|
112
113
|
<span data-test="summary-column" class="invisible-summary d-flex align-items-center justify-content-end flex-auto">
|
|
@@ -114,7 +115,7 @@
|
|
|
114
115
|
{{$t('components.table.calculate')}}
|
|
115
116
|
<itf-icon name="chevron_down" />
|
|
116
117
|
</span>
|
|
117
|
-
<span v-else>
|
|
118
|
+
<span v-else class="text-truncate">
|
|
118
119
|
<span class="summary-text text-uppercase pe-2">{{getCalculateMethodTitle(column.calculate)}}</span>
|
|
119
120
|
<slot :name="`summary.${column.property}`" :value="getCalculateMethodValue(column.calculate, column)" :raw="!column.calculate.includes('count') && !column.calculate.includes('percent')">
|
|
120
121
|
<span>{{getCalculateMethodValue(column.calculate, column)}}</span>
|
|
@@ -344,6 +345,7 @@ class itfTableGroup extends Vue {
|
|
|
344
345
|
@Prop(Boolean) noColumnMenu;
|
|
345
346
|
@Prop(Boolean) noSelectAll;
|
|
346
347
|
@Prop(Boolean) editable;
|
|
348
|
+
@Prop() editableProperty;
|
|
347
349
|
@Prop(Boolean) expandedAll;
|
|
348
350
|
@Prop(Boolean) striped;
|
|
349
351
|
@Prop() indicatorWidth;
|
|
@@ -279,7 +279,7 @@ class itfTableHeader extends Vue {
|
|
|
279
279
|
let newWidth;
|
|
280
280
|
const mouseMoveHandler = (event) => {
|
|
281
281
|
const delta = event.pageX - startX;
|
|
282
|
-
newWidth = Math.max(columnWidth + delta,
|
|
282
|
+
newWidth = Math.max(columnWidth + delta, 50);
|
|
283
283
|
columns.forEach((column) => {
|
|
284
284
|
if (!this.sortedColumns[index].grow) {
|
|
285
285
|
column.style.width = `${newWidth}px`;
|
|
@@ -54,9 +54,10 @@
|
|
|
54
54
|
:class="{'justify-content-end': column.align === 'end', 'sticky': column.pinned, 'last-sticky-column': k === lastPinnedIndex, 'flex-grow-1': column.grow, 'px-2': !(column.editable && editable), 'editable': column.editable && editable}"
|
|
55
55
|
class="table-view-item-value d-flex h-100">
|
|
56
56
|
<slot :name="`column.${column.property}`" :toggle="() => $emit('toggle', item)" :level="level" :editable="column.editable && editable" :item="item" :column="column" :update="(val) => updateValue(item, val, n, column)" :value="getValue(item, column)">
|
|
57
|
-
<template v-if="column.editable && editable">
|
|
57
|
+
<template v-if="column.editable && editable && (!editableProperty || item[editableProperty])">
|
|
58
58
|
<slot :name="`edit.${column.type}`" :level="level" :toggle="() => $emit('toggle', item)" :update="(val) => updateValue(item, val, n, column)" :value="getValue(item, column)" :item="item" :column="column">
|
|
59
59
|
<itf-text-field class="w-100" v-if="column.type === 'text'" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
|
|
60
|
+
<itf-text-field class="w-100" v-if="column.type === 'number'" type="number" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
|
|
60
61
|
<itf-hours-field
|
|
61
62
|
class="w-100"
|
|
62
63
|
placeholder="00h 00m"
|
|
@@ -103,6 +104,8 @@
|
|
|
103
104
|
:expanded-ids="expandedIds"
|
|
104
105
|
:expanded-all="expandedAll"
|
|
105
106
|
:css-property="cssProperty"
|
|
107
|
+
:editable-property="editableProperty"
|
|
108
|
+
@update="$emit('update', $event)"
|
|
106
109
|
@toggle="$emit('toggle', $event)"
|
|
107
110
|
>
|
|
108
111
|
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
@@ -153,6 +156,7 @@ class itfTableRows extends Vue {
|
|
|
153
156
|
@Prop(Boolean) editable;
|
|
154
157
|
@Prop(Boolean) expandedAll;
|
|
155
158
|
@Prop(Boolean) striped;
|
|
159
|
+
@Prop() editableProperty;
|
|
156
160
|
@Prop() selectedIds;
|
|
157
161
|
@Prop() expandedIds;
|
|
158
162
|
@Prop() currency;
|
|
@@ -180,6 +184,7 @@ class itfTableRows extends Vue {
|
|
|
180
184
|
this.$emit('update', {
|
|
181
185
|
index,
|
|
182
186
|
item,
|
|
187
|
+
inputValue: value,
|
|
183
188
|
value: newItem,
|
|
184
189
|
column
|
|
185
190
|
});
|