@appscode/design-system 1.1.0-beta.56 → 1.1.0-beta.58
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/vue-components/types/table.ts +1 -0
- package/vue-components/v3/cards/OverviewCard.vue +2 -1
- package/vue-components/v3/cards/OverviewCards.vue +1 -1
- package/vue-components/v3/loaders/InfoCardLoader.vue +1 -1
- package/vue-components/v3/table/Table.vue +31 -5
- package/vue-components/v3/table/table-cell/ArrayCell.vue +2 -2
- package/vue-components/v3/table/table-cell/CellValue.vue +1 -1
- package/vue-components/v3/table/table-cell/ObjectCell.vue +3 -3
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
primaryColor="#f5f5f5"
|
|
14
14
|
secondaryColor="#ecebeb"
|
|
15
15
|
>
|
|
16
|
-
<rect x="0" y="0" rx="0" ry="0"
|
|
16
|
+
<rect x="0" y="0" rx="0" ry="0" />
|
|
17
17
|
<rect x="10" y="70" rx="3" ry="3" width="120" height="11" />
|
|
18
18
|
<rect x="10" y="100" rx="3" ry="3" width="120" height="11" />
|
|
19
19
|
<rect x="150" y="100" rx="3" ry="3" width="60" height="11" />
|
|
@@ -77,6 +77,9 @@ const handleScroller = (value: number) => {
|
|
|
77
77
|
emit("scroller", value);
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
+
const headerWidths = ref<number[]>([]);
|
|
81
|
+
const totalWidth = ref<number>(0);
|
|
82
|
+
|
|
80
83
|
const onWindowResize = () => {
|
|
81
84
|
if (ac_table.value && props.isDynamicWidthTable) {
|
|
82
85
|
const tableWidth = ac_table.value.clientWidth;
|
|
@@ -108,6 +111,26 @@ const emitSortEvent = (index: number) => {
|
|
|
108
111
|
watch(
|
|
109
112
|
() => props.tableHeaders,
|
|
110
113
|
(n) => {
|
|
114
|
+
// calculated column width based on percentages
|
|
115
|
+
headerWidths.value = n.map((th) => th.width || 1);
|
|
116
|
+
totalWidth.value = headerWidths.value.reduce((p, c) => p + c, 0);
|
|
117
|
+
let collapsibleWidth = 0;
|
|
118
|
+
let actionsWidth = 0;
|
|
119
|
+
const collapsibleWidthPercent = 70 / (ac_table.value?.clientWidth || 0);
|
|
120
|
+
const actionsWidthPercent = 140 / (ac_table.value?.clientWidth || 0);
|
|
121
|
+
if (props.collapsible) {
|
|
122
|
+
collapsibleWidth =
|
|
123
|
+
(totalWidth.value * collapsibleWidthPercent) /
|
|
124
|
+
(1 - collapsibleWidthPercent);
|
|
125
|
+
headerWidths.value = [collapsibleWidth, ...headerWidths.value];
|
|
126
|
+
}
|
|
127
|
+
if (props.actionable) {
|
|
128
|
+
actionsWidth =
|
|
129
|
+
(totalWidth.value * actionsWidthPercent) / (1 - actionsWidthPercent);
|
|
130
|
+
headerWidths.value = [...headerWidths.value, actionsWidth];
|
|
131
|
+
}
|
|
132
|
+
totalWidth.value += collapsibleWidth + actionsWidth;
|
|
133
|
+
|
|
111
134
|
if (headerSortables.value.length === n.length) {
|
|
112
135
|
n.forEach((th, idx) => {
|
|
113
136
|
if (headerSortables.value[idx].enabled !== !!th?.sort?.enable) {
|
|
@@ -156,6 +179,13 @@ onUpdated(() => {
|
|
|
156
179
|
// 'is-bordered': columnStriped,
|
|
157
180
|
}"
|
|
158
181
|
>
|
|
182
|
+
<colgroup>
|
|
183
|
+
<col
|
|
184
|
+
v-for="(hw, idx) in headerWidths"
|
|
185
|
+
:key="`${hw}-${idx}`"
|
|
186
|
+
:width="`${(hw / totalWidth) * 100}%`"
|
|
187
|
+
/>
|
|
188
|
+
</colgroup>
|
|
159
189
|
<thead>
|
|
160
190
|
<table-row v-if="isFullTableLoaderActive">
|
|
161
191
|
<th v-for="i in loaderCols" :key="i">
|
|
@@ -199,11 +229,7 @@ onUpdated(() => {
|
|
|
199
229
|
<i class="fa fa-exclamation-triangle" />
|
|
200
230
|
</span>
|
|
201
231
|
</th>
|
|
202
|
-
<th
|
|
203
|
-
ref="action-section"
|
|
204
|
-
v-if="actionable"
|
|
205
|
-
style="min-width: 100px"
|
|
206
|
-
></th>
|
|
232
|
+
<th ref="action-section" v-if="actionable"></th>
|
|
207
233
|
<fake-table-cell
|
|
208
234
|
v-if="fakeCellWidth > 0"
|
|
209
235
|
:is-header-cell="true"
|
|
@@ -53,8 +53,8 @@ const indexOfCharacterLengthExceed = computed(() => {
|
|
|
53
53
|
let idx = -1;
|
|
54
54
|
let cumulativeLen = 0;
|
|
55
55
|
for (const [index, po] of printableStringObjs.value.entries()) {
|
|
56
|
-
const newLen = cumulativeLen + po.print.length;
|
|
57
|
-
if (newLen > props.maxCharacterLength) {
|
|
56
|
+
const newLen = cumulativeLen + po.print.length + 2;
|
|
57
|
+
if (newLen + 2 > props.maxCharacterLength) {
|
|
58
58
|
idx = index;
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
@@ -48,8 +48,8 @@ const indexOfCharacterLengthExceed = computed(() => {
|
|
|
48
48
|
let idx = -1;
|
|
49
49
|
let cumulativeLen = 0;
|
|
50
50
|
for (const [index, po] of printableStringObjs.value.entries()) {
|
|
51
|
-
const newLen = cumulativeLen + po.print.length;
|
|
52
|
-
if (newLen > props.maxCharacterLength) {
|
|
51
|
+
const newLen = cumulativeLen + po.print.length + 2;
|
|
52
|
+
if (newLen + 2 > props.maxCharacterLength) {
|
|
53
53
|
idx = index;
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
@@ -68,7 +68,7 @@ const indexOfCharacterLengthExceed = computed(() => {
|
|
|
68
68
|
indexOfCharacterLengthExceed
|
|
69
69
|
)"
|
|
70
70
|
:key="printableStringOb.key"
|
|
71
|
-
modifierClasses="is-
|
|
71
|
+
modifierClasses="is-primary is-light"
|
|
72
72
|
>
|
|
73
73
|
<value-with-modal
|
|
74
74
|
v-if="printableStringOb.exceededLength"
|