qidian-vue-ui 2.8.18 → 2.8.19
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.
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
.qd-service-table[data-v-
|
|
1
|
+
.qd-service-table[data-v-fa406722] {
|
|
2
2
|
height: 100%;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
}
|
|
6
|
-
.qd-service-table[data-v-
|
|
6
|
+
.qd-service-table[data-v-fa406722] > .t-table__content {
|
|
7
7
|
flex: 1;
|
|
8
8
|
}
|
|
9
|
-
.qd-service-table--mini[data-v-
|
|
9
|
+
.qd-service-table--mini[data-v-fa406722] {
|
|
10
10
|
font: var(--td-font-body-small);
|
|
11
11
|
}
|
|
12
|
-
.qd-service-table--mini[data-v-
|
|
13
|
-
.qd-service-table--mini[data-v-
|
|
12
|
+
.qd-service-table--mini[data-v-fa406722] th,
|
|
13
|
+
.qd-service-table--mini[data-v-fa406722] tr:not(.t-table__expanded-row) > td {
|
|
14
14
|
padding: var(--td-comp-paddingTB-xxs) var(--td-comp-paddingLR-xxs);
|
|
15
15
|
line-height: var(--td-line-height-body-small);
|
|
16
16
|
}
|
|
17
|
-
.qd-service-table--mini[data-v-
|
|
17
|
+
.qd-service-table--mini[data-v-fa406722] .t-table__row-full-element {
|
|
18
18
|
padding: var(--td-comp-paddingTB-xs) var(--td-comp-paddingLR-s);
|
|
19
19
|
}
|
|
20
|
-
.qd-service-table--hide-empty-image[data-v-
|
|
20
|
+
.qd-service-table--hide-empty-image[data-v-fa406722] .t-table__empty {
|
|
21
21
|
min-height: auto;
|
|
22
22
|
}
|
|
23
|
-
.qd-service-table--hide-empty-image[data-v-
|
|
23
|
+
.qd-service-table--hide-empty-image[data-v-fa406722] .t-table__empty .t-empty {
|
|
24
24
|
padding: 0 !important;
|
|
25
25
|
}
|
|
26
|
-
.qd-service-table--hide-empty-image[data-v-
|
|
26
|
+
.qd-service-table--hide-empty-image[data-v-fa406722] .t-table__empty .t-empty__image {
|
|
27
27
|
display: none;
|
|
28
28
|
}
|
|
29
|
-
.qd-service-table--hide-empty-image[data-v-
|
|
29
|
+
.qd-service-table--hide-empty-image[data-v-fa406722] .t-table__empty .t-empty__title {
|
|
30
30
|
margin-top: 0;
|
|
31
31
|
}
|
|
32
|
-
.qd-service-table[data-v-
|
|
33
|
-
.qd-service-table[data-v-
|
|
32
|
+
.qd-service-table[data-v-fa406722] .t-table__tree-col,
|
|
33
|
+
.qd-service-table[data-v-fa406722] .t-table__tree-leaf-node {
|
|
34
34
|
padding-left: 0 !important;
|
|
35
35
|
}
|
|
36
|
-
.qd-service-table[data-v-
|
|
36
|
+
.qd-service-table[data-v-fa406722] .t-table__tree-col:not(:has(.t-table__tree-op-icon)) {
|
|
37
37
|
margin-left: calc(var(--td-font-size-body-large) + var(--td-tree-indent, 0px) * (var(--td-tree-level, 0) + 1));
|
|
38
38
|
}
|
|
39
|
-
.qd-service-table[data-v-
|
|
39
|
+
.qd-service-table[data-v-fa406722] .t-table__tree-op-icon {
|
|
40
40
|
margin-right: calc(var(--td-tree-indent, 0px) * (var(--td-tree-level, 0) + 1));
|
|
41
41
|
}
|
|
42
|
-
.qd-service-table[data-v-
|
|
42
|
+
.qd-service-table[data-v-fa406722] .t-table__tree-leaf-node .t-table__tree-op-icon:empty {
|
|
43
43
|
width: var(--td-font-size-body-large);
|
|
44
44
|
margin-right: calc(var(--td-tree-indent, 0px) * (var(--td-tree-level, 0) + 1));
|
|
45
45
|
}
|
|
46
|
-
.qd-service-table[data-v-
|
|
47
|
-
.qd-service-table[data-v-
|
|
48
|
-
transform: var(--
|
|
46
|
+
.qd-service-table[data-v-fa406722] .t-affix > .t-table__affixed-header-elm-wrap,
|
|
47
|
+
.qd-service-table[data-v-fa406722] .t-affix > .t-table__scrollbar--obvious {
|
|
48
|
+
transform: var(--c18313c4);
|
|
49
49
|
}
|
|
50
|
-
.qd-service-table--horizontal-bar-static[data-v-
|
|
50
|
+
.qd-service-table--horizontal-bar-static[data-v-fa406722] .t-table__scrollbar--obvious {
|
|
51
51
|
visibility: hidden;
|
|
52
52
|
pointer-events: none;
|
|
53
53
|
}
|
|
54
|
-
.qd-service-table--horizontal-bar-static[data-v-
|
|
54
|
+
.qd-service-table--horizontal-bar-static[data-v-fa406722] > div:has(> div > .t-table__scrollbar--obvious) {
|
|
55
55
|
height: 0;
|
|
56
56
|
margin-top: 0 !important;
|
|
57
57
|
overflow: hidden;
|
|
58
58
|
}
|
|
59
|
-
.qd-service-table[data-v-
|
|
59
|
+
.qd-service-table[data-v-fa406722] .t-table__expanded-row .qd-service-table--horizontal-bar-static > div:has(> div > .t-table__scrollbar--obvious) {
|
|
60
60
|
display: none;
|
|
61
61
|
}
|
|
62
|
-
.qd-service-table[data-v-
|
|
62
|
+
.qd-service-table[data-v-fa406722] .t-table__expanded-row > td {
|
|
63
63
|
height: 0;
|
|
64
64
|
}
|
|
65
|
-
.qd-service-table[data-v-
|
|
65
|
+
.qd-service-table[data-v-fa406722] .t-table__affixed-header-elm-wrap {
|
|
66
66
|
height: auto !important;
|
|
67
67
|
}
|
|
68
|
-
.qd-service-table[data-v-
|
|
68
|
+
.qd-service-table[data-v-fa406722] .t-table__affixed-header-elm {
|
|
69
69
|
position: relative;
|
|
70
70
|
scrollbar-width: none;
|
|
71
71
|
}
|
|
72
|
-
.qd-service-table[data-v-
|
|
72
|
+
.qd-service-table[data-v-fa406722] .t-table__affixed-header-elm::-webkit-scrollbar {
|
|
73
73
|
display: none;
|
|
74
74
|
width: 0;
|
|
75
75
|
height: 0;
|
|
76
76
|
}
|
|
77
|
-
.qd-service-table[data-v-
|
|
77
|
+
.qd-service-table[data-v-fa406722] .t-table__virtual-scroll-cursor + table {
|
|
78
78
|
border-collapse: separate;
|
|
79
79
|
}
|
|
80
|
-
.qd-service-table[data-v-
|
|
81
|
-
.qd-service-table[data-v-
|
|
80
|
+
.qd-service-table[data-v-fa406722] .t-table__expanded-row-inner,
|
|
81
|
+
.qd-service-table[data-v-fa406722] .t-table__row-filter-inner {
|
|
82
82
|
display: block;
|
|
83
83
|
position: sticky;
|
|
84
84
|
left: 0;
|
|
85
|
-
width: var(--
|
|
85
|
+
width: var(--v67ff1b93) !important;
|
|
86
86
|
}
|
|
87
|
-
.qd-service-table[data-v-
|
|
87
|
+
.qd-service-table[data-v-fa406722] .t-table__cell-wrap > .t-form__controls > .t-form__controls-content > *:not(.t-switch):not(.t-tag):not(.t-icon):not(.qd-file-icon) {
|
|
88
88
|
width: 100%;
|
|
89
89
|
}
|
|
90
|
-
.qd-service-table[data-v-
|
|
90
|
+
.qd-service-table[data-v-fa406722] .qd-service-table__non-editable-col {
|
|
91
91
|
background-color: color-mix(in srgb, var(--td-bg-color-component) 50%, transparent);
|
|
92
92
|
}
|
|
93
|
-
.qd-service-table[data-v-
|
|
93
|
+
.qd-service-table[data-v-fa406722] td.qd-service-table__selected-cell {
|
|
94
94
|
box-shadow: inset 0 1px 0 0 var(--qst-sel-t, transparent), inset 0 -1px 0 0 var(--qst-sel-b, transparent), inset 1px 0 0 0 var(--qst-sel-l, transparent), inset -1px 0 0 0 var(--qst-sel-r, transparent);
|
|
95
95
|
}
|
|
96
|
-
.qd-service-table[data-v-
|
|
96
|
+
.qd-service-table[data-v-fa406722] .qd-service-table__selected-bt {
|
|
97
97
|
--qst-sel-t: var(--td-brand-color);
|
|
98
98
|
}
|
|
99
|
-
.qd-service-table[data-v-
|
|
99
|
+
.qd-service-table[data-v-fa406722] .qd-service-table__selected-bb {
|
|
100
100
|
--qst-sel-b: var(--td-brand-color);
|
|
101
101
|
}
|
|
102
|
-
.qd-service-table[data-v-
|
|
102
|
+
.qd-service-table[data-v-fa406722] .qd-service-table__selected-bl {
|
|
103
103
|
--qst-sel-l: var(--td-brand-color);
|
|
104
104
|
}
|
|
105
|
-
.qd-service-table[data-v-
|
|
105
|
+
.qd-service-table[data-v-fa406722] .qd-service-table__selected-br {
|
|
106
106
|
--qst-sel-r: var(--td-brand-color);
|
|
107
107
|
}
|
|
108
|
-
.qd-service-table[data-v-
|
|
108
|
+
.qd-service-table[data-v-fa406722] td.qd-service-table__copied-cell {
|
|
109
109
|
background-image: var(--qst-copy-t, none), var(--qst-copy-b, none), var(--qst-copy-l, none), var(--qst-copy-r, none);
|
|
110
110
|
background-size: 8px 1px,
|
|
111
111
|
8px 1px,
|
|
@@ -116,134 +116,131 @@
|
|
|
116
116
|
0 0,
|
|
117
117
|
100% 0;
|
|
118
118
|
background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
|
|
119
|
-
animation: qst-cell-ants-
|
|
119
|
+
animation: qst-cell-ants-fa406722 0.5s linear infinite;
|
|
120
120
|
}
|
|
121
|
-
.qd-service-table[data-v-
|
|
121
|
+
.qd-service-table[data-v-fa406722] td.qd-service-table__copied-cell.qd-service-table__selected-cell {
|
|
122
122
|
background-size: 8px 2px,
|
|
123
123
|
8px 2px,
|
|
124
124
|
2px 8px,
|
|
125
125
|
2px 8px;
|
|
126
126
|
}
|
|
127
|
-
.qd-service-table[data-v-
|
|
127
|
+
.qd-service-table[data-v-fa406722] .qd-service-table__copied-bt {
|
|
128
128
|
--qst-copy-t: linear-gradient(90deg, var(--td-brand-color-hover) 50%, transparent 0);
|
|
129
129
|
}
|
|
130
|
-
.qd-service-table[data-v-
|
|
130
|
+
.qd-service-table[data-v-fa406722] .qd-service-table__copied-bb {
|
|
131
131
|
--qst-copy-b: linear-gradient(90deg, var(--td-brand-color-hover) 50%, transparent 0);
|
|
132
132
|
}
|
|
133
|
-
.qd-service-table[data-v-
|
|
133
|
+
.qd-service-table[data-v-fa406722] .qd-service-table__copied-bl {
|
|
134
134
|
--qst-copy-l: linear-gradient(0deg, var(--td-brand-color-hover) 50%, transparent 0);
|
|
135
135
|
}
|
|
136
|
-
.qd-service-table[data-v-
|
|
136
|
+
.qd-service-table[data-v-fa406722] .qd-service-table__copied-br {
|
|
137
137
|
--qst-copy-r: linear-gradient(0deg, var(--td-brand-color-hover) 50%, transparent 0);
|
|
138
138
|
}
|
|
139
|
-
.qd-service-table[data-v-
|
|
139
|
+
.qd-service-table[data-v-fa406722] tbody > tr.t-table__row--active {
|
|
140
140
|
background-color: var(--td-brand-color-light);
|
|
141
141
|
}
|
|
142
|
-
.qd-service-table[data-v-
|
|
143
|
-
.qd-service-table[data-v-
|
|
142
|
+
.qd-service-table[data-v-fa406722] tbody > tr.t-table__row--active.t-table__row--hover,
|
|
143
|
+
.qd-service-table[data-v-fa406722] tbody > tr.t-table__row--active:hover {
|
|
144
144
|
background-color: var(--td-brand-color-light-hover);
|
|
145
145
|
}
|
|
146
|
-
.qd-service-table[data-v-
|
|
146
|
+
.qd-service-table[data-v-fa406722] .qd-service-table__non-editable-col:not(.qd-service-table__copied-cell):is(
|
|
147
147
|
.t-table__cell--fixed-left,
|
|
148
148
|
.t-table__cell--fixed-right
|
|
149
149
|
) {
|
|
150
150
|
background-color: inherit;
|
|
151
151
|
background-image: linear-gradient(color-mix(in srgb, var(--td-bg-color-secondarycontainer) 50%, transparent), color-mix(in srgb, var(--td-bg-color-secondarycontainer) 50%, transparent));
|
|
152
152
|
}
|
|
153
|
-
.qd-service-table--
|
|
154
|
-
width: auto !important;
|
|
155
|
-
}
|
|
156
|
-
.qd-service-table--cell-drag-selecting[data-v-77c8b27e] {
|
|
153
|
+
.qd-service-table--cell-drag-selecting[data-v-fa406722] {
|
|
157
154
|
cursor: crosshair;
|
|
158
155
|
}
|
|
159
|
-
.qd-service-table--cell-drag-selecting[data-v-
|
|
156
|
+
.qd-service-table--cell-drag-selecting[data-v-fa406722] td {
|
|
160
157
|
cursor: crosshair;
|
|
161
158
|
}
|
|
162
|
-
.qd-service-table[data-v-
|
|
159
|
+
.qd-service-table[data-v-fa406722] .t-table__filter-pop-content-inner {
|
|
163
160
|
padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-s) 0;
|
|
164
161
|
}
|
|
165
|
-
.qd-service-table[data-v-
|
|
162
|
+
.qd-service-table[data-v-fa406722] .t-table__filter-pop-content-inner:has(.qd-service-table-filter-item) {
|
|
166
163
|
padding: 0;
|
|
167
164
|
}
|
|
168
|
-
.qd-service-table[data-v-
|
|
165
|
+
.qd-service-table[data-v-fa406722] .t-table__filter-pop-content-inner:has(
|
|
169
166
|
.qd-service-table-filter-input,
|
|
170
167
|
.qd-service-table-filter-custom
|
|
171
168
|
) {
|
|
172
169
|
padding-bottom: var(--td-comp-paddingTB-s);
|
|
173
170
|
}
|
|
174
|
-
.qd-service-table[data-v-
|
|
171
|
+
.qd-service-table[data-v-fa406722] .t-table__filter--bottom-buttons {
|
|
175
172
|
padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-s);
|
|
176
173
|
}
|
|
177
|
-
.qd-service-table--mini[data-v-
|
|
174
|
+
.qd-service-table--mini[data-v-fa406722] .t-table__filter-pop-content-inner {
|
|
178
175
|
padding: var(--td-comp-paddingTB-xs) var(--td-comp-paddingLR-xs) 0;
|
|
179
176
|
}
|
|
180
|
-
.qd-service-table--mini[data-v-
|
|
177
|
+
.qd-service-table--mini[data-v-fa406722] .t-table__filter--bottom-buttons {
|
|
181
178
|
padding: var(--td-comp-paddingTB-xs) var(--td-comp-paddingLR-xs);
|
|
182
179
|
}
|
|
183
|
-
.qd-service-table--mini[data-v-
|
|
180
|
+
.qd-service-table--mini[data-v-fa406722] .t-table__filter-pop-content-inner:has(.qd-service-table-filter-item) {
|
|
184
181
|
padding: 0;
|
|
185
182
|
}
|
|
186
|
-
.qd-service-table--mini[data-v-
|
|
183
|
+
.qd-service-table--mini[data-v-fa406722] .t-table__filter-pop-content-inner:has(
|
|
187
184
|
.qd-service-table-filter-input,
|
|
188
185
|
.qd-service-table-filter-custom
|
|
189
186
|
) {
|
|
190
187
|
padding-bottom: var(--td-comp-paddingTB-xs);
|
|
191
188
|
}
|
|
192
|
-
.qd-service-table[data-v-
|
|
189
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item {
|
|
193
190
|
width: 266px;
|
|
194
191
|
}
|
|
195
|
-
.qd-service-table[data-v-
|
|
196
|
-
.qd-service-table[data-v-
|
|
197
|
-
.qd-service-table[data-v-
|
|
192
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item__search,
|
|
193
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item__all,
|
|
194
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item__options {
|
|
198
195
|
padding: var(--td-comp-paddingTB-s) var(--td-comp-paddingLR-s) 0;
|
|
199
196
|
}
|
|
200
|
-
.qd-service-table[data-v-
|
|
197
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item__all {
|
|
201
198
|
display: flex;
|
|
202
199
|
align-items: center;
|
|
203
200
|
padding: 0 var(--td-comp-paddingLR-s);
|
|
204
201
|
border-bottom: 1px solid var(--td-component-stroke);
|
|
205
202
|
}
|
|
206
|
-
.qd-service-table[data-v-
|
|
203
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item__options {
|
|
207
204
|
display: flex;
|
|
208
205
|
flex-direction: column;
|
|
209
206
|
height: 206px;
|
|
210
207
|
padding: 0 var(--td-comp-paddingLR-s);
|
|
211
208
|
overflow-y: auto;
|
|
212
209
|
}
|
|
213
|
-
.qd-service-table[data-v-
|
|
210
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item__count {
|
|
214
211
|
margin-left: var(--td-comp-margin-xs);
|
|
215
212
|
color: var(--td-text-color-placeholder);
|
|
216
213
|
}
|
|
217
|
-
.qd-service-table[data-v-
|
|
214
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item__cell {
|
|
218
215
|
pointer-events: none;
|
|
219
216
|
}
|
|
220
|
-
.qd-service-table[data-v-
|
|
221
|
-
.qd-service-table[data-v-
|
|
217
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item .t-checkbox,
|
|
218
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item .t-radio {
|
|
222
219
|
display: flex;
|
|
223
220
|
align-items: center;
|
|
224
221
|
}
|
|
225
|
-
.qd-service-table[data-v-
|
|
226
|
-
.qd-service-table[data-v-
|
|
222
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item .t-checkbox__label,
|
|
223
|
+
.qd-service-table[data-v-fa406722] .qd-service-table-filter-item .t-radio__label {
|
|
227
224
|
display: inline-flex;
|
|
228
225
|
flex: 1 1 0;
|
|
229
226
|
align-items: center;
|
|
230
227
|
min-width: 0;
|
|
231
228
|
overflow: hidden;
|
|
232
229
|
}
|
|
233
|
-
.qd-service-table--mini[data-v-
|
|
230
|
+
.qd-service-table--mini[data-v-fa406722] .qd-service-table-filter-item__search {
|
|
234
231
|
padding: var(--td-comp-paddingTB-xs) var(--td-comp-paddingLR-xs) 0;
|
|
235
232
|
}
|
|
236
|
-
.qd-service-table--mini[data-v-
|
|
237
|
-
.qd-service-table--mini[data-v-
|
|
233
|
+
.qd-service-table--mini[data-v-fa406722] .qd-service-table-filter-item__all,
|
|
234
|
+
.qd-service-table--mini[data-v-fa406722] .qd-service-table-filter-item__options {
|
|
238
235
|
padding: 0 var(--td-comp-paddingLR-xs);
|
|
239
236
|
}
|
|
240
|
-
@keyframes qst-cell-ants-
|
|
237
|
+
@keyframes qst-cell-ants-fa406722 {
|
|
241
238
|
to {
|
|
242
239
|
background-position: 8px 0, -8px 100%, 0 -8px, 100% 8px;
|
|
243
240
|
}
|
|
244
241
|
}
|
|
245
242
|
@media (prefers-reduced-motion: reduce) {
|
|
246
|
-
[data-v-
|
|
243
|
+
[data-v-fa406722] td.qd-service-table__copied-cell {
|
|
247
244
|
animation: none;
|
|
248
245
|
}
|
|
249
246
|
}
|
|
@@ -2,7 +2,7 @@ import './index.css'
|
|
|
2
2
|
import _sfc_main from "./index.vue2.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
5
|
-
const QdServiceTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
5
|
+
const QdServiceTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fa406722"]]);
|
|
6
6
|
export {
|
|
7
7
|
QdServiceTable as default
|
|
8
8
|
};
|
|
@@ -364,8 +364,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
364
364
|
emit: __emit
|
|
365
365
|
}) {
|
|
366
366
|
useCssVars((_ctx) => ({
|
|
367
|
-
"
|
|
368
|
-
"
|
|
367
|
+
"c18313c4": affixedHeaderTransform.value,
|
|
368
|
+
"v67ff1b93": expandedRowWidth.value
|
|
369
369
|
}));
|
|
370
370
|
const props = __props;
|
|
371
371
|
const emit = __emit;
|
|
@@ -1025,6 +1025,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1025
1025
|
size: reSize === "mini" ? "small" : reSize,
|
|
1026
1026
|
headerAffixedTop: reHeaderAffixedTop,
|
|
1027
1027
|
horizontalScrollAffixedBottom: reHorizontalScrollAffixedBottom,
|
|
1028
|
+
...props.disableHorizontalScroll ? {
|
|
1029
|
+
tableLayout: "fixed"
|
|
1030
|
+
} : {},
|
|
1028
1031
|
bordered: bordered ?? tableT("bordered") ?? true
|
|
1029
1032
|
},
|
|
1030
1033
|
externalLoad: loading2,
|
|
@@ -1135,20 +1138,63 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1135
1138
|
};
|
|
1136
1139
|
});
|
|
1137
1140
|
}
|
|
1141
|
+
function getLeafColumns(columns) {
|
|
1142
|
+
return columns.flatMap((col) => col.children?.length ? getLeafColumns(col.children) : [col]);
|
|
1143
|
+
}
|
|
1144
|
+
function fitLeafColumns(columns, resolvedColumns, availableWidth, containerWidth) {
|
|
1145
|
+
if (!props.disableHorizontalScroll) return resolvedColumns;
|
|
1146
|
+
const resolvedWidth = getLeafColumns(resolvedColumns).reduce((sum, col) => sum + Math.max(Number(col.width ?? col.minWidth ?? defaultMinWidth), Number(col.minWidth ?? 0)), 0);
|
|
1147
|
+
if (!(resolvedWidth > availableWidth + 1e-6)) return resolvedColumns;
|
|
1148
|
+
const weights = getLeafColumns(columns).map((col) => Number(col.width ?? col.minWidth ?? defaultMinWidth));
|
|
1149
|
+
const total2 = weights.reduce((sum, width) => sum + width, 0);
|
|
1150
|
+
if (!(total2 > 0)) return resolvedColumns;
|
|
1151
|
+
const fitWidth = Math.max(0, availableWidth);
|
|
1152
|
+
const minTotal = defaultMinWidth * weights.length;
|
|
1153
|
+
let widths = weights.map((weight) => weight / total2 * fitWidth);
|
|
1154
|
+
if (fitWidth <= minTotal) {
|
|
1155
|
+
widths = widths.map(() => fitWidth / weights.length);
|
|
1156
|
+
} else if (widths.some((width) => width < defaultMinWidth)) {
|
|
1157
|
+
const surplus = widths.reduce((sum, width) => sum + Math.max(0, width - defaultMinWidth), 0);
|
|
1158
|
+
const retained = (fitWidth - minTotal) / surplus;
|
|
1159
|
+
widths = widths.map((width) => defaultMinWidth + Math.max(0, width - defaultMinWidth) * retained);
|
|
1160
|
+
}
|
|
1161
|
+
const budget = Math.floor(fitWidth * 1e4 / containerWidth);
|
|
1162
|
+
let index = 0;
|
|
1163
|
+
let cumulative = 0;
|
|
1164
|
+
let used = 0;
|
|
1165
|
+
function resizeColumns(items) {
|
|
1166
|
+
return items.map((col) => {
|
|
1167
|
+
if (col.children?.length) return {
|
|
1168
|
+
...col,
|
|
1169
|
+
children: resizeColumns(col.children)
|
|
1170
|
+
};
|
|
1171
|
+
cumulative += widths[index++];
|
|
1172
|
+
const next = fitWidth > 0 ? Math.round(cumulative * budget / fitWidth) : 0;
|
|
1173
|
+
const width = `${((next - used) / 100).toFixed(2)}%`;
|
|
1174
|
+
used = next;
|
|
1175
|
+
return {
|
|
1176
|
+
...col,
|
|
1177
|
+
width,
|
|
1178
|
+
minWidth: void 0
|
|
1179
|
+
};
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
return resizeColumns(columns);
|
|
1183
|
+
}
|
|
1138
1184
|
const autoWidthColumns = computed(() => {
|
|
1139
1185
|
const observedWidth = tableContentWidth.value;
|
|
1140
1186
|
const containerWidth = observedWidth > 0 ? (tableContentEl.value?.clientWidth ?? observedWidth) - 1 : 0;
|
|
1141
1187
|
const columns = solidifyLeafMinWidth(reProps.value.columns);
|
|
1142
1188
|
const noWidthCols = columns.filter((c) => isEmpty(c.width));
|
|
1143
1189
|
const fixedWidth = columns.filter((c) => !isEmpty(c.width)).reduce((sum, c) => sum + Number(c.width), 0);
|
|
1144
|
-
if (containerWidth <= 0
|
|
1190
|
+
if (containerWidth <= 0) return columns;
|
|
1145
1191
|
const expandIconWidth = reProps.value.tableOptions.expandedRow && reProps.value.tableOptions.expandIcon !== false ? 46 : 0;
|
|
1146
1192
|
const availableWidth = containerWidth - expandIconWidth;
|
|
1147
1193
|
const bodyMinWidth = fixedWidth + noWidthCols.reduce((sum, c) => sum + (!isEmpty(c.minWidth) ? Number(c.minWidth) : defaultMinWidth), 0);
|
|
1148
1194
|
const totalFlexWidth = availableWidth - bodyMinWidth;
|
|
1149
1195
|
const allColumnsWidth = noWidthCols.reduce((sum, c) => sum + (!isEmpty(c.minWidth) ? Number(c.minWidth) : defaultMinWidth), 0);
|
|
1150
1196
|
const flexWidthPerPixel = totalFlexWidth > 0 && allColumnsWidth > 0 ? totalFlexWidth / allColumnsWidth : 0;
|
|
1151
|
-
|
|
1197
|
+
const resolvedColumns = columns.map((item) => {
|
|
1152
1198
|
if (!isEmpty(item.width)) return item;
|
|
1153
1199
|
const base = !isEmpty(item.minWidth) ? Number(item.minWidth) : defaultMinWidth;
|
|
1154
1200
|
const width = base + base * flexWidthPerPixel;
|
|
@@ -1157,6 +1203,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1157
1203
|
width
|
|
1158
1204
|
};
|
|
1159
1205
|
});
|
|
1206
|
+
return fitLeafColumns(columns, resolvedColumns, availableWidth, containerWidth);
|
|
1160
1207
|
});
|
|
1161
1208
|
watch([reSort, () => props.columns, () => searchData.value?.orderByColumn, () => searchData.value?.isAsc], syncSearchDataSort, {
|
|
1162
1209
|
immediate: true,
|