@sdata/web-vue 1.10.0 → 1.11.1
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/dist/sd.css +148 -952
- package/dist/sd.min.css +1 -1
- package/es/_components/input-label/style/input-label.scss +11 -51
- package/es/_components/select-view/select-view.d.ts +1 -1
- package/es/_components/select-view/style/index.css +0 -84
- package/es/_components/virtual-list/interface.d.ts +10 -1
- package/es/{table/hooks/use-table-virtual-size.d.ts → _components/virtual-list/use-virtual-size.d.ts} +4 -2
- package/es/{table/hooks/use-table-virtual-size.js → _components/virtual-list/use-virtual-size.js} +17 -20
- package/es/_components/virtual-list/virtual-list.js +64 -2
- package/es/_components/virtual-list/virtual-list.vue.d.ts +208 -0
- package/es/_components/virtual-list/virtual-list.vue_vue_type_script_lang.js +277 -5
- package/es/_utils/clipboard.js +2 -1
- package/es/auto-complete/auto-complete.d.ts +1 -1
- package/es/auto-complete/index.d.ts +24 -15
- package/es/auto-complete/style/index.css +0 -16
- package/es/auto-complete/style/index.scss +11 -26
- package/es/badge/style/index.scss +11 -41
- package/es/button/style/index.css +35 -445
- package/es/button/style/index.scss +57 -332
- package/es/card/style/index.scss +18 -52
- package/es/carousel/index.d.ts +1 -0
- package/es/cascader/cascader-panel.vue.d.ts +1 -1
- package/es/cascader/cascader.vue.d.ts +3 -3
- package/es/cascader/index.d.ts +10 -10
- package/es/cascader/interface.d.ts +5 -0
- package/es/color-picker/style/index.scss +17 -99
- package/es/config-provider/config-provider.vue.d.ts +1 -1
- package/es/config-provider/index.d.ts +4 -3
- package/es/date-picker/index.d.ts +21 -14
- package/es/date-picker/panels/date/index.vue.d.ts +1 -1
- package/es/date-picker/panels/week/index.vue.d.ts +7 -7
- package/es/date-picker/picker.vue.d.ts +1 -1
- package/es/date-picker/range-picker.vue.d.ts +1 -1
- package/es/descriptions/descriptions.d.ts +1 -1
- package/es/descriptions/index.d.ts +4 -4
- package/es/descriptions/style/index.scss +18 -63
- package/es/form/style/index.css +12 -176
- package/es/form/style/status.scss +36 -73
- package/es/index.css +148 -952
- package/es/index.d.ts +21 -20
- package/es/input/style/input.scss +14 -66
- package/es/input-number/index.d.ts +5 -0
- package/es/input-tag/style/index.css +0 -84
- package/es/input-tag/style/input-tag.scss +16 -170
- package/es/list/style/index.scss +12 -42
- package/es/menu/index.d.ts +8 -0
- package/es/menu/style/index.css +0 -178
- package/es/menu/style/index.scss +36 -139
- package/es/pagination/index.d.ts +3 -3
- package/es/pagination/interface.d.ts +2 -1
- package/es/pagination/page-options.js +1 -1
- package/es/pagination/page-options.vue.d.ts +72 -71
- package/es/pagination/page-options.vue_vue_type_script_lang.js +6 -0
- package/es/pagination/pagination.d.ts +3 -3
- package/es/pagination/style/index.css +0 -12
- package/es/pagination/style/index.scss +19 -76
- package/es/radio/index.d.ts +3 -0
- package/es/result/style/index.css +0 -16
- package/es/result/style/index.scss +12 -34
- package/es/select/index.d.ts +9 -9
- package/es/select/interface.d.ts +2 -1
- package/es/select/select.d.ts +3 -3
- package/es/slider/index.d.ts +6 -3
- package/es/slider/slider.vue.d.ts +1 -1
- package/es/steps/index.d.ts +2 -0
- package/es/switch/index.d.ts +3 -0
- package/es/table/context.d.ts +1 -1
- package/es/table/hooks/use-column-resize.d.ts +2 -3
- package/es/table/hooks/use-column-resize.js +48 -21
- package/es/table/hooks/use-drag.d.ts +4 -2
- package/es/table/hooks/use-drag.js +16 -2
- package/es/table/index.d.ts +22 -34
- package/es/table/interface.d.ts +21 -2
- package/es/table/style/index.css +97 -21
- package/es/table/style/index.scss +137 -125
- package/es/table/table-operation-td.d.ts +2 -2
- package/es/table/table-operation-td.js +4 -5
- package/es/table/table-operation-th.js +4 -4
- package/es/table/table-tbody.js +1 -1
- package/es/table/table-td.js +5 -6
- package/es/table/table-th.js +25 -24
- package/es/table/table-thead.js +1 -1
- package/es/table/table-tr.js +1 -1
- package/es/table/table.d.ts +12 -16
- package/es/table/table.js +399 -190
- package/es/tabs/index.d.ts +1 -0
- package/es/tabs/style/index.scss +53 -135
- package/es/tag/index.d.ts +3 -3
- package/es/tag/style/index.css +0 -84
- package/es/tag/style/index.scss +19 -146
- package/es/tag/tag.vue.d.ts +1 -1
- package/es/theme-provider/index.d.ts +9 -9
- package/es/time-picker/index.d.ts +1 -0
- package/es/timeline/index.d.ts +1 -0
- package/es/transfer/index.d.ts +1 -0
- package/es/transfer/interface.d.ts +1 -1
- package/es/tree/hooks/use-tree-data.d.ts +17 -29
- package/es/tree/index.d.ts +6 -1
- package/es/tree/interface.d.ts +2 -0
- package/es/tree/tree.js +1 -1
- package/es/tree/tree.vue.d.ts +3561 -13
- package/es/tree/tree.vue_vue_type_script_lang.js +21 -9
- package/es/tree-select/hooks/use-selected-state.js +3 -1
- package/es/tree-select/index.d.ts +3 -0
- package/es/tree-select/tree-select.vue.d.ts +1367 -3
- package/json/vetur-attributes.json +1 -6
- package/json/vetur-tags.json +0 -1
- package/json/web-types.json +7 -11
- package/package.json +1 -1
- package/es/style/theme/legacy-less-var.scss +0 -15
- package/es/table/table-col-group.js +0 -21
- package/es/table/table-col-group.vue_vue_type_script_lang.js +0 -32
- package/es/table/table-legacy-virtual-list.js +0 -47
- package/es/table/table-legacy-virtual-list.vue.d.ts +0 -156
- package/es/table/table-legacy-virtual-list.vue_vue_type_script_lang.js +0 -148
- package/es/table/table-virtual-list-item.d.ts +0 -22
- package/es/table/table-virtual-list-item.js +0 -37
|
@@ -1,60 +1,20 @@
|
|
|
1
1
|
@use 'sass:math';
|
|
2
2
|
@use 'sass:string';
|
|
3
3
|
@use 'sass:map';
|
|
4
|
-
@use '
|
|
4
|
+
@use 'sass:meta';
|
|
5
5
|
@use '@style/mixins/index.scss' as *;
|
|
6
|
+
@use '@components/input/style/token.scss' as inputToken;
|
|
6
7
|
@use '@components/input/style/token.scss' as *;
|
|
7
8
|
@use '@components/input/style/input.scss' as *;
|
|
8
9
|
|
|
9
|
-
$
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'input-color-bg_error_hover': $input-color-bg_error_hover,
|
|
18
|
-
'input-color-bg_focus': $input-color-bg_focus,
|
|
19
|
-
'input-color-bg_hover': $input-color-bg_hover,
|
|
20
|
-
'input-color-border': $input-color-border,
|
|
21
|
-
'input-color-border_disabled': $input-color-border_disabled,
|
|
22
|
-
'input-color-border_error': $input-color-border_error,
|
|
23
|
-
'input-color-border_error_focus': $input-color-border_error_focus,
|
|
24
|
-
'input-color-border_error_hover': $input-color-border_error_hover,
|
|
25
|
-
'input-color-border_focus': $input-color-border_focus,
|
|
26
|
-
'input-color-border_hover': $input-color-border_hover,
|
|
27
|
-
'input-color-icon-clear-bg_hover': $input-color-icon-clear-bg_hover,
|
|
28
|
-
'input-color-shadow_error_focus': $input-color-shadow_error_focus,
|
|
29
|
-
'input-color-shadow_focus': $input-color-shadow_focus,
|
|
30
|
-
'input-color-text': $input-color-text,
|
|
31
|
-
'input-color-text_disabled': $input-color-text_disabled,
|
|
32
|
-
'input-feedback-icon-color_error': $input-feedback-icon-color_error,
|
|
33
|
-
'input-feedback-icon-color_success': $input-feedback-icon-color_success,
|
|
34
|
-
'input-feedback-icon-color_validating': $input-feedback-icon-color_validating,
|
|
35
|
-
'input-feedback-icon-color_warning': $input-feedback-icon-color_warning,
|
|
36
|
-
'input-group-border-radius_compact': $input-group-border-radius_compact,
|
|
37
|
-
'input-size-default-height': $input-size-default-height,
|
|
38
|
-
'input-size-default-font-size': $input-size-default-font-size,
|
|
39
|
-
'input-size-default-line-height': $input-size-medium-line-height,
|
|
40
|
-
'input-size-large-height': $input-size-large-height,
|
|
41
|
-
'input-size-large-font-size': $input-size-large-font-size,
|
|
42
|
-
'input-size-large-line-height': $input-size-large-line-height,
|
|
43
|
-
'input-size-medium-height': $input-size-medium-height,
|
|
44
|
-
'input-size-medium-font-size': $input-size-medium-font-size,
|
|
45
|
-
'input-size-medium-line-height': $input-size-medium-line-height,
|
|
46
|
-
'input-size-mini-font-size': $input-size-mini-font-size,
|
|
47
|
-
'input-size-mini-height': $input-size-mini-height,
|
|
48
|
-
'input-size-mini-line-height': $input-size-mini-line-height,
|
|
49
|
-
'input-size-small-height': $input-size-small-height,
|
|
50
|
-
'input-size-small-font-size': $input-size-small-font-size,
|
|
51
|
-
'input-size-small-line-height': $input-size-small-line-height,
|
|
52
|
-
'input-size-shadow_error_focus': $input-size-shadow_error_focus,
|
|
53
|
-
'input-size-shadow_focus': $input-size-shadow_focus,
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
@function less-var($name, $fallback: null) {
|
|
57
|
-
@return legacyLessVar.get($less-vars, $name, $fallback);
|
|
10
|
+
@function token-var($name, $fallback: null) {
|
|
11
|
+
$value: map.get(meta.module-variables('inputToken'), $name);
|
|
12
|
+
|
|
13
|
+
@if $value == null {
|
|
14
|
+
@return $fallback;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@return $value;
|
|
58
18
|
}
|
|
59
19
|
|
|
60
20
|
@mixin input-label-hide-input-element() {
|
|
@@ -74,7 +34,7 @@ $less-vars: (
|
|
|
74
34
|
}
|
|
75
35
|
|
|
76
36
|
&.#{$cls}-size-#{$size} .#{$cls}-value {
|
|
77
|
-
min-height: math.round(
|
|
37
|
+
min-height: math.round(token-var($height) - $input-border-width * 2);
|
|
78
38
|
}
|
|
79
39
|
}
|
|
80
40
|
|
|
@@ -144,8 +144,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
144
144
|
disabled: boolean;
|
|
145
145
|
loading: boolean;
|
|
146
146
|
showArrow: boolean;
|
|
147
|
-
allowClear: boolean;
|
|
148
147
|
multiple: boolean;
|
|
148
|
+
allowClear: boolean;
|
|
149
149
|
bordered: boolean;
|
|
150
150
|
maxTagCount: number | "responsive";
|
|
151
151
|
retainInputValue: boolean;
|
|
@@ -99,13 +99,6 @@
|
|
|
99
99
|
background-color: rgb(var(--red-1));
|
|
100
100
|
border: 1px solid transparent;
|
|
101
101
|
}
|
|
102
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-red .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
103
|
-
background-color: rgb(var(--red-2));
|
|
104
|
-
}
|
|
105
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-red:hover {
|
|
106
|
-
background-color: rgb(var(--red-2));
|
|
107
|
-
border-color: transparent;
|
|
108
|
-
}
|
|
109
102
|
.sd-tag .sd-tag-checked.sd-tag-red.sd-tag-bordered,
|
|
110
103
|
.sd-tag .sd-tag-checked.sd-tag-red.sd-tag-bordered:hover {
|
|
111
104
|
border-color: rgb(var(--red-6));
|
|
@@ -118,13 +111,6 @@
|
|
|
118
111
|
background-color: rgb(var(--orangered-1));
|
|
119
112
|
border: 1px solid transparent;
|
|
120
113
|
}
|
|
121
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-orangered .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
122
|
-
background-color: rgb(var(--orangered-2));
|
|
123
|
-
}
|
|
124
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-orangered:hover {
|
|
125
|
-
background-color: rgb(var(--orangered-2));
|
|
126
|
-
border-color: transparent;
|
|
127
|
-
}
|
|
128
114
|
.sd-tag .sd-tag-checked.sd-tag-orangered.sd-tag-bordered,
|
|
129
115
|
.sd-tag .sd-tag-checked.sd-tag-orangered.sd-tag-bordered:hover {
|
|
130
116
|
border-color: rgb(var(--orangered-6));
|
|
@@ -137,13 +123,6 @@
|
|
|
137
123
|
background-color: rgb(var(--orange-1));
|
|
138
124
|
border: 1px solid transparent;
|
|
139
125
|
}
|
|
140
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-orange .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
141
|
-
background-color: rgb(var(--orange-2));
|
|
142
|
-
}
|
|
143
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-orange:hover {
|
|
144
|
-
background-color: rgb(var(--orange-2));
|
|
145
|
-
border-color: transparent;
|
|
146
|
-
}
|
|
147
126
|
.sd-tag .sd-tag-checked.sd-tag-orange.sd-tag-bordered,
|
|
148
127
|
.sd-tag .sd-tag-checked.sd-tag-orange.sd-tag-bordered:hover {
|
|
149
128
|
border-color: rgb(var(--orange-6));
|
|
@@ -156,13 +135,6 @@
|
|
|
156
135
|
background-color: rgb(var(--gold-1));
|
|
157
136
|
border: 1px solid transparent;
|
|
158
137
|
}
|
|
159
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-gold .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
160
|
-
background-color: rgb(var(--gold-2));
|
|
161
|
-
}
|
|
162
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-gold:hover {
|
|
163
|
-
background-color: rgb(var(--gold-3));
|
|
164
|
-
border-color: transparent;
|
|
165
|
-
}
|
|
166
138
|
.sd-tag .sd-tag-checked.sd-tag-gold.sd-tag-bordered,
|
|
167
139
|
.sd-tag .sd-tag-checked.sd-tag-gold.sd-tag-bordered:hover {
|
|
168
140
|
border-color: rgb(var(--gold-6));
|
|
@@ -175,13 +147,6 @@
|
|
|
175
147
|
background-color: rgb(var(--lime-1));
|
|
176
148
|
border: 1px solid transparent;
|
|
177
149
|
}
|
|
178
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-lime .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
179
|
-
background-color: rgb(var(--lime-2));
|
|
180
|
-
}
|
|
181
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-lime:hover {
|
|
182
|
-
background-color: rgb(var(--lime-2));
|
|
183
|
-
border-color: transparent;
|
|
184
|
-
}
|
|
185
150
|
.sd-tag .sd-tag-checked.sd-tag-lime.sd-tag-bordered,
|
|
186
151
|
.sd-tag .sd-tag-checked.sd-tag-lime.sd-tag-bordered:hover {
|
|
187
152
|
border-color: rgb(var(--lime-6));
|
|
@@ -194,13 +159,6 @@
|
|
|
194
159
|
background-color: rgb(var(--green-1));
|
|
195
160
|
border: 1px solid transparent;
|
|
196
161
|
}
|
|
197
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-green .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
198
|
-
background-color: rgb(var(--green-2));
|
|
199
|
-
}
|
|
200
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-green:hover {
|
|
201
|
-
background-color: rgb(var(--green-2));
|
|
202
|
-
border-color: transparent;
|
|
203
|
-
}
|
|
204
162
|
.sd-tag .sd-tag-checked.sd-tag-green.sd-tag-bordered,
|
|
205
163
|
.sd-tag .sd-tag-checked.sd-tag-green.sd-tag-bordered:hover {
|
|
206
164
|
border-color: rgb(var(--green-6));
|
|
@@ -213,13 +171,6 @@
|
|
|
213
171
|
background-color: rgb(var(--cyan-1));
|
|
214
172
|
border: 1px solid transparent;
|
|
215
173
|
}
|
|
216
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-cyan .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
217
|
-
background-color: rgb(var(--cyan-2));
|
|
218
|
-
}
|
|
219
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-cyan:hover {
|
|
220
|
-
background-color: rgb(var(--cyan-2));
|
|
221
|
-
border-color: transparent;
|
|
222
|
-
}
|
|
223
174
|
.sd-tag .sd-tag-checked.sd-tag-cyan.sd-tag-bordered,
|
|
224
175
|
.sd-tag .sd-tag-checked.sd-tag-cyan.sd-tag-bordered:hover {
|
|
225
176
|
border-color: rgb(var(--cyan-6));
|
|
@@ -232,13 +183,6 @@
|
|
|
232
183
|
background-color: rgb(var(--blue-1));
|
|
233
184
|
border: 1px solid transparent;
|
|
234
185
|
}
|
|
235
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-blue .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
236
|
-
background-color: rgb(var(--blue-2));
|
|
237
|
-
}
|
|
238
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-blue:hover {
|
|
239
|
-
background-color: rgb(var(--blue-2));
|
|
240
|
-
border-color: transparent;
|
|
241
|
-
}
|
|
242
186
|
.sd-tag .sd-tag-checked.sd-tag-blue.sd-tag-bordered,
|
|
243
187
|
.sd-tag .sd-tag-checked.sd-tag-blue.sd-tag-bordered:hover {
|
|
244
188
|
border-color: rgb(var(--blue-6));
|
|
@@ -251,13 +195,6 @@
|
|
|
251
195
|
background-color: rgb(var(--sdblue-1));
|
|
252
196
|
border: 1px solid transparent;
|
|
253
197
|
}
|
|
254
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-sdblue .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
255
|
-
background-color: rgb(var(--sdblue-2));
|
|
256
|
-
}
|
|
257
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-sdblue:hover {
|
|
258
|
-
background-color: rgb(var(--sdblue-2));
|
|
259
|
-
border-color: transparent;
|
|
260
|
-
}
|
|
261
198
|
.sd-tag .sd-tag-checked.sd-tag-sdblue.sd-tag-bordered,
|
|
262
199
|
.sd-tag .sd-tag-checked.sd-tag-sdblue.sd-tag-bordered:hover {
|
|
263
200
|
border-color: rgb(var(--sdblue-6));
|
|
@@ -270,13 +207,6 @@
|
|
|
270
207
|
background-color: rgb(var(--purple-1));
|
|
271
208
|
border: 1px solid transparent;
|
|
272
209
|
}
|
|
273
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-purple .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
274
|
-
background-color: rgb(var(--purple-2));
|
|
275
|
-
}
|
|
276
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-purple:hover {
|
|
277
|
-
background-color: rgb(var(--purple-2));
|
|
278
|
-
border-color: transparent;
|
|
279
|
-
}
|
|
280
210
|
.sd-tag .sd-tag-checked.sd-tag-purple.sd-tag-bordered,
|
|
281
211
|
.sd-tag .sd-tag-checked.sd-tag-purple.sd-tag-bordered:hover {
|
|
282
212
|
border-color: rgb(var(--purple-6));
|
|
@@ -289,13 +219,6 @@
|
|
|
289
219
|
background-color: rgb(var(--pinkpurple-1));
|
|
290
220
|
border: 1px solid transparent;
|
|
291
221
|
}
|
|
292
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-pinkpurple .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
293
|
-
background-color: rgb(var(--pinkpurple-2));
|
|
294
|
-
}
|
|
295
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-pinkpurple:hover {
|
|
296
|
-
background-color: rgb(var(--pinkpurple-2));
|
|
297
|
-
border-color: transparent;
|
|
298
|
-
}
|
|
299
222
|
.sd-tag .sd-tag-checked.sd-tag-pinkpurple.sd-tag-bordered,
|
|
300
223
|
.sd-tag .sd-tag-checked.sd-tag-pinkpurple.sd-tag-bordered:hover {
|
|
301
224
|
border-color: rgb(var(--pinkpurple-6));
|
|
@@ -308,13 +231,6 @@
|
|
|
308
231
|
background-color: rgb(var(--magenta-1));
|
|
309
232
|
border: 1px solid transparent;
|
|
310
233
|
}
|
|
311
|
-
.sd-tag .sd-tag.sd-tag-checked.sd-tag-magenta .sd-icon-hover.sd-tag-icon-hover:hover::before {
|
|
312
|
-
background-color: rgb(var(--magenta-2));
|
|
313
|
-
}
|
|
314
|
-
.sd-tag .sd-tag-checkable.sd-tag-checked.sd-tag-magenta:hover {
|
|
315
|
-
background-color: rgb(var(--magenta-2));
|
|
316
|
-
border-color: transparent;
|
|
317
|
-
}
|
|
318
234
|
.sd-tag .sd-tag-checked.sd-tag-magenta.sd-tag-bordered,
|
|
319
235
|
.sd-tag .sd-tag-checked.sd-tag-magenta.sd-tag-bordered:hover {
|
|
320
236
|
border-color: rgb(var(--magenta-6));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CacheSnapshot, ClassValue, ItemSizeValue, KeyFieldValue, ScrollAlign, ScrollDirection, ScrollToOptions } from 'vue-virtual-scroller';
|
|
2
|
-
import { VNode } from 'vue';
|
|
2
|
+
import type { CSSProperties, VNode } from 'vue';
|
|
3
3
|
import type { ScrollbarProps } from '../../scrollbar';
|
|
4
4
|
export type VirtualItemKey = string | number;
|
|
5
5
|
export interface InternalDataItem {
|
|
@@ -33,6 +33,15 @@ interface VirtualListCommonProps<TItem = unknown> {
|
|
|
33
33
|
hiddenPosition?: number;
|
|
34
34
|
enabled?: boolean;
|
|
35
35
|
scrollbar?: boolean | ScrollbarProps;
|
|
36
|
+
threshold?: number;
|
|
37
|
+
fixedSize?: boolean;
|
|
38
|
+
estimatedSize?: number;
|
|
39
|
+
component?: keyof HTMLElementTagNameMap | Record<string, unknown>;
|
|
40
|
+
listAttrs?: Record<string, unknown>;
|
|
41
|
+
contentWrapperAttrs?: Record<string, unknown>;
|
|
42
|
+
contentAttrs?: Record<string, unknown>;
|
|
43
|
+
listStyle?: CSSProperties;
|
|
44
|
+
paddingPosition?: 'content' | 'list';
|
|
36
45
|
}
|
|
37
46
|
export interface VirtualListRecycleProps<TItem = unknown> extends VirtualListCommonProps<TItem> {
|
|
38
47
|
gridItems?: number;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const useVirtualSize: ({ dataKeys, fixedSize, estimatedSize, overscan, visibleCount, }: {
|
|
3
3
|
dataKeys: Ref<(string | number)[]>;
|
|
4
4
|
fixedSize: Ref<boolean>;
|
|
5
5
|
estimatedSize: Ref<number | undefined>;
|
|
6
|
-
|
|
6
|
+
overscan: Ref<number>;
|
|
7
|
+
visibleCount: Ref<number>;
|
|
7
8
|
}) => {
|
|
8
9
|
frontPadding: import("vue").ComputedRef<number>;
|
|
9
10
|
behindPadding: import("vue").ComputedRef<number>;
|
|
@@ -14,4 +15,5 @@ export declare const useTableVirtualSize: ({ dataKeys, fixedSize, estimatedSize,
|
|
|
14
15
|
hasItemSize: (key: string | number) => boolean;
|
|
15
16
|
setStart: (index: number) => void;
|
|
16
17
|
getScrollOffset: (index: number) => number;
|
|
18
|
+
getItemSize: (index: number) => number;
|
|
17
19
|
};
|
package/es/{table/hooks/use-table-virtual-size.js → _components/virtual-list/use-virtual-size.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, onMounted, ref } from "vue";
|
|
2
|
-
//#region components/
|
|
3
|
-
var
|
|
2
|
+
//#region components/_components/virtual-list/use-virtual-size.ts
|
|
3
|
+
var useVirtualSize = ({ dataKeys, fixedSize, estimatedSize, overscan, visibleCount }) => {
|
|
4
4
|
const firstRangeAverageSize = ref(0);
|
|
5
5
|
const sizeMap = /* @__PURE__ */ new Map();
|
|
6
6
|
const fallbackEstimatedSize = computed(() => {
|
|
@@ -9,13 +9,16 @@ var useTableVirtualSize = ({ dataKeys, fixedSize, estimatedSize, buffer }) => {
|
|
|
9
9
|
});
|
|
10
10
|
const total = computed(() => dataKeys.value.length);
|
|
11
11
|
const start = ref(0);
|
|
12
|
+
const range = computed(() => {
|
|
13
|
+
return Math.max(visibleCount.value + overscan.value * 2, 1);
|
|
14
|
+
});
|
|
12
15
|
const end = computed(() => {
|
|
13
|
-
const nextEnd = start.value +
|
|
16
|
+
const nextEnd = start.value + range.value;
|
|
14
17
|
if (nextEnd > total.value) return total.value;
|
|
15
18
|
return nextEnd;
|
|
16
19
|
});
|
|
17
20
|
const maxStart = computed(() => {
|
|
18
|
-
const max = total.value -
|
|
21
|
+
const max = total.value - range.value;
|
|
19
22
|
if (max < 0) return 0;
|
|
20
23
|
return max;
|
|
21
24
|
});
|
|
@@ -59,21 +62,14 @@ var useTableVirtualSize = ({ dataKeys, fixedSize, estimatedSize, buffer }) => {
|
|
|
59
62
|
if (isFixed.value) return resolvedEstimatedSize.value * start.value;
|
|
60
63
|
return getOffset(0, start.value);
|
|
61
64
|
});
|
|
62
|
-
const getOffsetIndex = (scrollOffset) => {
|
|
63
|
-
const isForward = scrollOffset >= frontPadding.value;
|
|
64
|
-
let offset = Math.abs(scrollOffset - frontPadding.value);
|
|
65
|
-
const baseStart = isForward ? start.value : start.value - 1;
|
|
66
|
-
let offsetIndex = 0;
|
|
67
|
-
while (offset > 0) {
|
|
68
|
-
offset -= getItemSize(baseStart + offsetIndex);
|
|
69
|
-
if (isForward) offsetIndex += 1;
|
|
70
|
-
else offsetIndex -= 1;
|
|
71
|
-
}
|
|
72
|
-
return offsetIndex;
|
|
73
|
-
};
|
|
74
65
|
const getStartByScroll = (scrollOffset) => {
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
let offset = scrollOffset;
|
|
67
|
+
let anchorIndex = 0;
|
|
68
|
+
while (offset > 0 && anchorIndex < total.value) {
|
|
69
|
+
offset -= getItemSize(anchorIndex);
|
|
70
|
+
anchorIndex += 1;
|
|
71
|
+
}
|
|
72
|
+
const nextStart = anchorIndex - overscan.value;
|
|
77
73
|
if (nextStart < 0) return 0;
|
|
78
74
|
if (nextStart > maxStart.value) return maxStart.value;
|
|
79
75
|
return nextStart;
|
|
@@ -90,8 +86,9 @@ var useTableVirtualSize = ({ dataKeys, fixedSize, estimatedSize, buffer }) => {
|
|
|
90
86
|
setItemSize,
|
|
91
87
|
hasItemSize,
|
|
92
88
|
setStart,
|
|
93
|
-
getScrollOffset
|
|
89
|
+
getScrollOffset,
|
|
90
|
+
getItemSize
|
|
94
91
|
};
|
|
95
92
|
};
|
|
96
93
|
//#endregion
|
|
97
|
-
export {
|
|
94
|
+
export { useVirtualSize };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import virtual_list_vue_vue_type_script_lang_default from "./virtual-list.vue_vue_type_script_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { createBlock, createElementBlock, mergeProps, normalizeClass, normalizeStyle, openBlock, renderSlot, resolveComponent, resolveDynamicComponent, toHandlers, withCtx } from "vue";
|
|
4
|
+
import { Fragment, createBlock, createElementBlock, mergeProps, normalizeClass, normalizeStyle, openBlock, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toHandlers, withCtx } from "vue";
|
|
5
5
|
//#region components/_components/virtual-list/virtual-list.vue
|
|
6
6
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7
7
|
const _component_DynamicScrollerItem = resolveComponent("DynamicScrollerItem");
|
|
@@ -9,7 +9,69 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9
9
|
ref: "scrollbarHostRef",
|
|
10
10
|
class: normalizeClass(_ctx.hostClassNames),
|
|
11
11
|
style: normalizeStyle(_ctx.containerOuterStyle)
|
|
12
|
-
}, [(openBlock(), createBlock(resolveDynamicComponent(_ctx.
|
|
12
|
+
}, [_ctx.isCompatMode ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.mergedCompatComponent.container), {
|
|
13
|
+
key: 0,
|
|
14
|
+
ref: "viewportRef",
|
|
15
|
+
class: normalizeClass(`${_ctx.prefixCls}-scroller`),
|
|
16
|
+
style: normalizeStyle(_ctx.compatViewportStyle),
|
|
17
|
+
onScroll: _ctx.onCompatScroll
|
|
18
|
+
}, {
|
|
19
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.mergedCompatComponent.list), mergeProps(_ctx.props.listAttrs, { style: _ctx.compatListStyle }), {
|
|
20
|
+
default: withCtx(() => [
|
|
21
|
+
renderSlot(_ctx.$slots, "before"),
|
|
22
|
+
_ctx.hasCompatContentWrapper ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.mergedCompatComponent.content), mergeProps({ key: 0 }, _ctx.props.contentWrapperAttrs, { style: _ctx.compatContentWrapperStyle }), {
|
|
23
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.compatCurrentList, (item, index) => {
|
|
24
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.mergedCompatComponent.item), mergeProps({ key: _ctx.getCompatItemKey(item, _ctx.compatStart + index) }, { ref_for: true }, _ctx.props.contentAttrs, {
|
|
25
|
+
ref_for: true,
|
|
26
|
+
ref: (element) => _ctx.setCompatItemRef(_ctx.getCompatItemKey(item, _ctx.compatStart + index), element),
|
|
27
|
+
style: _ctx.getCompatContentStyle(index)
|
|
28
|
+
}), {
|
|
29
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "item", {
|
|
30
|
+
item,
|
|
31
|
+
index: _ctx.compatStart + index,
|
|
32
|
+
active: true,
|
|
33
|
+
itemWithSize: void 0
|
|
34
|
+
}, () => [renderSlot(_ctx.$slots, "default", {
|
|
35
|
+
item,
|
|
36
|
+
index: _ctx.compatStart + index,
|
|
37
|
+
active: true,
|
|
38
|
+
itemWithSize: void 0
|
|
39
|
+
})])]),
|
|
40
|
+
_: 2
|
|
41
|
+
}, 1040, ["style"]);
|
|
42
|
+
}), 128))]),
|
|
43
|
+
_: 3
|
|
44
|
+
}, 16, ["style"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.compatCurrentList, (item, index) => {
|
|
45
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.mergedCompatComponent.content), mergeProps({ key: _ctx.getCompatItemKey(item, _ctx.compatStart + index) }, { ref_for: true }, _ctx.props.contentAttrs, {
|
|
46
|
+
ref_for: true,
|
|
47
|
+
ref: (element) => _ctx.setCompatItemRef(_ctx.getCompatItemKey(item, _ctx.compatStart + index), element),
|
|
48
|
+
style: _ctx.getCompatContentStyle(index)
|
|
49
|
+
}), {
|
|
50
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "item", {
|
|
51
|
+
item,
|
|
52
|
+
index: _ctx.compatStart + index,
|
|
53
|
+
active: true,
|
|
54
|
+
itemWithSize: void 0
|
|
55
|
+
}, () => [renderSlot(_ctx.$slots, "default", {
|
|
56
|
+
item,
|
|
57
|
+
index: _ctx.compatStart + index,
|
|
58
|
+
active: true,
|
|
59
|
+
itemWithSize: void 0
|
|
60
|
+
})])]),
|
|
61
|
+
_: 2
|
|
62
|
+
}, 1040, ["style"]);
|
|
63
|
+
}), 128)),
|
|
64
|
+
renderSlot(_ctx.$slots, "after")
|
|
65
|
+
]),
|
|
66
|
+
_: 3
|
|
67
|
+
}, 16, ["style"]))]),
|
|
68
|
+
_: 3
|
|
69
|
+
}, 40, [
|
|
70
|
+
"class",
|
|
71
|
+
"style",
|
|
72
|
+
"onScroll"
|
|
73
|
+
])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.currentScroller), mergeProps({
|
|
74
|
+
key: 1,
|
|
13
75
|
ref: "scrollerRef",
|
|
14
76
|
class: `${_ctx.prefixCls}-scroller`,
|
|
15
77
|
style: _ctx.scrollerStyle
|