@sdata/web-vue 3.3.1 → 3.5.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 (99) hide show
  1. package/dist/sd.css +14 -5
  2. package/dist/sd.min.css +1 -1
  3. package/es/_components/select-view/select-view.d.ts +1 -1
  4. package/es/_components/select-view/style/index.css +1 -1
  5. package/es/_components/virtual-list/interface.d.ts +13 -6
  6. package/es/_components/virtual-list/style/index.scss +3 -1
  7. package/es/_components/virtual-list/virtual-list.vue.d.ts +31 -77
  8. package/es/_components/virtual-list/virtual-list.vue_vue_type_script_setup_true_lang.js +180 -503
  9. package/es/auto-complete/auto-complete.d.ts +1 -1
  10. package/es/auto-complete/auto-complete.js +3 -1
  11. package/es/auto-complete/index.d.ts +3 -3
  12. package/es/card/card.d.ts +3 -3
  13. package/es/card/index.d.ts +6 -6
  14. package/es/cascader/base-cascader-panel.d.ts +1 -1
  15. package/es/cascader/cascader-option.d.ts +1 -1
  16. package/es/cascader/cascader-option.js +8 -3
  17. package/es/cascader/cascader-panel.vue.d.ts +1 -1
  18. package/es/cascader/cascader-search-panel.d.ts +1 -1
  19. package/es/cascader/cascader.vue.d.ts +2 -2
  20. package/es/cascader/style/index.css +4 -1
  21. package/es/cascader/style/index.d.ts +1 -0
  22. package/es/cascader/style/index.scss +4 -1
  23. package/es/config-provider/config-provider.vue.d.ts +1 -1
  24. package/es/config-provider/index.d.ts +3 -3
  25. package/es/descriptions/descriptions.d.ts +2 -2
  26. package/es/descriptions/index.d.ts +6 -6
  27. package/es/drawer/drawer.vue.d.ts +2 -2
  28. package/es/drawer/index.d.ts +5 -5
  29. package/es/dropdown/dropdown-panel.vue.d.ts +1 -1
  30. package/es/ellipsis/ellipsis.vue.d.ts +1 -1
  31. package/es/ellipsis/ellipsis.vue_vue_type_script_setup_true_lang.js +1 -1
  32. package/es/ellipsis/index.d.ts +6 -6
  33. package/es/ellipsis/performant-ellipsis.vue.d.ts +1 -1
  34. package/es/image/preview-group.vue.d.ts +1 -1
  35. package/es/index.css +14 -5
  36. package/es/input-tag/style/index.css +1 -1
  37. package/es/link/index.d.ts +6 -6
  38. package/es/link/link.vue.d.ts +2 -2
  39. package/es/list/list-item-meta.vue.d.ts +2 -2
  40. package/es/list/list-item-meta.vue_vue_type_script_setup_true_lang.js +10 -3
  41. package/es/list/style/index.css +5 -0
  42. package/es/list/style/index.d.ts +1 -0
  43. package/es/list/style/index.scss +6 -0
  44. package/es/menu/item.d.ts +1 -1
  45. package/es/modal/index.d.ts +5 -5
  46. package/es/modal/modal.vue.d.ts +2 -2
  47. package/es/progress/line.vue.d.ts +1 -1
  48. package/es/qr-code/index.d.ts +12 -12
  49. package/es/qr-code/qr-code.vue.d.ts +4 -4
  50. package/es/select/index.d.ts +5 -5
  51. package/es/select/select-dropdown.vue.d.ts +1 -1
  52. package/es/select/select.d.ts +2 -2
  53. package/es/select/select.js +4 -2
  54. package/es/select/style/index.d.ts +1 -0
  55. package/es/slider/index.d.ts +3 -3
  56. package/es/slider/slider.vue.d.ts +1 -1
  57. package/es/spin/index.d.ts +3 -3
  58. package/es/spin/spin.d.ts +1 -1
  59. package/es/statistic/index.d.ts +3 -3
  60. package/es/statistic/statistic.vue.d.ts +1 -1
  61. package/es/table/index.d.ts +13 -7
  62. package/es/table/style/index.css +4 -1
  63. package/es/table/style/index.scss +6 -1
  64. package/es/table/table-column.d.ts +1 -1
  65. package/es/table/table-td.d.ts +1 -1
  66. package/es/table/table.d.ts +3 -1
  67. package/es/table/table.js +66 -34
  68. package/es/tabs/index.d.ts +3 -3
  69. package/es/tabs/tabs.d.ts +1 -1
  70. package/es/tag/index.d.ts +6 -6
  71. package/es/tag/style/index.css +1 -1
  72. package/es/tag/style/index.scss +1 -1
  73. package/es/tag/tag.vue.d.ts +2 -2
  74. package/es/timeline/index.d.ts +6 -6
  75. package/es/timeline/timeline.d.ts +3 -3
  76. package/es/toolbar/style/index.css +0 -1
  77. package/es/toolbar/style/index.scss +0 -1
  78. package/es/toolbar/style/token.scss +0 -2
  79. package/es/tree/base-node.vue.d.ts +4 -8
  80. package/es/tree/base-node.vue_vue_type_script_setup_true_lang.js +14 -16
  81. package/es/tree/tree.vue.d.ts +2 -2
  82. package/es/tree-select/tree-select.vue.d.ts +4 -4
  83. package/es/typography/base.d.ts +1 -1
  84. package/es/watermark/index.d.ts +3 -3
  85. package/es/watermark/watermark.d.ts +1 -1
  86. package/json/web-types.json +1 -1
  87. package/package.json +3 -3
  88. package/es/_components/virtual-list/use-virtual-size.js +0 -94
  89. package/es/_components/virtual-list-v2/hooks/use-size.d.ts +0 -17
  90. package/es/_components/virtual-list-v2/hooks/use-size.js +0 -95
  91. package/es/_components/virtual-list-v2/index.d.ts +0 -2
  92. package/es/_components/virtual-list-v2/index.js +0 -5
  93. package/es/_components/virtual-list-v2/interface.d.ts +0 -44
  94. package/es/_components/virtual-list-v2/virtual-list-item.d.ts +0 -22
  95. package/es/_components/virtual-list-v2/virtual-list-item.js +0 -37
  96. package/es/_components/virtual-list-v2/virtual-list.js +0 -47
  97. package/es/_components/virtual-list-v2/virtual-list.vue.d.ts +0 -749
  98. package/es/_components/virtual-list-v2/virtual-list.vue_vue_type_script_lang.js +0 -179
  99. package/es/_virtual/_plugin-vue_export-helper.js +0 -8
@@ -153,8 +153,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
153
153
  default: boolean;
154
154
  };
155
155
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
156
- dot: boolean;
157
156
  loading: boolean;
157
+ dot: boolean;
158
158
  hideIcon: boolean;
159
159
  }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
160
160
  P: {};
@@ -175,8 +175,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
175
175
  default: boolean;
176
176
  };
177
177
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
178
- dot: boolean;
179
178
  loading: boolean;
179
+ dot: boolean;
180
180
  hideIcon: boolean;
181
181
  }>;
182
182
  __isFragment?: never;
@@ -194,8 +194,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
194
194
  default: boolean;
195
195
  };
196
196
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
197
- dot: boolean;
198
197
  loading: boolean;
198
+ dot: boolean;
199
199
  hideIcon: boolean;
200
200
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
201
201
  install: (app: import("vue").App, options?: import("../_utils/types.ts").SDOptions) => void;
@@ -42,7 +42,6 @@
42
42
  grid-template-columns: repeat(auto-fill, minmax(var(--toolbar-span-width), 1fr));
43
43
  gap: 8px;
44
44
  width: 100%;
45
- background-color: var(--sd-color-bg-2);
46
45
  }
47
46
  .sd-toolbar-body--schema .sd-form > * {
48
47
  max-width: var(--toolbar-item-max-width);
@@ -36,7 +36,6 @@ $toolbar-prefix-cls: string.unquote('#{theme.$prefix}-toolbar');
36
36
  grid-template-columns: repeat(auto-fill, minmax(var(--toolbar-span-width), 1fr));
37
37
  gap: $toolbar-body-gap;
38
38
  width: 100%;
39
- background-color: $toolbar-color-bg;
40
39
 
41
40
  > * {
42
41
  max-width: var(--toolbar-item-max-width);
@@ -16,8 +16,6 @@ $toolbar-expand-gap: global.$spacing-2;
16
16
 
17
17
  $toolbar-padding-bottom: global.$spacing-4;
18
18
 
19
- $toolbar-color-bg: var(string.unquote('#{global.$sd-cssvars-prefix}-color-bg-2'));
20
-
21
19
  $toolbar-color-border: var(string.unquote('#{global.$sd-cssvars-prefix}-color-neutral-3'));
22
20
 
23
21
  $toolbar-border-width: global.$border-1;
@@ -6,11 +6,9 @@ declare var __VLS_10: {}, __VLS_13: {}, __VLS_22: {
6
6
  indeterminate: boolean | undefined;
7
7
  expanded: boolean | undefined;
8
8
  isLeaf: boolean;
9
- }, __VLS_45: {
9
+ }, __VLS_39: {
10
10
  title: string | undefined;
11
- }, __VLS_52: {
12
- title: string | undefined;
13
- }, __VLS_54: {
11
+ }, __VLS_47: {
14
12
  loading: boolean | undefined;
15
13
  checked: boolean | undefined;
16
14
  selected: boolean | undefined;
@@ -25,11 +23,9 @@ type __VLS_Slots = {} & {
25
23
  } & {
26
24
  icon?: (props: typeof __VLS_22) => any;
27
25
  } & {
28
- title?: (props: typeof __VLS_45) => any;
29
- } & {
30
- title?: (props: typeof __VLS_52) => any;
26
+ title?: (props: typeof __VLS_39) => any;
31
27
  } & {
32
- 'drag-icon'?: (props: typeof __VLS_54) => any;
28
+ 'drag-icon'?: (props: typeof __VLS_47) => any;
33
29
  };
34
30
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
35
31
  title: {
@@ -9,7 +9,7 @@ import useTreeContext from "./hooks/use-tree-context.js";
9
9
  import useDraggable$1 from "./hooks/use-draggable.js";
10
10
  import useNodeKey from "./hooks/use-node-key.js";
11
11
  import node_switcher_default from "./node-switcher.js";
12
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeProps, openBlock, reactive, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRefs, unref, withCtx } from "vue";
12
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeProps, openBlock, reactive, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRefs, unref, useSlots, withCtx } from "vue";
13
13
  import { onLongPress, useSwipe } from "@vueuse/core";
14
14
  //#region components/tree/base-node.vue?vue&type=script&setup=true&lang.ts
15
15
  var _hoisted_1 = ["data-level", "data-key"];
@@ -52,6 +52,7 @@ var base_node_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
52
52
  const key = useNodeKey();
53
53
  const prefixCls = getPrefixCls("tree-node");
54
54
  const treeContext = useTreeContext();
55
+ const slots = useSlots();
55
56
  const node = computed(() => {
56
57
  var _treeContext$key2Tree;
57
58
  return (_treeContext$key2Tree = treeContext.key2TreeNode) === null || _treeContext$key2Tree === void 0 ? void 0 : _treeContext$key2Tree.get(key.value);
@@ -130,12 +131,12 @@ var base_node_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
130
131
  const treeDragIcon = computed(() => treeContext.dragIcon);
131
132
  const treeNodeIcon = computed(() => treeContext.nodeIcon);
132
133
  const shouldRenderEllipsis = computed(() => {
133
- var _treeContext$treeProp3, _treeContext$treeProp4;
134
- return ((_treeContext$treeProp3 = treeContext.treeProps) === null || _treeContext$treeProp3 === void 0 ? void 0 : _treeContext$treeProp3.ellipsis) === true || ((_treeContext$treeProp4 = treeContext.treeProps) === null || _treeContext$treeProp4 === void 0 ? void 0 : _treeContext$treeProp4.ellipsis) === "performant-ellipsis";
134
+ var _treeContext$treeProp3, _treeContext$treeProp4, _treeContext$treeProp5;
135
+ return !treeContext.nodeTitle && !slots.title && (((_treeContext$treeProp3 = treeContext.treeProps) === null || _treeContext$treeProp3 === void 0 ? void 0 : _treeContext$treeProp3.ellipsis) === true || ((_treeContext$treeProp4 = treeContext.treeProps) === null || _treeContext$treeProp4 === void 0 ? void 0 : _treeContext$treeProp4.ellipsis) === "performant-ellipsis" || Boolean((_treeContext$treeProp5 = treeContext.treeProps) === null || _treeContext$treeProp5 === void 0 ? void 0 : _treeContext$treeProp5.virtualListProps));
135
136
  });
136
137
  const ellipsisComponent = computed(() => {
137
- var _treeContext$treeProp5;
138
- return ((_treeContext$treeProp5 = treeContext.treeProps) === null || _treeContext$treeProp5 === void 0 ? void 0 : _treeContext$treeProp5.ellipsis) === "performant-ellipsis" ? PerformantEllipsis : Ellipsis;
138
+ var _treeContext$treeProp6, _treeContext$treeProp7;
139
+ return ((_treeContext$treeProp6 = treeContext.treeProps) === null || _treeContext$treeProp6 === void 0 ? void 0 : _treeContext$treeProp6.ellipsis) === true && !((_treeContext$treeProp7 = treeContext.treeProps) === null || _treeContext$treeProp7 === void 0 ? void 0 : _treeContext$treeProp7.virtualListProps) ? Ellipsis : PerformantEllipsis;
139
140
  });
140
141
  const titleTextClassNames = computed(() => [`${prefixCls}-title-text`, { [`${prefixCls}-title-text-ellipsis`]: shouldRenderEllipsis.value }]);
141
142
  function onSwitcherClick(e) {
@@ -312,20 +313,17 @@ var base_node_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
312
313
  }, [_ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", normalizeProps(mergeProps({ key: 0 }, nodeStatus))) : __props.icon ? (openBlock(), createBlock(resolveDynamicComponent(__props.icon), normalizeProps(mergeProps({ key: 1 }, nodeStatus)), null, 16)) : treeNodeIcon.value ? (openBlock(), createBlock(resolveDynamicComponent(treeNodeIcon.value), mergeProps({
313
314
  key: 2,
314
315
  node: treeNodeData.value
315
- }, nodeStatus), null, 16, ["node"])) : createCommentVNode("", true)], 2)) : createCommentVNode("", true), createElementVNode("span", { class: normalizeClass(titleTextClassNames.value) }, [shouldRenderEllipsis.value ? (openBlock(), createBlock(resolveDynamicComponent(ellipsisComponent.value), {
316
- key: 0,
317
- class: normalizeClass(`${unref(prefixCls)}-title-ellipsis`)
318
- }, {
319
- default: withCtx(() => [treeTitle.value ? (openBlock(), createBlock(resolveDynamicComponent(treeTitle.value), { key: 0 })) : renderSlot(_ctx.$slots, "title", {
320
- key: 1,
321
- title: __props.title
322
- }, () => [createTextVNode(toDisplayString(__props.title), 1)])]),
323
- _: 3
324
- }, 8, ["class"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [treeTitle.value ? (openBlock(), createBlock(resolveDynamicComponent(treeTitle.value), { key: 0 })) : renderSlot(_ctx.$slots, "title", {
316
+ }, nodeStatus), null, 16, ["node"])) : createCommentVNode("", true)], 2)) : createCommentVNode("", true), createElementVNode("span", { class: normalizeClass(titleTextClassNames.value) }, [treeTitle.value ? (openBlock(), createBlock(resolveDynamicComponent(treeTitle.value), { key: 0 })) : _ctx.$slots.title ? renderSlot(_ctx.$slots, "title", {
325
317
  key: 1,
326
318
  title: __props.title
327
- }, () => [createTextVNode(toDisplayString(__props.title), 1)])], 64)), unref(draggable) ? (openBlock(), createElementBlock("span", {
319
+ }, () => [createTextVNode(toDisplayString(__props.title), 1)]) : shouldRenderEllipsis.value ? (openBlock(), createBlock(resolveDynamicComponent(ellipsisComponent.value), {
328
320
  key: 2,
321
+ class: normalizeClass(`${unref(prefixCls)}-title-ellipsis`)
322
+ }, {
323
+ default: withCtx(() => [createTextVNode(toDisplayString(__props.title), 1)]),
324
+ _: 1
325
+ }, 8, ["class"])) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [createTextVNode(toDisplayString(__props.title), 1)], 64)), unref(draggable) ? (openBlock(), createElementBlock("span", {
326
+ key: 4,
329
327
  class: normalizeClass([`${unref(prefixCls)}-icon`, `${unref(prefixCls)}-drag-icon`])
330
328
  }, [_ctx.$slots["drag-icon"] ? renderSlot(_ctx.$slots, "drag-icon", normalizeProps(mergeProps({ key: 0 }, nodeStatus))) : __props.dragIcon ? (openBlock(), createBlock(resolveDynamicComponent(__props.dragIcon), normalizeProps(mergeProps({ key: 1 }, nodeStatus)), null, 16)) : treeDragIcon.value ? (openBlock(), createBlock(resolveDynamicComponent(treeDragIcon.value), mergeProps({
331
329
  key: 2,
@@ -396,12 +396,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
396
396
  }>, {
397
397
  size: "small" | "mini" | "medium" | "large";
398
398
  data: TreeNodeData[];
399
- ellipsis: TreeEllipsis;
400
399
  multiple: boolean;
401
400
  checkable: boolean | ((node: TreeNodeData, info: {
402
401
  level: number;
403
402
  isLeaf: boolean;
404
403
  }) => boolean);
404
+ ellipsis: TreeEllipsis;
405
405
  checkStrictly: boolean;
406
406
  animation: boolean;
407
407
  draggable: boolean;
@@ -414,7 +414,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
414
414
  searchValue: string;
415
415
  onlyCheckLeaf: boolean;
416
416
  defaultExpandAll: boolean;
417
- checkedStrategy: "all" | "parent" | "child";
417
+ checkedStrategy: "parent" | "all" | "child";
418
418
  defaultExpandSelected: boolean;
419
419
  defaultExpandChecked: boolean;
420
420
  autoExpandParent: boolean;
@@ -390,14 +390,13 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
390
390
  showArrow: boolean;
391
391
  show: boolean;
392
392
  scrollbar: boolean | ScrollbarProps;
393
- separator: string;
394
- border: boolean;
395
- multiple: boolean;
396
393
  allowClear: boolean;
397
394
  loading: boolean;
395
+ multiple: boolean;
398
396
  showHeaderOnEmpty: boolean;
399
397
  showFooterOnEmpty: boolean;
400
398
  checkable: boolean;
399
+ separator: string;
401
400
  showPath: boolean;
402
401
  defaultInputValue: string;
403
402
  allowSearch: boolean | {
@@ -406,6 +405,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
406
405
  defaultShow: boolean;
407
406
  filterable: boolean;
408
407
  clearable: boolean;
408
+ border: boolean;
409
409
  fallbackOption: boolean | ((key: number | string) => TreeNodeData | boolean);
410
410
  selectable: boolean | "leaf" | ((node: TreeNodeData, info: {
411
411
  isLeaf: boolean;
@@ -415,7 +415,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
415
415
  treeCheckable: boolean;
416
416
  treeCheckStrictly: boolean;
417
417
  labelInValue: boolean;
418
- treeCheckedStrategy: "all" | "parent" | "child";
418
+ treeCheckedStrategy: "parent" | "all" | "child";
419
419
  virtualScroll: boolean;
420
420
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
421
421
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -160,8 +160,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
160
160
  color: string;
161
161
  };
162
162
  disabled: boolean;
163
- underline: boolean;
164
163
  ellipsis: boolean | EllipsisConfig;
164
+ underline: boolean;
165
165
  editable: boolean;
166
166
  copyable: boolean;
167
167
  editing: boolean;
@@ -55,10 +55,10 @@ declare const Watermark: {
55
55
  };
56
56
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
57
57
  repeat: boolean;
58
- alpha: number;
59
58
  rotate: number;
60
59
  zIndex: number;
61
60
  gap: [number, number];
61
+ alpha: number;
62
62
  antiTamper: boolean;
63
63
  grayscale: boolean;
64
64
  staggered: boolean;
@@ -122,10 +122,10 @@ declare const Watermark: {
122
122
  };
123
123
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
124
124
  repeat: boolean;
125
- alpha: number;
126
125
  rotate: number;
127
126
  zIndex: number;
128
127
  gap: [number, number];
128
+ alpha: number;
129
129
  antiTamper: boolean;
130
130
  grayscale: boolean;
131
131
  staggered: boolean;
@@ -186,10 +186,10 @@ declare const Watermark: {
186
186
  };
187
187
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
188
188
  repeat: boolean;
189
- alpha: number;
190
189
  rotate: number;
191
190
  zIndex: number;
192
191
  gap: [number, number];
192
+ alpha: number;
193
193
  antiTamper: boolean;
194
194
  grayscale: boolean;
195
195
  staggered: boolean;
@@ -104,10 +104,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
104
104
  };
105
105
  }>> & Readonly<{}>, {
106
106
  repeat: boolean;
107
- alpha: number;
108
107
  rotate: number;
109
108
  zIndex: number;
110
109
  gap: [number, number];
110
+ alpha: number;
111
111
  antiTamper: boolean;
112
112
  grayscale: boolean;
113
113
  staggered: boolean;
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "@sdata/web-vue",
5
- "version": "3.3.0",
5
+ "version": "3.4.0",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdata/web-vue",
3
- "version": "3.3.1",
3
+ "version": "3.5.0",
4
4
  "description": "SD Design Vue: A Vue.js 3 UI Library",
5
5
  "keywords": [
6
6
  "sd",
@@ -67,8 +67,8 @@
67
67
  "qrcode": "^1.5.4",
68
68
  "resize-observer-polyfill": "^1.5.1",
69
69
  "scroll-into-view-if-needed": "^3.1.0",
70
- "vue": "^3.5.38",
71
- "vue-virtual-scroller": "^3.0.4"
70
+ "virtua": "^0.49.2",
71
+ "vue": "^3.5.38"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@babel/types": "^7.29.7",
@@ -1,94 +0,0 @@
1
- import { computed, onMounted, ref } from "vue";
2
- //#region components/_components/virtual-list/use-virtual-size.ts
3
- var useVirtualSize = ({ dataKeys, fixedSize, estimatedSize, overscan, visibleCount }) => {
4
- const firstRangeAverageSize = ref(0);
5
- const sizeMap = /* @__PURE__ */ new Map();
6
- const fallbackEstimatedSize = computed(() => {
7
- var _estimatedSize$value;
8
- return (_estimatedSize$value = estimatedSize.value) !== null && _estimatedSize$value !== void 0 ? _estimatedSize$value : 30;
9
- });
10
- const total = computed(() => dataKeys.value.length);
11
- const start = ref(0);
12
- const range = computed(() => {
13
- return Math.max(visibleCount.value + overscan.value * 2, 1);
14
- });
15
- const end = computed(() => {
16
- const nextEnd = start.value + range.value;
17
- if (nextEnd > total.value) return total.value;
18
- return nextEnd;
19
- });
20
- const maxStart = computed(() => {
21
- const max = total.value - range.value;
22
- if (max < 0) return 0;
23
- return max;
24
- });
25
- const setStart = (index) => {
26
- if (index < 0) start.value = 0;
27
- else if (index > maxStart.value) start.value = maxStart.value;
28
- else start.value = index;
29
- };
30
- const isFixed = ref(fixedSize.value);
31
- const resolvedEstimatedSize = computed(() => {
32
- if (fallbackEstimatedSize.value !== 30) return fallbackEstimatedSize.value;
33
- return firstRangeAverageSize.value || fallbackEstimatedSize.value;
34
- });
35
- const setItemSize = (key, size) => {
36
- sizeMap.set(key, size);
37
- };
38
- const getItemSize = (index) => {
39
- var _sizeMap$get;
40
- if (isFixed.value) return resolvedEstimatedSize.value;
41
- const key = dataKeys.value[index];
42
- if (key === void 0) return resolvedEstimatedSize.value;
43
- return (_sizeMap$get = sizeMap.get(key)) !== null && _sizeMap$get !== void 0 ? _sizeMap$get : resolvedEstimatedSize.value;
44
- };
45
- const hasItemSize = (key) => {
46
- return sizeMap.has(key);
47
- };
48
- onMounted(() => {
49
- const firstRangeTotalSize = Array.from(sizeMap.values()).reduce((sum, value) => sum + value, 0);
50
- if (firstRangeTotalSize > 0) firstRangeAverageSize.value = firstRangeTotalSize / sizeMap.size;
51
- });
52
- const getOffset = (startIndex, endIndex) => {
53
- let offset = 0;
54
- for (let index = startIndex; index < endIndex; index++) offset += getItemSize(index);
55
- return offset;
56
- };
57
- const getScrollOffset = (index) => {
58
- if (isFixed.value) return resolvedEstimatedSize.value * index;
59
- return getOffset(0, index);
60
- };
61
- const frontPadding = computed(() => {
62
- if (isFixed.value) return resolvedEstimatedSize.value * start.value;
63
- return getOffset(0, start.value);
64
- });
65
- const getStartByScroll = (scrollOffset) => {
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;
73
- if (nextStart < 0) return 0;
74
- if (nextStart > maxStart.value) return maxStart.value;
75
- return nextStart;
76
- };
77
- return {
78
- frontPadding,
79
- behindPadding: computed(() => {
80
- if (isFixed.value) return resolvedEstimatedSize.value * (total.value - end.value);
81
- return getOffset(end.value, total.value);
82
- }),
83
- start,
84
- end,
85
- getStartByScroll,
86
- setItemSize,
87
- hasItemSize,
88
- setStart,
89
- getScrollOffset,
90
- getItemSize
91
- };
92
- };
93
- //#endregion
94
- export { useVirtualSize };
@@ -1,17 +0,0 @@
1
- import { Ref } from 'vue';
2
- export declare const useSize: ({ dataKeys, fixedSize, estimatedSize, buffer, }: {
3
- dataKeys: Ref<(string | number)[]>;
4
- fixedSize: Ref<boolean>;
5
- estimatedSize: Ref<number | undefined>;
6
- buffer: Ref<number>;
7
- }) => {
8
- frontPadding: import("vue").ComputedRef<number>;
9
- behindPadding: import("vue").ComputedRef<number>;
10
- start: Ref<number, number>;
11
- end: import("vue").ComputedRef<number>;
12
- getStartByScroll: (scrollOffset: number) => number;
13
- setItemSize: (key: string | number, size: number) => void;
14
- hasItemSize: (key: string | number) => boolean;
15
- setStart: (index: number) => void;
16
- getScrollOffset: (index: number) => number;
17
- };
@@ -1,95 +0,0 @@
1
- import { computed, onMounted, ref } from "vue";
2
- //#region components/_components/virtual-list-v2/hooks/use-size.ts
3
- var useSize = ({ dataKeys, fixedSize, estimatedSize, buffer }) => {
4
- const firstRangeAverageSize = ref(0);
5
- const sizeMap = /* @__PURE__ */ new Map();
6
- const total = computed(() => dataKeys.value.length);
7
- const start = ref(0);
8
- const end = computed(() => {
9
- const _end = start.value + buffer.value * 3;
10
- if (_end > total.value) return total.value;
11
- return _end;
12
- });
13
- const maxStart = computed(() => {
14
- const max = total.value - buffer.value * 3;
15
- if (max < 0) return 0;
16
- return max;
17
- });
18
- const setStart = (index) => {
19
- if (index < 0) start.value = 0;
20
- else if (index > maxStart.value) start.value = maxStart.value;
21
- else start.value = index;
22
- };
23
- const isFixed = ref(fixedSize.value);
24
- const _estimatedSize = computed(() => {
25
- var _estimatedSize$value;
26
- const nextEstimatedSize = (_estimatedSize$value = estimatedSize.value) !== null && _estimatedSize$value !== void 0 ? _estimatedSize$value : 30;
27
- if (nextEstimatedSize !== 30) return nextEstimatedSize;
28
- return firstRangeAverageSize.value || nextEstimatedSize;
29
- });
30
- const setItemSize = (key, size) => {
31
- sizeMap.set(key, size);
32
- };
33
- const getItemSize = (index) => {
34
- var _sizeMap$get;
35
- if (isFixed.value) return _estimatedSize.value;
36
- const _key = dataKeys.value[index];
37
- if (_key === void 0) return _estimatedSize.value;
38
- return (_sizeMap$get = sizeMap.get(_key)) !== null && _sizeMap$get !== void 0 ? _sizeMap$get : _estimatedSize.value;
39
- };
40
- const hasItemSize = (key) => {
41
- return sizeMap.has(key);
42
- };
43
- onMounted(() => {
44
- const firstRangeTotalSize = Array.from(sizeMap.values()).reduce((pre, value) => pre + value, 0);
45
- if (firstRangeTotalSize > 0) firstRangeAverageSize.value = firstRangeTotalSize / sizeMap.size;
46
- });
47
- const getScrollOffset = (index) => {
48
- if (isFixed.value) return _estimatedSize.value * index;
49
- return getOffset(0, index);
50
- };
51
- const getOffset = (start, end) => {
52
- let offset = 0;
53
- for (let i = start; i < end; i++) offset += getItemSize(i);
54
- return offset;
55
- };
56
- const frontPadding = computed(() => {
57
- if (isFixed.value) return _estimatedSize.value * start.value;
58
- return getOffset(0, start.value);
59
- });
60
- const getOffsetIndex = (scrollOffset) => {
61
- const isForward = scrollOffset >= frontPadding.value;
62
- let offset = Math.abs(scrollOffset - frontPadding.value);
63
- const _start = isForward ? start.value : start.value - 1;
64
- let offsetIndex = 0;
65
- while (offset > 0) {
66
- const itemSize = getItemSize(_start + offsetIndex);
67
- offset -= itemSize;
68
- isForward ? offsetIndex++ : offsetIndex--;
69
- }
70
- return offsetIndex;
71
- };
72
- const getStartByScroll = (scrollOffset) => {
73
- const offsetIndex = getOffsetIndex(scrollOffset);
74
- const _start = start.value + offsetIndex - buffer.value;
75
- if (_start < 0) return 0;
76
- if (_start > maxStart.value) return maxStart.value;
77
- return _start;
78
- };
79
- return {
80
- frontPadding,
81
- behindPadding: computed(() => {
82
- if (isFixed.value) return _estimatedSize.value * (total.value - end.value);
83
- return getOffset(end.value, total.value);
84
- }),
85
- start,
86
- end,
87
- getStartByScroll,
88
- setItemSize,
89
- hasItemSize,
90
- setStart,
91
- getScrollOffset
92
- };
93
- };
94
- //#endregion
95
- export { useSize };
@@ -1,2 +0,0 @@
1
- import VirtualList from './virtual-list.vue';
2
- export default VirtualList;
@@ -1,5 +0,0 @@
1
- import virtual_list_default from "./virtual-list.js";
2
- //#region components/_components/virtual-list-v2/index.ts
3
- var virtual_list_v2_default = virtual_list_default;
4
- //#endregion
5
- export { virtual_list_v2_default as default };
@@ -1,44 +0,0 @@
1
- import { VNode } from 'vue';
2
- import type { ScrollbarProps } from '../../scrollbar';
3
- export type VirtualItemKey = string | number;
4
- export interface InternalDataItem {
5
- key: VirtualItemKey;
6
- index: number;
7
- item: unknown;
8
- }
9
- export type ItemSlot = (props: {
10
- item: unknown;
11
- index: number;
12
- }) => VNode[];
13
- export interface ScrollIntoViewOptions {
14
- index?: number;
15
- key?: VirtualItemKey;
16
- align: 'auto' | 'top' | 'bottom';
17
- }
18
- export interface VirtualListProps {
19
- height?: number | string;
20
- threshold?: number;
21
- isStaticItemHeight?: boolean;
22
- fixedSize?: boolean;
23
- estimatedSize?: number;
24
- buffer?: number;
25
- data?: unknown[];
26
- itemKey?: string | ((item: unknown) => VirtualItemKey);
27
- component?: keyof HTMLElementTagNameMap | {
28
- container?: keyof HTMLElementTagNameMap;
29
- list?: keyof HTMLElementTagNameMap;
30
- content?: keyof HTMLElementTagNameMap;
31
- };
32
- listAttrs?: Record<string, unknown>;
33
- contentAttrs?: Record<string, unknown>;
34
- paddingPosition?: 'content' | 'list';
35
- scrollbar?: boolean | ScrollbarProps;
36
- }
37
- export type ScrollOptions = number | {
38
- index?: number;
39
- key?: VirtualItemKey;
40
- align?: 'auto' | 'top' | 'bottom';
41
- };
42
- export interface VirtualListRef {
43
- scrollTo: (options: ScrollOptions) => void;
44
- }
@@ -1,22 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- hasItemSize: {
3
- type: FunctionConstructor;
4
- required: true;
5
- };
6
- setItemSize: {
7
- type: FunctionConstructor;
8
- required: true;
9
- };
10
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
11
- [key: string]: any;
12
- }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
- hasItemSize: {
14
- type: FunctionConstructor;
15
- required: true;
16
- };
17
- setItemSize: {
18
- type: FunctionConstructor;
19
- required: true;
20
- };
21
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
22
- export default _default;
@@ -1,37 +0,0 @@
1
- import { getFirstComponent } from "../../_utils/vue-utils.js";
2
- import { cloneVNode, defineComponent, getCurrentInstance, onBeforeUnmount, onMounted, ref } from "vue";
3
- //#region components/_components/virtual-list-v2/virtual-list-item.tsx
4
- var virtual_list_item_default = /* @__PURE__ */ defineComponent({
5
- name: "VirtualListItem",
6
- props: {
7
- hasItemSize: {
8
- type: Function,
9
- required: true
10
- },
11
- setItemSize: {
12
- type: Function,
13
- required: true
14
- }
15
- },
16
- setup(props, { slots }) {
17
- var _getCurrentInstance;
18
- const key = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.vnode.key;
19
- const itemRef = ref();
20
- const setItemSize = () => {
21
- var _itemRef$value$$el, _itemRef$value, _ele$getBoundingClien, _ele$getBoundingClien2;
22
- const ele = (_itemRef$value$$el = (_itemRef$value = itemRef.value) === null || _itemRef$value === void 0 ? void 0 : _itemRef$value.$el) !== null && _itemRef$value$$el !== void 0 ? _itemRef$value$$el : itemRef.value;
23
- const height = (_ele$getBoundingClien = ele === null || ele === void 0 || (_ele$getBoundingClien2 = ele.getBoundingClientRect) === null || _ele$getBoundingClien2 === void 0 ? void 0 : _ele$getBoundingClien2.call(ele).height) !== null && _ele$getBoundingClien !== void 0 ? _ele$getBoundingClien : ele === null || ele === void 0 ? void 0 : ele.offsetHeight;
24
- if (height) props.setItemSize(key, height);
25
- };
26
- onMounted(() => setItemSize());
27
- onBeforeUnmount(() => setItemSize());
28
- return () => {
29
- var _slots$default;
30
- const child = getFirstComponent((_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots));
31
- if (child) return cloneVNode(child, { ref: itemRef }, true);
32
- return null;
33
- };
34
- }
35
- });
36
- //#endregion
37
- export { virtual_list_item_default as default };