@councilbox/councilbox-ui 1.0.0 → 2.0.0
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/useDynamicStyles.js +99 -0
- package/dist/HOCs/useRipple.js +91 -0
- package/dist/build-index.js +8 -0
- package/dist/components/1.Introduction.stories.mdx +2 -1
- package/dist/components/2.Changelog.stories.mdx +7 -0
- package/dist/components/3.Guide.stories.mdx +56 -0
- package/dist/components/Accordion/Accordion.css +39 -1
- package/dist/components/Accordion/Accordion.js +84 -45
- package/dist/components/Accordion/Accordion.stories.js +4 -2
- package/dist/components/Accordion/AccordionOld.css +16 -0
- package/dist/components/Accordion/AccordionOld.js +115 -0
- package/dist/components/Accordion/DesignAccordion.stories.js +38 -0
- package/dist/components/Alert/Alert.css +5 -0
- package/dist/components/Alert/Alert.js +17 -6
- package/dist/components/Avatar/Avatar.css +3 -3
- package/dist/components/Avatar/Avatar.js +36 -20
- package/dist/components/Avatar/AvatarOld.js +138 -0
- package/dist/components/Avatar/DesignAvatar.stories.js +1 -1
- package/dist/components/Block/Block.js +17 -2
- package/dist/components/ButtonBasic/ButtonBasic.css +264 -20
- package/dist/components/ButtonBasic/ButtonBasic.js +85 -110
- package/dist/components/ButtonBasic/ButtonBasicOld.css +41 -0
- package/dist/components/ButtonBasic/ButtonBasicOld.js +231 -0
- package/dist/components/Checkbox/Checkbox.css +101 -22
- package/dist/components/Checkbox/Checkbox.js +119 -63
- package/dist/components/Checkbox/CheckboxOld.css +31 -0
- package/dist/components/Checkbox/CheckboxOld.js +112 -0
- package/dist/components/DragDrop/DragDrop.js +24 -9
- package/dist/components/DrawerPanel/DesignDrawerPanel.js +4 -2
- package/dist/components/DrawerPanel/DrawerPanel.css +76 -36
- package/dist/components/DrawerPanel/DrawerPanel.js +137 -115
- package/dist/components/DrawerPanel/DrawerPanelOld.css +56 -0
- package/dist/components/DrawerPanel/DrawerPanelOld.js +233 -0
- package/dist/components/DropDown/DesignDropDown.stories.js +146 -17
- package/dist/components/DropDown/DropDown.css +96 -1
- package/dist/components/DropDown/DropDown.js +363 -82
- package/dist/components/DropDown/DropDown.stories.js +1 -0
- package/dist/components/DropDown/DropDownOld.css +3 -0
- package/dist/components/DropDown/DropDownOld.js +186 -0
- package/dist/components/DropDown/PopoverPlayground.css +22 -0
- package/dist/components/DropDown/PopoverPlayground.js +235 -0
- package/dist/components/EnhancedTable/EnhancedTable.js +5 -6
- package/dist/components/FabButton/DesignFabButton.stories.js +3 -1
- package/dist/components/FabButton/FabButton.js +25 -5
- package/dist/components/Grid/DesignGrid.stories.js +9 -3
- package/dist/components/Grid/Grid.css +325 -0
- package/dist/components/Grid/Grid.js +57 -16
- package/dist/components/Grid/GridItem.js +31 -13
- package/dist/components/Grid/GridItemOld.js +43 -0
- package/dist/components/Grid/GridOld.css +0 -0
- package/dist/components/Grid/GridOld.js +53 -0
- package/dist/components/Header/Header.js +144 -115
- package/dist/components/IconButton/DesignIconButton.stories.js +37 -2
- package/dist/components/IconButton/IconButton.css +144 -0
- package/dist/components/IconButton/IconButton.js +177 -50
- package/dist/components/IconButton/IconButtonOld.css +0 -0
- package/dist/components/IconButton/IconButtonOld.js +138 -0
- package/dist/components/IconButtonSquare/IconButtonSquare.js +20 -90
- package/dist/components/IconButtonSquare/IconButtonSquareOld.css +43 -0
- package/dist/components/IconButtonSquare/IconButtonSquareOld.js +133 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.css +109 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.js +316 -77
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +118 -6
- package/dist/components/InputAutocomplete/InputAutocompleteOld.css +5 -0
- package/dist/components/InputAutocomplete/InputAutocompleteOld.js +178 -0
- package/dist/components/InputPassword/InputPassword.js +10 -20
- package/dist/components/InputText/InputText.css +442 -1
- package/dist/components/InputText/InputText.js +298 -239
- package/dist/components/InputText/InputText.stories.js +12 -3
- package/dist/components/InputText/InputTextOld.css +10 -0
- package/dist/components/InputText/InputTextOld.js +340 -0
- package/dist/components/InputTextArea/DesignInputTextArea.stories.js +30 -4
- package/dist/components/InputTextArea/InputTextArea.js +13 -6
- package/dist/components/LoadingSection/LoadingSection.css +44 -2
- package/dist/components/LoadingSection/LoadingSection.js +63 -9
- package/dist/components/MenuItem/DesignMenuItem.stories.js +1 -0
- package/dist/components/MenuItem/MenuItem.css +31 -6
- package/dist/components/MenuItem/MenuItem.js +95 -50
- package/dist/components/MenuItem/MenuItemOld.js +139 -0
- package/dist/components/MenuLateralLeft/MenuLateralLeft.js +60 -40
- package/dist/components/MenuLateralRight/MenuLateralRight.js +32 -12
- package/dist/components/Modal/DesignModal.stories.js +54 -0
- package/dist/components/Modal/Modal.css +81 -2
- package/dist/components/Modal/Modal.js +112 -80
- package/dist/components/Modal/Modal.stories.js +13 -2
- package/dist/components/Modal/ModalOld.css +3 -0
- package/dist/components/Modal/ModalOld.js +230 -0
- package/dist/components/PaginationFooter/DesignPaginationFooter.stories.js +9 -1
- package/dist/components/PaginationFooter/PaginationFooter.css +73 -0
- package/dist/components/PaginationFooter/PaginationFooter.js +45 -87
- package/dist/components/RadioButton/Radio.css +115 -16
- package/dist/components/RadioButton/Radio.js +70 -94
- package/dist/components/RadioButton/Radio.stories.js +42 -18
- package/dist/components/RadioButton/RadioOld.css +31 -0
- package/dist/components/RadioButton/RadioOld.js +142 -0
- package/dist/components/Ripple/DesignRipple.js +77 -0
- package/dist/components/Ripple/Ripple.stories.js +45 -0
- package/dist/components/Scrollbar/Scrollbar.js +21 -6
- package/dist/components/SelectInput/DesignSelectInput.js +62 -23
- package/dist/components/SelectInput/SelectInput.css +128 -10
- package/dist/components/SelectInput/SelectInput.js +233 -246
- package/dist/components/SelectInput/SelectInputOld.css +17 -0
- package/dist/components/SelectInput/SelectInputOld.js +325 -0
- package/dist/components/Stars/Stars.css +28 -28
- package/dist/components/Stars/Stars.js +22 -12
- package/dist/components/Stepper/Stepper.css +1 -0
- package/dist/components/Stepper/Stepper.js +81 -24
- package/dist/components/Table/DesignTable.stories.js +1 -0
- package/dist/components/Table/Table.css +56 -53
- package/dist/components/Table/Table.js +55 -75
- package/dist/components/Table/TableOld.css +79 -0
- package/dist/components/Table/TableOld.js +165 -0
- package/dist/components/Tabs/DesignTabs.js +37 -12
- package/dist/components/Tabs/Tabs.css +39 -4
- package/dist/components/Tabs/Tabs.js +194 -30
- package/dist/components/Tabs/Tabs.stories.js +8 -1
- package/dist/components/Tabs/TabsOld.js +92 -0
- package/dist/components/Tag/Tag.js +19 -9
- package/dist/components/Toggle/Toggle.css +122 -3
- package/dist/components/Toggle/Toggle.js +95 -68
- package/dist/components/Tooltip/DesignTooltip.stories.js +48 -0
- package/dist/components/Tooltip/Tooltip.css +75 -0
- package/dist/components/Tooltip/Tooltip.js +126 -0
- package/dist/components/Tooltip/Tooltip.stories.js +40 -0
- package/dist/components/Typography/Typography.css +9 -0
- package/dist/components/Typography/Typography.js +30 -21
- package/dist/components/Typography/TypographyOld.js +132 -0
- package/dist/styles/colorConsts.css +24 -0
- package/dist/styles/main.css +41 -49
- package/dist/styles/scpacingConsts.css +26 -0
- package/dist/styles/zIndexConsts.css +9 -0
- package/package.json +2 -1
|
@@ -9,134 +9,110 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _Radio = _interopRequireDefault(require("@mui/material/Radio"));
|
|
13
|
-
|
|
14
12
|
require("../../styles/main.css");
|
|
15
13
|
|
|
16
14
|
require("./Radio.css");
|
|
17
15
|
|
|
18
|
-
var
|
|
16
|
+
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
19
17
|
|
|
20
|
-
var
|
|
18
|
+
var _useRipple3 = _interopRequireDefault(require("../../HOCs/useRipple"));
|
|
21
19
|
|
|
22
|
-
var _excluded = ["id", "className", "disabled", "
|
|
20
|
+
var _excluded = ["id", "className", "disabled", "label", "onChange", "sx", "style", "styles", "onClick", "checked", "name"];
|
|
23
21
|
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
23
|
|
|
26
24
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
25
|
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
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
|
+
|
|
32
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
+
|
|
34
|
+
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."); }
|
|
35
|
+
|
|
36
|
+
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); }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
|
+
|
|
28
44
|
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; }
|
|
29
45
|
|
|
30
46
|
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; }
|
|
31
47
|
|
|
32
|
-
var BpIcon = (0, _styled.default)('span')(function () {
|
|
33
|
-
return {
|
|
34
|
-
borderRadius: '50%',
|
|
35
|
-
width: 20,
|
|
36
|
-
height: 20,
|
|
37
|
-
boxShadow: 'inset 0 0 0 0.125rem var(--gray3)',
|
|
38
|
-
backgroundColor: '#f5f8fa',
|
|
39
|
-
zIndex: '1',
|
|
40
|
-
backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))',
|
|
41
|
-
transition: '0.2s',
|
|
42
|
-
'.Mui-focusVisible &': {
|
|
43
|
-
outline: '0.125rem auto rgba(19,124,189,.6)',
|
|
44
|
-
outlineOffset: 2
|
|
45
|
-
},
|
|
46
|
-
'input:disabled ~ &': {
|
|
47
|
-
boxShadow: 'inset 0 0 0 0.125rem var(--gray3)'
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
var BpCheckedIcon = (0, _styled.default)(BpIcon)({
|
|
52
|
-
boxShadow: 'inset 0 0 0 0.125rem var(--primary)',
|
|
53
|
-
backgroundColor: 'var(--primary)',
|
|
54
|
-
backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',
|
|
55
|
-
'&:before': {
|
|
56
|
-
display: 'block',
|
|
57
|
-
width: 20,
|
|
58
|
-
height: 20,
|
|
59
|
-
backgroundImage: 'radial-gradient(#fff,#fff 28%,transparent 32%)',
|
|
60
|
-
content: '""'
|
|
61
|
-
},
|
|
62
|
-
'input:hover ~ &': {
|
|
63
|
-
backgroundColor: 'var(--primary)'
|
|
64
|
-
},
|
|
65
|
-
'input:disabled ~ &': {
|
|
66
|
-
boxShadow: 'inset 0 0 0 0.125rem var(--gray3)',
|
|
67
|
-
backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',
|
|
68
|
-
backgroundColor: 'var(--gray3)'
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
var CssFormControlLabel = (0, _styled.default)(_FormControlLabel.default)(function () {
|
|
72
|
-
return {
|
|
73
|
-
'& .MuiFormControlLabel-label': {
|
|
74
|
-
marginLeft: 'var(--spacing12)',
|
|
75
|
-
transition: '0.2s'
|
|
76
|
-
},
|
|
77
|
-
'& .MuiRadio-root.Mui-disabled': {
|
|
78
|
-
color: '#acadce'
|
|
79
|
-
},
|
|
80
|
-
'& .MuiRadio-root': {
|
|
81
|
-
transition: 'all .2s'
|
|
82
|
-
},
|
|
83
|
-
'& .MuiRadio-root.Mui-checked + span': {
|
|
84
|
-
color: 'var(--primary)',
|
|
85
|
-
fontWeight: '700'
|
|
86
|
-
},
|
|
87
|
-
'& .MuiRadio-root.Mui-disabled.Mui-checked + span': {
|
|
88
|
-
color: 'var(--gray3)',
|
|
89
|
-
fontWeight: '700'
|
|
90
|
-
},
|
|
91
|
-
'.MuiButtonBase-root.Mui-disabled, .MuiFormControlLabel-label.Mui-disabled': {
|
|
92
|
-
color: 'var(--gray3)',
|
|
93
|
-
fontWeight: '700'
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
});
|
|
97
|
-
|
|
98
48
|
var Radio = function Radio(_ref) {
|
|
99
49
|
var id = _ref.id,
|
|
100
50
|
className = _ref.className,
|
|
101
51
|
disabled = _ref.disabled,
|
|
102
|
-
indeterminate = _ref.indeterminate,
|
|
103
52
|
label = _ref.label,
|
|
104
53
|
onChange = _ref.onChange,
|
|
54
|
+
sx = _ref.sx,
|
|
55
|
+
style = _ref.style,
|
|
56
|
+
styles = _ref.styles,
|
|
57
|
+
onClick = _ref.onClick,
|
|
58
|
+
_ref$checked = _ref.checked,
|
|
59
|
+
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
60
|
+
name = _ref.name,
|
|
105
61
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
106
62
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
63
|
+
var _useDynamicStyles = (0, _useDynamicStyles2.default)(sx),
|
|
64
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
65
|
+
prefixClass = _useDynamicStyles.prefixClass;
|
|
66
|
+
|
|
67
|
+
var _useRipple = (0, _useRipple3.default)({
|
|
68
|
+
backgroundColor: 'var(--accent25)'
|
|
69
|
+
}, 'center'),
|
|
70
|
+
_useRipple2 = _slicedToArray(_useRipple, 2),
|
|
71
|
+
addRipple = _useRipple2[0],
|
|
72
|
+
ripples = _useRipple2[1];
|
|
73
|
+
|
|
74
|
+
var generatedId = _react.default.useMemo(function () {
|
|
75
|
+
return id || Date.now().toString();
|
|
76
|
+
}, [id]);
|
|
77
|
+
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
+
className: prefixClass("".concat(className || '', " cbx-radio-container")),
|
|
80
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styles), style), stylesInLine)
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
82
|
+
className: prefixClass("".concat(!disabled ? 'cbx-ripple' : '', " cbx-radio-span-ripple")),
|
|
83
|
+
onClick: addRipple
|
|
84
|
+
}, !disabled && ripples, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
85
|
+
type: 'radio',
|
|
86
|
+
id: generatedId,
|
|
87
|
+
className: prefixClass('cbx-radio'),
|
|
88
|
+
name: name,
|
|
123
89
|
disabled: disabled,
|
|
124
|
-
|
|
125
|
-
|
|
90
|
+
onChange: onChange,
|
|
91
|
+
checked: checked
|
|
92
|
+
}, props)), /*#__PURE__*/_react.default.createElement("span", {
|
|
93
|
+
className: prefixClass('cbx-radio-icon')
|
|
94
|
+
})), /*#__PURE__*/_react.default.createElement("label", {
|
|
95
|
+
htmlFor: generatedId,
|
|
96
|
+
className: prefixClass('cbx-radio-containerLabel')
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
98
|
+
className: prefixClass('cbx-radio-labelText')
|
|
99
|
+
}, label)));
|
|
126
100
|
};
|
|
127
101
|
|
|
128
102
|
Radio.displayName = "Radio";
|
|
129
103
|
Radio.propTypes = {
|
|
130
104
|
onChange: _propTypes.default.func,
|
|
131
105
|
disabled: _propTypes.default.bool,
|
|
132
|
-
|
|
133
|
-
|
|
106
|
+
label: _propTypes.default.string,
|
|
107
|
+
checked: _propTypes.default.bool,
|
|
108
|
+
id: _propTypes.default.string
|
|
134
109
|
};
|
|
135
110
|
Radio.defaultProps = {
|
|
136
111
|
onChange: undefined,
|
|
137
112
|
disabled: false,
|
|
138
|
-
|
|
139
|
-
|
|
113
|
+
label: 'label',
|
|
114
|
+
checked: false,
|
|
115
|
+
id: undefined
|
|
140
116
|
};
|
|
141
117
|
var _default = Radio;
|
|
142
118
|
exports.default = _default;
|
|
@@ -1,42 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
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); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.default = exports.Default = void 0;
|
|
7
9
|
|
|
8
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
11
|
|
|
10
12
|
var _Radio = _interopRequireDefault(require("./Radio"));
|
|
11
13
|
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
22
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
+
|
|
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."); }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
|
|
14
34
|
var _default = {
|
|
15
35
|
title: 'Components/Radio',
|
|
16
36
|
component: _Radio.default,
|
|
17
|
-
argTypes: {}
|
|
18
|
-
parameters: {
|
|
19
|
-
storybookCodePanel: {
|
|
20
|
-
disabled: false,
|
|
21
|
-
files: [{
|
|
22
|
-
fileName: 'Radio.js',
|
|
23
|
-
// eslint-disable-next-line import/no-webpack-loader-syntax, global-require, import/extensions, import/no-unresolved
|
|
24
|
-
code: require('!!raw-loader!./Radio.jsx')
|
|
25
|
-
}, {
|
|
26
|
-
fileName: 'Radio.css',
|
|
27
|
-
// eslint-disable-next-line import/no-webpack-loader-syntax, global-require, import/extensions, import/no-unresolved
|
|
28
|
-
code: require('!!raw-loader!./Radio.css')
|
|
29
|
-
}]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
37
|
+
argTypes: {}
|
|
32
38
|
};
|
|
33
39
|
exports.default = _default;
|
|
34
40
|
|
|
35
41
|
var Template = function Template(args) {
|
|
36
|
-
|
|
42
|
+
var _useState = (0, _react.useState)(args.checked),
|
|
43
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
44
|
+
checked = _useState2[0],
|
|
45
|
+
setChecked = _useState2[1];
|
|
46
|
+
|
|
47
|
+
var handleChange = function handleChange(event) {
|
|
48
|
+
setChecked(event.target.checked);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
(0, _react.useEffect)(function () {
|
|
52
|
+
setChecked(args.checked);
|
|
53
|
+
}, [args.checked]);
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_Radio.default, _extends({}, args, {
|
|
55
|
+
checked: checked,
|
|
56
|
+
onChange: handleChange
|
|
57
|
+
}));
|
|
37
58
|
};
|
|
38
59
|
|
|
39
60
|
Template.displayName = "Template";
|
|
40
61
|
var Default = Template.bind({});
|
|
41
62
|
exports.Default = Default;
|
|
42
|
-
Default.args = {
|
|
63
|
+
Default.args = {
|
|
64
|
+
label: 'Radio button',
|
|
65
|
+
checked: true
|
|
66
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.cbx-radio-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.cbx-radio-container:hover:before {
|
|
6
|
+
animation: ripple .6s ease;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.cbx-radio-container:before {
|
|
10
|
+
content: "";
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
background-color: var(--accent25);
|
|
17
|
+
border-radius: 50%;
|
|
18
|
+
transform: scale(0);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes ripple {
|
|
22
|
+
from {
|
|
23
|
+
transform: scale(0);
|
|
24
|
+
opacity: 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
to {
|
|
28
|
+
transform: scale(2.1);
|
|
29
|
+
opacity: .6;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _Radio = _interopRequireDefault(require("@mui/material/Radio"));
|
|
13
|
+
|
|
14
|
+
require("../../styles/main.css");
|
|
15
|
+
|
|
16
|
+
require("./Radio.css");
|
|
17
|
+
|
|
18
|
+
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
19
|
+
|
|
20
|
+
var _styled = _interopRequireDefault(require("@mui/material/styles/styled"));
|
|
21
|
+
|
|
22
|
+
var _excluded = ["id", "className", "disabled", "indeterminate", "label", "onChange"];
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
var BpIcon = (0, _styled.default)('span')(function () {
|
|
33
|
+
return {
|
|
34
|
+
borderRadius: '50%',
|
|
35
|
+
width: 20,
|
|
36
|
+
height: 20,
|
|
37
|
+
boxShadow: 'inset 0 0 0 0.125rem var(--gray3)',
|
|
38
|
+
backgroundColor: '#f5f8fa',
|
|
39
|
+
zIndex: '1',
|
|
40
|
+
backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))',
|
|
41
|
+
transition: '0.2s',
|
|
42
|
+
'.Mui-focusVisible &': {
|
|
43
|
+
outline: '0.125rem auto rgba(19,124,189,.6)',
|
|
44
|
+
outlineOffset: 2
|
|
45
|
+
},
|
|
46
|
+
'input:disabled ~ &': {
|
|
47
|
+
boxShadow: 'inset 0 0 0 0.125rem var(--gray3)'
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
var BpCheckedIcon = (0, _styled.default)(BpIcon)({
|
|
52
|
+
boxShadow: 'inset 0 0 0 0.125rem var(--primary)',
|
|
53
|
+
backgroundColor: 'var(--primary)',
|
|
54
|
+
backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',
|
|
55
|
+
'&:before': {
|
|
56
|
+
display: 'block',
|
|
57
|
+
width: 20,
|
|
58
|
+
height: 20,
|
|
59
|
+
backgroundImage: 'radial-gradient(#fff,#fff 28%,transparent 32%)',
|
|
60
|
+
content: '""'
|
|
61
|
+
},
|
|
62
|
+
'input:hover ~ &': {
|
|
63
|
+
backgroundColor: 'var(--primary)'
|
|
64
|
+
},
|
|
65
|
+
'input:disabled ~ &': {
|
|
66
|
+
boxShadow: 'inset 0 0 0 0.125rem var(--gray3)',
|
|
67
|
+
backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',
|
|
68
|
+
backgroundColor: 'var(--gray3)'
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
var CssFormControlLabel = (0, _styled.default)(_FormControlLabel.default)(function () {
|
|
72
|
+
return {
|
|
73
|
+
'& .MuiFormControlLabel-label': {
|
|
74
|
+
marginLeft: 'var(--spacing12)',
|
|
75
|
+
transition: '0.2s'
|
|
76
|
+
},
|
|
77
|
+
'& .MuiRadio-root.Mui-disabled': {
|
|
78
|
+
color: '#acadce'
|
|
79
|
+
},
|
|
80
|
+
'& .MuiRadio-root': {
|
|
81
|
+
transition: 'all .2s'
|
|
82
|
+
},
|
|
83
|
+
'& .MuiRadio-root.Mui-checked + span': {
|
|
84
|
+
color: 'var(--primary)',
|
|
85
|
+
fontWeight: '700'
|
|
86
|
+
},
|
|
87
|
+
'& .MuiRadio-root.Mui-disabled.Mui-checked + span': {
|
|
88
|
+
color: 'var(--gray3)',
|
|
89
|
+
fontWeight: '700'
|
|
90
|
+
},
|
|
91
|
+
'.MuiButtonBase-root.Mui-disabled, .MuiFormControlLabel-label.Mui-disabled': {
|
|
92
|
+
color: 'var(--gray3)',
|
|
93
|
+
fontWeight: '700'
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
var Radio = function Radio(_ref) {
|
|
99
|
+
var id = _ref.id,
|
|
100
|
+
className = _ref.className,
|
|
101
|
+
disabled = _ref.disabled,
|
|
102
|
+
indeterminate = _ref.indeterminate,
|
|
103
|
+
label = _ref.label,
|
|
104
|
+
onChange = _ref.onChange,
|
|
105
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
106
|
+
|
|
107
|
+
return /*#__PURE__*/_react.default.createElement(CssFormControlLabel, _extends({
|
|
108
|
+
id: id,
|
|
109
|
+
className: className,
|
|
110
|
+
style: {
|
|
111
|
+
margin: '0px'
|
|
112
|
+
},
|
|
113
|
+
onChange: onChange,
|
|
114
|
+
control: /*#__PURE__*/_react.default.createElement(_Radio.default, {
|
|
115
|
+
className: 'cbx-radio-container',
|
|
116
|
+
indeterminate: indeterminate,
|
|
117
|
+
style: {
|
|
118
|
+
padding: '0px'
|
|
119
|
+
},
|
|
120
|
+
checkedIcon: /*#__PURE__*/_react.default.createElement(BpCheckedIcon, null),
|
|
121
|
+
icon: /*#__PURE__*/_react.default.createElement(BpIcon, null)
|
|
122
|
+
}),
|
|
123
|
+
disabled: disabled,
|
|
124
|
+
label: label
|
|
125
|
+
}, props));
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
Radio.displayName = "Radio";
|
|
129
|
+
Radio.propTypes = {
|
|
130
|
+
onChange: _propTypes.default.func,
|
|
131
|
+
disabled: _propTypes.default.bool,
|
|
132
|
+
indeterminate: _propTypes.default.bool,
|
|
133
|
+
label: _propTypes.default.string
|
|
134
|
+
};
|
|
135
|
+
Radio.defaultProps = {
|
|
136
|
+
onChange: undefined,
|
|
137
|
+
disabled: false,
|
|
138
|
+
indeterminate: false,
|
|
139
|
+
label: ''
|
|
140
|
+
};
|
|
141
|
+
var _default = Radio;
|
|
142
|
+
exports.default = _default;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
require("../../styles/main.css");
|
|
11
|
+
|
|
12
|
+
var _useRipple7 = _interopRequireDefault(require("../../HOCs/useRipple"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
+
|
|
18
|
+
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."); }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
|
+
|
|
28
|
+
var DesignRipple = function DesignRipple(_ref) {
|
|
29
|
+
var color = _ref.color;
|
|
30
|
+
|
|
31
|
+
var _useRipple = (0, _useRipple7.default)(),
|
|
32
|
+
_useRipple2 = _slicedToArray(_useRipple, 2),
|
|
33
|
+
addRipple = _useRipple2[0],
|
|
34
|
+
ripples = _useRipple2[1];
|
|
35
|
+
|
|
36
|
+
var _useRipple3 = (0, _useRipple7.default)({
|
|
37
|
+
background: color || 'blue'
|
|
38
|
+
}),
|
|
39
|
+
_useRipple4 = _slicedToArray(_useRipple3, 2),
|
|
40
|
+
addRipple2 = _useRipple4[0],
|
|
41
|
+
ripples2 = _useRipple4[1];
|
|
42
|
+
|
|
43
|
+
var _useRipple5 = (0, _useRipple7.default)({}, 'center'),
|
|
44
|
+
_useRipple6 = _slicedToArray(_useRipple5, 2),
|
|
45
|
+
addRipple3 = _useRipple6[0],
|
|
46
|
+
ripples3 = _useRipple6[1];
|
|
47
|
+
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
+
onClick: addRipple,
|
|
50
|
+
className: "cbx-ripple",
|
|
51
|
+
style: {
|
|
52
|
+
width: '120px',
|
|
53
|
+
height: '80px',
|
|
54
|
+
border: '1px solid black'
|
|
55
|
+
}
|
|
56
|
+
}, ripples, "ripples"), /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
+
onClick: addRipple2,
|
|
58
|
+
className: "cbx-ripple",
|
|
59
|
+
style: {
|
|
60
|
+
width: '120px',
|
|
61
|
+
height: '80px',
|
|
62
|
+
border: '1px solid black'
|
|
63
|
+
}
|
|
64
|
+
}, ripples2, "ripples2"), /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
+
onClick: addRipple3,
|
|
66
|
+
className: "cbx-ripple",
|
|
67
|
+
style: {
|
|
68
|
+
width: '120px',
|
|
69
|
+
height: '80px',
|
|
70
|
+
border: '1px solid black'
|
|
71
|
+
}
|
|
72
|
+
}, ripples3, "ripples3"));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
DesignRipple.displayName = "DesignRipple";
|
|
76
|
+
var _default = DesignRipple;
|
|
77
|
+
exports.default = _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.DesignRippleTemplate = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _DesignRipple = _interopRequireDefault(require("./DesignRipple"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
var _default = {
|
|
15
|
+
title: 'Components/Ripple',
|
|
16
|
+
component: _DesignRipple.default,
|
|
17
|
+
argTypes: {
|
|
18
|
+
color: {
|
|
19
|
+
control: {
|
|
20
|
+
type: 'text'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
parameters: {
|
|
25
|
+
storybookCodePanel: {
|
|
26
|
+
disabled: false,
|
|
27
|
+
files: [{
|
|
28
|
+
fileName: 'DesignRipple.js',
|
|
29
|
+
// eslint-disable-next-line import/no-webpack-loader-syntax, global-require, import/extensions, import/no-unresolved
|
|
30
|
+
code: require('!!raw-loader!./DesignRipple.js')
|
|
31
|
+
}]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.default = _default;
|
|
36
|
+
|
|
37
|
+
var TemplateRipple = function TemplateRipple(args) {
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_DesignRipple.default, args);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
TemplateRipple.displayName = "TemplateRipple";
|
|
42
|
+
var DesignRippleTemplate = TemplateRipple.bind({});
|
|
43
|
+
exports.DesignRippleTemplate = DesignRippleTemplate;
|
|
44
|
+
DesignRippleTemplate.parameters = {};
|
|
45
|
+
DesignRippleTemplate.args = {};
|
|
@@ -47,6 +47,20 @@ var Scrollbar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
47
47
|
};
|
|
48
48
|
}, []);
|
|
49
49
|
|
|
50
|
+
var handleKeyUpToScroll = _react.default.useCallback(function (e) {
|
|
51
|
+
if (e.key === 'ArrowDown') {
|
|
52
|
+
var _scrollbar$current;
|
|
53
|
+
|
|
54
|
+
scrollbar === null || scrollbar === void 0 ? void 0 : (_scrollbar$current = scrollbar.current) === null || _scrollbar$current === void 0 ? void 0 : _scrollbar$current.scrollToBottom();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (e.key === 'ArrowUp') {
|
|
58
|
+
var _scrollbar$current2;
|
|
59
|
+
|
|
60
|
+
scrollbar === null || scrollbar === void 0 ? void 0 : (_scrollbar$current2 = scrollbar.current) === null || _scrollbar$current2 === void 0 ? void 0 : _scrollbar$current2.scrollToTop();
|
|
61
|
+
}
|
|
62
|
+
}, []);
|
|
63
|
+
|
|
50
64
|
var style = props.style,
|
|
51
65
|
autoHide = props.autoHide,
|
|
52
66
|
children = props.children,
|
|
@@ -67,24 +81,25 @@ var Scrollbar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
67
81
|
autoHide: autoHide,
|
|
68
82
|
className: "Scrollbar ".concat(classFix, " ").concat(extraClass, " ").concat(horizontalScroll ? 'scrollbarBoth' : 'scrollbarOnlyY', " scrollbarFixHeight"),
|
|
69
83
|
onScrollStop: onScrollStop,
|
|
84
|
+
onKeyDown: handleKeyUpToScroll,
|
|
70
85
|
style: _objectSpread({
|
|
71
86
|
width: '100%',
|
|
72
87
|
height: '100%'
|
|
73
88
|
}, style)
|
|
74
89
|
}, !showX ? {
|
|
75
|
-
renderTrackHorizontal: function renderTrackHorizontal() {
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
90
|
+
renderTrackHorizontal: function renderTrackHorizontal(scrollbarProps) {
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
77
92
|
style: {
|
|
78
93
|
display: 'hidden'
|
|
79
94
|
}
|
|
80
|
-
});
|
|
95
|
+
}, scrollbarProps));
|
|
81
96
|
},
|
|
82
|
-
renderThumbHorizontal: function renderThumbHorizontal() {
|
|
83
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
97
|
+
renderThumbHorizontal: function renderThumbHorizontal(scrollbarProps) {
|
|
98
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
84
99
|
style: {
|
|
85
100
|
display: 'hidden'
|
|
86
101
|
}
|
|
87
|
-
});
|
|
102
|
+
}, scrollbarProps));
|
|
88
103
|
}
|
|
89
104
|
} : {}), children);
|
|
90
105
|
});
|