1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
require('../components/index.js');
var utils = require('../utils.js');
var row = require('../components/row.js');
function _isSlot(s) {
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
}
const RowRenderer = (props, {
slots
}) => {
const {
columns,
columnsStyles,
depthMap,
expandColumnKey,
expandedRowKeys,
estimatedRowHeight,
hasFixedColumns,
rowData,
rowIndex,
style,
isScrolling,
rowProps,
rowClass,
rowKey,
rowEventHandlers,
ns,
onRowHovered,
onRowExpanded
} = props;
const rowKls = utils.tryCall(rowClass, {
columns,
rowData,
rowIndex
}, "");
const additionalProps = utils.tryCall(rowProps, {
columns,
rowData,
rowIndex
});
const _rowKey = rowData[rowKey];
const depth = depthMap[_rowKey] || 0;
const canExpand = Boolean(expandColumnKey);
const isFixedRow = rowIndex < 0;
const kls = [ns.e("row"), rowKls, {
[ns.e(`row-depth-${depth}`)]: canExpand && rowIndex >= 0,
[ns.is("expanded")]: canExpand && expandedRowKeys.includes(_rowKey),
[ns.is("fixed")]: !depth && isFixedRow,
[ns.is("customized")]: Boolean(slots.row)
}];
const onRowHover = hasFixedColumns ? onRowHovered : void 0;
const _rowProps = {
...additionalProps,
columns,
columnsStyles,
class: kls,
depth,
expandColumnKey,
estimatedRowHeight: isFixedRow ? void 0 : estimatedRowHeight,
isScrolling,
rowIndex,
rowData,
rowKey: _rowKey,
rowEventHandlers,
style
};
const handlerMosueEnter = (e) => {
onRowHover == null ? void 0 : onRowHover({
hovered: true,
rowKey: _rowKey,
event: e,
rowData,
rowIndex
});
};
const handlerMouseLeave = (e) => {
onRowHover == null ? void 0 : onRowHover({
hovered: false,
rowKey: _rowKey,
event: e,
rowData,
rowIndex
});
};
return vue.createVNode(row["default"], vue.mergeProps(_rowProps, {
"onRowExpand": onRowExpanded,
"onMouseenter": handlerMosueEnter,
"onMouseleave": handlerMouseLeave,
"rowkey": _rowKey
}), _isSlot(slots) ? slots : {
default: () => [slots]
});
};
exports["default"] = RowRenderer;
//# sourceMappingURL=row.js.map