@canonical/react-components 0.47.1 → 0.47.2
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/__mocks__/nanoid.js +3 -3
- package/dist/components/Accordion/Accordion.js +28 -41
- package/dist/components/Accordion/AccordionSection/AccordionSection.js +18 -18
- package/dist/components/Accordion/AccordionSection/index.js +1 -1
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/ActionButton/ActionButton.js +34 -66
- package/dist/components/ActionButton/index.js +1 -1
- package/dist/components/ArticlePagination/ArticlePagination.js +10 -12
- package/dist/components/ArticlePagination/index.js +1 -1
- package/dist/components/Badge/Badge.js +24 -29
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Button/Button.js +21 -26
- package/dist/components/Button/index.js +4 -5
- package/dist/components/Card/Card.js +12 -14
- package/dist/components/Card/index.js +1 -1
- package/dist/components/CheckboxInput/CheckableInput/CheckableInput.js +15 -19
- package/dist/components/CheckboxInput/CheckableInput/index.js +1 -1
- package/dist/components/CheckboxInput/CheckboxInput.js +7 -10
- package/dist/components/CheckboxInput/index.js +1 -1
- package/dist/components/Chip/Chip.js +23 -33
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/Code/Code.js +14 -17
- package/dist/components/Code/index.js +1 -1
- package/dist/components/CodeSnippet/CodeSnippet.js +9 -14
- package/dist/components/CodeSnippet/CodeSnippetBlock.js +24 -29
- package/dist/components/CodeSnippet/CodeSnippetDropdown.js +11 -11
- package/dist/components/CodeSnippet/index.js +2 -2
- package/dist/components/Col/Col.js +24 -26
- package/dist/components/Col/index.js +4 -5
- package/dist/components/ConfirmationButton/ConfirmationButton.js +18 -21
- package/dist/components/ConfirmationButton/index.js +1 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.js +11 -15
- package/dist/components/ConfirmationModal/index.js +1 -1
- package/dist/components/ContextualMenu/ContextualMenu.js +89 -107
- package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.d.ts +4 -4
- package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +97 -107
- package/dist/components/ContextualMenu/ContextualMenuDropdown/index.js +1 -1
- package/dist/components/ContextualMenu/index.js +1 -1
- package/dist/components/EmptyState/EmptyState.js +9 -11
- package/dist/components/EmptyState/index.js +1 -1
- package/dist/components/Field/Field.js +66 -65
- package/dist/components/Field/index.js +1 -1
- package/dist/components/Form/Form.js +9 -11
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Icon/Icon.js +9 -12
- package/dist/components/Icon/index.js +4 -5
- package/dist/components/Input/Input.js +38 -45
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Label/Label.js +9 -11
- package/dist/components/Label/index.js +1 -1
- package/dist/components/Link/Link.js +12 -18
- package/dist/components/Link/index.js +1 -1
- package/dist/components/List/List.js +50 -54
- package/dist/components/List/index.js +1 -1
- package/dist/components/Loader/Loader.js +2 -3
- package/dist/components/Loader/index.js +1 -1
- package/dist/components/MainTable/MainTable.js +87 -104
- package/dist/components/MainTable/index.js +1 -1
- package/dist/components/Modal/Modal.js +37 -38
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/ModularTable/ModularTable.js +63 -77
- package/dist/components/ModularTable/index.js +1 -1
- package/dist/components/Navigation/Navigation.js +63 -97
- package/dist/components/Navigation/NavigationLink/NavigationLink.js +32 -35
- package/dist/components/Navigation/NavigationLink/index.js +1 -1
- package/dist/components/Navigation/NavigationMenu/NavigationMenu.js +26 -45
- package/dist/components/Navigation/NavigationMenu/index.js +1 -1
- package/dist/components/Navigation/index.js +1 -1
- package/dist/components/Notification/Notification.js +49 -59
- package/dist/components/Notification/index.js +4 -5
- package/dist/components/NotificationProvider/NotificationProvider.js +47 -68
- package/dist/components/NotificationProvider/index.js +7 -7
- package/dist/components/NotificationProvider/messageBuilder.js +9 -9
- package/dist/components/NotificationProvider/types.d.ts +1 -0
- package/dist/components/Pagination/Pagination.js +50 -69
- package/dist/components/Pagination/PaginationButton/PaginationButton.js +11 -12
- package/dist/components/Pagination/PaginationButton/index.js +1 -1
- package/dist/components/Pagination/PaginationItem/PaginationItem.js +7 -7
- package/dist/components/Pagination/PaginationItem/index.js +1 -1
- package/dist/components/Pagination/index.js +1 -1
- package/dist/components/PasswordToggle/PasswordToggle.d.ts +1 -1
- package/dist/components/PasswordToggle/PasswordToggle.js +25 -40
- package/dist/components/PasswordToggle/index.js +1 -1
- package/dist/components/RadioInput/RadioInput.js +6 -8
- package/dist/components/RadioInput/index.js +1 -1
- package/dist/components/Row/Row.js +7 -9
- package/dist/components/Row/index.js +1 -1
- package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.js +38 -51
- package/dist/components/SearchAndFilter/FilterPanelSection/index.js +1 -1
- package/dist/components/SearchAndFilter/SearchAndFilter.js +75 -135
- package/dist/components/SearchAndFilter/index.js +1 -1
- package/dist/components/SearchAndFilter/utils.js +4 -8
- package/dist/components/SearchBox/SearchBox.js +25 -33
- package/dist/components/SearchBox/index.js +1 -1
- package/dist/components/Select/Select.js +38 -44
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Slider/Slider.js +27 -35
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/Spinner/Spinner.js +10 -15
- package/dist/components/Spinner/index.js +1 -1
- package/dist/components/StatusLabel/StatusLabel.js +11 -13
- package/dist/components/StatusLabel/index.js +4 -5
- package/dist/components/Strip/Strip.js +27 -34
- package/dist/components/Strip/index.js +1 -1
- package/dist/components/SummaryButton/SummaryButton.js +9 -8
- package/dist/components/SummaryButton/index.js +1 -1
- package/dist/components/Switch/Switch.js +7 -10
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Table/Table.js +9 -13
- package/dist/components/Table/index.js +1 -1
- package/dist/components/TableCell/TableCell.js +11 -17
- package/dist/components/TableCell/index.js +1 -1
- package/dist/components/TableHeader/TableHeader.js +7 -9
- package/dist/components/TableHeader/index.js +1 -1
- package/dist/components/TablePagination/TablePagination.d.ts +37 -0
- package/dist/components/TablePagination/TablePagination.js +125 -0
- package/dist/components/TablePagination/TablePagination.scss +40 -0
- package/dist/components/TablePagination/TablePaginationControls/TablePaginationControls.d.ts +16 -0
- package/dist/components/TablePagination/TablePaginationControls/TablePaginationControls.js +66 -0
- package/dist/components/TablePagination/TablePaginationControls/index.d.ts +2 -0
- package/dist/components/TablePagination/TablePaginationControls/index.js +13 -0
- package/dist/components/TablePagination/index.d.ts +2 -0
- package/dist/components/TablePagination/index.js +13 -0
- package/dist/components/TableRow/TableRow.js +6 -8
- package/dist/components/TableRow/index.js +1 -1
- package/dist/components/Tabs/Tabs.js +17 -17
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Textarea/Textarea.js +51 -45
- package/dist/components/Textarea/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +5 -1
- package/dist/components/Tooltip/Tooltip.js +76 -79
- package/dist/components/Tooltip/index.js +4 -5
- package/dist/enums.js +2 -3
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +16 -10
- package/dist/hooks/useId.js +1 -3
- package/dist/hooks/useListener.d.ts +2 -1
- package/dist/hooks/useListener.js +25 -24
- package/dist/hooks/useOnClickOutside.d.ts +12 -0
- package/dist/hooks/useOnClickOutside.js +45 -0
- package/dist/hooks/useOnEscapePressed.d.ts +3 -1
- package/dist/hooks/useOnEscapePressed.js +13 -6
- package/dist/hooks/usePagination.js +17 -29
- package/dist/hooks/usePrevious.js +4 -4
- package/dist/hooks/useThrottle.js +16 -25
- package/dist/hooks/useWindowFitment.js +30 -28
- package/dist/index.d.ts +3 -1
- package/dist/index.js +86 -74
- package/dist/utils.js +6 -13
- package/package.json +42 -35
- package/dist/hooks/useClickOutside.d.ts +0 -6
- package/dist/hooks/useClickOutside.js +0 -32
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -12,29 +11,12 @@ var _TableRow = _interopRequireDefault(require("../TableRow"));
|
|
|
12
11
|
var _TableHeader = _interopRequireDefault(require("../TableHeader"));
|
|
13
12
|
var _TableCell = _interopRequireDefault(require("../TableCell"));
|
|
14
13
|
var _hooks = require("../../hooks");
|
|
15
|
-
var _excluded = ["content", "sortKey"],
|
|
16
|
-
_excluded2 = ["columns", "expanded", "expandedContent", "key", "sortData"],
|
|
17
|
-
_excluded3 = ["content"],
|
|
18
|
-
_excluded4 = ["defaultSort", "defaultSortDirection", "emptyStateMsg", "expanding", "headers", "onUpdateSort", "paginate", "rows", "responsive", "sortable", "sortFunction", "hiddenCaption"];
|
|
19
|
-
var _this = void 0;
|
|
20
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
function _getRequireWildcardCache(
|
|
22
|
-
function _interopRequireWildcard(
|
|
23
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
24
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
26
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
28
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
30
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
32
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
33
17
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var updateSort = function updateSort(setSortKey, setSortDirection, sortKey, sortDirection) {
|
|
37
|
-
var newDirection = null;
|
|
18
|
+
const updateSort = (setSortKey, setSortDirection, sortKey, sortDirection) => {
|
|
19
|
+
let newDirection = null;
|
|
38
20
|
if (sortDirection === "none") {
|
|
39
21
|
newDirection = "ascending";
|
|
40
22
|
} else if (sortDirection === "ascending") {
|
|
@@ -45,12 +27,14 @@ var updateSort = function updateSort(setSortKey, setSortDirection, sortKey, sort
|
|
|
45
27
|
setSortKey(sortKey);
|
|
46
28
|
setSortDirection(newDirection);
|
|
47
29
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
30
|
+
const generateHeaders = (currentSortKey, currentSortDirection, expanding, headers, sortable, setSortKey, setSortDirection) => {
|
|
31
|
+
const headerItems = headers.map((_ref, index) => {
|
|
32
|
+
let {
|
|
33
|
+
content,
|
|
34
|
+
sortKey,
|
|
35
|
+
...props
|
|
36
|
+
} = _ref;
|
|
37
|
+
let sortDirection;
|
|
54
38
|
if (sortable && sortKey) {
|
|
55
39
|
if (currentSortKey === sortKey) {
|
|
56
40
|
sortDirection = currentSortDirection;
|
|
@@ -61,7 +45,7 @@ var generateHeaders = function generateHeaders(currentSortKey, currentSortDirect
|
|
|
61
45
|
return /*#__PURE__*/_react.default.createElement(_TableHeader.default, _extends({
|
|
62
46
|
key: index,
|
|
63
47
|
sort: sortDirection,
|
|
64
|
-
onClick: sortable && sortKey ? updateSort.bind(
|
|
48
|
+
onClick: sortable && sortKey ? updateSort.bind(void 0, setSortKey, setSortDirection, sortKey, sortDirection) : undefined
|
|
65
49
|
}, props), content);
|
|
66
50
|
});
|
|
67
51
|
// When there is expanding content then provide an extra hidden header to
|
|
@@ -70,23 +54,29 @@ var generateHeaders = function generateHeaders(currentSortKey, currentSortDirect
|
|
|
70
54
|
"aria-hidden": "true"
|
|
71
55
|
})));
|
|
72
56
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
57
|
+
const generateRows = _ref2 => {
|
|
58
|
+
let {
|
|
59
|
+
rows,
|
|
60
|
+
headers,
|
|
61
|
+
responsive,
|
|
62
|
+
expanding
|
|
63
|
+
} = _ref2;
|
|
64
|
+
return rows.map((_ref3, index) => {
|
|
65
|
+
let {
|
|
66
|
+
columns,
|
|
67
|
+
expanded,
|
|
68
|
+
expandedContent,
|
|
69
|
+
key,
|
|
70
|
+
sortData,
|
|
71
|
+
...rowProps
|
|
72
|
+
} = _ref3;
|
|
73
|
+
const cellItems = columns === null || columns === void 0 ? void 0 : columns.map((_ref4, index) => {
|
|
74
|
+
let {
|
|
75
|
+
content,
|
|
76
|
+
...cellProps
|
|
77
|
+
} = _ref4;
|
|
78
|
+
const headerContent = headers && headers[index]["content"];
|
|
79
|
+
const headerReplacement = headers && headers[index]["heading"];
|
|
90
80
|
if (responsive) {
|
|
91
81
|
cellProps["data-heading"] = typeof headerContent === "string" ? headerContent : headerReplacement;
|
|
92
82
|
}
|
|
@@ -109,20 +99,22 @@ var generateRows = function generateRows(_ref2) {
|
|
|
109
99
|
}, expandedContent));
|
|
110
100
|
});
|
|
111
101
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
102
|
+
const sortRows = _ref5 => {
|
|
103
|
+
let {
|
|
104
|
+
currentSortDirection,
|
|
105
|
+
currentSortKey,
|
|
106
|
+
rows,
|
|
107
|
+
sortable,
|
|
108
|
+
sortFunction
|
|
109
|
+
} = _ref5;
|
|
118
110
|
if (!rows) {
|
|
119
111
|
return [];
|
|
120
112
|
}
|
|
121
113
|
// Clone the rows so we can restore the original order.
|
|
122
|
-
|
|
114
|
+
const sortedRows = [...rows];
|
|
123
115
|
if (sortable && currentSortKey) {
|
|
124
116
|
if (!sortFunction) {
|
|
125
|
-
sortFunction =
|
|
117
|
+
sortFunction = (a, b) => {
|
|
126
118
|
if (!a.sortData || !b.sortData) {
|
|
127
119
|
return 0;
|
|
128
120
|
}
|
|
@@ -134,65 +126,57 @@ var sortRows = function sortRows(_ref5) {
|
|
|
134
126
|
return 0;
|
|
135
127
|
};
|
|
136
128
|
}
|
|
137
|
-
sortedRows.sort(
|
|
138
|
-
return sortFunction(a, b, currentSortDirection, currentSortKey);
|
|
139
|
-
});
|
|
129
|
+
sortedRows.sort((a, b) => sortFunction(a, b, currentSortDirection, currentSortKey));
|
|
140
130
|
}
|
|
141
131
|
return sortedRows;
|
|
142
132
|
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
emptyStateMsg =
|
|
148
|
-
expanding
|
|
149
|
-
headers
|
|
150
|
-
onUpdateSort
|
|
151
|
-
paginate
|
|
152
|
-
rows
|
|
153
|
-
responsive
|
|
154
|
-
sortable
|
|
155
|
-
sortFunction
|
|
156
|
-
hiddenCaption
|
|
157
|
-
props
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
setSortKey = _useState2[1];
|
|
162
|
-
var _useState3 = (0, _react.useState)(defaultSortDirection),
|
|
163
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
164
|
-
currentSortDirection = _useState4[0],
|
|
165
|
-
setSortDirection = _useState4[1];
|
|
133
|
+
const MainTable = _ref6 => {
|
|
134
|
+
let {
|
|
135
|
+
defaultSort,
|
|
136
|
+
defaultSortDirection,
|
|
137
|
+
emptyStateMsg = "",
|
|
138
|
+
expanding,
|
|
139
|
+
headers,
|
|
140
|
+
onUpdateSort,
|
|
141
|
+
paginate,
|
|
142
|
+
rows,
|
|
143
|
+
responsive,
|
|
144
|
+
sortable,
|
|
145
|
+
sortFunction,
|
|
146
|
+
hiddenCaption,
|
|
147
|
+
...props
|
|
148
|
+
} = _ref6;
|
|
149
|
+
const [currentSortKey, setSortKey] = (0, _react.useState)(defaultSort);
|
|
150
|
+
const [currentSortDirection, setSortDirection] = (0, _react.useState)(defaultSortDirection);
|
|
166
151
|
|
|
167
152
|
// Update the current sort state if the prop changes.
|
|
168
|
-
(0, _react.useEffect)(
|
|
153
|
+
(0, _react.useEffect)(() => {
|
|
169
154
|
setSortKey(defaultSort);
|
|
170
155
|
}, [defaultSort]);
|
|
171
156
|
|
|
172
157
|
// Update the current sort direction state if the prop changes.
|
|
173
|
-
(0, _react.useEffect)(
|
|
158
|
+
(0, _react.useEffect)(() => {
|
|
174
159
|
setSortDirection(defaultSortDirection);
|
|
175
160
|
}, [defaultSortDirection]);
|
|
176
|
-
|
|
161
|
+
const updateSort = newSort => {
|
|
177
162
|
setSortKey(newSort);
|
|
178
163
|
onUpdateSort && onUpdateSort(newSort);
|
|
179
164
|
};
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
setCurrentPage = _usePagination.paginate;
|
|
165
|
+
const sortedRows = (0, _react.useMemo)(() => sortRows({
|
|
166
|
+
currentSortDirection,
|
|
167
|
+
currentSortKey,
|
|
168
|
+
rows,
|
|
169
|
+
sortable,
|
|
170
|
+
sortFunction
|
|
171
|
+
}), [currentSortDirection, currentSortKey, rows, sortable, sortFunction]);
|
|
172
|
+
const {
|
|
173
|
+
pageData: finalRows,
|
|
174
|
+
currentPage,
|
|
175
|
+
paginate: setCurrentPage
|
|
176
|
+
} = (0, _hooks.usePagination)(sortedRows, {
|
|
177
|
+
itemsPerPage: paginate,
|
|
178
|
+
autoResetPage: true
|
|
179
|
+
});
|
|
196
180
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Table.default, _extends({
|
|
197
181
|
expanding: expanding,
|
|
198
182
|
responsive: responsive
|
|
@@ -210,9 +194,9 @@ var MainTable = function MainTable(_ref6) {
|
|
|
210
194
|
// If the table has no rows, return empty state message
|
|
211
195
|
Object.entries(finalRows).length === 0 && emptyStateMsg ? /*#__PURE__*/_react.default.createElement("caption", null, emptyStateMsg) : /*#__PURE__*/_react.default.createElement("tbody", null, generateRows({
|
|
212
196
|
rows: finalRows,
|
|
213
|
-
headers
|
|
214
|
-
responsive
|
|
215
|
-
expanding
|
|
197
|
+
headers,
|
|
198
|
+
responsive,
|
|
199
|
+
expanding
|
|
216
200
|
}))), paginate && rows && rows.length > 0 && /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
217
201
|
currentPage: currentPage,
|
|
218
202
|
itemsPerPage: paginate,
|
|
@@ -223,5 +207,4 @@ var MainTable = function MainTable(_ref6) {
|
|
|
223
207
|
totalItems: rows.length
|
|
224
208
|
}));
|
|
225
209
|
};
|
|
226
|
-
var _default = MainTable;
|
|
227
|
-
exports.default = _default;
|
|
210
|
+
var _default = exports.default = MainTable;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -8,32 +7,31 @@ exports.default = exports.Modal = void 0;
|
|
|
8
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _useId = require("../../hooks/useId");
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
const Modal = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
buttonRow,
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
close,
|
|
20
|
+
title,
|
|
21
|
+
...wrapperProps
|
|
22
|
+
} = _ref;
|
|
25
23
|
// list of focusable selectors is based on this Stack Overflow answer:
|
|
26
24
|
// https://stackoverflow.com/a/30753870/3732840
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
const focusableElementSelectors = 'a[href]:not([tabindex="-1"]), button:not([disabled]), textarea:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([tabindex="-1"]), select:not([disabled]):not([tabindex="-1"]), area[href]:not([tabindex="-1"]), iframe:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"]), [contentEditable=true]:not([tabindex="-1"])';
|
|
26
|
+
const descriptionId = (0, _useId.useId)();
|
|
27
|
+
const titleId = (0, _useId.useId)();
|
|
28
|
+
const shouldClose = (0, _react.useRef)(false);
|
|
29
|
+
const modalRef = (0, _react.useRef)(null);
|
|
30
|
+
const focusableModalElements = (0, _react.useRef)(null);
|
|
31
|
+
const handleTabKey = e => {
|
|
34
32
|
if (focusableModalElements.current.length > 0) {
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const firstElement = focusableModalElements.current[0];
|
|
34
|
+
const lastElement = focusableModalElements.current[focusableModalElements.current.length - 1];
|
|
37
35
|
if (!e.shiftKey && document.activeElement === lastElement) {
|
|
38
36
|
firstElement.focus();
|
|
39
37
|
e.preventDefault();
|
|
@@ -44,7 +42,7 @@ var Modal = function Modal(_ref) {
|
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
};
|
|
47
|
-
|
|
45
|
+
const handleEscKey = e => {
|
|
48
46
|
if ("nativeEvent" in e && e.nativeEvent.stopImmediatePropagation) {
|
|
49
47
|
e.nativeEvent.stopImmediatePropagation();
|
|
50
48
|
} else if ("stopImmediatePropagation" in e) {
|
|
@@ -54,42 +52,44 @@ var Modal = function Modal(_ref) {
|
|
|
54
52
|
}
|
|
55
53
|
close();
|
|
56
54
|
};
|
|
57
|
-
|
|
58
|
-
(0, _react.useEffect)(
|
|
55
|
+
const keyListenersMap = new Map([["Escape", handleEscKey], ["Tab", handleTabKey]]);
|
|
56
|
+
(0, _react.useEffect)(() => {
|
|
59
57
|
modalRef.current.focus();
|
|
60
58
|
}, [modalRef]);
|
|
61
|
-
(0, _react.useEffect)(
|
|
59
|
+
(0, _react.useEffect)(() => {
|
|
62
60
|
var _focusableModalElemen;
|
|
63
61
|
focusableModalElements.current = modalRef.current.querySelectorAll(focusableElementSelectors);
|
|
64
|
-
|
|
62
|
+
let focusIndex = 0;
|
|
65
63
|
// when the close button is rendered, focus on the 2nd content element and not the close btn.
|
|
66
64
|
if (close && focusableModalElements.current.length > 1) {
|
|
67
65
|
focusIndex = 1;
|
|
68
66
|
}
|
|
69
|
-
(_focusableModalElemen = focusableModalElements.current[focusIndex]) === null || _focusableModalElemen === void 0
|
|
67
|
+
(_focusableModalElemen = focusableModalElements.current[focusIndex]) === null || _focusableModalElemen === void 0 || _focusableModalElemen.focus({
|
|
68
|
+
preventScroll: true
|
|
69
|
+
});
|
|
70
70
|
}, [close]);
|
|
71
|
-
(0, _react.useEffect)(
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
(0, _react.useEffect)(() => {
|
|
72
|
+
const keyDown = e => {
|
|
73
|
+
const listener = keyListenersMap.get(e.code);
|
|
74
74
|
return listener && listener(e);
|
|
75
75
|
};
|
|
76
76
|
document.addEventListener("keydown", keyDown);
|
|
77
|
-
return
|
|
77
|
+
return () => {
|
|
78
78
|
document.removeEventListener("keydown", keyDown);
|
|
79
79
|
};
|
|
80
80
|
});
|
|
81
|
-
|
|
81
|
+
const handleContentOnMouseDown = () => {
|
|
82
82
|
shouldClose.current = false;
|
|
83
83
|
};
|
|
84
|
-
|
|
84
|
+
const handleContentOnMouseUp = () => {
|
|
85
85
|
shouldClose.current = false;
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
const handleOverlayOnMouseDown = event => {
|
|
88
88
|
if (event.target === modalRef.current) {
|
|
89
89
|
shouldClose.current = true;
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
|
|
92
|
+
const handleOverlayOnClick = () => {
|
|
93
93
|
if (shouldClose.current) {
|
|
94
94
|
close();
|
|
95
95
|
}
|
|
@@ -124,5 +124,4 @@ var Modal = function Modal(_ref) {
|
|
|
124
124
|
}, buttonRow)));
|
|
125
125
|
};
|
|
126
126
|
exports.Modal = Modal;
|
|
127
|
-
var _default = Modal;
|
|
128
|
-
exports.default = _default;
|
|
127
|
+
var _default = exports.default = Modal;
|
|
@@ -11,42 +11,33 @@ var _TableRow = _interopRequireDefault(require("../TableRow"));
|
|
|
11
11
|
var _TableHeader = _interopRequireDefault(require("../TableHeader"));
|
|
12
12
|
var _TableCell = _interopRequireDefault(require("../TableCell"));
|
|
13
13
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
14
|
-
var _excluded = ["data", "columns", "emptyMsg", "footer", "sortable", "getHeaderProps", "getRowProps", "getCellProps", "getRowId", "initialSortColumn", "initialSortDirection", "autoResetSortBy"];
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
18
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
17
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
20
|
-
|
|
21
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
27
|
-
var generateCell = function generateCell(cell, getCellProps) {
|
|
18
|
+
const generateCell = (cell, getCellProps) => {
|
|
28
19
|
var _cell$column$getCellI, _cell$column;
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
const hasColumnIcon = cell.column.getCellIcon;
|
|
21
|
+
const iconName = hasColumnIcon && ((_cell$column$getCellI = (_cell$column = cell.column).getCellIcon) === null || _cell$column$getCellI === void 0 ? void 0 : _cell$column$getCellI.call(_cell$column, cell));
|
|
31
22
|
return /*#__PURE__*/_react.default.createElement(_TableCell.default, cell.getCellProps([{
|
|
32
23
|
className: cell.column.className
|
|
33
24
|
}, {
|
|
34
25
|
className: hasColumnIcon ? "p-table__cell--icon-placeholder" : ""
|
|
35
|
-
},
|
|
26
|
+
}, {
|
|
27
|
+
...(getCellProps === null || getCellProps === void 0 ? void 0 : getCellProps(cell))
|
|
28
|
+
}]), iconName && /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
36
29
|
name: iconName
|
|
37
30
|
}), cell.render("Cell"));
|
|
38
31
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
rows.forEach(
|
|
32
|
+
const generateRows = (rows, prepareRow, getRowProps, getCellProps) => {
|
|
33
|
+
let tableRows = [];
|
|
34
|
+
rows.forEach(row => {
|
|
42
35
|
var _row$subRows;
|
|
43
36
|
// This function is responsible for lazily preparing a row for rendering.
|
|
44
37
|
// Any row that you intend to render in your table needs to be passed to this function before every render.
|
|
45
38
|
// see: https://react-table.tanstack.com/docs/api/useTable#instance-properties
|
|
46
39
|
prepareRow(row);
|
|
47
|
-
tableRows.push( /*#__PURE__*/_react.default.createElement(_TableRow.default, row.getRowProps(getRowProps === null || getRowProps === void 0 ? void 0 : getRowProps(row)), row.cells.map(
|
|
48
|
-
return generateCell(cell, getCellProps);
|
|
49
|
-
})));
|
|
40
|
+
tableRows.push( /*#__PURE__*/_react.default.createElement(_TableRow.default, row.getRowProps(getRowProps === null || getRowProps === void 0 ? void 0 : getRowProps(row)), row.cells.map(cell => generateCell(cell, getCellProps))));
|
|
50
41
|
if ((_row$subRows = row.subRows) !== null && _row$subRows !== void 0 && _row$subRows.length) {
|
|
51
42
|
tableRows = tableRows.concat(generateRows(row.subRows, prepareRow, getRowProps, getCellProps));
|
|
52
43
|
}
|
|
@@ -54,49 +45,47 @@ var generateRows = function generateRows(rows, prepareRow, getRowProps, getCellP
|
|
|
54
45
|
return tableRows;
|
|
55
46
|
};
|
|
56
47
|
function ModularTable(_ref) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
autoResetSortBy =
|
|
70
|
-
props
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
48
|
+
let {
|
|
49
|
+
data,
|
|
50
|
+
columns,
|
|
51
|
+
emptyMsg,
|
|
52
|
+
footer,
|
|
53
|
+
sortable,
|
|
54
|
+
getHeaderProps,
|
|
55
|
+
getRowProps,
|
|
56
|
+
getCellProps,
|
|
57
|
+
getRowId,
|
|
58
|
+
initialSortColumn,
|
|
59
|
+
initialSortDirection,
|
|
60
|
+
autoResetSortBy = false,
|
|
61
|
+
...props
|
|
62
|
+
} = _ref;
|
|
63
|
+
const sortBy = (0, _react.useMemo)(() => initialSortColumn ? [{
|
|
64
|
+
id: initialSortColumn,
|
|
65
|
+
desc: initialSortDirection === "descending"
|
|
66
|
+
}] : [], [initialSortColumn, initialSortDirection]);
|
|
67
|
+
const {
|
|
68
|
+
getTableProps,
|
|
69
|
+
getTableBodyProps,
|
|
70
|
+
headerGroups,
|
|
71
|
+
rows,
|
|
72
|
+
prepareRow
|
|
73
|
+
} = (0, _reactTable.useTable)({
|
|
74
|
+
columns,
|
|
75
|
+
data,
|
|
76
|
+
getRowId: getRowId || undefined,
|
|
77
|
+
initialState: {
|
|
78
|
+
sortBy
|
|
79
|
+
},
|
|
80
|
+
autoResetSortBy
|
|
81
|
+
}, sortable ? _reactTable.useSortBy : undefined);
|
|
82
|
+
const showEmpty = !!emptyMsg && (!rows || rows.length === 0);
|
|
92
83
|
|
|
93
84
|
// Function returns whether table can be sorted by a specific column.
|
|
94
85
|
// Returns true if sorting is enabled for the column and there is text
|
|
95
86
|
// or JSX provided for the header, otherwise returns false.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
};
|
|
99
|
-
var getColumnSortDirection = function getColumnSortDirection(column) {
|
|
87
|
+
const isColumnSortable = column => column.canSort && ( /*#__PURE__*/(0, _react.isValidElement)(column.Header) || (typeof column.Header === "string" || typeof column.Header === "number") && !!String(column.Header).trim());
|
|
88
|
+
const getColumnSortDirection = column => {
|
|
100
89
|
if (!isColumnSortable(column)) {
|
|
101
90
|
return undefined;
|
|
102
91
|
}
|
|
@@ -105,25 +94,22 @@ function ModularTable(_ref) {
|
|
|
105
94
|
}
|
|
106
95
|
return column.isSortedDesc ? "descending" : "ascending";
|
|
107
96
|
};
|
|
108
|
-
return /*#__PURE__*/_react.default.createElement(_Table.default, _extends({}, getTableProps(), props), /*#__PURE__*/_react.default.createElement("thead", null, headerGroups.map(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}));
|
|
122
|
-
})), /*#__PURE__*/_react.default.createElement("tbody", getTableBodyProps(), generateRows(rows, prepareRow, getRowProps, getCellProps), showEmpty && /*#__PURE__*/_react.default.createElement(_TableRow.default, null, /*#__PURE__*/_react.default.createElement(_TableCell.default, {
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement(_Table.default, _extends({}, getTableProps(), props), /*#__PURE__*/_react.default.createElement("thead", null, headerGroups.map(headerGroup => /*#__PURE__*/_react.default.createElement(_TableRow.default, headerGroup.getHeaderGroupProps(), headerGroup.headers.map(column => /*#__PURE__*/_react.default.createElement(_TableHeader.default, _extends({
|
|
98
|
+
sort: getColumnSortDirection(column)
|
|
99
|
+
}, column.getHeaderProps([{
|
|
100
|
+
className: column.className
|
|
101
|
+
}, {
|
|
102
|
+
className: column.getCellIcon ? "p-table__cell--icon-placeholder" : ""
|
|
103
|
+
}, {
|
|
104
|
+
...(getHeaderProps === null || getHeaderProps === void 0 ? void 0 : getHeaderProps(column))
|
|
105
|
+
},
|
|
106
|
+
// Only call this if we want it to be sortable too.
|
|
107
|
+
sortable && isColumnSortable(column) ? column.getSortByToggleProps({
|
|
108
|
+
title: undefined
|
|
109
|
+
}) : {}])), column.render("Header")))))), /*#__PURE__*/_react.default.createElement("tbody", getTableBodyProps(), generateRows(rows, prepareRow, getRowProps, getCellProps), showEmpty && /*#__PURE__*/_react.default.createElement(_TableRow.default, null, /*#__PURE__*/_react.default.createElement(_TableCell.default, {
|
|
123
110
|
colSpan: columns.length
|
|
124
111
|
}, emptyMsg)), footer && /*#__PURE__*/_react.default.createElement(_TableRow.default, null, /*#__PURE__*/_react.default.createElement(_TableCell.default, {
|
|
125
112
|
colSpan: columns.length
|
|
126
113
|
}, footer))));
|
|
127
114
|
}
|
|
128
|
-
var _default = ModularTable;
|
|
129
|
-
exports.default = _default;
|
|
115
|
+
var _default = exports.default = ModularTable;
|