@councilbox/councilbox-ui 2.0.0 → 2.0.2

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.
@@ -16,7 +16,7 @@ a.noStyles:hover{
16
16
  `}</style>
17
17
 
18
18
 
19
- # Librería de componentes ui-councilbox NEW v2.0.0 &#127881;
19
+ # Librería de componentes ui-councilbox NEW v2.0.2 &#127881;
20
20
 
21
21
  <h2>Componentes:</h2>
22
22
  <div><a class='noStyles' href='/story/components-accordion--default'>Accordion</a></div>
@@ -24,6 +24,15 @@ a.noStyles:hover{
24
24
  <h2>v0.5.4</h2>
25
25
  <div>Fix zIndex label InputText y SelectInput</div>
26
26
  </div>
27
+ <h2>v2.0.2</h2>
28
+ <div>Fix tabs in DrawerPanel</div>
29
+ <div>Eliminar props de Avatar</div>
30
+ <div>Fix eventos del onChange en SelectInput</div>
31
+ <div>Fix validacion onChange en SelectInput</div>
32
+
33
+ <h2>v2.0.1</h2>
34
+ <div>Fix errores</div>
35
+
27
36
  <h2>v2.0.0</h2>
28
37
  <div>Nuevos componentes sin Mui</div>
29
38
 
@@ -125,7 +125,6 @@ Avatar.propTypes = {
125
125
  backgroundColor: _propTypes.default.string,
126
126
  text: _propTypes.default.string,
127
127
  src: _propTypes.default.any,
128
- icon: _propTypes.default.any,
129
128
  label: _propTypes.default.string,
130
129
  colorText: _propTypes.default.string,
131
130
  variantText: _propTypes.default.string,
@@ -142,7 +141,6 @@ Avatar.defaultProps = {
142
141
  backgroundColor: '',
143
142
  text: 'MW',
144
143
  src: null,
145
- icon: null,
146
144
  label: '',
147
145
  colorText: '',
148
146
  variantText: '',
@@ -88,11 +88,14 @@
88
88
  background-color: var(--primary);
89
89
  }
90
90
 
91
- .cbx-drawerPanel-tabs-block {
91
+ .cbx-drawerPanel-tabs-block, .cbx-drawerPanel-tabs-block-mobile {
92
92
  width: 100%;
93
+ overflow: hidden;
94
+ }
95
+
96
+ .cbx-drawerPanel-tabs-block {
93
97
  margin-right: 4.25rem;
94
98
  margin-left: 4.25rem;
95
- overflow: hidden;
96
99
  }
97
100
 
98
101
  .cbx-drawerPanel-tabs-bodyText {
@@ -23,7 +23,7 @@ var _IconButton = _interopRequireDefault(require("../IconButton/IconButton"));
23
23
 
24
24
  var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
25
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"];
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", "variantTabs"];
27
27
 
28
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
29
 
@@ -85,6 +85,7 @@ var DrawerPanel = function DrawerPanel(_ref) {
85
85
  sx = _ref.sx,
86
86
  propPrefixClass = _ref.prefixClass,
87
87
  direction = _ref.direction,
88
+ variantTabs = _ref.variantTabs,
88
89
  props = _objectWithoutProperties(_ref, _excluded);
89
90
 
90
91
  var _useDynamicStyles = (0, _useDynamicStyles2.default)(sx),
@@ -201,7 +202,7 @@ var DrawerPanel = function DrawerPanel(_ref) {
201
202
  }, propsButton)))), /*#__PURE__*/_react.default.createElement("div", {
202
203
  className: prefixClass('cbx-drawerPanel-tabs-container')
203
204
  }, tabs.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
204
- className: prefixClass('cbx-drawerPanel-tabs-block')
205
+ className: prefixClass(isMobile ? 'cbx-drawerPanel-tabs-block-mobile' : 'cbx-drawerPanel-tabs-block')
205
206
  }, /*#__PURE__*/_react.default.createElement(_Tabs.default, {
206
207
  onChange: function onChange(index, e) {
207
208
  return _onChange(e, index);
@@ -210,7 +211,7 @@ var DrawerPanel = function DrawerPanel(_ref) {
210
211
  return tab.active;
211
212
  }),
212
213
  itemsTab: tabs,
213
- variant: 'scrollable',
214
+ variant: variantTabs || 'scrollable',
214
215
  indicatorColor: "secondary",
215
216
  prefixClass: prefixClass
216
217
  }))), /*#__PURE__*/_react.default.createElement("div", {
@@ -19,6 +19,8 @@ require("./DropDown.css");
19
19
 
20
20
  var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
21
21
 
22
+ var _utils = require("../../utils");
23
+
22
24
  var _excluded = ["text", "Component", "items", "id", "type", "open", "icon", "requestClose", "anchorOrigin", "transformOrigin", "styleComponent", "variantButton", "stylesButtonText", "sxButton", "forceClose", "sx", "style", "styles", "prefixClass", "setOpen", "className"];
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -238,6 +240,7 @@ var DropDown = function DropDown(_ref2) {
238
240
  };
239
241
 
240
242
  var handleClick = _react.default.useCallback(function (event) {
243
+ console.log('abre cabrón');
241
244
  event === null || event === void 0 ? void 0 : event.stopPropagation();
242
245
  event === null || event === void 0 ? void 0 : event.preventDefault();
243
246
  setIsOpen(true);
@@ -317,44 +320,7 @@ var DropDown = function DropDown(_ref2) {
317
320
  clearTimeout(timeoutRef.current);
318
321
  }
319
322
  };
320
- }, [isOpen, adjustPopoverPosition, debouncedAdjustPopoverPosition, isVisible]); // const handleOptionClick = React.useCallback(
321
- // (option, event) => {
322
- // event?.stopPropagation();
323
- // event?.preventDefault();
324
- // closeDropdown();
325
- // if (option) {
326
- // option.props?.onClick?.({
327
- // target: { value: option.props?.value },
328
- // });
329
- // }
330
- // },
331
- // [closeDropdown]
332
- // );
333
-
334
- /*
335
- if (React.isValidElement(child)) {
336
- if (child.type === React.Fragment) {
337
- return React.cloneElement(child, {}, React.Children.map(child.props.children, applySpacingStyle));
338
- }
339
- return React.cloneElement(child, {
340
- spacingStyle: child.props.spacingStyle || itemSpacingStyle,
341
- });
342
- }
343
- */
344
- // Esto preguntar a Anxo, tiene que pillar tb fragment con fragment y/o sin fragment. (EJ documentCardFile de ovac)
345
- // const enhancedItems = React.useMemo(
346
- // () => React.Children.map(items, (child, index) => {
347
- // if (React.isValidElement(child)) {
348
- // return React.cloneElement(child, {
349
- // key: `${child.props.children}-${index}`,
350
- // onClick: event => handleOptionClick(child, event),
351
- // });
352
- // }
353
- // return child;
354
- // }),
355
- // [items, handleOptionClick]
356
- // );
357
-
323
+ }, [isOpen, adjustPopoverPosition, debouncedAdjustPopoverPosition, isVisible]);
358
324
 
359
325
  var handleOptionClick = _react.default.useCallback(function (option, event) {
360
326
  event === null || event === void 0 ? void 0 : event.preventDefault();
@@ -368,29 +334,8 @@ var DropDown = function DropDown(_ref2) {
368
334
  }
369
335
  }, [closeDropdown]);
370
336
 
371
- var enhanceChild = function enhanceChild(child, index) {
372
- if ( /*#__PURE__*/_react.default.isValidElement(child)) {
373
- if (child.type === _react.default.Fragment) {
374
- return enhanceNode(child.props.children);
375
- }
376
-
377
- return /*#__PURE__*/_react.default.cloneElement(child, {
378
- key: child.key || index,
379
- onClick: function onClick(event) {
380
- return handleOptionClick(child, event);
381
- }
382
- });
383
- }
384
-
385
- return child;
386
- };
387
-
388
- var enhanceNode = function enhanceNode(node) {
389
- return _react.default.Children.map(node, enhanceChild);
390
- };
391
-
392
337
  var enhancedItems = _react.default.useMemo(function () {
393
- return enhanceNode(items);
338
+ return (0, _utils.enhanceClickableChildren)(items, handleOptionClick);
394
339
  }, [items, handleOptionClick]);
395
340
 
396
341
  return /*#__PURE__*/_react.default.createElement("div", _extends({
@@ -38,7 +38,7 @@
38
38
  overflow: hidden auto;
39
39
  min-width: 1rem;
40
40
  min-height: 1rem;
41
- max-height: calc(100% - 2rem);
41
+ max-height: calc(45%);
42
42
  max-width: calc(100% - 2rem);
43
43
  outline: 0px;
44
44
  opacity: 1;