@darajs/core 1.18.10 → 1.18.11

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.
@@ -39729,10 +39729,13 @@ var __privateWrapper = (obj, member, setter, getter) => ({
39729
39729
  const unpackedItems = React.useMemo(() => unpackSectionedList(props.items), [props.items]);
39730
39730
  const [pendingHighlight, setPendingHighlight] = React.useState(null);
39731
39731
  const [items, setItems] = React.useState(unpackedItems);
39732
- const [inputValue, setInputValue] = React.useState((_b = (_a = props.selectedItem) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : "");
39732
+ const [inputValue, setInputValue] = React.useState(((_a = props.selectedItem) === null || _a === void 0 ? void 0 : _a.label) && props.selectedItem.label !== "null" ? props.selectedItem.label : (_b = props.placeholder) !== null && _b !== void 0 ? _b : "");
39733
39733
  const [kbdHighlightIdx, setKbdHighlightIdx] = React__default.default.useState();
39734
39734
  const { selectedItem, isOpen, getMenuProps, getInputProps, getToggleButtonProps, getItemProps, setHighlightedIndex } = useCombobox(Object.assign(Object.assign(Object.assign({ initialIsOpen: false, initialSelectedItem: (_c = props.initialValue) !== null && _c !== void 0 ? _c : props.selectedItem, itemToString: (item) => item ? item.label : "", items, onInputValueChange: (change) => {
39735
- setInputValue(change.inputValue);
39735
+ const shouldUpdateInput = [stateChangeTypes.ItemClick, stateChangeTypes.InputChange].includes(change.type);
39736
+ if (shouldUpdateInput) {
39737
+ setInputValue(change.inputValue);
39738
+ }
39736
39739
  if (!change.inputValue) {
39737
39740
  setItems(unpackedItems);
39738
39741
  return;
@@ -39797,10 +39800,11 @@ var __privateWrapper = (obj, member, setter, getter) => ({
39797
39800
  }
39798
39801
  }, [isOpen, pendingHighlight, setHighlightedIndex]);
39799
39802
  React.useEffect(() => {
39803
+ var _a2;
39800
39804
  if (props.selectedItem === null) {
39801
- setInputValue("");
39805
+ setInputValue((_a2 = props.placeholder) !== null && _a2 !== void 0 ? _a2 : "");
39802
39806
  }
39803
- }, [props.selectedItem]);
39807
+ }, [props.selectedItem, props.placeholder]);
39804
39808
  const { refs, floatingStyles, context: context2 } = useFloating({
39805
39809
  open: isOpen,
39806
39810
  placement: "bottom-start",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darajs/core",
3
- "version": "1.18.10",
3
+ "version": "1.18.11",
4
4
  "description": "Dara Framework core",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -37,9 +37,9 @@
37
37
  "@babel/preset-env": "^7.23.0",
38
38
  "@babel/preset-react": "^7.22.15",
39
39
  "@babel/preset-typescript": "^7.23.0",
40
- "@darajs/eslint-config": "1.18.10",
41
- "@darajs/prettier-config": "1.18.10",
42
- "@darajs/stylelint-config": "1.18.10",
40
+ "@darajs/eslint-config": "1.18.11",
41
+ "@darajs/prettier-config": "1.18.11",
42
+ "@darajs/stylelint-config": "1.18.11",
43
43
  "@rollup/plugin-inject": "^4.0.4",
44
44
  "@testing-library/dom": "^9.3.0",
45
45
  "@testing-library/jest-dom": "^5.16.5",
@@ -80,10 +80,10 @@
80
80
  "whatwg-fetch": "^3.6.2"
81
81
  },
82
82
  "dependencies": {
83
- "@darajs/styled-components": "1.18.10",
84
- "@darajs/ui-components": "1.18.10",
85
- "@darajs/ui-notifications": "1.18.10",
86
- "@darajs/ui-utils": "1.18.10",
83
+ "@darajs/styled-components": "1.18.11",
84
+ "@darajs/ui-components": "1.18.11",
85
+ "@darajs/ui-notifications": "1.18.11",
86
+ "@darajs/ui-utils": "1.18.11",
87
87
  "@fortawesome/fontawesome-free": "~6.4.0",
88
88
  "@recoiljs/refine": "^0.1.1",
89
89
  "@tanstack/query-core": "^4.0.0",
@@ -119,5 +119,5 @@
119
119
  "publishConfig": {
120
120
  "access": "public"
121
121
  },
122
- "gitHead": "c9e47a2cb3ea4cb6bb4f72823006aa4ee59e9b31"
122
+ "gitHead": "a5a688efd317878ea3a699e8d2410be5af08247e"
123
123
  }