@unbxd-ui/unbxd-react-components 0.2.107-beta.2 → 0.2.108-beta.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/components/Accordian/Accordian.js +13 -45
- package/components/Accordian/Accordian.stories.js +6 -25
- package/components/Accordian/index.js +0 -3
- package/components/Button/Button.js +9 -26
- package/components/Button/Button.stories.js +1 -14
- package/components/Button/DropdownButton.js +9 -31
- package/components/Button/DropdownButton.stories.js +6 -23
- package/components/Button/index.js +1 -8
- package/components/DataLoader/DataLoader.js +10 -40
- package/components/DataLoader/DataLoader.stories.js +5 -30
- package/components/DataLoader/index.js +0 -3
- package/components/Form/Checkbox.js +18 -43
- package/components/Form/DragDropFileUploader.js +12 -42
- package/components/Form/Dropdown.js +106 -182
- package/components/Form/FileUploader.js +10 -32
- package/components/Form/Form.js +15 -45
- package/components/Form/FormElementWrapper.js +2 -7
- package/components/Form/Input.js +27 -72
- package/components/Form/RadioList.js +20 -49
- package/components/Form/RangeSlider.js +39 -74
- package/components/Form/ServerPaginatedDDList.js +86 -130
- package/components/Form/Textarea.js +18 -43
- package/components/Form/Toggle.js +16 -48
- package/components/Form/index.js +18 -30
- package/components/Form/stories/Checkbox.stories.js +1 -12
- package/components/Form/stories/DragDropFileUploader.stories.js +0 -8
- package/components/Form/stories/Dropdown.stories.js +6 -24
- package/components/Form/stories/FileUploader.stories.js +0 -8
- package/components/Form/stories/FormDefault.stories.js +1 -21
- package/components/Form/stories/RadioList.stories.js +1 -12
- package/components/Form/stories/RangeSlider.stories.js +1 -15
- package/components/Form/stories/TextInput.stories.js +3 -19
- package/components/Form/stories/Textarea.stories.js +1 -12
- package/components/Form/stories/Toggle.stories.js +0 -7
- package/components/Form/stories/form.stories.js +3 -40
- package/components/InlineModal/InlineModal.js +14 -51
- package/components/InlineModal/InlineModal.stories.js +2 -14
- package/components/InlineModal/index.js +1 -6
- package/components/List/List.js +9 -24
- package/components/List/index.js +0 -3
- package/components/List/list.stories.js +0 -10
- package/components/Modal/Modal.js +17 -49
- package/components/Modal/Modal.stories.js +1 -15
- package/components/Modal/index.js +0 -3
- package/components/NotificationComponent/NotificationComponent.js +11 -34
- package/components/NotificationComponent/NotificationComponent.stories.js +0 -6
- package/components/NotificationComponent/index.js +0 -3
- package/components/ProgressBar/ProgressBar.js +2 -11
- package/components/ProgressBar/ProgressBar.stories.js +0 -6
- package/components/ProgressBar/index.js +0 -3
- package/components/Table/BaseTable.js +69 -134
- package/components/Table/PaginationComponent.js +11 -23
- package/components/Table/Table.js +68 -149
- package/components/Table/Table.stories.js +22 -67
- package/components/Table/index.js +0 -4
- package/components/TabsComponent/TabsComponent.js +20 -57
- package/components/TabsComponent/TabsComponent.stories.js +0 -16
- package/components/TabsComponent/index.js +0 -3
- package/components/Tooltip/Tooltip.js +25 -47
- package/components/Tooltip/Tooltip.stories.js +0 -6
- package/components/Tooltip/index.js +0 -3
- package/components/core.css +3 -1
- package/components/index.js +1 -17
- package/components/theme.css +2 -0
- package/package.json +3 -2
- package/.babelrc +0 -4
- package/.eslintrc.js +0 -38
- package/CONTRIBUTE.md +0 -105
- package/README.md +0 -82
- package/lib/components/Accordian/Accordian.js +0 -117
- package/lib/components/Accordian/Accordian.stories.js +0 -137
- package/lib/components/Accordian/index.js +0 -10
- package/lib/components/Button/Button.js +0 -84
- package/lib/components/Button/Button.stories.js +0 -89
- package/lib/components/Button/DropdownButton.js +0 -77
- package/lib/components/Button/DropdownButton.stories.js +0 -51
- package/lib/components/Button/index.js +0 -32
- package/lib/components/DataLoader/DataLoader.js +0 -88
- package/lib/components/DataLoader/DataLoader.stories.js +0 -77
- package/lib/components/DataLoader/index.js +0 -10
- package/lib/components/Form/Checkbox.js +0 -93
- package/lib/components/Form/DragDropFileUploader.js +0 -85
- package/lib/components/Form/Dropdown.js +0 -478
- package/lib/components/Form/FileUploader.js +0 -81
- package/lib/components/Form/Form.js +0 -106
- package/lib/components/Form/FormElementWrapper.js +0 -27
- package/lib/components/Form/Input.js +0 -140
- package/lib/components/Form/RadioList.js +0 -111
- package/lib/components/Form/RangeSlider.js +0 -142
- package/lib/components/Form/ServerPaginatedDDList.js +0 -267
- package/lib/components/Form/Textarea.js +0 -95
- package/lib/components/Form/Toggle.js +0 -117
- package/lib/components/Form/index.js +0 -73
- package/lib/components/Form/stories/Checkbox.stories.js +0 -54
- package/lib/components/Form/stories/DragDropFileUploader.stories.js +0 -27
- package/lib/components/Form/stories/Dropdown.stories.js +0 -114
- package/lib/components/Form/stories/FileUploader.stories.js +0 -31
- package/lib/components/Form/stories/FormDefault.stories.js +0 -117
- package/lib/components/Form/stories/RadioList.stories.js +0 -55
- package/lib/components/Form/stories/RangeSlider.stories.js +0 -82
- package/lib/components/Form/stories/TextInput.stories.js +0 -79
- package/lib/components/Form/stories/Textarea.stories.js +0 -48
- package/lib/components/Form/stories/Toggle.stories.js +0 -25
- package/lib/components/Form/stories/form.stories.js +0 -240
- package/lib/components/InlineModal/InlineModal.js +0 -146
- package/lib/components/InlineModal/InlineModal.stories.js +0 -61
- package/lib/components/InlineModal/index.js +0 -24
- package/lib/components/List/List.js +0 -76
- package/lib/components/List/index.js +0 -10
- package/lib/components/List/list.stories.js +0 -38
- package/lib/components/Modal/Modal.js +0 -117
- package/lib/components/Modal/Modal.stories.js +0 -55
- package/lib/components/Modal/index.js +0 -10
- package/lib/components/NotificationComponent/NotificationComponent.js +0 -76
- package/lib/components/NotificationComponent/NotificationComponent.stories.js +0 -29
- package/lib/components/NotificationComponent/index.js +0 -10
- package/lib/components/ProgressBar/ProgressBar.js +0 -49
- package/lib/components/ProgressBar/ProgressBar.stories.js +0 -21
- package/lib/components/ProgressBar/index.js +0 -10
- package/lib/components/Table/BaseTable.js +0 -352
- package/lib/components/Table/PaginationComponent.js +0 -87
- package/lib/components/Table/Table.js +0 -333
- package/lib/components/Table/Table.stories.js +0 -204
- package/lib/components/Table/index.js +0 -17
- package/lib/components/TabsComponent/TabsComponent.js +0 -134
- package/lib/components/TabsComponent/TabsComponent.stories.js +0 -65
- package/lib/components/TabsComponent/index.js +0 -10
- package/lib/components/Tooltip/Tooltip.js +0 -102
- package/lib/components/Tooltip/Tooltip.stories.js +0 -25
- package/lib/components/Tooltip/index.js +0 -10
- package/lib/components/core.css +0 -3
- package/lib/components/core.scss +0 -29
- package/lib/components/index.js +0 -159
- package/lib/components/theme.css +0 -3
- package/lib/components/theme.scss +0 -11
- package/lib/package-lock.json +0 -20607
- package/lib/package.json +0 -94
- package/src/Intro.stories.mdx +0 -119
- package/src/components/Accordian/Accordian.js +0 -89
- package/src/components/Accordian/Accordian.stories.js +0 -92
- package/src/components/Accordian/accordianCore.css +0 -1
- package/src/components/Accordian/accordianCore.scss +0 -8
- package/src/components/Accordian/accordianTheme.css +0 -1
- package/src/components/Accordian/accordianTheme.scss +0 -6
- package/src/components/Accordian/index.js +0 -3
- package/src/components/Button/Button.js +0 -67
- package/src/components/Button/Button.stories.js +0 -103
- package/src/components/Button/DropdownButton.js +0 -60
- package/src/components/Button/DropdownButton.stories.js +0 -38
- package/src/components/Button/button.css +0 -1
- package/src/components/Button/buttonTheme.css +0 -1
- package/src/components/Button/buttonTheme.scss +0 -45
- package/src/components/Button/index.js +0 -5
- package/src/components/DataLoader/DataLoader.js +0 -86
- package/src/components/DataLoader/DataLoader.stories.js +0 -72
- package/src/components/DataLoader/index.js +0 -3
- package/src/components/Form/Checkbox.js +0 -73
- package/src/components/Form/DragDropFileUploader.js +0 -67
- package/src/components/Form/Dropdown.js +0 -430
- package/src/components/Form/FileUploader.js +0 -64
- package/src/components/Form/Form.js +0 -83
- package/src/components/Form/FormElementWrapper.js +0 -22
- package/src/components/Form/Input.js +0 -121
- package/src/components/Form/RadioList.js +0 -86
- package/src/components/Form/RangeSlider.js +0 -100
- package/src/components/Form/ServerPaginatedDDList.js +0 -231
- package/src/components/Form/Textarea.js +0 -76
- package/src/components/Form/Toggle.js +0 -96
- package/src/components/Form/form.css +0 -1
- package/src/components/Form/formCore.css +0 -1
- package/src/components/Form/formCore.scss +0 -142
- package/src/components/Form/formTheme.css +0 -1
- package/src/components/Form/formTheme.scss +0 -27
- package/src/components/Form/index.js +0 -13
- package/src/components/Form/stories/Checkbox.stories.js +0 -41
- package/src/components/Form/stories/DragDropFileUploader.stories.js +0 -21
- package/src/components/Form/stories/Dropdown.stories.js +0 -124
- package/src/components/Form/stories/FileUploader.stories.js +0 -21
- package/src/components/Form/stories/FormDefault.stories.js +0 -87
- package/src/components/Form/stories/RadioList.stories.js +0 -48
- package/src/components/Form/stories/RangeSlider.stories.js +0 -84
- package/src/components/Form/stories/TextInput.stories.js +0 -77
- package/src/components/Form/stories/Textarea.stories.js +0 -43
- package/src/components/Form/stories/Toggle.stories.js +0 -14
- package/src/components/Form/stories/form.stories.js +0 -216
- package/src/components/InlineModal/InlineModal.js +0 -135
- package/src/components/InlineModal/InlineModal.stories.js +0 -54
- package/src/components/InlineModal/index.js +0 -4
- package/src/components/InlineModal/inlineModal.css +0 -1
- package/src/components/InlineModal/inlineModalCore.css +0 -1
- package/src/components/InlineModal/inlineModalCore.scss +0 -31
- package/src/components/InlineModal/inlineModalTheme.css +0 -1
- package/src/components/InlineModal/inlineModalTheme.scss +0 -16
- package/src/components/List/List.js +0 -72
- package/src/components/List/index.js +0 -3
- package/src/components/List/list.css +0 -1
- package/src/components/List/list.stories.js +0 -28
- package/src/components/List/listCore.css +0 -1
- package/src/components/List/listCore.scss +0 -6
- package/src/components/List/listTheme.css +0 -0
- package/src/components/List/listTheme.scss +0 -0
- package/src/components/Modal/Modal.js +0 -99
- package/src/components/Modal/Modal.stories.js +0 -54
- package/src/components/Modal/index.js +0 -3
- package/src/components/Modal/modal.css +0 -1
- package/src/components/Modal/modalCore.css +0 -1
- package/src/components/Modal/modalCore.scss +0 -34
- package/src/components/Modal/modalTheme.css +0 -0
- package/src/components/Modal/modalTheme.scss +0 -0
- package/src/components/NotificationComponent/NotificationComponent.js +0 -58
- package/src/components/NotificationComponent/NotificationComponent.stories.js +0 -28
- package/src/components/NotificationComponent/index.js +0 -3
- package/src/components/NotificationComponent/notificationComponent.css +0 -1
- package/src/components/NotificationComponent/notificationTheme.css +0 -1
- package/src/components/NotificationComponent/notificationTheme.scss +0 -30
- package/src/components/ProgressBar/ProgressBar.js +0 -45
- package/src/components/ProgressBar/ProgressBar.stories.js +0 -14
- package/src/components/ProgressBar/index.js +0 -3
- package/src/components/ProgressBar/progressBar.css +0 -1
- package/src/components/ProgressBar/progressBarCore.css +0 -1
- package/src/components/ProgressBar/progressBarCore.scss +0 -14
- package/src/components/ProgressBar/progressBarTheme.css +0 -0
- package/src/components/ProgressBar/progressBarTheme.scss +0 -0
- package/src/components/Table/BaseTable.js +0 -306
- package/src/components/Table/PaginationComponent.js +0 -73
- package/src/components/Table/Table.js +0 -295
- package/src/components/Table/Table.stories.js +0 -198
- package/src/components/Table/index.js +0 -8
- package/src/components/Table/table.css +0 -1
- package/src/components/Table/tableCore.css +0 -1
- package/src/components/Table/tableCore.scss +0 -94
- package/src/components/Table/tableTheme.css +0 -1
- package/src/components/Table/tableTheme.scss +0 -34
- package/src/components/TabsComponent/TabsComponent.js +0 -99
- package/src/components/TabsComponent/TabsComponent.stories.js +0 -69
- package/src/components/TabsComponent/index.js +0 -3
- package/src/components/TabsComponent/tabs.css +0 -1
- package/src/components/TabsComponent/tabsCore.css +0 -1
- package/src/components/TabsComponent/tabsCore.scss +0 -59
- package/src/components/TabsComponent/tabsTheme.css +0 -0
- package/src/components/TabsComponent/tabsTheme.scss +0 -0
- package/src/components/Tooltip/Tooltip.js +0 -87
- package/src/components/Tooltip/Tooltip.stories.js +0 -16
- package/src/components/Tooltip/index.js +0 -3
- package/src/components/Tooltip/tooltipCore.css +0 -1
- package/src/components/Tooltip/tooltipCore.scss +0 -22
- package/src/components/Tooltip/tooltipTheme.css +0 -1
- package/src/components/Tooltip/tooltipTheme.scss +0 -21
- package/src/components/core.css +0 -1
- package/src/components/core.scss +0 -29
- package/src/components/index.js +0 -38
- package/src/components/theme.css +0 -1
- package/src/components/theme.scss +0 -11
- package/src/core/Validators.js +0 -34
- package/src/core/customHooks.js +0 -20
- package/src/core/dataLoader.js +0 -143
- package/src/core/dataLoader.stories.js +0 -123
- package/src/core/index.js +0 -3
- package/src/core/utils.js +0 -95
- package/src/index.js +0 -68
- package/vscode-templates/NewStoryTemplate.stories.js +0 -8
- /package/{lib/Readme.md → Readme.md} +0 -0
- /package/{lib/components → components}/Accordian/accordianCore.css +0 -0
- /package/{lib/components → components}/Accordian/accordianTheme.css +0 -0
- /package/{lib/components → components}/Button/buttonTheme.css +0 -0
- /package/{lib/components → components}/Form/formCore.css +0 -0
- /package/{lib/components → components}/Form/formTheme.css +0 -0
- /package/{lib/components → components}/InlineModal/inlineModalCore.css +0 -0
- /package/{lib/components → components}/InlineModal/inlineModalTheme.css +0 -0
- /package/{lib/components → components}/List/listCore.css +0 -0
- /package/{lib/components → components}/List/listTheme.css +0 -0
- /package/{lib/components → components}/Modal/modalCore.css +0 -0
- /package/{lib/components → components}/Modal/modalTheme.css +0 -0
- /package/{lib/components → components}/NotificationComponent/notificationTheme.css +0 -0
- /package/{lib/components → components}/ProgressBar/progressBarCore.css +0 -0
- /package/{lib/components → components}/ProgressBar/progressBarTheme.css +0 -0
- /package/{lib/components → components}/Table/tableCore.css +0 -0
- /package/{lib/components → components}/Table/tableTheme.css +0 -0
- /package/{lib/components → components}/TabsComponent/tabsCore.css +0 -0
- /package/{lib/components → components}/TabsComponent/tabsTheme.css +0 -0
- /package/{lib/components → components}/Tooltip/tooltipCore.css +0 -0
- /package/{lib/components → components}/Tooltip/tooltipTheme.css +0 -0
- /package/{lib/core → core}/Validators.js +0 -0
- /package/{lib/core → core}/customHooks.js +0 -0
- /package/{lib/core → core}/dataLoader.js +0 -0
- /package/{lib/core → core}/dataLoader.stories.js +0 -0
- /package/{lib/core → core}/index.js +0 -0
- /package/{lib/core → core}/utils.js +0 -0
- /package/{lib/index.js → index.js} +0 -0
|
@@ -1,60 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
12
|
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; }
|
|
19
|
-
|
|
20
13
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
-
|
|
22
14
|
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."); }
|
|
23
|
-
|
|
24
15
|
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); }
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
29
|
-
|
|
16
|
+
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; }
|
|
17
|
+
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; } }
|
|
30
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
|
-
|
|
32
19
|
var NotificationComponent = function NotificationComponent(props) {
|
|
33
20
|
var _useState = (0, _react.useState)(false),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
hideMessage = _useState2[0],
|
|
23
|
+
setHideMessage = _useState2[1];
|
|
38
24
|
var appearance = props.appearance,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
25
|
+
children = props.children,
|
|
26
|
+
messageId = props.messageId,
|
|
27
|
+
fadeOut = props.fadeOut,
|
|
28
|
+
fadeOutTime = props.fadeOutTime,
|
|
29
|
+
className = props.className;
|
|
44
30
|
var fadeOutMessage = typeof fadeOut !== "undefined" ? fadeOut : appearance === "success";
|
|
45
31
|
var timerID;
|
|
46
|
-
|
|
47
32
|
var clearMessage = function clearMessage() {
|
|
48
33
|
setHideMessage(true);
|
|
49
34
|
};
|
|
50
|
-
|
|
51
35
|
var setClearMessageTimeout = function setClearMessageTimeout() {
|
|
52
36
|
if (fadeOutMessage) {
|
|
53
37
|
timerID && clearTimeout(timerID);
|
|
54
38
|
timerID = setTimeout(clearMessage, fadeOutTime);
|
|
55
39
|
}
|
|
56
40
|
};
|
|
57
|
-
|
|
58
41
|
(0, _react.useEffect)(function () {
|
|
59
42
|
/* RUN ONCE */
|
|
60
43
|
setClearMessageTimeout();
|
|
@@ -64,7 +47,6 @@ var NotificationComponent = function NotificationComponent(props) {
|
|
|
64
47
|
setHideMessage(false);
|
|
65
48
|
setClearMessageTimeout();
|
|
66
49
|
}, [messageId]);
|
|
67
|
-
|
|
68
50
|
if (hideMessage) {
|
|
69
51
|
return null;
|
|
70
52
|
} else {
|
|
@@ -73,20 +55,15 @@ var NotificationComponent = function NotificationComponent(props) {
|
|
|
73
55
|
}, children);
|
|
74
56
|
}
|
|
75
57
|
};
|
|
76
|
-
|
|
77
58
|
NotificationComponent.propTypes = {
|
|
78
59
|
/** Pass any additional classNames to Notification component */
|
|
79
60
|
className: _propTypes["default"].string,
|
|
80
|
-
|
|
81
61
|
/* Unique ID to represent this particular message */
|
|
82
62
|
messageId: _propTypes["default"].number,
|
|
83
|
-
|
|
84
63
|
/* Appearance of the notification message */
|
|
85
64
|
appearance: _propTypes["default"].oneOf(["error", "warning", "success", "info"]),
|
|
86
|
-
|
|
87
65
|
/* Should the message fadeout after (fadeOutTime)ms or not. Default true for success messages only. */
|
|
88
66
|
fadeOut: _propTypes["default"].bool,
|
|
89
|
-
|
|
90
67
|
/* fadeout timer, in milliseconds */
|
|
91
68
|
fadeOutTime: _propTypes["default"].number
|
|
92
69
|
};
|
|
@@ -4,18 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.SimpleUsage = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _NotificationComponent = _interopRequireDefault(require("./NotificationComponent"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
var _default = {
|
|
15
11
|
title: "NotificationComponent"
|
|
16
12
|
};
|
|
17
13
|
exports["default"] = _default;
|
|
18
|
-
|
|
19
14
|
var SimpleUsage = function SimpleUsage() {
|
|
20
15
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_NotificationComponent["default"], {
|
|
21
16
|
appearance: "success",
|
|
@@ -31,5 +26,4 @@ var SimpleUsage = function SimpleUsage() {
|
|
|
31
26
|
messageId: 4
|
|
32
27
|
}, "The job is scheduled. You will get a notification once it is completed."));
|
|
33
28
|
};
|
|
34
|
-
|
|
35
29
|
exports.SimpleUsage = SimpleUsage;
|
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _NotificationComponent = _interopRequireDefault(require("./NotificationComponent"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _NotificationComponent["default"];
|
|
13
10
|
exports["default"] = _default;
|
|
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
var ProgressBar = function ProgressBar(props) {
|
|
15
11
|
var progress = props.progress,
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
height = props.height,
|
|
13
|
+
className = props.className;
|
|
18
14
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
19
15
|
className: "RCB-progress-bar ".concat(className),
|
|
20
16
|
style: {
|
|
@@ -27,26 +23,21 @@ var ProgressBar = function ProgressBar(props) {
|
|
|
27
23
|
}
|
|
28
24
|
}));
|
|
29
25
|
};
|
|
30
|
-
|
|
31
26
|
ProgressBar.propTypes = {
|
|
32
27
|
/** Pass any additional classNames to ProgressBar component */
|
|
33
28
|
className: _propTypes["default"].string,
|
|
34
|
-
|
|
35
29
|
/** Progress value, must be a value between 1 to 100 */
|
|
36
30
|
progress: function progress(props, propName, componentName) {
|
|
37
31
|
if (typeof props[propName] === "undefined") {
|
|
38
32
|
return new Error("Prop `" + propName + "` is required");
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
if (typeof props[propName] !== "number") {
|
|
42
35
|
return new Error("Prop `" + propName + "` must be a number");
|
|
43
36
|
}
|
|
44
|
-
|
|
45
37
|
if (props[propName] < 0 || props[propName] > 100) {
|
|
46
38
|
return new Error("Invalid prop `" + propName + "` supplied to" + " `" + componentName + "`. Value must be between 0 to 100.");
|
|
47
39
|
}
|
|
48
40
|
},
|
|
49
|
-
|
|
50
41
|
/** Height of the progress bar. Values must be valid CSS height values like 40px or 20% etc. */
|
|
51
42
|
height: _propTypes["default"].string
|
|
52
43
|
};
|
|
@@ -4,18 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.SimpleUsage = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _ProgressBar = _interopRequireDefault(require("./ProgressBar"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
var _default = {
|
|
15
11
|
title: "ProgressBar"
|
|
16
12
|
};
|
|
17
13
|
exports["default"] = _default;
|
|
18
|
-
|
|
19
14
|
var SimpleUsage = function SimpleUsage() {
|
|
20
15
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
21
16
|
className: "progress-container"
|
|
@@ -23,5 +18,4 @@ var SimpleUsage = function SimpleUsage() {
|
|
|
23
18
|
progress: 40
|
|
24
19
|
}));
|
|
25
20
|
};
|
|
26
|
-
|
|
27
21
|
exports.SimpleUsage = SimpleUsage;
|
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _ProgressBar = _interopRequireDefault(require("./ProgressBar"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _ProgressBar["default"];
|
|
13
10
|
exports["default"] = _default;
|
|
@@ -1,82 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _utils = _interopRequireDefault(require("../../core/utils"));
|
|
15
|
-
|
|
16
11
|
var _Checkbox = _interopRequireDefault(require("../Form/Checkbox"));
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
14
|
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; }
|
|
23
|
-
|
|
24
15
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
|
-
|
|
26
16
|
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."); }
|
|
27
|
-
|
|
28
17
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
29
|
-
|
|
30
18
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
37
|
-
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
|
+
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); }
|
|
38
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
|
-
|
|
40
25
|
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."); }
|
|
41
|
-
|
|
42
26
|
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); }
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
47
|
-
|
|
27
|
+
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; }
|
|
28
|
+
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; } }
|
|
48
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
|
-
|
|
50
|
-
function _extends() { _extends = Object.assign || 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); }
|
|
51
|
-
|
|
30
|
+
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); }
|
|
52
31
|
var DEFAULT_CHECKBOX_CONFIG = {
|
|
53
32
|
enabled: false,
|
|
54
33
|
showInHeader: true
|
|
55
34
|
};
|
|
56
|
-
|
|
57
35
|
var DefaultNoDataComponent = function DefaultNoDataComponent() {
|
|
58
36
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
59
37
|
className: "RCB-no-data"
|
|
60
38
|
}, "No data found");
|
|
61
39
|
};
|
|
62
|
-
/* eslint-disable react/prop-types */
|
|
63
40
|
|
|
41
|
+
/* eslint-disable react/prop-types */
|
|
64
42
|
|
|
65
43
|
var getTDValue = function getTDValue(_ref) {
|
|
66
44
|
var columnValue = _ref.columnValue,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
45
|
+
_ref$rowData = _ref.rowData,
|
|
46
|
+
rowData = _ref$rowData === void 0 ? {} : _ref$rowData,
|
|
47
|
+
_ref$columnConfig = _ref.columnConfig,
|
|
48
|
+
columnConfig = _ref$columnConfig === void 0 ? {} : _ref$columnConfig,
|
|
49
|
+
_ref$tdProps = _ref.tdProps,
|
|
50
|
+
tdProps = _ref$tdProps === void 0 ? {} : _ref$tdProps;
|
|
73
51
|
var key = columnConfig.key,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
52
|
+
valueFormatter = columnConfig.valueFormatter,
|
|
53
|
+
ColumnComponent = columnConfig.ColumnComponent,
|
|
54
|
+
_columnConfig$compone = columnConfig.componentProps,
|
|
55
|
+
componentProps = _columnConfig$compone === void 0 ? {} : _columnConfig$compone;
|
|
78
56
|
var tdValue = columnValue;
|
|
79
|
-
|
|
80
57
|
if (typeof valueFormatter === "function") {
|
|
81
58
|
tdValue = valueFormatter({
|
|
82
59
|
value: columnValue,
|
|
@@ -87,46 +64,38 @@ var getTDValue = function getTDValue(_ref) {
|
|
|
87
64
|
record: rowData
|
|
88
65
|
}, componentProps));
|
|
89
66
|
}
|
|
90
|
-
|
|
91
67
|
return /*#__PURE__*/_react["default"].createElement("td", _extends({
|
|
92
68
|
key: key
|
|
93
69
|
}, tdProps), tdValue);
|
|
94
70
|
};
|
|
95
|
-
|
|
96
71
|
var ExpandableTR = function ExpandableTR(props) {
|
|
97
72
|
var rowIndex = props.rowIndex,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
73
|
+
rowData = props.rowData,
|
|
74
|
+
columnConfigs = props.columnConfigs,
|
|
75
|
+
isEven = props.isEven,
|
|
76
|
+
ExpandedRowComponent = props.ExpandedRowComponent,
|
|
77
|
+
showCheckbox = props.showCheckbox,
|
|
78
|
+
checkboxChangeCounter = props.checkboxChangeCounter,
|
|
79
|
+
checkboxValue = props.checkboxValue,
|
|
80
|
+
onSelectionChange = props.onSelectionChange;
|
|
107
81
|
var _useState = (0, _react.useState)(checkboxValue || false),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
82
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
83
|
+
selected = _useState2[0],
|
|
84
|
+
setSelected = _useState2[1];
|
|
112
85
|
var _useState3 = (0, _react.useState)(false),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
86
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
87
|
+
isExpanded = _useState4[0],
|
|
88
|
+
setIsExpanded = _useState4[1];
|
|
117
89
|
var onChange = function onChange(value) {
|
|
118
90
|
setSelected(value);
|
|
119
91
|
onSelectionChange(rowData, value);
|
|
120
92
|
};
|
|
121
|
-
|
|
122
93
|
(0, _react.useEffect)(function () {
|
|
123
94
|
setSelected(checkboxValue);
|
|
124
95
|
}, [checkboxChangeCounter, checkboxValue]);
|
|
125
|
-
|
|
126
96
|
var toggleExpanded = function toggleExpanded() {
|
|
127
97
|
setIsExpanded(!isExpanded);
|
|
128
98
|
};
|
|
129
|
-
|
|
130
99
|
var className = "RCB-tr RCB-parent-row " + (isEven ? "RCB-even-tr" : "RCB-odd-tr");
|
|
131
100
|
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("tr", {
|
|
132
101
|
className: className
|
|
@@ -165,34 +134,28 @@ var ExpandableTR = function ExpandableTR(props) {
|
|
|
165
134
|
parentRecord: rowData
|
|
166
135
|
}))));
|
|
167
136
|
};
|
|
168
|
-
|
|
169
137
|
ExpandableTR.propTypes = {
|
|
170
138
|
ExpandedRowComponent: _propTypes["default"].any.isRequired // TODO : check for a React Component
|
|
171
|
-
|
|
172
139
|
};
|
|
173
140
|
|
|
174
141
|
var TR = function TR(props) {
|
|
175
142
|
var rowIndex = props.rowIndex,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
143
|
+
rowData = props.rowData,
|
|
144
|
+
columnConfigs = props.columnConfigs,
|
|
145
|
+
isEven = props.isEven,
|
|
146
|
+
showCheckbox = props.showCheckbox,
|
|
147
|
+
checkboxChangeCounter = props.checkboxChangeCounter,
|
|
148
|
+
checkboxValue = props.checkboxValue,
|
|
149
|
+
onSelectionChange = props.onSelectionChange;
|
|
184
150
|
var _useState5 = (0, _react.useState)(checkboxValue || false),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
151
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
152
|
+
selected = _useState6[0],
|
|
153
|
+
setSelected = _useState6[1];
|
|
189
154
|
var className = "RCB-tr " + (isEven ? "RCB-even-tr" : "RCB-odd-tr");
|
|
190
|
-
|
|
191
155
|
var onChange = function onChange(value) {
|
|
192
156
|
setSelected(value);
|
|
193
157
|
onSelectionChange(rowData, value);
|
|
194
158
|
};
|
|
195
|
-
|
|
196
159
|
(0, _react.useEffect)(function () {
|
|
197
160
|
setSelected(checkboxValue);
|
|
198
161
|
}, [checkboxChangeCounter, checkboxValue]);
|
|
@@ -215,43 +178,35 @@ var TR = function TR(props) {
|
|
|
215
178
|
});
|
|
216
179
|
}));
|
|
217
180
|
};
|
|
218
|
-
|
|
219
181
|
var BaseTable = function BaseTable(props, ref) {
|
|
220
182
|
var className = props.className,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
183
|
+
records = props.records,
|
|
184
|
+
columnConfigs = props.columnConfigs,
|
|
185
|
+
idAttribute = props.idAttribute,
|
|
186
|
+
checkboxConfig = props.checkboxConfig,
|
|
187
|
+
isExpandableTable = props.isExpandableTable,
|
|
188
|
+
ExpandedRowComponent = props.ExpandedRowComponent,
|
|
189
|
+
noDataComponent = props.noDataComponent,
|
|
190
|
+
sortByConfig = props.sortByConfig,
|
|
191
|
+
resetPageNo = props.resetPageNo;
|
|
231
192
|
var _DEFAULT_CHECKBOX_CON = _objectSpread(_objectSpread({}, DEFAULT_CHECKBOX_CONFIG), checkboxConfig || {}),
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
193
|
+
showCheckbox = _DEFAULT_CHECKBOX_CON.enabled,
|
|
194
|
+
showInHeader = _DEFAULT_CHECKBOX_CON.showInHeader;
|
|
235
195
|
var sortBy = sortByConfig.sortBy,
|
|
236
|
-
|
|
237
|
-
|
|
196
|
+
sortOrder = sortByConfig.sortOrder;
|
|
238
197
|
var _useState7 = (0, _react.useState)(false),
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
198
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
199
|
+
checkboxValue = _useState8[0],
|
|
200
|
+
setCheckboxValue = _useState8[1];
|
|
243
201
|
var _useState9 = (0, _react.useState)(0),
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
202
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
203
|
+
checkboxChangeCounter = _useState10[0],
|
|
204
|
+
setChangeCounter = _useState10[1];
|
|
248
205
|
var _useState11 = (0, _react.useState)([]),
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
206
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
207
|
+
selected = _useState12[0],
|
|
208
|
+
setSelected = _useState12[1];
|
|
253
209
|
var RowComponent = isExpandableTable ? ExpandableTR : TR;
|
|
254
|
-
|
|
255
210
|
var onSelectionChange = function onSelectionChange(record, checked) {
|
|
256
211
|
if (checked) {
|
|
257
212
|
/* add to selected array */
|
|
@@ -264,32 +219,26 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
264
219
|
setSelected(newSelected);
|
|
265
220
|
}
|
|
266
221
|
};
|
|
267
|
-
|
|
268
222
|
var getSelectedRows = function getSelectedRows() {
|
|
269
223
|
return selected;
|
|
270
224
|
};
|
|
271
|
-
|
|
272
225
|
var updateCheckboxValue = function updateCheckboxValue(newValue) {
|
|
273
226
|
setCheckboxValue(newValue);
|
|
274
227
|
setChangeCounter(checkboxChangeCounter + 1);
|
|
275
228
|
};
|
|
276
|
-
|
|
277
229
|
var resetSelected = function resetSelected() {
|
|
278
230
|
updateCheckboxValue(false);
|
|
279
231
|
setSelected([]);
|
|
280
232
|
};
|
|
281
|
-
|
|
282
233
|
var toggleSelectAll = function toggleSelectAll() {
|
|
283
234
|
var checked = !checkboxValue;
|
|
284
235
|
updateCheckboxValue(checked);
|
|
285
|
-
|
|
286
236
|
if (checked) {
|
|
287
237
|
setSelected(records);
|
|
288
238
|
} else {
|
|
289
239
|
setSelected([]);
|
|
290
240
|
}
|
|
291
241
|
};
|
|
292
|
-
|
|
293
242
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
294
243
|
return {
|
|
295
244
|
getSelectedRows: getSelectedRows,
|
|
@@ -297,7 +246,6 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
297
246
|
resetPageNo: resetPageNo
|
|
298
247
|
};
|
|
299
248
|
});
|
|
300
|
-
|
|
301
249
|
if (records.length === 0) {
|
|
302
250
|
return noDataComponent;
|
|
303
251
|
} else {
|
|
@@ -316,32 +264,27 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
316
264
|
onChange: toggleSelectAll
|
|
317
265
|
})) : /*#__PURE__*/_react["default"].createElement("th", null)), columnConfigs.map(function (columnObj) {
|
|
318
266
|
var key = columnObj.key,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
267
|
+
label = columnObj.label,
|
|
268
|
+
sortable = columnObj.sortable,
|
|
269
|
+
headerClassName = columnObj.headerClassName;
|
|
322
270
|
var className = "RCB-th";
|
|
323
271
|
var thAttrs = {};
|
|
324
|
-
|
|
325
272
|
if (sortable) {
|
|
326
273
|
className += " RCB-th-sortable";
|
|
327
|
-
|
|
328
274
|
if (sortBy === key) {
|
|
329
275
|
className += " RCB-th-".concat(sortOrder.toLowerCase());
|
|
330
276
|
} else {
|
|
331
277
|
className += " RCB-th-sort";
|
|
332
278
|
}
|
|
333
|
-
|
|
334
279
|
thAttrs = {
|
|
335
280
|
onClick: function onClick() {
|
|
336
281
|
props.onSort(columnObj);
|
|
337
282
|
}
|
|
338
283
|
};
|
|
339
284
|
}
|
|
340
|
-
|
|
341
285
|
if (headerClassName) {
|
|
342
286
|
className += " ".concat(headerClassName);
|
|
343
287
|
}
|
|
344
|
-
|
|
345
288
|
return /*#__PURE__*/_react["default"].createElement("th", _extends({
|
|
346
289
|
className: className,
|
|
347
290
|
key: key
|
|
@@ -362,33 +305,28 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
362
305
|
})));
|
|
363
306
|
}
|
|
364
307
|
};
|
|
365
|
-
|
|
366
308
|
BaseTable = /*#__PURE__*/(0, _react.forwardRef)(BaseTable);
|
|
309
|
+
|
|
367
310
|
/* eslint-enable react/prop-types */
|
|
368
311
|
|
|
369
312
|
BaseTable.propTypes = {
|
|
370
313
|
/** Pass any additional classNames to Table component */
|
|
371
314
|
className: _propTypes["default"].string,
|
|
372
|
-
|
|
373
315
|
/** Array containing table row data */
|
|
374
316
|
records: function records(props, propName) {
|
|
375
317
|
if (props["paginationType"] == "CLIENT") {
|
|
376
318
|
if (!props[propName]) {
|
|
377
319
|
return new Error("Please provide the table records for paginationType 'CLIENT'!");
|
|
378
320
|
}
|
|
379
|
-
|
|
380
321
|
if (Object.prototype.toString.call(props[propName]) !== "[object Array]") {
|
|
381
322
|
return new Error("'records' must be an array");
|
|
382
323
|
}
|
|
383
324
|
}
|
|
384
325
|
},
|
|
385
|
-
|
|
386
326
|
/** Array containing the table columns config */
|
|
387
327
|
columnConfigs: _propTypes["default"].array.isRequired,
|
|
388
|
-
|
|
389
328
|
/** ID attribute key to use when rendering the dropdown items */
|
|
390
329
|
idAttribute: _propTypes["default"].string,
|
|
391
|
-
|
|
392
330
|
/* Config to display checkbox in the first column of the table
|
|
393
331
|
* {
|
|
394
332
|
enabled: false, // turn this on to display checkbox in first column of the table
|
|
@@ -396,13 +334,10 @@ BaseTable.propTypes = {
|
|
|
396
334
|
}
|
|
397
335
|
*/
|
|
398
336
|
checkboxConfig: _propTypes["default"].object,
|
|
399
|
-
|
|
400
337
|
/** set to "true" if table rows are expandable */
|
|
401
338
|
isExpandableTable: _propTypes["default"].bool,
|
|
402
|
-
|
|
403
339
|
/** Component to be rendered on expanding a row */
|
|
404
340
|
ExpandedRowComponent: _propTypes["default"].oneOfType([_propTypes["default"].instanceOf(Element), _propTypes["default"].func]),
|
|
405
|
-
|
|
406
341
|
/** Component to be rendered if the table has no data */
|
|
407
342
|
noDataComponent: _propTypes["default"].any
|
|
408
343
|
};
|