@councilbox/councilbox-ui 1.0.1 → 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 +3 -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 +95 -116
- package/dist/components/IconButton/DesignIconButton.stories.js +22 -2
- package/dist/components/IconButton/IconButton.css +121 -1
- package/dist/components/IconButton/IconButton.js +98 -53
- 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 +23 -8
- 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,57 +9,47 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
require("./DrawerPanel.css");
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var _AppBar = _interopRequireDefault(require("@mui/material/AppBar"));
|
|
15
|
-
|
|
16
|
-
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
17
|
-
|
|
18
|
-
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
19
|
-
|
|
20
|
-
var _Icon = _interopRequireDefault(require("@mui/material/Icon"));
|
|
21
|
-
|
|
22
|
-
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
12
|
+
var _reactDom = require("react-dom");
|
|
23
13
|
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
var _Toolbar = _interopRequireDefault(require("@mui/material/Toolbar"));
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
15
|
|
|
28
|
-
var
|
|
16
|
+
var _Tabs = _interopRequireDefault(require("../Tabs/Tabs"));
|
|
29
17
|
|
|
30
18
|
var _ButtonBasic = _interopRequireDefault(require("../ButtonBasic/ButtonBasic"));
|
|
31
19
|
|
|
32
20
|
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
33
21
|
|
|
34
|
-
var
|
|
22
|
+
var _IconButton = _interopRequireDefault(require("../IconButton/IconButton"));
|
|
23
|
+
|
|
24
|
+
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
25
|
+
|
|
26
|
+
var _excluded = ["title", "id", "fullScreen", "sizeContainer", "buttonAccept", "successAction", "open", "requestClose", "loadingAction", "acceptAction", "bodyText", "bodyStyle", "hideAccept", "classNameDialog", "PaperProps", "widthModal", "isMobile", "tabs", "onChange", "titleStyles", "subTitle", "subTitleStyles", "endIcon", "propsButton", "style", "styles", "sx", "prefixClass", "direction"];
|
|
35
27
|
|
|
36
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
29
|
|
|
30
|
+
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); }
|
|
31
|
+
|
|
38
32
|
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; }
|
|
39
33
|
|
|
40
34
|
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; }
|
|
41
35
|
|
|
42
36
|
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; }
|
|
43
37
|
|
|
44
|
-
function
|
|
38
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
45
39
|
|
|
46
|
-
function
|
|
40
|
+
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
41
|
|
|
48
|
-
function
|
|
42
|
+
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); }
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement(_Slide.default, _extends({
|
|
52
|
-
direction: "right",
|
|
53
|
-
ref: ref
|
|
54
|
-
}, props));
|
|
55
|
-
});
|
|
44
|
+
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; }
|
|
56
45
|
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
46
|
+
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; }
|
|
47
|
+
|
|
48
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
|
+
|
|
50
|
+
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; }
|
|
51
|
+
|
|
52
|
+
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; }
|
|
63
53
|
|
|
64
54
|
var DrawerPanel = function DrawerPanel(_ref) {
|
|
65
55
|
var title = _ref.title,
|
|
@@ -82,63 +72,112 @@ var DrawerPanel = function DrawerPanel(_ref) {
|
|
|
82
72
|
PaperProps = _ref.PaperProps,
|
|
83
73
|
widthModal = _ref.widthModal,
|
|
84
74
|
isMobile = _ref.isMobile,
|
|
85
|
-
tabs = _ref.tabs,
|
|
86
|
-
|
|
75
|
+
_ref$tabs = _ref.tabs,
|
|
76
|
+
tabs = _ref$tabs === void 0 ? [] : _ref$tabs,
|
|
77
|
+
_onChange = _ref.onChange,
|
|
87
78
|
titleStyles = _ref.titleStyles,
|
|
88
79
|
subTitle = _ref.subTitle,
|
|
89
80
|
subTitleStyles = _ref.subTitleStyles,
|
|
90
81
|
endIcon = _ref.endIcon,
|
|
91
82
|
propsButton = _ref.propsButton,
|
|
83
|
+
style = _ref.style,
|
|
84
|
+
styles = _ref.styles,
|
|
85
|
+
sx = _ref.sx,
|
|
86
|
+
propPrefixClass = _ref.prefixClass,
|
|
92
87
|
direction = _ref.direction,
|
|
93
88
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
94
89
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
var _useDynamicStyles = (0, _useDynamicStyles2.default)(sx),
|
|
91
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
92
|
+
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
93
|
+
|
|
94
|
+
var prefixClass = propPrefixClass || dynamicPrefixClass;
|
|
95
|
+
|
|
96
|
+
var _React$useState = _react.default.useState(false),
|
|
97
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
98
|
+
isOpen = _React$useState2[0],
|
|
99
|
+
setIsOpen = _React$useState2[1];
|
|
100
|
+
|
|
101
|
+
var _React$useState3 = _react.default.useState(false),
|
|
102
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
103
|
+
isClosing = _React$useState4[0],
|
|
104
|
+
setIsClosing = _React$useState4[1];
|
|
105
|
+
|
|
106
|
+
var _React$useState5 = _react.default.useState(false),
|
|
107
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
108
|
+
isOpenRender = _React$useState6[0],
|
|
109
|
+
setIsOpenRender = _React$useState6[1];
|
|
110
|
+
|
|
111
|
+
var closeDrawerPanel = function closeDrawerPanel(e) {
|
|
112
|
+
if (requestClose) {
|
|
113
|
+
requestClose(e);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
var handleAccept = function handleAccept(e) {
|
|
118
|
+
if (acceptAction) {
|
|
119
|
+
acceptAction(e);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
_react.default.useEffect(function () {
|
|
124
|
+
var timeout;
|
|
125
|
+
|
|
126
|
+
if (open) {
|
|
127
|
+
setIsOpenRender(true);
|
|
128
|
+
timeout = setTimeout(function () {
|
|
129
|
+
setIsOpen(true);
|
|
130
|
+
}, 50);
|
|
131
|
+
} else {
|
|
132
|
+
setIsOpen(false);
|
|
133
|
+
setIsClosing(true);
|
|
134
|
+
timeout = setTimeout(function () {
|
|
135
|
+
setIsOpenRender(false);
|
|
136
|
+
setIsClosing(false);
|
|
137
|
+
}, 300);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return function () {
|
|
141
|
+
return clearTimeout(timeout);
|
|
142
|
+
};
|
|
143
|
+
}, [open]);
|
|
144
|
+
|
|
145
|
+
return isOpenRender && /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
100
146
|
id: id,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
PaperProps: {
|
|
111
|
-
style: _objectSpread(_objectSpread(_objectSpread({
|
|
112
|
-
maxWidth: !isMobile && !fullScreen && '1600px'
|
|
113
|
-
}, widthModal), PaperProps ? PaperProps.style : {}), isMobile ? {
|
|
114
|
-
margin: 0
|
|
115
|
-
} : {})
|
|
147
|
+
className: "".concat(classNameDialog, " cbx-drawerPanel-container"),
|
|
148
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styles), style), stylesInLine)
|
|
149
|
+
}, props), /*#__PURE__*/_react.default.createElement("div", {
|
|
150
|
+
className: "".concat(prefixClass('cbx-drawerPanel-block'), " ").concat(direction === 'left' ? prefixClass('cbx-drawerPanel-block-left') : '', " ").concat(isOpen && !isClosing ? prefixClass('cbx-drawerPanel-block-open') : ''),
|
|
151
|
+
style: {
|
|
152
|
+
width: isMobile || fullScreen ? '100%' : sizeContainer === 'SM' ? '40%' : '80%',
|
|
153
|
+
maxWidth: !isMobile && !fullScreen && '75rem'
|
|
116
154
|
}
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
156
|
+
className: prefixClass('cbx-drawerPanel-header')
|
|
157
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
158
|
+
className: prefixClass('cbx-drawerPanel-requestClose')
|
|
159
|
+
}, !!requestClose && /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
160
|
+
onClick: function onClick(e) {
|
|
161
|
+
return closeDrawerPanel(e);
|
|
123
162
|
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}))), !!title && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
163
|
+
icon: /*#__PURE__*/_react.default.createElement("i", {
|
|
164
|
+
style: {
|
|
165
|
+
color: 'white',
|
|
166
|
+
fontSize: '1.71429rem'
|
|
167
|
+
},
|
|
168
|
+
className: 'ri-close-line'
|
|
169
|
+
})
|
|
170
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
171
|
+
className: prefixClass('cbx-drawerPanel-title')
|
|
172
|
+
}, !!title && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
135
173
|
variant: "M",
|
|
136
174
|
color: 'white',
|
|
137
|
-
className:
|
|
175
|
+
className: prefixClass('cbx-drawerPanel-typography'),
|
|
138
176
|
fontWeight: 'bold',
|
|
139
177
|
styles: _objectSpread({
|
|
140
178
|
fontSize: '1.125rem'
|
|
141
|
-
}, titleStyles)
|
|
179
|
+
}, titleStyles),
|
|
180
|
+
prefixClass: prefixClass
|
|
142
181
|
}, title, !!subTitle && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
143
182
|
variant: "M",
|
|
144
183
|
color: 'white',
|
|
@@ -146,60 +185,45 @@ var DrawerPanel = function DrawerPanel(_ref) {
|
|
|
146
185
|
fontSize: '1.125rem',
|
|
147
186
|
paddingLeft: '24px'
|
|
148
187
|
}, subTitleStyles),
|
|
149
|
-
component: 'span'
|
|
150
|
-
|
|
151
|
-
|
|
188
|
+
component: 'span',
|
|
189
|
+
prefixClass: prefixClass
|
|
190
|
+
}, subTitle))), /*#__PURE__*/_react.default.createElement("div", {
|
|
191
|
+
className: prefixClass('cbx-drawerPanel-buttonAccept')
|
|
152
192
|
}, !hideAccept && !!buttonAccept && /*#__PURE__*/_react.default.createElement(_ButtonBasic.default, _extends({
|
|
153
193
|
text: buttonAccept,
|
|
154
194
|
id: "".concat(id, "-button-accept"),
|
|
155
195
|
loading: loadingAction,
|
|
156
196
|
success: successAction,
|
|
157
|
-
onClick:
|
|
197
|
+
onClick: handleAccept,
|
|
158
198
|
variant: 'secondaryDark',
|
|
159
|
-
endIcon: endIcon
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
edge: "end",
|
|
164
|
-
id: "".concat(id, "-close"),
|
|
165
|
-
className: "cbx-DrawerPanel-iconButton",
|
|
166
|
-
onClick: requestClose
|
|
167
|
-
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
168
|
-
className: 'cbx-DrawerPanel-icon ri-close-line'
|
|
169
|
-
})))), /*#__PURE__*/_react.default.createElement(_AppBar.default, {
|
|
170
|
-
sx: {
|
|
171
|
-
position: 'relative',
|
|
172
|
-
flexDirection: 'row',
|
|
173
|
-
backgroundColor: 'var(--primary)'
|
|
174
|
-
},
|
|
175
|
-
elevation: 0
|
|
199
|
+
endIcon: endIcon,
|
|
200
|
+
prefixClass: prefixClass
|
|
201
|
+
}, propsButton)))), /*#__PURE__*/_react.default.createElement("div", {
|
|
202
|
+
className: prefixClass('cbx-drawerPanel-tabs-container')
|
|
176
203
|
}, tabs.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
177
|
-
className: 'cbx-
|
|
178
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
204
|
+
className: prefixClass('cbx-drawerPanel-tabs-block')
|
|
205
|
+
}, /*#__PURE__*/_react.default.createElement(_Tabs.default, {
|
|
206
|
+
onChange: function onChange(index, e) {
|
|
207
|
+
return _onChange(e, index);
|
|
208
|
+
},
|
|
182
209
|
value: tabs.findIndex(function (tab) {
|
|
183
210
|
return tab.active;
|
|
184
211
|
}),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
className: "cbx-DrawerPanel-tabs ".concat(!tab.active ? 'cbx-DrawerPanel-tabs-opacity' : ''),
|
|
192
|
-
sx: _objectSpread({}, !tab.active ? {
|
|
193
|
-
opacity: '50% !important'
|
|
194
|
-
} : {})
|
|
195
|
-
});
|
|
196
|
-
})))), /*#__PURE__*/_react.default.createElement(_DialogContent.default, {
|
|
197
|
-
className: 'cbx-DrawerPanel-dialogContent',
|
|
212
|
+
itemsTab: tabs,
|
|
213
|
+
variant: 'scrollable',
|
|
214
|
+
indicatorColor: "secondary",
|
|
215
|
+
prefixClass: prefixClass
|
|
216
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
217
|
+
className: prefixClass('cbx-drawerPanel-tabs-bodyText'),
|
|
198
218
|
style: _objectSpread({}, bodyStyle)
|
|
199
|
-
}, bodyText))
|
|
219
|
+
}, bodyText)), /*#__PURE__*/_react.default.createElement("div", {
|
|
220
|
+
className: "".concat(prefixClass('cbx-drawerPanel-backdrop'), " ").concat(isOpen && !isClosing ? prefixClass('cbx-drawerPanel-backdrop-open') : ''),
|
|
221
|
+
onClick: function onClick(e) {
|
|
222
|
+
return closeDrawerPanel(e);
|
|
223
|
+
}
|
|
224
|
+
})), document.body);
|
|
200
225
|
};
|
|
201
226
|
|
|
202
|
-
DrawerPanel.displayName = "DrawerPanel";
|
|
203
227
|
DrawerPanel.propTypes = {
|
|
204
228
|
open: _propTypes.default.bool,
|
|
205
229
|
title: _propTypes.default.string,
|
|
@@ -218,7 +242,6 @@ DrawerPanel.propTypes = {
|
|
|
218
242
|
PaperProps: _propTypes.default.object,
|
|
219
243
|
widthModal: _propTypes.default.object,
|
|
220
244
|
isMobile: _propTypes.default.bool,
|
|
221
|
-
loadingColor: _propTypes.default.string,
|
|
222
245
|
tabs: _propTypes.default.array,
|
|
223
246
|
onChange: _propTypes.default.func,
|
|
224
247
|
titleStyles: _propTypes.default.object
|
|
@@ -241,7 +264,6 @@ DrawerPanel.defaultProps = {
|
|
|
241
264
|
PaperProps: undefined,
|
|
242
265
|
widthModal: undefined,
|
|
243
266
|
isMobile: false,
|
|
244
|
-
loadingColor: 'white',
|
|
245
267
|
tabs: [],
|
|
246
268
|
onChange: undefined,
|
|
247
269
|
titleStyles: undefined
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.cbx-DrawerPanel-dialog {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: flex-end;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.cbx-DrawerPanel-toolbar {
|
|
8
|
+
padding: 0 1rem
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.cbx-DrawerPanel-iconButton {
|
|
12
|
+
outline: none!important;
|
|
13
|
+
height: 1.5em;
|
|
14
|
+
padding: 0!important;
|
|
15
|
+
margin: 0!important;
|
|
16
|
+
width: 1.5em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.cbx-DrawerPanel-icon {
|
|
20
|
+
color: #fff;
|
|
21
|
+
height: auto!important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cbx-DrawerPanel-typography {
|
|
25
|
+
color:#fff;
|
|
26
|
+
flex: 1!important;
|
|
27
|
+
padding: 1.125rem!important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.cbx-DrawerPanel-typography span{
|
|
31
|
+
padding-left: 1.5rem!important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.cbx-DrawerPanel-container-tabs {
|
|
35
|
+
width: 100%;
|
|
36
|
+
margin-right: 4.25rem;
|
|
37
|
+
margin-left: 4.25rem;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.cbx-DrawerPanel-tabs {
|
|
42
|
+
color: var(--white)!important;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.cbx-DrawerPanel-tabs:focus {
|
|
46
|
+
outline: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.cbx-DrawerPanel-tabs-opacity {
|
|
50
|
+
opacity: 50%!important
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.cbx-DrawerPanel-dialogContent {
|
|
54
|
+
min-width: 40vw;
|
|
55
|
+
max-width: 95vw;
|
|
56
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
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("./DrawerPanel.css");
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _AppBar = _interopRequireDefault(require("@mui/material/AppBar"));
|
|
15
|
+
|
|
16
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
17
|
+
|
|
18
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
19
|
+
|
|
20
|
+
var _Icon = _interopRequireDefault(require("@mui/material/Icon"));
|
|
21
|
+
|
|
22
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
23
|
+
|
|
24
|
+
var _Slide = _interopRequireDefault(require("@mui/material/Slide"));
|
|
25
|
+
|
|
26
|
+
var _Toolbar = _interopRequireDefault(require("@mui/material/Toolbar"));
|
|
27
|
+
|
|
28
|
+
var _material = require("@mui/material");
|
|
29
|
+
|
|
30
|
+
var _ButtonBasic = _interopRequireDefault(require("../ButtonBasic/ButtonBasic"));
|
|
31
|
+
|
|
32
|
+
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
33
|
+
|
|
34
|
+
var _excluded = ["title", "id", "fullScreen", "sizeContainer", "buttonAccept", "successAction", "open", "requestClose", "loadingAction", "acceptAction", "bodyText", "bodyStyle", "hideAccept", "classNameDialog", "PaperProps", "widthModal", "isMobile", "tabs", "onChange", "titleStyles", "subTitle", "subTitleStyles", "endIcon", "propsButton"];
|
|
35
|
+
|
|
36
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
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; }
|
|
43
|
+
|
|
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; }
|
|
45
|
+
|
|
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; }
|
|
47
|
+
|
|
48
|
+
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); }
|
|
49
|
+
|
|
50
|
+
var Transition = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_Slide.default, _extends({
|
|
52
|
+
direction: "left",
|
|
53
|
+
ref: ref
|
|
54
|
+
}, props));
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
var DrawerPanel = function DrawerPanel(_ref) {
|
|
58
|
+
var title = _ref.title,
|
|
59
|
+
_ref$id = _ref.id,
|
|
60
|
+
id = _ref$id === void 0 ? 'panel-confirm' : _ref$id,
|
|
61
|
+
fullScreen = _ref.fullScreen,
|
|
62
|
+
sizeContainer = _ref.sizeContainer,
|
|
63
|
+
buttonAccept = _ref.buttonAccept,
|
|
64
|
+
_ref$successAction = _ref.successAction,
|
|
65
|
+
successAction = _ref$successAction === void 0 ? false : _ref$successAction,
|
|
66
|
+
open = _ref.open,
|
|
67
|
+
requestClose = _ref.requestClose,
|
|
68
|
+
loadingAction = _ref.loadingAction,
|
|
69
|
+
acceptAction = _ref.acceptAction,
|
|
70
|
+
bodyText = _ref.bodyText,
|
|
71
|
+
_ref$bodyStyle = _ref.bodyStyle,
|
|
72
|
+
bodyStyle = _ref$bodyStyle === void 0 ? {} : _ref$bodyStyle,
|
|
73
|
+
hideAccept = _ref.hideAccept,
|
|
74
|
+
classNameDialog = _ref.classNameDialog,
|
|
75
|
+
PaperProps = _ref.PaperProps,
|
|
76
|
+
widthModal = _ref.widthModal,
|
|
77
|
+
isMobile = _ref.isMobile,
|
|
78
|
+
tabs = _ref.tabs,
|
|
79
|
+
onChange = _ref.onChange,
|
|
80
|
+
titleStyles = _ref.titleStyles,
|
|
81
|
+
subTitle = _ref.subTitle,
|
|
82
|
+
subTitleStyles = _ref.subTitleStyles,
|
|
83
|
+
endIcon = _ref.endIcon,
|
|
84
|
+
propsButton = _ref.propsButton,
|
|
85
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
86
|
+
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(_Dialog.default, _extends({
|
|
88
|
+
TransitionComponent: Transition,
|
|
89
|
+
className: "".concat(classNameDialog, " cbx-DrawerPanel-dialog"),
|
|
90
|
+
fullScreen: true,
|
|
91
|
+
maxWidth: false,
|
|
92
|
+
id: id,
|
|
93
|
+
open: open || false,
|
|
94
|
+
onClose: requestClose,
|
|
95
|
+
sx: {
|
|
96
|
+
'& .MuiDialog-container': {
|
|
97
|
+
width: isMobile || fullScreen ? '100%' : sizeContainer === 'SM' ? '40%' : '80%',
|
|
98
|
+
maxWidth: '75rem',
|
|
99
|
+
justifyContent: 'flex-end'
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
PaperProps: {
|
|
103
|
+
style: _objectSpread(_objectSpread(_objectSpread({
|
|
104
|
+
maxWidth: !isMobile && !fullScreen && '1600px'
|
|
105
|
+
}, widthModal), PaperProps ? PaperProps.style : {}), isMobile ? {
|
|
106
|
+
margin: 0
|
|
107
|
+
} : {})
|
|
108
|
+
}
|
|
109
|
+
}, props), /*#__PURE__*/_react.default.createElement(_AppBar.default, {
|
|
110
|
+
sx: {
|
|
111
|
+
position: 'relative',
|
|
112
|
+
flexDirection: 'row',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
backgroundColor: 'var(--primary)'
|
|
115
|
+
},
|
|
116
|
+
elevation: 0
|
|
117
|
+
}, !!requestClose && /*#__PURE__*/_react.default.createElement(_Toolbar.default, {
|
|
118
|
+
className: "cbx-DrawerPanel-toolbar"
|
|
119
|
+
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
120
|
+
edge: "end",
|
|
121
|
+
id: "".concat(id, "-close"),
|
|
122
|
+
className: "cbx-DrawerPanel-iconButton",
|
|
123
|
+
onClick: requestClose
|
|
124
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
125
|
+
className: 'cbx-DrawerPanel-icon ri-close-line'
|
|
126
|
+
}))), !!title && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
127
|
+
variant: "M",
|
|
128
|
+
color: 'white',
|
|
129
|
+
className: 'cbx-DrawerPanel-typography',
|
|
130
|
+
fontWeight: 'bold',
|
|
131
|
+
styles: _objectSpread({
|
|
132
|
+
fontSize: '1.125rem'
|
|
133
|
+
}, titleStyles)
|
|
134
|
+
}, title, !!subTitle && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
135
|
+
variant: "M",
|
|
136
|
+
color: 'white',
|
|
137
|
+
styles: _objectSpread({
|
|
138
|
+
fontSize: '1.125rem',
|
|
139
|
+
paddingLeft: '24px'
|
|
140
|
+
}, subTitleStyles),
|
|
141
|
+
component: 'span'
|
|
142
|
+
}, subTitle)), /*#__PURE__*/_react.default.createElement(_Toolbar.default, {
|
|
143
|
+
className: 'cbx-DrawerPanel-toolbar'
|
|
144
|
+
}, !hideAccept && !!buttonAccept && /*#__PURE__*/_react.default.createElement(_ButtonBasic.default, _extends({
|
|
145
|
+
text: buttonAccept,
|
|
146
|
+
id: "".concat(id, "-button-accept"),
|
|
147
|
+
loading: loadingAction,
|
|
148
|
+
success: successAction,
|
|
149
|
+
onClick: acceptAction,
|
|
150
|
+
variant: 'secondaryDark',
|
|
151
|
+
endIcon: endIcon
|
|
152
|
+
}, propsButton)))), /*#__PURE__*/_react.default.createElement(_AppBar.default, {
|
|
153
|
+
sx: {
|
|
154
|
+
position: 'relative',
|
|
155
|
+
flexDirection: 'row',
|
|
156
|
+
backgroundColor: 'var(--primary)'
|
|
157
|
+
},
|
|
158
|
+
elevation: 0
|
|
159
|
+
}, tabs.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
160
|
+
className: 'cbx-DrawerPanel-container-tabs'
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Tabs, {
|
|
162
|
+
indicatorColor: "secondary",
|
|
163
|
+
textColor: "secondary",
|
|
164
|
+
onChange: onChange,
|
|
165
|
+
value: tabs.findIndex(function (tab) {
|
|
166
|
+
return tab.active;
|
|
167
|
+
}),
|
|
168
|
+
variant: "scrollable",
|
|
169
|
+
scrollButtons: "auto"
|
|
170
|
+
}, tabs.map(function (tab, index) {
|
|
171
|
+
return /*#__PURE__*/_react.default.createElement(_material.Tab, {
|
|
172
|
+
label: tab.label,
|
|
173
|
+
key: index,
|
|
174
|
+
className: "cbx-DrawerPanel-tabs ".concat(!tab.active ? 'cbx-DrawerPanel-tabs-opacity' : ''),
|
|
175
|
+
sx: _objectSpread({}, !tab.active ? {
|
|
176
|
+
opacity: '50% !important'
|
|
177
|
+
} : {})
|
|
178
|
+
});
|
|
179
|
+
})))), /*#__PURE__*/_react.default.createElement(_DialogContent.default, {
|
|
180
|
+
className: 'cbx-DrawerPanel-dialogContent',
|
|
181
|
+
style: _objectSpread({}, bodyStyle)
|
|
182
|
+
}, bodyText));
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
DrawerPanel.displayName = "DrawerPanel";
|
|
186
|
+
DrawerPanel.propTypes = {
|
|
187
|
+
open: _propTypes.default.bool,
|
|
188
|
+
title: _propTypes.default.string,
|
|
189
|
+
id: _propTypes.default.string,
|
|
190
|
+
fullScreen: _propTypes.default.bool,
|
|
191
|
+
sizeContainer: _propTypes.default.string,
|
|
192
|
+
buttonAccept: _propTypes.default.string,
|
|
193
|
+
successAction: _propTypes.default.bool,
|
|
194
|
+
requestClose: _propTypes.default.func,
|
|
195
|
+
loadingAction: _propTypes.default.bool,
|
|
196
|
+
acceptAction: _propTypes.default.func,
|
|
197
|
+
bodyText: _propTypes.default.any,
|
|
198
|
+
bodyStyle: _propTypes.default.object,
|
|
199
|
+
hideAccept: _propTypes.default.bool,
|
|
200
|
+
classNameDialog: _propTypes.default.string,
|
|
201
|
+
PaperProps: _propTypes.default.object,
|
|
202
|
+
widthModal: _propTypes.default.object,
|
|
203
|
+
isMobile: _propTypes.default.bool,
|
|
204
|
+
loadingColor: _propTypes.default.string,
|
|
205
|
+
tabs: _propTypes.default.array,
|
|
206
|
+
onChange: _propTypes.default.func,
|
|
207
|
+
titleStyles: _propTypes.default.object
|
|
208
|
+
};
|
|
209
|
+
DrawerPanel.defaultProps = {
|
|
210
|
+
open: true,
|
|
211
|
+
title: 'title',
|
|
212
|
+
id: '',
|
|
213
|
+
fullScreen: false,
|
|
214
|
+
sizeContainer: '',
|
|
215
|
+
buttonAccept: '',
|
|
216
|
+
successAction: false,
|
|
217
|
+
requestClose: undefined,
|
|
218
|
+
loadingAction: false,
|
|
219
|
+
acceptAction: undefined,
|
|
220
|
+
bodyText: undefined,
|
|
221
|
+
bodyStyle: undefined,
|
|
222
|
+
hideAccept: false,
|
|
223
|
+
classNameDialog: '',
|
|
224
|
+
PaperProps: undefined,
|
|
225
|
+
widthModal: undefined,
|
|
226
|
+
isMobile: false,
|
|
227
|
+
loadingColor: 'white',
|
|
228
|
+
tabs: [],
|
|
229
|
+
onChange: undefined,
|
|
230
|
+
titleStyles: undefined
|
|
231
|
+
};
|
|
232
|
+
var _default = DrawerPanel;
|
|
233
|
+
exports.default = _default;
|