@semcore/data-table 4.51.0-prerelease.5 → 4.51.0-prerelease.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/lib/cjs/Body.js +477 -0
- package/lib/cjs/Body.js.map +1 -0
- package/lib/cjs/DataTable.js +629 -0
- package/lib/cjs/DataTable.js.map +1 -0
- package/lib/cjs/Head.js +398 -0
- package/lib/cjs/Head.js.map +1 -0
- package/lib/cjs/index.js +15 -38
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/data-table.shadow.css +413 -0
- package/lib/cjs/style/scroll-shadows.shadow.css +5 -50
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +5 -4
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/translations/de.json +1 -6
- package/lib/cjs/translations/en.json +1 -6
- package/lib/cjs/translations/es.json +1 -6
- package/lib/cjs/translations/fr.json +1 -6
- package/lib/cjs/translations/it.json +1 -6
- package/lib/cjs/translations/ja.json +1 -6
- package/lib/cjs/translations/ko.json +1 -6
- package/lib/cjs/translations/nl.json +1 -6
- package/lib/cjs/translations/pl.json +1 -6
- package/lib/cjs/translations/pt.json +1 -6
- package/lib/cjs/translations/sv.json +1 -6
- package/lib/cjs/translations/tr.json +1 -6
- package/lib/cjs/translations/vi.json +1 -6
- package/lib/cjs/translations/zh.json +1 -6
- package/lib/cjs/types.js +4 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/cjs/utils.js +57 -0
- package/lib/cjs/utils.js.map +1 -0
- package/lib/es6/Body.js +469 -0
- package/lib/es6/Body.js.map +1 -0
- package/lib/es6/DataTable.js +619 -0
- package/lib/es6/DataTable.js.map +1 -0
- package/lib/es6/Head.js +390 -0
- package/lib/es6/Head.js.map +1 -0
- package/lib/es6/index.js +2 -7
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/data-table.shadow.css +413 -0
- package/lib/es6/style/scroll-shadows.shadow.css +5 -50
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/translations/de.json +1 -6
- package/lib/es6/translations/en.json +1 -6
- package/lib/es6/translations/es.json +1 -6
- package/lib/es6/translations/fr.json +1 -6
- package/lib/es6/translations/it.json +1 -6
- package/lib/es6/translations/ja.json +1 -6
- package/lib/es6/translations/ko.json +1 -6
- package/lib/es6/translations/nl.json +1 -6
- package/lib/es6/translations/pl.json +1 -6
- package/lib/es6/translations/pt.json +1 -6
- package/lib/es6/translations/sv.json +1 -6
- package/lib/es6/translations/tr.json +1 -6
- package/lib/es6/translations/vi.json +1 -6
- package/lib/es6/translations/zh.json +1 -6
- package/lib/es6/types.js +2 -0
- package/lib/es6/types.js.map +1 -0
- package/lib/es6/utils.js +48 -0
- package/lib/es6/utils.js.map +1 -0
- package/lib/esm/Body.mjs +430 -0
- package/lib/esm/DataTable.mjs +589 -0
- package/lib/esm/Head.mjs +368 -0
- package/lib/esm/index.mjs +5 -12
- package/lib/esm/style/data-table.shadow.css +413 -0
- package/lib/esm/style/scroll-shadows.shadow.css +5 -50
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/translations/de.json.mjs +1 -6
- package/lib/esm/translations/en.json.mjs +1 -6
- package/lib/esm/translations/es.json.mjs +1 -6
- package/lib/esm/translations/fr.json.mjs +1 -6
- package/lib/esm/translations/it.json.mjs +1 -6
- package/lib/esm/translations/ja.json.mjs +1 -6
- package/lib/esm/translations/ko.json.mjs +1 -6
- package/lib/esm/translations/nl.json.mjs +1 -6
- package/lib/esm/translations/pl.json.mjs +1 -6
- package/lib/esm/translations/pt.json.mjs +1 -6
- package/lib/esm/translations/sv.json.mjs +1 -6
- package/lib/esm/translations/tr.json.mjs +1 -6
- package/lib/esm/translations/vi.json.mjs +1 -6
- package/lib/esm/translations/zh.json.mjs +1 -6
- package/lib/esm/utils.mjs +52 -0
- package/lib/types/Body.d.ts +61 -0
- package/lib/types/DataTable.d.ts +205 -0
- package/lib/types/Head.d.ts +45 -0
- package/lib/types/index.d.ts +2 -10
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +0 -70
- package/lib/types/types.d.ts +73 -0
- package/lib/types/utils.d.ts +4 -0
- package/package.json +6 -6
- package/lib/cjs/components/AccordionRows/AccordionRows.js +0 -177
- package/lib/cjs/components/AccordionRows/AccordionRows.js.map +0 -1
- package/lib/cjs/components/Body/Body.js +0 -445
- package/lib/cjs/components/Body/Body.js.map +0 -1
- package/lib/cjs/components/Body/Body.types.js +0 -2
- package/lib/cjs/components/Body/Body.types.js.map +0 -1
- package/lib/cjs/components/Body/Cell.js +0 -205
- package/lib/cjs/components/Body/Cell.js.map +0 -1
- package/lib/cjs/components/Body/Cell.types.js +0 -2
- package/lib/cjs/components/Body/Cell.types.js.map +0 -1
- package/lib/cjs/components/Body/LimitOverlay.js +0 -191
- package/lib/cjs/components/Body/LimitOverlay.js.map +0 -1
- package/lib/cjs/components/Body/MergedCells.js +0 -31
- package/lib/cjs/components/Body/MergedCells.js.map +0 -1
- package/lib/cjs/components/Body/Row.js +0 -630
- package/lib/cjs/components/Body/Row.js.map +0 -1
- package/lib/cjs/components/Body/Row.types.js +0 -2
- package/lib/cjs/components/Body/Row.types.js.map +0 -1
- package/lib/cjs/components/Body/RowGroup.js +0 -118
- package/lib/cjs/components/Body/RowGroup.js.map +0 -1
- package/lib/cjs/components/Body/style.shadow.css +0 -367
- package/lib/cjs/components/DataTable/DataTable.js +0 -1303
- package/lib/cjs/components/DataTable/DataTable.js.map +0 -1
- package/lib/cjs/components/DataTable/DataTable.types.js +0 -2
- package/lib/cjs/components/DataTable/DataTable.types.js.map +0 -1
- package/lib/cjs/components/DataTable/ScrollBars.js +0 -63
- package/lib/cjs/components/DataTable/ScrollBars.js.map +0 -1
- package/lib/cjs/components/DataTable/dataTable.shadow.css +0 -43
- package/lib/cjs/components/Head/Column.js +0 -350
- package/lib/cjs/components/Head/Column.js.map +0 -1
- package/lib/cjs/components/Head/Column.types.js +0 -2
- package/lib/cjs/components/Head/Column.types.js.map +0 -1
- package/lib/cjs/components/Head/Group.js +0 -116
- package/lib/cjs/components/Head/Group.js.map +0 -1
- package/lib/cjs/components/Head/Group.type.js +0 -2
- package/lib/cjs/components/Head/Group.type.js.map +0 -1
- package/lib/cjs/components/Head/Head.js +0 -350
- package/lib/cjs/components/Head/Head.js.map +0 -1
- package/lib/cjs/components/Head/Head.types.js +0 -2
- package/lib/cjs/components/Head/Head.types.js.map +0 -1
- package/lib/cjs/components/Head/style.shadow.css +0 -292
- package/lib/cjs/components/RowSelector/RowsSelector.js +0 -132
- package/lib/cjs/components/RowSelector/RowsSelector.js.map +0 -1
- package/lib/cjs/components/RowSelector/SRAnnouncer.js +0 -62
- package/lib/cjs/components/RowSelector/SRAnnouncer.js.map +0 -1
- package/lib/cjs/components/RowSelector/SRReactiveAnnouncer.js +0 -39
- package/lib/cjs/components/RowSelector/SRReactiveAnnouncer.js.map +0 -1
- package/lib/cjs/enhancers/focusableCell.js +0 -76
- package/lib/cjs/enhancers/focusableCell.js.map +0 -1
- package/lib/cjs/store/SelectableRows.js +0 -211
- package/lib/cjs/store/SelectableRows.js.map +0 -1
- package/lib/es6/components/AccordionRows/AccordionRows.js +0 -171
- package/lib/es6/components/AccordionRows/AccordionRows.js.map +0 -1
- package/lib/es6/components/Body/Body.js +0 -439
- package/lib/es6/components/Body/Body.js.map +0 -1
- package/lib/es6/components/Body/Body.types.js +0 -2
- package/lib/es6/components/Body/Body.types.js.map +0 -1
- package/lib/es6/components/Body/Cell.js +0 -199
- package/lib/es6/components/Body/Cell.js.map +0 -1
- package/lib/es6/components/Body/Cell.types.js +0 -2
- package/lib/es6/components/Body/Cell.types.js.map +0 -1
- package/lib/es6/components/Body/LimitOverlay.js +0 -184
- package/lib/es6/components/Body/LimitOverlay.js.map +0 -1
- package/lib/es6/components/Body/MergedCells.js +0 -24
- package/lib/es6/components/Body/MergedCells.js.map +0 -1
- package/lib/es6/components/Body/Row.js +0 -624
- package/lib/es6/components/Body/Row.js.map +0 -1
- package/lib/es6/components/Body/Row.types.js +0 -2
- package/lib/es6/components/Body/Row.types.js.map +0 -1
- package/lib/es6/components/Body/RowGroup.js +0 -111
- package/lib/es6/components/Body/RowGroup.js.map +0 -1
- package/lib/es6/components/Body/style.shadow.css +0 -367
- package/lib/es6/components/DataTable/DataTable.js +0 -1298
- package/lib/es6/components/DataTable/DataTable.js.map +0 -1
- package/lib/es6/components/DataTable/DataTable.types.js +0 -2
- package/lib/es6/components/DataTable/DataTable.types.js.map +0 -1
- package/lib/es6/components/DataTable/ScrollBars.js +0 -57
- package/lib/es6/components/DataTable/ScrollBars.js.map +0 -1
- package/lib/es6/components/DataTable/dataTable.shadow.css +0 -43
- package/lib/es6/components/Head/Column.js +0 -344
- package/lib/es6/components/Head/Column.js.map +0 -1
- package/lib/es6/components/Head/Column.types.js +0 -2
- package/lib/es6/components/Head/Column.types.js.map +0 -1
- package/lib/es6/components/Head/Group.js +0 -111
- package/lib/es6/components/Head/Group.js.map +0 -1
- package/lib/es6/components/Head/Group.type.js +0 -2
- package/lib/es6/components/Head/Group.type.js.map +0 -1
- package/lib/es6/components/Head/Head.js +0 -345
- package/lib/es6/components/Head/Head.js.map +0 -1
- package/lib/es6/components/Head/Head.types.js +0 -2
- package/lib/es6/components/Head/Head.types.js.map +0 -1
- package/lib/es6/components/Head/style.shadow.css +0 -292
- package/lib/es6/components/RowSelector/RowsSelector.js +0 -125
- package/lib/es6/components/RowSelector/RowsSelector.js.map +0 -1
- package/lib/es6/components/RowSelector/SRAnnouncer.js +0 -55
- package/lib/es6/components/RowSelector/SRAnnouncer.js.map +0 -1
- package/lib/es6/components/RowSelector/SRReactiveAnnouncer.js +0 -32
- package/lib/es6/components/RowSelector/SRReactiveAnnouncer.js.map +0 -1
- package/lib/es6/enhancers/focusableCell.js +0 -69
- package/lib/es6/enhancers/focusableCell.js.map +0 -1
- package/lib/es6/store/SelectableRows.js +0 -204
- package/lib/es6/store/SelectableRows.js.map +0 -1
- package/lib/esm/components/AccordionRows/AccordionRows.mjs +0 -155
- package/lib/esm/components/Body/Body.mjs +0 -395
- package/lib/esm/components/Body/Cell.mjs +0 -192
- package/lib/esm/components/Body/LimitOverlay.mjs +0 -179
- package/lib/esm/components/Body/MergedCells.mjs +0 -27
- package/lib/esm/components/Body/Row.mjs +0 -556
- package/lib/esm/components/Body/RowGroup.mjs +0 -113
- package/lib/esm/components/Body/style.shadow.css +0 -367
- package/lib/esm/components/DataTable/DataTable.mjs +0 -1216
- package/lib/esm/components/DataTable/ScrollBars.mjs +0 -61
- package/lib/esm/components/DataTable/dataTable.shadow.css +0 -43
- package/lib/esm/components/Head/Column.mjs +0 -321
- package/lib/esm/components/Head/Group.mjs +0 -111
- package/lib/esm/components/Head/Head.mjs +0 -307
- package/lib/esm/components/Head/style.shadow.css +0 -292
- package/lib/esm/components/RowSelector/RowsSelector.mjs +0 -105
- package/lib/esm/components/RowSelector/SRAnnouncer.mjs +0 -51
- package/lib/esm/components/RowSelector/SRReactiveAnnouncer.mjs +0 -31
- package/lib/esm/enhancers/focusableCell.mjs +0 -72
- package/lib/esm/store/SelectableRows.mjs +0 -201
- package/lib/types/components/AccordionRows/AccordionRows.d.ts +0 -41
- package/lib/types/components/Body/Body.d.ts +0 -6
- package/lib/types/components/Body/Body.types.d.ts +0 -87
- package/lib/types/components/Body/Cell.d.ts +0 -1
- package/lib/types/components/Body/Cell.types.d.ts +0 -36
- package/lib/types/components/Body/LimitOverlay.d.ts +0 -17
- package/lib/types/components/Body/MergedCells.d.ts +0 -17
- package/lib/types/components/Body/Row.d.ts +0 -47
- package/lib/types/components/Body/Row.types.d.ts +0 -74
- package/lib/types/components/Body/RowGroup.d.ts +0 -19
- package/lib/types/components/DataTable/DataTable.d.ts +0 -14
- package/lib/types/components/DataTable/DataTable.types.d.ts +0 -202
- package/lib/types/components/DataTable/ScrollBars.d.ts +0 -11
- package/lib/types/components/Head/Column.d.ts +0 -39
- package/lib/types/components/Head/Column.types.d.ts +0 -85
- package/lib/types/components/Head/Group.d.ts +0 -15
- package/lib/types/components/Head/Group.type.d.ts +0 -18
- package/lib/types/components/Head/Head.d.ts +0 -9
- package/lib/types/components/Head/Head.types.d.ts +0 -58
- package/lib/types/components/RowSelector/RowsSelector.d.ts +0 -32
- package/lib/types/components/RowSelector/SRAnnouncer.d.ts +0 -10
- package/lib/types/components/RowSelector/SRReactiveAnnouncer.d.ts +0 -8
- package/lib/types/enhancers/focusableCell.d.ts +0 -9
- package/lib/types/store/SelectableRows.d.ts +0 -60
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
|
-
import Checkbox from "@semcore/checkbox";
|
|
7
|
-
import React__default from "react";
|
|
8
|
-
import { SelectableRows } from "../../store/SelectableRows.mjs";
|
|
9
|
-
import { Row } from "../Body/Row.mjs";
|
|
10
|
-
import { UNIQ_ROW_KEY, SELECT_ALL } from "../DataTable/DataTable.mjs";
|
|
11
|
-
var RowSelector = /* @__PURE__ */ (function(_React$PureComponent) {
|
|
12
|
-
function RowSelector2(props) {
|
|
13
|
-
var _this;
|
|
14
|
-
_classCallCheck(this, RowSelector2);
|
|
15
|
-
_this = _callSuper(this, RowSelector2, [props]);
|
|
16
|
-
_defineProperty(_this, "state", {
|
|
17
|
-
checked: false
|
|
18
|
-
});
|
|
19
|
-
_defineProperty(_this, "unsubscribeToggle", void 0);
|
|
20
|
-
_defineProperty(_this, "handleSelectRow", function(value, event) {
|
|
21
|
-
var _this$props = _this.props, row = _this$props.row, rowIndex = _this$props.rowIndex, onSelectRow = _this$props.onSelectRow, selectedRows = _this$props.selectedRows;
|
|
22
|
-
onSelectRow === null || onSelectRow === void 0 || onSelectRow(value, rowIndex, row, event);
|
|
23
|
-
if (selectedRows && !Array.isArray(selectedRows)) {
|
|
24
|
-
selectedRows.toggle(value, row);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
_defineProperty(_this, "handleClickCheckbox", function(value) {
|
|
28
|
-
return function(event) {
|
|
29
|
-
event === null || event === void 0 || event.preventDefault();
|
|
30
|
-
event === null || event === void 0 || event.stopPropagation();
|
|
31
|
-
var _this$props2 = _this.props, row = _this$props2.row, rowIndex = _this$props2.rowIndex, onSelectRow = _this$props2.onSelectRow, selectedRows = _this$props2.selectedRows;
|
|
32
|
-
onSelectRow === null || onSelectRow === void 0 || onSelectRow(value, rowIndex, row, event);
|
|
33
|
-
if (selectedRows && !Array.isArray(selectedRows)) {
|
|
34
|
-
selectedRows.toggle(value, row);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
var _row = props.row, _selectedRows = props.selectedRows;
|
|
39
|
-
if (_selectedRows && !Array.isArray(_selectedRows)) {
|
|
40
|
-
_this.state.checked = _selectedRows.has(_row[UNIQ_ROW_KEY]);
|
|
41
|
-
}
|
|
42
|
-
return _this;
|
|
43
|
-
}
|
|
44
|
-
_inherits(RowSelector2, _React$PureComponent);
|
|
45
|
-
return _createClass(RowSelector2, [{
|
|
46
|
-
key: "componentDidMount",
|
|
47
|
-
value: function componentDidMount() {
|
|
48
|
-
var _this2 = this;
|
|
49
|
-
var _this$props3 = this.props, row = _this$props3.row, selectedRows = _this$props3.selectedRows;
|
|
50
|
-
if (selectedRows && !Array.isArray(selectedRows)) {
|
|
51
|
-
this.unsubscribeToggle = selectedRows.on(SelectableRows.TOGGLE_EVENT, function(key) {
|
|
52
|
-
if (row[UNIQ_ROW_KEY] === key) {
|
|
53
|
-
_this2.setState({
|
|
54
|
-
checked: selectedRows.has(row[UNIQ_ROW_KEY])
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "componentWillUnmount",
|
|
62
|
-
value: function componentWillUnmount() {
|
|
63
|
-
var _this$unsubscribeTogg;
|
|
64
|
-
(_this$unsubscribeTogg = this.unsubscribeToggle) === null || _this$unsubscribeTogg === void 0 || _this$unsubscribeTogg.call(this);
|
|
65
|
-
}
|
|
66
|
-
}, {
|
|
67
|
-
key: "render",
|
|
68
|
-
value: function render() {
|
|
69
|
-
var SCheckboxCell = Row.Cell;
|
|
70
|
-
var _this$props4 = this.props, row = _this$props4.row, rowIndex = _this$props4.rowIndex, gridRowIndex = _this$props4.gridRowIndex, expanded = _this$props4.expanded, withAccordion = _this$props4.withAccordion, isAccordionRow = _this$props4.isAccordionRow, isCellHidden = _this$props4.isCellHidden, theme = _this$props4.theme, uid = _this$props4.uid, selectedRows = _this$props4.selectedRows, fixed = _this$props4.fixed;
|
|
71
|
-
var rowUniqKey = row[UNIQ_ROW_KEY];
|
|
72
|
-
var checked = Array.isArray(selectedRows) ? selectedRows.includes(rowUniqKey) : this.state.checked;
|
|
73
|
-
var style = {};
|
|
74
|
-
if (fixed) {
|
|
75
|
-
style.left = 0;
|
|
76
|
-
}
|
|
77
|
-
return /* @__PURE__ */ React__default.createElement(SCheckboxCell, {
|
|
78
|
-
row,
|
|
79
|
-
rowIndex,
|
|
80
|
-
column: {
|
|
81
|
-
name: SELECT_ALL,
|
|
82
|
-
fixed
|
|
83
|
-
},
|
|
84
|
-
columnIndex: 0,
|
|
85
|
-
gridRowIndex,
|
|
86
|
-
onClick: this.handleClickCheckbox(!checked),
|
|
87
|
-
expanded,
|
|
88
|
-
isAccordionRow,
|
|
89
|
-
"aria-hidden": isCellHidden,
|
|
90
|
-
withAccordion,
|
|
91
|
-
theme,
|
|
92
|
-
"data-row-selector": true,
|
|
93
|
-
fixed,
|
|
94
|
-
style
|
|
95
|
-
}, /* @__PURE__ */ React__default.createElement(Checkbox, {
|
|
96
|
-
checked,
|
|
97
|
-
"aria-labelledby": "".concat(uid, "_").concat(rowUniqKey, "_1"),
|
|
98
|
-
onChange: this.handleSelectRow
|
|
99
|
-
}, /* @__PURE__ */ React__default.createElement(Checkbox.Value, null)));
|
|
100
|
-
}
|
|
101
|
-
}]);
|
|
102
|
-
})(React__default.PureComponent);
|
|
103
|
-
export {
|
|
104
|
-
RowSelector
|
|
105
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import { ScreenReaderOnly } from "@semcore/base-components";
|
|
3
|
-
import React__default from "react";
|
|
4
|
-
import { UNIQ_ROW_KEY } from "../DataTable/DataTable.mjs";
|
|
5
|
-
function SRAnnouncer(props) {
|
|
6
|
-
var _React$useState = React__default.useState(""), _React$useState2 = _slicedToArray(_React$useState, 2), ariaMessage = _React$useState2[0], setAriaMessage = _React$useState2[1];
|
|
7
|
-
var _React$useState3 = React__default.useState(false), _React$useState4 = _slicedToArray(_React$useState3, 2), selectedAll = _React$useState4[0], setSelectedAll = _React$useState4[1];
|
|
8
|
-
React__default.useEffect(function() {
|
|
9
|
-
var selectedRowsSet = new Set(props.selectedRows);
|
|
10
|
-
var allChecked = [];
|
|
11
|
-
var allUnchecked = [];
|
|
12
|
-
props.flatRows.forEach(function(row) {
|
|
13
|
-
if (selectedRowsSet.has(row[UNIQ_ROW_KEY])) {
|
|
14
|
-
allChecked.push(row[UNIQ_ROW_KEY]);
|
|
15
|
-
} else {
|
|
16
|
-
allUnchecked.push(row[UNIQ_ROW_KEY]);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
if (allChecked.length === props.data.length) {
|
|
20
|
-
setSelectedAll(true);
|
|
21
|
-
} else if (allUnchecked.length === props.data.length) {
|
|
22
|
-
setSelectedAll(false);
|
|
23
|
-
}
|
|
24
|
-
}, [props.selectedRows, props.data, props.flatRows]);
|
|
25
|
-
React__default.useEffect(function() {
|
|
26
|
-
var getI18nText = props.getI18nText;
|
|
27
|
-
var message = getI18nText(selectedAll ? "DataTable.allItemsSelected:aria-live" : "DataTable.allItemsDeselected:aria-live");
|
|
28
|
-
setAriaMessage(message);
|
|
29
|
-
var timeout = setTimeout(function() {
|
|
30
|
-
return setAriaMessage("");
|
|
31
|
-
}, 5e3);
|
|
32
|
-
return function() {
|
|
33
|
-
return clearTimeout(timeout);
|
|
34
|
-
};
|
|
35
|
-
}, [selectedAll, props.getI18nText]);
|
|
36
|
-
React__default.useEffect(function() {
|
|
37
|
-
var timer = setTimeout(function() {
|
|
38
|
-
return setAriaMessage("");
|
|
39
|
-
}, 1e3);
|
|
40
|
-
return function() {
|
|
41
|
-
return clearTimeout(timer);
|
|
42
|
-
};
|
|
43
|
-
}, [ariaMessage]);
|
|
44
|
-
return /* @__PURE__ */ React__default.createElement(ScreenReaderOnly, {
|
|
45
|
-
role: "status",
|
|
46
|
-
"aria-live": "polite"
|
|
47
|
-
}, ariaMessage);
|
|
48
|
-
}
|
|
49
|
-
export {
|
|
50
|
-
SRAnnouncer
|
|
51
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import { ScreenReaderOnly } from "@semcore/base-components";
|
|
3
|
-
import React__default from "react";
|
|
4
|
-
import { SelectableRows } from "../../store/SelectableRows.mjs";
|
|
5
|
-
function SRReactiveAnnouncer(props) {
|
|
6
|
-
var _React$useState = React__default.useState(""), _React$useState2 = _slicedToArray(_React$useState, 2), ariaMessage = _React$useState2[0], setAriaMessage = _React$useState2[1];
|
|
7
|
-
var setAriaCallback = React__default.useCallback(function() {
|
|
8
|
-
var isAllSelected = props.selectedRows.isAllSelected();
|
|
9
|
-
var message = props.getI18nText(isAllSelected ? "DataTable.allItemsSelected:aria-live" : "DataTable.allItemsDeselected:aria-live");
|
|
10
|
-
setAriaMessage(message);
|
|
11
|
-
}, [props.selectedRows]);
|
|
12
|
-
React__default.useEffect(function() {
|
|
13
|
-
var unsubscribe = props.selectedRows.on(SelectableRows.SELECT_ALL_EVENT, setAriaCallback);
|
|
14
|
-
return unsubscribe;
|
|
15
|
-
}, [props.selectedRows]);
|
|
16
|
-
React__default.useEffect(function() {
|
|
17
|
-
var timer = setTimeout(function() {
|
|
18
|
-
return setAriaMessage("");
|
|
19
|
-
}, 1e3);
|
|
20
|
-
return function() {
|
|
21
|
-
return clearTimeout(timer);
|
|
22
|
-
};
|
|
23
|
-
}, [ariaMessage]);
|
|
24
|
-
return /* @__PURE__ */ React__default.createElement(ScreenReaderOnly, {
|
|
25
|
-
role: "status",
|
|
26
|
-
"aria-live": "polite"
|
|
27
|
-
}, ariaMessage);
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
SRReactiveAnnouncer
|
|
31
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { getFocusableIn } from "@semcore/core/lib/utils/focus-lock/getFocusableIn";
|
|
2
|
-
function handleFocusCell(lockedCell, target, currentTarget) {
|
|
3
|
-
if (target instanceof HTMLElement && currentTarget instanceof HTMLElement && target === currentTarget && target.matches(":focus-visible")) {
|
|
4
|
-
target.scrollIntoView({
|
|
5
|
-
block: "center",
|
|
6
|
-
inline: "center"
|
|
7
|
-
});
|
|
8
|
-
var focusableChildren = Array.from(currentTarget.children).flatMap(function(node) {
|
|
9
|
-
return getFocusableIn(node);
|
|
10
|
-
});
|
|
11
|
-
if (focusableChildren.length === 1) {
|
|
12
|
-
focusableChildren[0].focus({
|
|
13
|
-
focusVisible: true
|
|
14
|
-
});
|
|
15
|
-
focusableChildren[0].scrollIntoView({
|
|
16
|
-
block: "center",
|
|
17
|
-
inline: "center"
|
|
18
|
-
});
|
|
19
|
-
} else if (focusableChildren.length > 1) {
|
|
20
|
-
lockedCell[0] = currentTarget;
|
|
21
|
-
lockedCell[1] = false;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function handleKeydownFocusCell(lockedCell, e) {
|
|
26
|
-
if (e.currentTarget === lockedCell[0]) {
|
|
27
|
-
var focusableChildren = Array.from(lockedCell[0].children).flatMap(function(node) {
|
|
28
|
-
return getFocusableIn(node);
|
|
29
|
-
});
|
|
30
|
-
if (lockedCell[1]) {
|
|
31
|
-
if (e.key === "Escape") {
|
|
32
|
-
var _lockedCell$;
|
|
33
|
-
(_lockedCell$ = lockedCell[0]) === null || _lockedCell$ === void 0 || _lockedCell$.focus({
|
|
34
|
-
focusVisible: true
|
|
35
|
-
});
|
|
36
|
-
lockedCell[1] = false;
|
|
37
|
-
}
|
|
38
|
-
if (e.key.startsWith("Arrow")) {
|
|
39
|
-
e.stopPropagation();
|
|
40
|
-
e.preventDefault();
|
|
41
|
-
}
|
|
42
|
-
if (e.key === "Tab") {
|
|
43
|
-
if (e.target === focusableChildren[0] && e.shiftKey) {
|
|
44
|
-
var _focusableChildren;
|
|
45
|
-
(_focusableChildren = focusableChildren[focusableChildren.length - 1]) === null || _focusableChildren === void 0 || _focusableChildren.focus({
|
|
46
|
-
focusVisible: true
|
|
47
|
-
});
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
} else if (e.target === focusableChildren[focusableChildren.length - 1] && !e.shiftKey) {
|
|
50
|
-
var _focusableChildren$;
|
|
51
|
-
(_focusableChildren$ = focusableChildren[0]) === null || _focusableChildren$ === void 0 || _focusableChildren$.focus({
|
|
52
|
-
focusVisible: true
|
|
53
|
-
});
|
|
54
|
-
e.preventDefault();
|
|
55
|
-
}
|
|
56
|
-
e.stopPropagation();
|
|
57
|
-
}
|
|
58
|
-
} else if (e.key === "Enter") {
|
|
59
|
-
var _focusableChildren$2;
|
|
60
|
-
e.preventDefault();
|
|
61
|
-
e.stopPropagation();
|
|
62
|
-
lockedCell[1] = true;
|
|
63
|
-
(_focusableChildren$2 = focusableChildren[0]) === null || _focusableChildren$2 === void 0 || _focusableChildren$2.focus({
|
|
64
|
-
focusVisible: true
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
export {
|
|
70
|
-
handleFocusCell,
|
|
71
|
-
handleKeydownFocusCell
|
|
72
|
-
};
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import EventEmitter from "@semcore/core/lib/utils/eventEmitter";
|
|
8
|
-
import { UNIQ_ROW_KEY } from "../components/DataTable/DataTable.mjs";
|
|
9
|
-
var SelectableRows = /* @__PURE__ */ (function(_EventEmitter) {
|
|
10
|
-
function SelectableRows2() {
|
|
11
|
-
var _this;
|
|
12
|
-
var initValues = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
13
|
-
_classCallCheck(this, SelectableRows2);
|
|
14
|
-
_this = _callSuper(this, SelectableRows2);
|
|
15
|
-
_defineProperty(_this, "values", void 0);
|
|
16
|
-
_defineProperty(_this, "availableKeys", /* @__PURE__ */ new Set());
|
|
17
|
-
_defineProperty(_this, "lastSelectedRow", null);
|
|
18
|
-
_defineProperty(_this, "isPressedShift", false);
|
|
19
|
-
_this.values = new Set(initValues);
|
|
20
|
-
return _this;
|
|
21
|
-
}
|
|
22
|
-
_inherits(SelectableRows2, _EventEmitter);
|
|
23
|
-
return _createClass(SelectableRows2, [{
|
|
24
|
-
key: "setAvailableKeys",
|
|
25
|
-
value: function setAvailableKeys(value) {
|
|
26
|
-
this.availableKeys = new Set(value);
|
|
27
|
-
}
|
|
28
|
-
}, {
|
|
29
|
-
key: "get",
|
|
30
|
-
value: function get() {
|
|
31
|
-
return Array.from(this.values.keys());
|
|
32
|
-
}
|
|
33
|
-
}, {
|
|
34
|
-
key: "isChecked",
|
|
35
|
-
value: function isChecked(key) {
|
|
36
|
-
return this.values.has(key);
|
|
37
|
-
}
|
|
38
|
-
}, {
|
|
39
|
-
key: "replace",
|
|
40
|
-
value: function replace(value) {
|
|
41
|
-
var _this2 = this;
|
|
42
|
-
this.clearAll();
|
|
43
|
-
value.forEach(function(val) {
|
|
44
|
-
_this2.values.add(val);
|
|
45
|
-
_this2.emit(SelectableRows2.TOGGLE_EVENT, val);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
key: "has",
|
|
50
|
-
value: function has(value) {
|
|
51
|
-
return this.values.has(value);
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: "isAllSelected",
|
|
55
|
-
value: function isAllSelected() {
|
|
56
|
-
var isAllSelected2 = true;
|
|
57
|
-
if (this.availableKeys.size === 0 || this.values.size === 0) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
var _iterator = _createForOfIteratorHelper(this.availableKeys.values()), _step;
|
|
61
|
-
try {
|
|
62
|
-
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
|
|
63
|
-
var _key = _step.value;
|
|
64
|
-
if (!this.values.has(_key)) {
|
|
65
|
-
isAllSelected2 = false;
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
} catch (err) {
|
|
70
|
-
_iterator.e(err);
|
|
71
|
-
} finally {
|
|
72
|
-
_iterator.f();
|
|
73
|
-
}
|
|
74
|
-
return isAllSelected2;
|
|
75
|
-
}
|
|
76
|
-
}, {
|
|
77
|
-
key: "isIndeterminate",
|
|
78
|
-
value: function isIndeterminate() {
|
|
79
|
-
var isIndeterminate2 = false;
|
|
80
|
-
var _iterator2 = _createForOfIteratorHelper(this.availableKeys.values()), _step2;
|
|
81
|
-
try {
|
|
82
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
|
|
83
|
-
var _key2 = _step2.value;
|
|
84
|
-
if (this.values.has(_key2)) {
|
|
85
|
-
isIndeterminate2 = true;
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
} catch (err) {
|
|
90
|
-
_iterator2.e(err);
|
|
91
|
-
} finally {
|
|
92
|
-
_iterator2.f();
|
|
93
|
-
}
|
|
94
|
-
return isIndeterminate2;
|
|
95
|
-
}
|
|
96
|
-
}, {
|
|
97
|
-
key: "selectAll",
|
|
98
|
-
value: function selectAll() {
|
|
99
|
-
var _iterator3 = _createForOfIteratorHelper(this.availableKeys.values()), _step3;
|
|
100
|
-
try {
|
|
101
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
|
|
102
|
-
var _key3 = _step3.value;
|
|
103
|
-
this.values.add(_key3);
|
|
104
|
-
this.emit(SelectableRows2.TOGGLE_EVENT, _key3);
|
|
105
|
-
}
|
|
106
|
-
} catch (err) {
|
|
107
|
-
_iterator3.e(err);
|
|
108
|
-
} finally {
|
|
109
|
-
_iterator3.f();
|
|
110
|
-
}
|
|
111
|
-
this.emit(SelectableRows2.SELECT_ALL_EVENT);
|
|
112
|
-
}
|
|
113
|
-
}, {
|
|
114
|
-
key: "clearAll",
|
|
115
|
-
value: function clearAll() {
|
|
116
|
-
var keys = Array.from(this.values.values());
|
|
117
|
-
this.values.clear();
|
|
118
|
-
for (var _i = 0, _keys = keys; _i < _keys.length; _i++) {
|
|
119
|
-
var _key4 = _keys[_i];
|
|
120
|
-
this.emit(SelectableRows2.TOGGLE_EVENT, _key4);
|
|
121
|
-
}
|
|
122
|
-
this.emit(SelectableRows2.SELECT_ALL_EVENT);
|
|
123
|
-
}
|
|
124
|
-
}, {
|
|
125
|
-
key: "clearAllAvailable",
|
|
126
|
-
value: function clearAllAvailable() {
|
|
127
|
-
var _iterator4 = _createForOfIteratorHelper(this.availableKeys.values()), _step4;
|
|
128
|
-
try {
|
|
129
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
|
|
130
|
-
var _key5 = _step4.value;
|
|
131
|
-
this.values["delete"](_key5);
|
|
132
|
-
this.emit(SelectableRows2.TOGGLE_EVENT, _key5);
|
|
133
|
-
}
|
|
134
|
-
} catch (err) {
|
|
135
|
-
_iterator4.e(err);
|
|
136
|
-
} finally {
|
|
137
|
-
_iterator4.f();
|
|
138
|
-
}
|
|
139
|
-
this.emit(SelectableRows2.SELECT_ALL_EVENT);
|
|
140
|
-
}
|
|
141
|
-
}, {
|
|
142
|
-
key: "toggle",
|
|
143
|
-
value: function toggle(selected, row) {
|
|
144
|
-
if (this.isPressedShift && this.values.size > 0 && this.lastSelectedRow && (selected ? this.values.has(this.lastSelectedRow) : true)) {
|
|
145
|
-
var select = false;
|
|
146
|
-
var _iterator5 = _createForOfIteratorHelper(this.availableKeys.values()), _step5;
|
|
147
|
-
try {
|
|
148
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
|
|
149
|
-
var item = _step5.value;
|
|
150
|
-
if (!select && (item === row[UNIQ_ROW_KEY] || item === this.lastSelectedRow)) {
|
|
151
|
-
select = true;
|
|
152
|
-
this.toggleOneRow(selected, item);
|
|
153
|
-
continue;
|
|
154
|
-
}
|
|
155
|
-
if (select) {
|
|
156
|
-
this.toggleOneRow(selected, item);
|
|
157
|
-
}
|
|
158
|
-
if (select && (item === row[UNIQ_ROW_KEY] || item === this.lastSelectedRow)) {
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
} catch (err) {
|
|
163
|
-
_iterator5.e(err);
|
|
164
|
-
} finally {
|
|
165
|
-
_iterator5.f();
|
|
166
|
-
}
|
|
167
|
-
} else {
|
|
168
|
-
this.toggleOneRow(selected, row[UNIQ_ROW_KEY]);
|
|
169
|
-
}
|
|
170
|
-
this.lastSelectedRow = row[UNIQ_ROW_KEY];
|
|
171
|
-
}
|
|
172
|
-
}, {
|
|
173
|
-
key: "toggleOneRow",
|
|
174
|
-
value: function toggleOneRow(isSelected, key) {
|
|
175
|
-
if (isSelected) {
|
|
176
|
-
if (!this.isIndeterminate()) {
|
|
177
|
-
this.emit(SelectableRows2.SET_INDETERMINATE_EVENT);
|
|
178
|
-
}
|
|
179
|
-
this.values.add(key);
|
|
180
|
-
if (this.isAllSelected()) {
|
|
181
|
-
this.emit(SelectableRows2.SELECT_ALL_EVENT);
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
if (this.isAllSelected()) {
|
|
185
|
-
this.emit(SelectableRows2.SET_INDETERMINATE_EVENT);
|
|
186
|
-
}
|
|
187
|
-
this.values["delete"](key);
|
|
188
|
-
if (this.values.size === 0) {
|
|
189
|
-
this.emit(SelectableRows2.SELECT_ALL_EVENT);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
this.emit(SelectableRows2.TOGGLE_EVENT, key);
|
|
193
|
-
}
|
|
194
|
-
}]);
|
|
195
|
-
})(EventEmitter);
|
|
196
|
-
_defineProperty(SelectableRows, "TOGGLE_EVENT", "toggle_selected_row");
|
|
197
|
-
_defineProperty(SelectableRows, "SELECT_ALL_EVENT", "select_all_selected_rows");
|
|
198
|
-
_defineProperty(SelectableRows, "SET_INDETERMINATE_EVENT", "set_indeterminate");
|
|
199
|
-
export {
|
|
200
|
-
SelectableRows
|
|
201
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { CellRenderProps } from '../Body/Body.types';
|
|
3
|
-
import type { DataTableCellProps } from '../Body/Cell.types';
|
|
4
|
-
import type { DTRow, DTRows } from '../Body/Row.types';
|
|
5
|
-
import type { DataTableData, DataTableProps, DataRowItem, DTUse } from '../DataTable/DataTable.types';
|
|
6
|
-
import type { DTColumn } from '../Head/Column.types';
|
|
7
|
-
type AccordionRowsProps<Data extends DataTableData, UniqKeyType> = {
|
|
8
|
-
accordionId: string;
|
|
9
|
-
expanded: boolean;
|
|
10
|
-
expandedForAnimation: boolean;
|
|
11
|
-
tableRef: React.RefObject<HTMLDivElement>;
|
|
12
|
-
use: DTUse;
|
|
13
|
-
columns: DTColumn[];
|
|
14
|
-
row: DTRow<UniqKeyType> | DTRow<UniqKeyType>[];
|
|
15
|
-
rows: DTRows<UniqKeyType>;
|
|
16
|
-
flatRows: DTRow<UniqKeyType>[];
|
|
17
|
-
rowIndex: number;
|
|
18
|
-
gridRowIndex: number;
|
|
19
|
-
accordionDuration: number | [number, number];
|
|
20
|
-
accordionAnimationRows: number;
|
|
21
|
-
sideIndents: 'wide' | undefined;
|
|
22
|
-
getFixedStyle: (cell: Pick<DTColumn, 'name' | 'fixed'>) => [side: 'left' | 'right', style: string | number] | [side: undefined, style: undefined];
|
|
23
|
-
onCellClick: DataTableCellProps<Data, UniqKeyType>['onClick'];
|
|
24
|
-
renderCell: ((props: CellRenderProps<Data[number], UniqKeyType>) => React.ReactNode | Record<string, any>) | undefined;
|
|
25
|
-
rawData: DataRowItem[];
|
|
26
|
-
shadowVertical: '' | 'end' | 'start' | 'median' | undefined;
|
|
27
|
-
variant: DataTableProps<any, any, any>['variant'];
|
|
28
|
-
limit: DataTableProps<any, any, any>['limit'];
|
|
29
|
-
} & {
|
|
30
|
-
'aria-level': number;
|
|
31
|
-
};
|
|
32
|
-
type State = {
|
|
33
|
-
maxHeight: number;
|
|
34
|
-
};
|
|
35
|
-
export declare class AccordionRows<Data extends DataTableData, UniqKeyType> extends React.PureComponent<AccordionRowsProps<Data, UniqKeyType>, State> {
|
|
36
|
-
accordionRowsRef: React.RefObject<HTMLDivElement>;
|
|
37
|
-
state: State;
|
|
38
|
-
componentDidUpdate(prevProps: Readonly<AccordionRowsProps<Data, UniqKeyType>>): void;
|
|
39
|
-
render(): React.ReactNode;
|
|
40
|
-
}
|
|
41
|
-
export {};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { Intergalactic } from '@semcore/core';
|
|
2
|
-
import type * as React from 'react';
|
|
3
|
-
import type { DataTableCellProps, Theme } from './Cell.types';
|
|
4
|
-
import type { DTRow, RowPropsInner } from './Row.types';
|
|
5
|
-
import type { ISelectedRows } from '../../store/SelectableRows';
|
|
6
|
-
import type { ACCORDION } from '../DataTable/DataTable';
|
|
7
|
-
import type { DataRowItem, DTUse, VirtualScroll, DataTableProps, DataTableData } from '../DataTable/DataTable.types';
|
|
8
|
-
import type { DTColumn } from '../Head/Column.types';
|
|
9
|
-
export type CellRenderProps<Data extends DataRowItem, UniqKeyType> = {
|
|
10
|
-
/** The column key for the cell data */
|
|
11
|
-
dataKey: string;
|
|
12
|
-
/** The complete row data object */
|
|
13
|
-
row: DTRow<UniqKeyType>;
|
|
14
|
-
/** The column configuration object */
|
|
15
|
-
column: DTColumn;
|
|
16
|
-
/** Zero-based row index in the table */
|
|
17
|
-
rowIndex: number;
|
|
18
|
-
/** Zero-based column index in the table */
|
|
19
|
-
columnIndex: number;
|
|
20
|
-
/** The name/key of the column */
|
|
21
|
-
columnName: string | typeof ACCORDION;
|
|
22
|
-
/** Cell value */
|
|
23
|
-
value: string | React.ReactElement;
|
|
24
|
-
/** Function that returns the default cell rendering */
|
|
25
|
-
defaultRender: () => React.ReactNode;
|
|
26
|
-
/** Indicates if this cell spans multiple rows */
|
|
27
|
-
isMergedRows: boolean;
|
|
28
|
-
/** Indicates if this cell spans multiple columns */
|
|
29
|
-
isMergedColumns: boolean;
|
|
30
|
-
/** The original unprocessed row data */
|
|
31
|
-
rawData: Data;
|
|
32
|
-
/** Flag to show is the cell is in the accordion row */
|
|
33
|
-
isAccordionRow: boolean;
|
|
34
|
-
/** Zero-based accordion row index */
|
|
35
|
-
accordionRowIndex?: number;
|
|
36
|
-
};
|
|
37
|
-
export type DataTableBodyProps<Data extends DataTableData, UniqKeyType> = {
|
|
38
|
-
renderCell?: (props: CellRenderProps<Data[number], UniqKeyType>) => React.ReactNode | (Record<string, any> & {
|
|
39
|
-
theme?: Theme;
|
|
40
|
-
});
|
|
41
|
-
rowProps?: (row: DTRow<UniqKeyType>, rowIndex: number) => (Record<string, any> & {
|
|
42
|
-
theme?: Theme;
|
|
43
|
-
}) | undefined;
|
|
44
|
-
};
|
|
45
|
-
export type BodyPropsInner<Data extends DataTableData, UniqKeyType> = DataTableBodyProps<Data, UniqKeyType> & {
|
|
46
|
-
rows: Array<DTRow<UniqKeyType> | DTRow<UniqKeyType>[]>;
|
|
47
|
-
flatRows: DTRow<UniqKeyType>[];
|
|
48
|
-
columns: DTColumn[];
|
|
49
|
-
use: DTUse;
|
|
50
|
-
compact: boolean;
|
|
51
|
-
gridTemplateColumns: string[];
|
|
52
|
-
gridTemplateAreas: string[];
|
|
53
|
-
loading?: boolean;
|
|
54
|
-
headerHeight: number;
|
|
55
|
-
getI18nText: (key: string) => string;
|
|
56
|
-
expandedRows: Set<UniqKeyType>;
|
|
57
|
-
onExpandRow: (row: DTRow<UniqKeyType>) => void;
|
|
58
|
-
spinnerRef: React.RefObject<HTMLDivElement>;
|
|
59
|
-
tableContainerRef: React.RefObject<HTMLDivElement>;
|
|
60
|
-
tableRef: React.RefObject<HTMLDivElement>;
|
|
61
|
-
scrollAreaRef: React.RefObject<HTMLDivElement>;
|
|
62
|
-
scrollTop: number;
|
|
63
|
-
scrollDirection: 'down' | 'up';
|
|
64
|
-
virtualScroll?: VirtualScroll;
|
|
65
|
-
hasGroups: boolean;
|
|
66
|
-
uid: string;
|
|
67
|
-
rowProps?: (row: DTRow<UniqKeyType>, rowIndex: number) => Record<string, any> | undefined;
|
|
68
|
-
renderCell?: (props: CellRenderProps<Data[number], UniqKeyType>) => React.ReactNode | Record<string, any>;
|
|
69
|
-
onBackFromAccordion: (colName: string) => void;
|
|
70
|
-
stickyHeader?: boolean;
|
|
71
|
-
selectedRows?: UniqKeyType[] | ISelectedRows<UniqKeyType>;
|
|
72
|
-
onSelectRow?: (isSelect: boolean, selectedRowIndex: number, row: DTRow<UniqKeyType>, event?: React.SyntheticEvent<HTMLElement>) => void;
|
|
73
|
-
renderEmptyData: () => React.ReactNode;
|
|
74
|
-
sideIndents?: 'wide';
|
|
75
|
-
getFixedStyle: (cell: Pick<DTColumn, 'name' | 'fixed'>) => [side: 'left' | 'right', style: string | number] | [side: undefined, style: undefined];
|
|
76
|
-
accordionDuration: number | [number, number];
|
|
77
|
-
onCellClick: DataTableCellProps<Data, UniqKeyType>['onClick'];
|
|
78
|
-
rawData: DataRowItem[];
|
|
79
|
-
accordionMode?: DataTableProps<any, any, any>['accordionMode'];
|
|
80
|
-
shadowVertical?: '' | 'end' | 'start' | 'median';
|
|
81
|
-
renderCellOverlay?: () => React.ReactNode;
|
|
82
|
-
limit?: DataTableProps<any, any, any>['limit'];
|
|
83
|
-
variant?: DataTableProps<any, any, any>['variant'];
|
|
84
|
-
totalRows?: number;
|
|
85
|
-
accordionAnimationRows: RowPropsInner<Data, UniqKeyType>['accordionAnimationRows'];
|
|
86
|
-
};
|
|
87
|
-
export type DataTableBodyType = (<Data extends DataTableData, UniqKeyType, Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', DataTableBodyProps<Data, UniqKeyType>>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', DataTableBodyProps<any, any>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Cell: import("@semcore/core").Intergalactic.Component<"div", {}, {}, never[]>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Intergalactic } from '@semcore/core';
|
|
2
|
-
import type { CSSProperties, HTMLAttributes } from 'react';
|
|
3
|
-
import type { BodyPropsInner } from './Body.types';
|
|
4
|
-
import type { DTRow, DTRows } from './Row.types';
|
|
5
|
-
import type { DataTableData, DTUse } from '../DataTable/DataTable.types';
|
|
6
|
-
import type { DTColumn } from '../Head/Column.types';
|
|
7
|
-
export type Theme = 'muted' | 'info' | 'success' | 'warning' | 'danger';
|
|
8
|
-
export type DataTableCellProps<Data extends DataTableData, UniqKeyType> = Intergalactic.InternalTypings.EfficientOmit<HTMLAttributes<HTMLDivElement>, 'onClick'> & {
|
|
9
|
-
id: string;
|
|
10
|
-
accordionId: string;
|
|
11
|
-
row: DTRow<UniqKeyType>;
|
|
12
|
-
rowIndex: number;
|
|
13
|
-
column: DTColumn;
|
|
14
|
-
columnIndex: number;
|
|
15
|
-
gridRowIndex: number;
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
expanded?: boolean;
|
|
18
|
-
withAccordion?: boolean;
|
|
19
|
-
accordionRowIndex?: number;
|
|
20
|
-
rows: DTRows<UniqKeyType>;
|
|
21
|
-
use: DTUse;
|
|
22
|
-
style?: CSSProperties;
|
|
23
|
-
virtualScroll: boolean;
|
|
24
|
-
tableRef: React.RefObject<HTMLDivElement>;
|
|
25
|
-
accordionDuration?: number | [number, number];
|
|
26
|
-
onClick: (e: React.SyntheticEvent<HTMLElement>, opt: {
|
|
27
|
-
rowIndex: number;
|
|
28
|
-
colIndex: number;
|
|
29
|
-
row?: DTRow<UniqKeyType>;
|
|
30
|
-
}) => void;
|
|
31
|
-
flatRows: DTRow<UniqKeyType>[];
|
|
32
|
-
shadowVertical?: BodyPropsInner<Data, UniqKeyType>;
|
|
33
|
-
withoutBorder?: boolean;
|
|
34
|
-
} & {
|
|
35
|
-
'data-aria-level'?: number;
|
|
36
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Intergalactic } from '@semcore/core';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import type { DTRow, DTRows } from './Row.types';
|
|
4
|
-
import type { DataTableProps } from '../DataTable/DataTable.types';
|
|
5
|
-
import type { DTColumn } from '../Head/Column.types';
|
|
6
|
-
type LimitOverlayProps<UniqKeyType> = {
|
|
7
|
-
columns: DTColumn[];
|
|
8
|
-
rows: DTRows<UniqKeyType>;
|
|
9
|
-
limit: Exclude<DataTableProps<any, any, any>['limit'], undefined>;
|
|
10
|
-
flatRows: DTRow<UniqKeyType>[];
|
|
11
|
-
hasGroups: boolean;
|
|
12
|
-
tableRef: React.RefObject<HTMLDivElement>;
|
|
13
|
-
scrollAreaRef: React.RefObject<HTMLDivElement>;
|
|
14
|
-
};
|
|
15
|
-
type LimitOverlayType = (<UniqKeyType, Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', LimitOverlayProps<UniqKeyType>>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', LimitOverlayProps<any>>;
|
|
16
|
-
export declare const LimitOverlay: LimitOverlayType;
|
|
17
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { DTRows } from './Row.types';
|
|
2
|
-
export declare class MergedRowsCell {
|
|
3
|
-
readonly value: any;
|
|
4
|
-
readonly rowsCount: number;
|
|
5
|
-
readonly accordion?: React.ReactNode | DTRows<any>;
|
|
6
|
-
constructor(value: any, rowsCount: number, accordion?: React.ReactNode | DTRows<any>);
|
|
7
|
-
}
|
|
8
|
-
export declare class MergedColumnsCell {
|
|
9
|
-
readonly value: any;
|
|
10
|
-
readonly columnsCount: number;
|
|
11
|
-
readonly dataKey: string;
|
|
12
|
-
readonly accordion?: React.ReactNode | DTRows<any>;
|
|
13
|
-
constructor(value: any, options: {
|
|
14
|
-
size: number;
|
|
15
|
-
dataKey: string;
|
|
16
|
-
}, accordion?: React.ReactNode | DTRows<any>);
|
|
17
|
-
}
|