@councilbox/councilbox-ui 2.0.53 → 2.0.55
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/Accordion.js +3 -0
- package/Alert.js +3 -0
- package/Avatar.js +3 -0
- package/AvatarGroup.js +3 -0
- package/Block.js +3 -0
- package/Button.js +3 -0
- package/ButtonBasic.js +3 -0
- package/Checkbox.js +3 -0
- package/DatePicker.js +3 -0
- package/DateRangePicker.js +3 -0
- package/DateTimePicker.js +3 -0
- package/DragDrop.js +3 -0
- package/DrawerPanel.js +3 -0
- package/DropDown.js +3 -0
- package/EnhancedTable.js +3 -0
- package/FabButton.js +3 -0
- package/Grid.js +3 -0
- package/Header.js +3 -0
- package/IconButton.js +3 -0
- package/IconButtonSquare.js +3 -0
- package/IconFont.js +3 -0
- package/InputAutocomplete.js +3 -0
- package/InputPassword.js +3 -0
- package/InputText.js +3 -0
- package/InputTextArea.js +3 -0
- package/LoadingSection.js +3 -0
- package/MenuItem.js +3 -0
- package/MenuLateralLeft.js +3 -0
- package/MenuLateralRight.js +3 -0
- package/Modal.js +3 -0
- package/Radio.js +3 -0
- package/RichTextInput.js +3 -0
- package/Scrollbar.js +3 -0
- package/ScrollbarNew.js +3 -0
- package/SelectInput.js +3 -0
- package/Slider.js +3 -0
- package/Spacing.js +3 -0
- package/Stars.js +3 -0
- package/Stepper.js +3 -0
- package/Table.js +3 -0
- package/TableBody.js +3 -0
- package/TableCell.js +3 -0
- package/TableContainer.js +3 -0
- package/TableHead.js +3 -0
- package/TableRow.js +3 -0
- package/TableSortLabel.js +3 -0
- package/Tabs.js +3 -0
- package/Tag.js +3 -0
- package/TextInput.js +3 -0
- package/ThemeProvider.js +3 -0
- package/TimePicker.js +3 -0
- package/Timeline.js +3 -0
- package/ToastProvider.js +3 -0
- package/Toggle.js +3 -0
- package/Tooltip.js +3 -0
- package/Typography.js +3 -0
- package/dist/HOCs/overlayA11yStack.js +47 -0
- package/dist/HOCs/useA11yGuard.js +38 -0
- package/dist/HOCs/useDynamicStyles.js +41 -60
- package/dist/HOCs/useMenuNavigation.js +110 -0
- package/dist/HOCs/useOverlay.js +87 -0
- package/dist/HOCs/usePopoverPosition.js +228 -0
- package/dist/HOCs/useRipple.js +17 -35
- package/dist/HOCs/useWindowSize.js +24 -42
- package/dist/build-index.js +119 -99
- package/dist/components/1.Introduction.stories.mdx +4 -1
- package/dist/components/2.Changelog.stories.mdx +54 -0
- package/dist/components/3.Guide.stories.mdx +1 -1
- package/dist/components/Accordion/Accordion.css +7 -0
- package/dist/components/Accordion/Accordion.js +97 -102
- package/dist/components/Accordion/Accordion.stories.js +10 -12
- package/dist/components/Accordion/DesignAccordion.stories.js +10 -21
- package/dist/components/Alert/Alert.js +55 -55
- package/dist/components/Alert/Alert.stories.js +10 -11
- package/dist/components/Avatar/Avatar.js +82 -74
- package/dist/components/Avatar/Avatar.stories.js +19 -23
- package/dist/components/Avatar/DesignAvatar.stories.js +18 -26
- package/dist/components/Avatar/DesignAvatarText.stories.js +31 -40
- package/dist/components/AvatarGroup/AvatarGroup.js +7 -14
- package/dist/components/AvatarGroup/AvatarGroup.stories.js +6 -13
- package/dist/components/AvatarGroup/DesignAvatarGroup.stories.js +34 -45
- package/dist/components/Block/Block.css +3 -3
- package/dist/components/Block/Block.js +31 -45
- package/dist/components/Block/Block.stories.js +5 -12
- package/dist/components/Block/DesignBlock.stories.js +7 -13
- package/dist/components/Button/Button.js +44 -66
- package/dist/components/Button/Button.stories.js +8 -14
- package/dist/components/Button/button.css +1 -1
- package/dist/components/ButtonBasic/ButtonBasic.css +6 -1
- package/dist/components/ButtonBasic/ButtonBasic.js +96 -118
- package/dist/components/ButtonBasic/ButtonBasic.stories.js +14 -15
- package/dist/components/Checkbox/Checkbox.css +6 -0
- package/dist/components/Checkbox/Checkbox.js +81 -100
- package/dist/components/Checkbox/Checkbox.stories.js +10 -11
- package/dist/components/DatePicker/Calendar.js +243 -0
- package/dist/components/DatePicker/DatePicker.css +197 -0
- package/dist/components/DatePicker/DatePicker.js +384 -0
- package/dist/components/DatePicker/DatePicker.stories.js +180 -0
- package/dist/components/DatePicker/dateUtils.js +478 -0
- package/dist/components/DateRangePicker/DateRangePicker.css +41 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +435 -0
- package/dist/components/DateRangePicker/DateRangePicker.stories.js +147 -0
- package/dist/components/DateRangePicker/RangeCalendar.js +188 -0
- package/dist/components/DateTimePicker/DateTimePicker.css +4 -0
- package/dist/components/DateTimePicker/DateTimePicker.js +481 -0
- package/dist/components/DateTimePicker/DateTimePicker.stories.js +144 -0
- package/dist/components/DateTimePicker/TimeColumns.css +46 -0
- package/dist/components/DateTimePicker/TimeColumns.js +175 -0
- package/dist/components/DragDrop/DragDrop.css +20 -9
- package/dist/components/DragDrop/DragDrop.js +83 -76
- package/dist/components/DragDrop/DragDrop.stories.js +9 -16
- package/dist/components/DrawerPanel/DesignDrawerPanel.js +35 -53
- package/dist/components/DrawerPanel/DrawerPanel.js +157 -146
- package/dist/components/DrawerPanel/DrawerPanel.stories.js +10 -12
- package/dist/components/DropDown/DesignDropDown.stories.js +87 -97
- package/dist/components/DropDown/DropDown.js +179 -343
- package/dist/components/DropDown/DropDown.stories.js +6 -12
- package/dist/components/DropDown/PopoverPlayground.js +68 -98
- package/dist/components/EnhancedTable/DesignEnhancedTable.stories.js +26 -36
- package/dist/components/EnhancedTable/EnhancedMyTable.js +16 -19
- package/dist/components/EnhancedTable/EnhancedTable.js +77 -136
- package/dist/components/EnhancedTable/EnhancedTable.stories.js +5 -12
- package/dist/components/EnhancedTable/EnhancedTableBody.js +11 -14
- package/dist/components/EnhancedTable/EnhancedTableCell.js +25 -34
- package/dist/components/EnhancedTable/EnhancedTableContainer.js +11 -14
- package/dist/components/EnhancedTable/EnhancedTableHead.js +11 -14
- package/dist/components/EnhancedTable/EnhancedTableRow.js +15 -18
- package/dist/components/EnhancedTable/EnhancedTableSortLabel.js +15 -18
- package/dist/components/FabButton/DesignFabButton.stories.js +9 -16
- package/dist/components/FabButton/FabButton.js +51 -54
- package/dist/components/FabButton/FabButton.stories.js +10 -12
- package/dist/components/Grid/DesignGrid.stories.js +7 -14
- package/dist/components/Grid/Grid.js +38 -46
- package/dist/components/Grid/Grid.stories.js +6 -13
- package/dist/components/Grid/GridItem.js +37 -39
- package/dist/components/Header/DesignHeader.stories.js +20 -24
- package/dist/components/Header/Header.js +227 -246
- package/dist/components/Header/Header.stories.js +9 -21
- package/dist/components/Header/header.css +10 -5
- package/dist/components/IconButton/DesignIconButton.stories.js +31 -36
- package/dist/components/IconButton/IconButton.css +6 -1
- package/dist/components/IconButton/IconButton.js +135 -140
- package/dist/components/IconButton/IconButton.stories.js +12 -13
- package/dist/components/IconButtonSquare/DesignIconButtonSquare.stories.js +5 -11
- package/dist/components/IconButtonSquare/IconButtonSquare.js +14 -28
- package/dist/components/IconButtonSquare/IconButtonSquare.stories.js +7 -13
- package/dist/components/IconFont/IconFont.js +27 -48
- package/dist/components/IconFont/IconFont.stories.js +5 -11
- package/dist/components/InputAutocomplete/InputAutocomplete.css +6 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.js +184 -260
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +5 -11
- package/dist/components/InputPassword/InputPassword.css +0 -6
- package/dist/components/InputPassword/InputPassword.js +58 -73
- package/dist/components/InputPassword/InputPassword.stories.js +5 -11
- package/dist/components/InputText/InputText.css +96 -83
- package/dist/components/InputText/InputText.js +211 -215
- package/dist/components/InputText/InputText.stories.js +11 -11
- package/dist/components/InputTextArea/DesignInputTextArea.stories.js +38 -51
- package/dist/components/InputTextArea/InputTextArea.js +84 -93
- package/dist/components/InputTextArea/InputTextArea.stories.js +5 -12
- package/dist/components/LoadingSection/LoadingSection.js +44 -51
- package/dist/components/LoadingSection/LoadingSection.stories.js +5 -11
- package/dist/components/MenuItem/DesignMenuItem.stories.js +20 -34
- package/dist/components/MenuItem/MenuItem.css +7 -2
- package/dist/components/MenuItem/MenuItem.js +131 -140
- package/dist/components/MenuItem/MenuItem.stories.js +6 -15
- package/dist/components/MenuLateralLeft/MenuLateralLeft.css +24 -0
- package/dist/components/MenuLateralLeft/MenuLateralLeft.js +120 -157
- package/dist/components/MenuLateralLeft/MenuLateralLeft.stories.js +5 -12
- package/dist/components/MenuLateralRight/MenuLateralRight.css +2 -2
- package/dist/components/MenuLateralRight/MenuLateralRight.js +91 -79
- package/dist/components/MenuLateralRight/MenuLateralRight.stories.js +5 -12
- package/dist/components/Modal/DesignModal.stories.js +15 -30
- package/dist/components/Modal/Modal.css +35 -15
- package/dist/components/Modal/Modal.js +156 -145
- package/dist/components/Modal/Modal.stories.js +7 -16
- package/dist/components/PaginationFooter/DesignPaginationFooter.stories.js +4 -10
- package/dist/components/PaginationFooter/PaginationFooter.css +10 -0
- package/dist/components/PaginationFooter/PaginationFooter.js +99 -91
- package/dist/components/PaginationFooter/PaginationFooter.stories.js +5 -12
- package/dist/components/RadioButton/Radio.css +19 -18
- package/dist/components/RadioButton/Radio.js +65 -83
- package/dist/components/RadioButton/Radio.stories.js +27 -36
- package/dist/components/RichTextInput/DesignRichTextInput.stories.js +119 -0
- package/dist/components/RichTextInput/RichTextInput.css +309 -0
- package/dist/components/RichTextInput/RichTextInput.js +851 -0
- package/dist/components/RichTextInput/RichTextInput.stories.js +33 -0
- package/dist/components/Ripple/DesignRipple.js +42 -41
- package/dist/components/Ripple/Ripple.stories.js +5 -11
- package/dist/components/Scrollbar/DesignScrollbar.js +5 -10
- package/dist/components/Scrollbar/Scrollbar.js +37 -56
- package/dist/components/Scrollbar/Scrollbar.stories.js +5 -12
- package/dist/components/ScrollbarNew/DesignScrollbarNew.js +24 -0
- package/dist/components/ScrollbarNew/ScrollbarNew.css +79 -0
- package/dist/components/ScrollbarNew/ScrollbarNew.js +426 -0
- package/dist/components/ScrollbarNew/ScrollbarNew.stories.js +37 -0
- package/dist/components/SelectInput/DesignSelectInput.js +22 -45
- package/dist/components/SelectInput/SelectInput.js +171 -218
- package/dist/components/SelectInput/SelectInput.stories.js +6 -15
- package/dist/components/Slider/DesignSlider.js +8 -14
- package/dist/components/Slider/Slider.css +57 -37
- package/dist/components/Slider/Slider.js +85 -84
- package/dist/components/Slider/Slider.stories.js +5 -12
- package/dist/components/Spacing/Spacing.js +38 -45
- package/dist/components/Spacing/Spacing.stories.js +5 -11
- package/dist/components/Stars/DesignStars.js +17 -30
- package/dist/components/Stars/Stars.css +55 -104
- package/dist/components/Stars/Stars.js +89 -73
- package/dist/components/Stars/Stars.stories.js +5 -12
- package/dist/components/Stepper/DesignStepper.stories.js +16 -30
- package/dist/components/Stepper/Stepper.css +46 -10
- package/dist/components/Stepper/Stepper.js +118 -134
- package/dist/components/Stepper/Stepper.stories.js +5 -12
- package/dist/components/Table/DesignTable.stories.js +200 -211
- package/dist/components/Table/Table.css +33 -2
- package/dist/components/Table/Table.js +30 -38
- package/dist/components/Table/Table.stories.js +5 -12
- package/dist/components/Table/TableBody.js +22 -34
- package/dist/components/Table/TableCell.js +71 -61
- package/dist/components/Table/TableContainer.js +22 -34
- package/dist/components/Table/TableHead.js +22 -34
- package/dist/components/Table/TableRow.js +33 -37
- package/dist/components/Table/TableSortLabel.js +42 -52
- package/dist/components/Tabs/DesignTabs.js +14 -28
- package/dist/components/Tabs/Tabs.css +30 -11
- package/dist/components/Tabs/Tabs.js +151 -138
- package/dist/components/Tabs/Tabs.stories.js +5 -12
- package/dist/components/Tag/DesignTags.stories.js +24 -39
- package/dist/components/Tag/Tag.css +61 -42
- package/dist/components/Tag/Tag.js +93 -91
- package/dist/components/Tag/Tag.stories.js +5 -12
- package/dist/components/TextInput/TextInput.js +38 -54
- package/dist/components/TextInput/TextInput.stories.js +5 -11
- package/dist/components/ThemeProvider/Colors.js +2 -2
- package/dist/components/ThemeProvider/CouncilboxThemeContext.js +7 -10
- package/dist/components/ThemeProvider/ThemeProvider.js +34 -52
- package/dist/components/TimePicker/TimePicker.css +3 -0
- package/dist/components/TimePicker/TimePicker.js +359 -0
- package/dist/components/TimePicker/TimePicker.stories.js +132 -0
- package/dist/components/Timeline/DesignTimeline.stories.js +4 -10
- package/dist/components/Timeline/Timeline.js +66 -46
- package/dist/components/Timeline/Timeline.stories.js +5 -12
- package/dist/components/Toast/DesignToast.stories.js +174 -0
- package/dist/components/Toast/Toast.css +154 -0
- package/dist/components/Toast/Toast.js +165 -0
- package/dist/components/Toast/Toast.stories.js +33 -0
- package/dist/components/Toast/ToastProvider.js +33 -0
- package/dist/components/Toast/ToastRoot.js +89 -0
- package/dist/components/Toast/toastStore.js +127 -0
- package/dist/components/Toast/useToast.js +42 -0
- package/dist/components/Toggle/Toggle.css +10 -0
- package/dist/components/Toggle/Toggle.js +123 -100
- package/dist/components/Toggle/Toggle.stories.js +10 -11
- package/dist/components/Tooltip/DesignTooltip.stories.js +10 -16
- package/dist/components/Tooltip/Tooltip.css +17 -1
- package/dist/components/Tooltip/Tooltip.js +195 -366
- package/dist/components/Tooltip/Tooltip.stories.js +5 -12
- package/dist/components/Typography/Typography.css +57 -6
- package/dist/components/Typography/Typography.js +44 -97
- package/dist/components/Typography/Typography.stories.js +5 -11
- package/dist/index.js +2 -6
- package/dist/reportWebVitals.js +8 -14
- package/dist/storybook.test.js +2 -4
- package/dist/styles/colorConsts.css +4 -4
- package/dist/styles/main.css +16 -0
- package/dist/styles/styleFont.css +1 -1
- package/dist/styles/stylesheet.js +10 -22
- package/dist/styles/zIndexConsts.css +2 -0
- package/dist/testing/TestAutocomplete.js +74 -97
- package/dist/testing/TestComponents.js +5 -10
- package/dist/testing/TestDropdown.js +33 -41
- package/dist/utils/autoDetectScroll.js +12 -35
- package/dist/utils/index.js +37 -63
- package/dist/utils/useFallbackId.js +19 -0
- package/package.json +67 -4
- package/toast.js +7 -0
- package/useCouncilboxTheme.js +7 -0
- package/useToast.js +7 -0
- package/dist/components/Accordion/AccordionOld.css +0 -16
- package/dist/components/Accordion/AccordionOld.js +0 -115
- package/dist/components/Avatar/AvatarOld.js +0 -138
- package/dist/components/ButtonBasic/ButtonBasicOld.css +0 -41
- package/dist/components/ButtonBasic/ButtonBasicOld.js +0 -231
- package/dist/components/Checkbox/CheckboxOld.css +0 -31
- package/dist/components/Checkbox/CheckboxOld.js +0 -112
- package/dist/components/DrawerPanel/DrawerPanelOld.css +0 -56
- package/dist/components/DrawerPanel/DrawerPanelOld.js +0 -233
- package/dist/components/DropDown/DropDownOld.css +0 -3
- package/dist/components/DropDown/DropDownOld.js +0 -186
- package/dist/components/Grid/GridItemOld.js +0 -43
- package/dist/components/Grid/GridOld.css +0 -0
- package/dist/components/Grid/GridOld.js +0 -53
- package/dist/components/IconButton/IconButtonOld.css +0 -0
- package/dist/components/IconButton/IconButtonOld.js +0 -138
- package/dist/components/IconButtonSquare/IconButtonSquareOld.css +0 -43
- package/dist/components/IconButtonSquare/IconButtonSquareOld.js +0 -133
- package/dist/components/InputAutocomplete/InputAutocompleteOld.css +0 -5
- package/dist/components/InputAutocomplete/InputAutocompleteOld.js +0 -178
- package/dist/components/InputText/InputTextOld.css +0 -10
- package/dist/components/InputText/InputTextOld.js +0 -340
- package/dist/components/MenuItem/MenuItemOld.js +0 -139
- package/dist/components/Modal/ModalOld.css +0 -3
- package/dist/components/Modal/ModalOld.js +0 -230
- package/dist/components/RadioButton/RadioOld.css +0 -31
- package/dist/components/RadioButton/RadioOld.js +0 -142
- package/dist/components/SelectInput/SelectInputOld.css +0 -17
- package/dist/components/SelectInput/SelectInputOld.js +0 -325
- package/dist/components/Table/TableOld.css +0 -79
- package/dist/components/Table/TableOld.js +0 -165
- package/dist/components/Tabs/TabsOld.js +0 -92
- package/dist/components/Typography/TypographyOld.js +0 -132
|
@@ -1,122 +1,92 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _reactDom = require("react-dom");
|
|
13
|
-
|
|
14
11
|
require("../../styles/main.css");
|
|
15
|
-
|
|
16
12
|
require("./SelectInput.css");
|
|
17
|
-
|
|
18
13
|
var _InputText = _interopRequireDefault(require("../InputText/InputText"));
|
|
19
|
-
|
|
20
14
|
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
21
|
-
|
|
22
15
|
var _utils = require("../../utils");
|
|
23
|
-
|
|
24
|
-
var _excluded = ["children", "onChange", "label", "value", "style", "sx", "multiple", "renderValue", "prefixClass", "fullWidth", "width", "disabled"];
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
-
|
|
36
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
37
|
-
|
|
16
|
+
var _useFallbackId = _interopRequireDefault(require("../../utils/useFallbackId"));
|
|
17
|
+
var _excluded = ["children", "onChange", "label", "value", "style", "sx", "multiple", "renderValue", "prefixClass", "fullWidth", "width", "disabled", "id"];
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
20
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
24
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
25
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
38
26
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
43
|
-
|
|
44
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
45
|
-
|
|
27
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
28
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
29
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
46
30
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
55
|
-
|
|
56
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
57
|
-
|
|
58
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
59
|
-
|
|
31
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
32
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
|
|
33
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
34
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
35
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
36
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
60
37
|
var SelectInput = function SelectInput(_ref) {
|
|
61
38
|
var children = _ref.children,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
39
|
+
onChange = _ref.onChange,
|
|
40
|
+
label = _ref.label,
|
|
41
|
+
value = _ref.value,
|
|
42
|
+
style = _ref.style,
|
|
43
|
+
sx = _ref.sx,
|
|
44
|
+
_ref$multiple = _ref.multiple,
|
|
45
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
46
|
+
_ref$renderValue = _ref.renderValue,
|
|
47
|
+
renderValue = _ref$renderValue === void 0 ? null : _ref$renderValue,
|
|
48
|
+
propPrefixClass = _ref.prefixClass,
|
|
49
|
+
fullWidth = _ref.fullWidth,
|
|
50
|
+
width = _ref.width,
|
|
51
|
+
disabled = _ref.disabled,
|
|
52
|
+
id = _ref.id,
|
|
53
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
77
54
|
var getDefaultValue = function getDefaultValue() {
|
|
78
55
|
if (value !== undefined) return value;
|
|
79
56
|
if (multiple) return [];
|
|
80
57
|
return '';
|
|
81
58
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
86
|
-
|
|
59
|
+
var _useDynamicStyles = (0, _useDynamicStyles2["default"])(sx),
|
|
60
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
61
|
+
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
87
62
|
var prefixClass = propPrefixClass || dynamicPrefixClass;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
var
|
|
105
|
-
|
|
106
|
-
var
|
|
107
|
-
|
|
108
|
-
var optionContainerRef = _react.default.useRef(null);
|
|
109
|
-
|
|
63
|
+
var _React$useState = _react["default"].useState(false),
|
|
64
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
65
|
+
isOpen = _React$useState2[0],
|
|
66
|
+
setIsOpen = _React$useState2[1];
|
|
67
|
+
var _React$useState3 = _react["default"].useState(false),
|
|
68
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
69
|
+
isClosing = _React$useState4[0],
|
|
70
|
+
setIsClosing = _React$useState4[1];
|
|
71
|
+
var _React$useState5 = _react["default"].useState(getDefaultValue()),
|
|
72
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
73
|
+
internalValue = _React$useState6[0],
|
|
74
|
+
setInternalValue = _React$useState6[1];
|
|
75
|
+
var selectRef = _react["default"].useRef(null);
|
|
76
|
+
var dropdownRef = _react["default"].useRef(null);
|
|
77
|
+
var optionContainerRef = _react["default"].useRef(null);
|
|
78
|
+
var inputRef = _react["default"].useRef(null);
|
|
79
|
+
var fallbackId = (0, _useFallbackId["default"])('cbx-selectInput-id');
|
|
80
|
+
var selectId = id || fallbackId;
|
|
81
|
+
var listboxId = "".concat(selectId, "-listbox");
|
|
110
82
|
var _useKeyItemNavigation = (0, _utils.useKeyItemNavigation)({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
83
|
+
containerRef: optionContainerRef,
|
|
84
|
+
canLoop: false
|
|
85
|
+
}),
|
|
86
|
+
handleKeyDown = _useKeyItemNavigation.handleKeyDown;
|
|
116
87
|
if (width === '100%') {
|
|
117
88
|
fullWidth = true;
|
|
118
89
|
}
|
|
119
|
-
|
|
120
90
|
var closeDropdown = function closeDropdown() {
|
|
121
91
|
setIsClosing(true);
|
|
122
92
|
setTimeout(function () {
|
|
@@ -124,14 +94,11 @@ var SelectInput = function SelectInput(_ref) {
|
|
|
124
94
|
setIsClosing(false);
|
|
125
95
|
}, 150);
|
|
126
96
|
};
|
|
127
|
-
|
|
128
97
|
var handleOptionClick = function handleOptionClick(option, event) {
|
|
129
98
|
var optionValue = option.props.value;
|
|
130
99
|
var optionText = option.props.children;
|
|
131
|
-
|
|
132
100
|
if (multiple) {
|
|
133
101
|
var newSelected;
|
|
134
|
-
|
|
135
102
|
if (internalValue.some(function (opt) {
|
|
136
103
|
return opt.value === optionValue;
|
|
137
104
|
})) {
|
|
@@ -144,9 +111,7 @@ var SelectInput = function SelectInput(_ref) {
|
|
|
144
111
|
text: optionText
|
|
145
112
|
}]);
|
|
146
113
|
}
|
|
147
|
-
|
|
148
114
|
setInternalValue(newSelected);
|
|
149
|
-
|
|
150
115
|
if (onChange) {
|
|
151
116
|
onChange(_objectSpread(_objectSpread({}, event), {}, {
|
|
152
117
|
preventDefault: function preventDefault() {},
|
|
@@ -165,7 +130,6 @@ var SelectInput = function SelectInput(_ref) {
|
|
|
165
130
|
value: optionValue,
|
|
166
131
|
text: optionText
|
|
167
132
|
});
|
|
168
|
-
|
|
169
133
|
if (onChange) {
|
|
170
134
|
onChange(_objectSpread(_objectSpread({}, event), {}, {
|
|
171
135
|
preventDefault: function preventDefault() {},
|
|
@@ -175,15 +139,12 @@ var SelectInput = function SelectInput(_ref) {
|
|
|
175
139
|
}
|
|
176
140
|
}));
|
|
177
141
|
}
|
|
178
|
-
|
|
179
142
|
closeDropdown();
|
|
180
143
|
}
|
|
181
144
|
};
|
|
182
|
-
|
|
183
145
|
var updateDropdownPosition = function updateDropdownPosition() {
|
|
184
146
|
if (selectRef.current && dropdownRef.current) {
|
|
185
147
|
var _selectRef$current$cl;
|
|
186
|
-
|
|
187
148
|
var inputText = selectRef.current;
|
|
188
149
|
var inputRect = inputText.getBoundingClientRect();
|
|
189
150
|
var dropdownHeight = dropdownRef.current.offsetHeight;
|
|
@@ -198,40 +159,37 @@ var SelectInput = function SelectInput(_ref) {
|
|
|
198
159
|
dropdownRef.current.style.width = "".concat(inputRect.width, "px");
|
|
199
160
|
}
|
|
200
161
|
};
|
|
201
|
-
|
|
202
|
-
_react.default.useEffect(function () {
|
|
162
|
+
_react["default"].useEffect(function () {
|
|
203
163
|
updateDropdownPosition();
|
|
204
164
|
}, [isOpen]);
|
|
205
|
-
|
|
206
|
-
_react.default.useEffect(function () {
|
|
165
|
+
_react["default"].useEffect(function () {
|
|
207
166
|
var handleResize = function handleResize() {
|
|
208
167
|
if (isOpen) {
|
|
209
168
|
updateDropdownPosition();
|
|
210
169
|
}
|
|
211
170
|
};
|
|
212
|
-
|
|
213
171
|
window.addEventListener('resize', handleResize);
|
|
214
172
|
return function () {
|
|
215
173
|
window.removeEventListener('resize', handleResize);
|
|
216
174
|
};
|
|
217
175
|
}, [isOpen]);
|
|
218
|
-
|
|
219
176
|
var checkSelectedOptions = function checkSelectedOptions(optionValue) {
|
|
220
177
|
if (multiple) {
|
|
221
178
|
return (value === null || value === void 0 ? void 0 : value.includes(optionValue)) || (internalValue === null || internalValue === void 0 ? void 0 : internalValue.includes(optionValue));
|
|
222
179
|
}
|
|
223
|
-
|
|
224
180
|
return String(optionValue) === String(value !== undefined ? value : internalValue);
|
|
225
181
|
};
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
if ( /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
182
|
+
var enhancedChildren = _react["default"].Children.map(children, function (child, index) {
|
|
183
|
+
if (/*#__PURE__*/_react["default"].isValidElement(child)) {
|
|
229
184
|
var _dropdownRef$current;
|
|
230
|
-
|
|
231
|
-
return /*#__PURE__*/_react
|
|
185
|
+
var isSelected = checkSelectedOptions(child.props.value);
|
|
186
|
+
return /*#__PURE__*/_react["default"].cloneElement(child, {
|
|
232
187
|
key: child.key || "".concat(child.props.value, "-").concat(index),
|
|
233
|
-
|
|
234
|
-
|
|
188
|
+
id: "".concat(selectId, "-option-").concat(index),
|
|
189
|
+
role: 'option',
|
|
190
|
+
'aria-selected': isSelected,
|
|
191
|
+
active: isSelected,
|
|
192
|
+
selected: isSelected,
|
|
235
193
|
onClick: function onClick(event) {
|
|
236
194
|
return handleOptionClick(child, event);
|
|
237
195
|
},
|
|
@@ -240,138 +198,133 @@ var SelectInput = function SelectInput(_ref) {
|
|
|
240
198
|
className: "".concat(child.props.className || '', " ").concat(isOpen && ((_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.querySelector("[data-index=\"".concat(index, "\"]"))) === document.activeElement ? 'cbx-selectInput-option-focused' : '').trim()
|
|
241
199
|
});
|
|
242
200
|
}
|
|
243
|
-
|
|
244
201
|
return child;
|
|
245
202
|
});
|
|
246
|
-
|
|
247
203
|
var getSelectedOptions = function getSelectedOptions() {
|
|
248
204
|
var _React$Children$toArr;
|
|
249
|
-
|
|
250
205
|
if (multiple) {
|
|
251
|
-
return _react
|
|
206
|
+
return _react["default"].Children.toArray(children).reduce(function (acc, curr) {
|
|
252
207
|
if (checkSelectedOptions(curr.props.value)) {
|
|
253
208
|
acc.push(curr.props);
|
|
254
209
|
}
|
|
255
|
-
|
|
256
210
|
return acc;
|
|
257
211
|
}, []);
|
|
258
212
|
}
|
|
259
|
-
|
|
260
|
-
return ((_React$Children$toArr = _react.default.Children.toArray(children).find(function (child) {
|
|
213
|
+
return ((_React$Children$toArr = _react["default"].Children.toArray(children).find(function (child) {
|
|
261
214
|
return checkSelectedOptions(child.props.value);
|
|
262
215
|
})) === null || _React$Children$toArr === void 0 ? void 0 : _React$Children$toArr.props) || {};
|
|
263
216
|
};
|
|
264
|
-
|
|
265
217
|
var selectedOption = getSelectedOptions();
|
|
266
|
-
|
|
267
218
|
var getRenderValue = function getRenderValue() {
|
|
268
219
|
if (renderValue) {
|
|
269
220
|
return renderValue(value);
|
|
270
221
|
}
|
|
271
|
-
|
|
272
222
|
if (multiple && Array.isArray(selectedOption)) {
|
|
273
223
|
return value.join(', ');
|
|
274
224
|
}
|
|
275
|
-
|
|
276
225
|
return (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.children) || '';
|
|
277
226
|
};
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
e
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
case ' ':
|
|
317
|
-
if (!isOpen) {
|
|
227
|
+
return (
|
|
228
|
+
/*#__PURE__*/
|
|
229
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
230
|
+
_react["default"].createElement("div", {
|
|
231
|
+
className: prefixClass("cbx-selectInput-container ".concat(isOpen ? 'cbx-selectInput-container-open' : '', " ").concat(fullWidth ? 'cbx-selectInput-container-fullWidth' : '', " ").concat(disabled ? 'cbx-selectInput-container-disabled' : '')),
|
|
232
|
+
onClick: function onClick(e) {
|
|
233
|
+
var _inputRef$current;
|
|
234
|
+
e.preventDefault();
|
|
235
|
+
e.stopPropagation();
|
|
236
|
+
setIsOpen(!disabled);
|
|
237
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
238
|
+
},
|
|
239
|
+
style: _objectSpread(_objectSpread({
|
|
240
|
+
width: width !== '100%' && width
|
|
241
|
+
}, style), stylesInLine),
|
|
242
|
+
ref: selectRef
|
|
243
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputText["default"], _extends({
|
|
244
|
+
ref: inputRef,
|
|
245
|
+
label: label,
|
|
246
|
+
renderValue: getRenderValue(),
|
|
247
|
+
value: getRenderValue(),
|
|
248
|
+
shrink: !!selectedOption,
|
|
249
|
+
readOnly: true,
|
|
250
|
+
prefixClass: prefixClass,
|
|
251
|
+
fullWidth: fullWidth || width !== '100%',
|
|
252
|
+
disabled: disabled,
|
|
253
|
+
role: "combobox",
|
|
254
|
+
"aria-expanded": isOpen,
|
|
255
|
+
"aria-haspopup": "listbox",
|
|
256
|
+
"aria-controls": isOpen ? listboxId : undefined,
|
|
257
|
+
"aria-autocomplete": "none",
|
|
258
|
+
tabIndex: disabled ? -1 : 0
|
|
259
|
+
}, props, {
|
|
260
|
+
onKeyDown: function onKeyDown(e) {
|
|
261
|
+
e.stopPropagation();
|
|
262
|
+
switch (e.key) {
|
|
263
|
+
case 'ArrowDown':
|
|
264
|
+
case 'ArrowUp':
|
|
318
265
|
setIsOpen(true);
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
266
|
+
handleKeyDown(e);
|
|
267
|
+
break;
|
|
268
|
+
case 'Enter':
|
|
269
|
+
case ' ':
|
|
270
|
+
if (!isOpen) {
|
|
271
|
+
setIsOpen(true);
|
|
272
|
+
} else {
|
|
273
|
+
var _optionContainerRef$c;
|
|
274
|
+
var activeOption = (_optionContainerRef$c = optionContainerRef.current) === null || _optionContainerRef$c === void 0 ? void 0 : _optionContainerRef$c.querySelector('.cbx-selectInput-option-focused');
|
|
275
|
+
if (activeOption) {
|
|
276
|
+
activeOption.click();
|
|
277
|
+
}
|
|
326
278
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
279
|
+
e.preventDefault();
|
|
280
|
+
break;
|
|
281
|
+
case 'Escape':
|
|
282
|
+
if (isOpen) closeDropdown();
|
|
283
|
+
break;
|
|
284
|
+
case 'Tab':
|
|
285
|
+
if (isOpen) closeDropdown();
|
|
286
|
+
break;
|
|
287
|
+
default:
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
type: 'select'
|
|
292
|
+
})), isOpen && /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react["default"].createElement("div", {
|
|
293
|
+
className: prefixClass('cbx-selectInput-presentation')
|
|
294
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
295
|
+
className: prefixClass('cbx-selectInput-backdrop'),
|
|
296
|
+
onClick: function onClick(e) {
|
|
297
|
+
var _inputRef$current2;
|
|
298
|
+
e.stopPropagation();
|
|
299
|
+
closeDropdown();
|
|
300
|
+
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
|
|
342
301
|
}
|
|
343
|
-
},
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
ref: dropdownRef
|
|
356
|
-
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
357
|
-
className: prefixClass('cbx-selectInput-options'),
|
|
358
|
-
ref: optionContainerRef
|
|
359
|
-
}, enhancedChildren))), document.body));
|
|
302
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
303
|
+
className: prefixClass("cbx-selectInput-options-container ".concat(isOpen && !isClosing ? 'cbx-selectInput-options-container-open' : 'cbx-selectInput-options-container-close')),
|
|
304
|
+
ref: dropdownRef
|
|
305
|
+
}, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
306
|
+
className: prefixClass('cbx-selectInput-options'),
|
|
307
|
+
ref: optionContainerRef,
|
|
308
|
+
id: listboxId,
|
|
309
|
+
role: "listbox",
|
|
310
|
+
"aria-multiselectable": multiple || undefined,
|
|
311
|
+
onKeyDown: handleKeyDown
|
|
312
|
+
}, enhancedChildren))), document.body))
|
|
313
|
+
);
|
|
360
314
|
};
|
|
361
|
-
|
|
362
315
|
SelectInput.displayName = "SelectInput";
|
|
363
316
|
SelectInput.propTypes = {
|
|
364
|
-
label: _propTypes
|
|
365
|
-
width: _propTypes
|
|
366
|
-
id: _propTypes
|
|
367
|
-
className: _propTypes
|
|
368
|
-
onChange: _propTypes
|
|
369
|
-
disabled: _propTypes
|
|
370
|
-
children: _propTypes
|
|
371
|
-
helperText: _propTypes
|
|
372
|
-
error: _propTypes
|
|
373
|
-
helper: _propTypes
|
|
374
|
-
fullWidth: _propTypes
|
|
317
|
+
label: _propTypes["default"].string,
|
|
318
|
+
width: _propTypes["default"].string,
|
|
319
|
+
id: _propTypes["default"].string,
|
|
320
|
+
className: _propTypes["default"].string,
|
|
321
|
+
onChange: _propTypes["default"].func,
|
|
322
|
+
disabled: _propTypes["default"].bool,
|
|
323
|
+
children: _propTypes["default"].node,
|
|
324
|
+
helperText: _propTypes["default"].node,
|
|
325
|
+
error: _propTypes["default"].node,
|
|
326
|
+
helper: _propTypes["default"].node,
|
|
327
|
+
fullWidth: _propTypes["default"].bool
|
|
375
328
|
};
|
|
376
329
|
SelectInput.defaultProps = {
|
|
377
330
|
label: '',
|
|
@@ -387,4 +340,4 @@ SelectInput.defaultProps = {
|
|
|
387
340
|
fullWidth: false
|
|
388
341
|
};
|
|
389
342
|
var _default = SelectInput;
|
|
390
|
-
exports
|
|
343
|
+
exports["default"] = _default;
|
|
@@ -3,19 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
6
|
+
exports["default"] = exports.Success = exports.Helper = exports.ErrorTemplate = exports.Disabled = exports.DesignSelectInputTemplate = exports.Default = void 0;
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _SelectInput = _interopRequireDefault(require("./SelectInput"));
|
|
11
|
-
|
|
12
9
|
var _DesignSelectInput = _interopRequireDefault(require("./DesignSelectInput"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
11
|
var _default = {
|
|
17
12
|
title: 'Components/SelectInput',
|
|
18
|
-
component: _SelectInput
|
|
13
|
+
component: _SelectInput["default"],
|
|
19
14
|
argTypes: {
|
|
20
15
|
variant: {
|
|
21
16
|
options: ['outlined', 'filled', 'standard'],
|
|
@@ -39,12 +34,10 @@ var _default = {
|
|
|
39
34
|
}
|
|
40
35
|
}
|
|
41
36
|
};
|
|
42
|
-
exports
|
|
43
|
-
|
|
37
|
+
exports["default"] = _default;
|
|
44
38
|
var Template = function Template(args) {
|
|
45
|
-
return /*#__PURE__*/_react
|
|
39
|
+
return /*#__PURE__*/_react["default"].createElement(_SelectInput["default"], args);
|
|
46
40
|
};
|
|
47
|
-
|
|
48
41
|
Template.displayName = "Template";
|
|
49
42
|
var Default = Template.bind({});
|
|
50
43
|
exports.Default = Default;
|
|
@@ -79,11 +72,9 @@ ErrorTemplate.args = {
|
|
|
79
72
|
error: 'Error',
|
|
80
73
|
label: 'Example'
|
|
81
74
|
};
|
|
82
|
-
|
|
83
75
|
var TemplateSelectInput = function TemplateSelectInput(args) {
|
|
84
|
-
return /*#__PURE__*/_react
|
|
76
|
+
return /*#__PURE__*/_react["default"].createElement(_DesignSelectInput["default"], args);
|
|
85
77
|
};
|
|
86
|
-
|
|
87
78
|
TemplateSelectInput.displayName = "TemplateSelectInput";
|
|
88
79
|
var DesignSelectInputTemplate = TemplateSelectInput.bind({});
|
|
89
80
|
exports.DesignSelectInputTemplate = DesignSelectInputTemplate;
|
|
@@ -3,36 +3,31 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
6
|
+
exports["default"] = void 0;
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
require("../../styles/main.css");
|
|
11
|
-
|
|
12
9
|
var _Slider = _interopRequireDefault(require("./Slider"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
11
|
var DesignSlider = function DesignSlider() {
|
|
17
|
-
return /*#__PURE__*/_react
|
|
12
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
18
13
|
style: {
|
|
19
14
|
marginBottom: '1rem',
|
|
20
15
|
width: '240px'
|
|
21
16
|
}
|
|
22
|
-
}, /*#__PURE__*/_react
|
|
17
|
+
}, /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
23
18
|
min: 1,
|
|
24
19
|
max: 100,
|
|
25
20
|
value: 80,
|
|
26
21
|
textValue: 'min.'
|
|
27
|
-
})), /*#__PURE__*/_react
|
|
22
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
28
23
|
style: {
|
|
29
24
|
marginBottom: '1rem'
|
|
30
25
|
}
|
|
31
|
-
}, /*#__PURE__*/_react
|
|
26
|
+
}, /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
32
27
|
values: [10, 15, 20, 25, 30, 45, 60, 75, 90, 105, 120],
|
|
33
28
|
value: 45,
|
|
34
29
|
noDisplayValue: true
|
|
35
|
-
})), /*#__PURE__*/_react
|
|
30
|
+
})), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
36
31
|
values: [10, 20, 30, 50, 80],
|
|
37
32
|
onChange: function onChange(val) {
|
|
38
33
|
return console.log('Nuevo valor:', val);
|
|
@@ -40,7 +35,6 @@ var DesignSlider = function DesignSlider() {
|
|
|
40
35
|
value: 30
|
|
41
36
|
})));
|
|
42
37
|
};
|
|
43
|
-
|
|
44
38
|
DesignSlider.displayName = "DesignSlider";
|
|
45
39
|
var _default = DesignSlider;
|
|
46
|
-
exports
|
|
40
|
+
exports["default"] = _default;
|