@thecb/components 6.0.0-beta.5 → 6.0.0-beta.8
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 +49 -37
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +49 -37
- 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 +22 -9
- package/src/components/atoms/form-select/FormSelect.js +3 -1
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +1 -0
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),
|
|
@@ -19522,6 +19520,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19522
19520
|
var onKeyDown = function onKeyDown(e) {
|
|
19523
19521
|
var _optionRefs$current$l, _optionRefs$current;
|
|
19524
19522
|
|
|
19523
|
+
console.log("key down event is", e);
|
|
19525
19524
|
var key = e.key,
|
|
19526
19525
|
keyCode = e.keyCode;
|
|
19527
19526
|
var focus = document.activeElement;
|
|
@@ -19596,11 +19595,12 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19596
19595
|
};
|
|
19597
19596
|
|
|
19598
19597
|
useEffect$1(function () {
|
|
19599
|
-
console.log("option refs in isopen useffect", optionRefs
|
|
19598
|
+
console.log("option refs in isopen useffect", optionRefs);
|
|
19599
|
+
console.log("option ref current in isopen useffect", optionRefs.current[0].current);
|
|
19600
19600
|
console.log("selected refs in isopen useffect", selectedRef);
|
|
19601
19601
|
console.log("value in isopen useffect", value);
|
|
19602
19602
|
|
|
19603
|
-
if (isOpen && selectedRef !== undefined) {
|
|
19603
|
+
if (isOpen && selectedRef !== undefined && selectedRef.current !== null) {
|
|
19604
19604
|
// WAI-ARIA requires the selected option to receive focus
|
|
19605
19605
|
selectedRef.current.focus();
|
|
19606
19606
|
} else if (isOpen && optionRefs.current[0].current) {
|
|
@@ -19616,7 +19616,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19616
19616
|
clearTimeout(timer);
|
|
19617
19617
|
setTimer(setTimeout(function () {
|
|
19618
19618
|
return setInputValue("");
|
|
19619
|
-
},
|
|
19619
|
+
}, 3000));
|
|
19620
19620
|
}
|
|
19621
19621
|
|
|
19622
19622
|
setFilteredOptions(options.filter(function (option) {
|
|
@@ -19625,6 +19625,8 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19625
19625
|
}, [inputValue]);
|
|
19626
19626
|
useEffect$1(function () {
|
|
19627
19627
|
if (!isOpen && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
|
|
19628
|
+
console.log("filtered options are", filteredOptions);
|
|
19629
|
+
console.log("option refs are", optionRefs);
|
|
19628
19630
|
onSelect(filteredOptions[0].value);
|
|
19629
19631
|
}
|
|
19630
19632
|
|
|
@@ -19661,12 +19663,15 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19661
19663
|
extraStyles: "height: 48px;\n ".concat(disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;", "\n ")
|
|
19662
19664
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
19663
19665
|
direction: "row",
|
|
19664
|
-
bottomItem: 2
|
|
19666
|
+
bottomItem: 2,
|
|
19667
|
+
extraStyles: "position: relative;"
|
|
19665
19668
|
}, /*#__PURE__*/React.createElement(SearchInput, {
|
|
19666
19669
|
"aria-label": getSelection(),
|
|
19667
19670
|
placeholder: getSelection(),
|
|
19668
19671
|
value: inputValue,
|
|
19669
|
-
onChange:
|
|
19672
|
+
onChange: function onChange(e) {
|
|
19673
|
+
console.log("input change event", e);
|
|
19674
|
+
},
|
|
19670
19675
|
themeValues: themeValues,
|
|
19671
19676
|
role: "searchbox",
|
|
19672
19677
|
type: "text",
|
|
@@ -19674,7 +19679,10 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19674
19679
|
"aria-autocomplete": "list",
|
|
19675
19680
|
"aria-controls": "".concat(ariaLabelledby, "_listbox"),
|
|
19676
19681
|
"aria-activedescendant": "selected_option",
|
|
19677
|
-
isOpen: isOpen
|
|
19682
|
+
isOpen: isOpen,
|
|
19683
|
+
tabIndex: -1,
|
|
19684
|
+
name: autocompleteValue,
|
|
19685
|
+
autocomplete: autocompleteValue
|
|
19678
19686
|
}), /*#__PURE__*/React.createElement(IconWrapper, {
|
|
19679
19687
|
open: isOpen
|
|
19680
19688
|
}, /*#__PURE__*/React.createElement(DropdownIcon, null)))), isOpen ? /*#__PURE__*/React.createElement(DropdownContentWrapper, {
|
|
@@ -19817,7 +19825,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
19817
19825
|
disabled = _ref.disabled,
|
|
19818
19826
|
themeValues = _ref.themeValues,
|
|
19819
19827
|
_ref$hasTitles = _ref.hasTitles,
|
|
19820
|
-
hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles
|
|
19828
|
+
hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles,
|
|
19829
|
+
autocompleteValue = _ref.autocompleteValue;
|
|
19821
19830
|
|
|
19822
19831
|
var _useState = useState(false),
|
|
19823
19832
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19872,7 +19881,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
19872
19881
|
onClick: function onClick() {
|
|
19873
19882
|
return setOpen(!open);
|
|
19874
19883
|
},
|
|
19875
|
-
disabled: disabled
|
|
19884
|
+
disabled: disabled,
|
|
19885
|
+
autocompleteValue: autocompleteValue
|
|
19876
19886
|
}), /*#__PURE__*/React.createElement(Stack, {
|
|
19877
19887
|
direction: "row",
|
|
19878
19888
|
justify: "space-between"
|
|
@@ -20645,7 +20655,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
20645
20655
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
20646
20656
|
errorMessages: errorMessages,
|
|
20647
20657
|
showErrors: showErrors,
|
|
20648
|
-
onChange: onChange
|
|
20658
|
+
onChange: onChange,
|
|
20659
|
+
autocompleteValue: "country-name"
|
|
20649
20660
|
});
|
|
20650
20661
|
};
|
|
20651
20662
|
|
|
@@ -33061,7 +33072,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
33061
33072
|
fieldActions: fieldActions,
|
|
33062
33073
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
33063
33074
|
errorMessages: errorMessages,
|
|
33064
|
-
showErrors: showErrors
|
|
33075
|
+
showErrors: showErrors,
|
|
33076
|
+
autocompleteValue: "address-level1"
|
|
33065
33077
|
});
|
|
33066
33078
|
};
|
|
33067
33079
|
|