@symply.io/basic-components 1.8.1 → 1.8.2-alpha.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.
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import ThemeProvider from "@mui/material/styles/ThemeProvider";
25
25
  import Checkbox from "@mui/material/Checkbox";
26
26
  import TextField from "@mui/material/TextField";
@@ -51,9 +51,10 @@ function AutocompleteWithFilter(props) {
51
51
  }
52
52
  return opt.label === val.label;
53
53
  }, renderOption: function (props, option, _a) {
54
- var _b, _c;
54
+ var _b;
55
55
  var selected = _a.selected;
56
- return (_jsxs("li", __assign({}, __assign(__assign({}, props), { key: (_c = (_b = option.value) !== null && _b !== void 0 ? _b : option.label) !== null && _c !== void 0 ? _c : option }), { children: [_jsx(Checkbox, { icon: icon, color: "primary", checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }), option.label || ""] })));
56
+ var label = option.label, value = option.value, hideCheckbox = option.hideCheckbox;
57
+ return (_jsxs("li", __assign({}, __assign(__assign({}, props), { key: (_b = value !== null && value !== void 0 ? value : label) !== null && _b !== void 0 ? _b : option }), { children: [!hideCheckbox ? (_jsx(Checkbox, { icon: icon, color: "primary", checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected })) : (_jsx(_Fragment, {})), label || ""] })));
57
58
  }, renderInput: function (params) { return (_jsx(TextField, __assign({}, params, rest, { variant: "outlined", required: required, inputProps: __assign(__assign({}, params.inputProps), { required: required &&
58
59
  (Array.isArray(value) ? value.length === 0 : !value) }) }))); } }) })));
59
60
  }
@@ -4,6 +4,7 @@ import type { AutocompleteValue } from "@mui/base/AutocompleteUnstyled";
4
4
  export declare type AutocompleteWithFilterOptionType<T> = T & {
5
5
  label: string;
6
6
  value?: string | number;
7
+ hideCheckbox?: boolean;
7
8
  };
8
9
  export declare type AutocompleteWithFilterValueType<T, multiple extends boolean | undefined> = multiple extends false | undefined ? AutocompleteWithFilterOptionType<T> | null : Array<AutocompleteWithFilterOptionType<T>>;
9
10
  export interface AutocompleteWithFilterProps<T, multiple extends boolean | undefined> extends Omit<TextFieldProps, "onChange" | "value" | "disabled"> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symply.io/basic-components",
3
- "version": "1.8.1",
3
+ "version": "1.8.2-alpha.1",
4
4
  "description": "Basic and reusable components for all frontend of Symply apps",
5
5
  "keywords": [
6
6
  "react",