@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.esm.js
CHANGED
|
@@ -19400,7 +19400,7 @@ var fallbackValues$e = {
|
|
|
19400
19400
|
var IconWrapper = styled.div.withConfig({
|
|
19401
19401
|
displayName: "Dropdown__IconWrapper",
|
|
19402
19402
|
componentId: "sc-pn6m0h-0"
|
|
19403
|
-
})(["display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", ""], function (_ref) {
|
|
19403
|
+
})(["display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", " position:absolute;top:20px;right:12px;"], function (_ref) {
|
|
19404
19404
|
var open = _ref.open;
|
|
19405
19405
|
return open ? "transform: rotate(-180deg)" : "";
|
|
19406
19406
|
});
|
|
@@ -19521,18 +19521,14 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19521
19521
|
var onKeyDown = function onKeyDown(e) {
|
|
19522
19522
|
var _optionRefs$current$l, _optionRefs$current;
|
|
19523
19523
|
|
|
19524
|
-
console.log("
|
|
19525
|
-
console.log("key down event value is", e.target.value);
|
|
19524
|
+
console.log("current input value", inputValue);
|
|
19526
19525
|
var key = e.key,
|
|
19527
19526
|
keyCode = e.keyCode;
|
|
19528
19527
|
var focus = document.activeElement;
|
|
19529
19528
|
console.log("dropdown value is", value);
|
|
19530
|
-
console.log("focus is", focus);
|
|
19531
|
-
console.log("option refs are", optionRefs.current);
|
|
19532
19529
|
var optionEl = optionRefs.current.find(function (ref) {
|
|
19533
19530
|
return ref.current === focus;
|
|
19534
19531
|
});
|
|
19535
|
-
console.log("option el is", optionEl);
|
|
19536
19532
|
|
|
19537
19533
|
switch (key) {
|
|
19538
19534
|
case "ArrowDown":
|
|
@@ -19599,11 +19595,6 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19599
19595
|
};
|
|
19600
19596
|
|
|
19601
19597
|
useEffect$1(function () {
|
|
19602
|
-
console.log("option refs in isopen useffect", optionRefs);
|
|
19603
|
-
console.log("option ref current in isopen useffect", optionRefs.current[0].current);
|
|
19604
|
-
console.log("selected refs in isopen useffect", selectedRef);
|
|
19605
|
-
console.log("value in isopen useffect", value);
|
|
19606
|
-
|
|
19607
19598
|
if (isOpen && selectedRef !== undefined && selectedRef.current !== null) {
|
|
19608
19599
|
// WAI-ARIA requires the selected option to receive focus
|
|
19609
19600
|
selectedRef.current.focus();
|
|
@@ -19629,8 +19620,6 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19629
19620
|
}, [inputValue]);
|
|
19630
19621
|
useEffect$1(function () {
|
|
19631
19622
|
if (!isOpen && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
|
|
19632
|
-
console.log("filtered options are", filteredOptions);
|
|
19633
|
-
console.log("option refs are", optionRefs);
|
|
19634
19623
|
onSelect(filteredOptions[0].value);
|
|
19635
19624
|
}
|
|
19636
19625
|
|
|
@@ -19643,17 +19632,12 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19643
19632
|
return /*#__PURE__*/React.createElement(Box, {
|
|
19644
19633
|
padding: "0",
|
|
19645
19634
|
background: isOpen ? themeValues.hoverColor : WHITE,
|
|
19646
|
-
borderSize: "1px",
|
|
19647
|
-
borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
|
|
19648
|
-
borderRadius: "2px",
|
|
19649
|
-
borderWidthOverride: "0px 1px 0px 0px",
|
|
19650
19635
|
extraStyles: "position: relative;",
|
|
19651
19636
|
minWidth: "100%",
|
|
19652
19637
|
onClick: function onClick() {
|
|
19653
|
-
|
|
19654
|
-
_onClick();
|
|
19655
|
-
}
|
|
19638
|
+
_onClick();
|
|
19656
19639
|
},
|
|
19640
|
+
onKeyDown: onKeyDown,
|
|
19657
19641
|
width: "100%"
|
|
19658
19642
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
19659
19643
|
direction: "row",
|
|
@@ -19678,15 +19662,15 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19678
19662
|
hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
|
|
19679
19663
|
isOpen: isOpen,
|
|
19680
19664
|
minHeight: "48px",
|
|
19681
|
-
minWidth: "
|
|
19665
|
+
minWidth: "100%",
|
|
19682
19666
|
name: autocompleteValue,
|
|
19683
|
-
onKeyDown: onKeyDown,
|
|
19684
19667
|
onFocus: function onFocus() {
|
|
19685
19668
|
if (!isOpen) {
|
|
19686
19669
|
_onClick();
|
|
19687
19670
|
}
|
|
19688
19671
|
},
|
|
19689
19672
|
onChange: function onChange(e) {
|
|
19673
|
+
console.log("current input value", inputValue);
|
|
19690
19674
|
console.log("input change event", e.target);
|
|
19691
19675
|
console.log("input change event value", e.target.value);
|
|
19692
19676
|
setInputValue(e.target.value);
|
|
@@ -19699,7 +19683,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
19699
19683
|
type: "text",
|
|
19700
19684
|
tabIndex: 0,
|
|
19701
19685
|
value: inputValue,
|
|
19702
|
-
width: "
|
|
19686
|
+
width: "100%",
|
|
19703
19687
|
dataQa: placeholder
|
|
19704
19688
|
}), /*#__PURE__*/React.createElement(IconWrapper, {
|
|
19705
19689
|
open: isOpen
|