@uzum-tech/ui 2.0.5 → 2.0.6
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/dist/index.js +1039 -493
- package/dist/index.mjs +1039 -493
- package/dist/index.prod.js +2 -2
- package/dist/index.prod.mjs +2 -2
- package/es/_internal/icons/DragHandleRound.d.ts +2 -0
- package/es/_internal/icons/DragHandleRound.mjs +16 -0
- package/es/_internal/icons/index.d.ts +1 -0
- package/es/_internal/icons/index.mjs +1 -0
- package/es/components.d.ts +32 -0
- package/es/data-table/src/DataTable.d.ts +24 -0
- package/es/data-table/src/DataTable.mjs +31 -0
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +6 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +6 -0
- package/es/data-table/src/TableParts/Body.d.ts +17 -9
- package/es/data-table/src/TableParts/Body.mjs +81 -274
- package/es/data-table/src/TableParts/BodyEmpty.d.ts +3 -0
- package/es/data-table/src/TableParts/BodyEmpty.mjs +22 -0
- package/es/data-table/src/TableParts/BodyRow.d.ts +3 -0
- package/es/data-table/src/TableParts/BodyRow.mjs +257 -0
- package/es/data-table/src/TableParts/BodySkeleton.mjs +5 -2
- package/es/data-table/src/TableParts/Header.d.ts +6 -0
- package/es/data-table/src/TableParts/Header.mjs +5 -1
- package/es/data-table/src/TableParts/VirtualListItemWrapper.d.ts +36 -0
- package/es/data-table/src/TableParts/VirtualListItemWrapper.mjs +46 -0
- package/es/data-table/src/interface.d.ts +161 -2
- package/es/data-table/src/styles/index.cssr.mjs +26 -3
- package/es/data-table/src/use-group-header.d.ts +3 -3
- package/es/data-table/src/use-row-drag.d.ts +2 -0
- package/es/data-table/src/use-row-drag.mjs +241 -0
- package/es/data-table/src/use-sorter.d.ts +4 -8
- package/es/data-table/src/use-sorter.mjs +14 -2
- package/es/data-table/src/use-table-data.d.ts +11 -14
- package/es/data-table/src/use-table-data.mjs +4 -2
- package/es/data-table/src/use-table-storage.d.ts +2 -2
- package/es/data-table/src/use-table-storage.mjs +1 -1
- package/es/data-table/src/utils/column-utils.d.ts +3 -2
- package/es/data-table/src/utils/column-utils.mjs +9 -1
- package/es/data-table/src/utils/csv-utils.mjs +1 -1
- package/es/data-table/src/utils/flatten-rows.d.ts +2 -0
- package/es/data-table/src/utils/flatten-rows.mjs +33 -0
- package/es/data-table/src/utils/index.d.ts +1 -0
- package/es/data-table/src/utils/index.mjs +1 -0
- package/es/data-table/src/utils/resize-orchestrator-utils.d.ts +3 -5
- package/es/data-table/src/utils/width-utils.d.ts +2 -2
- package/es/data-table/styles/light.d.ts +6 -0
- package/es/data-table/styles/light.mjs +3 -0
- package/es/mapping-card/src/MappingCard.d.ts +8 -0
- package/es/mapping-card/src/MappingCard.mjs +3 -1
- package/es/mapping-card/src/MappingCardParts/Header.mjs +31 -10
- package/es/mapping-card/src/interface.d.ts +8 -0
- package/es/mapping-card/src/interface.mjs +4 -0
- package/es/mapping-card/src/styles/index.cssr.mjs +8 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/_internal/icons/DragHandleRound.d.ts +2 -0
- package/lib/_internal/icons/DragHandleRound.js +10 -0
- package/lib/_internal/icons/index.d.ts +1 -0
- package/lib/_internal/icons/index.js +4 -2
- package/lib/components.d.ts +32 -0
- package/lib/data-table/src/DataTable.d.ts +24 -0
- package/lib/data-table/src/DataTable.js +19 -1
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +6 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +6 -0
- package/lib/data-table/src/TableParts/Body.d.ts +18 -10
- package/lib/data-table/src/TableParts/Body.js +65 -237
- package/lib/data-table/src/TableParts/BodyEmpty.d.ts +3 -0
- package/lib/data-table/src/TableParts/BodyEmpty.js +15 -0
- package/lib/data-table/src/TableParts/BodyRow.d.ts +3 -0
- package/lib/data-table/src/TableParts/BodyRow.js +210 -0
- package/lib/data-table/src/TableParts/BodySkeleton.js +8 -2
- package/lib/data-table/src/TableParts/Header.d.ts +6 -0
- package/lib/data-table/src/TableParts/Header.js +6 -0
- package/lib/data-table/src/TableParts/VirtualListItemWrapper.d.ts +36 -0
- package/lib/data-table/src/TableParts/VirtualListItemWrapper.js +29 -0
- package/lib/data-table/src/interface.d.ts +161 -2
- package/lib/data-table/src/styles/index.cssr.js +26 -3
- package/lib/data-table/src/use-group-header.d.ts +3 -3
- package/lib/data-table/src/use-row-drag.d.ts +2 -0
- package/lib/data-table/src/use-row-drag.js +270 -0
- package/lib/data-table/src/use-sorter.d.ts +4 -8
- package/lib/data-table/src/use-sorter.js +14 -0
- package/lib/data-table/src/use-table-data.d.ts +11 -14
- package/lib/data-table/src/use-table-data.js +5 -1
- package/lib/data-table/src/use-table-storage.d.ts +2 -2
- package/lib/data-table/src/use-table-storage.js +1 -0
- package/lib/data-table/src/utils/column-utils.d.ts +3 -2
- package/lib/data-table/src/utils/column-utils.js +11 -2
- package/lib/data-table/src/utils/csv-utils.js +1 -0
- package/lib/data-table/src/utils/flatten-rows.d.ts +2 -0
- package/lib/data-table/src/utils/flatten-rows.js +35 -0
- package/lib/data-table/src/utils/index.d.ts +1 -0
- package/lib/data-table/src/utils/index.js +1 -0
- package/lib/data-table/src/utils/resize-orchestrator-utils.d.ts +3 -5
- package/lib/data-table/src/utils/width-utils.d.ts +2 -2
- package/lib/data-table/styles/light.d.ts +6 -0
- package/lib/data-table/styles/light.js +3 -0
- package/lib/mapping-card/src/MappingCard.d.ts +8 -0
- package/lib/mapping-card/src/MappingCard.js +5 -1
- package/lib/mapping-card/src/MappingCardParts/Header.js +29 -5
- package/lib/mapping-card/src/interface.d.ts +8 -0
- package/lib/mapping-card/src/interface.js +4 -0
- package/lib/mapping-card/src/styles/index.cssr.js +8 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
@@ -23,72 +12,13 @@ const common_1 = require("../../../_mixins/common");
|
|
|
23
12
|
const _utils_1 = require("../../../_utils");
|
|
24
13
|
const cssr_1 = require("../../../_utils/cssr");
|
|
25
14
|
const context_1 = require("../../../config-provider/src/context");
|
|
26
|
-
const empty_1 = require("../../../empty");
|
|
27
15
|
const interface_1 = require("../interface");
|
|
28
16
|
const utils_1 = require("../utils");
|
|
29
|
-
const
|
|
30
|
-
const
|
|
17
|
+
const BodyEmpty_1 = require("./BodyEmpty");
|
|
18
|
+
const BodyRow_1 = require("./BodyRow");
|
|
31
19
|
const BodySkeleton_1 = __importDefault(require("./BodySkeleton"));
|
|
32
|
-
const Cell_1 = __importDefault(require("./Cell"));
|
|
33
|
-
const ExpandTrigger_1 = __importDefault(require("./ExpandTrigger"));
|
|
34
20
|
const Header_1 = __importDefault(require("./Header"));
|
|
35
|
-
|
|
36
|
-
const fRows = [];
|
|
37
|
-
function traverse(rs, rootIndex) {
|
|
38
|
-
rs.forEach((r) => {
|
|
39
|
-
if (r.children && expandedRowKeys.has(r.key)) {
|
|
40
|
-
fRows.push({
|
|
41
|
-
tmNode: r,
|
|
42
|
-
striped: false,
|
|
43
|
-
key: r.key,
|
|
44
|
-
index: rootIndex
|
|
45
|
-
});
|
|
46
|
-
traverse(r.children, rootIndex);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
fRows.push({
|
|
50
|
-
key: r.key,
|
|
51
|
-
tmNode: r,
|
|
52
|
-
striped: false,
|
|
53
|
-
index: rootIndex
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
rowInfos.forEach((rowInfo) => {
|
|
59
|
-
fRows.push(rowInfo);
|
|
60
|
-
const { children } = rowInfo.tmNode;
|
|
61
|
-
if (children && expandedRowKeys.has(rowInfo.key)) {
|
|
62
|
-
traverse(children, rowInfo.index);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
return fRows;
|
|
66
|
-
}
|
|
67
|
-
const VirtualListItemWrapper = (0, vue_1.defineComponent)({
|
|
68
|
-
props: {
|
|
69
|
-
clsPrefix: {
|
|
70
|
-
type: String,
|
|
71
|
-
required: true
|
|
72
|
-
},
|
|
73
|
-
id: {
|
|
74
|
-
type: String,
|
|
75
|
-
required: true
|
|
76
|
-
},
|
|
77
|
-
cols: {
|
|
78
|
-
type: Array,
|
|
79
|
-
required: true
|
|
80
|
-
},
|
|
81
|
-
tableWidth: String,
|
|
82
|
-
onMouseenter: Function,
|
|
83
|
-
onMouseleave: Function
|
|
84
|
-
},
|
|
85
|
-
render() {
|
|
86
|
-
const { clsPrefix, id, cols, tableWidth, onMouseenter, onMouseleave } = this;
|
|
87
|
-
return ((0, vue_1.h)("table", { style: { tableLayout: 'fixed', width: tableWidth }, class: `${clsPrefix}-data-table-table`, onMouseenter: onMouseenter, onMouseleave: onMouseleave },
|
|
88
|
-
(0, vue_1.h)("colgroup", null, cols.map(col => ((0, vue_1.h)("col", { key: col.key, style: col.style })))),
|
|
89
|
-
(0, vue_1.h)("tbody", { "data-u-id": id, class: `${clsPrefix}-data-table-tbody` }, this.$slots)));
|
|
90
|
-
}
|
|
91
|
-
});
|
|
21
|
+
const VirtualListItemWrapper_1 = __importDefault(require("./VirtualListItemWrapper"));
|
|
92
22
|
exports.default = (0, vue_1.defineComponent)({
|
|
93
23
|
name: 'DataTableBody',
|
|
94
24
|
emits: ['edit'],
|
|
@@ -100,7 +30,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
100
30
|
bodyStyle: Object
|
|
101
31
|
},
|
|
102
32
|
setup(props) {
|
|
103
|
-
const { slots: dataTableSlots, bodyWidthRef, mergedExpandedRowKeysRef, mergedClsPrefixRef, mergedThemeRef, scrollXRef, colsRef, paginatedDataRef, rawPaginatedDataRef, fixedColumnLeftMapRef, fixedColumnRightMapRef, mergedCurrentPageRef, rowClassNameRef, leftActiveFixedColKeyRef, leftActiveFixedChildrenColKeysRef, rightActiveFixedColKeyRef, rightActiveFixedChildrenColKeysRef, renderExpandRef, hoverKeyRef, summaryRef, mergedSortStateRef, virtualScrollRef, componentId, mergedTableLayoutRef, resizableEnabledRef, childTriggerColIndexRef, indentRef, rowPropsRef, maxHeightRef, stripedRef, loadingRef, loadingSkeletonRef, onLoadRef, loadingKeySetRef, expandableRef, stickyExpandedRowsRef, renderExpandIconRef, summaryPlacementRef, treeMateRef, scrollbarPropsRef, setHeaderScrollLeft, doUpdateExpandedRowKeys, handleTableBodyScroll, doCheck, doUncheck, renderCell, defaultEmptyValueRef, emptyPropsRef } = (0, vue_1.inject)(interface_1.dataTableInjectionKey);
|
|
33
|
+
const { slots: dataTableSlots, bodyWidthRef, mergedExpandedRowKeysRef, mergedClsPrefixRef, mergedThemeRef, scrollXRef, colsRef, paginatedDataRef, rawPaginatedDataRef, fixedColumnLeftMapRef, fixedColumnRightMapRef, mergedCurrentPageRef, rowClassNameRef, leftActiveFixedColKeyRef, leftActiveFixedChildrenColKeysRef, rightActiveFixedColKeyRef, rightActiveFixedChildrenColKeysRef, renderExpandRef, hoverKeyRef, summaryRef, mergedSortStateRef, virtualScrollRef, componentId, mergedTableLayoutRef, resizableEnabledRef, childTriggerColIndexRef, indentRef, rowPropsRef, maxHeightRef, stripedRef, loadingRef, loadingSkeletonRef, onLoadRef, loadingKeySetRef, expandableRef, stickyExpandedRowsRef, renderExpandIconRef, summaryPlacementRef, treeMateRef, scrollbarPropsRef, setHeaderScrollLeft, doUpdateExpandedRowKeys, handleTableBodyScroll, doCheck, doUncheck, renderCell, defaultEmptyValueRef, emptyPropsRef, draggableColumnRef, draggingRowKeySetRef, droppingRowKeyRef, droppingPositionRef, handleRowDragStart, handleRowDragOver, handleRowDragLeave, handleRowDragEnd, handleRowDrop } = (0, vue_1.inject)(interface_1.dataTableInjectionKey);
|
|
104
34
|
const UConfigProvider = (0, vue_1.inject)(context_1.configProviderInjectionKey, null);
|
|
105
35
|
const scrollbarInstRef = (0, vue_1.ref)(null);
|
|
106
36
|
const virtualListRef = (0, vue_1.ref)(null);
|
|
@@ -366,7 +296,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
366
296
|
handleUpdateExpanded,
|
|
367
297
|
renderCell,
|
|
368
298
|
defaultEmptyValueRef,
|
|
369
|
-
emptyPropsRef
|
|
299
|
+
emptyPropsRef, draggableColumn: draggableColumnRef, draggingRowKeySet: draggingRowKeySetRef, droppingRowKey: droppingRowKeyRef, droppingPosition: droppingPositionRef, handleRowDragStart,
|
|
300
|
+
handleRowDragOver,
|
|
301
|
+
handleRowDragLeave,
|
|
302
|
+
handleRowDragEnd,
|
|
303
|
+
handleRowDrop }, exposedMethods);
|
|
370
304
|
},
|
|
371
305
|
render() {
|
|
372
306
|
const { mergedTheme, scrollX, mergedClsPrefix, virtualScroll, maxHeight, mergedTableLayout, fixedResizableMode, fixedResizableTableWidth, flexHeight, loadingKeySet, onResize, setHeaderScrollLeft, emptyPropsRef } = this;
|
|
@@ -397,7 +331,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
397
331
|
// if there is children in data, we should expand mergedData first
|
|
398
332
|
const { data: paginatedData, hasChildren } = paginatedDataAndInfo;
|
|
399
333
|
const mergedPaginationData = hasChildren
|
|
400
|
-
?
|
|
334
|
+
? (0, utils_1.flattenExpandedRows)(paginatedData, mergedExpandedRowKeySet)
|
|
401
335
|
: paginatedData;
|
|
402
336
|
if (summary) {
|
|
403
337
|
const summaryRows = summary(this.rawPaginatedData);
|
|
@@ -462,162 +396,54 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
462
396
|
});
|
|
463
397
|
const bodyWidth = stickyExpandedRows ? this.bodyWidth : null;
|
|
464
398
|
const bodyWidthPx = bodyWidth === null ? undefined : `${bodyWidth}px`;
|
|
465
|
-
const
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
399
|
+
const renderContext = {
|
|
400
|
+
mergedClsPrefix,
|
|
401
|
+
cols,
|
|
402
|
+
colCount,
|
|
403
|
+
rowCount,
|
|
404
|
+
hasChildren,
|
|
405
|
+
childTriggerColIndex,
|
|
406
|
+
indentStyle,
|
|
407
|
+
rowClassName,
|
|
408
|
+
rowProps,
|
|
409
|
+
mergedSortState,
|
|
410
|
+
mergedExpandedRowKeySet,
|
|
411
|
+
fixedColumnLeftMap,
|
|
412
|
+
fixedColumnRightMap,
|
|
413
|
+
currentPage,
|
|
414
|
+
loadingKeySet,
|
|
415
|
+
stickyExpandedRows,
|
|
416
|
+
bodyWidthPx,
|
|
417
|
+
renderExpand,
|
|
418
|
+
renderExpandIcon: this.renderExpandIcon,
|
|
419
|
+
renderCell: this.renderCell,
|
|
420
|
+
defaultEmptyValue: this.defaultEmptyValueRef,
|
|
421
|
+
mergedTheme,
|
|
422
|
+
rowIndexToKey,
|
|
423
|
+
cordToPass,
|
|
424
|
+
cordKey,
|
|
425
|
+
draggableColumn: this.draggableColumn,
|
|
426
|
+
droppingRowKey: this.droppingRowKey,
|
|
427
|
+
droppingPosition: this.droppingPosition,
|
|
428
|
+
draggingRowKeySet: this.draggingRowKeySet,
|
|
429
|
+
hoverKey: this.hoverKey,
|
|
430
|
+
dataTableSlots: this.dataTableSlots,
|
|
431
|
+
setHoverKey: (key) => {
|
|
432
|
+
this.hoverKey = key;
|
|
433
|
+
},
|
|
434
|
+
handleCheckboxUpdateChecked,
|
|
435
|
+
handleRadioUpdateChecked,
|
|
436
|
+
handleUpdateExpanded,
|
|
437
|
+
handleRowDragStart: this.handleRowDragStart,
|
|
438
|
+
handleRowDragOver: this.handleRowDragOver,
|
|
439
|
+
handleRowDragLeave: this.handleRowDragLeave,
|
|
440
|
+
handleRowDragEnd: this.handleRowDragEnd,
|
|
441
|
+
handleRowDrop: this.handleRowDrop,
|
|
442
|
+
emitEdit: (value, row, key) => {
|
|
443
|
+
this.$emit('edit', value, row, key);
|
|
478
444
|
}
|
|
479
|
-
const isSummary = 'isSummaryRow' in rowInfo;
|
|
480
|
-
const striped = !isSummary && rowInfo.striped;
|
|
481
|
-
const { tmNode, key: rowKey } = rowInfo;
|
|
482
|
-
const { rawNode: rowData } = tmNode;
|
|
483
|
-
const expanded = mergedExpandedRowKeySet.has(rowKey);
|
|
484
|
-
const props = rowProps
|
|
485
|
-
? rowProps(rowData, actualRowIndex)
|
|
486
|
-
: undefined;
|
|
487
|
-
const mergedRowClassName = typeof rowClassName === 'string'
|
|
488
|
-
? rowClassName
|
|
489
|
-
: (0, utils_1.createRowClassName)(rowData, actualRowIndex, rowClassName);
|
|
490
|
-
const _a = props || {}, { class: _class } = _a, restProps = __rest(_a, ["class"]);
|
|
491
|
-
const row = ((0, vue_1.h)("tr", Object.assign({ onMouseenter: () => {
|
|
492
|
-
this.hoverKey = rowKey;
|
|
493
|
-
}, key: rowKey, class: [
|
|
494
|
-
`${mergedClsPrefix}-data-table-tr`,
|
|
495
|
-
rowInfo.tmNode.disabled
|
|
496
|
-
&& `${mergedClsPrefix}-data-table-tr--disabled`,
|
|
497
|
-
isSummary && `${mergedClsPrefix}-data-table-tr--summary`,
|
|
498
|
-
striped && `${mergedClsPrefix}-data-table-tr--striped`,
|
|
499
|
-
expanded && `${mergedClsPrefix}-data-table-tr--expanded`,
|
|
500
|
-
mergedRowClassName,
|
|
501
|
-
_class
|
|
502
|
-
] }, restProps), cols.map((col, colIndex) => {
|
|
503
|
-
var _a, _b, _c, _d, _e;
|
|
504
|
-
if (displayedRowIndex in cordToPass) {
|
|
505
|
-
const cordOfRowToPass = cordToPass[displayedRowIndex];
|
|
506
|
-
const indexInCordOfRowToPass = cordOfRowToPass.indexOf(colIndex);
|
|
507
|
-
if (~indexInCordOfRowToPass) {
|
|
508
|
-
cordOfRowToPass.splice(indexInCordOfRowToPass, 1);
|
|
509
|
-
return null;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
// TODO: Simplify row calculation
|
|
513
|
-
const { column } = col;
|
|
514
|
-
const colKey = (0, utils_1.getColKey)(col);
|
|
515
|
-
const { rowSpan, colSpan } = column;
|
|
516
|
-
const mergedColSpan = isSummary
|
|
517
|
-
? ((_a = rowInfo.tmNode.rawNode[colKey]) === null || _a === void 0 ? void 0 : _a.colSpan) || 1 // optional for #1276
|
|
518
|
-
: colSpan
|
|
519
|
-
? colSpan(rowData, actualRowIndex)
|
|
520
|
-
: 1;
|
|
521
|
-
const mergedRowSpan = isSummary
|
|
522
|
-
? ((_b = rowInfo.tmNode.rawNode[colKey]) === null || _b === void 0 ? void 0 : _b.rowSpan) || 1 // optional for #1276
|
|
523
|
-
: rowSpan
|
|
524
|
-
? rowSpan(rowData, actualRowIndex)
|
|
525
|
-
: 1;
|
|
526
|
-
const isLastCol = colIndex + mergedColSpan === colCount;
|
|
527
|
-
const isLastRow = displayedRowIndex + mergedRowSpan === rowCount;
|
|
528
|
-
const isCrossRowTd = mergedRowSpan > 1;
|
|
529
|
-
if (isCrossRowTd) {
|
|
530
|
-
cordKey[displayedRowIndex] = {
|
|
531
|
-
[colIndex]: []
|
|
532
|
-
};
|
|
533
|
-
}
|
|
534
|
-
if (mergedColSpan > 1 || isCrossRowTd) {
|
|
535
|
-
for (let i = displayedRowIndex; i < displayedRowIndex + mergedRowSpan; ++i) {
|
|
536
|
-
if (isCrossRowTd) {
|
|
537
|
-
cordKey[displayedRowIndex][colIndex].push(rowIndexToKey[i]);
|
|
538
|
-
}
|
|
539
|
-
for (let j = colIndex; j < colIndex + mergedColSpan; ++j) {
|
|
540
|
-
if (i === displayedRowIndex && j === colIndex) {
|
|
541
|
-
continue;
|
|
542
|
-
}
|
|
543
|
-
if (!(i in cordToPass)) {
|
|
544
|
-
cordToPass[i] = [j];
|
|
545
|
-
}
|
|
546
|
-
else {
|
|
547
|
-
cordToPass[i].push(j);
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
const hoverKey = isCrossRowTd ? this.hoverKey : null;
|
|
553
|
-
const { cellProps } = column;
|
|
554
|
-
const resolvedCellProps = cellProps === null || cellProps === void 0 ? void 0 : cellProps(rowData, actualRowIndex);
|
|
555
|
-
const indentOffsetStyle = {
|
|
556
|
-
'--indent-offset': ''
|
|
557
|
-
};
|
|
558
|
-
return ((0, vue_1.h)("td", Object.assign({}, resolvedCellProps, { key: colKey, style: [
|
|
559
|
-
{
|
|
560
|
-
textAlign: column.align || undefined,
|
|
561
|
-
left: (0, seemly_1.pxfy)((_c = fixedColumnLeftMap[colKey]) === null || _c === void 0 ? void 0 : _c.start),
|
|
562
|
-
right: (0, seemly_1.pxfy)((_d = fixedColumnRightMap[colKey]) === null || _d === void 0 ? void 0 : _d.start)
|
|
563
|
-
},
|
|
564
|
-
indentOffsetStyle,
|
|
565
|
-
(resolvedCellProps === null || resolvedCellProps === void 0 ? void 0 : resolvedCellProps.style) || ''
|
|
566
|
-
], colspan: mergedColSpan, rowspan: isVirtual ? undefined : mergedRowSpan, "data-col-key": colKey, class: [
|
|
567
|
-
`${mergedClsPrefix}-data-table-td`,
|
|
568
|
-
column.className,
|
|
569
|
-
resolvedCellProps === null || resolvedCellProps === void 0 ? void 0 : resolvedCellProps.class,
|
|
570
|
-
isSummary
|
|
571
|
-
&& `${mergedClsPrefix}-data-table-td--summary`,
|
|
572
|
-
((hoverKey !== null
|
|
573
|
-
&& cordKey[displayedRowIndex][colIndex].includes(hoverKey))
|
|
574
|
-
|| (0, utils_1.isColumnSorting)(column, mergedSortState))
|
|
575
|
-
&& `${mergedClsPrefix}-data-table-td--hover`,
|
|
576
|
-
column.fixed
|
|
577
|
-
&& `${mergedClsPrefix}-data-table-td--fixed-${column.fixed}`,
|
|
578
|
-
column.align
|
|
579
|
-
&& `${mergedClsPrefix}-data-table-td--${column.align}-align`,
|
|
580
|
-
column.type === 'selection'
|
|
581
|
-
&& `${mergedClsPrefix}-data-table-td--selection`,
|
|
582
|
-
column.type === 'expand'
|
|
583
|
-
&& `${mergedClsPrefix}-data-table-td--expand`,
|
|
584
|
-
isLastCol
|
|
585
|
-
&& `${mergedClsPrefix}-data-table-td--last-col`,
|
|
586
|
-
isLastRow
|
|
587
|
-
&& `${mergedClsPrefix}-data-table-td--last-row`,
|
|
588
|
-
'editable' in column
|
|
589
|
-
&& (typeof column.editable === 'function'
|
|
590
|
-
? column.editable(rowData)
|
|
591
|
-
: column.editable)
|
|
592
|
-
&& !isSummary
|
|
593
|
-
&& `${mergedClsPrefix}-data-table-td--editable`
|
|
594
|
-
] }),
|
|
595
|
-
column.fixed && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-td__shadow-holder` })),
|
|
596
|
-
hasChildren && colIndex === childTriggerColIndex
|
|
597
|
-
? [
|
|
598
|
-
(0, seemly_1.repeat)((indentOffsetStyle['--indent-offset']
|
|
599
|
-
= isSummary ? 0 : rowInfo.tmNode.level), (0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-indent`, style: indentStyle })),
|
|
600
|
-
isSummary || rowInfo.tmNode.isLeaf ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-expand-placeholder` })) : ((0, vue_1.h)(ExpandTrigger_1.default, { class: `${mergedClsPrefix}-data-table-expand-trigger`, clsPrefix: mergedClsPrefix, expanded: expanded, renderExpandIcon: this.renderExpandIcon, loading: loadingKeySet.has(rowInfo.key), onClick: () => {
|
|
601
|
-
handleUpdateExpanded(rowKey, rowInfo.tmNode);
|
|
602
|
-
} }))
|
|
603
|
-
]
|
|
604
|
-
: null,
|
|
605
|
-
column.type === 'selection' ? (!isSummary ? (column.multiple === false ? ((0, vue_1.h)(BodyRadio_1.default, { key: currentPage, rowKey: rowKey, disabled: rowInfo.tmNode.disabled, onClick: (event) => {
|
|
606
|
-
event.stopPropagation();
|
|
607
|
-
}, onUpdateChecked: () => {
|
|
608
|
-
handleRadioUpdateChecked(rowInfo.tmNode);
|
|
609
|
-
} })) : ((0, vue_1.h)(BodyCheckbox_1.default, { key: currentPage, rowKey: rowKey, disabled: rowInfo.tmNode.disabled, onUpdateChecked: (checked, event) => {
|
|
610
|
-
event.stopPropagation();
|
|
611
|
-
handleCheckboxUpdateChecked(rowInfo.tmNode, checked, event.shiftKey);
|
|
612
|
-
} }))) : null) : column.type === 'expand' ? (!isSummary ? (!column.expandable
|
|
613
|
-
|| ((_e = column.expandable) === null || _e === void 0 ? void 0 : _e.call(column, rowData)) ? ((0, vue_1.h)(ExpandTrigger_1.default, { clsPrefix: mergedClsPrefix, expanded: expanded, renderExpandIcon: this.renderExpandIcon, onClick: () => {
|
|
614
|
-
handleUpdateExpanded(rowKey, null);
|
|
615
|
-
} })) : null) : null) : ((0, vue_1.h)(Cell_1.default, { clsPrefix: mergedClsPrefix, index: actualRowIndex, row: rowData, column: column, isSummary: isSummary, mergedTheme: mergedTheme, renderCell: this.renderCell, defaultEmptyValue: this.defaultEmptyValueRef, onEdit: (value, row, key) => {
|
|
616
|
-
this.$emit('edit', value, row, key);
|
|
617
|
-
} }))));
|
|
618
|
-
})));
|
|
619
|
-
return row;
|
|
620
445
|
};
|
|
446
|
+
const renderRow = (rowInfo, displayedRowIndex, isVirtual) => (0, BodyRow_1.renderBodyRow)(renderContext, rowInfo, displayedRowIndex, isVirtual);
|
|
621
447
|
if (!virtualScroll) {
|
|
622
448
|
return ((0, vue_1.h)("table", { class: `${mergedClsPrefix}-data-table-table`, onMouseleave: handleMouseleaveTable, style: {
|
|
623
449
|
width: fixedResizableTableWidth,
|
|
@@ -639,7 +465,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
639
465
|
this.showHeader ? (0, vue_1.h)(Header_1.default, { discrete: false }) : null,
|
|
640
466
|
(0, vue_1.h)(BodySkeleton_1.default, null)));
|
|
641
467
|
}
|
|
642
|
-
return ((0, vue_1.h)(vueuc_1.VirtualList, { ref: "virtualListRef", items: displayedData, itemSize: 28, visibleItemsTag:
|
|
468
|
+
return ((0, vue_1.h)(vueuc_1.VirtualList, { ref: "virtualListRef", items: displayedData, itemSize: 28, visibleItemsTag: VirtualListItemWrapper_1.default, visibleItemsProps: {
|
|
643
469
|
clsPrefix: mergedClsPrefix,
|
|
644
470
|
id: componentId,
|
|
645
471
|
cols,
|
|
@@ -652,12 +478,14 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
652
478
|
}
|
|
653
479
|
}));
|
|
654
480
|
if (this.empty && !this.loadingSkeleton) {
|
|
655
|
-
const createEmptyNode = () => (
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
481
|
+
const createEmptyNode = () => (0, BodyEmpty_1.renderBodyEmpty)({
|
|
482
|
+
clsPrefix: mergedClsPrefix,
|
|
483
|
+
loading: this.loading,
|
|
484
|
+
bodyStyle: this.bodyStyle,
|
|
485
|
+
dataTableSlots: this.dataTableSlots,
|
|
486
|
+
mergedTheme: this.mergedTheme,
|
|
487
|
+
emptyProps: emptyPropsRef
|
|
488
|
+
});
|
|
661
489
|
if (this.shouldDisplaySomeTablePart) {
|
|
662
490
|
return ((0, vue_1.h)(vue_1.Fragment, null,
|
|
663
491
|
tableNode,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderBodyEmpty = renderBodyEmpty;
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
const _utils_1 = require("../../../_utils");
|
|
6
|
+
const empty_1 = require("../../../empty");
|
|
7
|
+
function renderBodyEmpty(deps) {
|
|
8
|
+
const { clsPrefix, loading, bodyStyle, dataTableSlots, mergedTheme, emptyProps } = deps;
|
|
9
|
+
return ((0, vue_1.h)("div", { class: [
|
|
10
|
+
`${clsPrefix}-data-table-empty`,
|
|
11
|
+
loading && `${clsPrefix}-data-table-empty--hide`
|
|
12
|
+
], style: bodyStyle, ref: "emptyElRef" }, (0, _utils_1.resolveSlot)(dataTableSlots.empty, () => [
|
|
13
|
+
(0, vue_1.h)(empty_1.UEmpty, Object.assign({ size: "large", theme: mergedTheme.peers.Empty, themeOverrides: mergedTheme.peerOverrides.Empty }, emptyProps))
|
|
14
|
+
])));
|
|
15
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.renderBodyRow = renderBodyRow;
|
|
18
|
+
const seemly_1 = require("seemly");
|
|
19
|
+
const vue_1 = require("vue");
|
|
20
|
+
const icons_1 = require("../../../_internal/icons");
|
|
21
|
+
const _utils_1 = require("../../../_utils");
|
|
22
|
+
const utils_1 = require("../utils");
|
|
23
|
+
const BodyCheckbox_1 = __importDefault(require("./BodyCheckbox"));
|
|
24
|
+
const BodyRadio_1 = __importDefault(require("./BodyRadio"));
|
|
25
|
+
const Cell_1 = __importDefault(require("./Cell"));
|
|
26
|
+
const ExpandTrigger_1 = __importDefault(require("./ExpandTrigger"));
|
|
27
|
+
function renderExpandedRow(context, rowInfo, displayedRowIndex) {
|
|
28
|
+
const { mergedClsPrefix, colCount, rowCount, stickyExpandedRows, bodyWidthPx, renderExpand } = context;
|
|
29
|
+
const { index: actualRowIndex } = rowInfo;
|
|
30
|
+
const { tmNode: { key, rawNode } } = rowInfo;
|
|
31
|
+
return ((0, vue_1.h)("tr", { class: `${mergedClsPrefix}-data-table-tr ${mergedClsPrefix}-data-table-tr--expanded`, key: `${key}__expand` },
|
|
32
|
+
(0, vue_1.h)("td", { class: [
|
|
33
|
+
`${mergedClsPrefix}-data-table-td`,
|
|
34
|
+
`${mergedClsPrefix}-data-table-td--last-col`,
|
|
35
|
+
displayedRowIndex + 1 === rowCount
|
|
36
|
+
&& `${mergedClsPrefix}-data-table-td--last-row`
|
|
37
|
+
], colspan: colCount }, stickyExpandedRows ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-expand`, style: {
|
|
38
|
+
width: bodyWidthPx
|
|
39
|
+
} }, renderExpand(rawNode, actualRowIndex))) : (renderExpand(rawNode, actualRowIndex)))));
|
|
40
|
+
}
|
|
41
|
+
function renderBodyRow(context, rowInfo, displayedRowIndex, isVirtual) {
|
|
42
|
+
if ('isExpandedRow' in rowInfo) {
|
|
43
|
+
return renderExpandedRow(context, rowInfo, displayedRowIndex);
|
|
44
|
+
}
|
|
45
|
+
const { mergedClsPrefix, cols, colCount, rowCount, hasChildren, childTriggerColIndex, indentStyle, rowClassName, rowProps, mergedSortState, mergedExpandedRowKeySet, fixedColumnLeftMap, fixedColumnRightMap, currentPage, loadingKeySet, renderExpandIcon, renderCell, defaultEmptyValue, mergedTheme, rowIndexToKey, cordToPass, cordKey, draggableColumn, droppingRowKey, droppingPosition, draggingRowKeySet, hoverKey, dataTableSlots, setHoverKey, handleCheckboxUpdateChecked, handleRadioUpdateChecked, handleUpdateExpanded, handleRowDragStart, handleRowDragOver, handleRowDragLeave, handleRowDragEnd, handleRowDrop, emitEdit } = context;
|
|
46
|
+
const { index: actualRowIndex } = rowInfo;
|
|
47
|
+
const isSummary = 'isSummaryRow' in rowInfo;
|
|
48
|
+
const striped = !isSummary && rowInfo.striped;
|
|
49
|
+
const { tmNode, key: rowKey } = rowInfo;
|
|
50
|
+
const { rawNode: rowData } = tmNode;
|
|
51
|
+
const expanded = mergedExpandedRowKeySet.has(rowKey);
|
|
52
|
+
const props = rowProps ? rowProps(rowData, actualRowIndex) : undefined;
|
|
53
|
+
const mergedRowClassName = typeof rowClassName === 'string'
|
|
54
|
+
? rowClassName
|
|
55
|
+
: (0, utils_1.createRowClassName)(rowData, actualRowIndex, rowClassName);
|
|
56
|
+
const _a = props || {}, { class: _class } = _a, restProps = __rest(_a, ["class"]);
|
|
57
|
+
const isRowDraggable = !isSummary
|
|
58
|
+
&& !!draggableColumn
|
|
59
|
+
&& (typeof draggableColumn.draggable === 'function'
|
|
60
|
+
? draggableColumn.draggable(rowData)
|
|
61
|
+
: true);
|
|
62
|
+
const isDropTarget = !!draggableColumn && droppingRowKey === rowKey;
|
|
63
|
+
const dropPosition = isDropTarget ? droppingPosition : null;
|
|
64
|
+
const isBeingDragged = !!draggableColumn && draggingRowKeySet.has(rowKey);
|
|
65
|
+
const row = ((0, vue_1.h)("tr", Object.assign({ onMouseenter: () => {
|
|
66
|
+
setHoverKey(rowKey);
|
|
67
|
+
}, key: rowKey, "data-row-key": String(rowKey), onDragover: draggableColumn && !isSummary
|
|
68
|
+
? (event) => handleRowDragOver(event, rowKey)
|
|
69
|
+
: undefined, onDragleave: draggableColumn && !isSummary
|
|
70
|
+
? (event) => handleRowDragLeave(event, rowKey)
|
|
71
|
+
: undefined, onDrop: draggableColumn && !isSummary
|
|
72
|
+
? (event) => handleRowDrop(event, rowKey)
|
|
73
|
+
: undefined, class: [
|
|
74
|
+
`${mergedClsPrefix}-data-table-tr`,
|
|
75
|
+
rowInfo.tmNode.disabled && `${mergedClsPrefix}-data-table-tr--disabled`,
|
|
76
|
+
isSummary && `${mergedClsPrefix}-data-table-tr--summary`,
|
|
77
|
+
striped && `${mergedClsPrefix}-data-table-tr--striped`,
|
|
78
|
+
expanded && `${mergedClsPrefix}-data-table-tr--expanded`,
|
|
79
|
+
isBeingDragged && `${mergedClsPrefix}-data-table-tr--dragging`,
|
|
80
|
+
isDropTarget
|
|
81
|
+
&& dropPosition === 'before'
|
|
82
|
+
&& `${mergedClsPrefix}-data-table-tr--drop-before`,
|
|
83
|
+
isDropTarget
|
|
84
|
+
&& dropPosition === 'after'
|
|
85
|
+
&& `${mergedClsPrefix}-data-table-tr--drop-after`,
|
|
86
|
+
mergedRowClassName,
|
|
87
|
+
_class
|
|
88
|
+
] }, restProps), cols.map((col, colIndex) => {
|
|
89
|
+
var _a, _b, _c, _d, _e;
|
|
90
|
+
if (displayedRowIndex in cordToPass) {
|
|
91
|
+
const cordOfRowToPass = cordToPass[displayedRowIndex];
|
|
92
|
+
const indexInCordOfRowToPass = cordOfRowToPass.indexOf(colIndex);
|
|
93
|
+
if (~indexInCordOfRowToPass) {
|
|
94
|
+
cordOfRowToPass.splice(indexInCordOfRowToPass, 1);
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// TODO: Simplify row calculation
|
|
99
|
+
const { column } = col;
|
|
100
|
+
const colKey = (0, utils_1.getColKey)(col);
|
|
101
|
+
const { rowSpan, colSpan } = column;
|
|
102
|
+
const mergedColSpan = isSummary
|
|
103
|
+
? ((_a = rowInfo.tmNode.rawNode[colKey]) === null || _a === void 0 ? void 0 : _a.colSpan) || 1 // optional for #1276
|
|
104
|
+
: colSpan
|
|
105
|
+
? colSpan(rowData, actualRowIndex)
|
|
106
|
+
: 1;
|
|
107
|
+
const mergedRowSpan = isSummary
|
|
108
|
+
? ((_b = rowInfo.tmNode.rawNode[colKey]) === null || _b === void 0 ? void 0 : _b.rowSpan) || 1 // optional for #1276
|
|
109
|
+
: rowSpan
|
|
110
|
+
? rowSpan(rowData, actualRowIndex)
|
|
111
|
+
: 1;
|
|
112
|
+
const isLastCol = colIndex + mergedColSpan === colCount;
|
|
113
|
+
const isLastRow = displayedRowIndex + mergedRowSpan === rowCount;
|
|
114
|
+
const isCrossRowTd = mergedRowSpan > 1;
|
|
115
|
+
if (isCrossRowTd) {
|
|
116
|
+
cordKey[displayedRowIndex] = {
|
|
117
|
+
[colIndex]: []
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if (mergedColSpan > 1 || isCrossRowTd) {
|
|
121
|
+
for (let i = displayedRowIndex; i < displayedRowIndex + mergedRowSpan; ++i) {
|
|
122
|
+
if (isCrossRowTd) {
|
|
123
|
+
cordKey[displayedRowIndex][colIndex].push(rowIndexToKey[i]);
|
|
124
|
+
}
|
|
125
|
+
for (let j = colIndex; j < colIndex + mergedColSpan; ++j) {
|
|
126
|
+
if (i === displayedRowIndex && j === colIndex) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (!(i in cordToPass)) {
|
|
130
|
+
cordToPass[i] = [j];
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
cordToPass[i].push(j);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const cellHoverKey = isCrossRowTd ? hoverKey : null;
|
|
139
|
+
const { cellProps } = column;
|
|
140
|
+
const resolvedCellProps = cellProps === null || cellProps === void 0 ? void 0 : cellProps(rowData, actualRowIndex);
|
|
141
|
+
const indentOffsetStyle = {
|
|
142
|
+
'--indent-offset': ''
|
|
143
|
+
};
|
|
144
|
+
const isDraggableHandleCell = column.type === 'draggable' && !isSummary && isRowDraggable;
|
|
145
|
+
return ((0, vue_1.h)("td", Object.assign({}, resolvedCellProps, { key: colKey, draggable: isDraggableHandleCell || undefined, onDragstart: isDraggableHandleCell
|
|
146
|
+
? (event) => handleRowDragStart(event, rowKey)
|
|
147
|
+
: undefined, onDragend: isDraggableHandleCell ? () => handleRowDragEnd() : undefined, style: [
|
|
148
|
+
{
|
|
149
|
+
textAlign: column.align || undefined,
|
|
150
|
+
left: (0, seemly_1.pxfy)((_c = fixedColumnLeftMap[colKey]) === null || _c === void 0 ? void 0 : _c.start),
|
|
151
|
+
right: (0, seemly_1.pxfy)((_d = fixedColumnRightMap[colKey]) === null || _d === void 0 ? void 0 : _d.start)
|
|
152
|
+
},
|
|
153
|
+
indentOffsetStyle,
|
|
154
|
+
(resolvedCellProps === null || resolvedCellProps === void 0 ? void 0 : resolvedCellProps.style) || ''
|
|
155
|
+
], colspan: mergedColSpan, rowspan: isVirtual ? undefined : mergedRowSpan, "data-col-key": colKey, class: [
|
|
156
|
+
`${mergedClsPrefix}-data-table-td`,
|
|
157
|
+
column.className,
|
|
158
|
+
resolvedCellProps === null || resolvedCellProps === void 0 ? void 0 : resolvedCellProps.class,
|
|
159
|
+
isSummary && `${mergedClsPrefix}-data-table-td--summary`,
|
|
160
|
+
((cellHoverKey !== null
|
|
161
|
+
&& cordKey[displayedRowIndex][colIndex].includes(cellHoverKey))
|
|
162
|
+
|| (0, utils_1.isColumnSorting)(column, mergedSortState))
|
|
163
|
+
&& `${mergedClsPrefix}-data-table-td--hover`,
|
|
164
|
+
column.fixed
|
|
165
|
+
&& `${mergedClsPrefix}-data-table-td--fixed-${column.fixed}`,
|
|
166
|
+
column.align
|
|
167
|
+
&& `${mergedClsPrefix}-data-table-td--${column.align}-align`,
|
|
168
|
+
column.type === 'selection'
|
|
169
|
+
&& `${mergedClsPrefix}-data-table-td--selection`,
|
|
170
|
+
column.type === 'expand'
|
|
171
|
+
&& `${mergedClsPrefix}-data-table-td--expand`,
|
|
172
|
+
column.type === 'draggable'
|
|
173
|
+
&& `${mergedClsPrefix}-data-table-td--draggable`,
|
|
174
|
+
isLastCol && `${mergedClsPrefix}-data-table-td--last-col`,
|
|
175
|
+
isLastRow && `${mergedClsPrefix}-data-table-td--last-row`,
|
|
176
|
+
'editable' in column
|
|
177
|
+
&& (typeof column.editable === 'function'
|
|
178
|
+
? column.editable(rowData)
|
|
179
|
+
: column.editable)
|
|
180
|
+
&& !isSummary
|
|
181
|
+
&& `${mergedClsPrefix}-data-table-td--editable`
|
|
182
|
+
] }),
|
|
183
|
+
column.fixed && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-td__shadow-holder` })),
|
|
184
|
+
hasChildren && colIndex === childTriggerColIndex
|
|
185
|
+
? [
|
|
186
|
+
(0, seemly_1.repeat)((indentOffsetStyle['--indent-offset'] = isSummary
|
|
187
|
+
? 0
|
|
188
|
+
: rowInfo.tmNode.level), (0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-indent`, style: indentStyle })),
|
|
189
|
+
isSummary || rowInfo.tmNode.isLeaf ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-expand-placeholder` })) : ((0, vue_1.h)(ExpandTrigger_1.default, { class: `${mergedClsPrefix}-data-table-expand-trigger`, clsPrefix: mergedClsPrefix, expanded: expanded, renderExpandIcon: renderExpandIcon, loading: loadingKeySet.has(rowInfo.key), onClick: () => {
|
|
190
|
+
handleUpdateExpanded(rowKey, rowInfo.tmNode);
|
|
191
|
+
} }))
|
|
192
|
+
]
|
|
193
|
+
: null,
|
|
194
|
+
column.type === 'selection' ? (!isSummary ? (column.multiple === false ? ((0, vue_1.h)(BodyRadio_1.default, { key: currentPage, rowKey: rowKey, disabled: rowInfo.tmNode.disabled, onClick: (event) => {
|
|
195
|
+
event.stopPropagation();
|
|
196
|
+
}, onUpdateChecked: () => {
|
|
197
|
+
handleRadioUpdateChecked(rowInfo.tmNode);
|
|
198
|
+
} })) : ((0, vue_1.h)(BodyCheckbox_1.default, { key: currentPage, rowKey: rowKey, disabled: rowInfo.tmNode.disabled, onUpdateChecked: (checked, event) => {
|
|
199
|
+
event.stopPropagation();
|
|
200
|
+
handleCheckboxUpdateChecked(rowInfo.tmNode, checked, event.shiftKey);
|
|
201
|
+
} }))) : null) : column.type === 'expand' ? (!isSummary ? (!column.expandable || ((_e = column.expandable) === null || _e === void 0 ? void 0 : _e.call(column, rowData)) ? ((0, vue_1.h)(ExpandTrigger_1.default, { clsPrefix: mergedClsPrefix, expanded: expanded, renderExpandIcon: renderExpandIcon, onClick: () => {
|
|
202
|
+
handleUpdateExpanded(rowKey, null);
|
|
203
|
+
} })) : null) : null) : column.type === 'draggable' ? (isDraggableHandleCell ? ((0, vue_1.h)("span", { class: `${mergedClsPrefix}-data-table-td__drag-handle`, "aria-label": "Drag to reorder" }, (0, _utils_1.resolveSlot)(dataTableSlots['drag-handle'], () => [
|
|
204
|
+
(0, vue_1.h)(icons_1.DragHandleRound, null)
|
|
205
|
+
]))) : null) : ((0, vue_1.h)(Cell_1.default, { clsPrefix: mergedClsPrefix, index: actualRowIndex, row: rowData, column: column, isSummary: isSummary, mergedTheme: mergedTheme, renderCell: renderCell, defaultEmptyValue: defaultEmptyValue, onEdit: (value, row, key) => {
|
|
206
|
+
emitEdit(value, row, key);
|
|
207
|
+
} }))));
|
|
208
|
+
})));
|
|
209
|
+
return row;
|
|
210
|
+
}
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const vue_1 = require("vue");
|
|
4
4
|
const skeleton_1 = require("../../../skeleton");
|
|
5
5
|
const interface_1 = require("../interface");
|
|
6
|
+
const ICON_COLUMN_SKELETON_WIDTH = '16px';
|
|
7
|
+
const DEFAULT_COLUMN_SKELETON_WIDTH = '85%';
|
|
8
|
+
const SKELETON_BORDER_RADIUS = '16px';
|
|
6
9
|
exports.default = (0, vue_1.defineComponent)({
|
|
7
10
|
name: 'DataTableBodySkeleton',
|
|
8
11
|
props: {
|
|
@@ -41,8 +44,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
41
44
|
padding: 'var(--u-td-padding)'
|
|
42
45
|
} },
|
|
43
46
|
col.column.fixed && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-td__shadow-holder` })),
|
|
44
|
-
(0, vue_1.h)(skeleton_1.USkeleton, { height: "var(--u-line-height)", width: col.column.type === 'selection'
|
|
45
|
-
|
|
47
|
+
(0, vue_1.h)(skeleton_1.USkeleton, { height: "var(--u-line-height)", width: col.column.type === 'selection'
|
|
48
|
+
|| col.column.type === 'draggable'
|
|
49
|
+
? ICON_COLUMN_SKELETON_WIDTH
|
|
50
|
+
: DEFAULT_COLUMN_SKELETON_WIDTH, animated: true, style: {
|
|
51
|
+
borderRadius: SKELETON_BORDER_RADIUS
|
|
46
52
|
} })))))));
|
|
47
53
|
return ((0, vue_1.h)("tbody", { class: [
|
|
48
54
|
`${mergedClsPrefix}-data-table-tbody`,
|
|
@@ -73,6 +73,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
73
73
|
thButtonColorHover: string;
|
|
74
74
|
thIconColor: string;
|
|
75
75
|
thIconColorActive: string;
|
|
76
|
+
dropMarkColor: string;
|
|
77
|
+
dragGhostOpacity: string;
|
|
78
|
+
dragGhostFilter: string;
|
|
76
79
|
borderColorModal: string;
|
|
77
80
|
tdColorHoverModal: string;
|
|
78
81
|
tdColorStripedModal: string;
|
|
@@ -1467,6 +1470,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1467
1470
|
thButtonColorHover: string;
|
|
1468
1471
|
thIconColor: string;
|
|
1469
1472
|
thIconColorActive: string;
|
|
1473
|
+
dropMarkColor: string;
|
|
1474
|
+
dragGhostOpacity: string;
|
|
1475
|
+
dragGhostFilter: string;
|
|
1470
1476
|
borderColorModal: string;
|
|
1471
1477
|
tdColorHoverModal: string;
|
|
1472
1478
|
tdColorStripedModal: string;
|