tabula-vue 1.0.1 → 1.0.2

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 (74) hide show
  1. package/es/component.mjs +2 -0
  2. package/es/components/index.d.ts +1 -0
  3. package/es/components/index.mjs +1 -0
  4. package/es/components/page/index.d.ts +8861 -5128
  5. package/es/components/page/src/index.vue.d.ts +1470 -268
  6. package/es/components/page/src/index.vue2.mjs +13 -3
  7. package/es/components/table-lite/index.d.ts +1783 -0
  8. package/es/components/table-lite/index.mjs +6 -0
  9. package/es/components/table-lite/src/index.vue.d.ts +672 -0
  10. package/es/components/table-lite/src/index.vue.mjs +6 -0
  11. package/es/components/table-lite/src/index.vue2.mjs +681 -0
  12. package/es/components/table-lite/src/type.d.ts +91 -0
  13. package/es/components/table-lite/src/type.mjs +1 -0
  14. package/es/components/table-lite/style/css.d.ts +16 -0
  15. package/es/components/table-lite/style/css.mjs +16 -0
  16. package/es/components/table-lite/style/index.d.ts +16 -0
  17. package/es/components/table-lite/style/index.mjs +16 -0
  18. package/es/index.mjs +1 -0
  19. package/es/version.d.ts +1 -1
  20. package/es/version.mjs +1 -1
  21. package/index.css +1 -1
  22. package/index.js +762 -84
  23. package/index.min.js +7 -3
  24. package/index.min.mjs +7 -3
  25. package/index.mjs +762 -85
  26. package/lib/component.js +42 -40
  27. package/lib/components/index.d.ts +1 -0
  28. package/lib/components/index.js +43 -41
  29. package/lib/components/page/index.d.ts +8861 -5128
  30. package/lib/components/page/src/index.vue.d.ts +1470 -268
  31. package/lib/components/page/src/index.vue2.js +15 -5
  32. package/lib/components/table-lite/index.d.ts +1783 -0
  33. package/lib/components/table-lite/index.js +8 -0
  34. package/lib/components/table-lite/src/index.vue.d.ts +672 -0
  35. package/lib/components/table-lite/src/index.vue.js +10 -0
  36. package/lib/components/table-lite/src/index.vue2.js +685 -0
  37. package/lib/components/table-lite/src/type.d.ts +91 -0
  38. package/lib/components/table-lite/src/type.js +2 -0
  39. package/lib/components/table-lite/style/css.d.ts +16 -0
  40. package/lib/components/table-lite/style/css.js +19 -0
  41. package/lib/components/table-lite/style/index.d.ts +16 -0
  42. package/lib/components/table-lite/style/index.js +19 -0
  43. package/lib/index.js +43 -41
  44. package/lib/version.d.ts +1 -1
  45. package/lib/version.js +1 -1
  46. package/locale/en.js +1 -1
  47. package/locale/en.min.js +1 -1
  48. package/locale/en.min.mjs +1 -1
  49. package/locale/en.mjs +1 -1
  50. package/locale/ja.js +1 -1
  51. package/locale/ja.min.js +1 -1
  52. package/locale/ja.min.mjs +1 -1
  53. package/locale/ja.mjs +1 -1
  54. package/locale/ko.js +1 -1
  55. package/locale/ko.min.js +1 -1
  56. package/locale/ko.min.mjs +1 -1
  57. package/locale/ko.mjs +1 -1
  58. package/locale/zh-cn.js +1 -1
  59. package/locale/zh-cn.min.js +1 -1
  60. package/locale/zh-cn.min.mjs +1 -1
  61. package/locale/zh-cn.mjs +1 -1
  62. package/locale/zh-hk.js +1 -1
  63. package/locale/zh-hk.min.js +1 -1
  64. package/locale/zh-hk.min.mjs +1 -1
  65. package/locale/zh-hk.mjs +1 -1
  66. package/locale/zh-tw.js +1 -1
  67. package/locale/zh-tw.min.js +1 -1
  68. package/locale/zh-tw.min.mjs +1 -1
  69. package/locale/zh-tw.mjs +1 -1
  70. package/package.json +1 -1
  71. package/theme-chalk/index.css +1 -1
  72. package/theme-chalk/plus-table-lite.css +1 -0
  73. package/theme-chalk/src/index.scss +1 -0
  74. package/theme-chalk/src/table-lite.scss +53 -0
@@ -0,0 +1,681 @@
1
+ import { defineComponent, shallowRef, ref, reactive, computed, createTextVNode, isVNode, h, watch, unref, onMounted, onBeforeUnmount, provide, openBlock, createElementBlock, createCommentVNode, createBlock, createSlots, withCtx, renderSlot, withDirectives, mergeProps, Fragment, renderList, createVNode, createElementVNode, normalizeStyle, toDisplayString, resolveDynamicComponent } from 'vue';
2
+ import { debounce } from 'lodash-es';
3
+ import { ElTable, ElTableColumn, ElCheckbox, ElTooltip, ElIcon, vLoading } from 'element-plus';
4
+ import { QuestionFilled } from '@element-plus/icons-vue';
5
+ import { PlusPagination } from '../../pagination/index.mjs';
6
+ import '../../../constants/index.mjs';
7
+ import { getLabel, getTableKey, getTableHeaderSlotName, getTableCellSlotName, getTooltip } from '../../utils/index.mjs';
8
+ import '../../../hooks/index.mjs';
9
+ import '../../table/index.mjs';
10
+ import { useLocale } from '../../../hooks/useLocale.mjs';
11
+ import { DefaultPageInfo } from '../../../constants/page.mjs';
12
+ import { useTableColumns } from '../../table/src/use-columns.mjs';
13
+ import { isString, isFunction, isPlainObject } from '../../utils/is.mjs';
14
+ import { TableFormRefInjectionKey } from '../../../constants/form.mjs';
15
+ import PlusTableTitleBar from '../../table/src/table-title-bar.vue.mjs';
16
+ import PlusTableActionBarContent from '../../table/src/table-action-bar-content.vue.mjs';
17
+
18
+ const _hoisted_1 = { class: "plus-table-lite__header" };
19
+ const _hoisted_2 = ["innerHTML"];
20
+ var _sfc_main = /* @__PURE__ */ defineComponent({
21
+ ...{
22
+ name: "PlusTableLite",
23
+ inheritAttrs: false
24
+ },
25
+ __name: "index",
26
+ props: {
27
+ tableData: { default: void 0 },
28
+ data: { default: void 0 },
29
+ columns: { default: () => [] },
30
+ defaultSize: { default: "default" },
31
+ pagination: { type: [Boolean, Object], default: false },
32
+ actionBar: { type: [Boolean, Object], default: false },
33
+ hasIndexColumn: { type: Boolean, default: false },
34
+ titleBar: { type: [Boolean, Object], default: true },
35
+ isSelection: { type: Boolean, default: false },
36
+ specialColumnsOrder: { default: void 0 },
37
+ loadingStatus: { type: Boolean, default: false },
38
+ rowKey: { type: [String, Function], default: "id" },
39
+ defaultSelectedKeys: { default: () => [] },
40
+ selectionTableColumnProps: { default: () => ({ width: 40 }) },
41
+ indexTableColumnProps: { default: () => ({}) },
42
+ indexContentStyle: { type: [Object, Function], default: () => ({}) },
43
+ headerCellStyle: { default: () => ({
44
+ "background-color": "var(--el-fill-color-light)"
45
+ }) },
46
+ emptyValue: { default: void 0 },
47
+ size: {},
48
+ width: {},
49
+ height: {},
50
+ maxHeight: {},
51
+ fit: { type: Boolean },
52
+ stripe: { type: Boolean },
53
+ border: { type: Boolean, default: true },
54
+ context: {},
55
+ showHeader: { type: Boolean },
56
+ showSummary: { type: Boolean },
57
+ sumText: {},
58
+ summaryMethod: {},
59
+ rowClassName: {},
60
+ rowStyle: {},
61
+ cellClassName: {},
62
+ cellStyle: {},
63
+ headerRowClassName: {},
64
+ headerRowStyle: {},
65
+ headerCellClassName: {},
66
+ highlightCurrentRow: { type: Boolean },
67
+ currentRowKey: {},
68
+ emptyText: {},
69
+ expandRowKeys: {},
70
+ defaultExpandAll: { type: Boolean },
71
+ defaultSort: {},
72
+ tooltipEffect: {},
73
+ tooltipOptions: {},
74
+ spanMethod: {},
75
+ selectOnIndeterminate: { type: Boolean },
76
+ indent: {},
77
+ treeProps: {},
78
+ lazy: { type: Boolean },
79
+ load: {},
80
+ className: {},
81
+ style: {},
82
+ tableLayout: {},
83
+ scrollbarAlwaysOn: { type: Boolean },
84
+ flexible: { type: Boolean },
85
+ showOverflowTooltip: { type: [Boolean, Object] }
86
+ },
87
+ emits: ["selection-change", "paginationChange", "clickAction", "clickActionConfirmCancel", "refresh", "filterTableHeader"],
88
+ setup(__props, { expose: __expose, emit: __emit }) {
89
+ var _a, _b;
90
+ const props = __props;
91
+ const emit = __emit;
92
+ const { t } = useLocale();
93
+ const tableInstance = shallowRef(null);
94
+ const wrapperInstance = ref(null);
95
+ const paginationInstance = ref(null);
96
+ const state = reactive({
97
+ size: props.defaultSize,
98
+ subPageInfo: {
99
+ ...((_a = props.pagination) == null ? void 0 : _a.modelValue) || DefaultPageInfo
100
+ }
101
+ });
102
+ const __tableData = computed(() => {
103
+ var _a2, _b2;
104
+ return (_b2 = (_a2 = props.tableData) != null ? _a2 : props.data) != null ? _b2 : [];
105
+ });
106
+ const { subColumns, filterColumns, columnsIsChange, setFilterColumns } = useTableColumns({
107
+ columns: () => props.columns || []
108
+ });
109
+ const resolveEmptyText = (column) => {
110
+ var _a2, _b2;
111
+ return (_b2 = (_a2 = column.emptyValue) != null ? _a2 : props.emptyValue) != null ? _b2 : "";
112
+ };
113
+ const toVNode = (result) => {
114
+ if (result === null || result === void 0 || result === "") return createTextVNode("");
115
+ if (isString(result) || typeof result === "number") return createTextVNode(String(result));
116
+ if (isVNode(result)) return result;
117
+ return h(result);
118
+ };
119
+ const getByPath = (target, path) => {
120
+ const keys = path.replace(/\[(\w+)\]/g, ".$1").split(".").filter(Boolean);
121
+ let current = target;
122
+ for (const key of keys) {
123
+ if (current === null || current === void 0) return void 0;
124
+ current = current[key];
125
+ }
126
+ return current;
127
+ };
128
+ const preparedColumns = computed(
129
+ () => subColumns.value.map((column) => {
130
+ const prop = column.prop;
131
+ const label = getLabel(column.label);
132
+ const isSimpleProp = !prop.includes(".") && !prop.includes("[");
133
+ const readValue = isSimpleProp ? (row) => row == null ? void 0 : row[prop] : (row) => getByPath(row, prop);
134
+ const cellText = (row, index) => {
135
+ const value = readValue(row);
136
+ if (isFunction(column.formatter)) {
137
+ const formatted = column.formatter(value, { row, column, index });
138
+ return String(
139
+ formatted === null || formatted === void 0 ? resolveEmptyText(column) : formatted
140
+ );
141
+ }
142
+ return value === null || value === void 0 || value === "" ? String(resolveEmptyText(column)) : String(value);
143
+ };
144
+ const prepared = {
145
+ key: getTableKey(column, true),
146
+ prop,
147
+ column,
148
+ tableColumnProps: column.tableColumnProps || {},
149
+ label,
150
+ width: column.width,
151
+ minWidth: column.minWidth,
152
+ headerSlotName: getTableHeaderSlotName(prop),
153
+ cellSlotName: getTableCellSlotName(prop),
154
+ tooltip: !!column.tooltip,
155
+ tooltipProps: getTooltip(column.tooltip),
156
+ readValue,
157
+ cellText
158
+ };
159
+ if (isFunction(column.renderHeader)) {
160
+ prepared.headerRender = () => {
161
+ var _a2;
162
+ return toVNode((_a2 = column.renderHeader) == null ? void 0 : _a2.call(column, label, column));
163
+ };
164
+ }
165
+ if (isFunction(column.render)) {
166
+ prepared.cellRender = ({ row, index }) => {
167
+ var _a2;
168
+ return toVNode((_a2 = column.render) == null ? void 0 : _a2.call(column, readValue(row), { row, column, index }));
169
+ };
170
+ } else if (isFunction(column.renderHTML)) {
171
+ prepared.cellHTML = (row, index) => {
172
+ var _a2, _b2;
173
+ return String((_b2 = (_a2 = column.renderHTML) == null ? void 0 : _a2.call(column, readValue(row), { row, column, index })) != null ? _b2 : "");
174
+ };
175
+ }
176
+ return prepared;
177
+ })
178
+ );
179
+ const getRowKeyValue = (row) => {
180
+ const { rowKey } = props;
181
+ if (isFunction(rowKey)) return rowKey(row);
182
+ return row == null ? void 0 : row[rowKey];
183
+ };
184
+ const selectedKeys = ref(new Set(props.defaultSelectedKeys));
185
+ let selectedRowCache = /* @__PURE__ */ new Map();
186
+ function isRowSelectable(row, index) {
187
+ var _a2;
188
+ const selectable = (_a2 = props.selectionTableColumnProps) == null ? void 0 : _a2.selectable;
189
+ return isFunction(selectable) ? selectable(row, index) !== false : true;
190
+ }
191
+ const selectableRows = computed(
192
+ () => __tableData.value.filter((row, index) => isRowSelectable(row, index))
193
+ );
194
+ const isRowSelected = (row) => {
195
+ const key = getRowKeyValue(row);
196
+ return key === void 0 ? false : selectedKeys.value.has(key);
197
+ };
198
+ const isAllSelected = computed(
199
+ () => selectableRows.value.length > 0 && selectableRows.value.every((row) => selectedKeys.value.has(getRowKeyValue(row)))
200
+ );
201
+ const isIndeterminate = computed(
202
+ () => !isAllSelected.value && selectableRows.value.some((row) => selectedKeys.value.has(getRowKeyValue(row)))
203
+ );
204
+ const getSelectedRows = () => {
205
+ const rows = [];
206
+ selectedRowCache.forEach((row, key) => {
207
+ if (selectedKeys.value.has(key)) rows.push(row);
208
+ });
209
+ return rows;
210
+ };
211
+ const handleToggleRow = (row, checked) => {
212
+ const key = getRowKeyValue(row);
213
+ if (key === void 0) return;
214
+ if (checked) {
215
+ selectedKeys.value.add(key);
216
+ selectedRowCache.set(key, row);
217
+ } else {
218
+ selectedKeys.value.delete(key);
219
+ selectedRowCache.delete(key);
220
+ }
221
+ emit("selection-change", getSelectedRows());
222
+ };
223
+ const handleToggleAll = () => {
224
+ const nextAllSelected = !isAllSelected.value;
225
+ selectableRows.value.forEach((row) => {
226
+ const key = getRowKeyValue(row);
227
+ if (key === void 0) return;
228
+ if (nextAllSelected) {
229
+ selectedKeys.value.add(key);
230
+ selectedRowCache.set(key, row);
231
+ } else {
232
+ selectedKeys.value.delete(key);
233
+ selectedRowCache.delete(key);
234
+ }
235
+ });
236
+ emit("selection-change", getSelectedRows());
237
+ };
238
+ const clearSelection = () => {
239
+ selectedKeys.value = /* @__PURE__ */ new Set();
240
+ selectedRowCache = /* @__PURE__ */ new Map();
241
+ };
242
+ const syncSelectedRowCache = (rows) => {
243
+ if (!selectedKeys.value.size || !(rows == null ? void 0 : rows.length)) return;
244
+ rows.forEach((row) => {
245
+ const key = getRowKeyValue(row);
246
+ if (key !== void 0 && selectedKeys.value.has(key)) {
247
+ selectedRowCache.set(key, row);
248
+ }
249
+ });
250
+ };
251
+ watch(
252
+ () => __tableData.value,
253
+ (rows) => syncSelectedRowCache(rows || []),
254
+ { immediate: true }
255
+ );
256
+ watch(
257
+ () => props.defaultSelectedKeys,
258
+ (keys) => {
259
+ if (!(keys == null ? void 0 : keys.length)) return;
260
+ keys.forEach((key) => selectedKeys.value.add(key));
261
+ syncSelectedRowCache(__tableData.value);
262
+ }
263
+ );
264
+ const specialColumns = computed(() => {
265
+ const active = [];
266
+ if (props.isSelection) active.push("selection");
267
+ if (props.hasIndexColumn) active.push("index");
268
+ const defaultOrder = ["selection", "index"];
269
+ const order = [...props.specialColumnsOrder || [], ...defaultOrder].filter(
270
+ (item, index, array) => array.indexOf(item) === index
271
+ );
272
+ return order.filter((item) => active.includes(item));
273
+ });
274
+ const selectionProps = computed(() => props.selectionTableColumnProps || {});
275
+ const selectionWidth = computed(() => selectionProps.value.width || 40);
276
+ const selectionAlign = computed(() => selectionProps.value.align || "center");
277
+ const selectionFixed = computed(
278
+ () => {
279
+ var _a2;
280
+ return (_a2 = selectionProps.value.fixed) != null ? _a2 : "left";
281
+ }
282
+ );
283
+ const indexProps = computed(() => props.indexTableColumnProps || {});
284
+ const indexFixed = computed(
285
+ () => indexProps.value.fixed || "left"
286
+ );
287
+ const getIndexValue = (index) => {
288
+ const customIndex = indexProps.value.index;
289
+ if (isFunction(customIndex)) return customIndex(index);
290
+ if (typeof customIndex === "number") return customIndex;
291
+ const { page, pageSize } = state.subPageInfo;
292
+ return (page - 1) * pageSize + index + 1;
293
+ };
294
+ const getIndexStyle = (row, index) => {
295
+ const style = props.indexContentStyle;
296
+ if (isFunction(style)) return style(row, index);
297
+ if (isPlainObject(style)) return style;
298
+ return {};
299
+ };
300
+ const actionBarLabel = computed(
301
+ () => props.actionBar ? unref(props.actionBar.label) || t("plus.table.action") : ""
302
+ );
303
+ const actionBarFixed = computed(
304
+ () => (props.actionBar ? props.actionBar.fixed : void 0) || "right"
305
+ );
306
+ const handlePaginationChange = () => {
307
+ emit("paginationChange", { ...state.subPageInfo });
308
+ };
309
+ const handleRefresh = () => emit("refresh");
310
+ const handleClickDensity = (size) => {
311
+ state.size = size;
312
+ };
313
+ const handleFilterTableConfirm = (list, eventType) => {
314
+ setFilterColumns(list);
315
+ emit("filterTableHeader", list, eventType);
316
+ };
317
+ const adaptiveHeight = ref();
318
+ const resolvedHeight = computed(() => {
319
+ const height = props.height;
320
+ return height !== void 0 ? height : adaptiveHeight.value;
321
+ });
322
+ const hasAdaptive = computed(() => props.height === void 0 && !!props.adaptive);
323
+ const calcAdaptiveHeight = () => {
324
+ var _a2;
325
+ if (!wrapperInstance.value) return;
326
+ let offsetBottom = 20;
327
+ if (isPlainObject(props.adaptive)) {
328
+ offsetBottom = (_a2 = props.adaptive.offsetBottom) != null ? _a2 : offsetBottom;
329
+ }
330
+ const paginationHeight = paginationInstance.value && props.pagination ? paginationInstance.value.$el.offsetHeight : 0;
331
+ const top = wrapperInstance.value.getBoundingClientRect().top;
332
+ adaptiveHeight.value = Math.max(window.innerHeight - top - offsetBottom - paginationHeight, 100);
333
+ };
334
+ const debounceCalcAdaptiveHeight = debounce(
335
+ calcAdaptiveHeight,
336
+ isPlainObject(props.adaptive) ? (_b = props.adaptive.timeout) != null ? _b : 60 : 60
337
+ );
338
+ onMounted(() => {
339
+ if (hasAdaptive.value) {
340
+ calcAdaptiveHeight();
341
+ window.addEventListener("resize", debounceCalcAdaptiveHeight);
342
+ }
343
+ });
344
+ onBeforeUnmount(() => {
345
+ window.removeEventListener("resize", debounceCalcAdaptiveHeight);
346
+ });
347
+ provide(TableFormRefInjectionKey, shallowRef({}));
348
+ __expose({
349
+ /** el-table 实例,可用于 doLayout 等 */
350
+ tableInstance,
351
+ /** 获取所有已选行(跨页累计) */
352
+ getSelectedRows,
353
+ /** 清空所有已选(跨页) */
354
+ clearSelection,
355
+ /** 当前已选 rowKey 列表 */
356
+ getSelectedKeys: () => Array.from(selectedKeys.value)
357
+ });
358
+ return (_ctx, _cache) => {
359
+ return openBlock(), createElementBlock(
360
+ "div",
361
+ {
362
+ ref_key: "wrapperInstance",
363
+ ref: wrapperInstance,
364
+ class: "plus-table-lite"
365
+ },
366
+ [
367
+ createCommentVNode(" \u6807\u9898\u680F\uFF1A\u5237\u65B0 / \u5BC6\u5EA6 / \u5217\u8BBE\u7F6E\uFF0C\u4E0E PlusTable \u5171\u7528\u540C\u4E00\u4EFD\u5B9E\u73B0 "),
368
+ _ctx.titleBar ? (openBlock(), createBlock(unref(PlusTableTitleBar), {
369
+ key: 0,
370
+ "origin-columns": _ctx.columns || [],
371
+ columns: unref(filterColumns),
372
+ "default-size": state.size,
373
+ "columns-is-change": unref(columnsIsChange),
374
+ "title-bar": _ctx.titleBar,
375
+ onClickDensity: handleClickDensity,
376
+ onFilterTableHeader: handleFilterTableConfirm,
377
+ onRefresh: handleRefresh
378
+ }, createSlots({
379
+ title: withCtx(() => [
380
+ renderSlot(_ctx.$slots, "title")
381
+ ]),
382
+ toolbar: withCtx(() => [
383
+ renderSlot(_ctx.$slots, "toolbar")
384
+ ]),
385
+ _: 2
386
+ /* DYNAMIC */
387
+ }, [
388
+ _ctx.$slots["drag-sort-icon"] ? {
389
+ name: "drag-sort-icon",
390
+ fn: withCtx(() => [
391
+ renderSlot(_ctx.$slots, "drag-sort-icon")
392
+ ]),
393
+ key: "0"
394
+ } : void 0,
395
+ _ctx.$slots["column-settings-icon"] ? {
396
+ name: "column-settings-icon",
397
+ fn: withCtx(() => [
398
+ renderSlot(_ctx.$slots, "column-settings-icon")
399
+ ]),
400
+ key: "1"
401
+ } : void 0,
402
+ _ctx.$slots["density-icon"] ? {
403
+ name: "density-icon",
404
+ fn: withCtx(() => [
405
+ renderSlot(_ctx.$slots, "density-icon")
406
+ ]),
407
+ key: "2"
408
+ } : void 0
409
+ ]), 1032, ["origin-columns", "columns", "default-size", "columns-is-change", "title-bar"])) : createCommentVNode("v-if", true),
410
+ withDirectives((openBlock(), createBlock(unref(ElTable), mergeProps({
411
+ ref_key: "tableInstance",
412
+ ref: tableInstance,
413
+ data: __tableData.value,
414
+ border: _ctx.border,
415
+ height: resolvedHeight.value,
416
+ "header-cell-style": _ctx.headerCellStyle,
417
+ size: state.size,
418
+ "row-key": _ctx.rowKey
419
+ }, _ctx.$attrs), {
420
+ empty: withCtx(() => [
421
+ renderSlot(_ctx.$slots, "empty")
422
+ ]),
423
+ default: withCtx(() => [
424
+ (openBlock(true), createElementBlock(
425
+ Fragment,
426
+ null,
427
+ renderList(specialColumns.value, (type) => {
428
+ return openBlock(), createElementBlock(
429
+ Fragment,
430
+ { key: type },
431
+ [
432
+ createCommentVNode("\n \u591A\u9009\u5217\n \u52FE\u9009\u72B6\u6001\u7531\u7EC4\u4EF6\u81EA\u8EAB\u7684 selectedKeys \u7EF4\u62A4\uFF0C\u56E0\u6B64\u7FFB\u9875\u540E\u4F9D\u7136\u4FDD\u7559\uFF1B\n \u4E0D\u4F7F\u7528 el-table \u5185\u7F6E\u7684 reserve-selection\uFF08\u5176\u884C\u4E3A\u4F9D\u8D56 selection \u5185\u90E8\u72B6\u6001\uFF0C\u8DE8\u9875\u4E0D\u53EF\u9760\uFF09\u3002\n "),
433
+ type === "selection" ? (openBlock(), createBlock(unref(ElTableColumn), {
434
+ key: "selection",
435
+ "class-name": "plus-table-lite-selection",
436
+ width: selectionWidth.value,
437
+ align: selectionAlign.value,
438
+ fixed: selectionFixed.value
439
+ }, {
440
+ header: withCtx(() => [
441
+ createVNode(unref(ElCheckbox), {
442
+ "model-value": isAllSelected.value,
443
+ indeterminate: isIndeterminate.value,
444
+ onChange: handleToggleAll
445
+ }, null, 8, ["model-value", "indeterminate"])
446
+ ]),
447
+ default: withCtx(({ row, $index }) => [
448
+ createVNode(unref(ElCheckbox), {
449
+ "model-value": isRowSelected(row),
450
+ disabled: !isRowSelectable(row, $index),
451
+ onChange: (checked) => handleToggleRow(row, !!checked)
452
+ }, null, 8, ["model-value", "disabled", "onChange"])
453
+ ]),
454
+ _: 1
455
+ /* STABLE */
456
+ }, 8, ["width", "align", "fixed"])) : (openBlock(), createElementBlock(
457
+ Fragment,
458
+ { key: 1 },
459
+ [
460
+ createCommentVNode(" \u5E8F\u53F7\u5217 "),
461
+ createVNode(unref(ElTableColumn), {
462
+ key: "index",
463
+ type: "index",
464
+ label: "#",
465
+ "class-name": "plus-table-lite-index",
466
+ width: indexProps.value.width || 60,
467
+ fixed: indexFixed.value,
468
+ align: "center",
469
+ index: getIndexValue
470
+ }, {
471
+ default: withCtx(({ $index }) => [
472
+ createElementVNode(
473
+ "div",
474
+ {
475
+ class: "plus-table-lite-index__content",
476
+ style: normalizeStyle(getIndexStyle(__tableData.value[$index], $index))
477
+ },
478
+ toDisplayString(getIndexValue($index)),
479
+ 5
480
+ /* TEXT, STYLE */
481
+ )
482
+ ]),
483
+ _: 1
484
+ /* STABLE */
485
+ }, 8, ["width", "fixed"])
486
+ ],
487
+ 2112
488
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
489
+ ))
490
+ ],
491
+ 64
492
+ /* STABLE_FRAGMENT */
493
+ );
494
+ }),
495
+ 128
496
+ /* KEYED_FRAGMENT */
497
+ )),
498
+ (openBlock(true), createElementBlock(
499
+ Fragment,
500
+ null,
501
+ renderList(preparedColumns.value, (col) => {
502
+ return openBlock(), createBlock(unref(ElTableColumn), mergeProps({
503
+ key: col.key
504
+ }, col.tableColumnProps, {
505
+ prop: col.prop,
506
+ label: col.label,
507
+ width: col.width,
508
+ "min-width": col.minWidth
509
+ }), {
510
+ header: withCtx((scoped) => [
511
+ createElementVNode("span", _hoisted_1, [
512
+ renderSlot(_ctx.$slots, col.headerSlotName, mergeProps(scoped, {
513
+ prop: col.prop,
514
+ label: col.label,
515
+ column: col.column
516
+ }), () => [
517
+ col.headerRender ? (openBlock(), createBlock(resolveDynamicComponent(col.headerRender), { key: 0 })) : (openBlock(), createElementBlock(
518
+ Fragment,
519
+ { key: 1 },
520
+ [
521
+ createTextVNode(
522
+ toDisplayString(col.label),
523
+ 1
524
+ /* TEXT */
525
+ )
526
+ ],
527
+ 64
528
+ /* STABLE_FRAGMENT */
529
+ ))
530
+ ]),
531
+ col.tooltip ? (openBlock(), createBlock(
532
+ unref(ElTooltip),
533
+ mergeProps({
534
+ key: 0,
535
+ placement: "top"
536
+ }, col.tooltipProps),
537
+ {
538
+ default: withCtx(() => [
539
+ renderSlot(_ctx.$slots, "tooltip-icon", {}, () => [
540
+ createVNode(unref(ElIcon), {
541
+ class: "plus-table-lite__header__icon",
542
+ size: 16
543
+ }, {
544
+ default: withCtx(() => [
545
+ createVNode(unref(QuestionFilled))
546
+ ]),
547
+ _: 1
548
+ /* STABLE */
549
+ })
550
+ ])
551
+ ]),
552
+ _: 2
553
+ /* DYNAMIC */
554
+ },
555
+ 1040
556
+ /* FULL_PROPS, DYNAMIC_SLOTS */
557
+ )) : createCommentVNode("v-if", true)
558
+ ])
559
+ ]),
560
+ default: withCtx(({ row, $index }) => [
561
+ renderSlot(_ctx.$slots, col.cellSlotName, {
562
+ row,
563
+ index: $index,
564
+ value: col.readValue(row),
565
+ column: col.column
566
+ }, () => [
567
+ createCommentVNode(" \u81EA\u5B9A\u4E49 render\uFF1A\u552F\u4E00\u9700\u8981\u7EC4\u4EF6\u7684\u4F4D\u7F6E\uFF0C\u6309\u5217\u521B\u5EFA\u4E00\u6B21 "),
568
+ col.cellRender ? (openBlock(), createBlock(resolveDynamicComponent(col.cellRender), {
569
+ key: 0,
570
+ row,
571
+ index: $index
572
+ }, null, 8, ["row", "index"])) : col.cellHTML ? (openBlock(), createElementBlock(
573
+ Fragment,
574
+ { key: 1 },
575
+ [
576
+ createCommentVNode(" renderHTML "),
577
+ createElementVNode("span", {
578
+ innerHTML: col.cellHTML(row, $index)
579
+ }, null, 8, _hoisted_2)
580
+ ],
581
+ 2112
582
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
583
+ )) : (openBlock(), createElementBlock(
584
+ Fragment,
585
+ { key: 2 },
586
+ [
587
+ createCommentVNode(" \u7EAF\u6587\u672C\uFF1A\u96F6\u5B9E\u4F8B "),
588
+ createTextVNode(
589
+ toDisplayString(col.cellText(row, $index)),
590
+ 1
591
+ /* TEXT */
592
+ )
593
+ ],
594
+ 64
595
+ /* STABLE_FRAGMENT */
596
+ ))
597
+ ])
598
+ ]),
599
+ _: 2
600
+ /* DYNAMIC */
601
+ }, 1040, ["prop", "label", "width", "min-width"]);
602
+ }),
603
+ 128
604
+ /* KEYED_FRAGMENT */
605
+ )),
606
+ _ctx.actionBar ? (openBlock(), createBlock(unref(ElTableColumn), mergeProps({
607
+ key: 0,
608
+ "class-name": "plus-table-action-bar",
609
+ label: actionBarLabel.value,
610
+ fixed: actionBarFixed.value,
611
+ width: _ctx.actionBar.width || 200
612
+ }, _ctx.actionBar.actionBarTableColumnProps), {
613
+ default: withCtx(({ row, $index }) => [
614
+ createVNode(unref(PlusTableActionBarContent), {
615
+ row,
616
+ index: $index,
617
+ type: _ctx.actionBar.type,
618
+ buttons: _ctx.actionBar.buttons,
619
+ "show-number": _ctx.actionBar.showNumber,
620
+ "show-limit-include-more": _ctx.actionBar.showLimitIncludeMore,
621
+ "confirm-type": _ctx.actionBar.confirmType,
622
+ "more-type": _ctx.actionBar.moreType,
623
+ onClickAction: _cache[0] || (_cache[0] = (data) => emit("clickAction", data)),
624
+ onClickActionConfirmCancel: _cache[1] || (_cache[1] = (data) => emit("clickActionConfirmCancel", data))
625
+ }, createSlots({
626
+ _: 2
627
+ /* DYNAMIC */
628
+ }, [
629
+ _ctx.$slots["action-bar-more-icon"] ? {
630
+ name: "action-bar-more-icon",
631
+ fn: withCtx(() => [
632
+ renderSlot(_ctx.$slots, "action-bar-more-icon")
633
+ ]),
634
+ key: "0"
635
+ } : void 0
636
+ ]), 1032, ["row", "index", "type", "buttons", "show-number", "show-limit-include-more", "confirm-type", "more-type"])
637
+ ]),
638
+ _: 3
639
+ /* FORWARDED */
640
+ }, 16, ["label", "fixed", "width"])) : createCommentVNode("v-if", true)
641
+ ]),
642
+ _: 3
643
+ /* FORWARDED */
644
+ }, 16, ["data", "border", "height", "header-cell-style", "size", "row-key"])), [
645
+ [unref(vLoading), _ctx.loadingStatus]
646
+ ]),
647
+ createCommentVNode(" \u5206\u9875 "),
648
+ _ctx.pagination ? (openBlock(), createBlock(unref(PlusPagination), mergeProps({
649
+ key: 1,
650
+ ref_key: "paginationInstance",
651
+ ref: paginationInstance,
652
+ modelValue: state.subPageInfo,
653
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => state.subPageInfo = $event)
654
+ }, _ctx.pagination, { onChange: handlePaginationChange }), createSlots({
655
+ _: 2
656
+ /* DYNAMIC */
657
+ }, [
658
+ _ctx.$slots["pagination-left"] ? {
659
+ name: "pagination-left",
660
+ fn: withCtx(() => [
661
+ renderSlot(_ctx.$slots, "pagination-left")
662
+ ]),
663
+ key: "0"
664
+ } : void 0,
665
+ _ctx.$slots["pagination-right"] ? {
666
+ name: "pagination-right",
667
+ fn: withCtx(() => [
668
+ renderSlot(_ctx.$slots, "pagination-right")
669
+ ]),
670
+ key: "1"
671
+ } : void 0
672
+ ]), 1040, ["modelValue"])) : createCommentVNode("v-if", true)
673
+ ],
674
+ 512
675
+ /* NEED_PATCH */
676
+ );
677
+ };
678
+ }
679
+ });
680
+
681
+ export { _sfc_main as default };