@uzum-tech/ui 2.0.4 → 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 +9 -8
- package/web-types.json +1 -1
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
4
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
import { pxfy, repeat } from 'seemly';
|
|
10
|
+
import { h } from 'vue';
|
|
11
|
+
import { DragHandleRound } from "../../../_internal/icons/index.mjs";
|
|
12
|
+
import { resolveSlot } from "../../../_utils/index.mjs";
|
|
13
|
+
import { createRowClassName, getColKey, isColumnSorting } from "../utils/index.mjs";
|
|
14
|
+
import RenderSafeCheckbox from "./BodyCheckbox.mjs";
|
|
15
|
+
import RenderSafeRadio from "./BodyRadio.mjs";
|
|
16
|
+
import Cell from "./Cell.mjs";
|
|
17
|
+
import ExpandTrigger from "./ExpandTrigger.mjs";
|
|
18
|
+
function renderExpandedRow(context, rowInfo, displayedRowIndex) {
|
|
19
|
+
const {
|
|
20
|
+
mergedClsPrefix,
|
|
21
|
+
colCount,
|
|
22
|
+
rowCount,
|
|
23
|
+
stickyExpandedRows,
|
|
24
|
+
bodyWidthPx,
|
|
25
|
+
renderExpand
|
|
26
|
+
} = context;
|
|
27
|
+
const {
|
|
28
|
+
index: actualRowIndex
|
|
29
|
+
} = rowInfo;
|
|
30
|
+
const {
|
|
31
|
+
tmNode: {
|
|
32
|
+
key,
|
|
33
|
+
rawNode
|
|
34
|
+
}
|
|
35
|
+
} = rowInfo;
|
|
36
|
+
return h("tr", {
|
|
37
|
+
class: `${mergedClsPrefix}-data-table-tr ${mergedClsPrefix}-data-table-tr--expanded`,
|
|
38
|
+
key: `${key}__expand`
|
|
39
|
+
}, h("td", {
|
|
40
|
+
class: [`${mergedClsPrefix}-data-table-td`, `${mergedClsPrefix}-data-table-td--last-col`, displayedRowIndex + 1 === rowCount && `${mergedClsPrefix}-data-table-td--last-row`],
|
|
41
|
+
colspan: colCount
|
|
42
|
+
}, stickyExpandedRows ? h("div", {
|
|
43
|
+
class: `${mergedClsPrefix}-data-table-expand`,
|
|
44
|
+
style: {
|
|
45
|
+
width: bodyWidthPx
|
|
46
|
+
}
|
|
47
|
+
}, renderExpand(rawNode, actualRowIndex)) : renderExpand(rawNode, actualRowIndex)));
|
|
48
|
+
}
|
|
49
|
+
export function renderBodyRow(context, rowInfo, displayedRowIndex, isVirtual) {
|
|
50
|
+
if ('isExpandedRow' in rowInfo) {
|
|
51
|
+
return renderExpandedRow(context, rowInfo, displayedRowIndex);
|
|
52
|
+
}
|
|
53
|
+
const {
|
|
54
|
+
mergedClsPrefix,
|
|
55
|
+
cols,
|
|
56
|
+
colCount,
|
|
57
|
+
rowCount,
|
|
58
|
+
hasChildren,
|
|
59
|
+
childTriggerColIndex,
|
|
60
|
+
indentStyle,
|
|
61
|
+
rowClassName,
|
|
62
|
+
rowProps,
|
|
63
|
+
mergedSortState,
|
|
64
|
+
mergedExpandedRowKeySet,
|
|
65
|
+
fixedColumnLeftMap,
|
|
66
|
+
fixedColumnRightMap,
|
|
67
|
+
currentPage,
|
|
68
|
+
loadingKeySet,
|
|
69
|
+
renderExpandIcon,
|
|
70
|
+
renderCell,
|
|
71
|
+
defaultEmptyValue,
|
|
72
|
+
mergedTheme,
|
|
73
|
+
rowIndexToKey,
|
|
74
|
+
cordToPass,
|
|
75
|
+
cordKey,
|
|
76
|
+
draggableColumn,
|
|
77
|
+
droppingRowKey,
|
|
78
|
+
droppingPosition,
|
|
79
|
+
draggingRowKeySet,
|
|
80
|
+
hoverKey,
|
|
81
|
+
dataTableSlots,
|
|
82
|
+
setHoverKey,
|
|
83
|
+
handleCheckboxUpdateChecked,
|
|
84
|
+
handleRadioUpdateChecked,
|
|
85
|
+
handleUpdateExpanded,
|
|
86
|
+
handleRowDragStart,
|
|
87
|
+
handleRowDragOver,
|
|
88
|
+
handleRowDragLeave,
|
|
89
|
+
handleRowDragEnd,
|
|
90
|
+
handleRowDrop,
|
|
91
|
+
emitEdit
|
|
92
|
+
} = context;
|
|
93
|
+
const {
|
|
94
|
+
index: actualRowIndex
|
|
95
|
+
} = rowInfo;
|
|
96
|
+
const isSummary = 'isSummaryRow' in rowInfo;
|
|
97
|
+
const striped = !isSummary && rowInfo.striped;
|
|
98
|
+
const {
|
|
99
|
+
tmNode,
|
|
100
|
+
key: rowKey
|
|
101
|
+
} = rowInfo;
|
|
102
|
+
const {
|
|
103
|
+
rawNode: rowData
|
|
104
|
+
} = tmNode;
|
|
105
|
+
const expanded = mergedExpandedRowKeySet.has(rowKey);
|
|
106
|
+
const props = rowProps ? rowProps(rowData, actualRowIndex) : undefined;
|
|
107
|
+
const mergedRowClassName = typeof rowClassName === 'string' ? rowClassName : createRowClassName(rowData, actualRowIndex, rowClassName);
|
|
108
|
+
const _a = props || {},
|
|
109
|
+
{
|
|
110
|
+
class: _class
|
|
111
|
+
} = _a,
|
|
112
|
+
restProps = __rest(_a, ["class"]);
|
|
113
|
+
const isRowDraggable = !isSummary && !!draggableColumn && (typeof draggableColumn.draggable === 'function' ? draggableColumn.draggable(rowData) : true);
|
|
114
|
+
const isDropTarget = !!draggableColumn && droppingRowKey === rowKey;
|
|
115
|
+
const dropPosition = isDropTarget ? droppingPosition : null;
|
|
116
|
+
const isBeingDragged = !!draggableColumn && draggingRowKeySet.has(rowKey);
|
|
117
|
+
const row = h("tr", Object.assign({
|
|
118
|
+
onMouseenter: () => {
|
|
119
|
+
setHoverKey(rowKey);
|
|
120
|
+
},
|
|
121
|
+
key: rowKey,
|
|
122
|
+
"data-row-key": String(rowKey),
|
|
123
|
+
onDragover: draggableColumn && !isSummary ? event => handleRowDragOver(event, rowKey) : undefined,
|
|
124
|
+
onDragleave: draggableColumn && !isSummary ? event => handleRowDragLeave(event, rowKey) : undefined,
|
|
125
|
+
onDrop: draggableColumn && !isSummary ? event => handleRowDrop(event, rowKey) : undefined,
|
|
126
|
+
class: [`${mergedClsPrefix}-data-table-tr`, rowInfo.tmNode.disabled && `${mergedClsPrefix}-data-table-tr--disabled`, isSummary && `${mergedClsPrefix}-data-table-tr--summary`, striped && `${mergedClsPrefix}-data-table-tr--striped`, expanded && `${mergedClsPrefix}-data-table-tr--expanded`, isBeingDragged && `${mergedClsPrefix}-data-table-tr--dragging`, isDropTarget && dropPosition === 'before' && `${mergedClsPrefix}-data-table-tr--drop-before`, isDropTarget && dropPosition === 'after' && `${mergedClsPrefix}-data-table-tr--drop-after`, mergedRowClassName, _class]
|
|
127
|
+
}, restProps), cols.map((col, colIndex) => {
|
|
128
|
+
var _a, _b, _c, _d, _e;
|
|
129
|
+
if (displayedRowIndex in cordToPass) {
|
|
130
|
+
const cordOfRowToPass = cordToPass[displayedRowIndex];
|
|
131
|
+
const indexInCordOfRowToPass = cordOfRowToPass.indexOf(colIndex);
|
|
132
|
+
if (~indexInCordOfRowToPass) {
|
|
133
|
+
cordOfRowToPass.splice(indexInCordOfRowToPass, 1);
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// TODO: Simplify row calculation
|
|
138
|
+
const {
|
|
139
|
+
column
|
|
140
|
+
} = col;
|
|
141
|
+
const colKey = getColKey(col);
|
|
142
|
+
const {
|
|
143
|
+
rowSpan,
|
|
144
|
+
colSpan
|
|
145
|
+
} = column;
|
|
146
|
+
const mergedColSpan = isSummary ? ((_a = rowInfo.tmNode.rawNode[colKey]) === null || _a === void 0 ? void 0 : _a.colSpan) || 1 // optional for #1276
|
|
147
|
+
: colSpan ? colSpan(rowData, actualRowIndex) : 1;
|
|
148
|
+
const mergedRowSpan = isSummary ? ((_b = rowInfo.tmNode.rawNode[colKey]) === null || _b === void 0 ? void 0 : _b.rowSpan) || 1 // optional for #1276
|
|
149
|
+
: rowSpan ? rowSpan(rowData, actualRowIndex) : 1;
|
|
150
|
+
const isLastCol = colIndex + mergedColSpan === colCount;
|
|
151
|
+
const isLastRow = displayedRowIndex + mergedRowSpan === rowCount;
|
|
152
|
+
const isCrossRowTd = mergedRowSpan > 1;
|
|
153
|
+
if (isCrossRowTd) {
|
|
154
|
+
cordKey[displayedRowIndex] = {
|
|
155
|
+
[colIndex]: []
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
if (mergedColSpan > 1 || isCrossRowTd) {
|
|
159
|
+
for (let i = displayedRowIndex; i < displayedRowIndex + mergedRowSpan; ++i) {
|
|
160
|
+
if (isCrossRowTd) {
|
|
161
|
+
cordKey[displayedRowIndex][colIndex].push(rowIndexToKey[i]);
|
|
162
|
+
}
|
|
163
|
+
for (let j = colIndex; j < colIndex + mergedColSpan; ++j) {
|
|
164
|
+
if (i === displayedRowIndex && j === colIndex) {
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
if (!(i in cordToPass)) {
|
|
168
|
+
cordToPass[i] = [j];
|
|
169
|
+
} else {
|
|
170
|
+
cordToPass[i].push(j);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const cellHoverKey = isCrossRowTd ? hoverKey : null;
|
|
176
|
+
const {
|
|
177
|
+
cellProps
|
|
178
|
+
} = column;
|
|
179
|
+
const resolvedCellProps = cellProps === null || cellProps === void 0 ? void 0 : cellProps(rowData, actualRowIndex);
|
|
180
|
+
const indentOffsetStyle = {
|
|
181
|
+
'--indent-offset': ''
|
|
182
|
+
};
|
|
183
|
+
const isDraggableHandleCell = column.type === 'draggable' && !isSummary && isRowDraggable;
|
|
184
|
+
return h("td", Object.assign({}, resolvedCellProps, {
|
|
185
|
+
key: colKey,
|
|
186
|
+
draggable: isDraggableHandleCell || undefined,
|
|
187
|
+
onDragstart: isDraggableHandleCell ? event => handleRowDragStart(event, rowKey) : undefined,
|
|
188
|
+
onDragend: isDraggableHandleCell ? () => handleRowDragEnd() : undefined,
|
|
189
|
+
style: [{
|
|
190
|
+
textAlign: column.align || undefined,
|
|
191
|
+
left: pxfy((_c = fixedColumnLeftMap[colKey]) === null || _c === void 0 ? void 0 : _c.start),
|
|
192
|
+
right: pxfy((_d = fixedColumnRightMap[colKey]) === null || _d === void 0 ? void 0 : _d.start)
|
|
193
|
+
}, indentOffsetStyle, (resolvedCellProps === null || resolvedCellProps === void 0 ? void 0 : resolvedCellProps.style) || ''],
|
|
194
|
+
colspan: mergedColSpan,
|
|
195
|
+
rowspan: isVirtual ? undefined : mergedRowSpan,
|
|
196
|
+
"data-col-key": colKey,
|
|
197
|
+
class: [`${mergedClsPrefix}-data-table-td`, column.className, resolvedCellProps === null || resolvedCellProps === void 0 ? void 0 : resolvedCellProps.class, isSummary && `${mergedClsPrefix}-data-table-td--summary`, (cellHoverKey !== null && cordKey[displayedRowIndex][colIndex].includes(cellHoverKey) || isColumnSorting(column, mergedSortState)) && `${mergedClsPrefix}-data-table-td--hover`, column.fixed && `${mergedClsPrefix}-data-table-td--fixed-${column.fixed}`, column.align && `${mergedClsPrefix}-data-table-td--${column.align}-align`, column.type === 'selection' && `${mergedClsPrefix}-data-table-td--selection`, column.type === 'expand' && `${mergedClsPrefix}-data-table-td--expand`, column.type === 'draggable' && `${mergedClsPrefix}-data-table-td--draggable`, isLastCol && `${mergedClsPrefix}-data-table-td--last-col`, isLastRow && `${mergedClsPrefix}-data-table-td--last-row`, 'editable' in column && (typeof column.editable === 'function' ? column.editable(rowData) : column.editable) && !isSummary && `${mergedClsPrefix}-data-table-td--editable`]
|
|
198
|
+
}), column.fixed && h("div", {
|
|
199
|
+
class: `${mergedClsPrefix}-data-table-td__shadow-holder`
|
|
200
|
+
}), hasChildren && colIndex === childTriggerColIndex ? [repeat(indentOffsetStyle['--indent-offset'] = isSummary ? 0 : rowInfo.tmNode.level, h("div", {
|
|
201
|
+
class: `${mergedClsPrefix}-data-table-indent`,
|
|
202
|
+
style: indentStyle
|
|
203
|
+
})), isSummary || rowInfo.tmNode.isLeaf ? h("div", {
|
|
204
|
+
class: `${mergedClsPrefix}-data-table-expand-placeholder`
|
|
205
|
+
}) : h(ExpandTrigger, {
|
|
206
|
+
class: `${mergedClsPrefix}-data-table-expand-trigger`,
|
|
207
|
+
clsPrefix: mergedClsPrefix,
|
|
208
|
+
expanded: expanded,
|
|
209
|
+
renderExpandIcon: renderExpandIcon,
|
|
210
|
+
loading: loadingKeySet.has(rowInfo.key),
|
|
211
|
+
onClick: () => {
|
|
212
|
+
handleUpdateExpanded(rowKey, rowInfo.tmNode);
|
|
213
|
+
}
|
|
214
|
+
})] : null, column.type === 'selection' ? !isSummary ? column.multiple === false ? h(RenderSafeRadio, {
|
|
215
|
+
key: currentPage,
|
|
216
|
+
rowKey: rowKey,
|
|
217
|
+
disabled: rowInfo.tmNode.disabled,
|
|
218
|
+
onClick: event => {
|
|
219
|
+
event.stopPropagation();
|
|
220
|
+
},
|
|
221
|
+
onUpdateChecked: () => {
|
|
222
|
+
handleRadioUpdateChecked(rowInfo.tmNode);
|
|
223
|
+
}
|
|
224
|
+
}) : h(RenderSafeCheckbox, {
|
|
225
|
+
key: currentPage,
|
|
226
|
+
rowKey: rowKey,
|
|
227
|
+
disabled: rowInfo.tmNode.disabled,
|
|
228
|
+
onUpdateChecked: (checked, event) => {
|
|
229
|
+
event.stopPropagation();
|
|
230
|
+
handleCheckboxUpdateChecked(rowInfo.tmNode, checked, event.shiftKey);
|
|
231
|
+
}
|
|
232
|
+
}) : null : column.type === 'expand' ? !isSummary ? !column.expandable || ((_e = column.expandable) === null || _e === void 0 ? void 0 : _e.call(column, rowData)) ? h(ExpandTrigger, {
|
|
233
|
+
clsPrefix: mergedClsPrefix,
|
|
234
|
+
expanded: expanded,
|
|
235
|
+
renderExpandIcon: renderExpandIcon,
|
|
236
|
+
onClick: () => {
|
|
237
|
+
handleUpdateExpanded(rowKey, null);
|
|
238
|
+
}
|
|
239
|
+
}) : null : null : column.type === 'draggable' ? isDraggableHandleCell ? h("span", {
|
|
240
|
+
class: `${mergedClsPrefix}-data-table-td__drag-handle`,
|
|
241
|
+
"aria-label": "Drag to reorder"
|
|
242
|
+
}, resolveSlot(dataTableSlots['drag-handle'], () => [h(DragHandleRound, null)])) : null : h(Cell, {
|
|
243
|
+
clsPrefix: mergedClsPrefix,
|
|
244
|
+
index: actualRowIndex,
|
|
245
|
+
row: rowData,
|
|
246
|
+
column: column,
|
|
247
|
+
isSummary: isSummary,
|
|
248
|
+
mergedTheme: mergedTheme,
|
|
249
|
+
renderCell: renderCell,
|
|
250
|
+
defaultEmptyValue: defaultEmptyValue,
|
|
251
|
+
onEdit: (value, row, key) => {
|
|
252
|
+
emitEdit(value, row, key);
|
|
253
|
+
}
|
|
254
|
+
}));
|
|
255
|
+
}));
|
|
256
|
+
return row;
|
|
257
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { computed, defineComponent, h, inject } from 'vue';
|
|
2
2
|
import { USkeleton } from "../../../skeleton/index.mjs";
|
|
3
3
|
import { dataTableInjectionKey } from "../interface.mjs";
|
|
4
|
+
const ICON_COLUMN_SKELETON_WIDTH = '16px';
|
|
5
|
+
const DEFAULT_COLUMN_SKELETON_WIDTH = '85%';
|
|
6
|
+
const SKELETON_BORDER_RADIUS = '16px';
|
|
4
7
|
export default defineComponent({
|
|
5
8
|
name: 'DataTableBodySkeleton',
|
|
6
9
|
props: {
|
|
@@ -49,10 +52,10 @@ export default defineComponent({
|
|
|
49
52
|
class: `${mergedClsPrefix}-data-table-td__shadow-holder`
|
|
50
53
|
}), h(USkeleton, {
|
|
51
54
|
height: "var(--u-line-height)",
|
|
52
|
-
width: col.column.type === 'selection'
|
|
55
|
+
width: col.column.type === 'selection' || col.column.type === 'draggable' ? ICON_COLUMN_SKELETON_WIDTH : DEFAULT_COLUMN_SKELETON_WIDTH,
|
|
53
56
|
animated: true,
|
|
54
57
|
style: {
|
|
55
|
-
borderRadius:
|
|
58
|
+
borderRadius: SKELETON_BORDER_RADIUS
|
|
56
59
|
}
|
|
57
60
|
})))));
|
|
58
61
|
return h("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;
|
|
@@ -10,6 +10,7 @@ import { dataTableInjectionKey } from "../interface.mjs";
|
|
|
10
10
|
import { clampValueFollowCSSRules, createNextSorter, getColKey, getNumberColWidth, isColumnEllipsisEnabled, isColumnFilterable, isColumnResizable, isColumnSortable, isColumnSorting, resolveColumnWidthConstraint } from "../utils/index.mjs";
|
|
11
11
|
import SelectionMenu from "./SelectionMenu.mjs";
|
|
12
12
|
function renderTitle(column) {
|
|
13
|
+
if (column.type === 'draggable') return null;
|
|
13
14
|
return typeof column.title === 'function' ? column.title(column) : column.title;
|
|
14
15
|
}
|
|
15
16
|
export default defineComponent({
|
|
@@ -201,6 +202,9 @@ export default defineComponent({
|
|
|
201
202
|
} = column;
|
|
202
203
|
const ellipsisEnabled = isColumnEllipsisEnabled(column);
|
|
203
204
|
const createColumnVNode = () => {
|
|
205
|
+
if (column.type === 'draggable') {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
204
208
|
if (column.type === 'selection') {
|
|
205
209
|
return column.multiple !== false ? h(Fragment, null, h(UCheckbox, {
|
|
206
210
|
key: currentPage,
|
|
@@ -261,7 +265,7 @@ export default defineComponent({
|
|
|
261
265
|
[`${mergedClsPrefix}-data-table-th--selection`]: column.type === 'selection',
|
|
262
266
|
[`${mergedClsPrefix}-data-table-th--last`]: isLast
|
|
263
267
|
}, column.className],
|
|
264
|
-
onClick: column.type !== 'selection' && column.type !== 'expand' && !('children' in column) ? e => {
|
|
268
|
+
onClick: column.type !== 'selection' && column.type !== 'expand' && column.type !== 'draggable' && !('children' in column) ? e => {
|
|
265
269
|
handleColHeaderClick(e, column);
|
|
266
270
|
} : undefined
|
|
267
271
|
}, (leftFixed || rightFixed) && h("div", {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
import type { ColItem } from '../use-group-header';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
clsPrefix: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
id: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
cols: {
|
|
13
|
+
type: PropType<ColItem[]>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
tableWidth: StringConstructor;
|
|
17
|
+
onMouseenter: PropType<(e: MouseEvent) => void>;
|
|
18
|
+
onMouseleave: PropType<(e: MouseEvent) => void>;
|
|
19
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
clsPrefix: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
id: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
cols: {
|
|
29
|
+
type: PropType<ColItem[]>;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
tableWidth: StringConstructor;
|
|
33
|
+
onMouseenter: PropType<(e: MouseEvent) => void>;
|
|
34
|
+
onMouseleave: PropType<(e: MouseEvent) => void>;
|
|
35
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue';
|
|
2
|
+
export default defineComponent({
|
|
3
|
+
name: 'VirtualListItemWrapper',
|
|
4
|
+
props: {
|
|
5
|
+
clsPrefix: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
id: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
cols: {
|
|
14
|
+
type: Array,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
tableWidth: String,
|
|
18
|
+
onMouseenter: Function,
|
|
19
|
+
onMouseleave: Function
|
|
20
|
+
},
|
|
21
|
+
render() {
|
|
22
|
+
const {
|
|
23
|
+
clsPrefix,
|
|
24
|
+
id,
|
|
25
|
+
cols,
|
|
26
|
+
tableWidth,
|
|
27
|
+
onMouseenter,
|
|
28
|
+
onMouseleave
|
|
29
|
+
} = this;
|
|
30
|
+
return h("table", {
|
|
31
|
+
style: {
|
|
32
|
+
tableLayout: 'fixed',
|
|
33
|
+
width: tableWidth
|
|
34
|
+
},
|
|
35
|
+
class: `${clsPrefix}-data-table-table`,
|
|
36
|
+
onMouseenter: onMouseenter,
|
|
37
|
+
onMouseleave: onMouseleave
|
|
38
|
+
}, h("colgroup", null, cols.map(col => h("col", {
|
|
39
|
+
key: col.key,
|
|
40
|
+
style: col.style
|
|
41
|
+
}))), h("tbody", {
|
|
42
|
+
"data-u-id": id,
|
|
43
|
+
class: `${clsPrefix}-data-table-tbody`
|
|
44
|
+
}, this.$slots));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TreeMate, TreeNode } from 'treemate';
|
|
2
|
-
import type { CSSProperties, ExtractPropTypes, HTMLAttributes, PropType, Ref, Slots, VNode, VNodeChild } from 'vue';
|
|
2
|
+
import type { ComputedRef, CSSProperties, ExtractPropTypes, HTMLAttributes, PropType, Ref, Slots, VNode, VNodeChild } from 'vue';
|
|
3
3
|
import type { BaseLoadingExposedProps } from '../../_internal';
|
|
4
4
|
import type { MergedTheme } from '../../_mixins';
|
|
5
5
|
import type { ExtractPublicPropTypes, MaybeArray } from '../../_utils';
|
|
@@ -178,6 +178,9 @@ export declare const dataTableProps: {
|
|
|
178
178
|
thButtonColorHover: string;
|
|
179
179
|
thIconColor: string;
|
|
180
180
|
thIconColorActive: string;
|
|
181
|
+
dropMarkColor: string;
|
|
182
|
+
dragGhostOpacity: string;
|
|
183
|
+
dragGhostFilter: string;
|
|
181
184
|
borderColorModal: string;
|
|
182
185
|
tdColorHoverModal: string;
|
|
183
186
|
tdColorStripedModal: string;
|
|
@@ -1133,6 +1136,9 @@ export declare const dataTableProps: {
|
|
|
1133
1136
|
thButtonColorHover: string;
|
|
1134
1137
|
thIconColor: string;
|
|
1135
1138
|
thIconColorActive: string;
|
|
1139
|
+
dropMarkColor: string;
|
|
1140
|
+
dragGhostOpacity: string;
|
|
1141
|
+
dragGhostFilter: string;
|
|
1136
1142
|
borderColorModal: string;
|
|
1137
1143
|
tdColorHoverModal: string;
|
|
1138
1144
|
tdColorStripedModal: string;
|
|
@@ -2088,6 +2094,9 @@ export declare const dataTableProps: {
|
|
|
2088
2094
|
thButtonColorHover: string;
|
|
2089
2095
|
thIconColor: string;
|
|
2090
2096
|
thIconColorActive: string;
|
|
2097
|
+
dropMarkColor: string;
|
|
2098
|
+
dragGhostOpacity: string;
|
|
2099
|
+
dragGhostFilter: string;
|
|
2091
2100
|
borderColorModal: string;
|
|
2092
2101
|
tdColorHoverModal: string;
|
|
2093
2102
|
tdColorStripedModal: string;
|
|
@@ -3016,6 +3025,7 @@ export interface DataTableSlots {
|
|
|
3016
3025
|
default?: () => VNode[];
|
|
3017
3026
|
empty?: () => VNode[];
|
|
3018
3027
|
loading?: () => VNode[];
|
|
3028
|
+
'drag-handle'?: () => VNode[];
|
|
3019
3029
|
}
|
|
3020
3030
|
export type RowData = Record<string, any>;
|
|
3021
3031
|
export type InternalRowData = Record<string, unknown>;
|
|
@@ -3134,8 +3144,123 @@ export interface TableExpandColumn<T = InternalRowData> extends Omit<TableSelect
|
|
|
3134
3144
|
renderExpand: RenderExpand<T>;
|
|
3135
3145
|
expandable?: Expandable<T>;
|
|
3136
3146
|
}
|
|
3137
|
-
export
|
|
3147
|
+
export interface RowDragEndOptions {
|
|
3148
|
+
index: number;
|
|
3149
|
+
oldOrder: number;
|
|
3150
|
+
newOrder: number;
|
|
3151
|
+
}
|
|
3152
|
+
export interface UseTableDataDeps {
|
|
3153
|
+
dataRelatedColsRef: ComputedRef<DataRelatedColumn[]>;
|
|
3154
|
+
}
|
|
3155
|
+
export interface UseSorterDeps {
|
|
3156
|
+
dataRelatedColsRef: ComputedRef<DataRelatedColumn[]>;
|
|
3157
|
+
filteredDataRef: ComputedRef<TmNode[]>;
|
|
3158
|
+
}
|
|
3159
|
+
export interface UseRowDragDeps {
|
|
3160
|
+
paginatedDataRef: ComputedRef<TmNode[]>;
|
|
3161
|
+
mergedCheckedRowKeySetRef: Ref<Set<RowKey>>;
|
|
3162
|
+
mergedClsPrefixRef: Ref<string>;
|
|
3163
|
+
}
|
|
3164
|
+
export interface UseRowDragReturn {
|
|
3165
|
+
draggableColumnRef: Ref<TableDraggableColumn | null>;
|
|
3166
|
+
draggingRowKeySetRef: Ref<Set<RowKey>>;
|
|
3167
|
+
droppingRowKeyRef: Ref<RowKey | null>;
|
|
3168
|
+
droppingPositionRef: Ref<RowDropPosition | null>;
|
|
3169
|
+
handleRowDragStart: (event: DragEvent, rowKey: RowKey) => void;
|
|
3170
|
+
handleRowDragOver: (event: DragEvent, rowKey: RowKey) => void;
|
|
3171
|
+
handleRowDragLeave: (event: DragEvent, rowKey: RowKey) => void;
|
|
3172
|
+
handleRowDragEnd: () => void;
|
|
3173
|
+
handleRowDrop: (event: DragEvent, rowKey: RowKey) => void;
|
|
3174
|
+
}
|
|
3175
|
+
export interface BodyRowRenderContext {
|
|
3176
|
+
mergedClsPrefix: string;
|
|
3177
|
+
cols: ColItem[];
|
|
3178
|
+
colCount: number;
|
|
3179
|
+
rowCount: number;
|
|
3180
|
+
hasChildren: boolean;
|
|
3181
|
+
childTriggerColIndex: number;
|
|
3182
|
+
indentStyle: {
|
|
3183
|
+
width: string;
|
|
3184
|
+
} | undefined;
|
|
3185
|
+
rowClassName: string | CreateRowClassName | undefined;
|
|
3186
|
+
rowProps: CreateRowProps | undefined;
|
|
3187
|
+
mergedSortState: SortState[];
|
|
3188
|
+
mergedExpandedRowKeySet: Set<RowKey>;
|
|
3189
|
+
fixedColumnLeftMap: Record<ColumnKey, {
|
|
3190
|
+
start: number;
|
|
3191
|
+
end: number;
|
|
3192
|
+
} | undefined>;
|
|
3193
|
+
fixedColumnRightMap: Record<ColumnKey, {
|
|
3194
|
+
start: number;
|
|
3195
|
+
end: number;
|
|
3196
|
+
} | undefined>;
|
|
3197
|
+
currentPage: number;
|
|
3198
|
+
loadingKeySet: Set<RowKey>;
|
|
3199
|
+
stickyExpandedRows: boolean;
|
|
3200
|
+
bodyWidthPx: string | undefined;
|
|
3201
|
+
renderExpand: RenderExpand | undefined;
|
|
3202
|
+
renderExpandIcon: RenderExpandIcon | undefined;
|
|
3203
|
+
renderCell: ((value: any, rowData: object, column: TableBaseColumn) => VNodeChild) | undefined;
|
|
3204
|
+
defaultEmptyValue: string | (() => VNodeChild) | undefined;
|
|
3205
|
+
mergedTheme: MergedTheme<DataTableTheme>;
|
|
3206
|
+
rowIndexToKey: Record<number, RowKey>;
|
|
3207
|
+
cordToPass: Record<number, number[]>;
|
|
3208
|
+
cordKey: Record<number, Record<number, RowKey[]>>;
|
|
3209
|
+
draggableColumn: TableDraggableColumn | null;
|
|
3210
|
+
droppingRowKey: RowKey | null;
|
|
3211
|
+
droppingPosition: RowDropPosition | null;
|
|
3212
|
+
draggingRowKeySet: Set<RowKey>;
|
|
3213
|
+
hoverKey: RowKey | null;
|
|
3214
|
+
dataTableSlots: Slots;
|
|
3215
|
+
setHoverKey: (key: RowKey) => void;
|
|
3216
|
+
handleCheckboxUpdateChecked: (tmNode: {
|
|
3217
|
+
key: RowKey;
|
|
3218
|
+
}, checked: boolean, shiftKey: boolean) => void;
|
|
3219
|
+
handleRadioUpdateChecked: (tmNode: {
|
|
3220
|
+
key: RowKey;
|
|
3221
|
+
}) => void;
|
|
3222
|
+
handleUpdateExpanded: (key: RowKey, tmNode: TmNode | null) => void;
|
|
3223
|
+
handleRowDragStart: (event: DragEvent, rowKey: RowKey) => void;
|
|
3224
|
+
handleRowDragOver: (event: DragEvent, rowKey: RowKey) => void;
|
|
3225
|
+
handleRowDragLeave: (event: DragEvent, rowKey: RowKey) => void;
|
|
3226
|
+
handleRowDragEnd: () => void;
|
|
3227
|
+
handleRowDrop: (event: DragEvent, rowKey: RowKey) => void;
|
|
3228
|
+
emitEdit: (value: any, row: any, key: any) => void;
|
|
3229
|
+
}
|
|
3230
|
+
export interface BodyEmptyDeps {
|
|
3231
|
+
clsPrefix: string;
|
|
3232
|
+
loading: boolean;
|
|
3233
|
+
bodyStyle: CSSProperties | undefined;
|
|
3234
|
+
dataTableSlots: Slots;
|
|
3235
|
+
mergedTheme: MergedTheme<DataTableTheme>;
|
|
3236
|
+
emptyProps: Partial<EmptyProps> | undefined;
|
|
3237
|
+
}
|
|
3238
|
+
export interface FixedShadowStyleProps {
|
|
3239
|
+
leftActiveFixedColKey: ColumnKey | null;
|
|
3240
|
+
leftActiveFixedChildrenColKeys: ColumnKey[];
|
|
3241
|
+
rightActiveFixedColKey: ColumnKey | null;
|
|
3242
|
+
rightActiveFixedChildrenColKeys: ColumnKey[];
|
|
3243
|
+
componentId: string;
|
|
3244
|
+
}
|
|
3245
|
+
export type RowDropPosition = 'before' | 'after';
|
|
3246
|
+
export type TableDraggableColumn<T = InternalRowData> = {
|
|
3247
|
+
type: 'draggable';
|
|
3248
|
+
key: ColumnKey;
|
|
3249
|
+
draggable?: (row: T) => boolean;
|
|
3250
|
+
onDragEnd?: (row: T, options: RowDragEndOptions) => void;
|
|
3251
|
+
sortByKey?: boolean;
|
|
3252
|
+
sorter?: never;
|
|
3253
|
+
filter?: never;
|
|
3254
|
+
filterOptions?: never;
|
|
3255
|
+
filterOptionValues?: never;
|
|
3256
|
+
filterOptionValue?: never;
|
|
3257
|
+
resizable?: never;
|
|
3258
|
+
colSpan?: never;
|
|
3259
|
+
rowSpan?: never;
|
|
3260
|
+
} & CommonColumnInfo<T>;
|
|
3261
|
+
export type TableColumn<T = InternalRowData> = TableColumnGroup<T> | TableBaseColumn<T> | TableSelectionColumn<T> | TableExpandColumn<T> | TableDraggableColumn<T>;
|
|
3138
3262
|
export type TableColumns<T = InternalRowData> = Array<TableColumn<T>>;
|
|
3263
|
+
export type DataRelatedColumn<T = InternalRowData> = TableSelectionColumn<T> | TableBaseColumn<T> | TableExpandColumn<T> | TableDraggableColumn<T>;
|
|
3139
3264
|
export type DataTableSelectionOptions<T = InternalRowData> = Array<DataTableSelectionOption | {
|
|
3140
3265
|
label: string;
|
|
3141
3266
|
key: string | number;
|
|
@@ -3226,6 +3351,15 @@ export interface DataTableInjection {
|
|
|
3226
3351
|
defaultEmptyValueRef: Ref<string | (() => VNodeChild) | undefined>;
|
|
3227
3352
|
emptyPropsRef: Ref<Partial<EmptyProps> | undefined>;
|
|
3228
3353
|
handleEdit: (value: any, row: any, key: string) => void;
|
|
3354
|
+
draggableColumnRef: UseRowDragReturn['draggableColumnRef'];
|
|
3355
|
+
draggingRowKeySetRef: UseRowDragReturn['draggingRowKeySetRef'];
|
|
3356
|
+
droppingRowKeyRef: UseRowDragReturn['droppingRowKeyRef'];
|
|
3357
|
+
droppingPositionRef: UseRowDragReturn['droppingPositionRef'];
|
|
3358
|
+
handleRowDragStart: UseRowDragReturn['handleRowDragStart'];
|
|
3359
|
+
handleRowDragOver: UseRowDragReturn['handleRowDragOver'];
|
|
3360
|
+
handleRowDragLeave: UseRowDragReturn['handleRowDragLeave'];
|
|
3361
|
+
handleRowDragEnd: UseRowDragReturn['handleRowDragEnd'];
|
|
3362
|
+
handleRowDrop: UseRowDragReturn['handleRowDrop'];
|
|
3229
3363
|
}
|
|
3230
3364
|
export declare const dataTableInjectionKey: import("vue").InjectionKey<DataTableInjection>;
|
|
3231
3365
|
export interface MainTableInjection {
|
|
@@ -3314,5 +3448,30 @@ export interface CsvOptionsType {
|
|
|
3314
3448
|
fileName?: string;
|
|
3315
3449
|
keepOriginalData?: boolean;
|
|
3316
3450
|
}
|
|
3451
|
+
export interface NormalRowRenderInfo {
|
|
3452
|
+
striped: boolean;
|
|
3453
|
+
tmNode: TmNode;
|
|
3454
|
+
key: RowKey;
|
|
3455
|
+
index: number;
|
|
3456
|
+
}
|
|
3457
|
+
export interface WidthConstraintSignal {
|
|
3458
|
+
systemMinWidth: number | string;
|
|
3459
|
+
systemMaxWidth?: number | string;
|
|
3460
|
+
}
|
|
3461
|
+
export type RowRenderInfo = {
|
|
3462
|
+
isSummaryRow: true;
|
|
3463
|
+
key: RowKey;
|
|
3464
|
+
tmNode: {
|
|
3465
|
+
rawNode: SummaryRowData;
|
|
3466
|
+
disabled: boolean;
|
|
3467
|
+
};
|
|
3468
|
+
index: number;
|
|
3469
|
+
} | NormalRowRenderInfo | {
|
|
3470
|
+
isExpandedRow: true;
|
|
3471
|
+
tmNode: TmNode;
|
|
3472
|
+
key: RowKey;
|
|
3473
|
+
index: number;
|
|
3474
|
+
};
|
|
3475
|
+
export type ResizeReconcileReason = 'topology/capability' | 'mode' | 'environment' | 'width-state';
|
|
3317
3476
|
export type DataTableProps = ExtractPublicPropTypes<typeof dataTableProps>;
|
|
3318
3477
|
export type DataTableSetupProps = ExtractPropTypes<typeof dataTableProps>;
|
|
@@ -140,7 +140,11 @@ c('&:last-child', 'flex-grow: 1;')])])])])])])]), c('>', [cB('data-table-loading
|
|
|
140
140
|
margin: calc(var(--u-th-padding) * -1);
|
|
141
141
|
padding: var(--u-th-padding);
|
|
142
142
|
box-sizing: border-box;
|
|
143
|
-
`), cM('disabled', null, [cB('data-table-td', 'color: var(--u-td-opacity-disabled);')]), cM('
|
|
143
|
+
`), cM('disabled', null, [cB('data-table-td', 'color: var(--u-td-opacity-disabled);')]), cM('dragging', 'opacity: 0.4;'), cM('drop-before', null, [c('>', [cB('data-table-td', `
|
|
144
|
+
box-shadow: inset 0 2px 0 0 var(--u-drop-mark-color);
|
|
145
|
+
`)])]), cM('drop-after', null, [c('>', [cB('data-table-td', `
|
|
146
|
+
box-shadow: inset 0 -2px 0 0 var(--u-drop-mark-color);
|
|
147
|
+
`)])]), cM('striped', 'background-color: var(--u-merged-td-color-striped);', [cB('data-table-td', 'background-color: var(--u-merged-td-color-striped);')]), c('&:hover', 'background-color: var(--u-merged-td-color-hover);', [c('>', [cB('data-table-td', 'background-color: var(--u-merged-td-color-hover);')])]), c('&:has(.u-data-table-td--editable:hover)', [c('>', [cB('data-table-td', 'background-color: var(--u-merged-td-color);', [cM('editable', [c('&:hover', 'background-color: var(--u-merged-td-color-hover);')])])])])]), cB('data-table-th', `
|
|
144
148
|
padding: var(--u-th-padding);
|
|
145
149
|
position: relative;
|
|
146
150
|
height: var(--u-th-height);
|
|
@@ -293,7 +297,22 @@ c('&:last-child', 'flex-grow: 1;')])])])])])])]), c('>', [cB('data-table-loading
|
|
|
293
297
|
`), cM('selection, expand', `
|
|
294
298
|
text-align: center;
|
|
295
299
|
line-height: 0;
|
|
296
|
-
`), cM('
|
|
300
|
+
`), cM('draggable', `
|
|
301
|
+
text-align: center;
|
|
302
|
+
line-height: 0;
|
|
303
|
+
cursor: grab;
|
|
304
|
+
`, [c('&:active', `
|
|
305
|
+
cursor: grabbing;
|
|
306
|
+
`), c('&:hover', [cE('drag-handle', `
|
|
307
|
+
color: var(--u-th-icon-color-active);
|
|
308
|
+
`)]), cE('drag-handle', `
|
|
309
|
+
display: inline-flex;
|
|
310
|
+
align-items: center;
|
|
311
|
+
justify-content: center;
|
|
312
|
+
color: var(--u-th-icon-color);
|
|
313
|
+
line-height: 0;
|
|
314
|
+
pointer-events: none;
|
|
315
|
+
`)]), cM('editable', `
|
|
297
316
|
cursor: pointer;
|
|
298
317
|
position: relative;
|
|
299
318
|
padding: 0;
|
|
@@ -312,7 +331,11 @@ c('&:last-child', 'flex-grow: 1;')])])])])])])]), c('>', [cB('data-table-loading
|
|
|
312
331
|
height: 100%;
|
|
313
332
|
width: 100%;
|
|
314
333
|
}
|
|
315
|
-
`), fixedColumnStyle]), cB('data-table-
|
|
334
|
+
`), fixedColumnStyle]), cB('data-table-drag-ghost', `
|
|
335
|
+
opacity: var(--u-drag-ghost-opacity);
|
|
336
|
+
filter: var(--u-drag-ghost-filter);
|
|
337
|
+
pointer-events: none;
|
|
338
|
+
`), cB('data-table-empty', `
|
|
316
339
|
box-sizing: border-box;
|
|
317
340
|
padding: var(--u-empty-padding);
|
|
318
341
|
flex-grow: 1;
|