@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.cjs.js
CHANGED
|
@@ -19446,33 +19446,31 @@ var DropdownItemWrapper = styled__default.div.withConfig({
|
|
|
19446
19446
|
var SearchInput = styled__default.input.withConfig({
|
|
19447
19447
|
displayName: "Dropdown__SearchInput",
|
|
19448
19448
|
componentId: "sc-pn6m0h-3"
|
|
19449
|
-
})(["border:none;background-color:
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
|
|
19463
|
-
|
|
19464
|
-
|
|
19465
|
-
|
|
19466
|
-
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
|
|
19471
|
-
|
|
19472
|
-
|
|
19473
|
-
|
|
19474
|
-
autoEraseTypeAhead = _ref9$autoEraseTypeAh === void 0 ? true : _ref9$autoEraseTypeAh,
|
|
19475
|
-
ariaLabelledby = _ref9.ariaLabelledby;
|
|
19449
|
+
})(["border:none;background-color:transparent;font-size:16px;height:24px;min-width:80%;"]);
|
|
19450
|
+
|
|
19451
|
+
var Dropdown = function Dropdown(_ref8) {
|
|
19452
|
+
var placeholder = _ref8.placeholder,
|
|
19453
|
+
options = _ref8.options,
|
|
19454
|
+
value = _ref8.value,
|
|
19455
|
+
isOpen = _ref8.isOpen,
|
|
19456
|
+
isError = _ref8.isError,
|
|
19457
|
+
onSelect = _ref8.onSelect,
|
|
19458
|
+
_ref8$disabledValues = _ref8.disabledValues,
|
|
19459
|
+
disabledValues = _ref8$disabledValues === void 0 ? [] : _ref8$disabledValues,
|
|
19460
|
+
_ref8$onClick = _ref8.onClick,
|
|
19461
|
+
onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
|
|
19462
|
+
themeValues = _ref8.themeValues,
|
|
19463
|
+
maxHeight = _ref8.maxHeight,
|
|
19464
|
+
_ref8$widthFitOptions = _ref8.widthFitOptions,
|
|
19465
|
+
widthFitOptions = _ref8$widthFitOptions === void 0 ? false : _ref8$widthFitOptions,
|
|
19466
|
+
disabled = _ref8.disabled,
|
|
19467
|
+
_ref8$hasTitles = _ref8.hasTitles,
|
|
19468
|
+
hasTitles = _ref8$hasTitles === void 0 ? false : _ref8$hasTitles,
|
|
19469
|
+
_ref8$autoEraseTypeAh = _ref8.autoEraseTypeAhead,
|
|
19470
|
+
autoEraseTypeAhead = _ref8$autoEraseTypeAh === void 0 ? true : _ref8$autoEraseTypeAh,
|
|
19471
|
+
ariaLabelledby = _ref8.ariaLabelledby,
|
|
19472
|
+
_ref8$autocompleteVal = _ref8.autocompleteValue,
|
|
19473
|
+
autocompleteValue = _ref8$autocompleteVal === void 0 ? "" : _ref8$autocompleteVal;
|
|
19476
19474
|
|
|
19477
19475
|
var _useState = React.useState(""),
|
|
19478
19476
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19633,6 +19631,8 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19633
19631
|
}, [inputValue]);
|
|
19634
19632
|
React.useEffect(function () {
|
|
19635
19633
|
if (!isOpen && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
|
|
19634
|
+
console.log("filtered options are", filteredOptions);
|
|
19635
|
+
console.log("option refs are", optionRefs);
|
|
19636
19636
|
onSelect(filteredOptions[0].value);
|
|
19637
19637
|
}
|
|
19638
19638
|
|
|
@@ -19669,7 +19669,8 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19669
19669
|
extraStyles: "height: 48px;\n ".concat(disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;", "\n ")
|
|
19670
19670
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
19671
19671
|
direction: "row",
|
|
19672
|
-
bottomItem: 2
|
|
19672
|
+
bottomItem: 2,
|
|
19673
|
+
extraStyles: "position: relative;"
|
|
19673
19674
|
}, /*#__PURE__*/React__default.createElement(SearchInput, {
|
|
19674
19675
|
"aria-label": getSelection(),
|
|
19675
19676
|
placeholder: getSelection(),
|
|
@@ -19682,7 +19683,10 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19682
19683
|
"aria-autocomplete": "list",
|
|
19683
19684
|
"aria-controls": "".concat(ariaLabelledby, "_listbox"),
|
|
19684
19685
|
"aria-activedescendant": "selected_option",
|
|
19685
|
-
isOpen: isOpen
|
|
19686
|
+
isOpen: isOpen,
|
|
19687
|
+
tabIndex: -1,
|
|
19688
|
+
name: autocompleteValue,
|
|
19689
|
+
autocomplete: autocompleteValue
|
|
19686
19690
|
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
19687
19691
|
open: isOpen
|
|
19688
19692
|
}, /*#__PURE__*/React__default.createElement(DropdownIcon, null)))), isOpen ? /*#__PURE__*/React__default.createElement(DropdownContentWrapper, {
|