@appquality/unguess-design-system 2.12.55 → 2.12.56

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v2.12.56 (Mon Jan 16 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Multiselect fixes [#176](https://github.com/AppQuality/unguess-design-system/pull/176) ([@cannarocks](https://github.com/cannarocks))
6
+
7
+ #### Authors: 1
8
+
9
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
10
+
11
+ ---
12
+
1
13
  # v2.12.55 (Mon Jan 16 2023)
2
14
 
3
15
  #### 🐛 Bug Fix
package/build/index.js CHANGED
@@ -3608,6 +3608,9 @@ const DisabledItem = ({ label }) => (jsxRuntime.jsx(reactDropdowns.Item, Object.
3608
3608
  const MultiSelect = ({ options, selectedItems, onChange, creatable, i18n, maxItems, size, menuHeight, }) => {
3609
3609
  var _a, _b, _c;
3610
3610
  const { isLoading, currentSelectedItems, matchingOptions, inputValue, setInputValue, selectItems, } = useOptions({ options, selectedItems, onChange });
3611
+ React.useEffect(() => {
3612
+ selectItems(selectedItems || []);
3613
+ }, [options, selectedItems]);
3611
3614
  const itemToString = (item) => (item ? item.id : "");
3612
3615
  return (jsxRuntime.jsx("div", Object.assign({ style: isLoading ? { pointerEvents: "none", opacity: "0.3" } : {} }, { children: jsxRuntime.jsxs(reactDropdowns.Dropdown, Object.assign({ inputValue: inputValue, selectedItems: currentSelectedItems, onSelect: (items) => selectItems(items), downshiftProps: { itemToString }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(reactDropdowns.Field, { children: [jsxRuntime.jsx(reactDropdowns.Label, Object.assign({ hidden: true }, { children: (_a = i18n === null || i18n === void 0 ? void 0 : i18n.label) !== null && _a !== void 0 ? _a : "Multiselect" })), jsxRuntime.jsx(reactDropdowns.Multiselect, { placeholder: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.placeholder) !== null && _b !== void 0 ? _b : "Select Items", isCompact: size !== "medium", maxItems: maxItems, renderItem: ({ value }) => (jsxRuntime.jsxs(reactTags.Tag, Object.assign({ isPill: true }, { children: [jsxRuntime.jsx("span", { children: value.label }), jsxRuntime.jsx(reactTags.Tag.Close, { onClick: () => {
3613
3616
  selectItems(currentSelectedItems.filter((item) => item.id !== value.id));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "2.12.55",
3
+ "version": "2.12.56",
4
4
  "dependencies": {
5
5
  "@nivo/bar": "^0.80.0",
6
6
  "@nivo/bullet": "^0.80.0",