@thecb/components 6.0.0-beta.5 → 6.0.0-beta.6
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 +33 -29
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +33 -29
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/dropdown/Dropdown.js +14 -5
package/dist/index.esm.js
CHANGED
|
@@ -19438,33 +19438,31 @@ var DropdownItemWrapper = styled.div.withConfig({
|
|
|
19438
19438
|
var SearchInput = styled.input.withConfig({
|
|
19439
19439
|
displayName: "Dropdown__SearchInput",
|
|
19440
19440
|
componentId: "sc-pn6m0h-3"
|
|
19441
|
-
})(["border:none;background-color:
|
|
19442
|
-
|
|
19443
|
-
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
|
|
19463
|
-
|
|
19464
|
-
|
|
19465
|
-
|
|
19466
|
-
autoEraseTypeAhead = _ref9$autoEraseTypeAh === void 0 ? true : _ref9$autoEraseTypeAh,
|
|
19467
|
-
ariaLabelledby = _ref9.ariaLabelledby;
|
|
19441
|
+
})(["border:none;background-color:transparent;font-size:16px;height:24px;min-width:80%;"]);
|
|
19442
|
+
|
|
19443
|
+
var Dropdown = function Dropdown(_ref8) {
|
|
19444
|
+
var placeholder = _ref8.placeholder,
|
|
19445
|
+
options = _ref8.options,
|
|
19446
|
+
value = _ref8.value,
|
|
19447
|
+
isOpen = _ref8.isOpen,
|
|
19448
|
+
isError = _ref8.isError,
|
|
19449
|
+
onSelect = _ref8.onSelect,
|
|
19450
|
+
_ref8$disabledValues = _ref8.disabledValues,
|
|
19451
|
+
disabledValues = _ref8$disabledValues === void 0 ? [] : _ref8$disabledValues,
|
|
19452
|
+
_ref8$onClick = _ref8.onClick,
|
|
19453
|
+
onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
|
|
19454
|
+
themeValues = _ref8.themeValues,
|
|
19455
|
+
maxHeight = _ref8.maxHeight,
|
|
19456
|
+
_ref8$widthFitOptions = _ref8.widthFitOptions,
|
|
19457
|
+
widthFitOptions = _ref8$widthFitOptions === void 0 ? false : _ref8$widthFitOptions,
|
|
19458
|
+
disabled = _ref8.disabled,
|
|
19459
|
+
_ref8$hasTitles = _ref8.hasTitles,
|
|
19460
|
+
hasTitles = _ref8$hasTitles === void 0 ? false : _ref8$hasTitles,
|
|
19461
|
+
_ref8$autoEraseTypeAh = _ref8.autoEraseTypeAhead,
|
|
19462
|
+
autoEraseTypeAhead = _ref8$autoEraseTypeAh === void 0 ? true : _ref8$autoEraseTypeAh,
|
|
19463
|
+
ariaLabelledby = _ref8.ariaLabelledby,
|
|
19464
|
+
_ref8$autocompleteVal = _ref8.autocompleteValue,
|
|
19465
|
+
autocompleteValue = _ref8$autocompleteVal === void 0 ? "" : _ref8$autocompleteVal;
|
|
19468
19466
|
|
|
19469
19467
|
var _useState = useState(""),
|
|
19470
19468
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19625,6 +19623,8 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19625
19623
|
}, [inputValue]);
|
|
19626
19624
|
useEffect$1(function () {
|
|
19627
19625
|
if (!isOpen && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
|
|
19626
|
+
console.log("filtered options are", filteredOptions);
|
|
19627
|
+
console.log("option refs are", optionRefs);
|
|
19628
19628
|
onSelect(filteredOptions[0].value);
|
|
19629
19629
|
}
|
|
19630
19630
|
|
|
@@ -19661,7 +19661,8 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19661
19661
|
extraStyles: "height: 48px;\n ".concat(disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;", "\n ")
|
|
19662
19662
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
19663
19663
|
direction: "row",
|
|
19664
|
-
bottomItem: 2
|
|
19664
|
+
bottomItem: 2,
|
|
19665
|
+
extraStyles: "position: relative;"
|
|
19665
19666
|
}, /*#__PURE__*/React.createElement(SearchInput, {
|
|
19666
19667
|
"aria-label": getSelection(),
|
|
19667
19668
|
placeholder: getSelection(),
|
|
@@ -19674,7 +19675,10 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19674
19675
|
"aria-autocomplete": "list",
|
|
19675
19676
|
"aria-controls": "".concat(ariaLabelledby, "_listbox"),
|
|
19676
19677
|
"aria-activedescendant": "selected_option",
|
|
19677
|
-
isOpen: isOpen
|
|
19678
|
+
isOpen: isOpen,
|
|
19679
|
+
tabIndex: -1,
|
|
19680
|
+
name: autocompleteValue,
|
|
19681
|
+
autocomplete: autocompleteValue
|
|
19678
19682
|
}), /*#__PURE__*/React.createElement(IconWrapper, {
|
|
19679
19683
|
open: isOpen
|
|
19680
19684
|
}, /*#__PURE__*/React.createElement(DropdownIcon, null)))), isOpen ? /*#__PURE__*/React.createElement(DropdownContentWrapper, {
|