@thecb/components 6.0.0-beta.15 → 6.0.0-beta.16
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 +16 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +16 -8
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/dropdown/Dropdown.js +65 -59
package/dist/index.cjs.js
CHANGED
|
@@ -19408,7 +19408,7 @@ var fallbackValues$e = {
|
|
|
19408
19408
|
var IconWrapper = styled__default.div.withConfig({
|
|
19409
19409
|
displayName: "Dropdown__IconWrapper",
|
|
19410
19410
|
componentId: "sc-pn6m0h-0"
|
|
19411
|
-
})(["display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", "
|
|
19411
|
+
})(["position:absolute;display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", " top:20px;right:12px;"], function (_ref) {
|
|
19412
19412
|
var open = _ref.open;
|
|
19413
19413
|
return open ? "transform: rotate(-180deg)" : "";
|
|
19414
19414
|
});
|
|
@@ -19542,6 +19542,10 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19542
19542
|
case "ArrowDown":
|
|
19543
19543
|
e.preventDefault();
|
|
19544
19544
|
|
|
19545
|
+
if (!isOpen) {
|
|
19546
|
+
_onClick();
|
|
19547
|
+
}
|
|
19548
|
+
|
|
19545
19549
|
if (optionEl) {
|
|
19546
19550
|
if (optionEl.current.nextElementSibling) {
|
|
19547
19551
|
optionEl.current.nextElementSibling.focus();
|
|
@@ -19600,6 +19604,11 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19600
19604
|
|
|
19601
19605
|
break;
|
|
19602
19606
|
}
|
|
19607
|
+
|
|
19608
|
+
if (keyCode > 64 && keyCode < 91 || keyCode == 32 || keyCode == 189) {
|
|
19609
|
+
e.preventDefault();
|
|
19610
|
+
setInputValue(inputValue + key);
|
|
19611
|
+
}
|
|
19603
19612
|
};
|
|
19604
19613
|
|
|
19605
19614
|
React.useEffect(function () {
|
|
@@ -19643,13 +19652,12 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19643
19652
|
extraStyles: "position: relative;",
|
|
19644
19653
|
minWidth: "100%",
|
|
19645
19654
|
onClick: function onClick() {
|
|
19646
|
-
|
|
19655
|
+
if (!isOpen) {
|
|
19656
|
+
_onClick();
|
|
19657
|
+
}
|
|
19647
19658
|
},
|
|
19648
19659
|
onKeyDown: onKeyDown,
|
|
19649
19660
|
width: "100%"
|
|
19650
|
-
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
19651
|
-
direction: "row",
|
|
19652
|
-
bottomItem: 2
|
|
19653
19661
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
19654
19662
|
as: "input",
|
|
19655
19663
|
"aria-multiline": "false",
|
|
@@ -19665,7 +19673,6 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19665
19673
|
borderRadius: "2px",
|
|
19666
19674
|
borderSize: "1px",
|
|
19667
19675
|
borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
|
|
19668
|
-
borderWidthOverride: "1px 0px 1px 1px",
|
|
19669
19676
|
extraStyles: disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;",
|
|
19670
19677
|
hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
|
|
19671
19678
|
isOpen: isOpen,
|
|
@@ -19694,8 +19701,9 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19694
19701
|
width: "100%",
|
|
19695
19702
|
dataQa: placeholder
|
|
19696
19703
|
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
19697
|
-
open: isOpen
|
|
19698
|
-
|
|
19704
|
+
open: isOpen,
|
|
19705
|
+
onClick: _onClick
|
|
19706
|
+
}, /*#__PURE__*/React__default.createElement(DropdownIcon, null)), /*#__PURE__*/React__default.createElement(React.Fragment, null, isOpen ? /*#__PURE__*/React__default.createElement(DropdownContentWrapper, {
|
|
19699
19707
|
maxHeight: maxHeight,
|
|
19700
19708
|
open: isOpen,
|
|
19701
19709
|
ref: dropdownRef,
|