@sdata/web-vue 1.10.0 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sd.css +148 -952
- package/dist/sd.min.css +1 -1
- package/es/_components/input-label/style/input-label.scss +11 -51
- package/es/_components/select-view/select-view.d.ts +1 -1
- package/es/_components/select-view/style/index.css +0 -84
- package/es/_components/virtual-list/interface.d.ts +10 -1
- package/es/{table/hooks/use-table-virtual-size.d.ts → _components/virtual-list/use-virtual-size.d.ts} +4 -2
- package/es/{table/hooks/use-table-virtual-size.js → _components/virtual-list/use-virtual-size.js} +17 -20
- package/es/_components/virtual-list/virtual-list.js +64 -2
- package/es/_components/virtual-list/virtual-list.vue.d.ts +208 -0
- package/es/_components/virtual-list/virtual-list.vue_vue_type_script_lang.js +277 -5
- package/es/_utils/clipboard.js +2 -1
- package/es/auto-complete/auto-complete.d.ts +1 -1
- package/es/auto-complete/index.d.ts +24 -15
- package/es/auto-complete/style/index.css +0 -16
- package/es/auto-complete/style/index.scss +11 -26
- package/es/badge/style/index.scss +11 -41
- package/es/button/style/index.css +35 -445
- package/es/button/style/index.scss +57 -332
- package/es/card/style/index.scss +18 -52
- package/es/carousel/index.d.ts +1 -0
- package/es/cascader/cascader-panel.vue.d.ts +1 -1
- package/es/cascader/cascader.vue.d.ts +3 -3
- package/es/cascader/index.d.ts +10 -10
- package/es/cascader/interface.d.ts +5 -0
- package/es/color-picker/style/index.scss +17 -99
- package/es/config-provider/config-provider.vue.d.ts +1 -1
- package/es/config-provider/index.d.ts +4 -3
- package/es/date-picker/index.d.ts +21 -14
- package/es/date-picker/panels/date/index.vue.d.ts +1 -1
- package/es/date-picker/panels/week/index.vue.d.ts +7 -7
- package/es/date-picker/picker.vue.d.ts +1 -1
- package/es/date-picker/range-picker.vue.d.ts +1 -1
- package/es/descriptions/descriptions.d.ts +1 -1
- package/es/descriptions/index.d.ts +4 -4
- package/es/descriptions/style/index.scss +18 -63
- package/es/form/style/index.css +12 -176
- package/es/form/style/status.scss +36 -73
- package/es/index.css +148 -952
- package/es/index.d.ts +21 -20
- package/es/input/style/input.scss +14 -66
- package/es/input-number/index.d.ts +5 -0
- package/es/input-tag/style/index.css +0 -84
- package/es/input-tag/style/input-tag.scss +16 -170
- package/es/list/style/index.scss +12 -42
- package/es/menu/index.d.ts +8 -0
- package/es/menu/style/index.css +0 -178
- package/es/menu/style/index.scss +36 -139
- package/es/pagination/index.d.ts +3 -3
- package/es/pagination/interface.d.ts +2 -1
- package/es/pagination/page-options.js +1 -1
- package/es/pagination/page-options.vue.d.ts +72 -71
- package/es/pagination/page-options.vue_vue_type_script_lang.js +6 -0
- package/es/pagination/pagination.d.ts +3 -3
- package/es/pagination/style/index.css +0 -12
- package/es/pagination/style/index.scss +19 -76
- package/es/radio/index.d.ts +3 -0
- package/es/result/style/index.css +0 -16
- package/es/result/style/index.scss +12 -34
- package/es/select/index.d.ts +9 -9
- package/es/select/interface.d.ts +2 -1
- package/es/select/select.d.ts +3 -3
- package/es/slider/index.d.ts +6 -3
- package/es/slider/slider.vue.d.ts +1 -1
- package/es/steps/index.d.ts +2 -0
- package/es/switch/index.d.ts +3 -0
- package/es/table/context.d.ts +1 -1
- package/es/table/hooks/use-column-resize.d.ts +2 -3
- package/es/table/hooks/use-column-resize.js +48 -21
- package/es/table/hooks/use-drag.d.ts +4 -2
- package/es/table/hooks/use-drag.js +16 -2
- package/es/table/index.d.ts +22 -34
- package/es/table/interface.d.ts +21 -2
- package/es/table/style/index.css +97 -21
- package/es/table/style/index.scss +137 -125
- package/es/table/table-operation-td.d.ts +2 -2
- package/es/table/table-operation-td.js +4 -5
- package/es/table/table-operation-th.js +4 -4
- package/es/table/table-tbody.js +1 -1
- package/es/table/table-td.js +5 -6
- package/es/table/table-th.js +25 -24
- package/es/table/table-thead.js +1 -1
- package/es/table/table-tr.js +1 -1
- package/es/table/table.d.ts +12 -16
- package/es/table/table.js +399 -190
- package/es/tabs/index.d.ts +1 -0
- package/es/tabs/style/index.scss +53 -135
- package/es/tag/index.d.ts +3 -3
- package/es/tag/style/index.css +0 -84
- package/es/tag/style/index.scss +19 -146
- package/es/tag/tag.vue.d.ts +1 -1
- package/es/theme-provider/index.d.ts +9 -9
- package/es/time-picker/index.d.ts +1 -0
- package/es/timeline/index.d.ts +1 -0
- package/es/transfer/index.d.ts +1 -0
- package/es/transfer/interface.d.ts +1 -1
- package/es/tree/hooks/use-tree-data.d.ts +17 -29
- package/es/tree/index.d.ts +6 -1
- package/es/tree/interface.d.ts +2 -0
- package/es/tree/tree.js +1 -1
- package/es/tree/tree.vue.d.ts +3561 -13
- package/es/tree/tree.vue_vue_type_script_lang.js +21 -9
- package/es/tree-select/hooks/use-selected-state.js +3 -1
- package/es/tree-select/index.d.ts +3 -0
- package/es/tree-select/tree-select.vue.d.ts +1367 -3
- package/json/vetur-attributes.json +1 -6
- package/json/vetur-tags.json +0 -1
- package/json/web-types.json +7 -11
- package/package.json +1 -1
- package/es/style/theme/legacy-less-var.scss +0 -15
- package/es/table/table-col-group.js +0 -21
- package/es/table/table-col-group.vue_vue_type_script_lang.js +0 -32
- package/es/table/table-legacy-virtual-list.js +0 -47
- package/es/table/table-legacy-virtual-list.vue.d.ts +0 -156
- package/es/table/table-legacy-virtual-list.vue_vue_type_script_lang.js +0 -148
- package/es/table/table-virtual-list-item.d.ts +0 -22
- package/es/table/table-virtual-list-item.js +0 -37
|
@@ -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",
|
package/json/vetur-tags.json
CHANGED
package/json/web-types.json
CHANGED
|
@@ -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.
|
|
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": "
|
|
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,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 };
|