@councilbox/councilbox-ui 2.0.22 → 2.0.23
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/components/1.Introduction.stories.mdx +1 -1
- package/dist/components/2.Changelog.stories.mdx +7 -0
- package/dist/components/Checkbox/Checkbox.js +30 -18
- package/dist/components/DrawerPanel/DrawerPanel.css +1 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.css +6 -0
- package/dist/components/Modal/Modal.js +6 -3
- package/dist/components/Tabs/DesignTabs.js +1 -1
- package/dist/components/Tabs/Tabs.js +17 -5
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ a.noStyles:hover{
|
|
|
16
16
|
`}</style>
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
# Librería de componentes ui-councilbox NEW v2.0.
|
|
19
|
+
# Librería de componentes ui-councilbox NEW v2.0.23 🎉
|
|
20
20
|
|
|
21
21
|
<h2>Componentes:</h2>
|
|
22
22
|
<div><a class='noStyles' href='/story/components-accordion--default'>Accordion</a></div>
|
|
@@ -25,6 +25,13 @@ a.noStyles:hover{
|
|
|
25
25
|
<div>Fix zIndex label InputText y SelectInput</div>
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
|
+
<h2>v2.0.23</h2>
|
|
29
|
+
<div>Fix Tabs controlados y no controlados</div>
|
|
30
|
+
<div>Fix Checkbox controlados y no controlados</div>
|
|
31
|
+
<div>Fix height del DrawerPanel</div>
|
|
32
|
+
<div>Fix tamaño del Autocomplete</div>
|
|
33
|
+
<div>Add disableBackdropClick en Modal</div>
|
|
34
|
+
|
|
28
35
|
<h2>v2.0.22</h2>
|
|
29
36
|
<div>Fix EnhanceTable</div>
|
|
30
37
|
|
|
@@ -60,6 +60,8 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
60
60
|
onClick = _ref.onClick,
|
|
61
61
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
62
62
|
|
|
63
|
+
var inputRef = _react.default.useRef(null);
|
|
64
|
+
|
|
63
65
|
var _useDynamicStyles = (0, _useDynamicStyles2.default)(sx),
|
|
64
66
|
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
65
67
|
prefixClass = _useDynamicStyles.prefixClass;
|
|
@@ -71,15 +73,22 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
71
73
|
addRipple = _useRipple2[0],
|
|
72
74
|
ripples = _useRipple2[1];
|
|
73
75
|
|
|
74
|
-
var
|
|
76
|
+
var isControlled = checkedProp !== undefined;
|
|
77
|
+
|
|
78
|
+
var _React$useState = _react.default.useState(!!checkedProp),
|
|
75
79
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
76
80
|
internalState = _React$useState2[0],
|
|
77
81
|
setInternalState = _React$useState2[1];
|
|
78
82
|
|
|
83
|
+
var checked = isControlled ? checkedProp : internalState;
|
|
84
|
+
|
|
79
85
|
var handleChange = function handleChange(event) {
|
|
80
86
|
if (disabled) return;
|
|
81
87
|
var newChecked = event.target.checked;
|
|
82
|
-
|
|
88
|
+
|
|
89
|
+
if (!isControlled) {
|
|
90
|
+
setInternalState(newChecked);
|
|
91
|
+
}
|
|
83
92
|
|
|
84
93
|
if (onChange) {
|
|
85
94
|
onChange(event, newChecked);
|
|
@@ -87,8 +96,10 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
87
96
|
};
|
|
88
97
|
|
|
89
98
|
_react.default.useEffect(function () {
|
|
90
|
-
|
|
91
|
-
|
|
99
|
+
if (inputRef.current) {
|
|
100
|
+
inputRef.current.indeterminate = indeterminate;
|
|
101
|
+
}
|
|
102
|
+
}, [indeterminate]);
|
|
92
103
|
|
|
93
104
|
return /*#__PURE__*/_react.default.createElement("label", _extends({
|
|
94
105
|
className: prefixClass('cbx-checkbox'),
|
|
@@ -97,28 +108,29 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
97
108
|
className: prefixClass("cbx-checkbox-container ".concat(disabled ? 'cbx-checkbox-container-disabled' : '', " ").concat(!disabled ? 'cbx-ripple' : '')),
|
|
98
109
|
onClick: addRipple
|
|
99
110
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
111
|
+
ref: inputRef,
|
|
100
112
|
type: "checkbox",
|
|
101
|
-
checked:
|
|
113
|
+
checked: checked,
|
|
102
114
|
onChange: handleChange,
|
|
103
|
-
onClick: function onClick(
|
|
104
|
-
|
|
115
|
+
onClick: function onClick(e) {
|
|
116
|
+
return e.stopPropagation();
|
|
105
117
|
},
|
|
106
|
-
onKeyDown: function onKeyDown(
|
|
107
|
-
if (
|
|
108
|
-
|
|
118
|
+
onKeyDown: function onKeyDown(e) {
|
|
119
|
+
if (e.key === ' ') {
|
|
120
|
+
e.preventDefault();
|
|
109
121
|
handleChange({
|
|
110
122
|
target: {
|
|
111
|
-
checked: !
|
|
123
|
+
checked: !checked
|
|
112
124
|
}
|
|
113
125
|
});
|
|
114
126
|
}
|
|
115
127
|
},
|
|
116
128
|
tabIndex: 0
|
|
117
|
-
}), !disabled && ripples,
|
|
129
|
+
}), !disabled && ripples, checked ? indeterminate ? /*#__PURE__*/_react.default.createElement("svg", {
|
|
130
|
+
className: prefixClass('cbx-checkbox-checked'),
|
|
118
131
|
focusable: "false",
|
|
119
132
|
"aria-hidden": "true",
|
|
120
|
-
viewBox: "0 0 24 24"
|
|
121
|
-
className: prefixClass('cbx-checkbox-checked')
|
|
133
|
+
viewBox: "0 0 24 24"
|
|
122
134
|
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
123
135
|
d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
|
|
124
136
|
})) : /*#__PURE__*/_react.default.createElement("svg", {
|
|
@@ -140,14 +152,14 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
140
152
|
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
141
153
|
d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
|
142
154
|
}))), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
143
|
-
component:
|
|
155
|
+
component: "span",
|
|
144
156
|
style: {
|
|
145
|
-
margin:
|
|
157
|
+
margin: 0,
|
|
146
158
|
transition: '0.2s',
|
|
147
159
|
marginLeft: '.5rem'
|
|
148
160
|
},
|
|
149
|
-
color: disabled ? 'var(--gray3)' :
|
|
150
|
-
fontWeight: disabled ? '700' :
|
|
161
|
+
color: disabled ? 'var(--gray3)' : checked ? 'var(--primary)' : 'var(--gray4)',
|
|
162
|
+
fontWeight: disabled ? '700' : checked ? '700' : '400',
|
|
151
163
|
prefixClass: prefixClass
|
|
152
164
|
}, label));
|
|
153
165
|
};
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
opacity: 0;
|
|
27
27
|
transition: opacity 0.3s ease-in-out;
|
|
28
28
|
margin-right: var(--spacing20);
|
|
29
|
+
position: absolute !important;
|
|
30
|
+
right: .30rem;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
.cbx-inputAutocomplete-container:hover .cbx-inputAutocomplete-icon-button {
|
|
@@ -117,6 +119,10 @@
|
|
|
117
119
|
pointer-events: none;
|
|
118
120
|
}
|
|
119
121
|
|
|
122
|
+
.cbx-inputText-autocomplete.shrink {
|
|
123
|
+
padding-right: 3.875rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
120
126
|
@keyframes dropdownOpen {
|
|
121
127
|
0% {
|
|
122
128
|
opacity: 0;
|
|
@@ -21,7 +21,7 @@ var _CouncilboxThemeContext = require("../ThemeProvider/CouncilboxThemeContext")
|
|
|
21
21
|
|
|
22
22
|
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
23
23
|
|
|
24
|
-
var _excluded = ["title", "fullWidth", "id", "fullScreen", "buttonAccept", "buttonCancel", "open", "requestClose", "loadingAction", "acceptAction", "cancelAction", "body", "bodyText", "hideAccept", "extraActions", "classNameDialog", "PaperProps", "widthModal", "actions", "sx", "buttonCancelProps", "buttonAcceptProps", "breakpointsButtons", "hasScrollbar", "scrollbarHeight", "prefixClass", "style", "styles", "customButtons", "className"];
|
|
24
|
+
var _excluded = ["title", "fullWidth", "id", "fullScreen", "buttonAccept", "buttonCancel", "open", "requestClose", "loadingAction", "acceptAction", "cancelAction", "body", "bodyText", "hideAccept", "extraActions", "classNameDialog", "PaperProps", "widthModal", "actions", "sx", "buttonCancelProps", "buttonAcceptProps", "breakpointsButtons", "hasScrollbar", "scrollbarHeight", "prefixClass", "style", "styles", "customButtons", "className", "disableBackdropClick"];
|
|
25
25
|
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
27
|
|
|
@@ -81,6 +81,7 @@ var Modal = function Modal(_ref) {
|
|
|
81
81
|
styles = _ref.styles,
|
|
82
82
|
customButtons = _ref.customButtons,
|
|
83
83
|
className = _ref.className,
|
|
84
|
+
disableBackdropClick = _ref.disableBackdropClick,
|
|
84
85
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
85
86
|
|
|
86
87
|
var _React$useState = _react.default.useState(false),
|
|
@@ -161,8 +162,10 @@ var Modal = function Modal(_ref) {
|
|
|
161
162
|
}, buttonAcceptProps))));
|
|
162
163
|
|
|
163
164
|
var handleBackgroundClick = function handleBackgroundClick(e) {
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
if (!disableBackdropClick) {
|
|
166
|
+
e.stopPropagation();
|
|
167
|
+
requestClose(false);
|
|
168
|
+
}
|
|
166
169
|
};
|
|
167
170
|
|
|
168
171
|
var handleContentClick = function handleContentClick(e) {
|
|
@@ -57,7 +57,7 @@ var data = [{
|
|
|
57
57
|
var DesignDrawerPanel = function DesignDrawerPanel(_ref) {
|
|
58
58
|
var variant = _ref.variant;
|
|
59
59
|
|
|
60
|
-
var _React$useState = _react.default.useState(
|
|
60
|
+
var _React$useState = _react.default.useState(2),
|
|
61
61
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
62
62
|
selectTab = _React$useState2[0],
|
|
63
63
|
setSelectTab = _React$useState2[1];
|
|
@@ -97,25 +97,37 @@ var Tabs = function Tabs(_ref) {
|
|
|
97
97
|
isEllipsisActive = _React$useState10[0],
|
|
98
98
|
setIsEllipsisActive = _React$useState10[1];
|
|
99
99
|
|
|
100
|
+
var isControlled = value !== undefined;
|
|
101
|
+
|
|
100
102
|
var getInitialTabIndex = function getInitialTabIndex() {
|
|
101
103
|
return Math.max(itemsTab.findIndex(function (i) {
|
|
102
104
|
return i.value === value;
|
|
103
105
|
}), 0);
|
|
104
106
|
};
|
|
105
107
|
|
|
106
|
-
var _React$useState11 = _react.default.useState(getInitialTabIndex),
|
|
108
|
+
var _React$useState11 = _react.default.useState(getInitialTabIndex()),
|
|
107
109
|
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
internalTabIndex = _React$useState12[0],
|
|
111
|
+
setInternalTabIndex = _React$useState12[1];
|
|
112
|
+
|
|
113
|
+
var activeTabIndex = isControlled ? value : internalTabIndex;
|
|
110
114
|
|
|
111
115
|
var handleTabClick = function handleTabClick(e, index, valueItem) {
|
|
112
|
-
|
|
116
|
+
if (!isControlled) {
|
|
117
|
+
setInternalTabIndex(index);
|
|
118
|
+
}
|
|
113
119
|
|
|
114
120
|
if (onChange) {
|
|
115
121
|
onChange(index, valueItem);
|
|
116
122
|
}
|
|
117
123
|
};
|
|
118
124
|
|
|
125
|
+
_react.default.useEffect(function () {
|
|
126
|
+
if (!isControlled) {
|
|
127
|
+
setInternalTabIndex(getInitialTabIndex());
|
|
128
|
+
}
|
|
129
|
+
}, [itemsTab]);
|
|
130
|
+
|
|
119
131
|
var showButtons = function showButtons(direction, scrollLeftNumber) {
|
|
120
132
|
var container = tabsContainerRef === null || tabsContainerRef === void 0 ? void 0 : tabsContainerRef.current;
|
|
121
133
|
|
|
@@ -272,7 +284,7 @@ Tabs.propTypes = {
|
|
|
272
284
|
variant: _propTypes.default.string
|
|
273
285
|
};
|
|
274
286
|
Tabs.defaultProps = {
|
|
275
|
-
value:
|
|
287
|
+
value: undefined,
|
|
276
288
|
onChange: undefined,
|
|
277
289
|
itemsTab: [],
|
|
278
290
|
variant: ''
|