bfg-common 1.3.166 → 1.3.167
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.
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
<div class="datagrid-row-master datagrid-row-flex">
|
|
11
11
|
<div class="datagrid-row-scrollable">
|
|
12
12
|
<div
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
v-for="(item, key) in props.headItems"
|
|
14
|
+
:key="key"
|
|
15
|
+
:style="{
|
|
16
16
|
width: columnsWidth[key],
|
|
17
17
|
}"
|
|
18
|
-
|
|
18
|
+
class="datagrid-column datagrid-fixed-width"
|
|
19
19
|
>
|
|
20
20
|
<div class="datagrid-column-flex">
|
|
21
21
|
<div class="datagrid-column-title">
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
</div>
|
|
35
35
|
<template v-if="props.bodyItems.length">
|
|
36
36
|
<div
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
v-for="(item, key) in props.bodyItems"
|
|
38
|
+
:key="key"
|
|
39
|
+
:class="['datagrid-body-row datagrid-row animation']"
|
|
40
40
|
>
|
|
41
41
|
<div>
|
|
42
42
|
<div class="datagrid-row-master datagrid-row-flex">
|
|
43
43
|
<div class="datagrid-row-scrollable">
|
|
44
44
|
<div class="datagrid-scrolling-cells">
|
|
45
45
|
<div
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
v-for="(item2, key2) in item"
|
|
47
|
+
:key="item2"
|
|
48
|
+
class="datagrid-cell datagrid-fixed-width"
|
|
49
|
+
:style="{
|
|
50
50
|
width: `${columnsWidth[key2]}`,
|
|
51
51
|
}"
|
|
52
52
|
>
|
|
@@ -87,14 +87,14 @@
|
|
|
87
87
|
import { UI_I_HeadItem } from '~/components/atoms/table/compact/lib/models/interfaces'
|
|
88
88
|
|
|
89
89
|
const props = withDefaults(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
defineProps<{
|
|
91
|
+
headItems: UI_I_HeadItem[]
|
|
92
|
+
bodyItems: any // don't know what array fields will be
|
|
93
|
+
loading?: boolean
|
|
94
|
+
}>(),
|
|
95
|
+
{
|
|
96
|
+
loading: false,
|
|
97
|
+
}
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
const columnsWidth = ref<string[]>([])
|
|
@@ -110,10 +110,10 @@ const setDataGridWidth = (): void => {
|
|
|
110
110
|
return
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
const emptyWidthCount = props.headItems.filter((item) =>
|
|
113
|
+
const emptyWidthCount = props.headItems.filter((item) => !item.width).length
|
|
114
114
|
const existWidthsSum = props.headItems.reduce((acum, item) => acum += item.width, 0)
|
|
115
|
+
const equalGridWidth = (dataGridWidth - existWidthsSum) / emptyWidthCount
|
|
115
116
|
props.headItems.forEach((item) => {
|
|
116
|
-
const equalGridWidth = (dataGridWidth - existWidthsSum) / emptyWidthCount
|
|
117
117
|
const elementMax = Math.max(equalGridWidth, item.width)
|
|
118
118
|
columnsWidth.value.push(`${elementMax}px`)
|
|
119
119
|
})
|