@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
|
@@ -4,36 +4,28 @@ 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
|
var _Dropdown = _interopRequireDefault(require("../Form/Dropdown"));
|
|
13
|
-
|
|
14
10
|
var _utils = _interopRequireDefault(require("../../core/utils"));
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
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); }
|
|
24
18
|
var PaginationComponent = function PaginationComponent(props) {
|
|
25
19
|
var pageSizeList = props.pageSizeList,
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
pageConfig = props.pageConfig,
|
|
21
|
+
onPageConfigChanged = props.onPageConfigChanged;
|
|
28
22
|
var perPageCount = pageConfig.perPageCount,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
pageNo = pageConfig.pageNo,
|
|
24
|
+
total = pageConfig.total;
|
|
32
25
|
var SelectionSummary = function SelectionSummary() {
|
|
33
26
|
var pagIndex = _utils["default"].getPagIndex(pageConfig);
|
|
34
|
-
|
|
35
27
|
var start = pagIndex.start,
|
|
36
|
-
|
|
28
|
+
end = pagIndex.end;
|
|
37
29
|
var startVal = start + 1;
|
|
38
30
|
var endVal = total < end ? total : end;
|
|
39
31
|
var summaryString = "".concat(startVal, "-").concat(endVal);
|
|
@@ -43,7 +35,6 @@ var PaginationComponent = function PaginationComponent(props) {
|
|
|
43
35
|
className: "RCB-select-arrow"
|
|
44
36
|
}));
|
|
45
37
|
};
|
|
46
|
-
|
|
47
38
|
var onPerPageChanged = function onPerPageChanged(perPageObj) {
|
|
48
39
|
var perPage = +perPageObj.id;
|
|
49
40
|
onPageConfigChanged(_objectSpread(_objectSpread({}, pageConfig), {}, {
|
|
@@ -51,14 +42,12 @@ var PaginationComponent = function PaginationComponent(props) {
|
|
|
51
42
|
perPageCount: perPage
|
|
52
43
|
}));
|
|
53
44
|
};
|
|
54
|
-
|
|
55
45
|
var changePage = function changePage(moveUnit, event) {
|
|
56
46
|
event.preventDefault();
|
|
57
47
|
onPageConfigChanged(_objectSpread(_objectSpread({}, pageConfig), {}, {
|
|
58
48
|
pageNo: pageNo + moveUnit
|
|
59
49
|
}));
|
|
60
50
|
};
|
|
61
|
-
|
|
62
51
|
var isLeftNavDisbaled = pageNo <= 1;
|
|
63
52
|
var isRightNavDisbaled = pageNo >= Math.ceil(total / +perPageCount);
|
|
64
53
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -86,7 +75,6 @@ var PaginationComponent = function PaginationComponent(props) {
|
|
|
86
75
|
}
|
|
87
76
|
}, ">")));
|
|
88
77
|
};
|
|
89
|
-
|
|
90
78
|
PaginationComponent.propTypes = {
|
|
91
79
|
pageSizeList: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
92
80
|
id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
@@ -4,94 +4,61 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.REQUEST_KEYS = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _BaseTable = _interopRequireDefault(require("./BaseTable"));
|
|
13
|
-
|
|
14
10
|
var _DataLoader = _interopRequireDefault(require("../DataLoader"));
|
|
15
|
-
|
|
16
11
|
var _PaginationComponent = _interopRequireDefault(require("./PaginationComponent"));
|
|
17
|
-
|
|
18
12
|
var _utils = _interopRequireDefault(require("../../core/utils"));
|
|
19
|
-
|
|
20
13
|
var _excluded = ["className", "wrapperClassName", "records", "columnConfigs", "idAttribute", "searchBy", "getRequestKeys", "showPaginateBar", "paginationPosition", "paginationType", "paginationBar", "requestId", "pageNoKey", "perPageKey", "pageSizeList", "isExpandableTable", "ExpandedRowComponent", "responseFormatter", "noDataComponent", "omitProps", "getUrlParams", "getRequestParams", "checkboxConfig"];
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
15
|
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); }
|
|
25
|
-
|
|
26
16
|
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; }
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
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; }
|
|
33
|
-
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
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); }
|
|
34
22
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
35
|
-
|
|
36
23
|
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."); }
|
|
37
|
-
|
|
38
24
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
39
|
-
|
|
40
25
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
41
|
-
|
|
42
26
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
43
|
-
|
|
44
27
|
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."); }
|
|
45
|
-
|
|
46
28
|
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); }
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
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; }
|
|
51
|
-
|
|
29
|
+
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; }
|
|
30
|
+
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; } }
|
|
52
31
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
|
-
|
|
54
32
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
55
|
-
|
|
56
33
|
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; }
|
|
57
|
-
|
|
58
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
59
|
-
|
|
34
|
+
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); }
|
|
60
35
|
var getPageRecords = function getPageRecords() {
|
|
61
36
|
var records = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
62
37
|
var pageConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
63
|
-
|
|
64
38
|
var pagIndex = _utils["default"].getPagIndex(pageConfig);
|
|
65
|
-
|
|
66
39
|
var start = pagIndex.start,
|
|
67
|
-
|
|
40
|
+
end = pagIndex.end;
|
|
68
41
|
return records.slice(start, end);
|
|
69
42
|
};
|
|
70
|
-
|
|
71
43
|
var sortNumbersASC = function sortNumbersASC(a, b) {
|
|
72
44
|
return a - b;
|
|
73
45
|
};
|
|
74
|
-
|
|
75
46
|
var sortNumbersDSC = function sortNumbersDSC(a, b) {
|
|
76
47
|
return b - a;
|
|
77
48
|
};
|
|
78
|
-
|
|
79
49
|
var sortAlphaASC = function sortAlphaASC(a, b) {
|
|
80
50
|
return a < b ? -1 : 1;
|
|
81
51
|
};
|
|
82
|
-
|
|
83
52
|
var sortAlphaDSC = function sortAlphaDSC(a, b) {
|
|
84
53
|
return b < a ? -1 : 1;
|
|
85
54
|
};
|
|
86
|
-
|
|
87
55
|
var getFilteredRecords = function getFilteredRecords(_ref) {
|
|
88
56
|
var _ref$records = _ref.records,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
57
|
+
records = _ref$records === void 0 ? [] : _ref$records,
|
|
58
|
+
searchBy = _ref.searchBy,
|
|
59
|
+
searchByKey = _ref.searchByKey,
|
|
60
|
+
sortByConfig = _ref.sortByConfig;
|
|
93
61
|
var filteredRecords = records;
|
|
94
|
-
|
|
95
62
|
if (searchBy) {
|
|
96
63
|
searchBy = searchBy.toLowerCase();
|
|
97
64
|
filteredRecords = records.filter(function (obj) {
|
|
@@ -99,11 +66,10 @@ var getFilteredRecords = function getFilteredRecords(_ref) {
|
|
|
99
66
|
return val.indexOf(searchBy) !== -1;
|
|
100
67
|
});
|
|
101
68
|
}
|
|
102
|
-
|
|
103
69
|
if (_typeof(sortByConfig) === "object" && !_utils["default"].isObjectEmpty(sortByConfig)) {
|
|
104
70
|
var sortBy = sortByConfig.sortBy,
|
|
105
|
-
|
|
106
|
-
|
|
71
|
+
sortOrder = sortByConfig.sortOrder,
|
|
72
|
+
columnConfig = sortByConfig.columnConfig;
|
|
107
73
|
var valueFormatter = columnConfig.valueFormatter;
|
|
108
74
|
filteredRecords = records.slice().sort(function (obj1, obj2) {
|
|
109
75
|
var rowValue1 = obj1[sortBy];
|
|
@@ -116,7 +82,6 @@ var getFilteredRecords = function getFilteredRecords(_ref) {
|
|
|
116
82
|
value: rowValue2,
|
|
117
83
|
record: obj2
|
|
118
84
|
}) : rowValue2;
|
|
119
|
-
|
|
120
85
|
if (typeof sortValue === "number") {
|
|
121
86
|
return sortOrder === "ASC" ? sortNumbersASC(sortValue1, sortValue2) : sortNumbersDSC(sortValue1, sortValue2);
|
|
122
87
|
} else {
|
|
@@ -124,10 +89,8 @@ var getFilteredRecords = function getFilteredRecords(_ref) {
|
|
|
124
89
|
}
|
|
125
90
|
});
|
|
126
91
|
}
|
|
127
|
-
|
|
128
92
|
return filteredRecords;
|
|
129
93
|
};
|
|
130
|
-
|
|
131
94
|
var REQUEST_KEYS = {
|
|
132
95
|
searchBy: "search",
|
|
133
96
|
sortBy: "sortBy",
|
|
@@ -136,146 +99,121 @@ var REQUEST_KEYS = {
|
|
|
136
99
|
sortDSC: "DSC"
|
|
137
100
|
};
|
|
138
101
|
exports.REQUEST_KEYS = REQUEST_KEYS;
|
|
139
|
-
|
|
140
102
|
var Table = function Table(props, ref) {
|
|
141
103
|
var _objectSpread2;
|
|
142
|
-
|
|
143
104
|
var className = props.className,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
105
|
+
wrapperClassName = props.wrapperClassName,
|
|
106
|
+
records = props.records,
|
|
107
|
+
columnConfigs = props.columnConfigs,
|
|
108
|
+
idAttribute = props.idAttribute,
|
|
109
|
+
searchBy = props.searchBy,
|
|
110
|
+
getRequestKeys = props.getRequestKeys,
|
|
111
|
+
showPaginateBar = props.showPaginateBar,
|
|
112
|
+
paginationPosition = props.paginationPosition,
|
|
113
|
+
paginationType = props.paginationType,
|
|
114
|
+
paginationBar = props.paginationBar,
|
|
115
|
+
requestId = props.requestId,
|
|
116
|
+
pageNoKey = props.pageNoKey,
|
|
117
|
+
perPageKey = props.perPageKey,
|
|
118
|
+
pageSizeList = props.pageSizeList,
|
|
119
|
+
isExpandableTable = props.isExpandableTable,
|
|
120
|
+
ExpandedRowComponent = props.ExpandedRowComponent,
|
|
121
|
+
responseFormatter = props.responseFormatter,
|
|
122
|
+
noDataComponent = props.noDataComponent,
|
|
123
|
+
omitProps = props.omitProps,
|
|
124
|
+
getUrlParams = props.getUrlParams,
|
|
125
|
+
getRequestParams = props.getRequestParams,
|
|
126
|
+
checkboxConfig = props.checkboxConfig,
|
|
127
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
167
128
|
/* variables for server data */
|
|
168
|
-
|
|
169
|
-
|
|
170
129
|
var _useState = (0, _react.useState)([]),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
130
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
131
|
+
serverRecords = _useState2[0],
|
|
132
|
+
setServerRecords = _useState2[1];
|
|
175
133
|
var _useState3 = (0, _react.useState)(0),
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
/* variables for search, sort data */
|
|
180
|
-
|
|
134
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
135
|
+
serverTotal = _useState4[0],
|
|
136
|
+
setServerTotal = _useState4[1];
|
|
181
137
|
|
|
138
|
+
/* variables for search, sort data */
|
|
182
139
|
var _useState5 = (0, _react.useState)(searchBy),
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
140
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
141
|
+
searchQuery = _useState6[0],
|
|
142
|
+
setSearchQuery = _useState6[1];
|
|
187
143
|
var _useState7 = (0, _react.useState)({}),
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
144
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
145
|
+
sortByConfig = _useState8[0],
|
|
146
|
+
setSortByConfig = _useState8[1];
|
|
192
147
|
var sortBy = sortByConfig.sortBy,
|
|
193
|
-
|
|
194
|
-
/* variables for pagination data */
|
|
148
|
+
sortOrder = sortByConfig.sortOrder;
|
|
195
149
|
|
|
150
|
+
/* variables for pagination data */
|
|
196
151
|
var _useState9 = (0, _react.useState)({
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
152
|
+
perPageCount: pageSizeList[0].id,
|
|
153
|
+
pageNo: 1
|
|
154
|
+
}),
|
|
155
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
156
|
+
pageConfig = _useState10[0],
|
|
157
|
+
setPageConfig = _useState10[1];
|
|
204
158
|
var perPageCount = pageConfig.perPageCount,
|
|
205
|
-
|
|
159
|
+
pageNo = pageConfig.pageNo;
|
|
206
160
|
var omitParams = [pageNoKey, perPageKey].concat(_toConsumableArray(omitProps.split(",")));
|
|
207
|
-
|
|
208
161
|
var _REQUEST_KEYS$getRequ = _objectSpread(_objectSpread({}, REQUEST_KEYS), getRequestKeys()),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
162
|
+
searchByKey = _REQUEST_KEYS$getRequ.searchBy,
|
|
163
|
+
sortByKey = _REQUEST_KEYS$getRequ.sortBy,
|
|
164
|
+
sortOrderKey = _REQUEST_KEYS$getRequ.sortOrder,
|
|
165
|
+
ASCEnum = _REQUEST_KEYS$getRequ.sortASC,
|
|
166
|
+
DSCEnum = _REQUEST_KEYS$getRequ.sortDSC;
|
|
215
167
|
var extraParams = _utils["default"].omit(restProps, omitParams);
|
|
216
|
-
|
|
217
168
|
var requestParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getRequestParams()), extraParams), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, pageNoKey, pageNo), _defineProperty(_objectSpread2, perPageKey, perPageCount), _objectSpread2), searchQuery && _defineProperty({}, searchByKey, searchQuery)), sortBy && _defineProperty({}, sortByKey, sortBy)), sortOrder && _defineProperty({}, sortOrderKey, sortOrder === "DSC" ? DSCEnum : ASCEnum));
|
|
218
|
-
|
|
219
169
|
var requests = [{
|
|
220
170
|
requestId: requestId,
|
|
221
171
|
params: requestParams,
|
|
222
172
|
urlParams: getUrlParams()
|
|
223
173
|
}];
|
|
224
|
-
|
|
225
174
|
var onDataLoaded = function onDataLoaded(_ref5) {
|
|
226
175
|
var _ref6 = _slicedToArray(_ref5, 1),
|
|
227
|
-
|
|
228
|
-
|
|
176
|
+
response = _ref6[0];
|
|
229
177
|
var apiResponse = response;
|
|
230
|
-
|
|
231
178
|
if (typeof responseFormatter === "function") {
|
|
232
179
|
apiResponse = responseFormatter(response);
|
|
233
180
|
}
|
|
234
|
-
|
|
235
181
|
var _apiResponse = apiResponse,
|
|
236
|
-
|
|
237
|
-
|
|
182
|
+
entries = _apiResponse.entries,
|
|
183
|
+
total = _apiResponse.total;
|
|
238
184
|
entries = entries || [];
|
|
239
|
-
|
|
240
185
|
if (pageNo > 1 && entries.length === 0) {
|
|
241
186
|
/* current page does not have records, so fetch previous page */
|
|
242
187
|
setPageConfig(_objectSpread(_objectSpread({}, pageConfig), {}, {
|
|
243
188
|
pageNo: pageNo - 1
|
|
244
189
|
}));
|
|
245
190
|
}
|
|
246
|
-
|
|
247
191
|
setServerRecords(entries);
|
|
248
192
|
setServerTotal(total);
|
|
249
193
|
};
|
|
250
|
-
|
|
251
194
|
var resetPageNo = function resetPageNo() {
|
|
252
195
|
setPageConfig(_objectSpread(_objectSpread({}, pageConfig), {}, {
|
|
253
196
|
pageNo: 1
|
|
254
197
|
}));
|
|
255
198
|
};
|
|
256
|
-
|
|
257
199
|
(0, _react.useEffect)(function () {
|
|
258
200
|
/* Search value changed: reset pageNo. */
|
|
259
201
|
resetPageNo();
|
|
260
202
|
setSearchQuery(searchBy);
|
|
261
203
|
}, [searchBy]);
|
|
262
|
-
|
|
263
204
|
var onSort = function onSort(columnConfig) {
|
|
264
205
|
var newSortBy = columnConfig.key;
|
|
265
206
|
var newSortOrder = "ASC";
|
|
266
|
-
|
|
267
207
|
if (sortBy === newSortBy) {
|
|
268
208
|
/* clicked sort on the same column */
|
|
269
209
|
newSortOrder = sortOrder === "ASC" ? "DSC" : "ASC";
|
|
270
210
|
}
|
|
271
|
-
|
|
272
211
|
setSortByConfig({
|
|
273
212
|
sortBy: newSortBy,
|
|
274
213
|
sortOrder: newSortOrder,
|
|
275
214
|
columnConfig: columnConfig
|
|
276
215
|
});
|
|
277
216
|
};
|
|
278
|
-
|
|
279
217
|
var filteredRecords = getFilteredRecords({
|
|
280
218
|
records: records,
|
|
281
219
|
searchBy: searchBy,
|
|
@@ -290,13 +228,10 @@ var Table = function Table(props, ref) {
|
|
|
290
228
|
total: totalRecords
|
|
291
229
|
})
|
|
292
230
|
};
|
|
293
|
-
|
|
294
231
|
var paginationComponent = /*#__PURE__*/_react["default"].createElement("div", {
|
|
295
232
|
className: "RCB-paginate-bar"
|
|
296
233
|
}, paginationBar ? /*#__PURE__*/_react["default"].cloneElement(paginationBar, paginationProps) : /*#__PURE__*/_react["default"].createElement(_PaginationComponent["default"], paginationProps));
|
|
297
|
-
|
|
298
234
|
var finalRecords = paginationType === "SERVER" ? serverRecords : showPaginateBar ? getPageRecords(filteredRecords, pageConfig) : filteredRecords;
|
|
299
|
-
|
|
300
235
|
var wrappedComponent = /*#__PURE__*/_react["default"].createElement(_BaseTable["default"], {
|
|
301
236
|
ref: ref,
|
|
302
237
|
records: finalRecords,
|
|
@@ -310,53 +245,41 @@ var Table = function Table(props, ref) {
|
|
|
310
245
|
isExpandableTable: isExpandableTable,
|
|
311
246
|
ExpandedRowComponent: ExpandedRowComponent
|
|
312
247
|
});
|
|
313
|
-
|
|
314
248
|
if (paginationType === "SERVER") {
|
|
315
249
|
wrappedComponent = /*#__PURE__*/_react["default"].createElement(_DataLoader["default"], {
|
|
316
250
|
requests: requests,
|
|
317
251
|
onDataLoaded: onDataLoaded
|
|
318
252
|
}, wrappedComponent);
|
|
319
253
|
}
|
|
320
|
-
|
|
321
254
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
322
255
|
className: className
|
|
323
256
|
}, showPaginateBar && paginationPosition === "TOP" && totalRecords > 0 && paginationComponent, /*#__PURE__*/_react["default"].createElement("div", {
|
|
324
257
|
className: wrapperClassName
|
|
325
258
|
}, wrappedComponent), showPaginateBar && paginationPosition === "BOTTOM" && totalRecords > 0 && paginationComponent);
|
|
326
259
|
};
|
|
327
|
-
|
|
328
260
|
Table = /*#__PURE__*/(0, _react.forwardRef)(Table);
|
|
329
261
|
Table.propTypes = _objectSpread(_objectSpread({}, _BaseTable["default"].propTypes), {}, {
|
|
330
262
|
/** search value to search data in the table */
|
|
331
263
|
searchBy: _propTypes["default"].string,
|
|
332
|
-
|
|
333
264
|
/** list of supported page sizes */
|
|
334
265
|
pageSizeList: _propTypes["default"].array,
|
|
335
|
-
|
|
336
266
|
/** set to false to disable pagination bar */
|
|
337
267
|
showPaginateBar: _propTypes["default"].bool,
|
|
338
|
-
|
|
339
268
|
/** location where the pagination component must be displayed */
|
|
340
269
|
paginationPosition: _propTypes["default"].oneOf(["TOP", "BOTTOM"]),
|
|
341
|
-
|
|
342
270
|
/** CLIENT side pagination or SERVER side pagination */
|
|
343
271
|
paginationType: _propTypes["default"].oneOf(["CLIENT", "SERVER"]),
|
|
344
|
-
|
|
345
272
|
/** You can provide a custom component for the pagination bar
|
|
346
273
|
* if you want to add more content to the pagination bar other than the pagination widget.
|
|
347
274
|
* Make sure to include <PagniationComponent /> and pass on all the props sent to this custom component
|
|
348
275
|
*/
|
|
349
276
|
paginationBar: _propTypes["default"].any,
|
|
350
|
-
|
|
351
277
|
/** [SERVER side pagination] the ID of the request to call */
|
|
352
278
|
requestId: _propTypes["default"].string,
|
|
353
|
-
|
|
354
279
|
/** [SERVER side pagination] key to send the page number value in, to the API */
|
|
355
280
|
pageNoKey: _propTypes["default"].string,
|
|
356
|
-
|
|
357
281
|
/** [SERVER side pagination] key to send the page count value in, to the API */
|
|
358
282
|
perPageKey: _propTypes["default"].string,
|
|
359
|
-
|
|
360
283
|
/** If paginationType is "SERVER",
|
|
361
284
|
* component expects the response to be of the form
|
|
362
285
|
* { [pageNoKey]: <pageNo>, [perPageKey]: <pageSize>, total: <totalCount>, entries: [{}] }
|
|
@@ -364,19 +287,15 @@ Table.propTypes = _objectSpread(_objectSpread({}, _BaseTable["default"].propType
|
|
|
364
287
|
* Input to this function is the response received from your API
|
|
365
288
|
* */
|
|
366
289
|
responseFormatter: _propTypes["default"].func,
|
|
367
|
-
|
|
368
290
|
/** If paginationType is "SERVER",
|
|
369
291
|
* a comma separated list of the props to be omitted from being added to the API request */
|
|
370
292
|
omitProps: _propTypes["default"].string,
|
|
371
|
-
|
|
372
293
|
/** If paginationType is "SERVER", function that is expected to return the key configs for the various request settings
|
|
373
294
|
* in the format { searchBy, sortBy, sortOrder }
|
|
374
295
|
*/
|
|
375
296
|
getRequestKeys: _propTypes["default"].func,
|
|
376
|
-
|
|
377
297
|
/** If paginationType is "SERVER", function that is expected to return the URL Params object */
|
|
378
298
|
getUrlParams: _propTypes["default"].func,
|
|
379
|
-
|
|
380
299
|
/** If paginationType is "SERVER", function that is expected to return the Request Params object */
|
|
381
300
|
getRequestParams: _propTypes["default"].func
|
|
382
301
|
});
|