@bolttech/molecules-dropdown 0.30.0 → 0.31.1

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.
Files changed (2) hide show
  1. package/index.cjs +13 -4
  2. package/package.json +3 -3
package/index.cjs CHANGED
@@ -2390,7 +2390,7 @@ const ContainerDropdown = /*#__PURE__*/styled__default["default"].section.withCo
2390
2390
  const SectionContainer = /*#__PURE__*/styled__default["default"].section.withConfig({
2391
2391
  displayName: "molecules-dropdownstyles__SectionContainer",
2392
2392
  componentId: "sc-3wugi4-2"
2393
- })(["position:relative;.errorMessage{padding-right:", ";padding-left:", ";label{color:", ";font-weight:", ";line-height:", ";font-size:", ";letter-spacing:", ";}}.helperMessage{padding-right:", ";padding-left:", ";label{color:", ";font-weight:", ";line-height:", ";font-size:", ";letter-spacing:", ";}}"], ({
2393
+ })(["position:relative;.errorMessage{padding-right:", ";padding-left:", ";label{color:", ";font-weight:", ";line-height:", ";font-size:", ";letter-spacing:", ";}}.helperMessage{padding-right:", ";padding-left:", ";margin-top:", ";label{color:", ";font-weight:", ";line-height:", ";font-size:", ";letter-spacing:", ";}}"], ({
2394
2394
  theme
2395
2395
  }) => theme.components.dropdown.paddingHorizontal, ({
2396
2396
  theme
@@ -2410,6 +2410,8 @@ const SectionContainer = /*#__PURE__*/styled__default["default"].section.withCon
2410
2410
  }) => theme.components.dropdown.paddingHorizontal, ({
2411
2411
  theme
2412
2412
  }) => theme.components.dropdown.paddingHorizontal, ({
2413
+ theme
2414
+ }) => theme.components.dropdown.gap, ({
2413
2415
  theme,
2414
2416
  $variant,
2415
2417
  disabled
@@ -2526,6 +2528,11 @@ const ReusableDropdownComponent = _a => {
2526
2528
  onFocus && onFocus(event);
2527
2529
  },
2528
2530
  onBlur: event => {
2531
+ var _a, _b;
2532
+ if ((_a = event.relatedTarget) === null || _a === void 0 ? void 0 : _a.contains(event.currentTarget)) {
2533
+ (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
2534
+ return;
2535
+ }
2529
2536
  setSelectedOptionOnInputValue();
2530
2537
  setShowSelectComponent(false);
2531
2538
  onBlur && onBlur(event);
@@ -2845,7 +2852,9 @@ const DropdownWithHeaders = /*#__PURE__*/react.forwardRef((_a, ref) => {
2845
2852
  const normalizeOptionList = () => __awaiter(void 0, void 0, void 0, function* () {
2846
2853
  return yield filterOptionsParam(inputValue, optionList, urlFilterOptions);
2847
2854
  });
2848
- normalizeOptionList().then(optionsResponse => setCurrentOptionList([...optionsResponse])).catch(error => console.error('An error happens when trying to normalize options', error));
2855
+ normalizeOptionList().then(optionsResponse => {
2856
+ setCurrentOptionList([...optionsResponse]);
2857
+ }).catch(error => console.error('An error happens when trying to normalize options', error));
2849
2858
  }
2850
2859
  }, [filterOptionsParam, optionList, urlFilterOptions, inputValue, internalSelectedOption === null || internalSelectedOption === void 0 ? void 0 : internalSelectedOption.value]);
2851
2860
  const setSelectedOptionOnInputValue = react.useCallback(() => {
@@ -2872,9 +2881,9 @@ const DropdownWithHeaders = /*#__PURE__*/react.forwardRef((_a, ref) => {
2872
2881
  }, [internalSelectedOption]);
2873
2882
  react.useEffect(() => {
2874
2883
  if (value !== (internalSelectedOption === null || internalSelectedOption === void 0 ? void 0 : internalSelectedOption.id)) {
2875
- const option = (optionList === null || optionList === void 0 ? void 0 : optionList.map(currentOptionsList => {
2884
+ const option = optionList === null || optionList === void 0 ? void 0 : optionList.map(currentOptionsList => {
2876
2885
  return currentOptionsList.options.find(option => option.id === value);
2877
- })[0]) || undefined;
2886
+ }).find(item => !!item);
2878
2887
  setInternalSelectedOption(option);
2879
2888
  setInputValue((option === null || option === void 0 ? void 0 : option.value) || '');
2880
2889
  if (!asyncOptionList) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolttech/molecules-dropdown",
3
- "version": "0.30.0",
3
+ "version": "0.31.1",
4
4
  "main": "./index.cjs",
5
5
  "type": "commonjs",
6
6
  "types": "./src/index.d.ts",
@@ -9,8 +9,8 @@
9
9
  "@bolttech/atoms-input": "0.26.0",
10
10
  "@bolttech/atoms-select": "0.22.0",
11
11
  "@bolttech/default-theme": "0.8.0",
12
- "@bolttech/form-engine": "3.0.1-beta.5",
13
- "@bolttech/frontend-foundations": "0.9.0",
12
+ "@bolttech/form-engine": "3.0.1-beta.7",
13
+ "@bolttech/frontend-foundations": "0.9.3",
14
14
  "@bolttech/ui-utils": "0.4.0",
15
15
  "react": "18.2.0",
16
16
  "react-dom": "18.2.0",