tabula-vue 1.0.1 → 1.0.3

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