@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,63 +1,38 @@
|
|
|
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 _InlineModal = _interopRequireWildcard(require("../InlineModal"));
|
|
15
|
-
|
|
16
11
|
var _List = _interopRequireDefault(require("../List"));
|
|
17
|
-
|
|
18
12
|
var _Form = require("./Form");
|
|
19
|
-
|
|
20
13
|
var _FormElementWrapper = _interopRequireDefault(require("./FormElementWrapper"));
|
|
21
|
-
|
|
22
14
|
var _ServerPaginatedDDList = _interopRequireDefault(require("./ServerPaginatedDDList"));
|
|
23
|
-
|
|
24
15
|
var _utils = _interopRequireDefault(require("../../core/utils"));
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
_excluded2 = ["halign", "label", "showLabel", "name", "SelectionSummary", "className", "value", "defaultValue", "onChange", "disabled", "options", "showSearch", "searchPlaceholder", "idAttribute", "nameAttribute", "noSelectionLabel", "appearance", "multiSelect", "DropdownItem", "validations", "paginationType", "requestId", "requestParams", "pageNoKey", "perPageKey", "pageSize", "searchAttribute", "maxHeight", "responseFormatter", "getUrlParams", "showCreateCTA", "createCTAComponent", "onCreateCTAClick", "serverListClassName", "showClear", "onClear", "minPageNo", "ListHeaderItem", "onSearchChange"];
|
|
28
|
-
|
|
16
|
+
var _excluded = ["items", "selectedItems", "selectItem", "idAttribute", "nameAttribute", "DropdownItem", "ListHeaderItem", "showClippedContentTitle"],
|
|
17
|
+
_excluded2 = ["halign", "label", "showLabel", "name", "SelectionSummary", "className", "value", "defaultValue", "onChange", "disabled", "options", "showSearch", "searchPlaceholder", "idAttribute", "nameAttribute", "noSelectionLabel", "appearance", "multiSelect", "DropdownItem", "validations", "paginationType", "requestId", "requestParams", "pageNoKey", "perPageKey", "pageSize", "searchAttribute", "maxHeight", "responseFormatter", "getUrlParams", "showCreateCTA", "createCTAComponent", "onCreateCTAClick", "serverListClassName", "showClear", "onClear", "minPageNo", "ListHeaderItem", "onSearchChange", "showClippedContentTitle"];
|
|
29
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
30
|
-
|
|
31
19
|
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); }
|
|
32
|
-
|
|
33
20
|
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; }
|
|
34
|
-
|
|
35
21
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
36
|
-
|
|
37
22
|
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."); }
|
|
38
|
-
|
|
39
23
|
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); }
|
|
40
|
-
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
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; }
|
|
44
|
-
|
|
24
|
+
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; }
|
|
25
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
45
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
46
|
-
|
|
47
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
48
|
-
|
|
27
|
+
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); }
|
|
49
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; }
|
|
50
|
-
|
|
51
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; }
|
|
52
|
-
|
|
53
30
|
var convertToArray = function convertToArray(value) {
|
|
54
31
|
if (!value) {
|
|
55
32
|
return [];
|
|
56
33
|
}
|
|
57
|
-
|
|
58
34
|
return Array.isArray(value) ? value : [value];
|
|
59
35
|
};
|
|
60
|
-
|
|
61
36
|
var getFilteredOptions = function getFilteredOptions() {
|
|
62
37
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
63
38
|
var searchQuery = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
@@ -67,26 +42,23 @@ var getFilteredOptions = function getFilteredOptions() {
|
|
|
67
42
|
return nameValue.indexOf(searchQuery.toLowerCase()) !== -1;
|
|
68
43
|
});
|
|
69
44
|
};
|
|
70
|
-
/* eslint-disable react/prop-types */
|
|
71
|
-
|
|
72
45
|
|
|
46
|
+
/* eslint-disable react/prop-types */
|
|
73
47
|
var DefaultSelectionSummary = function DefaultSelectionSummary(_ref) {
|
|
74
48
|
var _ref$selectedItems = _ref.selectedItems,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
49
|
+
selectedItems = _ref$selectedItems === void 0 ? [] : _ref$selectedItems,
|
|
50
|
+
multiSelect = _ref.multiSelect,
|
|
51
|
+
noSelectionLabel = _ref.noSelectionLabel,
|
|
52
|
+
nameAttribute = _ref.nameAttribute,
|
|
53
|
+
showClear = _ref.showClear,
|
|
54
|
+
clearSelectedItems = _ref.clearSelectedItems;
|
|
81
55
|
var summaryString = "";
|
|
82
56
|
var selectedCount = selectedItems.length;
|
|
83
|
-
|
|
84
57
|
if (multiSelect) {
|
|
85
58
|
summaryString = selectedCount ? "".concat(selectedCount, " selected") : noSelectionLabel;
|
|
86
59
|
} else {
|
|
87
60
|
summaryString = selectedCount ? selectedItems[0][nameAttribute] : noSelectionLabel;
|
|
88
61
|
}
|
|
89
|
-
|
|
90
62
|
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
91
63
|
className: "RCB-dd-label"
|
|
92
64
|
}, summaryString), /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -98,48 +70,57 @@ var DefaultSelectionSummary = function DefaultSelectionSummary(_ref) {
|
|
|
98
70
|
className: "RCB-select-arrow"
|
|
99
71
|
})));
|
|
100
72
|
};
|
|
101
|
-
|
|
102
73
|
var DefaultDropdownItem = function DefaultDropdownItem(props) {
|
|
103
74
|
var itemData = props.itemData,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
75
|
+
selectItem = props.selectItem,
|
|
76
|
+
_props$selectedItems = props.selectedItems,
|
|
77
|
+
selectedItems = _props$selectedItems === void 0 ? [] : _props$selectedItems,
|
|
78
|
+
idAttribute = props.idAttribute,
|
|
79
|
+
nameAttribute = props.nameAttribute,
|
|
80
|
+
showClippedContentTitle = props.showClippedContentTitle;
|
|
109
81
|
var idValue = itemData[idAttribute];
|
|
110
82
|
var name = itemData[nameAttribute];
|
|
111
83
|
var isSelected = selectedItems.find(function (obj) {
|
|
112
84
|
return obj[idAttribute] === idValue;
|
|
113
85
|
}) ? true : false;
|
|
114
86
|
var className = "RCB-list-item " + (isSelected ? "selected" : "");
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
87
|
+
if (showClippedContentTitle) {
|
|
88
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
89
|
+
onClick: function onClick() {
|
|
90
|
+
return selectItem(itemData);
|
|
91
|
+
},
|
|
92
|
+
className: className,
|
|
93
|
+
title: name
|
|
94
|
+
}, name);
|
|
95
|
+
} else {
|
|
96
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
97
|
+
onClick: function onClick() {
|
|
98
|
+
return selectItem(itemData);
|
|
99
|
+
},
|
|
100
|
+
className: className
|
|
101
|
+
}, name);
|
|
102
|
+
}
|
|
121
103
|
};
|
|
122
|
-
|
|
123
104
|
exports.DefaultDropdownItem = DefaultDropdownItem;
|
|
124
105
|
DefaultDropdownItem.propTypes = {
|
|
125
106
|
itemData: _propTypes["default"].object.isRequired,
|
|
126
107
|
selectItem: _propTypes["default"].func.isRequired,
|
|
127
108
|
selectedItems: _propTypes["default"].array,
|
|
128
109
|
idAttribute: _propTypes["default"].string,
|
|
129
|
-
nameAttribute: _propTypes["default"].string
|
|
110
|
+
nameAttribute: _propTypes["default"].string,
|
|
111
|
+
showClippedContentTitle: _propTypes["default"].bool
|
|
130
112
|
};
|
|
131
|
-
|
|
132
113
|
var NormalList = function NormalList(_ref2) {
|
|
133
114
|
var _ref2$items = _ref2.items,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
115
|
+
items = _ref2$items === void 0 ? [] : _ref2$items,
|
|
116
|
+
selectedItems = _ref2.selectedItems,
|
|
117
|
+
selectItem = _ref2.selectItem,
|
|
118
|
+
idAttribute = _ref2.idAttribute,
|
|
119
|
+
nameAttribute = _ref2.nameAttribute,
|
|
120
|
+
DropdownItem = _ref2.DropdownItem,
|
|
121
|
+
ListHeaderItem = _ref2.ListHeaderItem,
|
|
122
|
+
showClippedContentTitle = _ref2.showClippedContentTitle,
|
|
123
|
+
restProps = _objectWithoutProperties(_ref2, _excluded);
|
|
143
124
|
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, items.length ? ListHeaderItem : "", /*#__PURE__*/_react["default"].createElement(_List["default"], _extends({
|
|
144
125
|
items: items
|
|
145
126
|
}, restProps, {
|
|
@@ -147,103 +128,93 @@ var NormalList = function NormalList(_ref2) {
|
|
|
147
128
|
ListItem: DropdownItem,
|
|
148
129
|
selectedItems: selectedItems,
|
|
149
130
|
selectItem: selectItem,
|
|
131
|
+
showClippedContentTitle: showClippedContentTitle,
|
|
150
132
|
idAttribute: idAttribute,
|
|
151
133
|
nameAttribute: nameAttribute
|
|
152
134
|
})));
|
|
153
135
|
};
|
|
154
|
-
|
|
155
136
|
NormalList.defaultProps = {
|
|
156
137
|
DropdownItem: DefaultDropdownItem
|
|
157
138
|
};
|
|
139
|
+
|
|
158
140
|
/* eslint-enable react/prop-types */
|
|
159
141
|
|
|
160
142
|
var Dropdown = function Dropdown(props, ref) {
|
|
161
143
|
var halign = props.halign,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
144
|
+
label = props.label,
|
|
145
|
+
showLabel = props.showLabel,
|
|
146
|
+
name = props.name,
|
|
147
|
+
SelectionSummary = props.SelectionSummary,
|
|
148
|
+
className = props.className,
|
|
149
|
+
value = props.value,
|
|
150
|
+
defaultValue = props.defaultValue,
|
|
151
|
+
onChange = props.onChange,
|
|
152
|
+
disabled = props.disabled,
|
|
153
|
+
options = props.options,
|
|
154
|
+
showSearch = props.showSearch,
|
|
155
|
+
searchPlaceholder = props.searchPlaceholder,
|
|
156
|
+
idAttribute = props.idAttribute,
|
|
157
|
+
nameAttribute = props.nameAttribute,
|
|
158
|
+
noSelectionLabel = props.noSelectionLabel,
|
|
159
|
+
appearance = props.appearance,
|
|
160
|
+
multiSelect = props.multiSelect,
|
|
161
|
+
DropdownItem = props.DropdownItem,
|
|
162
|
+
validations = props.validations,
|
|
163
|
+
paginationType = props.paginationType,
|
|
164
|
+
requestId = props.requestId,
|
|
165
|
+
requestParams = props.requestParams,
|
|
166
|
+
pageNoKey = props.pageNoKey,
|
|
167
|
+
perPageKey = props.perPageKey,
|
|
168
|
+
pageSize = props.pageSize,
|
|
169
|
+
searchAttribute = props.searchAttribute,
|
|
170
|
+
maxHeight = props.maxHeight,
|
|
171
|
+
responseFormatter = props.responseFormatter,
|
|
172
|
+
getUrlParams = props.getUrlParams,
|
|
173
|
+
showCreateCTA = props.showCreateCTA,
|
|
174
|
+
createCTAComponent = props.createCTAComponent,
|
|
175
|
+
onCreateCTAClick = props.onCreateCTAClick,
|
|
176
|
+
serverListClassName = props.serverListClassName,
|
|
177
|
+
showClear = props.showClear,
|
|
178
|
+
onClear = props.onClear,
|
|
179
|
+
minPageNo = props.minPageNo,
|
|
180
|
+
ListHeaderItem = props.ListHeaderItem,
|
|
181
|
+
propSearchChange = props.onSearchChange,
|
|
182
|
+
showClippedContentTitle = props.showClippedContentTitle,
|
|
183
|
+
restProps = _objectWithoutProperties(props, _excluded2);
|
|
202
184
|
var _useState = (0, _react.useState)(""),
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
185
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
186
|
+
searchQuery = _useState2[0],
|
|
187
|
+
setSearchQuery = _useState2[1];
|
|
207
188
|
var debouncedFn = (0, _react.useRef)();
|
|
208
189
|
var searchIpRef = (0, _react.useRef)();
|
|
209
190
|
var initialSelected = [];
|
|
210
191
|
var initialValue = typeof onChange === "function" ? value : defaultValue;
|
|
211
|
-
|
|
212
192
|
if (typeof initialValue !== "undefined") {
|
|
213
193
|
initialSelected = convertToArray(initialValue);
|
|
214
194
|
}
|
|
215
|
-
/* array of selected item objects */
|
|
216
|
-
|
|
217
195
|
|
|
196
|
+
/* array of selected item objects */
|
|
218
197
|
var _useState3 = (0, _react.useState)(initialSelected),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
198
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
199
|
+
selectedItems = _useState4[0],
|
|
200
|
+
setSelectedItems = _useState4[1];
|
|
223
201
|
var _useContext = (0, _react.useContext)(_Form.FormContext),
|
|
224
|
-
|
|
225
|
-
|
|
202
|
+
onValueChange = _useContext.onValueChange;
|
|
226
203
|
var inlineModalRef = (0, _react.useRef)();
|
|
227
|
-
|
|
228
204
|
var hideModal = function hideModal() {
|
|
229
205
|
inlineModalRef.current.hideModal();
|
|
230
206
|
};
|
|
231
|
-
|
|
232
207
|
var postFormValueChange = function postFormValueChange(value) {
|
|
233
208
|
var _utils$checkIfValid = _utils["default"].checkIfValid(value, validations),
|
|
234
|
-
|
|
235
|
-
|
|
209
|
+
error = _utils$checkIfValid.error;
|
|
236
210
|
typeof onValueChange === "function" && onValueChange(name, value, error);
|
|
237
211
|
};
|
|
238
|
-
|
|
239
212
|
var selectItem = function selectItem(item) {
|
|
240
213
|
var id = item[idAttribute];
|
|
241
|
-
|
|
242
214
|
if (multiSelect) {
|
|
243
215
|
var isPresent = selectedItems.find(function (obj) {
|
|
244
216
|
return obj[idAttribute] === id;
|
|
245
217
|
});
|
|
246
|
-
|
|
247
218
|
if (!isPresent) {
|
|
248
219
|
selectedItems.push(item);
|
|
249
220
|
postFormValueChange(selectedItems);
|
|
@@ -254,44 +225,33 @@ var Dropdown = function Dropdown(props, ref) {
|
|
|
254
225
|
postFormValueChange(item);
|
|
255
226
|
typeof onChange === "function" && onChange(item);
|
|
256
227
|
/* close the dropdown */
|
|
257
|
-
|
|
258
228
|
hideModal();
|
|
259
229
|
}
|
|
260
|
-
|
|
261
230
|
setSelectedItems(selectedItems);
|
|
262
231
|
};
|
|
263
|
-
|
|
264
232
|
(0, _react.useEffect)(function () {
|
|
265
233
|
/* set the initial form element value in the form context */
|
|
266
234
|
var postValue = typeof onChange === "function" ? value : defaultValue;
|
|
267
|
-
|
|
268
235
|
if (typeof postValue !== "undefined") {
|
|
269
236
|
var arrayPostValue = convertToArray(postValue);
|
|
270
237
|
postValue = multiSelect ? arrayPostValue : postValue;
|
|
271
238
|
setSelectedItems(arrayPostValue);
|
|
272
239
|
}
|
|
273
|
-
|
|
274
240
|
postFormValueChange(postValue);
|
|
275
241
|
}, [value, defaultValue]);
|
|
276
|
-
|
|
277
242
|
var debouncedSearchChange = function debouncedSearchChange(value) {
|
|
278
243
|
setSearchQuery(value);
|
|
279
|
-
|
|
280
244
|
if (typeof propSearchChange === "function") {
|
|
281
245
|
propSearchChange(value);
|
|
282
246
|
}
|
|
283
247
|
};
|
|
284
|
-
|
|
285
248
|
var onSearchChange = function onSearchChange(event) {
|
|
286
249
|
event.persist();
|
|
287
|
-
|
|
288
250
|
if (!debouncedFn.current) {
|
|
289
251
|
debouncedFn.current = _utils["default"].debounce(debouncedSearchChange, 300);
|
|
290
252
|
}
|
|
291
|
-
|
|
292
253
|
return debouncedFn.current(event.target.value);
|
|
293
254
|
};
|
|
294
|
-
|
|
295
255
|
var onModalStateChange = function onModalStateChange(isModalOpen) {
|
|
296
256
|
if (isModalOpen && showSearch) {
|
|
297
257
|
searchIpRef.current && searchIpRef.current.focus();
|
|
@@ -300,24 +260,22 @@ var Dropdown = function Dropdown(props, ref) {
|
|
|
300
260
|
setSearchQuery("");
|
|
301
261
|
}
|
|
302
262
|
};
|
|
303
|
-
|
|
304
263
|
var clearSelectedItems = function clearSelectedItems(evnt) {
|
|
305
264
|
evnt.stopPropagation();
|
|
306
265
|
setSelectedItems([]);
|
|
307
266
|
typeof onClear === "function" && onClear();
|
|
308
267
|
typeof onChange === "function" && onChange(null);
|
|
309
268
|
/** Close modal after reset */
|
|
310
|
-
|
|
311
269
|
hideModal();
|
|
312
270
|
};
|
|
313
|
-
|
|
314
271
|
var commonAttributes = {
|
|
315
272
|
selectedItems: selectedItems,
|
|
316
273
|
selectItem: selectItem,
|
|
317
274
|
idAttribute: idAttribute,
|
|
318
275
|
nameAttribute: nameAttribute,
|
|
319
276
|
DropdownItem: DropdownItem,
|
|
320
|
-
ListHeaderItem: ListHeaderItem
|
|
277
|
+
ListHeaderItem: ListHeaderItem,
|
|
278
|
+
showClippedContentTitle: showClippedContentTitle
|
|
321
279
|
};
|
|
322
280
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
323
281
|
return {
|
|
@@ -367,93 +325,75 @@ var Dropdown = function Dropdown(props, ref) {
|
|
|
367
325
|
className: "RCB-dd-search-ip",
|
|
368
326
|
placeholder: searchPlaceholder,
|
|
369
327
|
onChange: onSearchChange,
|
|
370
|
-
ref: searchIpRef
|
|
328
|
+
ref: searchIpRef,
|
|
329
|
+
"data-hj-allow": true
|
|
371
330
|
})), paginationType === "SERVER" ? /*#__PURE__*/_react["default"].createElement(_ServerPaginatedDDList["default"], _extends({}, commonAttributes, serverListAttrs, restProps)) : /*#__PURE__*/_react["default"].createElement(NormalList, _extends({}, commonAttributes, restProps, {
|
|
372
331
|
items: getFilteredOptions(options, searchQuery, nameAttribute)
|
|
373
332
|
})), showCreateCTA && /*#__PURE__*/_react["default"].createElement("div", {
|
|
374
333
|
className: "RCB-dd-create-cta",
|
|
375
334
|
onClick: onCreateCTAClick
|
|
376
335
|
}, createCTAComponent))));
|
|
377
|
-
};
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// const VALUE_SHAPE = PropTypes.shape({
|
|
378
339
|
// id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
379
340
|
// name: PropTypes.string
|
|
380
341
|
// });
|
|
381
342
|
|
|
382
|
-
|
|
383
343
|
Dropdown = /*#__PURE__*/(0, _react.forwardRef)(Dropdown);
|
|
384
344
|
Dropdown.propTypes = {
|
|
385
345
|
/** Pass any additional classNames to Dropdown component */
|
|
386
346
|
className: _propTypes["default"].string,
|
|
387
|
-
|
|
388
347
|
/** Pass infinite fixed list classname to Dropdown component */
|
|
389
348
|
serverListClassName: _propTypes["default"].string,
|
|
390
|
-
|
|
391
349
|
/** Horizontal alignment of the dropdown body */
|
|
392
350
|
halign: _propTypes["default"].oneOf(["left", "right"]),
|
|
393
|
-
|
|
394
351
|
/** Label for the dropdown element */
|
|
395
352
|
label: _propTypes["default"].string,
|
|
396
|
-
|
|
397
353
|
/** indicates whether to show or hide label */
|
|
398
354
|
showLabel: _propTypes["default"].bool,
|
|
399
|
-
|
|
400
355
|
/** Unique ID for the input element */
|
|
401
356
|
name: _propTypes["default"].string.isRequired,
|
|
402
|
-
|
|
403
357
|
/** Label for dropdown activator */
|
|
404
358
|
noSelectionLabel: _propTypes["default"].string,
|
|
405
|
-
|
|
406
359
|
/** Selection items list */
|
|
407
360
|
options: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
408
361
|
id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
409
362
|
name: _propTypes["default"].string
|
|
410
363
|
})),
|
|
411
|
-
|
|
412
364
|
/** array of selected item objects, only considered if onChange event is given */
|
|
413
365
|
value: _propTypes["default"].any,
|
|
414
|
-
|
|
415
366
|
/** array of default selected item objects */
|
|
416
367
|
defaultValue: _propTypes["default"].any,
|
|
417
368
|
onChange: _propTypes["default"].func,
|
|
418
|
-
|
|
419
369
|
/** pass true if dropdown has to be disabled */
|
|
420
370
|
disabled: _propTypes["default"].bool,
|
|
421
|
-
|
|
422
371
|
/* set to true if you want search ability for dropdown items */
|
|
423
372
|
showSearch: _propTypes["default"].bool,
|
|
424
|
-
|
|
425
373
|
/* placeholder to show in the search box */
|
|
426
374
|
searchPlaceholder: _propTypes["default"].string,
|
|
427
|
-
|
|
428
375
|
/** Is dropdown multi select or single select */
|
|
429
376
|
multiSelect: _propTypes["default"].bool,
|
|
430
|
-
|
|
431
377
|
/** ID attribute key to use when rendering the dropdown items, if the ID attribute is other than "id" */
|
|
432
378
|
idAttribute: _propTypes["default"].string,
|
|
433
|
-
|
|
434
379
|
/** name attribute key to use when rendering the dropdown items, if the name attribute is other than "name" */
|
|
435
380
|
nameAttribute: _propTypes["default"].string,
|
|
436
|
-
|
|
381
|
+
/** Add title attribute to list element for large data */
|
|
382
|
+
showClippedContentTitle: _propTypes["default"].bool,
|
|
437
383
|
/** Provide a custom element for rendering dropdown item */
|
|
438
384
|
DropdownItem: _propTypes["default"].oneOfType([_propTypes["default"].instanceOf(Element), _propTypes["default"].func]),
|
|
439
|
-
|
|
440
385
|
/** Pass true to show a create CTA at the end of the dropdown */
|
|
441
386
|
showCreateCTA: _propTypes["default"].bool,
|
|
442
|
-
|
|
443
387
|
/** Customize the create CTA HTML by passing a createCTAComponent */
|
|
444
388
|
createCTAComponent: _propTypes["default"].any,
|
|
445
|
-
|
|
446
389
|
/** Callback that gets called when Create CTA button is clicked */
|
|
447
390
|
onCreateCTAClick: _propTypes["default"].func,
|
|
448
|
-
|
|
449
391
|
/** Pass this component to customise the selection summary HTML.
|
|
450
392
|
* The array of selected item objects will be sent as props
|
|
451
393
|
*/
|
|
452
394
|
SelectionSummary: _propTypes["default"].func,
|
|
453
|
-
|
|
454
395
|
/** Define the appearance of the form element. Accepted values are either "inline" or "block" */
|
|
455
396
|
appearance: _propTypes["default"].oneOf(["inline", "block"]),
|
|
456
|
-
|
|
457
397
|
/** Array of validations to perform on the form element value.
|
|
458
398
|
* If the validation fails, you will get an "error" field in the form onSubmit event */
|
|
459
399
|
validations: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
@@ -461,41 +401,30 @@ Dropdown.propTypes = {
|
|
|
461
401
|
message: _propTypes["default"].string.isRequired,
|
|
462
402
|
validator: _propTypes["default"].func
|
|
463
403
|
})),
|
|
464
|
-
|
|
465
404
|
/** Type of pagination for the dropdown list items. Send "SERVER" for server side pagination */
|
|
466
405
|
paginationType: _propTypes["default"].oneOf(["NONE", "SERVER"]),
|
|
467
|
-
|
|
468
406
|
/** If paginationType is "SERVER", pass the requestId for the server request */
|
|
469
407
|
requestId: function requestId(props, propName) {
|
|
470
408
|
if (props["paginationType"] == "SERVER" && (!props[propName] || typeof props[propName] === "undefined")) {
|
|
471
409
|
return new Error("Please provide a requestId for paginationType 'SERVER'!");
|
|
472
410
|
}
|
|
473
411
|
},
|
|
474
|
-
|
|
475
412
|
/** If paginationType is "SERVER", pass any additional params to be sent to the server request */
|
|
476
413
|
requestParams: _propTypes["default"].object,
|
|
477
|
-
|
|
478
414
|
/** If paginationType is "SERVER", pass the pageNo. attribute to be sent to the server request */
|
|
479
415
|
pageNoKey: _propTypes["default"].string,
|
|
480
|
-
|
|
481
416
|
/** If paginationType is "SERVER", pass the pageSize attribute to be sent to the server request */
|
|
482
417
|
perPageKey: _propTypes["default"].string,
|
|
483
|
-
|
|
484
418
|
/** If paginationType is "SERVER", max height of the dropdown container */
|
|
485
419
|
maxHeight: _propTypes["default"].number,
|
|
486
|
-
|
|
487
420
|
/** If paginationType is "SERVER", height of each dropdown item */
|
|
488
421
|
ddItemHeight: _propTypes["default"].number,
|
|
489
|
-
|
|
490
422
|
/** If paginationType is "SERVER", max number of items to show for one page in the dropdown container */
|
|
491
423
|
pageSize: _propTypes["default"].number,
|
|
492
|
-
|
|
493
424
|
/** Default page number to use for server paginated list */
|
|
494
425
|
minPageNo: _propTypes["default"].number,
|
|
495
|
-
|
|
496
426
|
/** If paginationType is "SERVER" & showSearch is true, pass the search attribute to be sent to the server request */
|
|
497
427
|
searchAttribute: _propTypes["default"].string,
|
|
498
|
-
|
|
499
428
|
/** If paginationType is "SERVER",
|
|
500
429
|
* component expects the response to be of the form
|
|
501
430
|
* { [pageNoKey]: <pageNo>, [perPageKey]: <pageSize>, total: <totalCount>, entries: [{}] }
|
|
@@ -503,19 +432,14 @@ Dropdown.propTypes = {
|
|
|
503
432
|
* Input to this function is the response received from your API
|
|
504
433
|
* */
|
|
505
434
|
responseFormatter: _propTypes["default"].func,
|
|
506
|
-
|
|
507
435
|
/** If paginationType is "SERVER", function that is expected to return the URL Params object */
|
|
508
436
|
getUrlParams: _propTypes["default"].func,
|
|
509
|
-
|
|
510
437
|
/** Show the optional clear button for resetting selections */
|
|
511
438
|
showClear: _propTypes["default"].bool,
|
|
512
|
-
|
|
513
439
|
/** Custom on clear function */
|
|
514
440
|
onClear: _propTypes["default"].func,
|
|
515
|
-
|
|
516
441
|
/** Callback on query search in dropdown */
|
|
517
442
|
onSearchChange: _propTypes["default"].func,
|
|
518
|
-
|
|
519
443
|
/** List header Component */
|
|
520
444
|
ListHeaderItem: _propTypes["default"].string
|
|
521
445
|
};
|