vue-devui 1.0.0-rc.11 → 1.0.0-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +160 -149
- package/auto-complete/index.es.js +182 -10
- package/auto-complete/index.umd.js +18 -18
- package/auto-complete/style.css +1 -1
- package/badge/index.es.js +3 -1
- package/badge/index.umd.js +1 -1
- package/button/index.es.js +5 -3
- package/button/index.umd.js +6 -6
- package/button/style.css +1 -1
- package/checkbox/index.es.js +1 -1
- package/checkbox/index.umd.js +4 -4
- package/checkbox/style.css +1 -1
- package/collapse/index.es.js +20 -186
- package/collapse/index.umd.js +1 -1
- package/collapse/style.css +1 -1
- package/countdown/index.es.js +56 -13
- package/countdown/index.umd.js +1 -1
- package/{date-picker → date-picker-pro}/index.d.ts +0 -0
- package/date-picker-pro/index.es.js +12016 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/dropdown/index.es.js +9 -2
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.es.js +248 -56
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1 -1
- package/form/index.umd.js +4 -4
- package/icon/index.es.js +5 -3
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +193 -15
- package/input/index.umd.js +14 -14
- package/input/style.css +1 -1
- package/input-number/index.es.js +1 -4
- package/input-number/index.umd.js +1 -1
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/modal/index.es.js +5 -3
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +32 -34
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/package.json +1 -1
- package/pagination/index.es.js +175 -7
- package/pagination/index.umd.js +1 -1
- package/radio/index.es.js +1 -1
- package/radio/index.umd.js +4 -4
- package/result/index.es.js +5 -3
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +198 -18
- package/search/index.umd.js +13 -13
- package/search/style.css +1 -1
- package/select/index.es.js +382 -258
- package/select/index.umd.js +15 -15
- package/select/style.css +1 -1
- package/splitter/index.es.js +182 -12
- package/splitter/index.umd.js +13 -13
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/{date-picker → steps}/package.json +1 -1
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +1 -1
- package/switch/index.umd.js +4 -4
- package/table/index.es.js +851 -294
- package/table/index.umd.js +16 -16
- package/table/style.css +1 -1
- package/tabs/index.es.js +22 -12
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/textarea/index.es.js +3 -2
- package/textarea/index.umd.js +6 -6
- package/time-picker/index.d.ts +7 -0
- package/{date-picker → time-picker}/index.es.js +1537 -1040
- package/time-picker/index.umd.js +27 -0
- package/time-picker/package.json +7 -0
- package/time-picker/style.css +1 -0
- package/time-select/index.es.js +383 -258
- package/time-select/index.umd.js +16 -16
- package/time-select/style.css +1 -1
- package/timeline/index.es.js +5 -3
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +1 -1
- package/tooltip/index.umd.js +1 -1
- package/tree/index.es.js +551 -88
- package/tree/index.umd.js +15 -15
- package/tree/style.css +1 -1
- package/upload/index.es.js +230 -57
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +14310 -11217
- package/vue-devui.umd.js +23 -23
- package/date-picker/index.umd.js +0 -27
- package/date-picker/style.css +0 -1
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
package/table/index.es.js
CHANGED
|
@@ -33,7 +33,7 @@ var __publicField = (obj, key, value) => {
|
|
|
33
33
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
34
|
return value;
|
|
35
35
|
};
|
|
36
|
-
import { computed, ref, watchEffect,
|
|
36
|
+
import { computed, ref, watchEffect, watch, getCurrentInstance, unref, defineComponent, inject, createVNode, mergeProps, toRefs, onMounted, onUnmounted, Transition, nextTick, Comment, Text, h, Fragment, withDirectives, cloneVNode, provide, Teleport, vShow, resolveDynamicComponent, render, resolveDirective, toRef, reactive, createTextVNode, onBeforeUnmount, isVNode, onBeforeMount, onUpdated } from "vue";
|
|
37
37
|
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
38
38
|
import { onClickOutside } from "@vueuse/core";
|
|
39
39
|
const tableProps = {
|
|
@@ -111,7 +111,8 @@ const tableProps = {
|
|
|
111
111
|
default: true
|
|
112
112
|
},
|
|
113
113
|
rowKey: {
|
|
114
|
-
type: String
|
|
114
|
+
type: [Function, String],
|
|
115
|
+
default: "id"
|
|
115
116
|
},
|
|
116
117
|
defaultExpandAll: {
|
|
117
118
|
type: Boolean,
|
|
@@ -120,8 +121,9 @@ const tableProps = {
|
|
|
120
121
|
expandRowKeys: {
|
|
121
122
|
type: Array
|
|
122
123
|
},
|
|
123
|
-
|
|
124
|
-
type:
|
|
124
|
+
indent: {
|
|
125
|
+
type: Number,
|
|
126
|
+
default: 16
|
|
125
127
|
}
|
|
126
128
|
};
|
|
127
129
|
const TABLE_TOKEN = Symbol();
|
|
@@ -166,18 +168,18 @@ function useTable(props, tableWidth) {
|
|
|
166
168
|
}));
|
|
167
169
|
return { classes, styles };
|
|
168
170
|
}
|
|
169
|
-
const useFixedColumn = (
|
|
171
|
+
const useFixedColumn = (column2) => {
|
|
170
172
|
const ns2 = useNamespace("table");
|
|
171
173
|
const stickyClass = computed(() => ({
|
|
172
|
-
[ns2.e("checkable-cell")]:
|
|
173
|
-
[ns2.m("sticky-cell")]: Boolean(
|
|
174
|
-
left: Boolean(
|
|
175
|
-
right: Boolean(
|
|
176
|
-
[`is-${
|
|
174
|
+
[ns2.e("checkable-cell")]: column2.value.type === "checkable",
|
|
175
|
+
[ns2.m("sticky-cell")]: Boolean(column2.value.fixedLeft) || Boolean(column2.value.fixedRight),
|
|
176
|
+
left: Boolean(column2.value.fixedLeft),
|
|
177
|
+
right: Boolean(column2.value.fixedRight),
|
|
178
|
+
[`is-${column2.value.align}`]: true
|
|
177
179
|
}));
|
|
178
180
|
const stickyStyle = computed(() => ({
|
|
179
|
-
left:
|
|
180
|
-
right:
|
|
181
|
+
left: column2.value.fixedLeft,
|
|
182
|
+
right: column2.value.fixedRight
|
|
181
183
|
}));
|
|
182
184
|
return { stickyClass, stickyStyle };
|
|
183
185
|
};
|
|
@@ -191,15 +193,15 @@ function useTableLayout(table2) {
|
|
|
191
193
|
}
|
|
192
194
|
const flatColumns = table2.store.states.flatColumns;
|
|
193
195
|
const columnMap = {};
|
|
194
|
-
flatColumns.value.forEach((
|
|
195
|
-
columnMap[
|
|
196
|
+
flatColumns.value.forEach((column2) => {
|
|
197
|
+
columnMap[column2.id] = column2;
|
|
196
198
|
});
|
|
197
199
|
for (let i = 0, len = cols.length; i < len; i++) {
|
|
198
200
|
const col = cols[i];
|
|
199
201
|
const columnId = col.getAttribute("column-id");
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
col.setAttribute("width",
|
|
202
|
+
const column2 = columnMap[columnId];
|
|
203
|
+
if (column2) {
|
|
204
|
+
col.setAttribute("width", column2.realWidth);
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
};
|
|
@@ -208,39 +210,39 @@ function useTableLayout(table2) {
|
|
|
208
210
|
const tableClientWidth = (_b = (_a = table2 == null ? void 0 : table2.vnode) == null ? void 0 : _a.el) == null ? void 0 : _b.clientWidth;
|
|
209
211
|
let tableMinWidth = 0;
|
|
210
212
|
const flatColumns = table2.store.states.flatColumns;
|
|
211
|
-
const flexColumns = flatColumns.value.filter((
|
|
213
|
+
const flexColumns = flatColumns.value.filter((column2) => typeof column2.width !== "number");
|
|
212
214
|
if (flexColumns.length) {
|
|
213
|
-
flatColumns.value.forEach((
|
|
214
|
-
tableMinWidth += Number(
|
|
215
|
+
flatColumns.value.forEach((column2) => {
|
|
216
|
+
tableMinWidth += Number(column2.width || 80);
|
|
215
217
|
});
|
|
216
218
|
if (tableMinWidth <= tableClientWidth) {
|
|
217
219
|
const totalFlexWidth = tableClientWidth - tableMinWidth;
|
|
218
220
|
if (flexColumns.length === 1) {
|
|
219
221
|
flexColumns[0].realWidth = Number(flexColumns[0].width || 80) + totalFlexWidth;
|
|
220
222
|
} else {
|
|
221
|
-
const allFlexColumnWidth = flexColumns.reduce((pre,
|
|
223
|
+
const allFlexColumnWidth = flexColumns.reduce((pre, column2) => pre + Number(column2.width || 80), 0);
|
|
222
224
|
const flexWidthPercent = totalFlexWidth / allFlexColumnWidth;
|
|
223
225
|
let exceptFistWidth = 0;
|
|
224
|
-
flexColumns.forEach((
|
|
226
|
+
flexColumns.forEach((column2, index2) => {
|
|
225
227
|
if (index2 === 0) {
|
|
226
228
|
return;
|
|
227
229
|
}
|
|
228
|
-
const perFlexWidth = Math.floor(Number(
|
|
230
|
+
const perFlexWidth = Math.floor(Number(column2.width || 80) * flexWidthPercent);
|
|
229
231
|
exceptFistWidth += perFlexWidth;
|
|
230
|
-
|
|
232
|
+
column2.realWidth = Number(column2.width || 80) + perFlexWidth;
|
|
231
233
|
});
|
|
232
234
|
flexColumns[0].realWidth = Number(flexColumns[0].width || 80) + totalFlexWidth - exceptFistWidth;
|
|
233
235
|
}
|
|
234
236
|
} else {
|
|
235
|
-
flexColumns.forEach((
|
|
236
|
-
|
|
237
|
+
flexColumns.forEach((column2) => {
|
|
238
|
+
column2.realWidth = Number(column2.width || 80);
|
|
237
239
|
});
|
|
238
240
|
}
|
|
239
241
|
tableWidth.value = Math.max(tableMinWidth, tableClientWidth);
|
|
240
242
|
} else {
|
|
241
|
-
flatColumns.value.forEach((
|
|
242
|
-
|
|
243
|
-
tableMinWidth += Number(
|
|
243
|
+
flatColumns.value.forEach((column2) => {
|
|
244
|
+
column2.realWidth = column2.width || 80;
|
|
245
|
+
tableMinWidth += Number(column2.realWidth);
|
|
244
246
|
});
|
|
245
247
|
tableWidth.value = tableMinWidth;
|
|
246
248
|
}
|
|
@@ -254,6 +256,9 @@ function useTableWatcher(props, store) {
|
|
|
254
256
|
store.setExpandRows(props.expandRowKeys);
|
|
255
257
|
}
|
|
256
258
|
});
|
|
259
|
+
watch(() => props.data, () => {
|
|
260
|
+
store.updateRows();
|
|
261
|
+
}, { deep: true });
|
|
257
262
|
}
|
|
258
263
|
const inBrowser = typeof window !== "undefined";
|
|
259
264
|
function getElement(element) {
|
|
@@ -285,6 +290,8 @@ function lockScroll() {
|
|
|
285
290
|
return;
|
|
286
291
|
}
|
|
287
292
|
const isBoolean = (value) => typeof value === "boolean";
|
|
293
|
+
const isString = (value) => typeof value === "string";
|
|
294
|
+
const isFunction = (value) => Object.prototype.toString.call(value) === "[object Function]";
|
|
288
295
|
function formatWidth(width) {
|
|
289
296
|
if (width === "") {
|
|
290
297
|
return width;
|
|
@@ -294,13 +301,18 @@ function formatWidth(width) {
|
|
|
294
301
|
}
|
|
295
302
|
return parseInt(width, 10) || 80;
|
|
296
303
|
}
|
|
297
|
-
function getRowIdentity(row, rowKey) {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
+
function getRowIdentity(row, rowKey, index2) {
|
|
305
|
+
if (isFunction(rowKey)) {
|
|
306
|
+
return rowKey(row, index2);
|
|
307
|
+
} else if (isString(rowKey)) {
|
|
308
|
+
const paths = rowKey.split(".");
|
|
309
|
+
let obj = row;
|
|
310
|
+
for (const p of paths) {
|
|
311
|
+
obj = obj[p];
|
|
312
|
+
}
|
|
313
|
+
return `${obj}`;
|
|
314
|
+
}
|
|
315
|
+
return "";
|
|
304
316
|
}
|
|
305
317
|
function getRowKeysMap(data, rowKey) {
|
|
306
318
|
const rowKeyMap = {};
|
|
@@ -336,7 +348,31 @@ function toggleRowExpandStatus(rowsArr, row, status) {
|
|
|
336
348
|
}
|
|
337
349
|
return isChanged;
|
|
338
350
|
}
|
|
339
|
-
function
|
|
351
|
+
function toggleRowVisible(expand, table2, key) {
|
|
352
|
+
const rowLevelMap = (table2 == null ? void 0 : table2.store.states.rowLevelMap.value) || {};
|
|
353
|
+
const levelKeys = Object.keys(rowLevelMap);
|
|
354
|
+
const hiddenRowKeys = table2 == null ? void 0 : table2.store.states.hiddenRowKeys;
|
|
355
|
+
let start = false;
|
|
356
|
+
for (let index2 = 0; index2 < levelKeys.length; index2++) {
|
|
357
|
+
if (levelKeys[index2] === key) {
|
|
358
|
+
start = true;
|
|
359
|
+
index2++;
|
|
360
|
+
}
|
|
361
|
+
if (start && rowLevelMap[levelKeys[index2]] !== rowLevelMap[key] + 1) {
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
364
|
+
if (start && rowLevelMap[levelKeys[index2]] === rowLevelMap[key] + 1) {
|
|
365
|
+
if (expand) {
|
|
366
|
+
hiddenRowKeys.value = hiddenRowKeys.value.filter((rowKey) => rowKey !== levelKeys[index2]);
|
|
367
|
+
} else {
|
|
368
|
+
if (!hiddenRowKeys.value.includes(levelKeys[index2])) {
|
|
369
|
+
hiddenRowKeys.value.push(levelKeys[index2]);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function useExpand(dataSource, table2) {
|
|
340
376
|
const tableInstance = getCurrentInstance();
|
|
341
377
|
const rowKey = tableInstance.props.rowKey || "";
|
|
342
378
|
const defaultExpandAll = ref(tableInstance.props.defaultExpandAll);
|
|
@@ -359,14 +395,32 @@ function useExpand(dataSource) {
|
|
|
359
395
|
return pre;
|
|
360
396
|
}, []);
|
|
361
397
|
};
|
|
398
|
+
const isRowExpanded = (row) => {
|
|
399
|
+
return _expandedRows.value.includes(row);
|
|
400
|
+
};
|
|
401
|
+
const doToggleRowVisible = (expand, row) => {
|
|
402
|
+
var _a;
|
|
403
|
+
if ((_a = row.children) == null ? void 0 : _a.length) {
|
|
404
|
+
const key = getRowIdentity(row, rowKey);
|
|
405
|
+
if (expand && isRowExpanded(row)) {
|
|
406
|
+
toggleRowVisible(true, table2, key);
|
|
407
|
+
}
|
|
408
|
+
if (!expand) {
|
|
409
|
+
toggleRowVisible(false, table2, key);
|
|
410
|
+
}
|
|
411
|
+
row.children.forEach((child) => {
|
|
412
|
+
doToggleRowVisible(expand, child);
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
};
|
|
362
416
|
const toggleRowExpansion = (row, expanded) => {
|
|
363
417
|
const isChanged = toggleRowExpandStatus(_expandedRows.value, row, expanded);
|
|
364
418
|
if (isChanged) {
|
|
365
419
|
tableInstance.emit("expand-change", row, _expandedRows.value.slice());
|
|
366
420
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
421
|
+
if (!table2.store.states.flatColumns.value.some((column2) => column2.type === "expand")) {
|
|
422
|
+
doToggleRowVisible(isRowExpanded(row), row);
|
|
423
|
+
}
|
|
370
424
|
};
|
|
371
425
|
return {
|
|
372
426
|
isRowExpanded,
|
|
@@ -375,29 +429,55 @@ function useExpand(dataSource) {
|
|
|
375
429
|
toggleRowExpansion
|
|
376
430
|
};
|
|
377
431
|
}
|
|
378
|
-
function
|
|
432
|
+
function useEditTableCell() {
|
|
433
|
+
const tableInstance = getCurrentInstance();
|
|
434
|
+
const rowKey = tableInstance.props.rowKey || "";
|
|
435
|
+
const tableCellModeMap = ref(/* @__PURE__ */ new Map());
|
|
436
|
+
const setCellMode = (row, rowIndex, fields, cellMode) => {
|
|
437
|
+
if (Array.isArray(fields)) {
|
|
438
|
+
fields.forEach((item) => {
|
|
439
|
+
const cellKey = `${getRowIdentity(row, rowKey, rowIndex)}-${item}-cell`;
|
|
440
|
+
tableCellModeMap.value.set(cellKey, cellMode);
|
|
441
|
+
});
|
|
442
|
+
} else {
|
|
443
|
+
const cellKey = `${getRowIdentity(row, rowKey, rowIndex)}-${fields}-cell`;
|
|
444
|
+
tableCellModeMap.value.set(cellKey, cellMode);
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
const resetCellMode = () => {
|
|
448
|
+
for (const item of tableCellModeMap.value.keys()) {
|
|
449
|
+
tableCellModeMap.value.set(item, "readonly");
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
return {
|
|
453
|
+
tableCellModeMap,
|
|
454
|
+
setCellMode,
|
|
455
|
+
resetCellMode
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
function replaceColumn(array4, column2) {
|
|
379
459
|
return array4.map((item) => {
|
|
380
460
|
var _a;
|
|
381
|
-
if (item.id ===
|
|
382
|
-
return
|
|
461
|
+
if (item.id === column2.id) {
|
|
462
|
+
return column2;
|
|
383
463
|
} else if ((_a = item.children) == null ? void 0 : _a.length) {
|
|
384
|
-
item.children = replaceColumn(item.children,
|
|
464
|
+
item.children = replaceColumn(item.children, column2);
|
|
385
465
|
}
|
|
386
466
|
return item;
|
|
387
467
|
});
|
|
388
468
|
}
|
|
389
469
|
function doFlattenColumns(columns) {
|
|
390
470
|
const result = [];
|
|
391
|
-
columns.forEach((
|
|
392
|
-
if (
|
|
393
|
-
result.push.apply(result, doFlattenColumns(
|
|
471
|
+
columns.forEach((column2) => {
|
|
472
|
+
if (column2.children) {
|
|
473
|
+
result.push.apply(result, doFlattenColumns(column2.children));
|
|
394
474
|
} else {
|
|
395
|
-
result.push(
|
|
475
|
+
result.push(column2);
|
|
396
476
|
}
|
|
397
477
|
});
|
|
398
478
|
return result;
|
|
399
479
|
}
|
|
400
|
-
|
|
480
|
+
function createColumnGenerator() {
|
|
401
481
|
const _columns = ref([]);
|
|
402
482
|
const flatColumns = ref([]);
|
|
403
483
|
const sortColumn = () => {
|
|
@@ -406,24 +486,25 @@ const createColumnGenerator = () => {
|
|
|
406
486
|
return ((_a = a.order) != null ? _a : 0) - ((_b = b.order) != null ? _b : 0);
|
|
407
487
|
});
|
|
408
488
|
};
|
|
409
|
-
const insertColumn = (
|
|
489
|
+
const insertColumn = (column2, parent) => {
|
|
490
|
+
var _a;
|
|
410
491
|
const array4 = unref(_columns);
|
|
411
492
|
let newColumns = [];
|
|
412
493
|
if (!parent) {
|
|
413
|
-
array4.push(
|
|
494
|
+
array4.push(column2);
|
|
414
495
|
newColumns = array4;
|
|
415
496
|
} else {
|
|
416
497
|
if (parent && !parent.children) {
|
|
417
498
|
parent.children = [];
|
|
418
499
|
}
|
|
419
|
-
parent.children.push(
|
|
500
|
+
(_a = parent == null ? void 0 : parent.children) == null ? void 0 : _a.push(column2);
|
|
420
501
|
newColumns = replaceColumn(array4, parent);
|
|
421
502
|
}
|
|
422
503
|
sortColumn();
|
|
423
504
|
_columns.value = newColumns;
|
|
424
505
|
};
|
|
425
|
-
const removeColumn = (
|
|
426
|
-
const i = _columns.value.findIndex((v) => v ===
|
|
506
|
+
const removeColumn = (column2) => {
|
|
507
|
+
const i = _columns.value.findIndex((v) => v === column2);
|
|
427
508
|
if (i === -1) {
|
|
428
509
|
return;
|
|
429
510
|
}
|
|
@@ -432,30 +513,100 @@ const createColumnGenerator = () => {
|
|
|
432
513
|
const updateColumns = () => {
|
|
433
514
|
flatColumns.value = [].concat(doFlattenColumns(_columns.value));
|
|
434
515
|
};
|
|
435
|
-
return {
|
|
436
|
-
|
|
437
|
-
|
|
516
|
+
return {
|
|
517
|
+
_columns,
|
|
518
|
+
flatColumns,
|
|
519
|
+
insertColumn,
|
|
520
|
+
removeColumn,
|
|
521
|
+
sortColumn,
|
|
522
|
+
updateColumns
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
function doFlattenRows(dataList, level, rowKey, rowLevelMap, hiddenRowKeys) {
|
|
526
|
+
const result = [];
|
|
527
|
+
dataList.forEach((data) => {
|
|
528
|
+
result.push(data);
|
|
529
|
+
if (level > 0) {
|
|
530
|
+
const key = getRowIdentity(data, rowKey);
|
|
531
|
+
rowLevelMap.value[key] = level;
|
|
532
|
+
hiddenRowKeys.value.push(key);
|
|
533
|
+
}
|
|
534
|
+
if (data.children) {
|
|
535
|
+
rowLevelMap.value[getRowIdentity(data, rowKey)] = level;
|
|
536
|
+
result.push.apply(result, doFlattenRows(data.children, level + 1, rowKey, rowLevelMap, hiddenRowKeys));
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
return result;
|
|
540
|
+
}
|
|
541
|
+
function createRowGenerator(dataSource, rowKey, flatColumns) {
|
|
542
|
+
const flatRows = ref([]);
|
|
543
|
+
const hiddenRowKeys = ref([]);
|
|
544
|
+
const rowLevelMap = ref({});
|
|
545
|
+
const firstDefaultColumn = ref("");
|
|
546
|
+
const updateRows = () => {
|
|
547
|
+
const hasExpand = flatColumns.value.some((column2) => column2.type === "expand");
|
|
548
|
+
const result = hasExpand ? dataSource.value : doFlattenRows(dataSource.value, 0, rowKey, rowLevelMap, hiddenRowKeys);
|
|
549
|
+
flatRows.value = [].concat(result);
|
|
550
|
+
};
|
|
551
|
+
const updateFirstDefaultColumn = () => {
|
|
552
|
+
const index2 = flatColumns.value.findIndex((column2) => column2.type === "");
|
|
553
|
+
firstDefaultColumn.value = index2 !== -1 ? flatColumns.value[index2].id : "";
|
|
554
|
+
};
|
|
555
|
+
return {
|
|
556
|
+
flatRows,
|
|
557
|
+
hiddenRowKeys,
|
|
558
|
+
rowLevelMap,
|
|
559
|
+
updateRows,
|
|
560
|
+
firstDefaultColumn,
|
|
561
|
+
updateFirstDefaultColumn
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
function createSelection(dataSource, rowKey, flatRows) {
|
|
438
565
|
const _checkSet = ref(/* @__PURE__ */ new Set());
|
|
439
|
-
const checkRow = (toggle, row) => {
|
|
566
|
+
const checkRow = (toggle, row, index2) => {
|
|
567
|
+
const key = getRowIdentity(row, rowKey, index2);
|
|
440
568
|
if (toggle) {
|
|
441
|
-
_checkSet.value.add(
|
|
569
|
+
_checkSet.value.add(key);
|
|
570
|
+
} else {
|
|
571
|
+
_checkSet.value.delete(key);
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
const toggleRowSelection = (row, checked, index2) => {
|
|
575
|
+
const key = getRowIdentity(row, rowKey, index2);
|
|
576
|
+
const isIncluded = _checkSet.value.has(key);
|
|
577
|
+
const addRow = () => {
|
|
578
|
+
_checkSet.value.add(key);
|
|
579
|
+
};
|
|
580
|
+
const deleteRow = () => {
|
|
581
|
+
_checkSet.value.delete(key);
|
|
582
|
+
};
|
|
583
|
+
if (isBoolean(checked)) {
|
|
584
|
+
if (checked && !isIncluded) {
|
|
585
|
+
addRow();
|
|
586
|
+
} else if (!checked && isIncluded) {
|
|
587
|
+
deleteRow();
|
|
588
|
+
}
|
|
442
589
|
} else {
|
|
443
|
-
|
|
590
|
+
if (isIncluded) {
|
|
591
|
+
deleteRow();
|
|
592
|
+
} else {
|
|
593
|
+
addRow();
|
|
594
|
+
}
|
|
444
595
|
}
|
|
445
596
|
};
|
|
446
|
-
const isRowChecked = (row) => {
|
|
447
|
-
return _checkSet.value.has(
|
|
597
|
+
const isRowChecked = (row, index2) => {
|
|
598
|
+
return _checkSet.value.has(getRowIdentity(row, rowKey, index2));
|
|
448
599
|
};
|
|
449
600
|
const getCheckedRows = () => {
|
|
450
|
-
return
|
|
601
|
+
return flatRows.value.filter((item, index2) => isRowChecked(item, index2));
|
|
451
602
|
};
|
|
452
603
|
const _checkAllRecord = ref(false);
|
|
453
604
|
const _checkAll = computed({
|
|
454
605
|
get: () => _checkAllRecord.value,
|
|
455
606
|
set: (val) => {
|
|
456
607
|
_checkAllRecord.value = val;
|
|
457
|
-
dataSource.value.forEach((item) => {
|
|
458
|
-
checkRow(val, item);
|
|
608
|
+
dataSource.value.forEach((item, index2) => {
|
|
609
|
+
checkRow(val, item, index2);
|
|
459
610
|
});
|
|
460
611
|
}
|
|
461
612
|
});
|
|
@@ -466,9 +617,9 @@ const createSelection = (dataSource, trackBy) => {
|
|
|
466
617
|
}
|
|
467
618
|
let allTrue = true;
|
|
468
619
|
let allFalse = true;
|
|
469
|
-
const items =
|
|
620
|
+
const items = flatRows.value;
|
|
470
621
|
for (let i = 0; i < items.length; i++) {
|
|
471
|
-
const checked = isRowChecked(items[i]);
|
|
622
|
+
const checked = isRowChecked(items[i], i);
|
|
472
623
|
allTrue && (allTrue = checked);
|
|
473
624
|
allFalse && (allFalse = !checked);
|
|
474
625
|
}
|
|
@@ -476,7 +627,7 @@ const createSelection = (dataSource, trackBy) => {
|
|
|
476
627
|
_halfChecked.value = !(allFalse || allTrue);
|
|
477
628
|
}, { immediate: true, deep: true });
|
|
478
629
|
watch(dataSource, (value) => {
|
|
479
|
-
_checkAllRecord.value = value.findIndex((item) => !isRowChecked(item)) === -1;
|
|
630
|
+
_checkAllRecord.value = value.findIndex((item, index2) => !isRowChecked(item, index2)) === -1;
|
|
480
631
|
});
|
|
481
632
|
return {
|
|
482
633
|
_checkSet,
|
|
@@ -484,10 +635,11 @@ const createSelection = (dataSource, trackBy) => {
|
|
|
484
635
|
_halfChecked,
|
|
485
636
|
getCheckedRows,
|
|
486
637
|
checkRow,
|
|
487
|
-
isRowChecked
|
|
638
|
+
isRowChecked,
|
|
639
|
+
toggleRowSelection
|
|
488
640
|
};
|
|
489
|
-
}
|
|
490
|
-
|
|
641
|
+
}
|
|
642
|
+
function createSorter(dataSource, _data) {
|
|
491
643
|
const sortData = (direction, sortMethod) => {
|
|
492
644
|
if (direction === "ASC") {
|
|
493
645
|
_data.value = _data.value.sort((a, b) => sortMethod ? sortMethod(a, b) ? 1 : -1 : 0);
|
|
@@ -499,20 +651,22 @@ const createSorter = (dataSource, _data) => {
|
|
|
499
651
|
};
|
|
500
652
|
const thList = [];
|
|
501
653
|
return { sortData, thList };
|
|
502
|
-
}
|
|
503
|
-
|
|
654
|
+
}
|
|
655
|
+
function createFixedLogic(columns) {
|
|
504
656
|
const isFixedLeft = computed(() => {
|
|
505
657
|
return columns.value.reduce((prev, current) => prev || !!current.fixedLeft, false);
|
|
506
658
|
});
|
|
507
659
|
return { isFixedLeft };
|
|
508
|
-
}
|
|
660
|
+
}
|
|
509
661
|
function createStore(dataSource, table2) {
|
|
510
662
|
const _data = ref([]);
|
|
511
663
|
const { _columns, flatColumns, insertColumn, removeColumn, sortColumn, updateColumns } = createColumnGenerator();
|
|
512
|
-
const {
|
|
513
|
-
const {
|
|
664
|
+
const { flatRows, hiddenRowKeys, rowLevelMap, updateRows, firstDefaultColumn, updateFirstDefaultColumn } = createRowGenerator(dataSource, table2.props.rowKey, flatColumns);
|
|
665
|
+
const { _checkAll, _checkSet, _halfChecked, getCheckedRows, isRowChecked, checkRow, toggleRowSelection } = createSelection(_data, table2.props.rowKey, flatRows);
|
|
666
|
+
const { sortData, thList } = createSorter(dataSource, flatRows);
|
|
514
667
|
const { isFixedLeft } = createFixedLogic(_columns);
|
|
515
|
-
const { isRowExpanded, updateExpandRows, setExpandRows, toggleRowExpansion } = useExpand(_data);
|
|
668
|
+
const { isRowExpanded, updateExpandRows, setExpandRows, toggleRowExpansion } = useExpand(_data, table2);
|
|
669
|
+
const { tableCellModeMap, setCellMode, resetCellMode } = useEditTableCell();
|
|
516
670
|
watch(dataSource, (value) => {
|
|
517
671
|
_data.value = [...value];
|
|
518
672
|
updateExpandRows();
|
|
@@ -521,25 +675,35 @@ function createStore(dataSource, table2) {
|
|
|
521
675
|
_table: table2,
|
|
522
676
|
states: {
|
|
523
677
|
_data,
|
|
678
|
+
flatRows,
|
|
679
|
+
hiddenRowKeys,
|
|
680
|
+
rowLevelMap,
|
|
524
681
|
_columns,
|
|
525
682
|
flatColumns,
|
|
526
683
|
_checkSet,
|
|
527
684
|
_checkAll,
|
|
528
685
|
_halfChecked,
|
|
529
686
|
isFixedLeft,
|
|
530
|
-
thList
|
|
687
|
+
thList,
|
|
688
|
+
firstDefaultColumn,
|
|
689
|
+
tableCellModeMap
|
|
531
690
|
},
|
|
532
691
|
insertColumn,
|
|
533
692
|
sortColumn,
|
|
534
693
|
removeColumn,
|
|
535
694
|
updateColumns,
|
|
695
|
+
updateRows,
|
|
536
696
|
getCheckedRows,
|
|
537
697
|
sortData,
|
|
538
698
|
isRowChecked,
|
|
539
699
|
checkRow,
|
|
540
700
|
isRowExpanded,
|
|
541
701
|
setExpandRows,
|
|
542
|
-
toggleRowExpansion
|
|
702
|
+
toggleRowExpansion,
|
|
703
|
+
toggleRowSelection,
|
|
704
|
+
updateFirstDefaultColumn,
|
|
705
|
+
setCellMode,
|
|
706
|
+
resetCellMode
|
|
543
707
|
};
|
|
544
708
|
}
|
|
545
709
|
var ColGroup = defineComponent({
|
|
@@ -548,11 +712,11 @@ var ColGroup = defineComponent({
|
|
|
548
712
|
const parent = inject(TABLE_TOKEN);
|
|
549
713
|
const columns = parent == null ? void 0 : parent.store.states.flatColumns;
|
|
550
714
|
const isFixed = computed(() => (parent == null ? void 0 : parent.props.tableLayout) === "fixed");
|
|
551
|
-
return () => createVNode("colgroup", null, [columns == null ? void 0 : columns.value.map((
|
|
715
|
+
return () => createVNode("colgroup", null, [columns == null ? void 0 : columns.value.map((column2, index2) => {
|
|
552
716
|
return createVNode("col", {
|
|
553
717
|
"key": index2,
|
|
554
|
-
"column-id": isFixed.value ?
|
|
555
|
-
"width":
|
|
718
|
+
"column-id": isFixed.value ? column2.id : "",
|
|
719
|
+
"width": column2.type === "expand" ? 60 : isFixed.value ? column2.realWidth : column2.width || ""
|
|
556
720
|
}, null);
|
|
557
721
|
})]);
|
|
558
722
|
}
|
|
@@ -564,6 +728,9 @@ const sortProps = {
|
|
|
564
728
|
}
|
|
565
729
|
};
|
|
566
730
|
var sort = "";
|
|
731
|
+
const XLINK_HREF = {
|
|
732
|
+
"xlink:href": "#sort-svg-path-1"
|
|
733
|
+
};
|
|
567
734
|
var Sort = defineComponent({
|
|
568
735
|
props: sortProps,
|
|
569
736
|
emits: ["sort"],
|
|
@@ -622,10 +789,9 @@ var Sort = defineComponent({
|
|
|
622
789
|
"stroke-width": "1",
|
|
623
790
|
"fill": "none",
|
|
624
791
|
"fill-rule": "evenodd"
|
|
625
|
-
}, [createVNode("use", {
|
|
626
|
-
"fill-rule": "evenodd"
|
|
627
|
-
|
|
628
|
-
}, null), createVNode("polygon", {
|
|
792
|
+
}, [createVNode("use", mergeProps({
|
|
793
|
+
"fill-rule": "evenodd"
|
|
794
|
+
}, XLINK_HREF), null), createVNode("polygon", {
|
|
629
795
|
"points": "8 4 11 7 5 7"
|
|
630
796
|
}, null), createVNode("polygon", {
|
|
631
797
|
"points": "8 12 5 9 11 9"
|
|
@@ -695,7 +861,14 @@ function subscribeEvent(dom, type4, callback) {
|
|
|
695
861
|
dom == null ? void 0 : dom.removeEventListener(type4, callback);
|
|
696
862
|
};
|
|
697
863
|
}
|
|
698
|
-
const useDropdownEvent = ({
|
|
864
|
+
const useDropdownEvent = ({
|
|
865
|
+
id,
|
|
866
|
+
isOpen,
|
|
867
|
+
origin,
|
|
868
|
+
dropdownRef,
|
|
869
|
+
props,
|
|
870
|
+
emit
|
|
871
|
+
}) => {
|
|
699
872
|
let overlayEnter = false;
|
|
700
873
|
let originEnter = false;
|
|
701
874
|
const { trigger, closeScope, closeOnMouseLeaveMenu } = toRefs(props);
|
|
@@ -1069,9 +1242,9 @@ const FlexibleOverlay = defineComponent({
|
|
|
1069
1242
|
}
|
|
1070
1243
|
});
|
|
1071
1244
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
1072
|
-
const ns$
|
|
1245
|
+
const ns$3 = useNamespace("popper-trigger");
|
|
1073
1246
|
function wrapContent(content) {
|
|
1074
|
-
return h("span", { class: ns$
|
|
1247
|
+
return h("span", { class: ns$3.b() }, content);
|
|
1075
1248
|
}
|
|
1076
1249
|
function getFirstValidChild(nodes) {
|
|
1077
1250
|
for (const child of nodes) {
|
|
@@ -1417,7 +1590,8 @@ function useIconDom(props, ctx) {
|
|
|
1417
1590
|
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
1418
1591
|
"style": {
|
|
1419
1592
|
width: iconSize.value || "",
|
|
1420
|
-
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)
|
|
1593
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
|
|
1594
|
+
verticalAlign: "middle"
|
|
1421
1595
|
}
|
|
1422
1596
|
}, ctx.attrs), null);
|
|
1423
1597
|
};
|
|
@@ -1453,6 +1627,7 @@ function useIconDom(props, ctx) {
|
|
|
1453
1627
|
var Icon = defineComponent({
|
|
1454
1628
|
name: "DIcon",
|
|
1455
1629
|
props: iconProps,
|
|
1630
|
+
emits: ["click"],
|
|
1456
1631
|
setup(props, ctx) {
|
|
1457
1632
|
const {
|
|
1458
1633
|
disabled,
|
|
@@ -1468,10 +1643,10 @@ var Icon = defineComponent({
|
|
|
1468
1643
|
[ns2.m("operable")]: operable.value
|
|
1469
1644
|
}));
|
|
1470
1645
|
const onClick = (e) => {
|
|
1471
|
-
e.stopImmediatePropagation();
|
|
1472
1646
|
if (disabled.value) {
|
|
1473
|
-
|
|
1647
|
+
return;
|
|
1474
1648
|
}
|
|
1649
|
+
ctx.emit("click", e);
|
|
1475
1650
|
};
|
|
1476
1651
|
return () => {
|
|
1477
1652
|
var _a, _b, _c, _d;
|
|
@@ -2816,7 +2991,7 @@ var lodash = { exports: {} };
|
|
|
2816
2991
|
function baseAt(object4, paths) {
|
|
2817
2992
|
var index2 = -1, length = paths.length, result2 = Array2(length), skip = object4 == null;
|
|
2818
2993
|
while (++index2 < length) {
|
|
2819
|
-
result2[index2] = skip ? undefined$1 :
|
|
2994
|
+
result2[index2] = skip ? undefined$1 : get2(object4, paths[index2]);
|
|
2820
2995
|
}
|
|
2821
2996
|
return result2;
|
|
2822
2997
|
}
|
|
@@ -3026,7 +3201,7 @@ var lodash = { exports: {} };
|
|
|
3026
3201
|
}
|
|
3027
3202
|
function baseFunctions(object4, props) {
|
|
3028
3203
|
return arrayFilter(props, function(key) {
|
|
3029
|
-
return
|
|
3204
|
+
return isFunction2(object4[key]);
|
|
3030
3205
|
});
|
|
3031
3206
|
}
|
|
3032
3207
|
function baseGet(object4, path) {
|
|
@@ -3189,7 +3364,7 @@ var lodash = { exports: {} };
|
|
|
3189
3364
|
if (!isObject2(value) || isMasked(value)) {
|
|
3190
3365
|
return false;
|
|
3191
3366
|
}
|
|
3192
|
-
var pattern4 =
|
|
3367
|
+
var pattern4 = isFunction2(value) ? reIsNative : reIsHostCtor;
|
|
3193
3368
|
return pattern4.test(toSource(value));
|
|
3194
3369
|
}
|
|
3195
3370
|
function baseIsRegExp(value) {
|
|
@@ -3261,7 +3436,7 @@ var lodash = { exports: {} };
|
|
|
3261
3436
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
3262
3437
|
}
|
|
3263
3438
|
return function(object4) {
|
|
3264
|
-
var objValue =
|
|
3439
|
+
var objValue = get2(object4, path);
|
|
3265
3440
|
return objValue === undefined$1 && objValue === srcValue ? hasIn(object4, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
3266
3441
|
};
|
|
3267
3442
|
}
|
|
@@ -3311,7 +3486,7 @@ var lodash = { exports: {} };
|
|
|
3311
3486
|
newValue = objValue;
|
|
3312
3487
|
if (isArguments(objValue)) {
|
|
3313
3488
|
newValue = toPlainObject(objValue);
|
|
3314
|
-
} else if (!isObject2(objValue) ||
|
|
3489
|
+
} else if (!isObject2(objValue) || isFunction2(objValue)) {
|
|
3315
3490
|
newValue = initCloneObject(srcValue);
|
|
3316
3491
|
}
|
|
3317
3492
|
} else {
|
|
@@ -4613,7 +4788,7 @@ var lodash = { exports: {} };
|
|
|
4613
4788
|
function isMasked(func) {
|
|
4614
4789
|
return !!maskSrcKey && maskSrcKey in func;
|
|
4615
4790
|
}
|
|
4616
|
-
var isMaskable = coreJsData ?
|
|
4791
|
+
var isMaskable = coreJsData ? isFunction2 : stubFalse;
|
|
4617
4792
|
function isPrototype(value) {
|
|
4618
4793
|
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
4619
4794
|
return value === proto;
|
|
@@ -5337,7 +5512,7 @@ var lodash = { exports: {} };
|
|
|
5337
5512
|
if (fromIndex < 0) {
|
|
5338
5513
|
fromIndex = nativeMax(length + fromIndex, 0);
|
|
5339
5514
|
}
|
|
5340
|
-
return
|
|
5515
|
+
return isString2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
|
|
5341
5516
|
}
|
|
5342
5517
|
var invokeMap = baseRest(function(collection, path, args) {
|
|
5343
5518
|
var index2 = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
@@ -5405,7 +5580,7 @@ var lodash = { exports: {} };
|
|
|
5405
5580
|
return 0;
|
|
5406
5581
|
}
|
|
5407
5582
|
if (isArrayLike(collection)) {
|
|
5408
|
-
return
|
|
5583
|
+
return isString2(collection) ? stringSize(collection) : collection.length;
|
|
5409
5584
|
}
|
|
5410
5585
|
var tag = getTag(collection);
|
|
5411
5586
|
if (tag == mapTag || tag == setTag) {
|
|
@@ -5726,7 +5901,7 @@ var lodash = { exports: {} };
|
|
|
5726
5901
|
var isArray = Array2.isArray;
|
|
5727
5902
|
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
|
|
5728
5903
|
function isArrayLike(value) {
|
|
5729
|
-
return value != null && isLength(value.length) && !
|
|
5904
|
+
return value != null && isLength(value.length) && !isFunction2(value);
|
|
5730
5905
|
}
|
|
5731
5906
|
function isArrayLikeObject(value) {
|
|
5732
5907
|
return isObjectLike(value) && isArrayLike(value);
|
|
@@ -5778,7 +5953,7 @@ var lodash = { exports: {} };
|
|
|
5778
5953
|
function isFinite(value) {
|
|
5779
5954
|
return typeof value == "number" && nativeIsFinite(value);
|
|
5780
5955
|
}
|
|
5781
|
-
function
|
|
5956
|
+
function isFunction2(value) {
|
|
5782
5957
|
if (!isObject2(value)) {
|
|
5783
5958
|
return false;
|
|
5784
5959
|
}
|
|
@@ -5840,7 +6015,7 @@ var lodash = { exports: {} };
|
|
|
5840
6015
|
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
|
|
5841
6016
|
}
|
|
5842
6017
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
5843
|
-
function
|
|
6018
|
+
function isString2(value) {
|
|
5844
6019
|
return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
|
|
5845
6020
|
}
|
|
5846
6021
|
function isSymbol(value) {
|
|
@@ -5865,7 +6040,7 @@ var lodash = { exports: {} };
|
|
|
5865
6040
|
return [];
|
|
5866
6041
|
}
|
|
5867
6042
|
if (isArrayLike(value)) {
|
|
5868
|
-
return
|
|
6043
|
+
return isString2(value) ? stringToArray(value) : copyArray(value);
|
|
5869
6044
|
}
|
|
5870
6045
|
if (symIterator && value[symIterator]) {
|
|
5871
6046
|
return iteratorToArray(value[symIterator]());
|
|
@@ -5994,7 +6169,7 @@ var lodash = { exports: {} };
|
|
|
5994
6169
|
function functionsIn(object4) {
|
|
5995
6170
|
return object4 == null ? [] : baseFunctions(object4, keysIn(object4));
|
|
5996
6171
|
}
|
|
5997
|
-
function
|
|
6172
|
+
function get2(object4, path, defaultValue) {
|
|
5998
6173
|
var result2 = object4 == null ? undefined$1 : baseGet(object4, path);
|
|
5999
6174
|
return result2 === undefined$1 ? defaultValue : result2;
|
|
6000
6175
|
}
|
|
@@ -6101,7 +6276,7 @@ var lodash = { exports: {} };
|
|
|
6101
6276
|
index2 = length;
|
|
6102
6277
|
value = defaultValue;
|
|
6103
6278
|
}
|
|
6104
|
-
object4 =
|
|
6279
|
+
object4 = isFunction2(value) ? value.call(object4) : value;
|
|
6105
6280
|
}
|
|
6106
6281
|
return object4;
|
|
6107
6282
|
}
|
|
@@ -6122,7 +6297,7 @@ var lodash = { exports: {} };
|
|
|
6122
6297
|
if (isArrLike) {
|
|
6123
6298
|
accumulator = isArr ? new Ctor() : [];
|
|
6124
6299
|
} else if (isObject2(object4)) {
|
|
6125
|
-
accumulator =
|
|
6300
|
+
accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object4)) : {};
|
|
6126
6301
|
} else {
|
|
6127
6302
|
accumulator = {};
|
|
6128
6303
|
}
|
|
@@ -6539,7 +6714,7 @@ var lodash = { exports: {} };
|
|
|
6539
6714
|
object4 = this;
|
|
6540
6715
|
methodNames = baseFunctions(source, keys(source));
|
|
6541
6716
|
}
|
|
6542
|
-
var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc =
|
|
6717
|
+
var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object4);
|
|
6543
6718
|
arrayEach(methodNames, function(methodName) {
|
|
6544
6719
|
var func = source[methodName];
|
|
6545
6720
|
object4[methodName] = func;
|
|
@@ -6849,7 +7024,7 @@ var lodash = { exports: {} };
|
|
|
6849
7024
|
lodash2.forInRight = forInRight;
|
|
6850
7025
|
lodash2.forOwn = forOwn;
|
|
6851
7026
|
lodash2.forOwnRight = forOwnRight;
|
|
6852
|
-
lodash2.get =
|
|
7027
|
+
lodash2.get = get2;
|
|
6853
7028
|
lodash2.gt = gt;
|
|
6854
7029
|
lodash2.gte = gte;
|
|
6855
7030
|
lodash2.has = has;
|
|
@@ -6874,7 +7049,7 @@ var lodash = { exports: {} };
|
|
|
6874
7049
|
lodash2.isEqualWith = isEqualWith;
|
|
6875
7050
|
lodash2.isError = isError;
|
|
6876
7051
|
lodash2.isFinite = isFinite;
|
|
6877
|
-
lodash2.isFunction =
|
|
7052
|
+
lodash2.isFunction = isFunction2;
|
|
6878
7053
|
lodash2.isInteger = isInteger;
|
|
6879
7054
|
lodash2.isLength = isLength;
|
|
6880
7055
|
lodash2.isMap = isMap;
|
|
@@ -6891,7 +7066,7 @@ var lodash = { exports: {} };
|
|
|
6891
7066
|
lodash2.isRegExp = isRegExp;
|
|
6892
7067
|
lodash2.isSafeInteger = isSafeInteger;
|
|
6893
7068
|
lodash2.isSet = isSet;
|
|
6894
|
-
lodash2.isString =
|
|
7069
|
+
lodash2.isString = isString2;
|
|
6895
7070
|
lodash2.isSymbol = isSymbol;
|
|
6896
7071
|
lodash2.isTypedArray = isTypedArray;
|
|
6897
7072
|
lodash2.isUndefined = isUndefined;
|
|
@@ -7681,10 +7856,10 @@ function usePopoverEvent(props, visible, origin) {
|
|
|
7681
7856
|
});
|
|
7682
7857
|
return { placement, handlePositionChange, onMouseenter, onMouseleave };
|
|
7683
7858
|
}
|
|
7684
|
-
const ns = useNamespace("popover");
|
|
7859
|
+
const ns$2 = useNamespace("popover");
|
|
7685
7860
|
function SuccessIcon$1() {
|
|
7686
7861
|
return createVNode("svg", {
|
|
7687
|
-
"class": [ns.e("icon"), ns.em("icon", "success")],
|
|
7862
|
+
"class": [ns$2.e("icon"), ns$2.em("icon", "success")],
|
|
7688
7863
|
"viewBox": "0 0 16 16",
|
|
7689
7864
|
"version": "1.1",
|
|
7690
7865
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
@@ -7708,7 +7883,7 @@ function SuccessIcon$1() {
|
|
|
7708
7883
|
}
|
|
7709
7884
|
function WarningIcon() {
|
|
7710
7885
|
return createVNode("svg", {
|
|
7711
|
-
"class": [ns.e("icon"), ns.em("icon", "warning")],
|
|
7886
|
+
"class": [ns$2.e("icon"), ns$2.em("icon", "warning")],
|
|
7712
7887
|
"viewBox": "0 0 16 16",
|
|
7713
7888
|
"version": "1.1",
|
|
7714
7889
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
@@ -7725,7 +7900,7 @@ function WarningIcon() {
|
|
|
7725
7900
|
}
|
|
7726
7901
|
function InfoIcon() {
|
|
7727
7902
|
return createVNode("svg", {
|
|
7728
|
-
"class": [ns.e("icon"), ns.em("icon", "info")],
|
|
7903
|
+
"class": [ns$2.e("icon"), ns$2.em("icon", "info")],
|
|
7729
7904
|
"viewBox": "0 0 16 16",
|
|
7730
7905
|
"version": "1.1",
|
|
7731
7906
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
@@ -7746,7 +7921,7 @@ function InfoIcon() {
|
|
|
7746
7921
|
}
|
|
7747
7922
|
function ErrorIcon$1() {
|
|
7748
7923
|
return createVNode("svg", {
|
|
7749
|
-
"class": [ns.e("icon"), ns.em("icon", "error")],
|
|
7924
|
+
"class": [ns$2.e("icon"), ns$2.em("icon", "error")],
|
|
7750
7925
|
"width": "16px",
|
|
7751
7926
|
"height": "16px",
|
|
7752
7927
|
"viewBox": "0 0 16 16",
|
|
@@ -9127,7 +9302,7 @@ function useFormItemValidate(props, _rules) {
|
|
|
9127
9302
|
return rule.trigger === triggerVal;
|
|
9128
9303
|
}
|
|
9129
9304
|
}).map((_a) => {
|
|
9130
|
-
var
|
|
9305
|
+
var rule = __objRest(_a, []);
|
|
9131
9306
|
return rule;
|
|
9132
9307
|
});
|
|
9133
9308
|
};
|
|
@@ -9727,6 +9902,177 @@ function useFilterSingle(ctx) {
|
|
|
9727
9902
|
};
|
|
9728
9903
|
return { selectedItem, handleSelect };
|
|
9729
9904
|
}
|
|
9905
|
+
function deepAssign(...objects) {
|
|
9906
|
+
const isObject2 = (obj) => obj && typeof obj === "object";
|
|
9907
|
+
return objects.reduce((prev, from) => {
|
|
9908
|
+
Object.keys(from).forEach((key) => {
|
|
9909
|
+
const pVal = prev[key];
|
|
9910
|
+
const oVal = from[key];
|
|
9911
|
+
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
9912
|
+
prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
|
|
9913
|
+
} else if (isObject2(pVal) && isObject2(oVal)) {
|
|
9914
|
+
prev[key] = deepAssign(pVal, oVal);
|
|
9915
|
+
} else {
|
|
9916
|
+
prev[key] = oVal;
|
|
9917
|
+
}
|
|
9918
|
+
});
|
|
9919
|
+
return prev;
|
|
9920
|
+
}, {});
|
|
9921
|
+
}
|
|
9922
|
+
var zhCN = {
|
|
9923
|
+
pagination: {
|
|
9924
|
+
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
9925
|
+
goToText: "\u8DF3\u81F3"
|
|
9926
|
+
},
|
|
9927
|
+
accordion: {
|
|
9928
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
9929
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
9930
|
+
},
|
|
9931
|
+
autoCompleteDropdown: {
|
|
9932
|
+
latestInput: "\u6700\u8FD1\u8F93\u5165"
|
|
9933
|
+
},
|
|
9934
|
+
cascaderList: {
|
|
9935
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
9936
|
+
},
|
|
9937
|
+
colorPicker: {
|
|
9938
|
+
foundationPanel: "\u57FA\u7840\u9762\u677F",
|
|
9939
|
+
advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
|
|
9940
|
+
},
|
|
9941
|
+
datePickerPro: {
|
|
9942
|
+
ok: "\u786E\u5B9A",
|
|
9943
|
+
placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
|
|
9944
|
+
month1: "1\u6708",
|
|
9945
|
+
month2: "2\u6708",
|
|
9946
|
+
month3: "3\u6708",
|
|
9947
|
+
month4: "4\u6708",
|
|
9948
|
+
month5: "5\u6708",
|
|
9949
|
+
month6: "6\u6708",
|
|
9950
|
+
month7: "7\u6708",
|
|
9951
|
+
month8: "8\u6708",
|
|
9952
|
+
month9: "9\u6708",
|
|
9953
|
+
month10: "10\u6708",
|
|
9954
|
+
month11: "11\u6708",
|
|
9955
|
+
month12: "12\u6708",
|
|
9956
|
+
year: "\u5E74",
|
|
9957
|
+
startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
|
|
9958
|
+
endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
|
|
9959
|
+
getWeekDays() {
|
|
9960
|
+
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
9961
|
+
},
|
|
9962
|
+
getTimeArr() {
|
|
9963
|
+
return ["\u65F6", "\u5206", "\u79D2"];
|
|
9964
|
+
},
|
|
9965
|
+
getYearMonthStr(year, month) {
|
|
9966
|
+
return `${year}\u5E74${month}\u6708`;
|
|
9967
|
+
}
|
|
9968
|
+
},
|
|
9969
|
+
editableSelect: {
|
|
9970
|
+
noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
9971
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
9972
|
+
},
|
|
9973
|
+
input: {
|
|
9974
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
9975
|
+
},
|
|
9976
|
+
splitterBar: {
|
|
9977
|
+
collapse: "\u6536\u8D77",
|
|
9978
|
+
expand: "\u5C55\u5F00"
|
|
9979
|
+
},
|
|
9980
|
+
stepsGuide: {
|
|
9981
|
+
previous: "\u4E0A\u4E00\u6B65",
|
|
9982
|
+
continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
|
|
9983
|
+
ok: "\u6211\u77E5\u9053\u5566"
|
|
9984
|
+
},
|
|
9985
|
+
table: {
|
|
9986
|
+
selectAll: "\u5168\u9009",
|
|
9987
|
+
ok: "\u786E\u5B9A"
|
|
9988
|
+
},
|
|
9989
|
+
timePopup: {
|
|
9990
|
+
ok: "\u786E\u5B9A"
|
|
9991
|
+
},
|
|
9992
|
+
transfer: {
|
|
9993
|
+
unit: "\u9879",
|
|
9994
|
+
panelUnit: "\u9879",
|
|
9995
|
+
headerUnit: "\u9879",
|
|
9996
|
+
noData: "\u6682\u65E0\u6570\u636E",
|
|
9997
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
|
|
9998
|
+
},
|
|
9999
|
+
tree: {
|
|
10000
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
10001
|
+
newNode: "\u65B0\u8282\u70B9",
|
|
10002
|
+
selectPlaceholder: "\u8BF7\u9009\u62E9"
|
|
10003
|
+
},
|
|
10004
|
+
upload: {
|
|
10005
|
+
placeholder: "\u9009\u62E9\u6587\u4EF6",
|
|
10006
|
+
getExistSameNameFilesMsg(sameNames) {
|
|
10007
|
+
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
10008
|
+
},
|
|
10009
|
+
getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
|
|
10010
|
+
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
10011
|
+
},
|
|
10012
|
+
getBeyondMaximalFileSizeMsg(filename, maximalSize) {
|
|
10013
|
+
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
10014
|
+
},
|
|
10015
|
+
getNotAllowedFileTypeMsg(filename, scope) {
|
|
10016
|
+
return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
10017
|
+
}
|
|
10018
|
+
},
|
|
10019
|
+
search: {
|
|
10020
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
10021
|
+
},
|
|
10022
|
+
select: {
|
|
10023
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
10024
|
+
noDataText: "\u65E0\u6570\u636E",
|
|
10025
|
+
noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
10026
|
+
loadingText: "\u52A0\u8F7D\u4E2D..."
|
|
10027
|
+
},
|
|
10028
|
+
tagInput: {
|
|
10029
|
+
maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
|
|
10030
|
+
},
|
|
10031
|
+
timeSelect: {
|
|
10032
|
+
placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
|
|
10033
|
+
}
|
|
10034
|
+
};
|
|
10035
|
+
const lang = ref("zh-CN");
|
|
10036
|
+
let langMessages = reactive({
|
|
10037
|
+
[lang.value]: zhCN
|
|
10038
|
+
});
|
|
10039
|
+
const Locale = {
|
|
10040
|
+
messages() {
|
|
10041
|
+
return langMessages[lang.value];
|
|
10042
|
+
},
|
|
10043
|
+
lang() {
|
|
10044
|
+
return lang.value;
|
|
10045
|
+
},
|
|
10046
|
+
use(newLang, newMessages2) {
|
|
10047
|
+
lang.value = newLang;
|
|
10048
|
+
this.add({ [newLang]: newMessages2 });
|
|
10049
|
+
},
|
|
10050
|
+
add(newMessages2 = {}) {
|
|
10051
|
+
langMessages = deepAssign(langMessages, newMessages2);
|
|
10052
|
+
}
|
|
10053
|
+
};
|
|
10054
|
+
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
10055
|
+
function get(object4, path) {
|
|
10056
|
+
const keys = path.split(".");
|
|
10057
|
+
let result = object4;
|
|
10058
|
+
keys.forEach((key) => {
|
|
10059
|
+
var _a;
|
|
10060
|
+
result = (_a = result[key]) != null ? _a : "";
|
|
10061
|
+
});
|
|
10062
|
+
return result;
|
|
10063
|
+
}
|
|
10064
|
+
function createI18nTranslate(name, app, newPrefix) {
|
|
10065
|
+
const prefix = newPrefix || camelize(name) + ".";
|
|
10066
|
+
return (path) => {
|
|
10067
|
+
var _a;
|
|
10068
|
+
const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
10069
|
+
const message = get(messages2, prefix + path) || get(messages2, path);
|
|
10070
|
+
return message;
|
|
10071
|
+
};
|
|
10072
|
+
}
|
|
10073
|
+
function _isSlot$1(s) {
|
|
10074
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
10075
|
+
}
|
|
9730
10076
|
var MultipleFilter = defineComponent({
|
|
9731
10077
|
props: {
|
|
9732
10078
|
filterList: {
|
|
@@ -9736,37 +10082,42 @@ var MultipleFilter = defineComponent({
|
|
|
9736
10082
|
},
|
|
9737
10083
|
emits: ["confirm"],
|
|
9738
10084
|
setup(props, ctx) {
|
|
10085
|
+
const app = getCurrentInstance();
|
|
10086
|
+
const t = createI18nTranslate("DTable", app);
|
|
9739
10087
|
const {
|
|
9740
10088
|
_checkList,
|
|
9741
10089
|
_checkAll,
|
|
9742
10090
|
_halfChecked,
|
|
9743
10091
|
handleConfirm
|
|
9744
10092
|
} = useFilterMultiple(props.filterList, ctx);
|
|
9745
|
-
return () =>
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
10093
|
+
return () => {
|
|
10094
|
+
let _slot;
|
|
10095
|
+
return createVNode(Fragment, null, [createVNode("div", {
|
|
10096
|
+
"class": "filter-all-check"
|
|
10097
|
+
}, [createVNode("div", {
|
|
10098
|
+
"class": "filter-item"
|
|
10099
|
+
}, [createVNode(Checkbox, {
|
|
10100
|
+
"modelValue": _checkAll.value,
|
|
10101
|
+
"onUpdate:modelValue": ($event) => _checkAll.value = $event,
|
|
10102
|
+
"halfChecked": _halfChecked.value,
|
|
10103
|
+
"label": t("selectAll")
|
|
10104
|
+
}, null)])]), createVNode("div", {
|
|
10105
|
+
"class": "filter-multiple-menu"
|
|
10106
|
+
}, [_checkList.value.map((item) => createVNode("div", {
|
|
10107
|
+
"class": "filter-item"
|
|
10108
|
+
}, [createVNode(Checkbox, {
|
|
10109
|
+
"modelValue": item.checked,
|
|
10110
|
+
"onUpdate:modelValue": ($event) => item.checked = $event,
|
|
10111
|
+
"label": item.name
|
|
10112
|
+
}, null)]))]), createVNode("div", {
|
|
10113
|
+
"class": "filter-operation"
|
|
10114
|
+
}, [createVNode(Button, {
|
|
10115
|
+
"variant": "text",
|
|
10116
|
+
"onClick": handleConfirm
|
|
10117
|
+
}, _isSlot$1(_slot = t("ok")) ? _slot : {
|
|
10118
|
+
default: () => [_slot]
|
|
10119
|
+
})])]);
|
|
10120
|
+
};
|
|
9770
10121
|
}
|
|
9771
10122
|
});
|
|
9772
10123
|
var list = "";
|
|
@@ -9886,17 +10237,17 @@ var Filter = defineComponent({
|
|
|
9886
10237
|
});
|
|
9887
10238
|
}
|
|
9888
10239
|
});
|
|
9889
|
-
function useBaseRender(
|
|
10240
|
+
function useBaseRender(column2) {
|
|
9890
10241
|
const baseClass = computed(() => ({
|
|
9891
|
-
operable:
|
|
9892
|
-
resizeable:
|
|
10242
|
+
operable: column2.value.filterable || column2.value.sortable || column2.value.resizeable,
|
|
10243
|
+
resizeable: column2.value.resizeable
|
|
9893
10244
|
}));
|
|
9894
10245
|
return { baseClass };
|
|
9895
10246
|
}
|
|
9896
|
-
function useSort(
|
|
10247
|
+
function useSort(column2) {
|
|
9897
10248
|
const table2 = inject(TABLE_TOKEN);
|
|
9898
10249
|
const store = table2.store;
|
|
9899
|
-
const direction = ref(
|
|
10250
|
+
const direction = ref(column2.value.sortDirection);
|
|
9900
10251
|
const sortClass = computed(() => ({
|
|
9901
10252
|
"sort-active": Boolean(direction.value)
|
|
9902
10253
|
}));
|
|
@@ -9904,7 +10255,7 @@ function useSort(column) {
|
|
|
9904
10255
|
thInstance && store.states.thList.push(thInstance);
|
|
9905
10256
|
onMounted(() => {
|
|
9906
10257
|
var _a;
|
|
9907
|
-
|
|
10258
|
+
column2.value.sortable && column2.value.sortDirection && ((_a = store.sortData) == null ? void 0 : _a.call(store, direction.value, column2.value.sortMethod));
|
|
9908
10259
|
});
|
|
9909
10260
|
const execClearSortOrder = () => {
|
|
9910
10261
|
store.states.thList.forEach((th) => {
|
|
@@ -9918,22 +10269,23 @@ function useSort(column) {
|
|
|
9918
10269
|
var _a;
|
|
9919
10270
|
direction.value = val;
|
|
9920
10271
|
execClearSortOrder();
|
|
9921
|
-
(_a = store.sortData) == null ? void 0 : _a.call(store, direction.value,
|
|
9922
|
-
table2.emit("sort-change", { field:
|
|
10272
|
+
(_a = store.sortData) == null ? void 0 : _a.call(store, direction.value, column2.value.sortMethod);
|
|
10273
|
+
table2.emit("sort-change", { field: column2.value.field, direction: direction.value });
|
|
9923
10274
|
};
|
|
9924
10275
|
const clearSortOrder = () => {
|
|
9925
10276
|
direction.value = "";
|
|
9926
10277
|
};
|
|
9927
10278
|
return { direction, sortClass, handleSort, clearSortOrder };
|
|
9928
10279
|
}
|
|
9929
|
-
function useFilter(
|
|
10280
|
+
function useFilter(column2) {
|
|
9930
10281
|
const filter2 = ref(null);
|
|
9931
10282
|
const filterClass = computed(() => ({
|
|
9932
10283
|
"filter-active": Boolean(filter2.value || Array.isArray(filter2.value) && filter2.value.length)
|
|
9933
10284
|
}));
|
|
9934
10285
|
const handleFilter = (val) => {
|
|
10286
|
+
var _a;
|
|
9935
10287
|
filter2.value = val;
|
|
9936
|
-
|
|
10288
|
+
(_a = column2.value.ctx) == null ? void 0 : _a.emit("filter-change", val);
|
|
9937
10289
|
};
|
|
9938
10290
|
return { filterClass, handleFilter };
|
|
9939
10291
|
}
|
|
@@ -9954,7 +10306,7 @@ function getFinalWidth(newWidth, minWidth, maxWidth) {
|
|
|
9954
10306
|
const finalWidth = !overMinWidth ? realMinWidth : !underMaxWidth ? realMaxWidth : newWidth;
|
|
9955
10307
|
return finalWidth;
|
|
9956
10308
|
}
|
|
9957
|
-
function useDragColumnWidth(elementRef,
|
|
10309
|
+
function useDragColumnWidth(elementRef, column2) {
|
|
9958
10310
|
let initialWidth = 0;
|
|
9959
10311
|
let mouseDownScreenX = 0;
|
|
9960
10312
|
let resizeBarElement;
|
|
@@ -9963,33 +10315,36 @@ function useDragColumnWidth(elementRef, column) {
|
|
|
9963
10315
|
const resizing = ref(false);
|
|
9964
10316
|
const tableElement = table2.tableRef;
|
|
9965
10317
|
const onMousemove = (e) => {
|
|
10318
|
+
var _a;
|
|
9966
10319
|
const movementX = e.clientX - mouseDownScreenX;
|
|
9967
10320
|
const newWidth = initialWidth + movementX;
|
|
9968
|
-
const finalWidth = getFinalWidth(newWidth,
|
|
10321
|
+
const finalWidth = getFinalWidth(newWidth, column2.value.minWidth, column2.value.maxWidth);
|
|
9969
10322
|
if (resizeBarElement) {
|
|
9970
10323
|
resizeBarElement.style.left = `${finalWidth + elementRef.value.offsetLeft}px`;
|
|
9971
10324
|
}
|
|
9972
|
-
|
|
10325
|
+
(_a = column2.value.ctx) == null ? void 0 : _a.emit("resizing", { width: finalWidth });
|
|
9973
10326
|
};
|
|
9974
10327
|
const onMouseup = (e) => {
|
|
10328
|
+
var _a;
|
|
9975
10329
|
const movementX = e.clientX - mouseDownScreenX;
|
|
9976
10330
|
const newWidth = initialWidth + movementX;
|
|
9977
|
-
const finalWidth = getFinalWidth(newWidth,
|
|
9978
|
-
|
|
9979
|
-
|
|
10331
|
+
const finalWidth = getFinalWidth(newWidth, column2.value.minWidth, column2.value.maxWidth);
|
|
10332
|
+
column2.value.width = finalWidth;
|
|
10333
|
+
column2.value.realWidth = finalWidth;
|
|
9980
10334
|
table2.updateColumnWidth();
|
|
9981
10335
|
resizing.value = false;
|
|
9982
10336
|
tableElement == null ? void 0 : tableElement.value.classList.remove("table-selector");
|
|
9983
10337
|
dragClass.value = "";
|
|
9984
10338
|
tableElement == null ? void 0 : tableElement.value.removeChild(resizeBarElement);
|
|
9985
|
-
|
|
10339
|
+
(_a = column2.value.ctx) == null ? void 0 : _a.emit("resize-end", { width: finalWidth, beforeWidth: initialWidth });
|
|
9986
10340
|
document.removeEventListener("mouseup", onMouseup);
|
|
9987
10341
|
document.removeEventListener("mousemove", onMousemove);
|
|
9988
10342
|
};
|
|
9989
10343
|
const onMousedown = (e) => {
|
|
10344
|
+
var _a;
|
|
9990
10345
|
const isHandle = e.target.classList.contains("resize-handle");
|
|
9991
10346
|
if (isHandle) {
|
|
9992
|
-
|
|
10347
|
+
(_a = column2.value.ctx) == null ? void 0 : _a.emit("resize-start");
|
|
9993
10348
|
const initialOffset = elementRef.value.offsetLeft;
|
|
9994
10349
|
initialWidth = elementRef.value.clientWidth;
|
|
9995
10350
|
mouseDownScreenX = e.clientX;
|
|
@@ -10010,14 +10365,21 @@ function useDragColumnWidth(elementRef, column) {
|
|
|
10010
10365
|
};
|
|
10011
10366
|
return { resizing, dragClass, onMousedown };
|
|
10012
10367
|
}
|
|
10368
|
+
const headerThProps = {
|
|
10369
|
+
column: {
|
|
10370
|
+
type: Object,
|
|
10371
|
+
required: true
|
|
10372
|
+
},
|
|
10373
|
+
colspan: {
|
|
10374
|
+
type: Number
|
|
10375
|
+
},
|
|
10376
|
+
rowspan: {
|
|
10377
|
+
type: Number
|
|
10378
|
+
}
|
|
10379
|
+
};
|
|
10013
10380
|
var TH = defineComponent({
|
|
10014
10381
|
name: "DTableHeaderTh",
|
|
10015
|
-
props:
|
|
10016
|
-
column: {
|
|
10017
|
-
type: Object,
|
|
10018
|
-
required: true
|
|
10019
|
-
}
|
|
10020
|
-
},
|
|
10382
|
+
props: headerThProps,
|
|
10021
10383
|
setup(props, {
|
|
10022
10384
|
expose
|
|
10023
10385
|
}) {
|
|
@@ -10025,30 +10387,32 @@ var TH = defineComponent({
|
|
|
10025
10387
|
const store = table2.store;
|
|
10026
10388
|
const headerContainerRef = ref();
|
|
10027
10389
|
const {
|
|
10028
|
-
column
|
|
10390
|
+
column: column2,
|
|
10391
|
+
colspan,
|
|
10392
|
+
rowspan
|
|
10029
10393
|
} = toRefs(props);
|
|
10030
10394
|
const {
|
|
10031
10395
|
baseClass
|
|
10032
|
-
} = useBaseRender(
|
|
10396
|
+
} = useBaseRender(column2);
|
|
10033
10397
|
const {
|
|
10034
10398
|
direction,
|
|
10035
10399
|
sortClass,
|
|
10036
10400
|
handleSort,
|
|
10037
10401
|
clearSortOrder
|
|
10038
|
-
} = useSort(
|
|
10402
|
+
} = useSort(column2);
|
|
10039
10403
|
const {
|
|
10040
10404
|
filterClass,
|
|
10041
10405
|
handleFilter
|
|
10042
|
-
} = useFilter(
|
|
10406
|
+
} = useFilter(column2);
|
|
10043
10407
|
const {
|
|
10044
10408
|
stickyClass,
|
|
10045
10409
|
stickyStyle
|
|
10046
|
-
} = useFixedColumn(
|
|
10410
|
+
} = useFixedColumn(column2);
|
|
10047
10411
|
const {
|
|
10048
10412
|
resizing,
|
|
10049
10413
|
dragClass,
|
|
10050
10414
|
onMousedown
|
|
10051
|
-
} = useDragColumnWidth(headerContainerRef,
|
|
10415
|
+
} = useDragColumnWidth(headerContainerRef, column2);
|
|
10052
10416
|
expose({
|
|
10053
10417
|
clearSortOrder
|
|
10054
10418
|
});
|
|
@@ -10056,22 +10420,24 @@ var TH = defineComponent({
|
|
|
10056
10420
|
var _a, _b;
|
|
10057
10421
|
return createVNode("th", {
|
|
10058
10422
|
"class": [baseClass.value, stickyClass.value, sortClass.value, filterClass.value, dragClass.value],
|
|
10059
|
-
"style": stickyStyle.value
|
|
10423
|
+
"style": stickyStyle.value,
|
|
10424
|
+
"colspan": colspan == null ? void 0 : colspan.value,
|
|
10425
|
+
"rowspan": rowspan == null ? void 0 : rowspan.value
|
|
10060
10426
|
}, [createVNode("div", {
|
|
10061
10427
|
"ref": headerContainerRef,
|
|
10062
10428
|
"class": "header-container",
|
|
10063
10429
|
"onMousedown": onMousedown
|
|
10064
|
-
}, [(_b = (_a =
|
|
10065
|
-
"filterList":
|
|
10066
|
-
"multiple":
|
|
10430
|
+
}, [(_b = (_a = column2.value).renderHeader) == null ? void 0 : _b.call(_a, column2.value, store), column2.value.filterable && createVNode(Filter, {
|
|
10431
|
+
"filterList": column2.value.filterList,
|
|
10432
|
+
"multiple": column2.value.filterMultiple,
|
|
10067
10433
|
"onFilter": handleFilter
|
|
10068
|
-
}, null),
|
|
10434
|
+
}, null), column2.value.sortable && createVNode(Sort, {
|
|
10069
10435
|
"sort-direction": direction.value,
|
|
10070
10436
|
"onSort": handleSort
|
|
10071
|
-
}, null),
|
|
10437
|
+
}, null), column2.value.resizeable && createVNode("span", {
|
|
10072
10438
|
"class": "resize-handle",
|
|
10073
10439
|
"onClick": (e) => e.stopPropagation()
|
|
10074
|
-
}, null),
|
|
10440
|
+
}, null), column2.value.resizeable && resizing.value && createVNode("div", {
|
|
10075
10441
|
"class": "resize-overlay",
|
|
10076
10442
|
"onClick": (e) => e.stopPropagation()
|
|
10077
10443
|
}, null)])]);
|
|
@@ -10080,53 +10446,53 @@ var TH = defineComponent({
|
|
|
10080
10446
|
});
|
|
10081
10447
|
function getAllColumns(columns) {
|
|
10082
10448
|
const result = [];
|
|
10083
|
-
columns.forEach((
|
|
10084
|
-
if (
|
|
10085
|
-
result.push(
|
|
10086
|
-
result.push.apply(result, getAllColumns(
|
|
10449
|
+
columns.forEach((column2) => {
|
|
10450
|
+
if (column2.children) {
|
|
10451
|
+
result.push(column2);
|
|
10452
|
+
result.push.apply(result, getAllColumns(column2.children));
|
|
10087
10453
|
} else {
|
|
10088
|
-
result.push(
|
|
10454
|
+
result.push(column2);
|
|
10089
10455
|
}
|
|
10090
10456
|
});
|
|
10091
10457
|
return result;
|
|
10092
10458
|
}
|
|
10093
10459
|
function convertToRows(originColumns) {
|
|
10094
10460
|
let maxLevel = 1;
|
|
10095
|
-
const traverse = (
|
|
10461
|
+
const traverse = (column2, parent) => {
|
|
10096
10462
|
if (parent) {
|
|
10097
|
-
|
|
10098
|
-
if (maxLevel <
|
|
10099
|
-
maxLevel =
|
|
10463
|
+
column2.level = parent.level + 1;
|
|
10464
|
+
if (maxLevel < column2.level) {
|
|
10465
|
+
maxLevel = column2.level;
|
|
10100
10466
|
}
|
|
10101
10467
|
}
|
|
10102
|
-
if (
|
|
10468
|
+
if (column2.children) {
|
|
10103
10469
|
let colSpan = 0;
|
|
10104
|
-
|
|
10105
|
-
traverse(subColumn,
|
|
10106
|
-
colSpan += subColumn.colSpan;
|
|
10470
|
+
column2.children.forEach((subColumn) => {
|
|
10471
|
+
traverse(subColumn, column2);
|
|
10472
|
+
colSpan += subColumn.colSpan || 0;
|
|
10107
10473
|
});
|
|
10108
|
-
|
|
10474
|
+
column2.colSpan = colSpan;
|
|
10109
10475
|
} else {
|
|
10110
|
-
|
|
10476
|
+
column2.colSpan = 1;
|
|
10111
10477
|
}
|
|
10112
10478
|
};
|
|
10113
|
-
originColumns.forEach((
|
|
10114
|
-
|
|
10115
|
-
traverse(
|
|
10479
|
+
originColumns.forEach((column2) => {
|
|
10480
|
+
column2.level = 1;
|
|
10481
|
+
traverse(column2, void 0);
|
|
10116
10482
|
});
|
|
10117
10483
|
const rows = [];
|
|
10118
10484
|
for (let i = 0; i < maxLevel; i++) {
|
|
10119
10485
|
rows.push([]);
|
|
10120
10486
|
}
|
|
10121
10487
|
const allColumns = getAllColumns(originColumns);
|
|
10122
|
-
allColumns.forEach((
|
|
10123
|
-
if (!
|
|
10124
|
-
|
|
10488
|
+
allColumns.forEach((column2) => {
|
|
10489
|
+
if (!column2.children) {
|
|
10490
|
+
column2.rowSpan = maxLevel - (column2.level || 0) + 1;
|
|
10125
10491
|
} else {
|
|
10126
|
-
|
|
10127
|
-
|
|
10492
|
+
column2.rowSpan = 1;
|
|
10493
|
+
column2.children.forEach((col) => col.isSubColumn = true);
|
|
10128
10494
|
}
|
|
10129
|
-
rows[
|
|
10495
|
+
rows[column2.level - 1].push(column2);
|
|
10130
10496
|
});
|
|
10131
10497
|
return rows;
|
|
10132
10498
|
}
|
|
@@ -10146,12 +10512,12 @@ var TableHeader = defineComponent({
|
|
|
10146
10512
|
} = useHeader();
|
|
10147
10513
|
return () => createVNode("thead", {
|
|
10148
10514
|
"class": ns2.e("thead")
|
|
10149
|
-
}, [headerRows.value.map((subColumns) => createVNode("tr", null, [subColumns.map((
|
|
10515
|
+
}, [headerRows.value.map((subColumns) => createVNode("tr", null, [subColumns.map((column2, columnIndex) => {
|
|
10150
10516
|
return createVNode(TH, {
|
|
10151
10517
|
"key": columnIndex,
|
|
10152
|
-
"column":
|
|
10153
|
-
"colspan":
|
|
10154
|
-
"rowspan":
|
|
10518
|
+
"column": column2,
|
|
10519
|
+
"colspan": column2.colSpan,
|
|
10520
|
+
"rowspan": column2.rowSpan
|
|
10155
10521
|
}, null);
|
|
10156
10522
|
})]))]);
|
|
10157
10523
|
}
|
|
@@ -10165,6 +10531,12 @@ const bodyTdProps = {
|
|
|
10165
10531
|
type: Object,
|
|
10166
10532
|
default: () => ({})
|
|
10167
10533
|
},
|
|
10534
|
+
rowspan: {
|
|
10535
|
+
type: Number
|
|
10536
|
+
},
|
|
10537
|
+
colspan: {
|
|
10538
|
+
type: Number
|
|
10539
|
+
},
|
|
10168
10540
|
index: {
|
|
10169
10541
|
type: Number,
|
|
10170
10542
|
default: 0
|
|
@@ -10320,11 +10692,12 @@ var Tooltip = defineComponent({
|
|
|
10320
10692
|
})]);
|
|
10321
10693
|
}
|
|
10322
10694
|
});
|
|
10323
|
-
function useBodyTd(props) {
|
|
10695
|
+
function useBodyTd(props, ctx) {
|
|
10324
10696
|
const tooltipContent = ref();
|
|
10325
10697
|
const isShowTooltip = ref(false);
|
|
10326
10698
|
const tdRef = ref();
|
|
10327
10699
|
let observer;
|
|
10700
|
+
const table2 = inject(TABLE_TOKEN);
|
|
10328
10701
|
function getTooltipContent() {
|
|
10329
10702
|
var _a, _b;
|
|
10330
10703
|
return ((_a = tdRef.value) == null ? void 0 : _a.innerText) || ((_b = tdRef.value) == null ? void 0 : _b.textContent);
|
|
@@ -10338,36 +10711,68 @@ function useBodyTd(props) {
|
|
|
10338
10711
|
range3.setEnd(tdRef.value, tdRef.value.childNodes.length);
|
|
10339
10712
|
const rangeWidth = range3.getBoundingClientRect().width;
|
|
10340
10713
|
const padding = parseInt(window.getComputedStyle(tdRef.value)["paddingLeft"], 10) + parseInt(window.getComputedStyle(tdRef.value)["paddingRight"], 10);
|
|
10341
|
-
isShowTooltip.value = props.column.showOverflowTooltip && rangeWidth + padding > tdRef.value.offsetWidth;
|
|
10714
|
+
isShowTooltip.value = !!(props.column.showOverflowTooltip && rangeWidth + padding > tdRef.value.offsetWidth);
|
|
10342
10715
|
}
|
|
10343
10716
|
onMounted(() => {
|
|
10344
10717
|
if (inBrowser && window.ResizeObserver && props.column.showOverflowTooltip) {
|
|
10345
|
-
const
|
|
10346
|
-
tdRef.value &&
|
|
10718
|
+
const innerObserver = new window.ResizeObserver(shouldShowTooltip);
|
|
10719
|
+
tdRef.value && innerObserver.observe(tdRef.value);
|
|
10347
10720
|
}
|
|
10348
10721
|
tooltipContent.value = getTooltipContent();
|
|
10349
10722
|
});
|
|
10350
10723
|
onBeforeMount(() => {
|
|
10351
10724
|
tdRef.value && observer.unobserve(tdRef.value);
|
|
10352
10725
|
});
|
|
10353
|
-
|
|
10726
|
+
onUpdated(() => {
|
|
10727
|
+
const modeMap = table2.store.states.tableCellModeMap.value;
|
|
10728
|
+
for (const child of modeMap.keys()) {
|
|
10729
|
+
modeMap.set(child, "readonly");
|
|
10730
|
+
}
|
|
10731
|
+
});
|
|
10732
|
+
const getCellKsy = () => {
|
|
10733
|
+
return `${getRowIdentity(props.row, table2.props.rowKey, props.index)}-${props.column.field}-cell`;
|
|
10734
|
+
};
|
|
10735
|
+
const cellMode = computed(() => {
|
|
10736
|
+
const cellKey = getCellKsy();
|
|
10737
|
+
const mode = table2.store.states.tableCellModeMap.value.get(cellKey);
|
|
10738
|
+
return mode || "readonly";
|
|
10739
|
+
});
|
|
10740
|
+
const onCellClick = () => {
|
|
10741
|
+
const modeMap = table2.store.states.tableCellModeMap.value;
|
|
10742
|
+
const cellKey = getCellKsy();
|
|
10743
|
+
for (const child of modeMap.keys()) {
|
|
10744
|
+
modeMap.set(child, "readonly");
|
|
10745
|
+
}
|
|
10746
|
+
if (props.column.type === "editable" && modeMap.get(cellKey) === "edit") {
|
|
10747
|
+
return;
|
|
10748
|
+
}
|
|
10749
|
+
ctx.emit("cellClick");
|
|
10750
|
+
};
|
|
10751
|
+
return { tdRef, isShowTooltip, tooltipContent, cellMode, onCellClick };
|
|
10354
10752
|
}
|
|
10355
10753
|
var TD = defineComponent({
|
|
10356
10754
|
name: "DTableBodyTd",
|
|
10357
10755
|
inheritAttrs: false,
|
|
10358
10756
|
props: bodyTdProps,
|
|
10757
|
+
emits: ["cellClick"],
|
|
10359
10758
|
setup(props, ctx) {
|
|
10360
|
-
const
|
|
10759
|
+
const {
|
|
10760
|
+
column: column2,
|
|
10761
|
+
rowspan,
|
|
10762
|
+
colspan
|
|
10763
|
+
} = toRefs(props);
|
|
10361
10764
|
const table2 = inject(TABLE_TOKEN);
|
|
10362
10765
|
const {
|
|
10363
10766
|
stickyClass,
|
|
10364
10767
|
stickyStyle
|
|
10365
|
-
} = useFixedColumn(
|
|
10768
|
+
} = useFixedColumn(column2);
|
|
10366
10769
|
const {
|
|
10367
10770
|
tdRef,
|
|
10368
10771
|
isShowTooltip,
|
|
10369
|
-
tooltipContent
|
|
10370
|
-
|
|
10772
|
+
tooltipContent,
|
|
10773
|
+
cellMode,
|
|
10774
|
+
onCellClick
|
|
10775
|
+
} = useBodyTd(props, ctx);
|
|
10371
10776
|
return () => {
|
|
10372
10777
|
return createVNode(Tooltip, {
|
|
10373
10778
|
"content": tooltipContent.value,
|
|
@@ -10379,21 +10784,26 @@ var TD = defineComponent({
|
|
|
10379
10784
|
"ref": tdRef,
|
|
10380
10785
|
"class": stickyClass.value,
|
|
10381
10786
|
"style": stickyStyle.value
|
|
10382
|
-
}, ctx.attrs
|
|
10787
|
+
}, ctx.attrs, {
|
|
10788
|
+
"rowspan": rowspan == null ? void 0 : rowspan.value,
|
|
10789
|
+
"colspan": colspan == null ? void 0 : colspan.value,
|
|
10790
|
+
"onClick": onCellClick
|
|
10791
|
+
}), [(_b = (_a = props.column).renderCell) == null ? void 0 : _b.call(_a, props.row, props.column, table2.store, props.index, table2.props, cellMode)])];
|
|
10383
10792
|
}
|
|
10384
10793
|
});
|
|
10385
10794
|
};
|
|
10386
10795
|
}
|
|
10387
10796
|
});
|
|
10797
|
+
const ns$1 = useNamespace("table");
|
|
10388
10798
|
function useMergeCell() {
|
|
10389
10799
|
const table2 = inject(TABLE_TOKEN);
|
|
10390
10800
|
const { _data: data, _columns: columns } = table2.store.states;
|
|
10391
|
-
const getSpan = (row,
|
|
10801
|
+
const getSpan = (row, column2, rowIndex, columnIndex) => {
|
|
10392
10802
|
const fn = table2 == null ? void 0 : table2.props.spanMethod;
|
|
10393
10803
|
let rowspan = 1;
|
|
10394
10804
|
let colspan = 1;
|
|
10395
10805
|
if (typeof fn === "function") {
|
|
10396
|
-
const result = fn({ row, column, rowIndex, columnIndex });
|
|
10806
|
+
const result = fn({ row, column: column2, rowIndex, columnIndex });
|
|
10397
10807
|
if (Array.isArray(result)) {
|
|
10398
10808
|
rowspan = result[0];
|
|
10399
10809
|
colspan = result[1];
|
|
@@ -10408,8 +10818,8 @@ function useMergeCell() {
|
|
|
10408
10818
|
const result = {};
|
|
10409
10819
|
if (table2 == null ? void 0 : table2.props.spanMethod) {
|
|
10410
10820
|
data.value.forEach((row, rowIndex) => {
|
|
10411
|
-
columns.value.forEach((
|
|
10412
|
-
const { rowspan, colspan } = getSpan(row,
|
|
10821
|
+
columns.value.forEach((column2, columnIndex) => {
|
|
10822
|
+
const { rowspan, colspan } = getSpan(row, column2, rowIndex, columnIndex);
|
|
10413
10823
|
if (rowspan > 1 || colspan > 1) {
|
|
10414
10824
|
result[`${rowIndex}-${columnIndex}`] = [rowspan, colspan];
|
|
10415
10825
|
}
|
|
@@ -10437,20 +10847,39 @@ function useMergeCell() {
|
|
|
10437
10847
|
});
|
|
10438
10848
|
return { tableSpans, removeCells };
|
|
10439
10849
|
}
|
|
10850
|
+
function useBodyRender() {
|
|
10851
|
+
const table2 = inject(TABLE_TOKEN);
|
|
10852
|
+
const hoverEnabled = computed(() => table2 == null ? void 0 : table2.props.rowHoveredHighlight);
|
|
10853
|
+
const rowLevelMap = (table2 == null ? void 0 : table2.store.states.rowLevelMap) || {};
|
|
10854
|
+
const rowKey = (table2 == null ? void 0 : table2.props.rowKey) || "id";
|
|
10855
|
+
const getTableRowClass = (row) => {
|
|
10856
|
+
const level = rowLevelMap.value[getRowIdentity(row, rowKey)];
|
|
10857
|
+
return {
|
|
10858
|
+
[ns$1.e("row")]: true,
|
|
10859
|
+
["hover-enabled"]: hoverEnabled.value,
|
|
10860
|
+
["expanded"]: table2 == null ? void 0 : table2.store.isRowExpanded(row),
|
|
10861
|
+
[ns$1.em("row", `level-${level}`)]: level !== void 0,
|
|
10862
|
+
["is-hidden"]: table2 == null ? void 0 : table2.store.states.hiddenRowKeys.value.includes(getRowIdentity(row, rowKey))
|
|
10863
|
+
};
|
|
10864
|
+
};
|
|
10865
|
+
return { getTableRowClass };
|
|
10866
|
+
}
|
|
10440
10867
|
var TableBody = defineComponent({
|
|
10441
10868
|
name: "DTableBody",
|
|
10442
10869
|
setup() {
|
|
10443
10870
|
const table2 = inject(TABLE_TOKEN);
|
|
10444
10871
|
const {
|
|
10445
|
-
|
|
10446
|
-
|
|
10872
|
+
flatColumns,
|
|
10873
|
+
flatRows
|
|
10447
10874
|
} = table2.store.states;
|
|
10448
10875
|
const ns2 = useNamespace("table");
|
|
10449
|
-
const hoverEnabled = computed(() => table2.props.rowHoveredHighlight);
|
|
10450
10876
|
const {
|
|
10451
10877
|
tableSpans,
|
|
10452
10878
|
removeCells
|
|
10453
10879
|
} = useMergeCell();
|
|
10880
|
+
const {
|
|
10881
|
+
getTableRowClass
|
|
10882
|
+
} = useBodyRender();
|
|
10454
10883
|
const onCellClick = (cellClickArg) => {
|
|
10455
10884
|
table2.emit("cell-click", cellClickArg);
|
|
10456
10885
|
};
|
|
@@ -10459,18 +10888,15 @@ var TableBody = defineComponent({
|
|
|
10459
10888
|
};
|
|
10460
10889
|
return () => createVNode("tbody", {
|
|
10461
10890
|
"class": ns2.e("tbody")
|
|
10462
|
-
}, [
|
|
10891
|
+
}, [flatRows.value.map((row, rowIndex) => {
|
|
10463
10892
|
var _a, _b, _c, _d;
|
|
10464
10893
|
return createVNode(Fragment, null, [createVNode("tr", {
|
|
10465
10894
|
"key": rowIndex,
|
|
10466
|
-
"class":
|
|
10467
|
-
"hover-enabled": hoverEnabled.value,
|
|
10468
|
-
expanded: table2.store.isRowExpanded(row)
|
|
10469
|
-
},
|
|
10895
|
+
"class": getTableRowClass(row),
|
|
10470
10896
|
"onClick": () => onRowClick({
|
|
10471
10897
|
row
|
|
10472
10898
|
})
|
|
10473
|
-
}, [flatColumns.value.map((
|
|
10899
|
+
}, [flatColumns.value.map((column2, columnIndex) => {
|
|
10474
10900
|
var _a2;
|
|
10475
10901
|
const cellId = `${rowIndex}-${columnIndex}`;
|
|
10476
10902
|
const [rowspan, colspan] = (_a2 = tableSpans.value[cellId]) != null ? _a2 : [1, 1];
|
|
@@ -10478,21 +10904,21 @@ var TableBody = defineComponent({
|
|
|
10478
10904
|
return null;
|
|
10479
10905
|
}
|
|
10480
10906
|
return createVNode(TD, {
|
|
10481
|
-
"column":
|
|
10907
|
+
"column": column2,
|
|
10482
10908
|
"index": rowIndex,
|
|
10483
10909
|
"row": row,
|
|
10484
10910
|
"rowspan": rowspan,
|
|
10485
10911
|
"colspan": colspan,
|
|
10486
|
-
"
|
|
10912
|
+
"onCellClick": () => onCellClick({
|
|
10487
10913
|
rowIndex,
|
|
10488
10914
|
columnIndex,
|
|
10489
|
-
column,
|
|
10915
|
+
column: column2,
|
|
10490
10916
|
row
|
|
10491
10917
|
})
|
|
10492
10918
|
}, null);
|
|
10493
|
-
})]), flatColumns.value.some((
|
|
10919
|
+
})]), flatColumns.value.some((column2) => column2.type === "expand") && table2.store.isRowExpanded(row) && createVNode("tr", null, [createVNode("td", {
|
|
10494
10920
|
"colspan": flatColumns.value.length
|
|
10495
|
-
}, [(_d = (_c = (_b = (_a = flatColumns.value.filter((
|
|
10921
|
+
}, [(_d = (_c = (_b = (_a = flatColumns.value.filter((column2) => column2.type === "expand")) == null ? void 0 : _a[0]) == null ? void 0 : _b.slots) == null ? void 0 : _c.default) == null ? void 0 : _d.call(_c, {
|
|
10496
10922
|
row
|
|
10497
10923
|
})])])]);
|
|
10498
10924
|
})]);
|
|
@@ -10592,6 +11018,8 @@ var Table = defineComponent({
|
|
|
10592
11018
|
onMounted(async () => {
|
|
10593
11019
|
await nextTick();
|
|
10594
11020
|
store.updateColumns();
|
|
11021
|
+
store.updateFirstDefaultColumn();
|
|
11022
|
+
store.updateRows();
|
|
10595
11023
|
updateColumnWidth();
|
|
10596
11024
|
});
|
|
10597
11025
|
return () => {
|
|
@@ -10695,36 +11123,86 @@ const tableColumnProps = {
|
|
|
10695
11123
|
default: false
|
|
10696
11124
|
}
|
|
10697
11125
|
};
|
|
11126
|
+
var column = "";
|
|
11127
|
+
const IconOpen = () => createVNode("svg", {
|
|
11128
|
+
"width": "16px",
|
|
11129
|
+
"height": "16px",
|
|
11130
|
+
"viewBox": "0 0 16 16",
|
|
11131
|
+
"version": "1.1",
|
|
11132
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
11133
|
+
"class": "svg-icon svg-icon-close"
|
|
11134
|
+
}, [createVNode("g", {
|
|
11135
|
+
"stroke-width": "1",
|
|
11136
|
+
"fill": "none",
|
|
11137
|
+
"fill-rule": "evenodd"
|
|
11138
|
+
}, [createVNode("rect", {
|
|
11139
|
+
"x": "0.5",
|
|
11140
|
+
"y": "0.5",
|
|
11141
|
+
"width": "15",
|
|
11142
|
+
"height": "15",
|
|
11143
|
+
"rx": "2",
|
|
11144
|
+
"stroke": "#5e7ce0"
|
|
11145
|
+
}, null), createVNode("rect", {
|
|
11146
|
+
"x": "4",
|
|
11147
|
+
"y": "7",
|
|
11148
|
+
"width": "8",
|
|
11149
|
+
"height": "2",
|
|
11150
|
+
"fill": "#5e7ce0"
|
|
11151
|
+
}, null)])]);
|
|
11152
|
+
const IconClose = () => createVNode("svg", {
|
|
11153
|
+
"width": "16px",
|
|
11154
|
+
"height": "16px",
|
|
11155
|
+
"viewBox": "0 0 16 16",
|
|
11156
|
+
"version": "1.1",
|
|
11157
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
11158
|
+
"class": "svg-icon"
|
|
11159
|
+
}, [createVNode("g", {
|
|
11160
|
+
"stroke": "none",
|
|
11161
|
+
"stroke-width": "1",
|
|
11162
|
+
"fill": "none",
|
|
11163
|
+
"fill-rule": "evenodd"
|
|
11164
|
+
}, [createVNode("rect", {
|
|
11165
|
+
"x": "0.5",
|
|
11166
|
+
"y": "0.5",
|
|
11167
|
+
"width": "15",
|
|
11168
|
+
"height": "15",
|
|
11169
|
+
"rx": "2",
|
|
11170
|
+
"stroke": "#252b3a"
|
|
11171
|
+
}, null), createVNode("path", {
|
|
11172
|
+
"fill": "#252b3a",
|
|
11173
|
+
"d": "M8.75,4 L8.75,7.25 L12,7.25 L12,8.75 L8.749,8.75 L8.75,12 L7.25,12 L7.249,8.75 L4,8.75 L4,7.25 L7.25,7.25 L7.25,4 L8.75,4 Z"
|
|
11174
|
+
}, null)])]);
|
|
11175
|
+
const ns = useNamespace("table");
|
|
10698
11176
|
const cellMap = {
|
|
10699
11177
|
checkable: {
|
|
10700
|
-
renderHeader(
|
|
11178
|
+
renderHeader(column2, store) {
|
|
10701
11179
|
return h(Checkbox, {
|
|
10702
11180
|
modelValue: store.states._checkAll.value,
|
|
10703
11181
|
halfChecked: store.states._halfChecked.value,
|
|
10704
11182
|
onChange: (val) => {
|
|
10705
11183
|
store.states._checkAll.value = val;
|
|
10706
|
-
store._table.emit("check-all-change", val);
|
|
11184
|
+
store._table.emit("check-all-change", val, store.getCheckedRows());
|
|
10707
11185
|
}
|
|
10708
11186
|
});
|
|
10709
11187
|
},
|
|
10710
|
-
renderCell(rowData,
|
|
11188
|
+
renderCell(rowData, column2, store, rowIndex) {
|
|
10711
11189
|
return h(Checkbox, {
|
|
10712
|
-
modelValue: store.isRowChecked(rowData),
|
|
11190
|
+
modelValue: store.isRowChecked(rowData, rowIndex),
|
|
10713
11191
|
onChange: (val) => {
|
|
10714
|
-
store.checkRow(val, rowData);
|
|
10715
|
-
store._table.emit("check-change", val, store.states._data.value[rowIndex]);
|
|
11192
|
+
store.checkRow(val, rowData, rowIndex);
|
|
11193
|
+
store._table.emit("check-change", val, store.states._data.value[rowIndex], store.getCheckedRows());
|
|
10716
11194
|
}
|
|
10717
11195
|
});
|
|
10718
11196
|
}
|
|
10719
11197
|
},
|
|
10720
11198
|
index: {
|
|
10721
|
-
renderHeader(
|
|
11199
|
+
renderHeader(column2) {
|
|
10722
11200
|
var _a;
|
|
10723
11201
|
return h("span", {
|
|
10724
11202
|
class: "title"
|
|
10725
|
-
}, (_a =
|
|
11203
|
+
}, (_a = column2.header) != null ? _a : "#");
|
|
10726
11204
|
},
|
|
10727
|
-
renderCell(rowData,
|
|
11205
|
+
renderCell(rowData, column2, store, rowIndex) {
|
|
10728
11206
|
return rowIndex + 1;
|
|
10729
11207
|
}
|
|
10730
11208
|
},
|
|
@@ -10732,7 +11210,7 @@ const cellMap = {
|
|
|
10732
11210
|
renderHeader() {
|
|
10733
11211
|
return createVNode("span", null, null);
|
|
10734
11212
|
},
|
|
10735
|
-
renderCell(rowData,
|
|
11213
|
+
renderCell(rowData, column2, store) {
|
|
10736
11214
|
return createVNode(Icon, {
|
|
10737
11215
|
"name": "chevron-right",
|
|
10738
11216
|
"class": "icon-expand-row",
|
|
@@ -10742,20 +11220,99 @@ const cellMap = {
|
|
|
10742
11220
|
}, null);
|
|
10743
11221
|
}
|
|
10744
11222
|
},
|
|
10745
|
-
|
|
10746
|
-
renderHeader(
|
|
11223
|
+
editable: {
|
|
11224
|
+
renderHeader(column2) {
|
|
10747
11225
|
var _a;
|
|
10748
11226
|
return h("span", {
|
|
10749
11227
|
class: "title"
|
|
10750
|
-
}, (_a =
|
|
11228
|
+
}, (_a = column2.header) != null ? _a : "");
|
|
10751
11229
|
},
|
|
10752
|
-
renderCell(rowData,
|
|
11230
|
+
renderCell(rowData, column2, store, rowIndex, props, cellMode, ctx) {
|
|
10753
11231
|
var _a, _b;
|
|
10754
|
-
|
|
10755
|
-
if (
|
|
10756
|
-
|
|
11232
|
+
let columnValue;
|
|
11233
|
+
if (cellMode.value === "edit") {
|
|
11234
|
+
columnValue = ctx.slots.cellEdit ? ctx.slots.cellEdit({
|
|
11235
|
+
row: rowData,
|
|
11236
|
+
rowIndex
|
|
11237
|
+
}) : "";
|
|
11238
|
+
} else {
|
|
11239
|
+
if (ctx.slots.cell) {
|
|
11240
|
+
columnValue = createVNode("div", {
|
|
11241
|
+
"class": "cell-text"
|
|
11242
|
+
}, [ctx.slots.cell({
|
|
11243
|
+
row: rowData,
|
|
11244
|
+
rowIndex
|
|
11245
|
+
})]);
|
|
11246
|
+
} else {
|
|
11247
|
+
const value = column2.field ? rowData[column2.field] : "";
|
|
11248
|
+
if (column2.formatter) {
|
|
11249
|
+
columnValue = column2.formatter(rowData, column2, value, rowIndex);
|
|
11250
|
+
}
|
|
11251
|
+
columnValue = createVNode("div", {
|
|
11252
|
+
"class": "cell-text"
|
|
11253
|
+
}, [(_b = (_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) != null ? _b : ""]);
|
|
11254
|
+
}
|
|
10757
11255
|
}
|
|
10758
|
-
return (
|
|
11256
|
+
return h("div", {
|
|
11257
|
+
class: [ns.e("cell"), column2.type === "editable" && (cellMode == null ? void 0 : cellMode.value) === "readonly" && "editable-cell"]
|
|
11258
|
+
}, columnValue);
|
|
11259
|
+
}
|
|
11260
|
+
},
|
|
11261
|
+
default: {
|
|
11262
|
+
renderHeader(column2) {
|
|
11263
|
+
var _a;
|
|
11264
|
+
return h("span", {
|
|
11265
|
+
class: "title"
|
|
11266
|
+
}, (_a = column2.header) != null ? _a : "");
|
|
11267
|
+
},
|
|
11268
|
+
renderCell(rowData, column2, store, rowIndex, props, cellMode, ctx) {
|
|
11269
|
+
var _a, _b, _c;
|
|
11270
|
+
let columnValue;
|
|
11271
|
+
if (ctx.slots.default) {
|
|
11272
|
+
columnValue = ctx.slots.default({
|
|
11273
|
+
row: rowData,
|
|
11274
|
+
rowIndex
|
|
11275
|
+
});
|
|
11276
|
+
} else {
|
|
11277
|
+
const value = column2.field ? rowData[column2.field] : "";
|
|
11278
|
+
if (column2.formatter) {
|
|
11279
|
+
columnValue = column2.formatter(rowData, column2, value, rowIndex);
|
|
11280
|
+
}
|
|
11281
|
+
columnValue = (_b = (_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) != null ? _b : "";
|
|
11282
|
+
}
|
|
11283
|
+
const hasExpandColumn = store.states.flatColumns.value.some((column22) => column22.type === "expand");
|
|
11284
|
+
const hasChildren = store.states._data.value.some((row) => {
|
|
11285
|
+
var _a2;
|
|
11286
|
+
return (_a2 = row.children) == null ? void 0 : _a2.length;
|
|
11287
|
+
});
|
|
11288
|
+
const level = store.states.rowLevelMap.value[getRowIdentity(rowData, props.rowKey)] || 0;
|
|
11289
|
+
const indentDom = h("span", {
|
|
11290
|
+
class: `${ns.e("indent")}`,
|
|
11291
|
+
style: {
|
|
11292
|
+
paddingLeft: `${level * props.indent}px`
|
|
11293
|
+
}
|
|
11294
|
+
}, "");
|
|
11295
|
+
const isTreeCell = store.states.firstDefaultColumn.value === column2.id;
|
|
11296
|
+
const showIndentDom = isTreeCell && level;
|
|
11297
|
+
const showExpendIconDom = isTreeCell && ((_c = rowData.children) == null ? void 0 : _c.length);
|
|
11298
|
+
const expendIconDom = createVNode("span", {
|
|
11299
|
+
"class": ns.e("tree-operate"),
|
|
11300
|
+
"onClick": () => {
|
|
11301
|
+
store.toggleRowExpansion(rowData);
|
|
11302
|
+
},
|
|
11303
|
+
"style": showExpendIconDom ? "" : "visibility: hidden;"
|
|
11304
|
+
}, [store.isRowExpanded(rowData) ? createVNode(IconOpen, null, null) : createVNode(IconClose, null, null)]);
|
|
11305
|
+
const cellDom = [];
|
|
11306
|
+
if (showIndentDom) {
|
|
11307
|
+
cellDom.push(indentDom);
|
|
11308
|
+
}
|
|
11309
|
+
if (hasChildren && !hasExpandColumn && isTreeCell) {
|
|
11310
|
+
cellDom.push(expendIconDom);
|
|
11311
|
+
}
|
|
11312
|
+
cellDom.push(columnValue);
|
|
11313
|
+
return h("div", {
|
|
11314
|
+
class: `${ns.e("cell")} `
|
|
11315
|
+
}, cellDom);
|
|
10759
11316
|
}
|
|
10760
11317
|
}
|
|
10761
11318
|
};
|
|
@@ -10781,64 +11338,65 @@ function createColumn(id, props, ctx) {
|
|
|
10781
11338
|
showOverflowTooltip,
|
|
10782
11339
|
resizeable
|
|
10783
11340
|
} = props;
|
|
10784
|
-
const
|
|
10785
|
-
|
|
11341
|
+
const column2 = reactive({ id });
|
|
11342
|
+
column2.type = type4.value;
|
|
10786
11343
|
function renderHeader(columnItem, store) {
|
|
10787
11344
|
if (ctx.slots.header) {
|
|
10788
11345
|
return ctx.slots.header(columnItem);
|
|
10789
11346
|
}
|
|
10790
11347
|
return cellMap[type4.value || "default"].renderHeader(columnItem, store);
|
|
10791
11348
|
}
|
|
10792
|
-
function renderCell(rowData, columnItem, store, rowIndex) {
|
|
10793
|
-
if (ctx.slots.default && columnItem.type
|
|
11349
|
+
function renderCell(rowData, columnItem, store, rowIndex, tableProps2, cellMode) {
|
|
11350
|
+
if (ctx.slots.default && columnItem.type === "index") {
|
|
10794
11351
|
return ctx.slots.default({ row: rowData, rowIndex });
|
|
10795
11352
|
}
|
|
10796
|
-
return cellMap[type4.value || "default"].renderCell(rowData, columnItem, store, rowIndex);
|
|
11353
|
+
return cellMap[type4.value || "default"].renderCell(rowData, columnItem, store, rowIndex, tableProps2, cellMode, ctx);
|
|
10797
11354
|
}
|
|
10798
11355
|
watch([field, header2, order], ([fieldVal, headerVal, orderVal]) => {
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
11356
|
+
column2.field = fieldVal;
|
|
11357
|
+
column2.header = headerVal;
|
|
11358
|
+
column2.order = orderVal;
|
|
10802
11359
|
}, { immediate: true });
|
|
10803
11360
|
watch([sortable, sortDirection, sortMethod], ([sortableVal, sortDirectionVal, sortMethodVal]) => {
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
11361
|
+
column2.sortable = sortableVal;
|
|
11362
|
+
column2.sortDirection = sortDirectionVal;
|
|
11363
|
+
column2.sortMethod = sortMethodVal;
|
|
10807
11364
|
}, { immediate: true });
|
|
10808
11365
|
watch([filterable, filterList, filterMultiple], ([filterableVal, filterListVal, filterMultipleVal]) => {
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
11366
|
+
column2.filterable = filterableVal;
|
|
11367
|
+
column2.filterMultiple = filterMultipleVal;
|
|
11368
|
+
column2.filterList = filterListVal;
|
|
10812
11369
|
}, { immediate: true });
|
|
10813
11370
|
watch([fixedLeft, fixedRight], ([left, right]) => {
|
|
10814
|
-
|
|
10815
|
-
|
|
11371
|
+
column2.fixedLeft = left;
|
|
11372
|
+
column2.fixedRight = right;
|
|
10816
11373
|
}, { immediate: true });
|
|
10817
11374
|
watch(align, (alignVal) => {
|
|
10818
|
-
|
|
11375
|
+
column2.align = alignVal;
|
|
10819
11376
|
}, { immediate: true });
|
|
10820
11377
|
watch(showOverflowTooltip, (showVal) => {
|
|
10821
|
-
|
|
11378
|
+
column2.showOverflowTooltip = showVal;
|
|
10822
11379
|
}, { immediate: true });
|
|
10823
11380
|
watch(resizeable, (resizeVal) => {
|
|
10824
|
-
|
|
11381
|
+
column2.resizeable = resizeVal;
|
|
10825
11382
|
}, { immediate: true });
|
|
10826
11383
|
watch([width, minWidth, maxWidth], ([widthVal, minWidthVal, maxWidthVal]) => {
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
11384
|
+
column2.width = formatWidth(widthVal);
|
|
11385
|
+
column2.minWidth = minWidthVal;
|
|
11386
|
+
column2.maxWidth = maxWidthVal;
|
|
11387
|
+
column2.realWidth = column2.width;
|
|
10831
11388
|
}, { immediate: true });
|
|
10832
11389
|
onBeforeMount(() => {
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
11390
|
+
column2.id = id;
|
|
11391
|
+
column2.renderHeader = renderHeader;
|
|
11392
|
+
column2.renderCell = renderCell;
|
|
11393
|
+
column2.formatter = formatter == null ? void 0 : formatter.value;
|
|
11394
|
+
column2.customFilterTemplate = ctx.slots.customFilterTemplate;
|
|
11395
|
+
column2.subColumns = ctx.slots.subColumns;
|
|
11396
|
+
column2.slots = ctx.slots;
|
|
11397
|
+
column2.ctx = ctx;
|
|
10840
11398
|
});
|
|
10841
|
-
return
|
|
11399
|
+
return column2;
|
|
10842
11400
|
}
|
|
10843
11401
|
function useRender() {
|
|
10844
11402
|
const instance = getCurrentInstance();
|
|
@@ -10860,7 +11418,6 @@ var Column = defineComponent({
|
|
|
10860
11418
|
props: tableColumnProps,
|
|
10861
11419
|
emits: ["filter-change", "resize-start", "resizing", "resize-end"],
|
|
10862
11420
|
setup(props, ctx) {
|
|
10863
|
-
toRefs(props);
|
|
10864
11421
|
const owner = inject(TABLE_TOKEN);
|
|
10865
11422
|
const isSubColumn = ref(false);
|
|
10866
11423
|
const {
|
|
@@ -10870,16 +11427,16 @@ var Column = defineComponent({
|
|
|
10870
11427
|
const parent = columnOrTableParent.value;
|
|
10871
11428
|
const instance = getCurrentInstance();
|
|
10872
11429
|
instance.columnId = `${parent.tableId || parent.columnId}_column_${columnIdInit++}`;
|
|
10873
|
-
const
|
|
10874
|
-
instance.columnConfig =
|
|
11430
|
+
const column2 = createColumn(instance.columnId, toRefs(props), ctx);
|
|
11431
|
+
instance.columnConfig = column2;
|
|
10875
11432
|
onBeforeMount(() => {
|
|
10876
11433
|
isSubColumn.value = owner !== parent;
|
|
10877
11434
|
});
|
|
10878
11435
|
onMounted(() => {
|
|
10879
|
-
var _a;
|
|
10880
|
-
const children = isSubColumn.value ? parent.vnode.el.children : (
|
|
11436
|
+
var _a, _b, _c;
|
|
11437
|
+
const children = isSubColumn.value ? (_b = (_a = parent == null ? void 0 : parent.vnode) == null ? void 0 : _a.el) == null ? void 0 : _b.children : (_c = owner == null ? void 0 : owner.hiddenColumns.value) == null ? void 0 : _c.children;
|
|
10881
11438
|
const columnIndex = getColumnIndex(children || [], instance.vnode.el);
|
|
10882
|
-
columnIndex > -1 && (owner == null ? void 0 : owner.store.insertColumn(
|
|
11439
|
+
columnIndex > -1 && (owner == null ? void 0 : owner.store.insertColumn(column2, isSubColumn.value ? parent.columnConfig : null));
|
|
10883
11440
|
if (typeof props.checkable === "function") {
|
|
10884
11441
|
for (const [rowIndex, row] of owner == null ? void 0 : owner.store.states._data.value.entries()) {
|
|
10885
11442
|
if (props.checkable(row, rowIndex)) {
|
|
@@ -10888,11 +11445,11 @@ var Column = defineComponent({
|
|
|
10888
11445
|
}
|
|
10889
11446
|
}
|
|
10890
11447
|
});
|
|
10891
|
-
watch(() =>
|
|
11448
|
+
watch(() => column2.order, () => {
|
|
10892
11449
|
owner == null ? void 0 : owner.store.sortColumn();
|
|
10893
11450
|
});
|
|
10894
11451
|
onBeforeUnmount(() => {
|
|
10895
|
-
owner == null ? void 0 : owner.store.removeColumn(
|
|
11452
|
+
owner == null ? void 0 : owner.store.removeColumn(column2);
|
|
10896
11453
|
});
|
|
10897
11454
|
return () => {
|
|
10898
11455
|
var _a, _b;
|
|
@@ -10901,14 +11458,14 @@ var Column = defineComponent({
|
|
|
10901
11458
|
column: {},
|
|
10902
11459
|
$index: -1
|
|
10903
11460
|
});
|
|
10904
|
-
return createVNode("div", null, [Array.isArray(defaultSlot) ? defaultSlot.filter((child) => child.type.name === "DColumn").map((child) => createVNode(Fragment, null, [child])) : createVNode("div", null, null)]);
|
|
11461
|
+
return createVNode("div", null, [defaultSlot && Array.isArray(defaultSlot) ? defaultSlot.filter((child) => child.type.name === "DColumn").map((child) => createVNode(Fragment, null, [child])) : createVNode("div", null, null)]);
|
|
10905
11462
|
};
|
|
10906
11463
|
}
|
|
10907
11464
|
});
|
|
10908
11465
|
var index = {
|
|
10909
11466
|
title: "Table \u8868\u683C",
|
|
10910
11467
|
category: "\u6570\u636E\u5C55\u793A",
|
|
10911
|
-
status: "
|
|
11468
|
+
status: "50%",
|
|
10912
11469
|
install(app) {
|
|
10913
11470
|
app.component(Table.name, Table);
|
|
10914
11471
|
app.component(Column.name, Column);
|