@thecb/components 6.0.0-beta.11 → 6.0.0-beta.14
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/index.cjs.js
CHANGED
|
@@ -6380,7 +6380,7 @@ var Box = function Box(_ref) {
|
|
|
6380
6380
|
onFocus: onFocus,
|
|
6381
6381
|
onBlur: onBlur,
|
|
6382
6382
|
onTouchEnd: onTouchEnd
|
|
6383
|
-
}, rest), safeChildren(children, /*#__PURE__*/React__default.createElement(React.Fragment, null)));
|
|
6383
|
+
}, rest), children && safeChildren(children, /*#__PURE__*/React__default.createElement(React.Fragment, null)));
|
|
6384
6384
|
};
|
|
6385
6385
|
|
|
6386
6386
|
var CenterWrapper = styled__default.div.withConfig({
|
|
@@ -19415,7 +19415,7 @@ var IconWrapper = styled__default.div.withConfig({
|
|
|
19415
19415
|
var DropdownContentWrapper = styled__default.div.withConfig({
|
|
19416
19416
|
displayName: "Dropdown__DropdownContentWrapper",
|
|
19417
19417
|
componentId: "sc-pn6m0h-1"
|
|
19418
|
-
})(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}"], GREY_CHATEAU, WHITE, function (_ref2) {
|
|
19418
|
+
})(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}ul{padding-left:0;}"], GREY_CHATEAU, WHITE, function (_ref2) {
|
|
19419
19419
|
var widthFitOptions = _ref2.widthFitOptions;
|
|
19420
19420
|
return widthFitOptions ? "fit-content" : "100%";
|
|
19421
19421
|
}, function (_ref3) {
|
|
@@ -19425,7 +19425,7 @@ var DropdownContentWrapper = styled__default.div.withConfig({
|
|
|
19425
19425
|
var DropdownItemWrapper = styled__default.li.withConfig({
|
|
19426
19426
|
displayName: "Dropdown__DropdownItemWrapper",
|
|
19427
19427
|
componentId: "sc-pn6m0h-2"
|
|
19428
|
-
})(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
|
|
19428
|
+
})(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;list-style:none;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
|
|
19429
19429
|
var selected = _ref4.selected,
|
|
19430
19430
|
themeValues = _ref4.themeValues;
|
|
19431
19431
|
return selected ? themeValues.selectedColor : WHITE;
|
|
@@ -19454,7 +19454,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19454
19454
|
_ref8$disabledValues = _ref8.disabledValues,
|
|
19455
19455
|
disabledValues = _ref8$disabledValues === void 0 ? [] : _ref8$disabledValues,
|
|
19456
19456
|
_ref8$onClick = _ref8.onClick,
|
|
19457
|
-
|
|
19457
|
+
_onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
|
|
19458
19458
|
themeValues = _ref8.themeValues,
|
|
19459
19459
|
maxHeight = _ref8.maxHeight,
|
|
19460
19460
|
_ref8$widthFitOptions = _ref8.widthFitOptions,
|
|
@@ -19554,7 +19554,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19554
19554
|
break;
|
|
19555
19555
|
}
|
|
19556
19556
|
} else {
|
|
19557
|
-
|
|
19557
|
+
_onClick();
|
|
19558
19558
|
}
|
|
19559
19559
|
|
|
19560
19560
|
break;
|
|
@@ -19570,7 +19570,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19570
19570
|
break;
|
|
19571
19571
|
}
|
|
19572
19572
|
} else {
|
|
19573
|
-
|
|
19573
|
+
_onClick();
|
|
19574
19574
|
}
|
|
19575
19575
|
|
|
19576
19576
|
break;
|
|
@@ -19599,7 +19599,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19599
19599
|
|
|
19600
19600
|
case "Escape":
|
|
19601
19601
|
if (isOpen) {
|
|
19602
|
-
|
|
19602
|
+
_onClick();
|
|
19603
19603
|
}
|
|
19604
19604
|
|
|
19605
19605
|
break;
|
|
@@ -19648,10 +19648,24 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19648
19648
|
dropdownRef.current.focus();
|
|
19649
19649
|
}
|
|
19650
19650
|
}, [filteredOptions]);
|
|
19651
|
-
return /*#__PURE__*/React__default.createElement(
|
|
19651
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
19652
|
+
padding: "0",
|
|
19653
|
+
background: isOpen ? themeValues.hoverColor : WHITE,
|
|
19654
|
+
borderSize: "1px",
|
|
19655
|
+
borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
|
|
19656
|
+
borderRadius: "2px",
|
|
19657
|
+
borderWidthOverride: "0px 1px 0px 0px",
|
|
19658
|
+
extraStyles: "position: relative;",
|
|
19659
|
+
minWidth: "100%",
|
|
19660
|
+
onClick: function onClick() {
|
|
19661
|
+
if (!isOpen) {
|
|
19662
|
+
_onClick();
|
|
19663
|
+
}
|
|
19664
|
+
},
|
|
19665
|
+
width: "100%"
|
|
19666
|
+
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
19652
19667
|
direction: "row",
|
|
19653
|
-
bottomItem: 2
|
|
19654
|
-
extraStyles: "position: relative;"
|
|
19668
|
+
bottomItem: 2
|
|
19655
19669
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
19656
19670
|
as: "input",
|
|
19657
19671
|
"aria-multiline": "false",
|
|
@@ -19667,13 +19681,19 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19667
19681
|
borderRadius: "2px",
|
|
19668
19682
|
borderSize: "1px",
|
|
19669
19683
|
borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
|
|
19684
|
+
borderWidthOverride: "1px 0px 1px 1px",
|
|
19670
19685
|
extraStyles: disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;",
|
|
19671
19686
|
hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
|
|
19672
19687
|
isOpen: isOpen,
|
|
19688
|
+
minHeight: "48px",
|
|
19689
|
+
minWidth: "85%",
|
|
19673
19690
|
name: autocompleteValue,
|
|
19674
19691
|
onKeyDown: onKeyDown,
|
|
19675
|
-
|
|
19676
|
-
|
|
19692
|
+
onFocus: function onFocus() {
|
|
19693
|
+
if (!isOpen) {
|
|
19694
|
+
_onClick();
|
|
19695
|
+
}
|
|
19696
|
+
},
|
|
19677
19697
|
onChange: function onChange(e) {
|
|
19678
19698
|
console.log("input change event", e.target);
|
|
19679
19699
|
console.log("input change event value", e.target.value);
|
|
@@ -19685,9 +19705,9 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19685
19705
|
themeValues: themeValues,
|
|
19686
19706
|
title: hasTitles ? getSelection() : null,
|
|
19687
19707
|
type: "text",
|
|
19688
|
-
tabIndex:
|
|
19708
|
+
tabIndex: 0,
|
|
19689
19709
|
value: inputValue,
|
|
19690
|
-
width: "
|
|
19710
|
+
width: "85%",
|
|
19691
19711
|
dataQa: placeholder
|
|
19692
19712
|
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
19693
19713
|
open: isOpen
|