@appquality/unguess-design-system 2.12.71 → 2.12.73

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,27 @@
1
+ # v2.12.73 (Thu Feb 09 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - i18n: Allow translating showmore in multiselect [#207](https://github.com/AppQuality/unguess-design-system/pull/207) ([@d-beezee](https://github.com/d-beezee))
6
+
7
+ #### Authors: 1
8
+
9
+ - [@d-beezee](https://github.com/d-beezee)
10
+
11
+ ---
12
+
13
+ # v2.12.72 (Thu Feb 09 2023)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - Fix dropdown header item [#206](https://github.com/AppQuality/unguess-design-system/pull/206) ([@cannarocks](https://github.com/cannarocks))
18
+
19
+ #### Authors: 1
20
+
21
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
22
+
23
+ ---
24
+
1
25
  # v2.12.71 (Thu Feb 09 2023)
2
26
 
3
27
  #### 🐛 Bug Fix
package/build/index.js CHANGED
@@ -1868,6 +1868,8 @@ const StyledLabel$2 = styled__default["default"](reactForms.Label) ``;
1868
1868
  **/
1869
1869
  const Label = (props) => jsxRuntime.jsx(StyledLabel$2, Object.assign({}, props));
1870
1870
 
1871
+ const MenuHeaderItem = (props) => (jsxRuntime.jsx(reactDropdowns.HeaderItem, Object.assign({}, props)));
1872
+
1871
1873
  const UgSelect = styled__default["default"](reactDropdowns.Select) `
1872
1874
  ${(props) => props.isPrimary &&
1873
1875
  `
@@ -1894,9 +1896,12 @@ const StyledDropdown = styled__default["default"].div `
1894
1896
  display: block;
1895
1897
  }
1896
1898
  `;
1899
+ const StyledMenuHeaderItem = styled__default["default"](MenuHeaderItem) `
1900
+ pointer-events: none;
1901
+ `;
1897
1902
  const Dropdown = (props) => (jsxRuntime.jsx(StyledDropdown, { children: jsxRuntime.jsx(reactDropdowns.Dropdown, Object.assign({}, props)) }));
1898
1903
  const Message = (props) => jsxRuntime.jsx(reactDropdowns.Message, Object.assign({}, props));
1899
- Dropdown.HeaderItem = HeaderItem;
1904
+ Dropdown.HeaderItem = StyledMenuHeaderItem;
1900
1905
  Dropdown.Separator = Separator;
1901
1906
 
1902
1907
  const StyledAutocomplete = styled__default["default"](Autocomplete) `
@@ -1943,8 +1948,6 @@ const CounterMultiselect = ({ options, label, i18n, onChange, isCompact, }) => {
1943
1948
  : (_a = i18n === null || i18n === void 0 ? void 0 : i18n.noItems) !== null && _a !== void 0 ? _a : "No items" }))] }), jsxRuntime.jsx(Menu, Object.assign({ isCompact: isCompact }, { children: matchingOptions.length === 0 ? (jsxRuntime.jsx(Item$1, Object.assign({ disabled: true }, { children: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.noMatches) !== null && _b !== void 0 ? _b : "No matches found" }))) : (matchingOptions.map((option) => (jsxRuntime.jsx(Item$1, Object.assign({ value: option }, option, { children: jsxRuntime.jsx("span", { children: option.label }) }), option.itemId)))) }))] })) }));
1944
1949
  };
1945
1950
 
1946
- const MenuHeaderItem = (props) => (jsxRuntime.jsx(reactDropdowns.HeaderItem, Object.assign({}, props)));
1947
-
1948
1951
  const editorStyle = styled.css `
1949
1952
  > * + * {
1950
1953
  margin-top: 0.75em;
@@ -3652,7 +3655,7 @@ const MultiSelect = ({ options, onChange, creatable, i18n, maxItems, size, menuH
3652
3655
  setMatchingOptions(matchedOptions);
3653
3656
  }, [inputValue, options]);
3654
3657
  return (jsxRuntime.jsxs(Dropdown, Object.assign({ inputValue: inputValue, selectedItems: options.filter((option) => option.selected), onSelect: (items) => onChange &&
3655
- onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: items.some((i) => i.id === o.id) })))), downshiftProps: { itemToString }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [jsxRuntime.jsx(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: () => onChange &&
3658
+ onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: items.some((i) => i.id === o.id) })))), downshiftProps: { itemToString }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [jsxRuntime.jsx(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", renderShowMore: i18n === null || i18n === void 0 ? void 0 : i18n.showMore, 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: () => onChange &&
3656
3659
  onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: o.selected && o.id !== value.id })))) })] }))) })] }), jsxRuntime.jsxs(Menu, { children: [jsxRuntime.jsxs("div", Object.assign({ style: { maxHeight: menuHeight !== null && menuHeight !== void 0 ? menuHeight : "200px" } }, { children: [matchingOptions.map((option) => {
3657
3660
  const items = options
3658
3661
  .filter((o) => o.selected)
@@ -13,7 +13,7 @@ import { SelectArgs, DropdownArgs, MessageArgs } from "./_types";
13
13
  declare const Select: (props: SelectArgs) => JSX.Element;
14
14
  declare const Dropdown: {
15
15
  (props: PropsWithChildren<DropdownArgs>): JSX.Element;
16
- HeaderItem: (props: import("../../navigation/header/header-item/_types").HeaderItemArgs) => JSX.Element;
16
+ HeaderItem: import("styled-components").StyledComponent<(props: import("../menuheader/_types").HeaderItemArgs) => JSX.Element, any, {}, never>;
17
17
  Separator: (props: import("react").LiHTMLAttributes<HTMLLIElement>) => JSX.Element;
18
18
  };
19
19
  declare const Message: (props: MessageArgs) => JSX.Element;
@@ -18,7 +18,7 @@ export declare const Default: Story<MenuStoryArgs>;
18
18
  export declare const Validation: Story<MenuStoryArgs>;
19
19
  declare const _default: ComponentMeta<{
20
20
  (props: import("react").PropsWithChildren<DropdownArgs>): JSX.Element;
21
- HeaderItem: (props: import("../../navigation/header/header-item/_types").HeaderItemArgs) => JSX.Element;
21
+ HeaderItem: import("styled-components").StyledComponent<(props: import("../menuheader/_types").HeaderItemArgs) => JSX.Element, any, {}, never>;
22
22
  Separator: (props: import("react").LiHTMLAttributes<HTMLLIElement>) => JSX.Element;
23
23
  }>;
24
24
  export default _default;
@@ -16,6 +16,7 @@ export declare type MultiSelectProps = {
16
16
  label?: string;
17
17
  noMatches?: string;
18
18
  addNew?: (value: string) => string;
19
+ showMore?: (value: number) => string;
19
20
  };
20
21
  };
21
22
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "2.12.71",
3
+ "version": "2.12.73",
4
4
  "dependencies": {
5
5
  "@nivo/bar": "^0.80.0",
6
6
  "@nivo/bullet": "^0.80.0",