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