@symply.io/basic-components 1.0.0-alpha.7 → 1.0.0-alpha.8
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,10 +20,10 @@ import ThemeProvider from "@mui/material/styles/ThemeProvider";
|
|
20
20
|
import useInteractions from "./useInteractions";
|
21
21
|
import useCustomTheme from "../useCustomTheme";
|
22
22
|
function MultipleSelector(props) {
|
23
|
-
var name = props.name, label = props.label, _a = props.variant, variant = _a === void 0 ? "outlined" : _a, value = props.value, tooltip = props.tooltip, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.multiple, multiple = _c === void 0 ? false : _c, _d = props.showHelperText, showHelperText = _d === void 0 ? false : _d, helperText = props.helperText, _e = props.error, error = _e === void 0 ? false : _e, _f = props.options, options = _f === void 0 ? [] : _f, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, onChange = props.onChange;
|
23
|
+
var name = props.name, label = props.label, _a = props.variant, variant = _a === void 0 ? "outlined" : _a, value = props.value, tooltip = props.tooltip, size = props.size, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.multiple, multiple = _c === void 0 ? false : _c, _d = props.showHelperText, showHelperText = _d === void 0 ? false : _d, helperText = props.helperText, _e = props.error, error = _e === void 0 ? false : _e, _f = props.options, options = _f === void 0 ? [] : _f, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, fullWidth = props.fullWidth, onChange = props.onChange;
|
24
24
|
var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
|
25
25
|
var _g = useInteractions(), tooltipOpen = _g.tooltipOpen, onOpenTooltip = _g.onOpenTooltip, onCloseTooltip = _g.onCloseTooltip;
|
26
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Tooltip, __assign({ title: tooltip !== null && tooltip !== void 0 ? tooltip : "", open: !!tooltip && tooltipOpen }, { children: _jsxs(FormControl, __assign({ variant: variant, disabled: disabled, error: error }, { children: [label && (_jsx(InputLabel, __assign({ id: "symply-multiple-select" }, { children: label }), void 0)), _jsx(Select, __assign({
|
26
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Tooltip, __assign({ title: tooltip !== null && tooltip !== void 0 ? tooltip : "", open: !!tooltip && tooltipOpen }, { children: _jsxs(FormControl, __assign({ variant: variant, disabled: disabled, fullWidth: fullWidth, error: error, size: size }, { children: [label && (_jsx(InputLabel, __assign({ id: "symply-multiple-select" }, { children: label }), void 0)), _jsx(Select, __assign({ name: name, value: value, multiple: true, onChange: function (event) {
|
27
27
|
var _a;
|
28
28
|
onChange((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value);
|
29
29
|
}, inputProps: {
|
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
|
|
9
9
|
};
|
10
10
|
return __assign.apply(this, arguments);
|
11
11
|
};
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
+
var t = {};
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
+
t[p] = s[p];
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
+
t[p[i]] = s[p[i]];
|
20
|
+
}
|
21
|
+
return t;
|
22
|
+
};
|
12
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
13
24
|
import Select from "@mui/material/Select";
|
14
25
|
import Tooltip from "@mui/material/Tooltip";
|
@@ -20,10 +31,10 @@ import ThemeProvider from "@mui/material/styles/ThemeProvider";
|
|
20
31
|
import useInteractions from "./useInteractions";
|
21
32
|
import useCustomTheme from "../useCustomTheme";
|
22
33
|
function SimpleSelector(props) {
|
23
|
-
var name = props.name, label = props.label, _a = props.variant, variant = _a === void 0 ? "outlined" : _a, value = props.value, tooltip = props.tooltip, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.showHelperText, showHelperText = _c === void 0 ? false : _c, helperText = props.helperText, _d = props.error, error = _d === void 0 ? false : _d, _e = props.options, options = _e === void 0 ? [] : _e, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, onChange = props.onChange;
|
34
|
+
var name = props.name, label = props.label, _a = props.variant, variant = _a === void 0 ? "outlined" : _a, value = props.value, size = props.size, tooltip = props.tooltip, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.showHelperText, showHelperText = _c === void 0 ? false : _c, helperText = props.helperText, _d = props.error, error = _d === void 0 ? false : _d, _e = props.options, options = _e === void 0 ? [] : _e, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, fullWidth = props.fullWidth, onChange = props.onChange, rest = __rest(props, ["name", "label", "variant", "value", "size", "tooltip", "disabled", "showHelperText", "helperText", "error", "options", "primaryColor", "secondaryColor", "fullWidth", "onChange"]);
|
24
35
|
var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
|
25
36
|
var _f = useInteractions(), tooltipOpen = _f.tooltipOpen, onOpenTooltip = _f.onOpenTooltip, onCloseTooltip = _f.onCloseTooltip;
|
26
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Tooltip, __assign({ title: tooltip !== null && tooltip !== void 0 ? tooltip : "", open: !!tooltip && tooltipOpen }, { children: _jsxs(FormControl, __assign({ variant: variant, disabled: disabled, error: error }, { children: [label && (_jsx(InputLabel, __assign({ id: "symply-simple-selector" }, { children: label }), void 0)), _jsx(Select, __assign({ value: value, name: name, disabled: disabled, onChange: function (event) {
|
37
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Tooltip, __assign({ title: tooltip !== null && tooltip !== void 0 ? tooltip : "", open: !!tooltip && tooltipOpen }, { children: _jsxs(FormControl, __assign({ variant: variant, disabled: disabled, fullWidth: fullWidth, error: error, size: size }, { children: [label && (_jsx(InputLabel, __assign({ id: "symply-simple-selector" }, { children: label }), void 0)), _jsx(Select, __assign({ value: value, name: name, disabled: disabled, onChange: function (event) {
|
27
38
|
var _a;
|
28
39
|
onChange((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value);
|
29
40
|
}, inputProps: {
|
package/FormSelector/types.d.ts
CHANGED
@@ -7,8 +7,10 @@ interface SelectorBaseProps {
|
|
7
7
|
variant?: SelectProps["variant"];
|
8
8
|
disabled?: SelectProps["disabled"];
|
9
9
|
showHelperText?: boolean;
|
10
|
+
fullWidth?: boolean;
|
10
11
|
helperText?: string;
|
11
12
|
error?: boolean;
|
13
|
+
size?: SelectProps["size"];
|
12
14
|
multiple?: SelectProps["multiple"];
|
13
15
|
primaryColor?: CSSProperties["color"];
|
14
16
|
secondaryColor?: CSSProperties["color"];
|
@@ -20,10 +22,10 @@ interface SelectorBaseProps {
|
|
20
22
|
}
|
21
23
|
export interface SimpleSelectorProps extends SelectorBaseProps {
|
22
24
|
value: number | string;
|
23
|
-
onChange: (value
|
25
|
+
onChange: (value?: string | number) => void;
|
24
26
|
}
|
25
27
|
export interface MultipleSelectorProps extends SelectorBaseProps {
|
26
28
|
value: Array<number> | Array<string>;
|
27
|
-
onChange: (value
|
29
|
+
onChange: (value?: string | Array<number> | Array<string>) => void;
|
28
30
|
}
|
29
31
|
export {};
|