yc-pro-components 0.0.42 → 0.0.44

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 (207) hide show
  1. package/es/component.mjs +2 -0
  2. package/es/components/check-card/index.d.ts +61 -61
  3. package/es/components/check-card/src/index.vue.d.ts +4 -4
  4. package/es/components/check-card-group/index.d.ts +43 -43
  5. package/es/components/check-card-group/src/index.vue.d.ts +3 -3
  6. package/es/components/date-picker/index.d.ts +20 -20
  7. package/es/components/date-picker/src/index.vue.d.ts +12 -12
  8. package/es/components/dialog/index.d.ts +26 -26
  9. package/es/components/dialog/src/index.vue.d.ts +2 -2
  10. package/es/components/dialog-form/index.d.ts +31 -31
  11. package/es/components/dialog-form/src/index.vue.d.ts +9 -9
  12. package/es/components/display-item/index.d.ts +41 -41
  13. package/es/components/display-item/src/index.vue.d.ts +22 -22
  14. package/es/components/drawer-form/index.d.ts +65 -65
  15. package/es/components/drawer-form/src/index.vue.d.ts +15 -15
  16. package/es/components/form/index.d.ts +45 -45
  17. package/es/components/form/src/form-content.vue.d.ts +20 -20
  18. package/es/components/form/src/index.vue.d.ts +17 -17
  19. package/es/components/form-item/index.d.ts +48 -48
  20. package/es/components/form-item/src/index.vue.d.ts +14 -14
  21. package/es/components/header/index.d.ts +19 -19
  22. package/es/components/header/src/index.vue.d.ts +1 -1
  23. package/es/components/index.d.ts +1 -0
  24. package/es/components/index.mjs +4 -0
  25. package/es/components/input-tag/index.d.ts +15 -15
  26. package/es/components/input-tag/src/index.vue.d.ts +3 -3
  27. package/es/components/layout/index.d.ts +50 -50
  28. package/es/components/layout/src/index.vue.d.ts +11 -11
  29. package/es/components/page/index.d.ts +4166 -2538
  30. package/es/components/page/src/index.vue.d.ts +712 -137
  31. package/es/components/page/src/index.vue2.mjs +120 -31
  32. package/es/components/pagination/index.d.ts +42 -42
  33. package/es/components/pagination/src/index.vue.d.ts +3 -3
  34. package/es/components/radio/index.d.ts +35 -35
  35. package/es/components/radio/src/index.vue.d.ts +27 -27
  36. package/es/components/render/index.d.ts +3 -3
  37. package/es/components/render/src/index.vue.d.ts +1 -1
  38. package/es/components/search/index.d.ts +154 -154
  39. package/es/components/search/src/index.vue.d.ts +50 -50
  40. package/es/components/sidebar/index.d.ts +15 -15
  41. package/es/components/sidebar/src/index.vue.d.ts +5 -5
  42. package/es/components/steps-form/index.d.ts +23 -23
  43. package/es/components/steps-form/src/index.vue.d.ts +2 -2
  44. package/es/components/table/src/table-column.vue.d.ts +37 -37
  45. package/es/components/utils/index.d.ts +2 -2
  46. package/es/components/virtual-table/index.d.ts +646 -0
  47. package/es/components/virtual-table/index.mjs +8 -0
  48. package/es/components/virtual-table/src/index.vue.d.ts +139 -0
  49. package/es/components/virtual-table/src/index.vue.mjs +6 -0
  50. package/es/components/virtual-table/src/index.vue2.mjs +327 -0
  51. package/es/components/virtual-table/src/type.d.ts +295 -0
  52. package/es/components/virtual-table/src/type.mjs +1 -0
  53. package/es/components/virtual-table/src/use-column-adapter.d.ts +40 -0
  54. package/es/components/virtual-table/src/use-column-adapter.mjs +137 -0
  55. package/es/components/virtual-table/src/use-virtual-scroll.d.ts +35 -0
  56. package/es/components/virtual-table/src/use-virtual-scroll.mjs +71 -0
  57. package/es/components/virtual-table/src/use-virtual-selection.d.ts +40 -0
  58. package/es/components/virtual-table/src/use-virtual-selection.mjs +112 -0
  59. package/es/components/virtual-table/src/virtual-table-action-bar.d.ts +11 -0
  60. package/es/components/virtual-table/src/virtual-table-action-bar.mjs +121 -0
  61. package/es/components/virtual-table/src/virtual-table-cell-renderer.d.ts +16 -0
  62. package/es/components/virtual-table/src/virtual-table-cell-renderer.mjs +170 -0
  63. package/es/components/virtual-table/src/virtual-table-header-renderer.d.ts +10 -0
  64. package/es/components/virtual-table/src/virtual-table-header-renderer.mjs +51 -0
  65. package/es/components/virtual-table/style/css.d.ts +3 -0
  66. package/es/components/virtual-table/style/css.mjs +1 -0
  67. package/es/components/virtual-table/style/index.d.ts +12 -0
  68. package/es/components/virtual-table/style/index.mjs +1 -0
  69. package/es/components/yc-dialog/index.d.ts +24 -24
  70. package/es/components/yc-download-dialog/index.d.ts +19 -19
  71. package/es/components/yc-download-dialog/src/index.vue.d.ts +1 -1
  72. package/es/components/yc-form-container-header/index.d.ts +12 -12
  73. package/es/components/yc-more-actions/index.d.ts +46 -46
  74. package/es/components/yc-more-actions/src/index.vue.d.ts +3 -3
  75. package/es/components/yc-plus-page/src/index.vue.d.ts +2445 -1430
  76. package/es/components/yc-plus-page/src/index.vue.mjs +1 -1
  77. package/es/components/yc-plus-page/src/type.d.ts +8 -2
  78. package/es/components/yc-segmented/index.d.ts +2 -2
  79. package/es/components/yc-segmented/src/index.d.ts +2 -2
  80. package/es/components/yc-select-v2/src/index.vue.d.ts +3 -3
  81. package/es/components/yc-status-dialog/src/index.vue.d.ts +1 -1
  82. package/es/components/yc-tabs-with-filter/index.d.ts +16 -16
  83. package/es/components/yc-text/src/index.vue.d.ts +2 -2
  84. package/es/hooks/usePlusFormReset.d.ts +238 -238
  85. package/es/index.css +20 -1
  86. package/es/index.d.ts +1 -0
  87. package/es/index.mjs +4 -0
  88. package/es/yc-components/index.d.ts +1 -0
  89. package/index.css +111 -6
  90. package/index.js +1141 -149
  91. package/index.min.css +2 -1
  92. package/index.min.js +13 -10
  93. package/index.min.mjs +13 -10
  94. package/index.mjs +1139 -151
  95. package/lib/component.js +42 -40
  96. package/lib/components/check-card/index.d.ts +61 -61
  97. package/lib/components/check-card/src/index.vue.d.ts +4 -4
  98. package/lib/components/check-card-group/index.d.ts +43 -43
  99. package/lib/components/check-card-group/src/index.vue.d.ts +3 -3
  100. package/lib/components/date-picker/index.d.ts +20 -20
  101. package/lib/components/date-picker/src/index.vue.d.ts +12 -12
  102. package/lib/components/dialog/index.d.ts +26 -26
  103. package/lib/components/dialog/src/index.vue.d.ts +2 -2
  104. package/lib/components/dialog-form/index.d.ts +31 -31
  105. package/lib/components/dialog-form/src/index.vue.d.ts +9 -9
  106. package/lib/components/display-item/index.d.ts +41 -41
  107. package/lib/components/display-item/src/index.vue.d.ts +22 -22
  108. package/lib/components/drawer-form/index.d.ts +65 -65
  109. package/lib/components/drawer-form/src/index.vue.d.ts +15 -15
  110. package/lib/components/form/index.d.ts +45 -45
  111. package/lib/components/form/src/form-content.vue.d.ts +20 -20
  112. package/lib/components/form/src/index.vue.d.ts +17 -17
  113. package/lib/components/form-item/index.d.ts +48 -48
  114. package/lib/components/form-item/src/index.vue.d.ts +14 -14
  115. package/lib/components/header/index.d.ts +19 -19
  116. package/lib/components/header/src/index.vue.d.ts +1 -1
  117. package/lib/components/index.d.ts +1 -0
  118. package/lib/components/index.js +98 -90
  119. package/lib/components/input-tag/index.d.ts +15 -15
  120. package/lib/components/input-tag/src/index.vue.d.ts +3 -3
  121. package/lib/components/layout/index.d.ts +50 -50
  122. package/lib/components/layout/src/index.vue.d.ts +11 -11
  123. package/lib/components/page/index.d.ts +4166 -2538
  124. package/lib/components/page/src/index.vue.d.ts +712 -137
  125. package/lib/components/page/src/index.vue2.js +125 -36
  126. package/lib/components/pagination/index.d.ts +42 -42
  127. package/lib/components/pagination/src/index.vue.d.ts +3 -3
  128. package/lib/components/radio/index.d.ts +35 -35
  129. package/lib/components/radio/src/index.vue.d.ts +27 -27
  130. package/lib/components/render/index.d.ts +3 -3
  131. package/lib/components/render/src/index.vue.d.ts +1 -1
  132. package/lib/components/search/index.d.ts +154 -154
  133. package/lib/components/search/src/index.vue.d.ts +50 -50
  134. package/lib/components/sidebar/index.d.ts +15 -15
  135. package/lib/components/sidebar/src/index.vue.d.ts +5 -5
  136. package/lib/components/steps-form/index.d.ts +23 -23
  137. package/lib/components/steps-form/src/index.vue.d.ts +2 -2
  138. package/lib/components/table/src/table-column.vue.d.ts +37 -37
  139. package/lib/components/utils/index.d.ts +2 -2
  140. package/lib/components/virtual-table/index.d.ts +646 -0
  141. package/lib/components/virtual-table/index.js +13 -0
  142. package/lib/components/virtual-table/src/index.vue.d.ts +139 -0
  143. package/lib/components/virtual-table/src/index.vue.js +10 -0
  144. package/lib/components/virtual-table/src/index.vue2.js +331 -0
  145. package/lib/components/virtual-table/src/type.d.ts +295 -0
  146. package/lib/components/virtual-table/src/type.js +2 -0
  147. package/lib/components/virtual-table/src/use-column-adapter.d.ts +40 -0
  148. package/lib/components/virtual-table/src/use-column-adapter.js +139 -0
  149. package/lib/components/virtual-table/src/use-virtual-scroll.d.ts +35 -0
  150. package/lib/components/virtual-table/src/use-virtual-scroll.js +73 -0
  151. package/lib/components/virtual-table/src/use-virtual-selection.d.ts +40 -0
  152. package/lib/components/virtual-table/src/use-virtual-selection.js +114 -0
  153. package/lib/components/virtual-table/src/virtual-table-action-bar.d.ts +11 -0
  154. package/lib/components/virtual-table/src/virtual-table-action-bar.js +123 -0
  155. package/lib/components/virtual-table/src/virtual-table-cell-renderer.d.ts +16 -0
  156. package/lib/components/virtual-table/src/virtual-table-cell-renderer.js +172 -0
  157. package/lib/components/virtual-table/src/virtual-table-header-renderer.d.ts +10 -0
  158. package/lib/components/virtual-table/src/virtual-table-header-renderer.js +53 -0
  159. package/lib/components/virtual-table/style/css.d.ts +3 -0
  160. package/lib/components/virtual-table/style/css.js +2 -0
  161. package/lib/components/virtual-table/style/index.d.ts +12 -0
  162. package/lib/components/virtual-table/style/index.js +2 -0
  163. package/lib/components/yc-dialog/index.d.ts +24 -24
  164. package/lib/components/yc-download-dialog/index.d.ts +19 -19
  165. package/lib/components/yc-download-dialog/src/index.vue.d.ts +1 -1
  166. package/lib/components/yc-form-container-header/index.d.ts +12 -12
  167. package/lib/components/yc-more-actions/index.d.ts +46 -46
  168. package/lib/components/yc-more-actions/src/index.vue.d.ts +3 -3
  169. package/lib/components/yc-plus-page/src/index.vue.d.ts +2445 -1430
  170. package/lib/components/yc-plus-page/src/index.vue.js +1 -1
  171. package/lib/components/yc-plus-page/src/type.d.ts +8 -2
  172. package/lib/components/yc-segmented/index.d.ts +2 -2
  173. package/lib/components/yc-segmented/src/index.d.ts +2 -2
  174. package/lib/components/yc-select-v2/src/index.vue.d.ts +3 -3
  175. package/lib/components/yc-status-dialog/src/index.vue.d.ts +1 -1
  176. package/lib/components/yc-tabs-with-filter/index.d.ts +16 -16
  177. package/lib/components/yc-text/src/index.vue.d.ts +2 -2
  178. package/lib/hooks/usePlusFormReset.d.ts +238 -238
  179. package/lib/index.css +20 -1
  180. package/lib/index.d.ts +1 -0
  181. package/lib/index.js +143 -135
  182. package/lib/yc-components/index.d.ts +1 -0
  183. package/locale/en.js +1 -1
  184. package/locale/en.min.js +1 -1
  185. package/locale/en.min.mjs +1 -1
  186. package/locale/en.mjs +1 -1
  187. package/locale/ja.js +1 -1
  188. package/locale/ja.min.js +1 -1
  189. package/locale/ja.min.mjs +1 -1
  190. package/locale/ja.mjs +1 -1
  191. package/locale/ko.js +1 -1
  192. package/locale/ko.min.js +1 -1
  193. package/locale/ko.min.mjs +1 -1
  194. package/locale/ko.mjs +1 -1
  195. package/locale/zh-cn.js +1 -1
  196. package/locale/zh-cn.min.js +1 -1
  197. package/locale/zh-cn.min.mjs +1 -1
  198. package/locale/zh-cn.mjs +1 -1
  199. package/locale/zh-tw.js +1 -1
  200. package/locale/zh-tw.min.js +1 -1
  201. package/locale/zh-tw.min.mjs +1 -1
  202. package/locale/zh-tw.mjs +1 -1
  203. package/package.json +1 -1
  204. package/theme-chalk/index.css +1 -1
  205. package/theme-chalk/plus-virtual-table.css +1 -0
  206. package/theme-chalk/src/index.scss +3 -0
  207. package/theme-chalk/src/virtual-table.scss +128 -0
@@ -0,0 +1,139 @@
1
+ import { TableV2Instance } from 'element-plus';
2
+ import { DefineComponent, ComputedRef, ShallowRef, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+ import { ButtonsCallBackParams, ActionBarProps } from 'yc-pro-components/es/components/table';
4
+ import { PlusVirtualTableProps, VirtualTableColumn } from './type';
5
+ import { PageInfo, RecordType, PlusColumn } from 'yc-pro-components/es/types';
6
+ import { PlusPaginationProps } from 'yc-pro-components/es/components/pagination';
7
+
8
+ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PlusVirtualTableProps>, {
9
+ columns: () => never[];
10
+ tableData: () => never[];
11
+ data: () => never[];
12
+ pagination: boolean;
13
+ actionBar: boolean;
14
+ hasIndexColumn: boolean;
15
+ isSelection: boolean;
16
+ loadingStatus: boolean;
17
+ rowKey: string;
18
+ defaultSize: string;
19
+ rowHeight: number;
20
+ headerHeight: number;
21
+ fixed: boolean;
22
+ defaultColumnWidth: number;
23
+ columnsEmptyText: string;
24
+ scrollbarAlwaysOn: boolean;
25
+ titleBar: boolean;
26
+ selectionColumnWidth: number;
27
+ indexColumnWidth: number;
28
+ stripe: boolean;
29
+ border: boolean;
30
+ }>, {
31
+ getSelectionRows: () => RecordType[];
32
+ clearSelection: () => void;
33
+ toggleRowSelection: (row: RecordType, selected?: boolean | undefined) => void;
34
+ toggleAllSelection: (selected?: boolean | undefined) => void;
35
+ scrollToRow: (rowIndex: number) => void;
36
+ data: ComputedRef<RecordType[]>;
37
+ tableRef: ShallowRef< TableV2Instance | null>;
38
+ }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
39
+ paginationChange: (pageInfo: PageInfo) => void;
40
+ clickAction: (data: ButtonsCallBackParams) => void;
41
+ "selection-change": (selection: RecordType[]) => void;
42
+ select: (selection: RecordType[], row: RecordType) => void;
43
+ "select-all": (selection: RecordType[]) => void;
44
+ refresh: () => void;
45
+ "row-click": (rowData: RecordType, rowIndex: number) => void;
46
+ "sort-change": (data: {
47
+ column: VirtualTableColumn;
48
+ prop: string;
49
+ order: string | null;
50
+ }) => void;
51
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PlusVirtualTableProps>, {
52
+ columns: () => never[];
53
+ tableData: () => never[];
54
+ data: () => never[];
55
+ pagination: boolean;
56
+ actionBar: boolean;
57
+ hasIndexColumn: boolean;
58
+ isSelection: boolean;
59
+ loadingStatus: boolean;
60
+ rowKey: string;
61
+ defaultSize: string;
62
+ rowHeight: number;
63
+ headerHeight: number;
64
+ fixed: boolean;
65
+ defaultColumnWidth: number;
66
+ columnsEmptyText: string;
67
+ scrollbarAlwaysOn: boolean;
68
+ titleBar: boolean;
69
+ selectionColumnWidth: number;
70
+ indexColumnWidth: number;
71
+ stripe: boolean;
72
+ border: boolean;
73
+ }>>> & {
74
+ onSelect?: ((selection: RecordType[], row: RecordType) => any) | undefined;
75
+ onClickAction?: ((data: ButtonsCallBackParams) => any) | undefined;
76
+ "onSelect-all"?: ((selection: RecordType[]) => any) | undefined;
77
+ "onSelection-change"?: ((selection: RecordType[]) => any) | undefined;
78
+ "onSort-change"?: ((data: {
79
+ column: VirtualTableColumn;
80
+ prop: string;
81
+ order: string | null;
82
+ }) => any) | undefined;
83
+ "onRow-click"?: ((rowData: RecordType, rowIndex: number) => any) | undefined;
84
+ onRefresh?: (() => any) | undefined;
85
+ onPaginationChange?: ((pageInfo: PageInfo) => any) | undefined;
86
+ }, {
87
+ fixed: boolean;
88
+ data: RecordType[];
89
+ columns: PlusColumn[];
90
+ border: boolean;
91
+ rowKey: string;
92
+ actionBar: false | Partial< ActionBarProps>;
93
+ stripe: boolean;
94
+ scrollbarAlwaysOn: boolean;
95
+ titleBar: boolean | {
96
+ title?: string | undefined;
97
+ refresh?: boolean | undefined;
98
+ };
99
+ defaultSize: "" | "default" | "small" | "large";
100
+ tableData: RecordType[];
101
+ pagination: false | Partial<PlusPaginationProps>;
102
+ hasIndexColumn: boolean;
103
+ isSelection: boolean;
104
+ loadingStatus: boolean;
105
+ columnsEmptyText: string;
106
+ headerHeight: number;
107
+ rowHeight: number;
108
+ defaultColumnWidth: number;
109
+ selectionColumnWidth: number;
110
+ indexColumnWidth: number;
111
+ }, {}>, {
112
+ title?(_: {}): any;
113
+ toolbar?(_: {}): any;
114
+ "pagination-left"?(_: {}): any;
115
+ "pagination-right"?(_: {}): any;
116
+ }>;
117
+ export default _default;
118
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
119
+ type __VLS_TypePropsToRuntimeProps<T> = {
120
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
121
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
122
+ } : {
123
+ type: PropType<T[K]>;
124
+ required: true;
125
+ };
126
+ };
127
+ type __VLS_WithDefaults<P, D> = {
128
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
129
+ default: D[K];
130
+ }> : P[K];
131
+ };
132
+ type __VLS_Prettify<T> = {
133
+ [K in keyof T]: T[K];
134
+ } & {};
135
+ type __VLS_WithTemplateSlots<T, S> = T & {
136
+ new (): {
137
+ $slots: S;
138
+ };
139
+ };
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var index_vue_vue_type_script_setup_true_lang = require('./index.vue2.js');
6
+ var _pluginVue_exportHelper = require('../../../_virtual/_plugin-vue_export-helper.js');
7
+
8
+ var _VirtualTable = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__file", "index.vue"]]);
9
+
10
+ exports.default = _VirtualTable;
@@ -0,0 +1,331 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var elementPlus = require('element-plus');
7
+ var ElementPlusIconsVue = require('@element-plus/icons-vue');
8
+ var index = require('../../pagination/index.js');
9
+ var page = require('../../../constants/page.js');
10
+ var useColumnAdapter = require('./use-column-adapter.js');
11
+ var useVirtualSelection = require('./use-virtual-selection.js');
12
+ var useVirtualScroll = require('./use-virtual-scroll.js');
13
+
14
+ const _hoisted_1 = {
15
+ key: 0,
16
+ class: "plus-virtual-table__title-bar"
17
+ };
18
+ const _hoisted_2 = { class: "plus-virtual-table__title-bar__left" };
19
+ const _hoisted_3 = {
20
+ key: 0,
21
+ class: "plus-virtual-table__title-bar__text"
22
+ };
23
+ const _hoisted_4 = { class: "plus-virtual-table__title-bar__right" };
24
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
25
+ ...{
26
+ name: "PlusVirtualTable",
27
+ inheritAttrs: false
28
+ },
29
+ __name: "index",
30
+ props: {
31
+ columns: { default: () => [] },
32
+ tableData: { default: () => [] },
33
+ data: { default: () => [] },
34
+ pagination: { type: [Boolean, Object], default: false },
35
+ actionBar: { type: [Boolean, Object], default: false },
36
+ hasIndexColumn: { type: Boolean, default: false },
37
+ isSelection: { type: Boolean, default: false },
38
+ loadingStatus: { type: Boolean, default: false },
39
+ height: {},
40
+ width: {},
41
+ headerCellStyle: {},
42
+ rowKey: { default: "id" },
43
+ defaultSize: { default: "default" },
44
+ rowHeight: { default: 50 },
45
+ headerHeight: { default: 50 },
46
+ fixed: { type: Boolean, default: true },
47
+ defaultColumnWidth: { default: 150 },
48
+ columnsEmptyText: { default: "-" },
49
+ rowClass: {},
50
+ rowStyle: {},
51
+ scrollbarAlwaysOn: { type: Boolean, default: true },
52
+ titleBar: { type: [Boolean, Object], default: false },
53
+ selectionColumnWidth: { default: 50 },
54
+ indexColumnWidth: { default: 60 },
55
+ stripe: { type: Boolean, default: false },
56
+ border: { type: Boolean, default: false }
57
+ },
58
+ emits: ["paginationChange", "clickAction", "selection-change", "select", "select-all", "refresh", "row-click", "sort-change"],
59
+ setup(__props, { expose: __expose, emit: __emit }) {
60
+ var _a;
61
+ const props = __props;
62
+ const emit = __emit;
63
+ const tableData = vue.computed(() => {
64
+ var _a2;
65
+ return ((_a2 = props.tableData) == null ? void 0 : _a2.length) ? props.tableData : props.data;
66
+ });
67
+ const state = vue.reactive({
68
+ subPageInfo: {
69
+ ...((_a = props.pagination) == null ? void 0 : _a.modelValue) || page.DefaultPageInfo
70
+ }
71
+ });
72
+ vue.watch(
73
+ () => {
74
+ var _a2;
75
+ return (_a2 = props.pagination) == null ? void 0 : _a2.modelValue;
76
+ },
77
+ (newVal) => {
78
+ if (newVal) {
79
+ Object.assign(state.subPageInfo, newVal);
80
+ }
81
+ },
82
+ { deep: true }
83
+ );
84
+ const {
85
+ tableRef,
86
+ wrapperRef,
87
+ scrollToRow,
88
+ useAutoResizer,
89
+ containerStyle,
90
+ rowHeight,
91
+ headerHeight,
92
+ containerWidth
93
+ } = useVirtualScroll.useVirtualScroll({
94
+ height: () => props.height,
95
+ width: () => props.width,
96
+ rowHeight: () => props.rowHeight,
97
+ headerHeight: () => props.headerHeight
98
+ });
99
+ const selectionComposable = useVirtualSelection.useVirtualSelection({
100
+ rowKey: () => props.rowKey,
101
+ data: () => tableData.value,
102
+ onSelectionChange: (selection) => {
103
+ emit("selection-change", selection);
104
+ },
105
+ onSelect: (selection, row) => {
106
+ emit("select", selection, row);
107
+ },
108
+ onSelectAll: (selection) => {
109
+ emit("select-all", selection);
110
+ }
111
+ });
112
+ const { virtualColumns } = useColumnAdapter.useColumnAdapter({
113
+ columns: () => props.columns,
114
+ isSelection: () => props.isSelection,
115
+ hasIndexColumn: () => props.hasIndexColumn,
116
+ actionBar: () => props.actionBar,
117
+ rowKey: () => props.rowKey,
118
+ defaultColumnWidth: () => props.defaultColumnWidth,
119
+ columnsEmptyText: () => props.columnsEmptyText,
120
+ containerWidth: () => containerWidth.value,
121
+ pageInfo: () => {
122
+ if (!props.pagination) return void 0;
123
+ return state.subPageInfo;
124
+ },
125
+ selectionColumnWidth: () => props.selectionColumnWidth,
126
+ indexColumnWidth: () => props.indexColumnWidth,
127
+ selectionCellRenderer: () => selectionComposable.selectionCellRenderer,
128
+ selectionHeaderRenderer: () => selectionComposable.selectionHeaderRenderer,
129
+ onClickAction: (params) => {
130
+ emit("clickAction", params);
131
+ }
132
+ });
133
+ const showTitleBar = vue.computed(() => !!props.titleBar);
134
+ const titleBarConfig = vue.computed(() => {
135
+ if (typeof props.titleBar === "object") {
136
+ return props.titleBar;
137
+ }
138
+ return { refresh: false };
139
+ });
140
+ const fixedWidth = vue.computed(() => {
141
+ const w = props.width;
142
+ if (typeof w === "number") return w;
143
+ if (typeof w === "string") return parseInt(w, 10) || 700;
144
+ return 700;
145
+ });
146
+ const fixedHeight = vue.computed(() => {
147
+ const h = props.height;
148
+ if (typeof h === "number") return h;
149
+ if (typeof h === "string") return parseInt(h, 10) || 400;
150
+ return 400;
151
+ });
152
+ const rowEventHandlers = vue.computed(() => ({
153
+ onClick: (params) => {
154
+ emit("row-click", params.rowData, params.rowIndex);
155
+ }
156
+ }));
157
+ const wrapperClass = vue.computed(() => [
158
+ "plus-virtual-table",
159
+ {
160
+ "plus-virtual-table--striped": props.stripe,
161
+ "plus-virtual-table--border": props.border
162
+ }
163
+ ]);
164
+ const mergedRowClass = vue.computed(() => {
165
+ return (params) => {
166
+ const classes = [];
167
+ if (props.stripe && params.rowIndex % 2 === 1) {
168
+ classes.push("plus-virtual-table__row--striped");
169
+ }
170
+ const userClass = props.rowClass;
171
+ if (typeof userClass === "string") {
172
+ classes.push(userClass);
173
+ } else if (typeof userClass === "function") {
174
+ const result = userClass(params);
175
+ if (result) classes.push(result);
176
+ }
177
+ return classes.join(" ");
178
+ };
179
+ });
180
+ const headerClass = vue.computed(() => "plus-virtual-table__header");
181
+ const handlePaginationChange = () => {
182
+ emit("paginationChange", { ...state.subPageInfo });
183
+ };
184
+ const handleRefresh = () => {
185
+ emit("refresh");
186
+ };
187
+ const { subPageInfo } = vue.toRefs(state);
188
+ __expose({
189
+ getSelectionRows: selectionComposable.getSelectionRows,
190
+ clearSelection: selectionComposable.clearSelection,
191
+ toggleRowSelection: selectionComposable.toggleRowSelection,
192
+ toggleAllSelection: selectionComposable.toggleAllSelection,
193
+ scrollToRow,
194
+ data: tableData,
195
+ tableRef
196
+ });
197
+ return (_ctx, _cache) => {
198
+ return vue.openBlock(), vue.createElementBlock(
199
+ "div",
200
+ {
201
+ ref_key: "wrapperRef",
202
+ ref: wrapperRef,
203
+ class: vue.normalizeClass(wrapperClass.value)
204
+ },
205
+ [
206
+ vue.createCommentVNode(" \u6807\u9898\u680F\uFF08\u7B80\u5316\u7248\uFF09 "),
207
+ showTitleBar.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
208
+ vue.createElementVNode("div", _hoisted_2, [
209
+ vue.renderSlot(_ctx.$slots, "title", {}, () => [
210
+ titleBarConfig.value.title ? (vue.openBlock(), vue.createElementBlock(
211
+ "span",
212
+ _hoisted_3,
213
+ vue.toDisplayString(titleBarConfig.value.title),
214
+ 1
215
+ /* TEXT */
216
+ )) : vue.createCommentVNode("v-if", true)
217
+ ])
218
+ ]),
219
+ vue.createElementVNode("div", _hoisted_4, [
220
+ vue.renderSlot(_ctx.$slots, "toolbar"),
221
+ titleBarConfig.value.refresh ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElIcon), {
222
+ key: 0,
223
+ class: "plus-virtual-table__title-bar__refresh",
224
+ size: 16,
225
+ onClick: handleRefresh
226
+ }, {
227
+ default: vue.withCtx(() => [
228
+ vue.createVNode(vue.unref(ElementPlusIconsVue.Refresh))
229
+ ]),
230
+ _: 1
231
+ /* STABLE */
232
+ })) : vue.createCommentVNode("v-if", true)
233
+ ])
234
+ ])) : vue.createCommentVNode("v-if", true),
235
+ vue.createCommentVNode(" \u8868\u683C\u4E3B\u4F53 "),
236
+ vue.withDirectives((vue.openBlock(), vue.createElementBlock(
237
+ "div",
238
+ {
239
+ class: "plus-virtual-table__body",
240
+ style: vue.normalizeStyle(vue.unref(containerStyle))
241
+ },
242
+ [
243
+ vue.createCommentVNode(" \u81EA\u9002\u5E94\u6A21\u5F0F\uFF1A\u4F7F\u7528 AutoResizer \u81EA\u52A8\u83B7\u53D6\u7236\u5BB9\u5668\u5C3A\u5BF8 "),
244
+ vue.unref(useAutoResizer) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElAutoResizer), { key: 0 }, {
245
+ default: vue.withCtx(({ height: autoHeight, width: autoWidth }) => [
246
+ vue.createVNode(vue.unref(elementPlus.ElTableV2), {
247
+ ref_key: "tableRef",
248
+ ref: tableRef,
249
+ columns: vue.unref(virtualColumns),
250
+ data: tableData.value,
251
+ width: autoWidth,
252
+ height: autoHeight,
253
+ fixed: _ctx.fixed,
254
+ "row-key": _ctx.rowKey,
255
+ "row-height": vue.unref(rowHeight),
256
+ "header-height": vue.unref(headerHeight),
257
+ "row-class": mergedRowClass.value,
258
+ "row-event-handlers": rowEventHandlers.value,
259
+ "scrollbar-always-on": _ctx.scrollbarAlwaysOn,
260
+ "header-class": headerClass.value
261
+ }, null, 8, ["columns", "data", "width", "height", "fixed", "row-key", "row-height", "header-height", "row-class", "row-event-handlers", "scrollbar-always-on", "header-class"])
262
+ ]),
263
+ _: 1
264
+ /* STABLE */
265
+ })) : (vue.openBlock(), vue.createElementBlock(
266
+ vue.Fragment,
267
+ { key: 1 },
268
+ [
269
+ vue.createCommentVNode(" \u56FA\u5B9A\u5C3A\u5BF8\u6A21\u5F0F\uFF1A\u76F4\u63A5\u4F7F\u7528\u6307\u5B9A\u7684\u5BBD\u9AD8 "),
270
+ vue.createVNode(vue.unref(elementPlus.ElTableV2), {
271
+ ref_key: "tableRef",
272
+ ref: tableRef,
273
+ columns: vue.unref(virtualColumns),
274
+ data: tableData.value,
275
+ width: fixedWidth.value,
276
+ height: fixedHeight.value,
277
+ fixed: _ctx.fixed,
278
+ "row-key": _ctx.rowKey,
279
+ "row-height": vue.unref(rowHeight),
280
+ "header-height": vue.unref(headerHeight),
281
+ "row-class": mergedRowClass.value,
282
+ "row-event-handlers": rowEventHandlers.value,
283
+ "scrollbar-always-on": _ctx.scrollbarAlwaysOn,
284
+ "header-class": headerClass.value
285
+ }, null, 8, ["columns", "data", "width", "height", "fixed", "row-key", "row-height", "header-height", "row-class", "row-event-handlers", "scrollbar-always-on", "header-class"])
286
+ ],
287
+ 2112
288
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
289
+ ))
290
+ ],
291
+ 4
292
+ /* STYLE */
293
+ )), [
294
+ [vue.unref(elementPlus.vLoading), _ctx.loadingStatus]
295
+ ]),
296
+ vue.createCommentVNode(" \u5206\u9875 "),
297
+ _ctx.pagination ? (vue.openBlock(), vue.createBlock(vue.unref(index.PlusPagination), vue.mergeProps({
298
+ key: 1,
299
+ modelValue: vue.unref(subPageInfo),
300
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(subPageInfo) ? subPageInfo.value = $event : null)
301
+ }, _ctx.pagination, {
302
+ class: "plus-virtual-table__pagination",
303
+ onChange: handlePaginationChange
304
+ }), vue.createSlots({
305
+ _: 2
306
+ /* DYNAMIC */
307
+ }, [
308
+ _ctx.$slots["pagination-left"] ? {
309
+ name: "pagination-left",
310
+ fn: vue.withCtx(() => [
311
+ vue.renderSlot(_ctx.$slots, "pagination-left")
312
+ ]),
313
+ key: "0"
314
+ } : void 0,
315
+ _ctx.$slots["pagination-right"] ? {
316
+ name: "pagination-right",
317
+ fn: vue.withCtx(() => [
318
+ vue.renderSlot(_ctx.$slots, "pagination-right")
319
+ ]),
320
+ key: "1"
321
+ } : void 0
322
+ ]), 1040, ["modelValue"])) : vue.createCommentVNode("v-if", true)
323
+ ],
324
+ 2
325
+ /* CLASS */
326
+ );
327
+ };
328
+ }
329
+ });
330
+
331
+ exports.default = _sfc_main;