@sdata/web-vue 1.10.0 → 1.11.0

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.
Files changed (117) hide show
  1. package/dist/sd.css +148 -952
  2. package/dist/sd.min.css +1 -1
  3. package/es/_components/input-label/style/input-label.scss +11 -51
  4. package/es/_components/select-view/select-view.d.ts +1 -1
  5. package/es/_components/select-view/style/index.css +0 -84
  6. package/es/_components/virtual-list/interface.d.ts +10 -1
  7. package/es/{table/hooks/use-table-virtual-size.d.ts → _components/virtual-list/use-virtual-size.d.ts} +4 -2
  8. package/es/{table/hooks/use-table-virtual-size.js → _components/virtual-list/use-virtual-size.js} +17 -20
  9. package/es/_components/virtual-list/virtual-list.js +64 -2
  10. package/es/_components/virtual-list/virtual-list.vue.d.ts +208 -0
  11. package/es/_components/virtual-list/virtual-list.vue_vue_type_script_lang.js +277 -5
  12. package/es/_utils/clipboard.js +2 -1
  13. package/es/auto-complete/auto-complete.d.ts +1 -1
  14. package/es/auto-complete/index.d.ts +24 -15
  15. package/es/auto-complete/style/index.css +0 -16
  16. package/es/auto-complete/style/index.scss +11 -26
  17. package/es/badge/style/index.scss +11 -41
  18. package/es/button/style/index.css +35 -445
  19. package/es/button/style/index.scss +57 -332
  20. package/es/card/style/index.scss +18 -52
  21. package/es/carousel/index.d.ts +1 -0
  22. package/es/cascader/cascader-panel.vue.d.ts +1 -1
  23. package/es/cascader/cascader.vue.d.ts +3 -3
  24. package/es/cascader/index.d.ts +10 -10
  25. package/es/cascader/interface.d.ts +5 -0
  26. package/es/color-picker/style/index.scss +17 -99
  27. package/es/config-provider/config-provider.vue.d.ts +1 -1
  28. package/es/config-provider/index.d.ts +4 -3
  29. package/es/date-picker/index.d.ts +21 -14
  30. package/es/date-picker/panels/date/index.vue.d.ts +1 -1
  31. package/es/date-picker/panels/week/index.vue.d.ts +7 -7
  32. package/es/date-picker/picker.vue.d.ts +1 -1
  33. package/es/date-picker/range-picker.vue.d.ts +1 -1
  34. package/es/descriptions/descriptions.d.ts +1 -1
  35. package/es/descriptions/index.d.ts +4 -4
  36. package/es/descriptions/style/index.scss +18 -63
  37. package/es/form/style/index.css +12 -176
  38. package/es/form/style/status.scss +36 -73
  39. package/es/index.css +148 -952
  40. package/es/index.d.ts +21 -20
  41. package/es/input/style/input.scss +14 -66
  42. package/es/input-number/index.d.ts +5 -0
  43. package/es/input-tag/style/index.css +0 -84
  44. package/es/input-tag/style/input-tag.scss +16 -170
  45. package/es/list/style/index.scss +12 -42
  46. package/es/menu/index.d.ts +8 -0
  47. package/es/menu/style/index.css +0 -178
  48. package/es/menu/style/index.scss +36 -139
  49. package/es/pagination/index.d.ts +3 -3
  50. package/es/pagination/interface.d.ts +2 -1
  51. package/es/pagination/page-options.js +1 -1
  52. package/es/pagination/page-options.vue.d.ts +72 -71
  53. package/es/pagination/page-options.vue_vue_type_script_lang.js +6 -0
  54. package/es/pagination/pagination.d.ts +3 -3
  55. package/es/pagination/style/index.css +0 -12
  56. package/es/pagination/style/index.scss +19 -76
  57. package/es/radio/index.d.ts +3 -0
  58. package/es/result/style/index.css +0 -16
  59. package/es/result/style/index.scss +12 -34
  60. package/es/select/index.d.ts +9 -9
  61. package/es/select/interface.d.ts +2 -1
  62. package/es/select/select.d.ts +3 -3
  63. package/es/slider/index.d.ts +6 -3
  64. package/es/slider/slider.vue.d.ts +1 -1
  65. package/es/steps/index.d.ts +2 -0
  66. package/es/switch/index.d.ts +3 -0
  67. package/es/table/context.d.ts +1 -1
  68. package/es/table/hooks/use-column-resize.d.ts +2 -3
  69. package/es/table/hooks/use-column-resize.js +48 -21
  70. package/es/table/hooks/use-drag.d.ts +4 -2
  71. package/es/table/hooks/use-drag.js +16 -2
  72. package/es/table/index.d.ts +22 -34
  73. package/es/table/interface.d.ts +21 -2
  74. package/es/table/style/index.css +97 -21
  75. package/es/table/style/index.scss +137 -125
  76. package/es/table/table-operation-td.d.ts +2 -2
  77. package/es/table/table-operation-td.js +4 -5
  78. package/es/table/table-operation-th.js +4 -4
  79. package/es/table/table-tbody.js +1 -1
  80. package/es/table/table-td.js +5 -6
  81. package/es/table/table-th.js +25 -24
  82. package/es/table/table-thead.js +1 -1
  83. package/es/table/table-tr.js +1 -1
  84. package/es/table/table.d.ts +12 -16
  85. package/es/table/table.js +399 -190
  86. package/es/tabs/index.d.ts +1 -0
  87. package/es/tabs/style/index.scss +53 -135
  88. package/es/tag/index.d.ts +3 -3
  89. package/es/tag/style/index.css +0 -84
  90. package/es/tag/style/index.scss +19 -146
  91. package/es/tag/tag.vue.d.ts +1 -1
  92. package/es/theme-provider/index.d.ts +9 -9
  93. package/es/time-picker/index.d.ts +1 -0
  94. package/es/timeline/index.d.ts +1 -0
  95. package/es/transfer/index.d.ts +1 -0
  96. package/es/transfer/interface.d.ts +1 -1
  97. package/es/tree/hooks/use-tree-data.d.ts +17 -29
  98. package/es/tree/index.d.ts +6 -1
  99. package/es/tree/interface.d.ts +2 -0
  100. package/es/tree/tree.js +1 -1
  101. package/es/tree/tree.vue.d.ts +3561 -13
  102. package/es/tree/tree.vue_vue_type_script_lang.js +21 -9
  103. package/es/tree-select/hooks/use-selected-state.js +3 -1
  104. package/es/tree-select/index.d.ts +3 -0
  105. package/es/tree-select/tree-select.vue.d.ts +1367 -3
  106. package/json/vetur-attributes.json +1 -6
  107. package/json/vetur-tags.json +0 -1
  108. package/json/web-types.json +7 -11
  109. package/package.json +1 -1
  110. package/es/style/theme/legacy-less-var.scss +0 -15
  111. package/es/table/table-col-group.js +0 -21
  112. package/es/table/table-col-group.vue_vue_type_script_lang.js +0 -32
  113. package/es/table/table-legacy-virtual-list.js +0 -47
  114. package/es/table/table-legacy-virtual-list.vue.d.ts +0 -156
  115. package/es/table/table-legacy-virtual-list.vue_vue_type_script_lang.js +0 -148
  116. package/es/table/table-virtual-list-item.d.ts +0 -22
  117. package/es/table/table-virtual-list-item.js +0 -37
@@ -1,6 +1,7 @@
1
1
  import { type CSSProperties, type Component, PropType } from 'vue';
2
2
  import { type CacheSnapshot, type ClassValue, type DynamicScrollerExposed, type ItemSizeValue, type KeyFieldValue, type KeyValue, type RecycleScrollerExposed, type ScrollDirection } from 'vue-virtual-scroller';
3
3
  import type { ScrollbarProps } from '../../scrollbar';
4
+ import type { VirtualItemKey } from './interface';
4
5
  type ScrollerExpose = RecycleScrollerExposed<any, KeyValue> | DynamicScrollerExposed<any>;
5
6
  type ScrollerSlotProps = {
6
7
  item: unknown;
@@ -67,15 +68,177 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
67
68
  itemClass: {
68
69
  type: PropType<ClassValue>;
69
70
  };
71
+ threshold: {
72
+ type: NumberConstructor;
73
+ default: number;
74
+ };
75
+ fixedSize: {
76
+ type: BooleanConstructor;
77
+ default: boolean;
78
+ };
79
+ estimatedSize: {
80
+ type: NumberConstructor;
81
+ default: undefined;
82
+ };
83
+ component: {
84
+ type: PropType<keyof HTMLElementTagNameMap | Record<string, unknown>>;
85
+ default: undefined;
86
+ };
87
+ listAttrs: {
88
+ type: PropType<Record<string, unknown> | undefined>;
89
+ default: undefined;
90
+ };
91
+ contentWrapperAttrs: {
92
+ type: PropType<Record<string, unknown> | undefined>;
93
+ default: undefined;
94
+ };
95
+ contentAttrs: {
96
+ type: PropType<Record<string, unknown> | undefined>;
97
+ default: undefined;
98
+ };
99
+ listStyle: {
100
+ type: PropType<CSSProperties | undefined>;
101
+ default: undefined;
102
+ };
103
+ paddingPosition: {
104
+ type: PropType<"content" | "list">;
105
+ default: string;
106
+ };
70
107
  scrollbar: {
71
108
  type: PropType<boolean | ScrollbarProps>;
72
109
  default: boolean;
73
110
  };
74
111
  }>, {
75
112
  prefixCls: string;
113
+ props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
114
+ items: {
115
+ type: PropType<unknown[]>;
116
+ default: () => never[];
117
+ };
118
+ height: {
119
+ type: PropType<number | string>;
120
+ default: undefined;
121
+ };
122
+ keyField: {
123
+ type: PropType<KeyFieldValue<any>>;
124
+ default: string;
125
+ };
126
+ direction: {
127
+ type: PropType<ScrollDirection>;
128
+ default: string;
129
+ };
130
+ listTag: {
131
+ type: StringConstructor;
132
+ default: string;
133
+ };
134
+ itemTag: {
135
+ type: StringConstructor;
136
+ default: string;
137
+ };
138
+ itemSize: {
139
+ type: PropType<ItemSizeValue<any>>;
140
+ default: undefined;
141
+ };
142
+ gridItems: NumberConstructor;
143
+ itemSecondarySize: NumberConstructor;
144
+ minItemSize: {
145
+ type: PropType<number | string | null>;
146
+ default: undefined;
147
+ };
148
+ sizeField: StringConstructor;
149
+ typeField: StringConstructor;
150
+ buffer: NumberConstructor;
151
+ shift: BooleanConstructor;
152
+ cache: PropType<CacheSnapshot>;
153
+ prerender: NumberConstructor;
154
+ emitUpdate: BooleanConstructor;
155
+ disableTransform: BooleanConstructor;
156
+ flowMode: BooleanConstructor;
157
+ hiddenPosition: NumberConstructor;
158
+ updateInterval: NumberConstructor;
159
+ skipHover: BooleanConstructor;
160
+ enabled: {
161
+ type: BooleanConstructor;
162
+ default: boolean;
163
+ };
164
+ listClass: {
165
+ type: PropType<ClassValue>;
166
+ };
167
+ itemClass: {
168
+ type: PropType<ClassValue>;
169
+ };
170
+ threshold: {
171
+ type: NumberConstructor;
172
+ default: number;
173
+ };
174
+ fixedSize: {
175
+ type: BooleanConstructor;
176
+ default: boolean;
177
+ };
178
+ estimatedSize: {
179
+ type: NumberConstructor;
180
+ default: undefined;
181
+ };
182
+ component: {
183
+ type: PropType<keyof HTMLElementTagNameMap | Record<string, unknown>>;
184
+ default: undefined;
185
+ };
186
+ listAttrs: {
187
+ type: PropType<Record<string, unknown> | undefined>;
188
+ default: undefined;
189
+ };
190
+ contentWrapperAttrs: {
191
+ type: PropType<Record<string, unknown> | undefined>;
192
+ default: undefined;
193
+ };
194
+ contentAttrs: {
195
+ type: PropType<Record<string, unknown> | undefined>;
196
+ default: undefined;
197
+ };
198
+ listStyle: {
199
+ type: PropType<CSSProperties | undefined>;
200
+ default: undefined;
201
+ };
202
+ paddingPosition: {
203
+ type: PropType<"content" | "list">;
204
+ default: string;
205
+ };
206
+ scrollbar: {
207
+ type: PropType<boolean | ScrollbarProps>;
208
+ default: boolean;
209
+ };
210
+ }>> & Readonly<{
211
+ onResize?: (() => any) | undefined;
212
+ onScroll?: ((_ev: Event) => any) | undefined;
213
+ onVisible?: (() => any) | undefined;
214
+ onUpdate?: ((_startIndex: number, _endIndex: number, _visibleStartIndex: number, _visibleEndIndex: number) => any) | undefined;
215
+ onHidden?: (() => any) | undefined;
216
+ onReachBottom?: ((_ev: Event) => any) | undefined;
217
+ onScrollStart?: (() => any) | undefined;
218
+ onScrollEnd?: (() => any) | undefined;
219
+ }> & {}>;
76
220
  hostClassNames: import("vue").ComputedRef<(string | undefined)[]>;
77
221
  scrollbarHostRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
78
222
  scrollerRef: import("vue").Ref<ScrollerExpose | undefined, ScrollerExpose | undefined>;
223
+ viewportRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
224
+ isCompatMode: import("vue").ComputedRef<boolean>;
225
+ mergedCompatComponent: import("vue").ComputedRef<{
226
+ container: string;
227
+ list: string;
228
+ content: string;
229
+ item: string;
230
+ }>;
231
+ hasCompatContentWrapper: import("vue").ComputedRef<boolean>;
232
+ compatViewportStyle: import("vue").ComputedRef<CSSProperties>;
233
+ compatListStyle: import("vue").ComputedRef<CSSProperties | undefined>;
234
+ compatContentStyle: import("vue").ComputedRef<CSSProperties | undefined>;
235
+ compatContentWrapperStyle: import("vue").ComputedRef<CSSProperties | undefined>;
236
+ compatCurrentList: import("vue").ComputedRef<unknown[]>;
237
+ compatStart: import("vue").ComputedRef<number>;
238
+ getCompatItemKey: (item: unknown, index: number) => VirtualItemKey;
239
+ setCompatItemRef: (key: VirtualItemKey, value: unknown) => void;
240
+ getCompatContentStyle: (index: number) => CSSProperties | undefined;
241
+ onCompatScroll: (ev: Event) => void;
79
242
  currentScroller: import("vue").ComputedRef<Component>;
80
243
  isDynamicScroller: import("vue").ComputedRef<boolean>;
81
244
  containerOuterStyle: import("vue").ComputedRef<{
@@ -166,6 +329,42 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
166
329
  itemClass: {
167
330
  type: PropType<ClassValue>;
168
331
  };
332
+ threshold: {
333
+ type: NumberConstructor;
334
+ default: number;
335
+ };
336
+ fixedSize: {
337
+ type: BooleanConstructor;
338
+ default: boolean;
339
+ };
340
+ estimatedSize: {
341
+ type: NumberConstructor;
342
+ default: undefined;
343
+ };
344
+ component: {
345
+ type: PropType<keyof HTMLElementTagNameMap | Record<string, unknown>>;
346
+ default: undefined;
347
+ };
348
+ listAttrs: {
349
+ type: PropType<Record<string, unknown> | undefined>;
350
+ default: undefined;
351
+ };
352
+ contentWrapperAttrs: {
353
+ type: PropType<Record<string, unknown> | undefined>;
354
+ default: undefined;
355
+ };
356
+ contentAttrs: {
357
+ type: PropType<Record<string, unknown> | undefined>;
358
+ default: undefined;
359
+ };
360
+ listStyle: {
361
+ type: PropType<CSSProperties | undefined>;
362
+ default: undefined;
363
+ };
364
+ paddingPosition: {
365
+ type: PropType<"content" | "list">;
366
+ default: string;
367
+ };
169
368
  scrollbar: {
170
369
  type: PropType<boolean | ScrollbarProps>;
171
370
  default: boolean;
@@ -183,6 +382,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
183
382
  shift: boolean;
184
383
  height: string | number;
185
384
  direction: ScrollDirection;
385
+ listStyle: CSSProperties | undefined;
386
+ fixedSize: boolean;
387
+ estimatedSize: number;
186
388
  emitUpdate: boolean;
187
389
  disableTransform: boolean;
188
390
  flowMode: boolean;
@@ -194,6 +396,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
194
396
  itemSize: ItemSizeValue<any>;
195
397
  minItemSize: string | number | null;
196
398
  enabled: boolean;
399
+ threshold: number;
400
+ component: Record<string, unknown> | keyof HTMLElementTagNameMap;
401
+ listAttrs: Record<string, unknown> | undefined;
402
+ contentWrapperAttrs: Record<string, unknown> | undefined;
403
+ contentAttrs: Record<string, unknown> | undefined;
404
+ paddingPosition: "content" | "list";
197
405
  scrollbar: boolean | ScrollbarProps;
198
406
  }, {}, {
199
407
  RecycleScroller: <TItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
@@ -1,8 +1,9 @@
1
1
  import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/objectSpread2.js";
2
2
  import { getPrefixCls } from "../../_utils/global-config.js";
3
- import { isString } from "../../_utils/is.js";
3
+ import { isObject, isString } from "../../_utils/is.js";
4
+ import { useVirtualSize } from "./use-virtual-size.js";
4
5
  import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/asyncToGenerator.js";
5
- import { computed, defineComponent, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";
6
+ import { computed, defineComponent, nextTick, onBeforeUnmount, onMounted, onUpdated, ref, watch } from "vue";
6
7
  import { OverlayScrollbars } from "overlayscrollbars";
7
8
  import { DynamicScroller, DynamicScrollerItem, RecycleScroller } from "vue-virtual-scroller";
8
9
  //#region components/_components/virtual-list/virtual-list.vue?vue&type=script&lang.ts
@@ -78,6 +79,42 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
78
79
  Object,
79
80
  Array
80
81
  ] },
82
+ threshold: {
83
+ type: Number,
84
+ default: 0
85
+ },
86
+ fixedSize: {
87
+ type: Boolean,
88
+ default: false
89
+ },
90
+ estimatedSize: {
91
+ type: Number,
92
+ default: void 0
93
+ },
94
+ component: {
95
+ type: [String, Object],
96
+ default: void 0
97
+ },
98
+ listAttrs: {
99
+ type: Object,
100
+ default: void 0
101
+ },
102
+ contentWrapperAttrs: {
103
+ type: Object,
104
+ default: void 0
105
+ },
106
+ contentAttrs: {
107
+ type: Object,
108
+ default: void 0
109
+ },
110
+ listStyle: {
111
+ type: Object,
112
+ default: void 0
113
+ },
114
+ paddingPosition: {
115
+ type: String,
116
+ default: "content"
117
+ },
81
118
  scrollbar: {
82
119
  type: [Boolean, Object],
83
120
  default: true
@@ -97,12 +134,20 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
97
134
  const prefixCls = getPrefixCls("virtual-list");
98
135
  const scrollbarHostRef = ref();
99
136
  const scrollerRef = ref();
137
+ const viewportRef = ref();
138
+ const compatItemRefs = /* @__PURE__ */ new Map();
100
139
  const osInstanceRef = ref(null);
101
140
  const overlayViewportReadyRef = ref(false);
102
141
  const resolvedItems = computed(() => {
103
142
  var _props$items;
104
143
  return (_props$items = props.items) !== null && _props$items !== void 0 ? _props$items : [];
105
144
  });
145
+ const isCompatMode = computed(() => {
146
+ return Boolean(props.component || props.listAttrs || props.contentWrapperAttrs || props.contentAttrs || props.listStyle || props.paddingPosition !== "content");
147
+ });
148
+ const hasCompatContentWrapper = computed(() => {
149
+ return Boolean(props.contentWrapperAttrs || isObject(props.component) && props.component.item);
150
+ });
106
151
  const resolvedScrollbarProps = computed(() => {
107
152
  if (!props.scrollbar) return;
108
153
  if (typeof props.scrollbar === "boolean") return { type: "embed" };
@@ -125,8 +170,150 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
125
170
  if (props.height === void 0) return;
126
171
  return typeof props.height === "number" ? `${props.height}px` : props.height;
127
172
  });
173
+ const mergedCompatComponent = computed(() => {
174
+ var _props$component;
175
+ if (isObject(props.component)) return _objectSpread2({
176
+ container: "div",
177
+ list: "div",
178
+ content: "div",
179
+ item: "div"
180
+ }, props.component);
181
+ return {
182
+ container: (_props$component = props.component) !== null && _props$component !== void 0 ? _props$component : "div",
183
+ list: "div",
184
+ content: "div",
185
+ item: "div"
186
+ };
187
+ });
188
+ const compatFixedSize = computed(() => {
189
+ return props.fixedSize || typeof props.itemSize === "number";
190
+ });
191
+ const compatEstimatedSize = computed(() => {
192
+ if (props.estimatedSize !== void 0) return props.estimatedSize;
193
+ if (typeof props.itemSize === "number") return props.itemSize;
194
+ if (typeof props.minItemSize === "number") return props.minItemSize;
195
+ });
196
+ const compatViewportSize = ref(0);
197
+ const compatResolvedItemSize = computed(() => {
198
+ var _compatEstimatedSize$;
199
+ return (_compatEstimatedSize$ = compatEstimatedSize.value) !== null && _compatEstimatedSize$ !== void 0 ? _compatEstimatedSize$ : 30;
200
+ });
201
+ const compatBuffer = computed(() => {
202
+ var _props$buffer;
203
+ return (_props$buffer = props.buffer) !== null && _props$buffer !== void 0 ? _props$buffer : 200;
204
+ });
205
+ const compatOverscan = computed(() => {
206
+ const baseItemSize = Math.max(compatResolvedItemSize.value, 1);
207
+ return Math.max(Math.ceil(compatBuffer.value / baseItemSize), 0);
208
+ });
209
+ const compatVisibleCount = computed(() => {
210
+ const baseItemSize = Math.max(compatResolvedItemSize.value, 1);
211
+ if (compatViewportSize.value <= 0) return 1;
212
+ return Math.max(Math.ceil(compatViewportSize.value / baseItemSize), 1);
213
+ });
214
+ const getCompatItemKey = (item, index) => {
215
+ const keyField = props.keyField;
216
+ if (typeof keyField === "function") return keyField(item, index);
217
+ if (item && typeof item === "object" && isString(keyField)) {
218
+ var _item$keyField;
219
+ return (_item$keyField = item[keyField]) !== null && _item$keyField !== void 0 ? _item$keyField : index;
220
+ }
221
+ return index;
222
+ };
223
+ const { frontPadding: compatFrontPadding, behindPadding: compatBehindPadding, start: compatStartRef, end: compatEnd, getStartByScroll: getCompatStartByScroll, setItemSize: compatSetItemSize, setStart: setCompatStart, getScrollOffset: getCompatScrollOffset, getItemSize: getCompatItemSize } = useVirtualSize({
224
+ dataKeys: computed(() => {
225
+ return resolvedItems.value.map((item, index) => getCompatItemKey(item, index));
226
+ }),
227
+ fixedSize: compatFixedSize,
228
+ estimatedSize: compatEstimatedSize,
229
+ overscan: compatOverscan,
230
+ visibleCount: compatVisibleCount
231
+ });
232
+ const compatCurrentList = computed(() => {
233
+ if (!isCompatMode.value) return [];
234
+ if (props.threshold && resolvedItems.value.length <= props.threshold) return resolvedItems.value;
235
+ return resolvedItems.value.slice(compatStartRef.value, compatEnd.value);
236
+ });
237
+ const compatStart = computed(() => {
238
+ if (props.threshold && resolvedItems.value.length <= props.threshold) return 0;
239
+ return compatStartRef.value;
240
+ });
241
+ const compatViewportStyle = computed(() => {
242
+ const style = { minHeight: 0 };
243
+ if (resolvedHeightValue.value !== void 0) style.height = resolvedScrollbarProps.value && resolvedHeightValue.value !== "auto" ? "100%" : resolvedHeightValue.value;
244
+ if (!resolvedScrollbarProps.value || !overlayViewportReadyRef.value) if (props.direction === "horizontal") {
245
+ style.overflowX = "auto";
246
+ style.overflowY = "hidden";
247
+ } else {
248
+ style.overflowY = "auto";
249
+ style.overflowX = "hidden";
250
+ }
251
+ return style;
252
+ });
253
+ const compatListPaddingStyle = computed(() => {
254
+ if (props.paddingPosition !== "list") return;
255
+ return {
256
+ paddingTop: `${compatFrontPadding.value}px`,
257
+ paddingBottom: `${compatBehindPadding.value}px`
258
+ };
259
+ });
260
+ const compatContentPaddingStyle = computed(() => {
261
+ if (props.paddingPosition !== "content") return;
262
+ return {
263
+ paddingTop: `${compatFrontPadding.value}px`,
264
+ paddingBottom: `${compatBehindPadding.value}px`
265
+ };
266
+ });
267
+ const compatListStyle = computed(() => {
268
+ if (!props.listStyle && !compatListPaddingStyle.value) return;
269
+ return _objectSpread2(_objectSpread2({}, props.listStyle), compatListPaddingStyle.value);
270
+ });
271
+ const compatContentStyle = computed(() => {
272
+ return compatContentPaddingStyle.value;
273
+ });
274
+ const compatContentWrapperStyle = computed(() => {
275
+ if (!hasCompatContentWrapper.value || props.paddingPosition !== "content") return;
276
+ return compatContentStyle.value;
277
+ });
278
+ const updateCompatItemSize = (key, element) => {
279
+ const height = element.getBoundingClientRect().height || element.offsetHeight;
280
+ if (height) compatSetItemSize(key, height);
281
+ };
282
+ const updateCompatItemSizes = () => {
283
+ compatItemRefs.forEach((element, key) => {
284
+ updateCompatItemSize(key, element);
285
+ });
286
+ };
287
+ const updateCompatViewportSize = () => {
288
+ var _scrollerElement$clie, _scrollerElement$clie2;
289
+ if (!isCompatMode.value) {
290
+ compatViewportSize.value = 0;
291
+ return;
292
+ }
293
+ const scrollerElement = getScrollerElement();
294
+ const nextViewportSize = props.direction === "horizontal" ? (_scrollerElement$clie = scrollerElement === null || scrollerElement === void 0 ? void 0 : scrollerElement.clientWidth) !== null && _scrollerElement$clie !== void 0 ? _scrollerElement$clie : 0 : (_scrollerElement$clie2 = scrollerElement === null || scrollerElement === void 0 ? void 0 : scrollerElement.clientHeight) !== null && _scrollerElement$clie2 !== void 0 ? _scrollerElement$clie2 : 0;
295
+ if (nextViewportSize > 0) compatViewportSize.value = nextViewportSize;
296
+ };
297
+ const setCompatItemRef = (key, value) => {
298
+ var _value$$el;
299
+ const element = (_value$$el = value === null || value === void 0 ? void 0 : value.$el) !== null && _value$$el !== void 0 ? _value$$el : value;
300
+ if (!(element instanceof HTMLElement)) {
301
+ compatItemRefs.delete(key);
302
+ return;
303
+ }
304
+ compatItemRefs.set(key, element);
305
+ updateCompatItemSize(key, element);
306
+ };
307
+ const getCompatContentStyle = (index) => {
308
+ if (hasCompatContentWrapper.value) return;
309
+ if (props.paddingPosition !== "content") return compatContentStyle.value;
310
+ const style = _objectSpread2({}, compatContentStyle.value);
311
+ if (index === 0) style.paddingTop = `${compatFrontPadding.value}px`;
312
+ if (index === compatCurrentList.value.length - 1) style.paddingBottom = `${compatBehindPadding.value}px`;
313
+ return style;
314
+ };
128
315
  const isDynamicScroller = computed(() => {
129
- return props.itemSize === void 0;
316
+ return !isCompatMode.value && props.itemSize === void 0;
130
317
  });
131
318
  const currentScroller = computed(() => {
132
319
  return isDynamicScroller.value ? DynamicScroller : RecycleScroller;
@@ -172,6 +359,10 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
172
359
  return instance;
173
360
  };
174
361
  const getScrollerElement = () => {
362
+ if (isCompatMode.value) {
363
+ var _viewportRef$value;
364
+ return (_viewportRef$value = viewportRef.value) !== null && _viewportRef$value !== void 0 ? _viewportRef$value : null;
365
+ }
175
366
  const scroller = scrollerRef.value;
176
367
  return (scroller === null || scroller === void 0 ? void 0 : scroller.$el) instanceof HTMLElement ? scroller.$el : null;
177
368
  };
@@ -238,7 +429,7 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
238
429
  content: false
239
430
  }
240
431
  }, resolvedOverlayOptions.value, { scroll: (_instance, event) => {
241
- onScroll(event);
432
+ if (!isCompatMode.value) onScroll(event);
242
433
  } });
243
434
  overlayViewportReadyRef.value = true;
244
435
  });
@@ -246,8 +437,16 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
246
437
  return _ref2.apply(this, arguments);
247
438
  };
248
439
  }();
249
- onMounted(() => {
440
+ onMounted(_asyncToGenerator(function* () {
441
+ yield nextTick();
442
+ updateCompatViewportSize();
250
443
  initOverlayScrollbar(false);
444
+ }));
445
+ onUpdated(() => {
446
+ if (isCompatMode.value) {
447
+ updateCompatItemSizes();
448
+ updateCompatViewportSize();
449
+ }
251
450
  });
252
451
  watch([currentScroller, resolvedOverlayOptions], _asyncToGenerator(function* () {
253
452
  if (!resolvedOverlayOptions.value) {
@@ -269,6 +468,10 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
269
468
  var _ref3 = _asyncToGenerator(function* (nextItems, previousItems) {
270
469
  var _resolveOSInstance, _resolveOSInstance2;
271
470
  yield nextTick();
471
+ if (isCompatMode.value) {
472
+ updateCompatItemSizes();
473
+ updateCompatViewportSize();
474
+ }
272
475
  (_resolveOSInstance = resolveOSInstance()) === null || _resolveOSInstance === void 0 || _resolveOSInstance.update(true);
273
476
  yield waitForLayoutFrame();
274
477
  if (shouldResetScrollForSmallList(nextItems, previousItems)) {
@@ -332,6 +535,14 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
332
535
  if (!target) return;
333
536
  if (Math.floor(target.scrollHeight - (target.scrollTop + target.clientHeight)) <= 0) emit("reachBottom", ev);
334
537
  };
538
+ const onCompatScroll = (ev) => {
539
+ const target = ev.target;
540
+ if (target) {
541
+ const nextStart = getCompatStartByScroll(target.scrollTop);
542
+ if (nextStart !== compatStartRef.value) setCompatStart(nextStart);
543
+ }
544
+ onScroll(ev);
545
+ };
335
546
  const onScrollEnd = () => {
336
547
  var _osInstance$elements$;
337
548
  emit("scrollEnd");
@@ -365,22 +576,44 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
365
576
  const getScroller = () => scrollerRef.value;
366
577
  const scrollToItem = (index, options) => {
367
578
  var _getScroller;
579
+ if (isCompatMode.value) {
580
+ scrollTo({
581
+ index,
582
+ align: (options === null || options === void 0 ? void 0 : options.smooth) ? "auto" : void 0,
583
+ smooth: options === null || options === void 0 ? void 0 : options.smooth,
584
+ offset: options === null || options === void 0 ? void 0 : options.offset
585
+ });
586
+ return;
587
+ }
368
588
  (_getScroller = getScroller()) === null || _getScroller === void 0 || _getScroller.scrollToItem(index, options);
369
589
  };
370
590
  const scrollToPosition = (position, options) => {
371
591
  var _getScroller2;
592
+ if (isCompatMode.value) {
593
+ const viewport = getScrollerElement();
594
+ if (!viewport) return;
595
+ if (options === null || options === void 0 ? void 0 : options.smooth) viewport.scrollTo({
596
+ top: position,
597
+ behavior: "smooth"
598
+ });
599
+ else viewport.scrollTop = position;
600
+ return;
601
+ }
372
602
  (_getScroller2 = getScroller()) === null || _getScroller2 === void 0 || _getScroller2.scrollToPosition(position, options);
373
603
  };
374
604
  const findItemIndex = (offset) => {
375
605
  var _getScroller$findItem, _getScroller3;
606
+ if (isCompatMode.value) return getCompatStartByScroll(offset);
376
607
  return (_getScroller$findItem = (_getScroller3 = getScroller()) === null || _getScroller3 === void 0 ? void 0 : _getScroller3.findItemIndex(offset)) !== null && _getScroller$findItem !== void 0 ? _getScroller$findItem : -1;
377
608
  };
378
609
  const getItemOffset = (index) => {
379
610
  var _getScroller$getItemO, _getScroller4;
611
+ if (isCompatMode.value) return getCompatScrollOffset(index);
380
612
  return (_getScroller$getItemO = (_getScroller4 = getScroller()) === null || _getScroller4 === void 0 ? void 0 : _getScroller4.getItemOffset(index)) !== null && _getScroller$getItemO !== void 0 ? _getScroller$getItemO : 0;
381
613
  };
382
614
  const getItemSize = (index) => {
383
615
  var _getScroller$getItemS, _getScroller5;
616
+ if (isCompatMode.value) return getCompatItemSize(index);
384
617
  if (isDynamicScroller.value) {
385
618
  const dynamicScroller = getScroller();
386
619
  if (!dynamicScroller) return 0;
@@ -403,15 +636,26 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
403
636
  scroller === null || scroller === void 0 || scroller.updateVisibleItems(itemsChanged, checkPositionDiff);
404
637
  };
405
638
  const scrollToBottom = () => {
639
+ if (isCompatMode.value) {
640
+ const viewport = getScrollerElement();
641
+ if (!viewport) return;
642
+ scrollToPosition(viewport.scrollHeight);
643
+ return;
644
+ }
406
645
  const scroller = getScroller();
407
646
  scroller === null || scroller === void 0 || scroller.scrollToBottom();
408
647
  };
409
648
  const forceUpdate = (clear) => {
649
+ if (isCompatMode.value) {
650
+ if (clear) setCompatStart(0);
651
+ return;
652
+ }
410
653
  const scroller = getScroller();
411
654
  scroller === null || scroller === void 0 || scroller.forceUpdate(clear);
412
655
  };
413
656
  const getDynamicItemSize = (item, index) => {
414
657
  var _scroller$getItemSize;
658
+ if (isCompatMode.value) return typeof index === "number" ? getCompatItemSize(index) : 0;
415
659
  const scroller = getScroller();
416
660
  return (_scroller$getItemSize = scroller === null || scroller === void 0 ? void 0 : scroller.getItemSize(item, index)) !== null && _scroller$getItemSize !== void 0 ? _scroller$getItemSize : 0;
417
661
  };
@@ -430,6 +674,19 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
430
674
  });
431
675
  }
432
676
  if (typeof index !== "number" || index < 0) return;
677
+ if (isCompatMode.value) {
678
+ setCompatStart(index - compatOverscan.value);
679
+ scrollToPosition(getCompatScrollOffset(index), {
680
+ smooth: options.smooth,
681
+ offset: options.offset
682
+ });
683
+ nextTick(() => {
684
+ const scrollTop = getCompatScrollOffset(index);
685
+ const viewport = getScrollerElement();
686
+ if (viewport && scrollTop !== viewport.scrollTop) viewport.scrollTop = scrollTop;
687
+ });
688
+ return;
689
+ }
433
690
  scrollToItem(index, {
434
691
  align: normalizeAlign(options.align),
435
692
  smooth: options.smooth,
@@ -452,9 +709,24 @@ var virtual_list_vue_vue_type_script_lang_default = defineComponent({
452
709
  });
453
710
  return {
454
711
  prefixCls,
712
+ props,
455
713
  hostClassNames,
456
714
  scrollbarHostRef,
457
715
  scrollerRef,
716
+ viewportRef,
717
+ isCompatMode,
718
+ mergedCompatComponent,
719
+ hasCompatContentWrapper,
720
+ compatViewportStyle,
721
+ compatListStyle,
722
+ compatContentStyle,
723
+ compatContentWrapperStyle,
724
+ compatCurrentList,
725
+ compatStart,
726
+ getCompatItemKey,
727
+ setCompatItemRef,
728
+ getCompatContentStyle,
729
+ onCompatScroll,
458
730
  currentScroller,
459
731
  isDynamicScroller,
460
732
  containerOuterStyle,
@@ -19,7 +19,8 @@ var clipboard = function() {
19
19
  range.selectNode(span);
20
20
  selection === null || selection === void 0 || selection.addRange(range);
21
21
  try {
22
- window.document.execCommand("copy");
22
+ var _window$document$exec, _window$document;
23
+ (_window$document$exec = (_window$document = window.document).execCommand) === null || _window$document$exec === void 0 || _window$document$exec.call(_window$document, "copy");
23
24
  } catch (err) {
24
25
  console.error(`execCommand Error: ${err}`);
25
26
  }
@@ -104,9 +104,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
104
104
  disabled: boolean;
105
105
  defaultValue: string;
106
106
  data: (string | number | SelectOptionData | SelectOptionGroup)[];
107
+ strict: boolean;
107
108
  modelValue: string;
108
109
  allowClear: boolean;
109
110
  filterOption: FilterOption;
110
- strict: boolean;
111
111
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
112
112
  export default _default;