@itfin/components 2.0.39 → 2.0.40
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
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
<svg width="24" height="24" viewBox="
|
|
2
|
-
|
|
1
|
+
<svg width="24" height="24" viewBox="-2 -2 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_24391_35934)">
|
|
3
|
+
<path d="M8.4 13v-1H2.808v5H17.2v-5h-5.6v1H8.4ZM18 6.111h-4.8V4.556L11.6 3H8.4L6.8 4.556V6.11H2V11h6.4v-1h3.2v1H18V6.111Zm-6.4 0H8.4V4.556h3.2V6.11Z"
|
|
4
|
+
fill="currentColor"></path>
|
|
5
|
+
</g>
|
|
3
6
|
</svg>
|
|
@@ -36,34 +36,34 @@
|
|
|
36
36
|
:class="{'justify-content-end': column.align === 'end', 'sticky': column.pinned, 'last-sticky-column': k === lastPinnedIndex, 'editable': column.editable && editable}"
|
|
37
37
|
class="table-view-item-value d-flex h-100">
|
|
38
38
|
<div class="table-view-item-value-content" :class="{'px-2': !(column.editable && editable)}">
|
|
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
|
-
|
|
39
|
+
<slot
|
|
40
|
+
:name="`column.${column.property}`"
|
|
41
|
+
:toggle="() => $emit('toggle', item)"
|
|
42
|
+
:hasSubitems="!!(subrowsProperty && item[subrowsProperty] && item[subrowsProperty].length)"
|
|
43
|
+
:isExpanded="!!(item[subrowsProperty] && item[subrowsProperty].length && !isExpanded(item))"
|
|
44
|
+
:level="level" :editable="column.editable && editable" :item="item" :column="column" :updateFields="(val) => updateValues(item, val, n, column)" :update="(val) => updateValue(item, val, n, column)" :value="getValue(item, column)">
|
|
45
|
+
<template v-if="column.editable && editable && (!editableProperty || item[editableProperty])">
|
|
46
|
+
<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">
|
|
47
|
+
<itf-text-field class="w-100 h-100" v-if="column.type === 'text'" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
|
|
48
|
+
<itf-text-field class="w-100 h-100" v-if="column.type === 'number'" type="number" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
|
|
49
|
+
<itf-hours-field
|
|
50
|
+
class="w-100 h-100"
|
|
51
|
+
placeholder="00h 00m"
|
|
52
|
+
v-else-if="column.type === 'time'"
|
|
53
|
+
:hours="getValue(item, column)"
|
|
54
|
+
@update:hours="updateValue(item, $event, n, column)"
|
|
55
|
+
/>
|
|
56
|
+
<itf-textarea class="w-100 h-100" :rows="1" autogrow v-else-if="column.type === 'textarea'" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
|
|
57
|
+
<itf-money-field class="w-100 h-100" currency-disabled :currency="currency" :currencies="currencies" v-else-if="column.type === 'money'" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
|
|
58
|
+
<itf-select class="w-100 h-100" v-else-if="column.type === 'select'" :reduce="(item) => item.value" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" :options="column.options"></itf-select>
|
|
59
|
+
</slot>
|
|
60
|
+
</template>
|
|
61
|
+
<div v-else class="h-100 align-items-center d-flex w-100">
|
|
62
|
+
<slot :name="`format.${column.type}`" :toggle="() => $emit('toggle', item)" :level="level" :value="getValue(item, column)" :update="(value) => updateValue(item, value, n, column)" :item="item" :column="column">
|
|
63
|
+
{{getValue(item, column)}}
|
|
64
|
+
</slot>
|
|
65
|
+
</div>
|
|
66
|
+
</slot>
|
|
67
67
|
</div>
|
|
68
68
|
</div>
|
|
69
69
|
</template>
|
|
@@ -188,6 +188,18 @@ class itfTableRows extends Vue {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
updateValues(item, values, index, column) {
|
|
192
|
+
const newItem = { ...item };
|
|
193
|
+
Object.assign(newItem, values);
|
|
194
|
+
this.$emit('update', {
|
|
195
|
+
index,
|
|
196
|
+
item,
|
|
197
|
+
inputValue: values,
|
|
198
|
+
value: newItem,
|
|
199
|
+
column
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
191
203
|
isActive(id) {
|
|
192
204
|
if (!this.idProperty) {
|
|
193
205
|
return false;
|