@councilbox/councilbox-ui 2.0.52 → 2.0.54
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/dist/HOCs/overlayA11yStack.js +47 -0
- package/dist/HOCs/useA11yGuard.js +38 -0
- package/dist/HOCs/useDynamicStyles.js +18 -38
- 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 +49 -99
- package/dist/components/1.Introduction.stories.mdx +1 -1
- package/dist/components/2.Changelog.stories.mdx +45 -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/AccordionOld.js +32 -56
- 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/AvatarOld.js +46 -60
- 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/ButtonBasic/ButtonBasicOld.js +57 -77
- 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/Checkbox/CheckboxOld.js +19 -35
- package/dist/components/DragDrop/DragDrop.css +20 -9
- package/dist/components/DragDrop/DragDrop.js +80 -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/DrawerPanel/DrawerPanelOld.js +76 -98
- package/dist/components/DropDown/DesignDropDown.stories.js +79 -97
- package/dist/components/DropDown/DropDown.js +168 -342
- package/dist/components/DropDown/DropDown.stories.js +6 -12
- package/dist/components/DropDown/DropDownOld.js +57 -89
- 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/Grid/GridItemOld.js +13 -18
- package/dist/components/Grid/GridOld.js +14 -21
- package/dist/components/Header/DesignHeader.stories.js +20 -24
- package/dist/components/Header/Header.js +201 -242
- 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 +132 -138
- package/dist/components/IconButton/IconButton.stories.js +12 -13
- package/dist/components/IconButton/IconButtonOld.js +41 -57
- package/dist/components/IconButtonSquare/DesignIconButtonSquare.stories.js +5 -11
- package/dist/components/IconButtonSquare/IconButtonSquare.js +11 -25
- package/dist/components/IconButtonSquare/IconButtonSquare.stories.js +7 -13
- package/dist/components/IconButtonSquare/IconButtonSquareOld.js +44 -62
- 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/InputAutocomplete/InputAutocompleteOld.js +43 -62
- 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 +86 -78
- package/dist/components/InputText/InputText.js +207 -211
- package/dist/components/InputText/InputText.stories.js +11 -11
- package/dist/components/InputText/InputTextOld.js +48 -74
- 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 +100 -113
- package/dist/components/MenuItem/MenuItem.stories.js +6 -15
- package/dist/components/MenuItem/MenuItemOld.js +40 -56
- package/dist/components/MenuLateralLeft/MenuLateralLeft.css +24 -0
- package/dist/components/MenuLateralLeft/MenuLateralLeft.js +123 -160
- package/dist/components/MenuLateralLeft/MenuLateralLeft.stories.js +5 -12
- package/dist/components/MenuLateralRight/MenuLateralRight.css +2 -2
- package/dist/components/MenuLateralRight/MenuLateralRight.js +73 -77
- 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 +154 -145
- package/dist/components/Modal/Modal.stories.js +7 -16
- package/dist/components/Modal/ModalOld.js +73 -90
- 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/RadioButton/RadioOld.js +23 -39
- package/dist/components/Ripple/DesignRipple.js +25 -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/SelectInput/DesignSelectInput.js +22 -45
- package/dist/components/SelectInput/SelectInput.js +101 -155
- package/dist/components/SelectInput/SelectInput.stories.js +6 -15
- package/dist/components/SelectInput/SelectInputOld.js +52 -81
- 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/TableOld.js +52 -84
- 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 -137
- package/dist/components/Tabs/Tabs.stories.js +5 -12
- package/dist/components/Tabs/TabsOld.js +28 -42
- 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/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/Toggle/Toggle.css +10 -0
- package/dist/components/Toggle/Toggle.js +115 -98
- 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 +190 -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/components/Typography/TypographyOld.js +29 -42
- 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/stylesheet.js +10 -22
- 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 +5 -2
|
@@ -1,47 +1,31 @@
|
|
|
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 _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
13
|
-
|
|
14
11
|
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
15
|
-
|
|
16
12
|
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
17
|
-
|
|
18
13
|
var _material = require("@mui/material");
|
|
19
|
-
|
|
20
14
|
require("../../styles/main.css");
|
|
21
|
-
|
|
22
15
|
require("./SelectInputOld.css");
|
|
23
|
-
|
|
24
16
|
var _styled = _interopRequireDefault(require("@mui/material/styles/styled"));
|
|
25
|
-
|
|
26
17
|
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
27
|
-
|
|
28
18
|
var _excluded = ["id", "className", "onChange", "label", "disabled", "width", "fullWidth", "children", "error", "helperText", "helper", "variant", "endAdornment", "success", "sx", "sxFormControl", "propsFormControl"];
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
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; }
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
44
|
-
var CssSelect = (0, _styled.default)(_Select.default)(function () {
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
25
|
+
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); }
|
|
26
|
+
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; }
|
|
27
|
+
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; }
|
|
28
|
+
var CssSelect = (0, _styled["default"])(_Select["default"])(function () {
|
|
45
29
|
return {
|
|
46
30
|
'& .MuiInput-underline:after': {
|
|
47
31
|
borderBottomColor: 'var(--gray5)',
|
|
@@ -129,78 +113,66 @@ var CssSelect = (0, _styled.default)(_Select.default)(function () {
|
|
|
129
113
|
}
|
|
130
114
|
};
|
|
131
115
|
});
|
|
132
|
-
|
|
133
116
|
var SelectInputOld = function SelectInputOld(_ref) {
|
|
134
117
|
var id = _ref.id,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
118
|
+
className = _ref.className,
|
|
119
|
+
onChange = _ref.onChange,
|
|
120
|
+
label = _ref.label,
|
|
121
|
+
disabled = _ref.disabled,
|
|
122
|
+
width = _ref.width,
|
|
123
|
+
fullWidth = _ref.fullWidth,
|
|
124
|
+
children = _ref.children,
|
|
125
|
+
error = _ref.error,
|
|
126
|
+
helperText = _ref.helperText,
|
|
127
|
+
helper = _ref.helper,
|
|
128
|
+
variant = _ref.variant,
|
|
129
|
+
endAdornment = _ref.endAdornment,
|
|
130
|
+
success = _ref.success,
|
|
131
|
+
sx = _ref.sx,
|
|
132
|
+
sxFormControl = _ref.sxFormControl,
|
|
133
|
+
propsFormControl = _ref.propsFormControl,
|
|
134
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
153
135
|
var getIcon = function getIcon() {
|
|
154
|
-
var icon = /*#__PURE__*/_react
|
|
136
|
+
var icon = /*#__PURE__*/_react["default"].createElement("i", {
|
|
155
137
|
className: "cbx-inputText-endAdornment ".concat(endAdornment)
|
|
156
138
|
});
|
|
157
|
-
|
|
158
139
|
if (success) {
|
|
159
|
-
icon = /*#__PURE__*/_react
|
|
140
|
+
icon = /*#__PURE__*/_react["default"].createElement("i", {
|
|
160
141
|
className: "cbx-inputText-endAdornment ri-check-line",
|
|
161
142
|
style: {
|
|
162
143
|
color: 'var(--success)'
|
|
163
144
|
}
|
|
164
145
|
});
|
|
165
146
|
}
|
|
166
|
-
|
|
167
147
|
if (error) {
|
|
168
|
-
icon = /*#__PURE__*/_react
|
|
148
|
+
icon = /*#__PURE__*/_react["default"].createElement("i", {
|
|
169
149
|
className: 'cbx-inputText-endAdornment ri-information-line',
|
|
170
150
|
style: {
|
|
171
151
|
color: 'var(--error)'
|
|
172
152
|
}
|
|
173
153
|
});
|
|
174
154
|
}
|
|
175
|
-
|
|
176
155
|
if (helper) {
|
|
177
|
-
icon = /*#__PURE__*/_react
|
|
156
|
+
icon = /*#__PURE__*/_react["default"].createElement("i", {
|
|
178
157
|
className: 'cbx-inputText-endAdornment ri-information-line'
|
|
179
158
|
});
|
|
180
159
|
}
|
|
181
|
-
|
|
182
160
|
return icon;
|
|
183
161
|
};
|
|
184
|
-
|
|
185
162
|
var getVariant = function getVariant() {
|
|
186
163
|
var variantInput = 'outlined';
|
|
187
|
-
|
|
188
164
|
if (variant === 'outlined') {
|
|
189
165
|
variantInput = variant;
|
|
190
166
|
}
|
|
191
|
-
|
|
192
167
|
if (variant === 'filled') {
|
|
193
168
|
variantInput = variant;
|
|
194
169
|
}
|
|
195
|
-
|
|
196
170
|
if (variant === 'standard') {
|
|
197
171
|
variantInput = variant;
|
|
198
172
|
}
|
|
199
|
-
|
|
200
173
|
return variantInput;
|
|
201
174
|
};
|
|
202
|
-
|
|
203
|
-
return /*#__PURE__*/_react.default.createElement(_FormControl.default, _extends({
|
|
175
|
+
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], _extends({
|
|
204
176
|
fullWidth: fullWidth,
|
|
205
177
|
sx: _objectSpread(_objectSpread({
|
|
206
178
|
minWidth: width || '15rem'
|
|
@@ -209,7 +181,7 @@ var SelectInputOld = function SelectInputOld(_ref) {
|
|
|
209
181
|
} : {}), {}, {
|
|
210
182
|
minHeight: '3rem'
|
|
211
183
|
}, sxFormControl)
|
|
212
|
-
}, propsFormControl), label && /*#__PURE__*/_react
|
|
184
|
+
}, propsFormControl), label && /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
213
185
|
variant: getVariant(),
|
|
214
186
|
disabled: disabled,
|
|
215
187
|
error: error,
|
|
@@ -247,7 +219,7 @@ var SelectInputOld = function SelectInputOld(_ref) {
|
|
|
247
219
|
zIndex: '1'
|
|
248
220
|
}
|
|
249
221
|
}
|
|
250
|
-
}, label), /*#__PURE__*/_react
|
|
222
|
+
}, label), /*#__PURE__*/_react["default"].createElement(CssSelect, _extends({
|
|
251
223
|
id: id,
|
|
252
224
|
className: className,
|
|
253
225
|
sx: _objectSpread(_objectSpread({
|
|
@@ -278,36 +250,35 @@ var SelectInputOld = function SelectInputOld(_ref) {
|
|
|
278
250
|
InputProps: {
|
|
279
251
|
endAdornment: getIcon()
|
|
280
252
|
}
|
|
281
|
-
}), children), /*#__PURE__*/_react
|
|
253
|
+
}), children), /*#__PURE__*/_react["default"].createElement(_material.FormHelperText, {
|
|
282
254
|
sx: {
|
|
283
255
|
marginLeft: '0',
|
|
284
256
|
marginRight: '0px'
|
|
285
257
|
}
|
|
286
|
-
}, /*#__PURE__*/_react
|
|
258
|
+
}, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, helperText, error ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
287
259
|
className: "cbx-selectInput-items-center"
|
|
288
|
-
}, /*#__PURE__*/_react
|
|
260
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
289
261
|
variant: "XS",
|
|
290
262
|
color: 'var(--error)'
|
|
291
|
-
}, error)) : helper && /*#__PURE__*/_react
|
|
263
|
+
}, error)) : helper && /*#__PURE__*/_react["default"].createElement("div", {
|
|
292
264
|
className: "cbx-inputText-items-center"
|
|
293
|
-
}, /*#__PURE__*/_react
|
|
265
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
294
266
|
color: !disabled ? 'var(--gray4)' : 'var(--gray3)',
|
|
295
267
|
variant: "XS"
|
|
296
268
|
}, helper)))));
|
|
297
269
|
};
|
|
298
|
-
|
|
299
270
|
SelectInputOld.displayName = "SelectInputOld";
|
|
300
271
|
SelectInputOld.propTypes = {
|
|
301
|
-
label: _propTypes
|
|
302
|
-
width: _propTypes
|
|
303
|
-
id: _propTypes
|
|
304
|
-
className: _propTypes
|
|
305
|
-
onChange: _propTypes
|
|
306
|
-
disabled: _propTypes
|
|
307
|
-
children: _propTypes
|
|
308
|
-
helperText: _propTypes
|
|
309
|
-
error: _propTypes
|
|
310
|
-
helper: _propTypes
|
|
272
|
+
label: _propTypes["default"].string,
|
|
273
|
+
width: _propTypes["default"].string,
|
|
274
|
+
id: _propTypes["default"].string,
|
|
275
|
+
className: _propTypes["default"].string,
|
|
276
|
+
onChange: _propTypes["default"].func,
|
|
277
|
+
disabled: _propTypes["default"].bool,
|
|
278
|
+
children: _propTypes["default"].node,
|
|
279
|
+
helperText: _propTypes["default"].node,
|
|
280
|
+
error: _propTypes["default"].node,
|
|
281
|
+
helper: _propTypes["default"].node
|
|
311
282
|
};
|
|
312
283
|
SelectInputOld.defaultProps = {
|
|
313
284
|
label: '',
|
|
@@ -322,4 +293,4 @@ SelectInputOld.defaultProps = {
|
|
|
322
293
|
helper: ''
|
|
323
294
|
};
|
|
324
295
|
var _default = SelectInputOld;
|
|
325
|
-
exports
|
|
296
|
+
exports["default"] = _default;
|
|
@@ -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;
|
|
@@ -1,51 +1,71 @@
|
|
|
1
1
|
.cbx-slider {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
-webkit-appearance: none;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 1px;
|
|
5
|
+
border-radius: 5px;
|
|
6
|
+
background: var(--gray4);
|
|
7
|
+
outline: none;
|
|
8
|
+
opacity: 1;
|
|
9
|
+
-webkit-transition: 0.2s;
|
|
10
|
+
transition: opacity 0.2s;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
13
|
.cbx-slider::-webkit-slider-thumb {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
-webkit-appearance: none;
|
|
15
|
+
appearance: none;
|
|
16
|
+
width: 1rem;
|
|
17
|
+
height: 1rem;
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
background: var(--primary);
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
border: 0px;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
.cbx-slider::-moz-range-thumb {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
width: 1rem;
|
|
26
|
+
height: 1rem;
|
|
27
|
+
border-radius: 50%;
|
|
28
|
+
background: var(--primary);
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
border: 0px;
|
|
32
31
|
}
|
|
33
32
|
|
|
33
|
+
.cbx-slider:focus-visible {
|
|
34
|
+
outline: 2px solid var(--accent);
|
|
35
|
+
outline-offset: 4px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.cbx-slider:focus-visible::-webkit-slider-thumb {
|
|
39
|
+
outline: 2px solid var(--accent);
|
|
40
|
+
outline-offset: 2px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.cbx-slider:focus-visible::-moz-range-thumb {
|
|
44
|
+
outline: 1px solid var(--accent);
|
|
45
|
+
outline-offset: 2px;
|
|
46
|
+
}
|
|
34
47
|
|
|
35
48
|
.cbx-slider-container {
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
position: relative;
|
|
50
|
+
width: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.cbx-slider-label {
|
|
54
|
+
display: block;
|
|
55
|
+
margin-bottom: var(--spacing8);
|
|
56
|
+
color: var(--gray5);
|
|
57
|
+
font-size: 0.875rem;
|
|
38
58
|
}
|
|
39
59
|
|
|
40
60
|
.cbx-slider-value {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
61
|
+
position: absolute;
|
|
62
|
+
color: var(--primary);
|
|
63
|
+
text-align: center;
|
|
64
|
+
pointer-events: none;
|
|
65
|
+
user-select: none;
|
|
66
|
+
top: 1.5rem;
|
|
67
|
+
transform: translateX(-50%);
|
|
68
|
+
font-size: 1rem;
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
}
|
|
@@ -1,79 +1,66 @@
|
|
|
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
|
require("../../styles/main.css");
|
|
13
|
-
|
|
14
11
|
require("./Slider.css");
|
|
15
|
-
|
|
16
12
|
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
17
|
-
|
|
18
|
-
var _excluded = ["id", "sx", "prefixClass", "style", "className", "min", "max", "onChange", "values", "value", "textValue", "noDisplayValue"];
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
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; }
|
|
29
|
-
|
|
30
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
-
|
|
13
|
+
var _useFallbackId = _interopRequireDefault(require("../../utils/useFallbackId"));
|
|
14
|
+
var _excluded = ["id", "sx", "prefixClass", "style", "className", "min", "max", "onChange", "values", "value", "textValue", "noDisplayValue", "label", "aria-label", "aria-labelledby"];
|
|
15
|
+
/* eslint-disable no-nested-ternary */
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
|
+
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); }
|
|
23
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
32
24
|
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."); }
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
25
|
+
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; } }
|
|
26
|
+
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; }
|
|
27
|
+
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; } }
|
|
28
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
29
|
+
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; }
|
|
30
|
+
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; }
|
|
46
31
|
var Slider = function Slider(_ref) {
|
|
47
32
|
var id = _ref.id,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
33
|
+
sx = _ref.sx,
|
|
34
|
+
propPrefixClass = _ref.prefixClass,
|
|
35
|
+
style = _ref.style,
|
|
36
|
+
className = _ref.className,
|
|
37
|
+
min = _ref.min,
|
|
38
|
+
max = _ref.max,
|
|
39
|
+
onChange = _ref.onChange,
|
|
40
|
+
values = _ref.values,
|
|
41
|
+
value = _ref.value,
|
|
42
|
+
textValue = _ref.textValue,
|
|
43
|
+
noDisplayValue = _ref.noDisplayValue,
|
|
44
|
+
label = _ref.label,
|
|
45
|
+
ariaLabelProp = _ref['aria-label'],
|
|
46
|
+
ariaLabelledByProp = _ref['aria-labelledby'],
|
|
47
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
48
|
+
var _useDynamicStyles = (0, _useDynamicStyles2["default"])(sx),
|
|
49
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
50
|
+
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
51
|
+
var prefixClass = propPrefixClass || dynamicPrefixClass;
|
|
65
52
|
var isDiscrete = Array.isArray(values) && values.length > 0;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
53
|
+
var _React$useState = _react["default"].useState(function () {
|
|
54
|
+
return isDiscrete ? 0 : min;
|
|
55
|
+
}),
|
|
56
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
57
|
+
state = _React$useState2[0],
|
|
58
|
+
setState = _React$useState2[1];
|
|
59
|
+
var generatedId = (0, _useFallbackId["default"])('cbx-slider');
|
|
60
|
+
var sliderId = id || generatedId;
|
|
61
|
+
var labelId = "".concat(sliderId, "-label");
|
|
62
|
+
_react["default"].useEffect(function () {
|
|
75
63
|
if (value == null) return;
|
|
76
|
-
|
|
77
64
|
if (isDiscrete) {
|
|
78
65
|
var idx = values.indexOf(value);
|
|
79
66
|
if (idx >= 0) setState(idx);
|
|
@@ -81,10 +68,8 @@ var Slider = function Slider(_ref) {
|
|
|
81
68
|
setState(value);
|
|
82
69
|
}
|
|
83
70
|
}, [value, isDiscrete, values, min]);
|
|
84
|
-
|
|
85
71
|
var handleChange = function handleChange(e) {
|
|
86
72
|
var newVal = Number(e.target.value);
|
|
87
|
-
|
|
88
73
|
if (isDiscrete) {
|
|
89
74
|
setState(newVal);
|
|
90
75
|
onChange === null || onChange === void 0 ? void 0 : onChange(values[newVal]);
|
|
@@ -93,39 +78,54 @@ var Slider = function Slider(_ref) {
|
|
|
93
78
|
onChange === null || onChange === void 0 ? void 0 : onChange(newVal);
|
|
94
79
|
}
|
|
95
80
|
};
|
|
96
|
-
|
|
97
81
|
var displayValue = isDiscrete ? values[state] : state;
|
|
98
82
|
var positionPercent = isDiscrete ? state / (values.length - 1) * 100 : (displayValue - min) / (max - min) * 100;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
83
|
+
var accessibleNameProps = ariaLabelledByProp ? {
|
|
84
|
+
'aria-labelledby': ariaLabelledByProp
|
|
85
|
+
} : label ? {
|
|
86
|
+
'aria-labelledby': labelId
|
|
87
|
+
} : {
|
|
88
|
+
'aria-label': ariaLabelProp || textValue || 'Control deslizante'
|
|
89
|
+
};
|
|
90
|
+
var ariaValueText = isDiscrete ? "".concat(displayValue).concat(textValue ? " ".concat(textValue) : '') : undefined;
|
|
91
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
92
|
+
className: prefixClass('cbx-slider-container')
|
|
93
|
+
}, label && /*#__PURE__*/_react["default"].createElement("label", {
|
|
94
|
+
id: labelId,
|
|
95
|
+
htmlFor: sliderId,
|
|
96
|
+
className: prefixClass('cbx-slider-label')
|
|
97
|
+
}, label), /*#__PURE__*/_react["default"].createElement("input", _extends({
|
|
98
|
+
className: prefixClass("cbx-slider ".concat(className)),
|
|
103
99
|
style: _objectSpread(_objectSpread({}, style), stylesInLine),
|
|
104
|
-
id:
|
|
100
|
+
id: sliderId,
|
|
105
101
|
type: 'range',
|
|
106
102
|
min: isDiscrete ? 0 : min,
|
|
107
103
|
max: isDiscrete ? values.length - 1 : max,
|
|
108
104
|
value: state,
|
|
109
|
-
onChange: handleChange
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
onChange: handleChange,
|
|
106
|
+
"aria-valuetext": ariaValueText
|
|
107
|
+
}, accessibleNameProps, props)), !noDisplayValue && /*#__PURE__*/_react["default"].createElement("div", {
|
|
108
|
+
className: prefixClass('cbx-slider-value'),
|
|
109
|
+
"aria-hidden": "true",
|
|
112
110
|
style: {
|
|
113
111
|
left: "".concat(positionPercent, "%")
|
|
114
112
|
}
|
|
115
113
|
}, displayValue, " ", textValue));
|
|
116
114
|
};
|
|
117
|
-
|
|
118
115
|
Slider.displayName = "Slider";
|
|
119
116
|
Slider.propTypes = {
|
|
120
|
-
id: _propTypes
|
|
121
|
-
style: _propTypes
|
|
122
|
-
min: _propTypes
|
|
123
|
-
max: _propTypes
|
|
124
|
-
onChange: _propTypes
|
|
125
|
-
values: _propTypes
|
|
126
|
-
value: _propTypes
|
|
127
|
-
textValue: _propTypes
|
|
128
|
-
noDisplayValue: _propTypes
|
|
117
|
+
id: _propTypes["default"].string,
|
|
118
|
+
style: _propTypes["default"].node,
|
|
119
|
+
min: _propTypes["default"].number,
|
|
120
|
+
max: _propTypes["default"].number,
|
|
121
|
+
onChange: _propTypes["default"].node,
|
|
122
|
+
values: _propTypes["default"].node,
|
|
123
|
+
value: _propTypes["default"].node,
|
|
124
|
+
textValue: _propTypes["default"].string,
|
|
125
|
+
noDisplayValue: _propTypes["default"].node,
|
|
126
|
+
label: _propTypes["default"].string,
|
|
127
|
+
'aria-label': _propTypes["default"].string,
|
|
128
|
+
'aria-labelledby': _propTypes["default"].string
|
|
129
129
|
};
|
|
130
130
|
Slider.defaultProps = {
|
|
131
131
|
id: '',
|
|
@@ -136,7 +136,8 @@ Slider.defaultProps = {
|
|
|
136
136
|
values: null,
|
|
137
137
|
value: null,
|
|
138
138
|
textValue: '',
|
|
139
|
-
noDisplayValue: null
|
|
139
|
+
noDisplayValue: null,
|
|
140
|
+
label: ''
|
|
140
141
|
};
|
|
141
142
|
var _default = Slider;
|
|
142
|
-
exports
|
|
143
|
+
exports["default"] = _default;
|