@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.
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
@@ -3010,10 +3010,6 @@
3010
3010
  "sd-table/size": {
3011
3011
  "description": "The size of the table"
3012
3012
  },
3013
- "sd-table/table-layout-fixed": {
3014
- "description": "The table-layout property of the table is set to fixed. After it is set to fixed, the width of the table will not be stretched beyond 100% by the content.",
3015
- "type": "boolean"
3016
- },
3017
3013
  "sd-table/loading": {
3018
3014
  "description": "Whether it is loading state",
3019
3015
  "type": "boolean|object"
@@ -3038,8 +3034,7 @@
3038
3034
  "type": "number"
3039
3035
  },
3040
3036
  "sd-table/row-key": {
3041
- "description": "Value field of table row `key`",
3042
- "type": "string"
3037
+ "description": "Value field of table row `key`"
3043
3038
  },
3044
3039
  "sd-table/show-header": {
3045
3040
  "description": "Whether to show the header",
@@ -1237,7 +1237,6 @@
1237
1237
  "hoverable",
1238
1238
  "stripe",
1239
1239
  "size",
1240
- "table-layout-fixed",
1241
1240
  "loading",
1242
1241
  "row-selection",
1243
1242
  "expandable",
@@ -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": "1.9.0",
5
+ "version": "1.11.0",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
@@ -5704,7 +5704,7 @@
5704
5704
  "name": "page-size-props",
5705
5705
  "description": "Props of data number selector",
5706
5706
  "value": {
5707
- "type": "SelectProps",
5707
+ "type": "PaginationSelectProps",
5708
5708
  "kind": "expression"
5709
5709
  }
5710
5710
  },
@@ -7587,14 +7587,6 @@
7587
7587
  "kind": "expression"
7588
7588
  }
7589
7589
  },
7590
- {
7591
- "name": "table-layout-fixed",
7592
- "description": "The table-layout property of the table is set to fixed. After it is set to fixed, the width of the table will not be stretched beyond 100% by the content.",
7593
- "value": {
7594
- "type": "boolean",
7595
- "kind": "expression"
7596
- }
7597
- },
7598
7590
  {
7599
7591
  "name": "loading",
7600
7592
  "description": "Whether it is loading state",
@@ -7655,7 +7647,7 @@
7655
7647
  "name": "row-key",
7656
7648
  "description": "Value field of table row `key`",
7657
7649
  "value": {
7658
- "type": "string",
7650
+ "type": "string | ((record: TableData) => BaseType)",
7659
7651
  "kind": "expression"
7660
7652
  }
7661
7653
  },
@@ -7919,6 +7911,10 @@
7919
7911
  "name": "thead",
7920
7912
  "description": "Custom thead element"
7921
7913
  },
7914
+ {
7915
+ "name": "append",
7916
+ "description": "Content inserted after the last table row"
7917
+ },
7922
7918
  {
7923
7919
  "name": "empty",
7924
7920
  "description": "Empty"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdata/web-vue",
3
- "version": "1.10.0",
3
+ "version": "1.11.1",
4
4
  "description": "SD Design Vue: A Vue.js 3 UI Library",
5
5
  "keywords": [
6
6
  "sd",
@@ -1,15 +0,0 @@
1
- @use 'sass:map';
2
-
3
- @function get($vars, $name, $fallback: null) {
4
- $value: map.get($vars, $name);
5
-
6
- @if $value == null {
7
- @if $fallback != null {
8
- @return $fallback;
9
- }
10
-
11
- @error "Unknown Less variable: #{$name}";
12
- }
13
-
14
- @return $value;
15
- }
@@ -1,21 +0,0 @@
1
- import _plugin_vue_export_helper_default from "../_virtual/_plugin-vue_export-helper.js";
2
- import table_col_group_vue_vue_type_script_lang_default from "./table-col-group.vue_vue_type_script_lang.js";
3
- import { Fragment, createElementBlock, normalizeClass, normalizeStyle, openBlock, renderList } from "vue";
4
- //#region components/table/table-col-group.vue
5
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
6
- return openBlock(), createElementBlock("colgroup", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.operations, (item) => {
7
- return openBlock(), createElementBlock("col", {
8
- key: `sd-col-${item.name}`,
9
- class: normalizeClass(`sd-table-${item.name}-col`),
10
- style: normalizeStyle(_ctx.fixedWidth(item.width))
11
- }, null, 6);
12
- }), 128)), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dataColumns, (item) => {
13
- return openBlock(), createElementBlock("col", {
14
- key: `sd-col-${item.dataIndex}`,
15
- style: normalizeStyle(_ctx.fixedWidth(_ctx.columnWidth && item.dataIndex && _ctx.columnWidth[item.dataIndex] || item.width, item.minWidth))
16
- }, null, 4);
17
- }), 128))]);
18
- }
19
- var table_col_group_default = /* @__PURE__ */ _plugin_vue_export_helper_default(table_col_group_vue_vue_type_script_lang_default, [["render", _sfc_render]]);
20
- //#endregion
21
- export { table_col_group_default as default };
@@ -1,32 +0,0 @@
1
- import { defineComponent } from "vue";
2
- //#region components/table/table-col-group.vue?vue&type=script&lang.ts
3
- var table_col_group_vue_vue_type_script_lang_default = defineComponent({
4
- name: "ColGroup",
5
- props: {
6
- dataColumns: {
7
- type: Array,
8
- required: true
9
- },
10
- operations: {
11
- type: Array,
12
- required: true
13
- },
14
- columnWidth: { type: Object }
15
- },
16
- setup() {
17
- const fixedWidth = (width, minWidth) => {
18
- if (width) {
19
- const min = Math.max(width, minWidth || 0);
20
- return {
21
- width: `${width}px`,
22
- minWidth: `${min}px`,
23
- maxWidth: `${width}px`
24
- };
25
- }
26
- if (minWidth) return { minWidth: `${minWidth}px` };
27
- };
28
- return { fixedWidth };
29
- }
30
- });
31
- //#endregion
32
- export { table_col_group_vue_vue_type_script_lang_default as default };
@@ -1,47 +0,0 @@
1
- import _plugin_vue_export_helper_default from "../_virtual/_plugin-vue_export-helper.js";
2
- import table_legacy_virtual_list_vue_vue_type_script_lang_default from "./table-legacy-virtual-list.vue_vue_type_script_lang.js";
3
- import { Fragment, createBlock, createElementBlock, mergeProps, normalizeClass, normalizeStyle, openBlock, renderList, renderSlot, resolveComponent, resolveDynamicComponent, withCtx } from "vue";
4
- //#region components/table/table-legacy-virtual-list.vue
5
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
6
- const _component_TableVirtualListItem = resolveComponent("TableVirtualListItem");
7
- return openBlock(), createBlock(resolveDynamicComponent(_ctx.mergedComponent.container), {
8
- ref: "containerRef",
9
- class: normalizeClass(_ctx.prefixCls),
10
- style: normalizeStyle(_ctx.style),
11
- onScroll: _ctx.onScroll
12
- }, {
13
- default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.mergedComponent.list), mergeProps(_ctx.listAttrs, { style: _ctx.paddingPosition === "list" ? {
14
- paddingTop: `${_ctx.frontPadding}px`,
15
- paddingBottom: `${_ctx.behindPadding}px`
16
- } : {} }), {
17
- default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.mergedComponent.content), mergeProps({ ref: "contentRef" }, _ctx.contentAttrs, { style: _ctx.paddingPosition === "content" ? {
18
- paddingTop: `${_ctx.frontPadding}px`,
19
- paddingBottom: `${_ctx.behindPadding}px`
20
- } : {} }), {
21
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.currentList, (item, index) => {
22
- return openBlock(), createBlock(_component_TableVirtualListItem, {
23
- key: _ctx.getItemKey(item, _ctx.start + index),
24
- "has-item-size": _ctx.hasItemSize,
25
- "set-item-size": _ctx.setItemSize
26
- }, {
27
- default: withCtx(() => [renderSlot(_ctx.$slots, "item", {
28
- item,
29
- index: _ctx.start + index
30
- })]),
31
- _: 2
32
- }, 1032, ["has-item-size", "set-item-size"]);
33
- }), 128))]),
34
- _: 3
35
- }, 16, ["style"]))]),
36
- _: 3
37
- }, 16, ["style"]))]),
38
- _: 3
39
- }, 40, [
40
- "class",
41
- "style",
42
- "onScroll"
43
- ]);
44
- }
45
- var table_legacy_virtual_list_default = /* @__PURE__ */ _plugin_vue_export_helper_default(table_legacy_virtual_list_vue_vue_type_script_lang_default, [["render", _sfc_render]]);
46
- //#endregion
47
- export { table_legacy_virtual_list_default as default };
@@ -1,156 +0,0 @@
1
- import { type PropType } from 'vue';
2
- import type { VirtualItemKey } from '../_components/virtual-list/interface';
3
- declare const _default: typeof __VLS_export;
4
- export default _default;
5
- declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
- height: {
7
- type: (StringConstructor | NumberConstructor)[];
8
- default: number;
9
- };
10
- data: {
11
- type: PropType<unknown[]>;
12
- default: () => never[];
13
- };
14
- threshold: {
15
- type: NumberConstructor;
16
- default: number;
17
- };
18
- itemKey: {
19
- type: PropType<string | ((item: unknown, index: number) => VirtualItemKey)>;
20
- default: string;
21
- };
22
- fixedSize: {
23
- type: BooleanConstructor;
24
- default: boolean;
25
- };
26
- estimatedSize: {
27
- type: NumberConstructor;
28
- default: number;
29
- };
30
- buffer: {
31
- type: NumberConstructor;
32
- default: number;
33
- };
34
- component: {
35
- type: (StringConstructor | ObjectConstructor)[];
36
- default: string;
37
- };
38
- listAttrs: {
39
- type: PropType<Record<string, unknown> | undefined>;
40
- default: undefined;
41
- };
42
- contentAttrs: {
43
- type: PropType<Record<string, unknown> | undefined>;
44
- default: undefined;
45
- };
46
- paddingPosition: {
47
- type: PropType<"content" | "list">;
48
- default: string;
49
- };
50
- }>, {
51
- prefixCls: string;
52
- containerRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
53
- contentRef: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
54
- frontPadding: import("vue").ComputedRef<number>;
55
- currentList: import("vue").ComputedRef<unknown[]>;
56
- behindPadding: import("vue").ComputedRef<number>;
57
- getItemKey: (item: unknown, index: number) => VirtualItemKey;
58
- onScroll: (ev: Event) => void;
59
- setItemSize: (key: string | number, size: number) => void;
60
- hasItemSize: (key: string | number) => boolean;
61
- start: import("vue").Ref<number, number>;
62
- style: import("vue").ComputedRef<{
63
- height: string;
64
- overflow: string;
65
- }>;
66
- mergedComponent: import("vue").ComputedRef<{
67
- container: string;
68
- list: string;
69
- content: string;
70
- }>;
71
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
72
- scroll: (_ev: Event) => true;
73
- reachBottom: (_ev: Event) => true;
74
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
75
- height: {
76
- type: (StringConstructor | NumberConstructor)[];
77
- default: number;
78
- };
79
- data: {
80
- type: PropType<unknown[]>;
81
- default: () => never[];
82
- };
83
- threshold: {
84
- type: NumberConstructor;
85
- default: number;
86
- };
87
- itemKey: {
88
- type: PropType<string | ((item: unknown, index: number) => VirtualItemKey)>;
89
- default: string;
90
- };
91
- fixedSize: {
92
- type: BooleanConstructor;
93
- default: boolean;
94
- };
95
- estimatedSize: {
96
- type: NumberConstructor;
97
- default: number;
98
- };
99
- buffer: {
100
- type: NumberConstructor;
101
- default: number;
102
- };
103
- component: {
104
- type: (StringConstructor | ObjectConstructor)[];
105
- default: string;
106
- };
107
- listAttrs: {
108
- type: PropType<Record<string, unknown> | undefined>;
109
- default: undefined;
110
- };
111
- contentAttrs: {
112
- type: PropType<Record<string, unknown> | undefined>;
113
- default: undefined;
114
- };
115
- paddingPosition: {
116
- type: PropType<"content" | "list">;
117
- default: string;
118
- };
119
- }>> & Readonly<{
120
- onScroll?: ((_ev: Event) => any) | undefined;
121
- onReachBottom?: ((_ev: Event) => any) | undefined;
122
- }>, {
123
- data: unknown[];
124
- height: string | number;
125
- buffer: number;
126
- component: string | Record<string, any>;
127
- fixedSize: boolean;
128
- estimatedSize: number;
129
- threshold: number;
130
- itemKey: string | ((item: unknown, index: number) => VirtualItemKey);
131
- listAttrs: Record<string, unknown> | undefined;
132
- contentAttrs: Record<string, unknown> | undefined;
133
- paddingPosition: "content" | "list";
134
- }, {}, {
135
- TableVirtualListItem: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
136
- hasItemSize: {
137
- type: FunctionConstructor;
138
- required: true;
139
- };
140
- setItemSize: {
141
- type: FunctionConstructor;
142
- required: true;
143
- };
144
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
145
- [key: string]: any;
146
- }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
147
- hasItemSize: {
148
- type: FunctionConstructor;
149
- required: true;
150
- };
151
- setItemSize: {
152
- type: FunctionConstructor;
153
- required: true;
154
- };
155
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
156
- }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,148 +0,0 @@
1
- import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.124.0/helpers/objectSpread2.js";
2
- import { getPrefixCls } from "../_utils/global-config.js";
3
- import { isNumber, isObject } from "../_utils/is.js";
4
- import { useTableVirtualSize } from "./hooks/use-table-virtual-size.js";
5
- import table_virtual_list_item_default from "./table-virtual-list-item.js";
6
- import { computed, defineComponent, nextTick, ref, toRefs } from "vue";
7
- //#region components/table/table-legacy-virtual-list.vue?vue&type=script&lang.ts
8
- var table_legacy_virtual_list_vue_vue_type_script_lang_default = defineComponent({
9
- name: "TableLegacyVirtualList",
10
- components: { TableVirtualListItem: table_virtual_list_item_default },
11
- props: {
12
- height: {
13
- type: [Number, String],
14
- default: 200
15
- },
16
- data: {
17
- type: Array,
18
- default: () => []
19
- },
20
- threshold: {
21
- type: Number,
22
- default: 0
23
- },
24
- itemKey: {
25
- type: [String, Function],
26
- default: "key"
27
- },
28
- fixedSize: {
29
- type: Boolean,
30
- default: false
31
- },
32
- estimatedSize: {
33
- type: Number,
34
- default: 30
35
- },
36
- buffer: {
37
- type: Number,
38
- default: 10
39
- },
40
- component: {
41
- type: [String, Object],
42
- default: "div"
43
- },
44
- listAttrs: {
45
- type: Object,
46
- default: void 0
47
- },
48
- contentAttrs: {
49
- type: Object,
50
- default: void 0
51
- },
52
- paddingPosition: {
53
- type: String,
54
- default: "content"
55
- }
56
- },
57
- emits: {
58
- scroll: (_ev) => true,
59
- reachBottom: (_ev) => true
60
- },
61
- setup(props, { emit, expose }) {
62
- const { data, itemKey, fixedSize, estimatedSize, buffer, height } = toRefs(props);
63
- const prefixCls = getPrefixCls("virtual-list");
64
- const getItemKey = (item, index) => {
65
- if (typeof itemKey.value === "function") return itemKey.value(item, index);
66
- if (item && typeof item === "object") {
67
- var _item$itemKey$value;
68
- return (_item$itemKey$value = item[itemKey.value]) !== null && _item$itemKey$value !== void 0 ? _item$itemKey$value : index;
69
- }
70
- return index;
71
- };
72
- const mergedComponent = computed(() => {
73
- if (isObject(props.component)) return _objectSpread2({
74
- container: "div",
75
- list: "div",
76
- content: "div"
77
- }, props.component);
78
- return {
79
- container: props.component,
80
- list: "div",
81
- content: "div"
82
- };
83
- });
84
- const containerRef = ref();
85
- const contentRef = ref();
86
- const style = computed(() => ({
87
- height: isNumber(height.value) ? `${height.value}px` : height.value,
88
- overflow: "auto"
89
- }));
90
- const dataKeys = computed(() => data.value.map((item, index) => getItemKey(item, index)));
91
- const { frontPadding, behindPadding, start, end, getStartByScroll, setItemSize, hasItemSize, setStart, getScrollOffset } = useTableVirtualSize({
92
- dataKeys,
93
- fixedSize,
94
- estimatedSize,
95
- buffer
96
- });
97
- const currentList = computed(() => {
98
- if (props.threshold && data.value.length <= props.threshold) return data.value;
99
- return data.value.slice(start.value, end.value);
100
- });
101
- const scrollTo = (options) => {
102
- var _options$index, _options$key;
103
- if (!containerRef.value) return;
104
- if (isNumber(options)) {
105
- containerRef.value.scrollTop = options;
106
- return;
107
- }
108
- const index = (_options$index = options.index) !== null && _options$index !== void 0 ? _options$index : dataKeys.value.indexOf((_options$key = options.key) !== null && _options$key !== void 0 ? _options$key : "");
109
- setStart(index - buffer.value);
110
- containerRef.value.scrollTop = getScrollOffset(index);
111
- nextTick(() => {
112
- if (!containerRef.value) return;
113
- const scrollTop = getScrollOffset(index);
114
- if (scrollTop !== containerRef.value.scrollTop) containerRef.value.scrollTop = scrollTop;
115
- });
116
- };
117
- const onScroll = (ev) => {
118
- const { scrollTop, scrollHeight, offsetHeight } = ev.target;
119
- const nextStart = getStartByScroll(scrollTop);
120
- if (nextStart !== start.value) {
121
- setStart(nextStart);
122
- nextTick(() => {
123
- scrollTo(scrollTop);
124
- });
125
- }
126
- emit("scroll", ev);
127
- if (Math.floor(scrollHeight - (scrollTop + offsetHeight)) <= 0) emit("reachBottom", ev);
128
- };
129
- expose({ scrollTo });
130
- return {
131
- prefixCls,
132
- containerRef,
133
- contentRef,
134
- frontPadding,
135
- currentList,
136
- behindPadding,
137
- getItemKey,
138
- onScroll,
139
- setItemSize,
140
- hasItemSize,
141
- start,
142
- style,
143
- mergedComponent
144
- };
145
- }
146
- });
147
- //#endregion
148
- export { table_legacy_virtual_list_vue_vue_type_script_lang_default as default };
@@ -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/table/table-virtual-list-item.tsx
4
- var table_virtual_list_item_default = /* @__PURE__ */ defineComponent({
5
- name: "TableVirtualListItem",
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 updateItemSize = () => {
21
- var _itemRef$value$$el, _itemRef$value, _element$getBoundingC, _element$getBoundingC2;
22
- const element = (_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 = (_element$getBoundingC = element === null || element === void 0 || (_element$getBoundingC2 = element.getBoundingClientRect) === null || _element$getBoundingC2 === void 0 ? void 0 : _element$getBoundingC2.call(element).height) !== null && _element$getBoundingC !== void 0 ? _element$getBoundingC : element === null || element === void 0 ? void 0 : element.offsetHeight;
24
- if (height) props.setItemSize(key, height);
25
- };
26
- onMounted(() => updateItemSize());
27
- onBeforeUnmount(() => updateItemSize());
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 null;
32
- return cloneVNode(child, { ref: itemRef }, true);
33
- };
34
- }
35
- });
36
- //#endregion
37
- export { table_virtual_list_item_default as default };