@thecb/components 6.0.0-beta.4 → 6.0.0-beta.7
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 +46 -35
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +46 -35
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/country-dropdown/CountryDropdown.js +1 -0
- package/src/components/atoms/dropdown/Dropdown.js +25 -8
- package/src/components/atoms/form-select/FormSelect.js +3 -1
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +1 -0
package/dist/index.cjs.js
CHANGED
|
@@ -19446,32 +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
|
-
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;
|
|
19475
19474
|
|
|
19476
19475
|
var _useState = React.useState(""),
|
|
19477
19476
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19623,7 +19622,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19623
19622
|
clearTimeout(timer);
|
|
19624
19623
|
setTimer(setTimeout(function () {
|
|
19625
19624
|
return setInputValue("");
|
|
19626
|
-
},
|
|
19625
|
+
}, 5000));
|
|
19627
19626
|
}
|
|
19628
19627
|
|
|
19629
19628
|
setFilteredOptions(options.filter(function (option) {
|
|
@@ -19632,6 +19631,8 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19632
19631
|
}, [inputValue]);
|
|
19633
19632
|
React.useEffect(function () {
|
|
19634
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);
|
|
19635
19636
|
onSelect(filteredOptions[0].value);
|
|
19636
19637
|
}
|
|
19637
19638
|
|
|
@@ -19663,11 +19664,13 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19663
19664
|
borderSize: "1px",
|
|
19664
19665
|
borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
|
|
19665
19666
|
borderRadius: "2px",
|
|
19667
|
+
tabIndex: 0,
|
|
19666
19668
|
dataQa: placeholder,
|
|
19667
19669
|
extraStyles: "height: 48px;\n ".concat(disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;", "\n ")
|
|
19668
19670
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
19669
19671
|
direction: "row",
|
|
19670
|
-
bottomItem: 2
|
|
19672
|
+
bottomItem: 2,
|
|
19673
|
+
extraStyles: "position: relative;"
|
|
19671
19674
|
}, /*#__PURE__*/React__default.createElement(SearchInput, {
|
|
19672
19675
|
"aria-label": getSelection(),
|
|
19673
19676
|
placeholder: getSelection(),
|
|
@@ -19680,7 +19683,10 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19680
19683
|
"aria-autocomplete": "list",
|
|
19681
19684
|
"aria-controls": "".concat(ariaLabelledby, "_listbox"),
|
|
19682
19685
|
"aria-activedescendant": "selected_option",
|
|
19683
|
-
|
|
19686
|
+
isOpen: isOpen,
|
|
19687
|
+
tabIndex: -1,
|
|
19688
|
+
name: autocompleteValue,
|
|
19689
|
+
autocomplete: autocompleteValue
|
|
19684
19690
|
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
19685
19691
|
open: isOpen
|
|
19686
19692
|
}, /*#__PURE__*/React__default.createElement(DropdownIcon, null)))), isOpen ? /*#__PURE__*/React__default.createElement(DropdownContentWrapper, {
|
|
@@ -19694,7 +19700,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19694
19700
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
19695
19701
|
childGap: "0"
|
|
19696
19702
|
}, filteredOptions.map(function (choice, i) {
|
|
19697
|
-
if (
|
|
19703
|
+
if (choice.value === value && selectedRef !== optionRefs.current[i]) {
|
|
19698
19704
|
setSelectedRef(optionRefs.current[i]);
|
|
19699
19705
|
}
|
|
19700
19706
|
|
|
@@ -19707,7 +19713,8 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19707
19713
|
onClick: disabledValues.includes(choice.value) ? function (evt) {
|
|
19708
19714
|
return evt.preventDefault();
|
|
19709
19715
|
} : function () {
|
|
19710
|
-
|
|
19716
|
+
setSelectedRef(optionRefs.current[i]);
|
|
19717
|
+
onSelect(choice.value);
|
|
19711
19718
|
},
|
|
19712
19719
|
selected: choice.value === value,
|
|
19713
19720
|
"aria-selected": choice.value === value,
|
|
@@ -19822,7 +19829,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
19822
19829
|
disabled = _ref.disabled,
|
|
19823
19830
|
themeValues = _ref.themeValues,
|
|
19824
19831
|
_ref$hasTitles = _ref.hasTitles,
|
|
19825
|
-
hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles
|
|
19832
|
+
hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles,
|
|
19833
|
+
autocompleteValue = _ref.autocompleteValue;
|
|
19826
19834
|
|
|
19827
19835
|
var _useState = React.useState(false),
|
|
19828
19836
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19877,7 +19885,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
19877
19885
|
onClick: function onClick() {
|
|
19878
19886
|
return setOpen(!open);
|
|
19879
19887
|
},
|
|
19880
|
-
disabled: disabled
|
|
19888
|
+
disabled: disabled,
|
|
19889
|
+
autocompleteValue: autocompleteValue
|
|
19881
19890
|
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
19882
19891
|
direction: "row",
|
|
19883
19892
|
justify: "space-between"
|
|
@@ -20650,7 +20659,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
20650
20659
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
20651
20660
|
errorMessages: errorMessages,
|
|
20652
20661
|
showErrors: showErrors,
|
|
20653
|
-
onChange: onChange
|
|
20662
|
+
onChange: onChange,
|
|
20663
|
+
autocompleteValue: "country-name"
|
|
20654
20664
|
});
|
|
20655
20665
|
};
|
|
20656
20666
|
|
|
@@ -33066,7 +33076,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
33066
33076
|
fieldActions: fieldActions,
|
|
33067
33077
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
33068
33078
|
errorMessages: errorMessages,
|
|
33069
|
-
showErrors: showErrors
|
|
33079
|
+
showErrors: showErrors,
|
|
33080
|
+
autocompleteValue: "address-level1"
|
|
33070
33081
|
});
|
|
33071
33082
|
};
|
|
33072
33083
|
|