@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,99 +1,75 @@
|
|
|
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 _Form = require("./Form");
|
|
15
|
-
|
|
16
11
|
var _FormElementWrapper = _interopRequireDefault(require("./FormElementWrapper"));
|
|
17
|
-
|
|
18
|
-
var _excluded = ["label", "name", "min", "max", "className", "value", "defaultValue", "appearance", "onChange", "disabled", "showBubble", "inputStyle", "bubbleStyle"];
|
|
19
|
-
|
|
12
|
+
var _excluded = ["label", "name", "min", "max", "className", "value", "defaultValue", "appearance", "onChange", "disabled", "showBubble", "inputStyle", "bubbleStyle", "inputClassName"];
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
14
|
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); }
|
|
23
|
-
|
|
24
15
|
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; }
|
|
25
|
-
|
|
26
|
-
function
|
|
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
|
-
|
|
16
|
+
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); }
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
35
|
-
|
|
36
23
|
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."); }
|
|
37
|
-
|
|
38
24
|
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); }
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
25
|
+
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; }
|
|
26
|
+
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; } }
|
|
44
27
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
|
-
|
|
46
28
|
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; }
|
|
47
|
-
|
|
48
29
|
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; }
|
|
49
|
-
|
|
50
30
|
var RangeSlider = function RangeSlider(props) {
|
|
51
31
|
var label = props.label,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
32
|
+
name = props.name,
|
|
33
|
+
min = props.min,
|
|
34
|
+
max = props.max,
|
|
35
|
+
className = props.className,
|
|
36
|
+
value = props.value,
|
|
37
|
+
defaultValue = props.defaultValue,
|
|
38
|
+
appearance = props.appearance,
|
|
39
|
+
onChange = props.onChange,
|
|
40
|
+
disabled = props.disabled,
|
|
41
|
+
showBubble = props.showBubble,
|
|
42
|
+
_props$inputStyle = props.inputStyle,
|
|
43
|
+
inputStyle = _props$inputStyle === void 0 ? {} : _props$inputStyle,
|
|
44
|
+
_props$bubbleStyle = props.bubbleStyle,
|
|
45
|
+
bubbleStyle = _props$bubbleStyle === void 0 ? {} : _props$bubbleStyle,
|
|
46
|
+
inputClassName = props.inputClassName,
|
|
47
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
68
48
|
var _useContext = (0, _react.useContext)(_Form.FormContext),
|
|
69
|
-
|
|
70
|
-
|
|
49
|
+
onValueChange = _useContext.onValueChange;
|
|
71
50
|
var _useState = (0, _react.useState)(value || defaultValue),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
51
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
+
val = _useState2[0],
|
|
53
|
+
setVal = _useState2[1];
|
|
76
54
|
var postFormValueChange = function postFormValueChange(value) {
|
|
77
55
|
typeof onValueChange === "function" && onValueChange(name, value);
|
|
78
56
|
};
|
|
79
|
-
|
|
80
57
|
var onInputChange = function onInputChange(event) {
|
|
81
|
-
var value = event.target.value;
|
|
58
|
+
var value = event.target.value;
|
|
59
|
+
|
|
60
|
+
// TODO : do validations
|
|
82
61
|
|
|
83
62
|
if (typeof onChange === "function") {
|
|
84
63
|
onChange(value);
|
|
85
64
|
}
|
|
86
|
-
|
|
87
65
|
postFormValueChange(value);
|
|
88
66
|
setVal(value);
|
|
89
67
|
};
|
|
90
|
-
|
|
91
68
|
(0, _react.useEffect)(function () {
|
|
92
69
|
/* set the initial form element value in the form context */
|
|
93
70
|
var postValue = typeof onChange === "function" ? value : defaultValue;
|
|
94
71
|
postFormValueChange(postValue);
|
|
95
72
|
}, [value, defaultValue]);
|
|
96
|
-
|
|
97
73
|
var inputProps = _objectSpread(_objectSpread({
|
|
98
74
|
type: "range",
|
|
99
75
|
min: min,
|
|
@@ -103,17 +79,15 @@ var RangeSlider = function RangeSlider(props) {
|
|
|
103
79
|
id: name,
|
|
104
80
|
defaultValue: defaultValue,
|
|
105
81
|
disabled: disabled,
|
|
106
|
-
className: "RCB-form-el RCB-input-range ".concat(
|
|
82
|
+
className: "RCB-form-el RCB-input-range ".concat(inputClassName),
|
|
107
83
|
onChange: onInputChange
|
|
108
84
|
}, restProps), {}, {
|
|
109
85
|
showBubble: showBubble
|
|
110
86
|
});
|
|
111
|
-
|
|
112
87
|
if (typeof onChange === "function") {
|
|
113
88
|
/* make it a controlled component if onChange function is given */
|
|
114
89
|
inputProps.value = value;
|
|
115
90
|
}
|
|
116
|
-
|
|
117
91
|
return /*#__PURE__*/_react["default"].createElement(_FormElementWrapper["default"], {
|
|
118
92
|
className: className,
|
|
119
93
|
appearance: appearance
|
|
@@ -127,45 +101,36 @@ var RangeSlider = function RangeSlider(props) {
|
|
|
127
101
|
style: bubbleStyle
|
|
128
102
|
}, /*#__PURE__*/_react["default"].createElement("span", null, val)), /*#__PURE__*/_react["default"].createElement("input", _extends({}, inputProps, {
|
|
129
103
|
style: inputStyle,
|
|
130
|
-
disabled: disabled
|
|
104
|
+
disabled: disabled,
|
|
105
|
+
"data-hj-allow": true
|
|
131
106
|
}))));
|
|
132
107
|
};
|
|
133
|
-
|
|
134
108
|
RangeSlider.propTypes = {
|
|
135
|
-
/** Pass any additional classNames to Input component */
|
|
109
|
+
/** Pass any additional classNames to Input component container */
|
|
136
110
|
className: _propTypes["default"].string,
|
|
137
|
-
|
|
111
|
+
/** Pass any additional classNames to Input component */
|
|
112
|
+
inputClassName: _propTypes["default"].string,
|
|
138
113
|
/** Minimum value for range slider */
|
|
139
114
|
min: _propTypes["default"].string.isRequired,
|
|
140
|
-
|
|
141
115
|
/** Maximum value for range slider */
|
|
142
116
|
max: _propTypes["default"].string.isRequired,
|
|
143
|
-
|
|
144
117
|
/** Label for the input element */
|
|
145
118
|
label: _propTypes["default"].string,
|
|
146
|
-
|
|
147
119
|
/** Unique ID for the input element */
|
|
148
120
|
name: _propTypes["default"].string.isRequired,
|
|
149
|
-
|
|
150
121
|
/** Will be used only with onChange function, or else ignored */
|
|
151
122
|
value: _propTypes["default"].any,
|
|
152
123
|
defaultValue: _propTypes["default"].any,
|
|
153
|
-
|
|
154
124
|
/** Define the appearance of the form element. Accepted values are either "inline" or "block" */
|
|
155
125
|
appearance: _propTypes["default"].oneOf(["inline", "block"]),
|
|
156
|
-
|
|
157
126
|
/** Becomes a controlled component if onChange function is given */
|
|
158
127
|
onChange: _propTypes["default"].func,
|
|
159
|
-
|
|
160
128
|
/** Custom Style changes of slider track */
|
|
161
129
|
inputStyle: _propTypes["default"].object,
|
|
162
|
-
|
|
163
130
|
/** Custom Style changes of value bubble */
|
|
164
131
|
bubbleStyle: _propTypes["default"].object,
|
|
165
|
-
|
|
166
132
|
/** Show bubble with values */
|
|
167
133
|
showBubble: _propTypes["default"].bool,
|
|
168
|
-
|
|
169
134
|
/** Indicates if the slider is disabled or enabled */
|
|
170
135
|
disabled: _propTypes["default"].bool
|
|
171
136
|
};
|
|
@@ -1,74 +1,52 @@
|
|
|
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"] = exports.DefaultDropdownItem = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _reactWindow = require("react-window");
|
|
15
|
-
|
|
16
11
|
var _reactWindowInfiniteLoader = _interopRequireDefault(require("react-window-infinite-loader"));
|
|
17
|
-
|
|
18
12
|
var _dataLoader = _interopRequireDefault(require("../../core/dataLoader"));
|
|
19
|
-
|
|
20
13
|
var _utils = _interopRequireDefault(require("../../core/utils"));
|
|
21
|
-
|
|
22
|
-
var _excluded = ["selectedItems", "selectItem", "idAttribute", "nameAttribute", "DropdownItem", "requestId", "requestParams", "responseFormatter", "pageNoKey", "perPageKey", "pageSize", "maxHeight", "searchAttribute", "searchQuery", "getUrlParams", "serverListClassName", "ddItemHeight", "minPageNo", "delay", "loadImmediately"];
|
|
23
|
-
|
|
14
|
+
var _excluded = ["selectedItems", "selectItem", "idAttribute", "nameAttribute", "DropdownItem", "requestId", "requestParams", "responseFormatter", "pageNoKey", "perPageKey", "pageSize", "maxHeight", "searchAttribute", "searchQuery", "getUrlParams", "serverListClassName", "ddItemHeight", "minPageNo", "delay", "loadImmediately", "showClippedContentTitle"];
|
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
26
16
|
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); }
|
|
27
|
-
|
|
28
17
|
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; }
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
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; }
|
|
35
|
-
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
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); }
|
|
36
23
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
37
|
-
|
|
38
24
|
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."); }
|
|
39
|
-
|
|
40
25
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
41
|
-
|
|
42
26
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
43
|
-
|
|
44
27
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
45
|
-
|
|
46
28
|
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."); }
|
|
47
|
-
|
|
48
29
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
49
|
-
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
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; }
|
|
53
|
-
|
|
30
|
+
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; }
|
|
31
|
+
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; } }
|
|
54
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
55
|
-
|
|
56
33
|
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; }
|
|
57
|
-
|
|
58
34
|
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; }
|
|
59
|
-
|
|
35
|
+
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); }
|
|
60
36
|
/* eslint-disable react/prop-types */
|
|
37
|
+
|
|
61
38
|
var DefaultDropdownItem = function DefaultDropdownItem(props) {
|
|
62
39
|
var index = props.index,
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
style = props.style,
|
|
41
|
+
data = props.data;
|
|
65
42
|
var items = data.items,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
43
|
+
isItemLoaded = data.isItemLoaded,
|
|
44
|
+
selectItem = data.selectItem,
|
|
45
|
+
_data$selectedItems = data.selectedItems,
|
|
46
|
+
selectedItems = _data$selectedItems === void 0 ? [] : _data$selectedItems,
|
|
47
|
+
idAttribute = data.idAttribute,
|
|
48
|
+
nameAttribute = data.nameAttribute,
|
|
49
|
+
showClippedContentTitle = data.showClippedContentTitle;
|
|
72
50
|
var itemData = items[index] || {};
|
|
73
51
|
var idValue = itemData[idAttribute];
|
|
74
52
|
var name = itemData[nameAttribute];
|
|
@@ -77,140 +55,118 @@ var DefaultDropdownItem = function DefaultDropdownItem(props) {
|
|
|
77
55
|
}) ? true : false;
|
|
78
56
|
var className = "RCB-list-item " + (isSelected ? "selected" : "");
|
|
79
57
|
var content = name;
|
|
80
|
-
|
|
81
58
|
if (!isItemLoaded(index)) {
|
|
82
59
|
content = "Loading...";
|
|
83
60
|
}
|
|
84
|
-
|
|
85
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
61
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
86
62
|
style: style,
|
|
87
63
|
onClick: function onClick() {
|
|
88
64
|
return selectItem(itemData);
|
|
89
|
-
}
|
|
65
|
+
}
|
|
66
|
+
}, showClippedContentTitle ? {
|
|
67
|
+
title: content
|
|
68
|
+
} : {}, {
|
|
90
69
|
className: className
|
|
91
|
-
}, content);
|
|
70
|
+
}), content);
|
|
92
71
|
};
|
|
93
|
-
|
|
94
72
|
exports.DefaultDropdownItem = DefaultDropdownItem;
|
|
95
|
-
|
|
96
73
|
var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
97
74
|
var selectedItems = props.selectedItems,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
75
|
+
selectItem = props.selectItem,
|
|
76
|
+
idAttribute = props.idAttribute,
|
|
77
|
+
nameAttribute = props.nameAttribute,
|
|
78
|
+
DropdownItem = props.DropdownItem,
|
|
79
|
+
requestId = props.requestId,
|
|
80
|
+
requestParams = props.requestParams,
|
|
81
|
+
responseFormatter = props.responseFormatter,
|
|
82
|
+
pageNoKey = props.pageNoKey,
|
|
83
|
+
perPageKey = props.perPageKey,
|
|
84
|
+
pageSize = props.pageSize,
|
|
85
|
+
maxHeight = props.maxHeight,
|
|
86
|
+
searchAttribute = props.searchAttribute,
|
|
87
|
+
searchQuery = props.searchQuery,
|
|
88
|
+
getUrlParams = props.getUrlParams,
|
|
89
|
+
serverListClassName = props.serverListClassName,
|
|
90
|
+
ddItemHeight = props.ddItemHeight,
|
|
91
|
+
minPageNo = props.minPageNo,
|
|
92
|
+
_props$delay = props.delay,
|
|
93
|
+
delay = _props$delay === void 0 ? 500 : _props$delay,
|
|
94
|
+
_props$loadImmediatel = props.loadImmediately,
|
|
95
|
+
loadImmediately = _props$loadImmediatel === void 0 ? true : _props$loadImmediatel,
|
|
96
|
+
showClippedContentTitle = props.showClippedContentTitle,
|
|
97
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
121
98
|
var _useState = (0, _react.useState)([]),
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
99
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
100
|
+
items = _useState2[0],
|
|
101
|
+
setItems = _useState2[1];
|
|
126
102
|
var _useState3 = (0, _react.useState)(loadImmediately ? 1 : 0),
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
103
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
104
|
+
itemsResetCounter = _useState4[0],
|
|
105
|
+
setItemsResetCounter = _useState4[1];
|
|
131
106
|
var _useState5 = (0, _react.useState)(null),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
107
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
108
|
+
total = _useState6[0],
|
|
109
|
+
setTotal = _useState6[1];
|
|
136
110
|
var _useState7 = (0, _react.useState)(false),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
111
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
112
|
+
hasNextPage = _useState8[0],
|
|
113
|
+
setHasNextPage = _useState8[1];
|
|
141
114
|
var _useState9 = (0, _react.useState)(false),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
115
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
116
|
+
isNextPageLoading = _useState10[0],
|
|
117
|
+
setIsNextPageLoading = _useState10[1];
|
|
146
118
|
var debouncedFn = (0, _react.useRef)();
|
|
147
|
-
|
|
148
119
|
var getDefaultPageNo = function getDefaultPageNo() {
|
|
149
120
|
return minPageNo !== null && minPageNo !== void 0 ? minPageNo : 1;
|
|
150
121
|
};
|
|
151
|
-
|
|
152
122
|
var pageNoRef = (0, _react.useRef)(getDefaultPageNo());
|
|
153
123
|
var searchRef = (0, _react.useRef)(searchQuery);
|
|
154
|
-
|
|
155
124
|
var onDataLoaded = function onDataLoaded(response) {
|
|
156
125
|
var apiResponse = response;
|
|
157
126
|
setIsNextPageLoading(false);
|
|
158
|
-
|
|
159
127
|
if (!loadImmediately && searchRef.current === "") {
|
|
160
128
|
setItems([]);
|
|
161
129
|
setTotal(null);
|
|
162
130
|
return false;
|
|
163
131
|
}
|
|
164
|
-
|
|
165
132
|
if (typeof responseFormatter === "function") {
|
|
166
133
|
apiResponse = responseFormatter(response);
|
|
167
134
|
}
|
|
168
|
-
|
|
169
135
|
var _apiResponse = apiResponse,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
136
|
+
entries = _apiResponse.entries,
|
|
137
|
+
_apiResponse$total = _apiResponse.total,
|
|
138
|
+
total = _apiResponse$total === void 0 ? 0 : _apiResponse$total;
|
|
174
139
|
if (entries === null) {
|
|
175
140
|
entries = [];
|
|
176
141
|
}
|
|
177
|
-
|
|
178
142
|
var totalEntries = [].concat(_toConsumableArray(items), _toConsumableArray(entries));
|
|
179
|
-
|
|
180
143
|
if (totalEntries.length < total) {
|
|
181
144
|
setHasNextPage(true);
|
|
182
145
|
} else {
|
|
183
146
|
setHasNextPage(false);
|
|
184
147
|
}
|
|
185
|
-
|
|
186
148
|
setItems(totalEntries);
|
|
187
149
|
setTotal(total);
|
|
188
150
|
};
|
|
189
|
-
|
|
190
151
|
var makeAPICall = function makeAPICall() {
|
|
191
152
|
var _objectSpread2;
|
|
192
|
-
|
|
193
153
|
setIsNextPageLoading(true);
|
|
194
|
-
|
|
195
154
|
var def = _dataLoader["default"].getRequestDef({
|
|
196
155
|
requestId: requestId,
|
|
197
156
|
params: _objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, pageNoKey, pageNoRef.current), _defineProperty(_objectSpread2, perPageKey, pageSize), _objectSpread2), searchRef.current && _defineProperty({}, searchAttribute, searchRef.current)), requestParams),
|
|
198
157
|
urlParams: getUrlParams()
|
|
199
158
|
});
|
|
200
|
-
|
|
201
159
|
def.done(onDataLoaded);
|
|
202
160
|
return def;
|
|
203
161
|
};
|
|
162
|
+
|
|
204
163
|
/* Callback to be invoked when more rows must be loaded.
|
|
205
164
|
It should return a Promise that is resolved once all data has finished loading.
|
|
206
165
|
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
166
|
var loadNextPage = function loadNextPage() {
|
|
210
167
|
pageNoRef.current = pageNoRef.current + 1;
|
|
211
168
|
return makeAPICall();
|
|
212
169
|
};
|
|
213
|
-
|
|
214
170
|
(0, _react.useEffect)(function () {
|
|
215
171
|
/* not the first call */
|
|
216
172
|
if (itemsResetCounter > 0) {
|
|
@@ -231,10 +187,8 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
|
231
187
|
if (!debouncedFn.current) {
|
|
232
188
|
debouncedFn.current = _utils["default"].debounce(startSearchCallBack, delay);
|
|
233
189
|
}
|
|
234
|
-
|
|
235
190
|
debouncedFn.current();
|
|
236
191
|
}, []);
|
|
237
|
-
|
|
238
192
|
var startSearchCallBack = function startSearchCallBack() {
|
|
239
193
|
pageNoRef.current = getDefaultPageNo();
|
|
240
194
|
setItems([]);
|
|
@@ -242,50 +196,53 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
|
242
196
|
setItemsResetCounter(function (prevItemsResetCounter) {
|
|
243
197
|
return prevItemsResetCounter + 1;
|
|
244
198
|
});
|
|
245
|
-
};
|
|
199
|
+
};
|
|
246
200
|
|
|
201
|
+
// If there are more items to be loaded then add an extra row to hold a loading indicator.
|
|
202
|
+
var itemCount = hasNextPage ? items.length + 1 : items.length;
|
|
247
203
|
|
|
248
|
-
|
|
204
|
+
// Only load 1 page of items at a time.
|
|
249
205
|
// Pass an empty callback to InfiniteLoader in case it asks us to load more than once.
|
|
206
|
+
var loadMoreItems = isNextPageLoading ? function () {} : loadNextPage;
|
|
250
207
|
|
|
251
|
-
|
|
252
|
-
|
|
208
|
+
// Every row is loaded except for our loading indicator row.
|
|
253
209
|
var isItemLoaded = function isItemLoaded(index) {
|
|
254
210
|
return !hasNextPage || index < items.length;
|
|
255
211
|
};
|
|
256
|
-
|
|
257
212
|
var listProps = _objectSpread({
|
|
258
213
|
selectItem: selectItem,
|
|
259
214
|
selectedItems: selectedItems,
|
|
260
215
|
idAttribute: idAttribute,
|
|
261
216
|
nameAttribute: nameAttribute,
|
|
262
217
|
items: items,
|
|
263
|
-
isItemLoaded: isItemLoaded
|
|
218
|
+
isItemLoaded: isItemLoaded,
|
|
219
|
+
showClippedContentTitle: showClippedContentTitle
|
|
264
220
|
}, restProps);
|
|
265
|
-
|
|
266
221
|
if (total === null) {
|
|
267
222
|
return [];
|
|
268
223
|
}
|
|
269
|
-
|
|
270
224
|
if (total === 0) {
|
|
271
225
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
272
226
|
className: "RCB-no-data"
|
|
273
227
|
}, "No data found");
|
|
274
228
|
}
|
|
275
|
-
|
|
276
|
-
|
|
229
|
+
return /*#__PURE__*/_react["default"].createElement(_reactWindowInfiniteLoader["default"]
|
|
230
|
+
// Function responsible for tracking the loaded state of each item.
|
|
277
231
|
, {
|
|
278
|
-
isItemLoaded: isItemLoaded
|
|
232
|
+
isItemLoaded: isItemLoaded
|
|
233
|
+
// Number of rows in list; can be arbitrary high number if actual number is unknown.
|
|
279
234
|
,
|
|
280
235
|
itemCount: total,
|
|
281
|
-
loadMoreItems: loadMoreItems
|
|
236
|
+
loadMoreItems: loadMoreItems
|
|
237
|
+
// Minimum number of rows to be loaded at a time; defaults to 10. This property can be used to batch requests to reduce HTTP requests.
|
|
282
238
|
,
|
|
283
|
-
minimumBatchSize: pageSize
|
|
239
|
+
minimumBatchSize: pageSize
|
|
240
|
+
// Threshold at which to pre-fetch data; defaults to 15. A threshold of 15 means that data will start loading when a user scrolls within 15 rows.
|
|
284
241
|
,
|
|
285
242
|
threshold: pageSize
|
|
286
243
|
}, function (_ref2) {
|
|
287
244
|
var onItemsRendered = _ref2.onItemsRendered,
|
|
288
|
-
|
|
245
|
+
ref = _ref2.ref;
|
|
289
246
|
return /*#__PURE__*/_react["default"].createElement(_reactWindow.FixedSizeList, {
|
|
290
247
|
itemCount: itemCount,
|
|
291
248
|
itemSize: ddItemHeight,
|
|
@@ -297,7 +254,6 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
|
297
254
|
}, DropdownItem);
|
|
298
255
|
});
|
|
299
256
|
};
|
|
300
|
-
|
|
301
257
|
ServerPaginatedDDList.propTypes = {
|
|
302
258
|
ddItemHeight: _propTypes["default"].number
|
|
303
259
|
};
|
|
@@ -305,7 +261,7 @@ ServerPaginatedDDList.defaultProps = {
|
|
|
305
261
|
DropdownItem: DefaultDropdownItem,
|
|
306
262
|
ddItemHeight: 30
|
|
307
263
|
};
|
|
308
|
-
/* eslint-enable react/prop-types */
|
|
309
264
|
|
|
265
|
+
/* eslint-enable react/prop-types */
|
|
310
266
|
var _default = ServerPaginatedDDList;
|
|
311
267
|
exports["default"] = _default;
|