@semcore/data-table 16.0.0-prerelease.7 → 16.0.0
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/CHANGELOG.md +25 -1
- package/lib/cjs/components/Body/Body.js +436 -0
- package/lib/cjs/components/Body/Body.js.map +1 -0
- package/lib/cjs/components/Body/Body.types.js +2 -0
- package/lib/cjs/components/Body/Body.types.js.map +1 -0
- package/lib/cjs/components/Body/Cell.js +194 -0
- package/lib/cjs/components/Body/Cell.js.map +1 -0
- package/lib/cjs/components/Body/Cell.types.js +2 -0
- package/lib/cjs/components/Body/Cell.types.js.map +1 -0
- package/lib/cjs/components/Body/MergedCells.js +29 -0
- package/lib/cjs/components/Body/MergedCells.js.map +1 -0
- package/lib/cjs/components/Body/Row.js +244 -0
- package/lib/cjs/components/Body/Row.js.map +1 -0
- package/lib/cjs/components/Body/Row.types.js +4 -0
- package/lib/cjs/components/Body/Row.types.js.map +1 -0
- package/lib/cjs/components/Body/style.shadow.css +257 -0
- package/lib/cjs/components/DataTable/DataTable.js +981 -0
- package/lib/cjs/components/DataTable/DataTable.js.map +1 -0
- package/lib/cjs/{types.js → components/DataTable/DataTable.types.js} +1 -1
- package/lib/cjs/components/DataTable/DataTable.types.js.map +1 -0
- package/lib/cjs/components/DataTable/dataTable.shadow.css +17 -0
- package/lib/cjs/components/Head/Column.js +316 -0
- package/lib/cjs/components/Head/Column.js.map +1 -0
- package/lib/cjs/components/Head/Column.types.js +2 -0
- package/lib/cjs/components/Head/Column.types.js.map +1 -0
- package/lib/cjs/components/Head/Group.js +115 -0
- package/lib/cjs/components/Head/Group.js.map +1 -0
- package/lib/cjs/components/Head/Group.type.js +2 -0
- package/lib/cjs/components/Head/Group.type.js.map +1 -0
- package/lib/cjs/components/Head/Head.js +205 -0
- package/lib/cjs/components/Head/Head.js.map +1 -0
- package/lib/cjs/components/Head/Head.types.js +2 -0
- package/lib/cjs/components/Head/Head.types.js.map +1 -0
- package/lib/cjs/components/Head/style.shadow.css +176 -0
- package/lib/cjs/index.js +25 -15
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/scroll-shadows.shadow.css +39 -5
- package/lib/cjs/translations/en.json +6 -1
- package/lib/cjs/utils.js +16 -7
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/components/Body/Body.js +429 -0
- package/lib/es6/components/Body/Body.js.map +1 -0
- package/lib/es6/components/Body/Body.types.js +2 -0
- package/lib/es6/components/Body/Body.types.js.map +1 -0
- package/lib/es6/components/Body/Cell.js +187 -0
- package/lib/es6/components/Body/Cell.js.map +1 -0
- package/lib/es6/components/Body/Cell.types.js +2 -0
- package/lib/es6/components/Body/Cell.types.js.map +1 -0
- package/lib/es6/components/Body/MergedCells.js +20 -0
- package/lib/es6/components/Body/MergedCells.js.map +1 -0
- package/lib/es6/components/Body/Row.js +237 -0
- package/lib/es6/components/Body/Row.js.map +1 -0
- package/lib/es6/components/Body/Row.types.js +2 -0
- package/lib/es6/components/Body/Row.types.js.map +1 -0
- package/lib/es6/components/Body/style.shadow.css +257 -0
- package/lib/es6/components/DataTable/DataTable.js +970 -0
- package/lib/es6/components/DataTable/DataTable.js.map +1 -0
- package/lib/es6/components/DataTable/DataTable.types.js +2 -0
- package/lib/es6/components/DataTable/DataTable.types.js.map +1 -0
- package/lib/es6/components/DataTable/dataTable.shadow.css +17 -0
- package/lib/es6/components/Head/Column.js +309 -0
- package/lib/es6/components/Head/Column.js.map +1 -0
- package/lib/es6/components/Head/Column.types.js +2 -0
- package/lib/es6/components/Head/Column.types.js.map +1 -0
- package/lib/es6/components/Head/Group.js +108 -0
- package/lib/es6/components/Head/Group.js.map +1 -0
- package/lib/es6/components/Head/Group.type.js +2 -0
- package/lib/es6/components/Head/Group.type.js.map +1 -0
- package/lib/es6/components/Head/Head.js +199 -0
- package/lib/es6/components/Head/Head.js.map +1 -0
- package/lib/es6/components/Head/Head.types.js +2 -0
- package/lib/es6/components/Head/Head.types.js.map +1 -0
- package/lib/es6/components/Head/style.shadow.css +176 -0
- package/lib/es6/index.js +5 -2
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/scroll-shadows.shadow.css +39 -5
- package/lib/es6/translations/en.json +6 -1
- package/lib/es6/utils.js +14 -6
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/components/Body/Body.mjs +392 -0
- package/lib/esm/components/Body/Cell.mjs +185 -0
- package/lib/esm/components/Body/MergedCells.mjs +23 -0
- package/lib/esm/components/Body/Row.mjs +218 -0
- package/lib/esm/components/Body/style.shadow.css +257 -0
- package/lib/esm/components/DataTable/DataTable.mjs +904 -0
- package/lib/esm/components/DataTable/dataTable.shadow.css +17 -0
- package/lib/esm/components/Head/Column.mjs +299 -0
- package/lib/esm/components/Head/Group.mjs +102 -0
- package/lib/esm/components/Head/Head.mjs +180 -0
- package/lib/esm/components/Head/style.shadow.css +176 -0
- package/lib/esm/index.mjs +8 -5
- package/lib/esm/style/scroll-shadows.shadow.css +41 -0
- package/lib/esm/translations/en.json.mjs +6 -1
- package/lib/esm/utils.mjs +6 -15
- package/lib/types/components/Body/Body.d.ts +8 -0
- package/lib/types/components/Body/Body.types.d.ts +56 -0
- package/lib/types/components/Body/Cell.d.ts +3 -0
- package/lib/types/components/Body/Cell.types.d.ts +20 -0
- package/lib/types/components/Body/MergedCells.d.ts +14 -0
- package/lib/types/components/Body/Row.d.ts +3 -0
- package/lib/types/components/Body/Row.types.d.ts +42 -0
- package/lib/types/components/DataTable/DataTable.d.ts +12 -0
- package/lib/types/components/DataTable/DataTable.types.d.ts +118 -0
- package/lib/types/components/Head/Column.d.ts +30 -0
- package/lib/types/components/Head/Column.types.d.ts +82 -0
- package/lib/types/components/Head/Group.d.ts +15 -0
- package/lib/types/components/Head/Group.type.d.ts +16 -0
- package/lib/types/components/Head/Head.d.ts +98 -0
- package/lib/types/components/Head/Head.types.d.ts +35 -0
- package/lib/types/index.d.ts +10 -2
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +5 -0
- package/lib/types/utils.d.ts +8 -4
- package/package.json +11 -6
- package/vite.config.ts +0 -3
- package/lib/cjs/Body.js +0 -475
- package/lib/cjs/Body.js.map +0 -1
- package/lib/cjs/DataTable.js +0 -622
- package/lib/cjs/DataTable.js.map +0 -1
- package/lib/cjs/Head.js +0 -399
- package/lib/cjs/Head.js.map +0 -1
- package/lib/cjs/style/data-table.shadow.css +0 -394
- package/lib/cjs/types.js.map +0 -1
- package/lib/es6/Body.js +0 -468
- package/lib/es6/Body.js.map +0 -1
- package/lib/es6/DataTable.js +0 -614
- package/lib/es6/DataTable.js.map +0 -1
- package/lib/es6/Head.js +0 -391
- package/lib/es6/Head.js.map +0 -1
- package/lib/es6/style/data-table.shadow.css +0 -394
- package/lib/es6/types.js +0 -2
- package/lib/es6/types.js.map +0 -1
- package/lib/esm/Body.mjs +0 -427
- package/lib/esm/DataTable.mjs +0 -582
- package/lib/esm/Head.mjs +0 -369
- package/lib/types/Body.d.ts +0 -61
- package/lib/types/DataTable.d.ts +0 -205
- package/lib/types/Head.d.ts +0 -45
- package/lib/types/types.d.ts +0 -73
package/lib/esm/Head.mjs
DELETED
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
-
import { sstyled, assignProps, Component } from "@semcore/core";
|
|
10
|
-
import React from "react";
|
|
11
|
-
import { ScreenReaderOnly, Flex, Box } from "@semcore/flex-box";
|
|
12
|
-
import ScrollArea, { hideScrollBarsFromScreenReadersContext } from "@semcore/scroll-area";
|
|
13
|
-
import SortDesc from "@semcore/icon/SortDesc/m";
|
|
14
|
-
import SortAsc from "@semcore/icon/SortAsc/m";
|
|
15
|
-
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
16
|
-
import { flattenColumns, getFixedStyle, getScrollOffsetValue } from "./utils.mjs";
|
|
17
|
-
import logger from "@semcore/core/lib/utils/logger";
|
|
18
|
-
import { setRef } from "@semcore/core/lib/utils/ref";
|
|
19
|
-
import { getFocusableIn } from "@semcore/core/lib/utils/focus-lock/getFocusableIn";
|
|
20
|
-
var SORT_ICON_WIDTH = 20;
|
|
21
|
-
var SORTING_ICON = {
|
|
22
|
-
desc: SortDesc,
|
|
23
|
-
asc: SortAsc
|
|
24
|
-
};
|
|
25
|
-
var ariaSort = {
|
|
26
|
-
desc: "descending",
|
|
27
|
-
asc: "ascending"
|
|
28
|
-
};
|
|
29
|
-
var displayContents = {
|
|
30
|
-
display: "contents"
|
|
31
|
-
};
|
|
32
|
-
function cssToIntDefault(value) {
|
|
33
|
-
var defaultValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
34
|
-
var result = parseFloat(value);
|
|
35
|
-
if (Number.isNaN(result)) {
|
|
36
|
-
result = defaultValue;
|
|
37
|
-
}
|
|
38
|
-
return Math.round(result);
|
|
39
|
-
}
|
|
40
|
-
var Head = /* @__PURE__ */ function(_Component) {
|
|
41
|
-
_inherits(Head2, _Component);
|
|
42
|
-
var _super = _createSuper(Head2);
|
|
43
|
-
function Head2() {
|
|
44
|
-
var _this;
|
|
45
|
-
_classCallCheck(this, Head2);
|
|
46
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
47
|
-
args[_key] = arguments[_key];
|
|
48
|
-
}
|
|
49
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
50
|
-
_defineProperty(_assertThisInitialized(_this), "columns", []);
|
|
51
|
-
_defineProperty(_assertThisInitialized(_this), "headCellMap", /* @__PURE__ */ new Map());
|
|
52
|
-
_defineProperty(_assertThisInitialized(_this), "lockedCell", [null, false]);
|
|
53
|
-
_defineProperty(_assertThisInitialized(_this), "sortWrapperRefs", /* @__PURE__ */ new Map());
|
|
54
|
-
_defineProperty(_assertThisInitialized(_this), "defaultWidths", /* @__PURE__ */ new Map());
|
|
55
|
-
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function(e) {
|
|
56
|
-
if (e.currentTarget === _this.lockedCell[0]) {
|
|
57
|
-
var focusableChildren = Array.from(_this.lockedCell[0].children).flatMap(function(node) {
|
|
58
|
-
return getFocusableIn(node);
|
|
59
|
-
});
|
|
60
|
-
if (_this.lockedCell[1]) {
|
|
61
|
-
if (e.key === "Escape") {
|
|
62
|
-
var _this$lockedCell$;
|
|
63
|
-
(_this$lockedCell$ = _this.lockedCell[0]) === null || _this$lockedCell$ === void 0 ? void 0 : _this$lockedCell$.focus();
|
|
64
|
-
_this.lockedCell[1] = false;
|
|
65
|
-
}
|
|
66
|
-
if (e.key.startsWith("Arrow")) {
|
|
67
|
-
e.stopPropagation();
|
|
68
|
-
}
|
|
69
|
-
if (e.key === "Tab") {
|
|
70
|
-
if (e.target === focusableChildren[0] && e.shiftKey) {
|
|
71
|
-
var _focusableChildren;
|
|
72
|
-
(_focusableChildren = focusableChildren[focusableChildren.length - 1]) === null || _focusableChildren === void 0 ? void 0 : _focusableChildren.focus();
|
|
73
|
-
e.preventDefault();
|
|
74
|
-
} else if (e.target === focusableChildren[focusableChildren.length - 1] && !e.shiftKey) {
|
|
75
|
-
var _focusableChildren$;
|
|
76
|
-
(_focusableChildren$ = focusableChildren[0]) === null || _focusableChildren$ === void 0 ? void 0 : _focusableChildren$.focus();
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
} else if (e.key === "Enter") {
|
|
81
|
-
var _focusableChildren$2;
|
|
82
|
-
_this.lockedCell[1] = true;
|
|
83
|
-
(_focusableChildren$2 = focusableChildren[0]) === null || _focusableChildren$2 === void 0 ? void 0 : _focusableChildren$2.focus();
|
|
84
|
-
} else if (e.key === "Tab") {
|
|
85
|
-
var _this$lockedCell$2;
|
|
86
|
-
(_this$lockedCell$2 = _this.lockedCell[0]) === null || _this$lockedCell$2 === void 0 ? void 0 : _this$lockedCell$2.setAttribute("inert", "");
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
_defineProperty(_assertThisInitialized(_this), "onFocusCell", function(e) {
|
|
91
|
-
if (e.target === e.currentTarget) {
|
|
92
|
-
var focusableChildren = Array.from(e.currentTarget.children).flatMap(function(node) {
|
|
93
|
-
return getFocusableIn(node);
|
|
94
|
-
});
|
|
95
|
-
if (focusableChildren.length === 1) {
|
|
96
|
-
focusableChildren[0].focus();
|
|
97
|
-
} else if (focusableChildren.length > 1) {
|
|
98
|
-
_this.lockedCell = [e.currentTarget, false];
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
_defineProperty(_assertThisInitialized(_this), "bindHandlerSortClick", function(name) {
|
|
103
|
-
return function(event) {
|
|
104
|
-
_this.asProps.$onSortClick(name, event);
|
|
105
|
-
};
|
|
106
|
-
});
|
|
107
|
-
_defineProperty(_assertThisInitialized(_this), "bindHandlerKeyDown", function(name) {
|
|
108
|
-
return function(event) {
|
|
109
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
110
|
-
event.preventDefault();
|
|
111
|
-
_this.asProps.$onSortClick(name, event);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
});
|
|
115
|
-
_defineProperty(_assertThisInitialized(_this), "makeSortRefHandler", function(active) {
|
|
116
|
-
return function(ref) {
|
|
117
|
-
if (ref) {
|
|
118
|
-
_this.sortWrapperRefs.set(ref, active);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
});
|
|
122
|
-
_defineProperty(_assertThisInitialized(_this), "makeColumnRefHandler", function(column, index) {
|
|
123
|
-
return function(ref) {
|
|
124
|
-
setRef(column.props.ref, ref);
|
|
125
|
-
_this.headCellMap.set(index, ref);
|
|
126
|
-
if (column.props.forwardRef) {
|
|
127
|
-
setRef(column.props.forwardRef, ref);
|
|
128
|
-
}
|
|
129
|
-
if (ref && ref.getAttribute("scope") === "col") {
|
|
130
|
-
if (!_this.defaultWidths.has(ref)) {
|
|
131
|
-
var computedStyle = window.getComputedStyle(ref);
|
|
132
|
-
_this.defaultWidths.set(ref, {
|
|
133
|
-
minWidth: cssToIntDefault(computedStyle.getPropertyValue("min-width")),
|
|
134
|
-
computedWidth: cssToIntDefault(computedStyle.getPropertyValue("width")),
|
|
135
|
-
maxWidth: cssToIntDefault(computedStyle.getPropertyValue("max-width")) || null,
|
|
136
|
-
useForRecalculation: Boolean(column.props.sortSizeRecalculation)
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
});
|
|
142
|
-
_defineProperty(_assertThisInitialized(_this), "changeMaxNodeWidth", function(diff, exceptNode) {
|
|
143
|
-
var lastMaxWidth = 0;
|
|
144
|
-
var node = null;
|
|
145
|
-
var recalculatedNodes = [];
|
|
146
|
-
_this.defaultWidths.forEach(function(value, key) {
|
|
147
|
-
if (value.computedWidth > lastMaxWidth && key !== exceptNode) {
|
|
148
|
-
node = key;
|
|
149
|
-
lastMaxWidth = value.computedWidth;
|
|
150
|
-
}
|
|
151
|
-
if (value.useForRecalculation) {
|
|
152
|
-
recalculatedNodes.push(key);
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
var setNodeMinWidth = function setNodeMinWidth2(node2, diff2) {
|
|
156
|
-
var _this$defaultWidths$g, _this$defaultWidths$g2;
|
|
157
|
-
var defaultNodeWidth = (_this$defaultWidths$g = _this.defaultWidths.get(node2)) === null || _this$defaultWidths$g === void 0 ? void 0 : _this$defaultWidths$g.computedWidth;
|
|
158
|
-
var defaultNodeMinWidth = (_this$defaultWidths$g2 = _this.defaultWidths.get(node2)) === null || _this$defaultWidths$g2 === void 0 ? void 0 : _this$defaultWidths$g2.minWidth;
|
|
159
|
-
if (defaultNodeWidth) {
|
|
160
|
-
var maxWidth = defaultNodeWidth - diff2;
|
|
161
|
-
node2.style.setProperty("max-width", "".concat(maxWidth, "px"));
|
|
162
|
-
if (defaultNodeMinWidth) {
|
|
163
|
-
node2.style.setProperty("min-width", "min(".concat(maxWidth, "px, ").concat(defaultNodeMinWidth, "px)"));
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
if (recalculatedNodes.length > 0) {
|
|
168
|
-
var diffPart = diff / recalculatedNodes.length;
|
|
169
|
-
recalculatedNodes.forEach(function(node2) {
|
|
170
|
-
setNodeMinWidth(node2, diffPart);
|
|
171
|
-
});
|
|
172
|
-
} else if (node !== null) {
|
|
173
|
-
setNodeMinWidth(node, diff);
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
_defineProperty(_assertThisInitialized(_this), "backToColumnDefaults", function(node) {
|
|
177
|
-
var _this$defaultWidths$g3, _this$defaultWidths$g4;
|
|
178
|
-
var defaultNodeMinWidth = (_this$defaultWidths$g3 = _this.defaultWidths.get(node)) === null || _this$defaultWidths$g3 === void 0 ? void 0 : _this$defaultWidths$g3.minWidth;
|
|
179
|
-
var defaultNodeMaxWidth = (_this$defaultWidths$g4 = _this.defaultWidths.get(node)) === null || _this$defaultWidths$g4 === void 0 ? void 0 : _this$defaultWidths$g4.maxWidth;
|
|
180
|
-
node.style.setProperty("min-width", defaultNodeMinWidth + "px");
|
|
181
|
-
if (defaultNodeMaxWidth) {
|
|
182
|
-
node.style.setProperty("max-width", defaultNodeMaxWidth + "px");
|
|
183
|
-
} else {
|
|
184
|
-
node.style.removeProperty("max-width");
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
_defineProperty(_assertThisInitialized(_this), "calculateActiveColumnMinWidth", function(node) {
|
|
188
|
-
var _this$defaultWidths$g5, _this$defaultWidths$g6;
|
|
189
|
-
var clonedColumn = document.createElement("div");
|
|
190
|
-
var computedStyle = window.getComputedStyle(node);
|
|
191
|
-
node.childNodes.forEach(function(node2) {
|
|
192
|
-
if (!_this.sortWrapperRefs.get(node2)) {
|
|
193
|
-
clonedColumn.append(node2.cloneNode(true));
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
clonedColumn.style.setProperty("visibility", "hidden", "important");
|
|
197
|
-
var styles = ["display", "flex", "margin", "padding", "background", "font-style", "font-width", "font-size", "font-weight"];
|
|
198
|
-
styles.forEach(function(key) {
|
|
199
|
-
clonedColumn.style.setProperty(key, computedStyle.getPropertyValue(key), computedStyle.getPropertyPriority(key));
|
|
200
|
-
});
|
|
201
|
-
clonedColumn.style.setProperty("width", "fit-content", "important");
|
|
202
|
-
document.body.appendChild(clonedColumn);
|
|
203
|
-
var computedWidth = Math.ceil(clonedColumn.getBoundingClientRect().width);
|
|
204
|
-
document.body.removeChild(clonedColumn);
|
|
205
|
-
var defaultNodeWidth = (_this$defaultWidths$g5 = (_this$defaultWidths$g6 = _this.defaultWidths.get(node)) === null || _this$defaultWidths$g6 === void 0 ? void 0 : _this$defaultWidths$g6.computedWidth) !== null && _this$defaultWidths$g5 !== void 0 ? _this$defaultWidths$g5 : 0;
|
|
206
|
-
if (computedWidth >= defaultNodeWidth) {
|
|
207
|
-
node.style.setProperty("min-width", defaultNodeWidth + SORT_ICON_WIDTH + "px");
|
|
208
|
-
_this.changeMaxNodeWidth(SORT_ICON_WIDTH, node);
|
|
209
|
-
} else {
|
|
210
|
-
var freeSpace = defaultNodeWidth - computedWidth;
|
|
211
|
-
if (freeSpace < SORT_ICON_WIDTH) {
|
|
212
|
-
node.style.setProperty("min-width", computedWidth + SORT_ICON_WIDTH + "px");
|
|
213
|
-
_this.changeMaxNodeWidth(freeSpace, node);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
return _this;
|
|
218
|
-
}
|
|
219
|
-
_createClass(Head2, [{
|
|
220
|
-
key: "sortableColumnDescribeId",
|
|
221
|
-
value: function sortableColumnDescribeId() {
|
|
222
|
-
var uid = this.asProps.uid;
|
|
223
|
-
return "".concat(uid, "-column-sortable-describer");
|
|
224
|
-
}
|
|
225
|
-
}, {
|
|
226
|
-
key: "componentDidUpdate",
|
|
227
|
-
value: function componentDidUpdate() {
|
|
228
|
-
var _this2 = this;
|
|
229
|
-
var activeColumn = null;
|
|
230
|
-
this.columns.forEach(function(column) {
|
|
231
|
-
var _column$props = column.props, changeSortSize = _column$props.changeSortSize, ref = _column$props.ref;
|
|
232
|
-
if (column.active && changeSortSize && ref.current) {
|
|
233
|
-
activeColumn = ref.current;
|
|
234
|
-
}
|
|
235
|
-
if (ref.current) {
|
|
236
|
-
_this2.backToColumnDefaults(ref.current);
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
if (activeColumn) {
|
|
240
|
-
this.calculateActiveColumnMinWidth(activeColumn);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}, {
|
|
244
|
-
key: "renderColumns",
|
|
245
|
-
value: function renderColumns(columns, width) {
|
|
246
|
-
var _this3 = this;
|
|
247
|
-
return columns.map(function(column) {
|
|
248
|
-
return _this3.renderColumn(column, width);
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
}, {
|
|
252
|
-
key: "renderColumn",
|
|
253
|
-
value: function renderColumn(column, width) {
|
|
254
|
-
var _ref2, _column$columns;
|
|
255
|
-
var _this$asProps = this.asProps, styles = _this$asProps.styles, use = _this$asProps.use, hidden = _this$asProps.hidden, uid = _this$asProps.uid;
|
|
256
|
-
var SColumn = Flex;
|
|
257
|
-
var SHead = Box;
|
|
258
|
-
var SSortWrapper = "div";
|
|
259
|
-
var SSortIcon = SORTING_ICON[column.sortDirection];
|
|
260
|
-
var ariaSortValue = column.sortable && column.active ? ariaSort[column.sortDirection] : void 0;
|
|
261
|
-
var isGroup = ((_column$columns = column.columns) === null || _column$columns === void 0 ? void 0 : _column$columns.length) > 0;
|
|
262
|
-
var cSize = isGroup ? flattenColumns(column.columns).length : 1;
|
|
263
|
-
var _getFixedStyle = getFixedStyle(column, this.columns), _getFixedStyle2 = _slicedToArray(_getFixedStyle, 2), name = _getFixedStyle2[0], value = _getFixedStyle2[1];
|
|
264
|
-
var style = _objectSpread({
|
|
265
|
-
flexBasis: column.props.flex === void 0 && "".concat(width * cSize, "%")
|
|
266
|
-
}, column.props.style);
|
|
267
|
-
if (name !== void 0 && value !== void 0) {
|
|
268
|
-
style[name] = value;
|
|
269
|
-
}
|
|
270
|
-
if (!column.setVar) {
|
|
271
|
-
style["flexBasis"] = "var(".concat(column.varWidth, ")");
|
|
272
|
-
}
|
|
273
|
-
var ariaDescribedBy = [];
|
|
274
|
-
if (column.sortable && !column.active) {
|
|
275
|
-
ariaDescribedBy.push(this.sortableColumnDescribeId());
|
|
276
|
-
}
|
|
277
|
-
if (column.parentColumns.length > 0) {
|
|
278
|
-
var parentName = column.parentColumns[0].name;
|
|
279
|
-
ariaDescribedBy.push("igc-table-".concat(uid, "-").concat(parentName, "-group"));
|
|
280
|
-
}
|
|
281
|
-
var index = this.columns.findIndex(function(flattenCol) {
|
|
282
|
-
return flattenCol.name === column.name;
|
|
283
|
-
});
|
|
284
|
-
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SColumn, _ref2.cn("SColumn", _objectSpread(_objectSpread({
|
|
285
|
-
"role": isGroup ? void 0 : "columnheader",
|
|
286
|
-
"scope": isGroup ? "colgroup" : "col",
|
|
287
|
-
"key": column.name,
|
|
288
|
-
"id": "igc-table-".concat(uid, "-").concat(column.name),
|
|
289
|
-
"use": use,
|
|
290
|
-
"fixed": column.fixed,
|
|
291
|
-
"resizable": column.resizable,
|
|
292
|
-
"sortable": column.sortable,
|
|
293
|
-
"borderLeft": isGroup ? false : column.borderLeft,
|
|
294
|
-
"borderRight": isGroup ? false : column.borderRight,
|
|
295
|
-
"active": isGroup ? false : column.active,
|
|
296
|
-
"group": isGroup,
|
|
297
|
-
"tabIndex": isGroup ? void 0 : -1,
|
|
298
|
-
"__excludeProps": ["hidden"]
|
|
299
|
-
}, column.props), {}, {
|
|
300
|
-
"ref": this.makeColumnRefHandler(column, index),
|
|
301
|
-
"onClick": callAllEventHandlers(column.props.onClick, column.sortable ? this.bindHandlerSortClick(column.name) : void 0),
|
|
302
|
-
"onKeyDown": callAllEventHandlers(column.props.onKeyDown, column.sortable ? this.bindHandlerKeyDown(column.name) : void 0, this.handleKeyDown),
|
|
303
|
-
"style": style,
|
|
304
|
-
"hidden": hidden,
|
|
305
|
-
"aria-sort": ariaSortValue,
|
|
306
|
-
"aria-colindex": isGroup ? void 0 : index + 1,
|
|
307
|
-
"onFocus": this.onFocusCell,
|
|
308
|
-
"aria-describedby": ariaDescribedBy.length > 0 ? ariaDescribedBy.join(" ") : void 0,
|
|
309
|
-
"innerOutline": true
|
|
310
|
-
})), isGroup ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SColumn, _ref2.cn("SColumn", {
|
|
311
|
-
"id": "igc-table-".concat(uid, "-").concat(column.name, "-group"),
|
|
312
|
-
"groupHead": true,
|
|
313
|
-
"use": use,
|
|
314
|
-
"active": column.active,
|
|
315
|
-
"borderLeft": column.borderLeft,
|
|
316
|
-
"borderRight": column.borderRight
|
|
317
|
-
}), /* @__PURE__ */ React.createElement("div", _ref2.cn("div", {}), column.props.children)), /* @__PURE__ */ React.createElement(SHead, _ref2.cn("SHead", {}), this.renderColumns(column.columns, 100 / cSize))) : /* @__PURE__ */ React.createElement(React.Fragment, null, column.props.children, column.sortable ? /* @__PURE__ */ React.createElement(SSortWrapper, _ref2.cn("SSortWrapper", {
|
|
318
|
-
"ref": this.makeSortRefHandler(column.active)
|
|
319
|
-
}), /* @__PURE__ */ React.createElement(SSortIcon, _ref2.cn("SSortIcon", {}))) : null));
|
|
320
|
-
}
|
|
321
|
-
}, {
|
|
322
|
-
key: "render",
|
|
323
|
-
value: function render() {
|
|
324
|
-
var _ref = this.asProps, _ref3;
|
|
325
|
-
var SHead = Box;
|
|
326
|
-
var SHeadWrapper = Box;
|
|
327
|
-
var _this$asProps2 = this.asProps, Children = _this$asProps2.Children, styles = _this$asProps2.styles, columnsChildren = _this$asProps2.columnsChildren, onResize = _this$asProps2.onResize, $scrollRef = _this$asProps2.$scrollRef, sticky = _this$asProps2.sticky, withScrollBar = _this$asProps2.withScrollBar, animationsDisabled = _this$asProps2.animationsDisabled, getI18nText = _this$asProps2.getI18nText;
|
|
328
|
-
this.columns = flattenColumns(columnsChildren);
|
|
329
|
-
var _getScrollOffsetValue = getScrollOffsetValue(this.columns), _getScrollOffsetValue2 = _slicedToArray(_getScrollOffsetValue, 2), offsetLeftSum = _getScrollOffsetValue2[0], offsetRightSum = _getScrollOffsetValue2[1];
|
|
330
|
-
logger.warn(sticky, "'sticky' property is deprecated, use '<Sticky/>' wrapper", this.asProps["data-ui-name"] || Head2.displayName);
|
|
331
|
-
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(hideScrollBarsFromScreenReadersContext.Provider, {
|
|
332
|
-
value: true
|
|
333
|
-
}, /* @__PURE__ */ React.createElement(SHeadWrapper, _ref3.cn("SHeadWrapper", {
|
|
334
|
-
"sticky": sticky,
|
|
335
|
-
"animationsDisabled": animationsDisabled
|
|
336
|
-
}), /* @__PURE__ */ React.createElement(ScrollArea, _ref3.cn("ScrollArea", {
|
|
337
|
-
"leftOffset": offsetLeftSum,
|
|
338
|
-
"rightOffset": offsetRightSum,
|
|
339
|
-
"shadow": true,
|
|
340
|
-
"onResize": onResize
|
|
341
|
-
}), /* @__PURE__ */ React.createElement(ScrollArea.Container, {
|
|
342
|
-
ref: $scrollRef,
|
|
343
|
-
role: "rowgroup",
|
|
344
|
-
tabIndex: -1,
|
|
345
|
-
zIndex: 2
|
|
346
|
-
}, /* @__PURE__ */ React.createElement(SHead, _ref3.cn("SHead", _objectSpread({}, assignProps({
|
|
347
|
-
"role": "row",
|
|
348
|
-
"__excludeProps": ["hidden"]
|
|
349
|
-
}, _ref))), this.renderColumns(columnsChildren, 100 / this.columns.length))), Boolean(withScrollBar) && /* @__PURE__ */ React.createElement("div", _ref3.cn("div", {
|
|
350
|
-
"style": displayContents
|
|
351
|
-
}), /* @__PURE__ */ React.createElement("div", _ref3.cn("div", {
|
|
352
|
-
"style": displayContents
|
|
353
|
-
}), /* @__PURE__ */ React.createElement("div", _ref3.cn("div", {
|
|
354
|
-
"style": displayContents
|
|
355
|
-
}), /* @__PURE__ */ React.createElement(ScrollArea.Bar, {
|
|
356
|
-
orientation: "horizontal"
|
|
357
|
-
}))))), Children.origin, /* @__PURE__ */ React.createElement(ScreenReaderOnly, _ref3.cn("ScreenReaderOnly", {
|
|
358
|
-
"aria-hidden": true,
|
|
359
|
-
"id": this.sortableColumnDescribeId()
|
|
360
|
-
}), getI18nText === null || getI18nText === void 0 ? void 0 : getI18nText("sortableColumn"))));
|
|
361
|
-
}
|
|
362
|
-
}]);
|
|
363
|
-
return Head2;
|
|
364
|
-
}(Component);
|
|
365
|
-
_defineProperty(Head, "displayName", void 0);
|
|
366
|
-
export {
|
|
367
|
-
SORT_ICON_WIDTH,
|
|
368
|
-
Head as default
|
|
369
|
-
};
|
package/lib/types/Body.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Component } from '@semcore/core';
|
|
3
|
-
import { RowData, Column, NestedCells, PropsLayer, Cell } from './types';
|
|
4
|
-
import syncScroll from '@semcore/core/lib/utils/syncScroll';
|
|
5
|
-
type AsProps = {
|
|
6
|
-
rows: NestedCells[][];
|
|
7
|
-
columns: Column[];
|
|
8
|
-
$scrollRef: ReturnType<ReturnType<typeof syncScroll>>;
|
|
9
|
-
onResize: ResizeObserverCallback;
|
|
10
|
-
onScroll?: (event: React.SyntheticEvent<HTMLElement>) => void;
|
|
11
|
-
rowPropsLayers: PropsLayer[];
|
|
12
|
-
use: 'primary' | 'secondary';
|
|
13
|
-
uniqueKey: string;
|
|
14
|
-
virtualScroll?: boolean | {
|
|
15
|
-
tollerance?: number;
|
|
16
|
-
rowHeight?: number;
|
|
17
|
-
};
|
|
18
|
-
renderRows?: (props: {
|
|
19
|
-
rows: NestedCells[][];
|
|
20
|
-
columns: Column[];
|
|
21
|
-
renderRow: (row: Cell[], details: {
|
|
22
|
-
dataIndex: number;
|
|
23
|
-
nested: boolean;
|
|
24
|
-
}) => React.ReactNode;
|
|
25
|
-
}) => React.ReactNode;
|
|
26
|
-
disabledScroll?: boolean;
|
|
27
|
-
uid?: string;
|
|
28
|
-
animationsDisabled?: boolean;
|
|
29
|
-
scrollContainerRef: React.Ref<HTMLDivElement>;
|
|
30
|
-
};
|
|
31
|
-
type State = {
|
|
32
|
-
rowHeight: number | undefined;
|
|
33
|
-
scrollAreaHeight: undefined | number;
|
|
34
|
-
scrollOffset: number;
|
|
35
|
-
};
|
|
36
|
-
declare class Body extends Component<AsProps, {}, State> {
|
|
37
|
-
state: State;
|
|
38
|
-
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
39
|
-
firstRowRef: React.RefObject<HTMLDivElement>;
|
|
40
|
-
firstRowResizeObserver: ResizeObserver | null;
|
|
41
|
-
lockedCell: [HTMLElement | null, boolean];
|
|
42
|
-
getRowHeight: () => number | undefined;
|
|
43
|
-
handleKeyDown: (e: React.KeyboardEvent) => void;
|
|
44
|
-
onFocusCell: (e: React.FocusEvent<HTMLElement, HTMLElement>) => void;
|
|
45
|
-
renderCells(cells: NestedCells, rowData: RowData, dataIndex: number): React.ReactNode[];
|
|
46
|
-
renderRow(cells: NestedCells, { dataIndex, topOffset, nested, }: {
|
|
47
|
-
dataIndex: number;
|
|
48
|
-
topOffset?: number;
|
|
49
|
-
nested: boolean;
|
|
50
|
-
}): React.ReactNode;
|
|
51
|
-
renderRows(rows: NestedCells[], nested?: boolean): React.ReactNode[];
|
|
52
|
-
renderVirtualizedRows(rows: NestedCells[]): React.ReactNode[];
|
|
53
|
-
handleFirstRowResize: (entries: ResizeObserverEntry[]) => void;
|
|
54
|
-
handleScrollAreaResize: (entries: ResizeObserverEntry[]) => void;
|
|
55
|
-
handleScrollAreaScroll: (event: React.SyntheticEvent<HTMLElement>) => void;
|
|
56
|
-
setupRowSizeObserver: () => void;
|
|
57
|
-
handleBodyTransitionEnd: () => void;
|
|
58
|
-
componentWillUnmount(): void;
|
|
59
|
-
render(): JSX.Element;
|
|
60
|
-
}
|
|
61
|
-
export default Body;
|
package/lib/types/DataTable.d.ts
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Property } from 'csstype';
|
|
3
|
-
import { Component, PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';
|
|
4
|
-
import { BoxProps, FlexProps } from '@semcore/flex-box';
|
|
5
|
-
import type { Column } from './types';
|
|
6
|
-
declare const ROW_GROUP: unique symbol;
|
|
7
|
-
export type DataTableData = {
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
};
|
|
10
|
-
export type DataTableSort<Column = string> = [sortBy: Column, sortDirection: 'desc' | 'asc'];
|
|
11
|
-
export type DataTableTheme = 'muted' | 'info' | 'success' | 'warning' | 'danger';
|
|
12
|
-
export type DataTableUse = 'primary' | 'secondary';
|
|
13
|
-
export type DataTableRow = DataTableCell[];
|
|
14
|
-
export type DataTableCell = {
|
|
15
|
-
/** Name of column */
|
|
16
|
-
name: string;
|
|
17
|
-
/** Data of column */
|
|
18
|
-
data: React.ReactNode;
|
|
19
|
-
[key: string]: unknown;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Datatable must have an accessible name (aria-table-name).
|
|
23
|
-
* It should describe table content.
|
|
24
|
-
*/
|
|
25
|
-
type DataTableAriaProps = Intergalactic.RequireAtLeastOne<{
|
|
26
|
-
'aria-label'?: string;
|
|
27
|
-
'aria-labelledby'?: string;
|
|
28
|
-
title?: string;
|
|
29
|
-
}>;
|
|
30
|
-
/** @deprecated */
|
|
31
|
-
export interface IDataTableProps<DataTableData extends {
|
|
32
|
-
[key: string]: any;
|
|
33
|
-
}[] = UnknownProperties[]> extends Omit<DataTableProps<DataTableData>, keyof DataTableAriaProps> {
|
|
34
|
-
}
|
|
35
|
-
export type DataTableProps<DataTableData extends {
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
}[] = UnknownProperties[]> = BoxProps & {
|
|
38
|
-
/** Table theme according to visual hierarchy on the page
|
|
39
|
-
* @default primary
|
|
40
|
-
* */
|
|
41
|
-
use?: DataTableUse;
|
|
42
|
-
/** Data for table */
|
|
43
|
-
data?: DataTableData;
|
|
44
|
-
/** Active sort object */
|
|
45
|
-
sort?: DataTableSort<keyof DataTableData[0]>;
|
|
46
|
-
/** Handler call when request will change sort */
|
|
47
|
-
onSortChange?: (sort: DataTableSort<keyof DataTableData[0]>, e?: React.SyntheticEvent) => void;
|
|
48
|
-
/** Field name in one data entity that is unique accross all dataset
|
|
49
|
-
* @default id
|
|
50
|
-
*/
|
|
51
|
-
uniqueKey?: keyof DataTableData[0];
|
|
52
|
-
/** Make cells compact by changing left and right paddings to smaller ones*/
|
|
53
|
-
compact?: boolean;
|
|
54
|
-
/** Count of total rows if table using virtual scroll. Needs for accessibility */
|
|
55
|
-
totalRows?: number;
|
|
56
|
-
} & DataTableAriaProps;
|
|
57
|
-
/** @deprecated */
|
|
58
|
-
export interface IDataTableHeadProps extends DataTableHeadProps, UnknownProperties {
|
|
59
|
-
}
|
|
60
|
-
export type DataTableHeadProps = BoxProps & {
|
|
61
|
-
/** Sticky table header
|
|
62
|
-
* @deprecated
|
|
63
|
-
* */
|
|
64
|
-
sticky?: boolean;
|
|
65
|
-
/** Hidden header */
|
|
66
|
-
hidden?: boolean;
|
|
67
|
-
/** Disabled scroll (as action) */
|
|
68
|
-
disabledScroll?: boolean;
|
|
69
|
-
/** Enable scroll bar element in header */
|
|
70
|
-
withScrollBar?: boolean;
|
|
71
|
-
/** Disables column width change animation **/
|
|
72
|
-
animationsDisabled?: boolean;
|
|
73
|
-
};
|
|
74
|
-
/** @deprecated */
|
|
75
|
-
export interface IDataTableColumnProps extends DataTableColumnProps, UnknownProperties {
|
|
76
|
-
}
|
|
77
|
-
export type DataTableColumnProps = FlexProps & {
|
|
78
|
-
/** Unique column name */
|
|
79
|
-
name?: string;
|
|
80
|
-
/** Enable sorting for column. And if you are passing a string, you can also set the default sorting */
|
|
81
|
-
sortable?: boolean | 'desc' | 'asc';
|
|
82
|
-
/** Enable resize for column
|
|
83
|
-
* @ignore */
|
|
84
|
-
resizable?: boolean;
|
|
85
|
-
/** Fix column on the left o right side of the table */
|
|
86
|
-
fixed?: 'left' | 'right';
|
|
87
|
-
/** Fields to control the size of the column */
|
|
88
|
-
flex?: Property.Flex | 'inherit';
|
|
89
|
-
/** Add vertical border to the column */
|
|
90
|
-
vBorders?: boolean;
|
|
91
|
-
/** Add vertical border to the right side of the cell */
|
|
92
|
-
borderRight?: boolean;
|
|
93
|
-
/** Add vertical border to the left side of the cell */
|
|
94
|
-
borderLeft?: boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Enable changing column width with sort icon
|
|
97
|
-
* @default false
|
|
98
|
-
*/
|
|
99
|
-
changeSortSize?: boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Enable column to use as a column for recalculation width
|
|
102
|
-
* @default false (By default used first column with maximum width)
|
|
103
|
-
*/
|
|
104
|
-
sortSizeRecalculation?: boolean;
|
|
105
|
-
};
|
|
106
|
-
/** @deprecated */
|
|
107
|
-
export interface IDataTableBodyProps extends DataTableBodyProps, UnknownProperties {
|
|
108
|
-
}
|
|
109
|
-
export type DataTableBodyProps = BoxProps & {
|
|
110
|
-
/** Rows table */
|
|
111
|
-
rows?: DataTableRow[];
|
|
112
|
-
/** When enabled, only visually acessable rows are rendered.
|
|
113
|
-
* `tollerance` property controls how many rows outside of viewport are render.
|
|
114
|
-
* `rowHeight` fixes the rows height if it has known. If not provided, first row node height is measured.
|
|
115
|
-
* @default { tollerance: 2 }
|
|
116
|
-
*/
|
|
117
|
-
virtualScroll?: boolean | {
|
|
118
|
-
tollerance?: number;
|
|
119
|
-
rowHeight?: number;
|
|
120
|
-
};
|
|
121
|
-
/** Allows to redefine rows renderning for a very deep and even fragile customization like building custom virtual scrolling */
|
|
122
|
-
renderRows?: (props: {
|
|
123
|
-
rows: DataTableRow[];
|
|
124
|
-
columns: Column[];
|
|
125
|
-
renderRow: (row: DataTableRow, details: {
|
|
126
|
-
dataIndex: number;
|
|
127
|
-
}) => React.ReactNode;
|
|
128
|
-
}) => React.ReactNode;
|
|
129
|
-
/**
|
|
130
|
-
* Called every time user scrolls area
|
|
131
|
-
*/
|
|
132
|
-
onScroll?: (event: React.SyntheticEvent<HTMLElement>) => void;
|
|
133
|
-
/** Disabled scroll */
|
|
134
|
-
disabledScroll?: boolean;
|
|
135
|
-
/** Disables column width change animation **/
|
|
136
|
-
animationsDisabled?: boolean;
|
|
137
|
-
/** Ref for table body container */
|
|
138
|
-
scrollContainerRef?: React.Ref<HTMLDivElement>;
|
|
139
|
-
};
|
|
140
|
-
/** @deprecated */
|
|
141
|
-
export interface IDataTableRowProps extends DataTableRowProps, UnknownProperties {
|
|
142
|
-
}
|
|
143
|
-
export type DataTableRowProps = BoxProps & {
|
|
144
|
-
/** Theme for row */
|
|
145
|
-
theme?: DataTableTheme;
|
|
146
|
-
/** Sets row state to active*/
|
|
147
|
-
active?: boolean;
|
|
148
|
-
};
|
|
149
|
-
/** @deprecated */
|
|
150
|
-
export interface IDataTableCellProps extends DataTableCellProps, UnknownProperties {
|
|
151
|
-
}
|
|
152
|
-
export type DataTableCellProps<Name extends string = string> = FlexProps & {
|
|
153
|
-
/** Unique name for column or columns separated by / */
|
|
154
|
-
name: Name;
|
|
155
|
-
/** Theme for cell */
|
|
156
|
-
theme?: DataTableTheme;
|
|
157
|
-
};
|
|
158
|
-
type DataTableCtx = {
|
|
159
|
-
getHeadProps: PropGetterFn;
|
|
160
|
-
getBodyProps: PropGetterFn;
|
|
161
|
-
};
|
|
162
|
-
type IntergalacticDataTableComponent<PropsExtending extends {} = {}> = (<Data extends DataTableData[], Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', DataTableProps<Data> & PropsExtending, DataTableCtx, never>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', DataTableProps>;
|
|
163
|
-
type IntergalacticDataTableRowComponent<PropsExtending extends {} = {}> = (<Data extends DataTableData[], Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<Tag, DataTableRowProps & {
|
|
164
|
-
/**
|
|
165
|
-
* That property is ONLY used for the component strict typings. In the component runtime `data` prop set on `<DataTable>...</DataTable> is used.
|
|
166
|
-
*/
|
|
167
|
-
data?: Data;
|
|
168
|
-
} & PropsExtending, DataTableCtx & {
|
|
169
|
-
data: Data;
|
|
170
|
-
}, [
|
|
171
|
-
row: Data[0],
|
|
172
|
-
index: number
|
|
173
|
-
]>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', DataTableRowProps>;
|
|
174
|
-
type IntergalacticDataTableCellComponent<PropsExtending extends {} = {}> = (<Data extends DataTableData[] = [], Name extends string = string, Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<Tag, DataTableCellProps<Name> & {
|
|
175
|
-
/**
|
|
176
|
-
* That property is ONLY used for the componenct strict typings. In the component runtime `data` prop set on `<DataTable>...</DataTable> is used.
|
|
177
|
-
*/
|
|
178
|
-
data?: Data;
|
|
179
|
-
} & PropsExtending, DataTableCtx & {
|
|
180
|
-
data: Data;
|
|
181
|
-
}, [
|
|
182
|
-
row: Data[0],
|
|
183
|
-
index: number
|
|
184
|
-
]>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', DataTableCellProps>;
|
|
185
|
-
declare const DefinitionTable: (<Data extends DataTableData[], Tag extends Intergalactic.InternalTypings.ComponentTag = "div">(props: Intergalactic.InternalTypings.ComponentProps<Tag, "div", DataTableProps<Data> & {}, DataTableCtx, never>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<"div", "div", DataTableProps<UnknownProperties[]>, {}, {}> & {
|
|
186
|
-
Head: Intergalactic.Component<'div', DataTableHeadProps>;
|
|
187
|
-
Body: Intergalactic.Component<'div', DataTableBodyProps>;
|
|
188
|
-
Column: Intergalactic.Component<'div', DataTableColumnProps>;
|
|
189
|
-
Row: IntergalacticDataTableRowComponent;
|
|
190
|
-
Cell: IntergalacticDataTableCellComponent;
|
|
191
|
-
};
|
|
192
|
-
export { ROW_GROUP };
|
|
193
|
-
export default DefinitionTable;
|
|
194
|
-
export declare const wrapDataTable: <PropsExtending extends {}>(wrapper: (props: Intergalactic.InternalTypings.EfficientOmit<Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticDataTableComponent<{}>>, "tag" | "ref"> & {
|
|
195
|
-
ref: React.Ref<any>;
|
|
196
|
-
tag: Intergalactic.InternalTypings.ComponentTag;
|
|
197
|
-
} & PropsExtending) => React.ReactNode) => IntergalacticDataTableComponent<PropsExtending>;
|
|
198
|
-
export declare const wrapDataTableRow: <PropsExtending extends {}>(wrapper: (props: Intergalactic.InternalTypings.EfficientOmit<Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticDataTableRowComponent<{}>>, "tag" | "ref"> & {
|
|
199
|
-
ref: React.Ref<any>;
|
|
200
|
-
tag: Intergalactic.InternalTypings.ComponentTag;
|
|
201
|
-
} & PropsExtending) => React.ReactNode) => IntergalacticDataTableRowComponent<PropsExtending>;
|
|
202
|
-
export declare const wrapDataTableCell: <PropsExtending extends {}>(wrapper: (props: Intergalactic.InternalTypings.EfficientOmit<Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticDataTableCellComponent<{}>>, "tag" | "ref"> & {
|
|
203
|
-
ref: React.Ref<any>;
|
|
204
|
-
tag: Intergalactic.InternalTypings.ComponentTag;
|
|
205
|
-
} & PropsExtending) => React.ReactNode) => IntergalacticDataTableCellComponent<PropsExtending>;
|