@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,72 +1,55 @@
|
|
|
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
12
|
var _excluded = ["label", "name", "className", "value", "defaultValue", "placeholder", "appearance", "onChange"];
|
|
19
|
-
|
|
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 _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; }
|
|
31
|
-
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
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); }
|
|
32
21
|
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; }
|
|
33
|
-
|
|
34
22
|
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; }
|
|
35
|
-
|
|
36
23
|
var Textarea = function Textarea(props) {
|
|
37
24
|
var label = props.label,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
name = props.name,
|
|
26
|
+
className = props.className,
|
|
27
|
+
value = props.value,
|
|
28
|
+
defaultValue = props.defaultValue,
|
|
29
|
+
placeholder = props.placeholder,
|
|
30
|
+
appearance = props.appearance,
|
|
31
|
+
onChange = props.onChange,
|
|
32
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
47
33
|
var _useContext = (0, _react.useContext)(_Form.FormContext),
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
onValueChange = _useContext.onValueChange;
|
|
50
35
|
var postFormValueChange = function postFormValueChange(value) {
|
|
51
36
|
typeof onValueChange === "function" && onValueChange(name, value);
|
|
52
37
|
};
|
|
53
|
-
|
|
54
38
|
var onInputChange = function onInputChange(event) {
|
|
55
|
-
var value = event.target.value;
|
|
39
|
+
var value = event.target.value;
|
|
40
|
+
|
|
41
|
+
// TODO : do validations
|
|
56
42
|
|
|
57
43
|
if (typeof onChange === "function") {
|
|
58
44
|
onChange(value);
|
|
59
45
|
}
|
|
60
|
-
|
|
61
46
|
postFormValueChange(value);
|
|
62
47
|
};
|
|
63
|
-
|
|
64
48
|
(0, _react.useEffect)(function () {
|
|
65
49
|
/* set the initial form element value in the form context */
|
|
66
50
|
var postValue = typeof onChange === "function" ? value : defaultValue;
|
|
67
51
|
postFormValueChange(postValue);
|
|
68
52
|
}, [value, defaultValue]);
|
|
69
|
-
|
|
70
53
|
var inputProps = _objectSpread({
|
|
71
54
|
label: label,
|
|
72
55
|
name: name,
|
|
@@ -76,12 +59,10 @@ var Textarea = function Textarea(props) {
|
|
|
76
59
|
className: "RCB-form-el",
|
|
77
60
|
onChange: onInputChange
|
|
78
61
|
}, restProps);
|
|
79
|
-
|
|
80
62
|
if (typeof onChange === "function") {
|
|
81
63
|
/* make it a controlled component if onChange function is given */
|
|
82
64
|
inputProps.value = value;
|
|
83
65
|
}
|
|
84
|
-
|
|
85
66
|
return /*#__PURE__*/_react["default"].createElement(_FormElementWrapper["default"], {
|
|
86
67
|
className: className,
|
|
87
68
|
appearance: appearance
|
|
@@ -90,25 +71,19 @@ var Textarea = function Textarea(props) {
|
|
|
90
71
|
htmlFor: name
|
|
91
72
|
}, label), /*#__PURE__*/_react["default"].createElement("textarea", inputProps));
|
|
92
73
|
};
|
|
93
|
-
|
|
94
74
|
Textarea.propTypes = {
|
|
95
75
|
/** Pass any additional classNames to Textarea component */
|
|
96
76
|
className: _propTypes["default"].string,
|
|
97
|
-
|
|
98
77
|
/** Label for the input element */
|
|
99
78
|
label: _propTypes["default"].string,
|
|
100
|
-
|
|
101
79
|
/** Unique ID for the input element */
|
|
102
80
|
name: _propTypes["default"].string.isRequired,
|
|
103
|
-
|
|
104
81
|
/* Will be used only with onChange function, or else ignored */
|
|
105
82
|
value: _propTypes["default"].any,
|
|
106
83
|
defaultValue: _propTypes["default"].any,
|
|
107
84
|
placeholder: _propTypes["default"].string,
|
|
108
|
-
|
|
109
85
|
/* Define the appearance of the form element. Accepted values are either "inline" or "block" */
|
|
110
86
|
appearance: _propTypes["default"].oneOf(["inline", "block"]),
|
|
111
|
-
|
|
112
87
|
/* Becomes a controlled component if onChange function is given */
|
|
113
88
|
onChange: _propTypes["default"].func
|
|
114
89
|
};
|
|
@@ -1,61 +1,42 @@
|
|
|
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 _customHooks = require("../../core/customHooks");
|
|
13
|
-
|
|
14
10
|
var _Form = require("./Form");
|
|
15
|
-
|
|
16
11
|
var _FormElementWrapper = _interopRequireDefault(require("./FormElementWrapper"));
|
|
17
|
-
|
|
18
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
-
|
|
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
16
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
|
|
28
17
|
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."); }
|
|
29
|
-
|
|
30
18
|
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); }
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
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; }
|
|
35
|
-
|
|
19
|
+
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; }
|
|
20
|
+
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; } }
|
|
36
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
|
|
38
22
|
var Toggle = function Toggle(props) {
|
|
39
23
|
var name = props.name,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
24
|
+
label = props.label,
|
|
25
|
+
value = props.value,
|
|
26
|
+
defaultValue = props.defaultValue,
|
|
27
|
+
className = props.className,
|
|
28
|
+
appearance = props.appearance,
|
|
29
|
+
toggleElWidth = props.toggleElWidth,
|
|
30
|
+
toggleKnobSize = props.toggleKnobSize,
|
|
31
|
+
onChange = props.onChange,
|
|
32
|
+
disabled = props.disabled;
|
|
49
33
|
var initialValue = typeof onChange === "function" ? value : defaultValue;
|
|
50
|
-
|
|
51
34
|
var _useState = (0, _react.useState)(initialValue),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
isActive = _useState2[0],
|
|
37
|
+
setIsActive = _useState2[1];
|
|
56
38
|
var _useContext = (0, _react.useContext)(_Form.FormContext),
|
|
57
|
-
|
|
58
|
-
|
|
39
|
+
onValueChange = _useContext.onValueChange;
|
|
59
40
|
var toggleActive = function toggleActive() {
|
|
60
41
|
if (typeof onChange === "function") {
|
|
61
42
|
onChange(!isActive);
|
|
@@ -63,11 +44,9 @@ var Toggle = function Toggle(props) {
|
|
|
63
44
|
setIsActive(!isActive);
|
|
64
45
|
}
|
|
65
46
|
};
|
|
66
|
-
|
|
67
47
|
var postFormValueChange = function postFormValueChange(value) {
|
|
68
48
|
typeof onValueChange === "function" && onValueChange(name, value);
|
|
69
49
|
};
|
|
70
|
-
|
|
71
50
|
(0, _customHooks.useDidUpdateEffect)(function () {
|
|
72
51
|
/* runs only when isActive changes, hence call the onChange function then */
|
|
73
52
|
var value = isActive;
|
|
@@ -87,11 +66,9 @@ var Toggle = function Toggle(props) {
|
|
|
87
66
|
width: "".concat(toggleKnobSize, "px"),
|
|
88
67
|
height: "".concat(toggleKnobSize, "px")
|
|
89
68
|
};
|
|
90
|
-
|
|
91
69
|
if (isActive) {
|
|
92
70
|
toggleKnobCSS.transform = "translateX(".concat(toggleElWidth - toggleKnobSize, "px)");
|
|
93
71
|
}
|
|
94
|
-
|
|
95
72
|
var toggleClasses = "RCB-form-el RCB-toggle ".concat(isActive ? "active" : "", " ").concat(disabled ? "RCB-toggle-disable" : "");
|
|
96
73
|
return /*#__PURE__*/_react["default"].createElement(_FormElementWrapper["default"], {
|
|
97
74
|
className: className,
|
|
@@ -108,33 +85,24 @@ var Toggle = function Toggle(props) {
|
|
|
108
85
|
style: toggleKnobCSS
|
|
109
86
|
})));
|
|
110
87
|
};
|
|
111
|
-
|
|
112
88
|
Toggle.propTypes = {
|
|
113
89
|
/** Pass any additional classNames to Input component */
|
|
114
90
|
className: _propTypes["default"].string,
|
|
115
|
-
|
|
116
91
|
/** Label for the input element */
|
|
117
92
|
label: _propTypes["default"].string,
|
|
118
|
-
|
|
119
93
|
/** Unique ID for the input element */
|
|
120
94
|
name: _propTypes["default"].string.isRequired,
|
|
121
|
-
|
|
122
95
|
/** Will be used only with onChange function, or else ignored */
|
|
123
96
|
value: _propTypes["default"].bool,
|
|
124
97
|
defaultValue: _propTypes["default"].bool,
|
|
125
|
-
|
|
126
98
|
/** Set this to true to disable the toggle component */
|
|
127
99
|
disabled: _propTypes["default"].bool,
|
|
128
|
-
|
|
129
100
|
/** Define the appearance of the form element. Accepted values are either "inline" or "block" */
|
|
130
101
|
appearance: _propTypes["default"].oneOf(["inline", "block"]),
|
|
131
|
-
|
|
132
102
|
/** Becomes a controlled component if onChange function is given */
|
|
133
103
|
onChange: _propTypes["default"].func,
|
|
134
|
-
|
|
135
104
|
/** width of the toggle element in pixels */
|
|
136
105
|
toggleElWidth: _propTypes["default"].number,
|
|
137
|
-
|
|
138
106
|
/** size of the toggle inner knob in pixels */
|
|
139
107
|
toggleKnobSize: _propTypes["default"].number
|
|
140
108
|
};
|
package/components/Form/index.js
CHANGED
|
@@ -6,80 +6,68 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "Checkbox", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _Checkbox["default"];
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "DragDropFileUploader", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _DragDropFileUploader["default"];
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "Dropdown", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return
|
|
21
|
+
return _Dropdown["default"];
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "FileUploader", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function get() {
|
|
27
|
-
return
|
|
27
|
+
return _FileUploader["default"];
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "Input", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function get() {
|
|
33
|
-
return
|
|
33
|
+
return _Input["default"];
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "RadioList", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
get: function get() {
|
|
39
|
-
return
|
|
39
|
+
return _RadioList["default"];
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "RangeSlider", {
|
|
43
43
|
enumerable: true,
|
|
44
44
|
get: function get() {
|
|
45
|
-
return
|
|
45
|
+
return _RangeSlider["default"];
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "Textarea", {
|
|
49
49
|
enumerable: true,
|
|
50
50
|
get: function get() {
|
|
51
|
-
return
|
|
51
|
+
return _Textarea["default"];
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "Toggle", {
|
|
55
55
|
enumerable: true,
|
|
56
56
|
get: function get() {
|
|
57
|
-
return
|
|
57
|
+
return _Toggle["default"];
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
exports["default"] = void 0;
|
|
61
|
-
|
|
62
61
|
var _Form = _interopRequireDefault(require("./Form"));
|
|
63
|
-
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
var _Dropdown2 = _interopRequireDefault(require("./Dropdown"));
|
|
73
|
-
|
|
74
|
-
var _RangeSlider2 = _interopRequireDefault(require("./RangeSlider"));
|
|
75
|
-
|
|
76
|
-
var _FileUploader2 = _interopRequireDefault(require("./FileUploader"));
|
|
77
|
-
|
|
78
|
-
var _DragDropFileUploader2 = _interopRequireDefault(require("./DragDropFileUploader"));
|
|
79
|
-
|
|
80
|
-
var _Toggle2 = _interopRequireDefault(require("./Toggle"));
|
|
81
|
-
|
|
62
|
+
var _Input = _interopRequireDefault(require("./Input"));
|
|
63
|
+
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
64
|
+
var _RadioList = _interopRequireDefault(require("./RadioList"));
|
|
65
|
+
var _Textarea = _interopRequireDefault(require("./Textarea"));
|
|
66
|
+
var _Dropdown = _interopRequireDefault(require("./Dropdown"));
|
|
67
|
+
var _RangeSlider = _interopRequireDefault(require("./RangeSlider"));
|
|
68
|
+
var _FileUploader = _interopRequireDefault(require("./FileUploader"));
|
|
69
|
+
var _DragDropFileUploader = _interopRequireDefault(require("./DragDropFileUploader"));
|
|
70
|
+
var _Toggle = _interopRequireDefault(require("./Toggle"));
|
|
82
71
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
83
|
-
|
|
84
72
|
var _default = _Form["default"];
|
|
85
73
|
exports["default"] = _default;
|
|
@@ -1,32 +1,22 @@
|
|
|
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._Checkbox = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _Form = _interopRequireDefault(require("../Form"));
|
|
13
|
-
|
|
14
10
|
var _Checkbox2 = _interopRequireDefault(require("../Checkbox"));
|
|
15
|
-
|
|
16
11
|
var _Button = _interopRequireWildcard(require("../../Button"));
|
|
17
|
-
|
|
18
12
|
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); }
|
|
19
|
-
|
|
20
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
15
|
var _Checkbox = function _Checkbox() {
|
|
25
16
|
var onSubmit = function onSubmit(formData) {
|
|
26
17
|
var data = formData.data;
|
|
27
18
|
console.log("Submitted data: ", data);
|
|
28
19
|
};
|
|
29
|
-
|
|
30
20
|
return /*#__PURE__*/_react["default"].createElement(_Form["default"], {
|
|
31
21
|
onSubmit: onSubmit
|
|
32
22
|
}, /*#__PURE__*/_react["default"].createElement(_Checkbox2["default"], {
|
|
@@ -45,7 +35,6 @@ var _Checkbox = function _Checkbox() {
|
|
|
45
35
|
className: "full-width-btn"
|
|
46
36
|
}, "Submit"));
|
|
47
37
|
};
|
|
48
|
-
|
|
49
38
|
exports._Checkbox = _Checkbox;
|
|
50
39
|
_Checkbox.story = {
|
|
51
40
|
parameters: {
|
|
@@ -4,32 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.SimpleUsage = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _DragDropFileUploader = _interopRequireDefault(require("../DragDropFileUploader"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
var _default = {
|
|
15
11
|
title: "DragDropFileUploader"
|
|
16
12
|
};
|
|
17
13
|
exports["default"] = _default;
|
|
18
|
-
|
|
19
14
|
var SimpleUsage = function SimpleUsage() {
|
|
20
15
|
var onFileChange = function onFileChange() {
|
|
21
16
|
var files = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
22
17
|
console.log("SELECTED FILES");
|
|
23
|
-
|
|
24
18
|
for (var i = 0; i < files.length; i++) {
|
|
25
19
|
console.log(files[i].name);
|
|
26
20
|
}
|
|
27
21
|
};
|
|
28
|
-
|
|
29
22
|
return /*#__PURE__*/_react["default"].createElement(_DragDropFileUploader["default"], {
|
|
30
23
|
onChange: onFileChange,
|
|
31
24
|
appearance: "block"
|
|
32
25
|
}, /*#__PURE__*/_react["default"].createElement("div", null, "Drag & drop files into this area"));
|
|
33
26
|
};
|
|
34
|
-
|
|
35
27
|
exports.SimpleUsage = SimpleUsage;
|
|
@@ -4,33 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.SimpleUsage = exports.SearchEnbaledDropdown = exports.PaginatedDropdown = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _Constants = require("../../../../public/Constants");
|
|
11
|
-
|
|
12
9
|
var _Dropdown = _interopRequireDefault(require("../Dropdown"));
|
|
13
|
-
|
|
14
10
|
var _dataLoader = _interopRequireDefault(require("../../../core/dataLoader"));
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
12
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
18
|
var _default = {
|
|
25
19
|
title: "Dropdown"
|
|
26
20
|
};
|
|
27
21
|
exports["default"] = _default;
|
|
28
|
-
|
|
29
22
|
var SimpleUsage = function SimpleUsage() {
|
|
30
23
|
var onChange = function onChange(selectedFruit) {
|
|
31
24
|
console.log("Selected Fruit: ", selectedFruit);
|
|
32
25
|
};
|
|
33
|
-
|
|
34
26
|
return /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
35
27
|
name: "fruit",
|
|
36
28
|
label: "Select a fruit",
|
|
@@ -41,7 +33,6 @@ var SimpleUsage = function SimpleUsage() {
|
|
|
41
33
|
noSelectionLabel: "Select"
|
|
42
34
|
});
|
|
43
35
|
};
|
|
44
|
-
|
|
45
36
|
exports.SimpleUsage = SimpleUsage;
|
|
46
37
|
SimpleUsage.story = {
|
|
47
38
|
name: "Simple Usage ",
|
|
@@ -51,23 +42,19 @@ SimpleUsage.story = {
|
|
|
51
42
|
}
|
|
52
43
|
}
|
|
53
44
|
};
|
|
54
|
-
|
|
55
45
|
_dataLoader["default"].addRequestConfig("getPaginatedUsers", {
|
|
56
46
|
method: "GET",
|
|
57
47
|
url: "https://reqres.in/api/users"
|
|
58
48
|
});
|
|
59
|
-
|
|
60
49
|
var PaginatedDropdown = function PaginatedDropdown() {
|
|
61
50
|
var onChange = function onChange(selected) {
|
|
62
51
|
console.log("Selected User: ", selected);
|
|
63
52
|
};
|
|
64
|
-
|
|
65
53
|
var responseFormatter = function responseFormatter(response) {
|
|
66
54
|
return _objectSpread(_objectSpread({}, response), {}, {
|
|
67
55
|
entries: response.data
|
|
68
56
|
});
|
|
69
57
|
};
|
|
70
|
-
|
|
71
58
|
return /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
72
59
|
paginationType: "SERVER",
|
|
73
60
|
requestId: "getPaginatedUsers",
|
|
@@ -82,7 +69,6 @@ var PaginatedDropdown = function PaginatedDropdown() {
|
|
|
82
69
|
responseFormatter: responseFormatter
|
|
83
70
|
});
|
|
84
71
|
};
|
|
85
|
-
|
|
86
72
|
exports.PaginatedDropdown = PaginatedDropdown;
|
|
87
73
|
PaginatedDropdown.story = {
|
|
88
74
|
name: "Dropdown with server side pagination",
|
|
@@ -92,18 +78,15 @@ PaginatedDropdown.story = {
|
|
|
92
78
|
}
|
|
93
79
|
}
|
|
94
80
|
};
|
|
95
|
-
|
|
96
81
|
var SearchEnbaledDropdown = function SearchEnbaledDropdown() {
|
|
97
82
|
var onChange = function onChange(selected) {
|
|
98
83
|
console.log("Selected User: ", selected);
|
|
99
84
|
};
|
|
100
|
-
|
|
101
85
|
var responseFormatter = function responseFormatter(response) {
|
|
102
86
|
return _objectSpread(_objectSpread({}, response), {}, {
|
|
103
87
|
entries: response.data
|
|
104
88
|
});
|
|
105
89
|
};
|
|
106
|
-
|
|
107
90
|
return /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
108
91
|
paginationType: "SERVER",
|
|
109
92
|
requestId: "getPaginatedUsers",
|
|
@@ -120,7 +103,6 @@ var SearchEnbaledDropdown = function SearchEnbaledDropdown() {
|
|
|
120
103
|
responseFormatter: responseFormatter
|
|
121
104
|
});
|
|
122
105
|
};
|
|
123
|
-
|
|
124
106
|
exports.SearchEnbaledDropdown = SearchEnbaledDropdown;
|
|
125
107
|
PaginatedDropdown.story = {
|
|
126
108
|
name: "Dropdown with server side search and pagination",
|
|
@@ -4,28 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.SimpleUsage = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _FileUploader = _interopRequireDefault(require("../FileUploader"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
var _default = {
|
|
15
11
|
title: "FileUploader"
|
|
16
12
|
};
|
|
17
13
|
exports["default"] = _default;
|
|
18
|
-
|
|
19
14
|
var SimpleUsage = function SimpleUsage() {
|
|
20
15
|
var onFileChange = function onFileChange() {
|
|
21
16
|
var files = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
22
17
|
console.log("SELECTED FILES");
|
|
23
|
-
|
|
24
18
|
for (var i = 0; i < files.length; i++) {
|
|
25
19
|
console.log(files[i].name);
|
|
26
20
|
}
|
|
27
21
|
};
|
|
28
|
-
|
|
29
22
|
return /*#__PURE__*/_react["default"].createElement(_FileUploader["default"], {
|
|
30
23
|
name: "files",
|
|
31
24
|
appearance: "block",
|
|
@@ -35,5 +28,4 @@ var SimpleUsage = function SimpleUsage() {
|
|
|
35
28
|
href: "javascript:void(0)"
|
|
36
29
|
}, "Upload File"));
|
|
37
30
|
};
|
|
38
|
-
|
|
39
31
|
exports.SimpleUsage = SimpleUsage;
|