@thecb/components 6.0.0-beta.14 → 6.0.0-beta.15
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
|
@@ -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;", ""], function (_ref) {
|
|
19411
|
+
})(["display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", " position:absolute;top:20px;right:12px;"], function (_ref) {
|
|
19412
19412
|
var open = _ref.open;
|
|
19413
19413
|
return open ? "transform: rotate(-180deg)" : "";
|
|
19414
19414
|
});
|
|
@@ -19529,18 +19529,14 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19529
19529
|
var onKeyDown = function onKeyDown(e) {
|
|
19530
19530
|
var _optionRefs$current$l, _optionRefs$current;
|
|
19531
19531
|
|
|
19532
|
-
console.log("
|
|
19533
|
-
console.log("key down event value is", e.target.value);
|
|
19532
|
+
console.log("current input value", inputValue);
|
|
19534
19533
|
var key = e.key,
|
|
19535
19534
|
keyCode = e.keyCode;
|
|
19536
19535
|
var focus = document.activeElement;
|
|
19537
19536
|
console.log("dropdown value is", value);
|
|
19538
|
-
console.log("focus is", focus);
|
|
19539
|
-
console.log("option refs are", optionRefs.current);
|
|
19540
19537
|
var optionEl = optionRefs.current.find(function (ref) {
|
|
19541
19538
|
return ref.current === focus;
|
|
19542
19539
|
});
|
|
19543
|
-
console.log("option el is", optionEl);
|
|
19544
19540
|
|
|
19545
19541
|
switch (key) {
|
|
19546
19542
|
case "ArrowDown":
|
|
@@ -19607,11 +19603,6 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19607
19603
|
};
|
|
19608
19604
|
|
|
19609
19605
|
React.useEffect(function () {
|
|
19610
|
-
console.log("option refs in isopen useffect", optionRefs);
|
|
19611
|
-
console.log("option ref current in isopen useffect", optionRefs.current[0].current);
|
|
19612
|
-
console.log("selected refs in isopen useffect", selectedRef);
|
|
19613
|
-
console.log("value in isopen useffect", value);
|
|
19614
|
-
|
|
19615
19606
|
if (isOpen && selectedRef !== undefined && selectedRef.current !== null) {
|
|
19616
19607
|
// WAI-ARIA requires the selected option to receive focus
|
|
19617
19608
|
selectedRef.current.focus();
|
|
@@ -19637,8 +19628,6 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19637
19628
|
}, [inputValue]);
|
|
19638
19629
|
React.useEffect(function () {
|
|
19639
19630
|
if (!isOpen && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
|
|
19640
|
-
console.log("filtered options are", filteredOptions);
|
|
19641
|
-
console.log("option refs are", optionRefs);
|
|
19642
19631
|
onSelect(filteredOptions[0].value);
|
|
19643
19632
|
}
|
|
19644
19633
|
|
|
@@ -19651,17 +19640,12 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19651
19640
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
19652
19641
|
padding: "0",
|
|
19653
19642
|
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
19643
|
extraStyles: "position: relative;",
|
|
19659
19644
|
minWidth: "100%",
|
|
19660
19645
|
onClick: function onClick() {
|
|
19661
|
-
|
|
19662
|
-
_onClick();
|
|
19663
|
-
}
|
|
19646
|
+
_onClick();
|
|
19664
19647
|
},
|
|
19648
|
+
onKeyDown: onKeyDown,
|
|
19665
19649
|
width: "100%"
|
|
19666
19650
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
19667
19651
|
direction: "row",
|
|
@@ -19686,15 +19670,15 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19686
19670
|
hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
|
|
19687
19671
|
isOpen: isOpen,
|
|
19688
19672
|
minHeight: "48px",
|
|
19689
|
-
minWidth: "
|
|
19673
|
+
minWidth: "100%",
|
|
19690
19674
|
name: autocompleteValue,
|
|
19691
|
-
onKeyDown: onKeyDown,
|
|
19692
19675
|
onFocus: function onFocus() {
|
|
19693
19676
|
if (!isOpen) {
|
|
19694
19677
|
_onClick();
|
|
19695
19678
|
}
|
|
19696
19679
|
},
|
|
19697
19680
|
onChange: function onChange(e) {
|
|
19681
|
+
console.log("current input value", inputValue);
|
|
19698
19682
|
console.log("input change event", e.target);
|
|
19699
19683
|
console.log("input change event value", e.target.value);
|
|
19700
19684
|
setInputValue(e.target.value);
|
|
@@ -19707,7 +19691,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19707
19691
|
type: "text",
|
|
19708
19692
|
tabIndex: 0,
|
|
19709
19693
|
value: inputValue,
|
|
19710
|
-
width: "
|
|
19694
|
+
width: "100%",
|
|
19711
19695
|
dataQa: placeholder
|
|
19712
19696
|
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
19713
19697
|
open: isOpen
|