@symply.io/basic-components 1.7.4 → 1.7.6-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.
package/BasicModal/index.js
CHANGED
@@ -57,7 +57,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
57
57
|
return t;
|
58
58
|
};
|
59
59
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
60
|
-
import { useRef, forwardRef, useCallback,
|
60
|
+
import { useRef, forwardRef, useCallback, useImperativeHandle, } from "react";
|
61
61
|
import Grid from "@mui/material/Grid";
|
62
62
|
import Button from "@mui/material/Button";
|
63
63
|
import Dialog from "@mui/material/Dialog";
|
@@ -121,7 +121,7 @@ function BasicModal(props, ref) {
|
|
121
121
|
? undefined
|
122
122
|
: function (ev) {
|
123
123
|
ev.preventDefault();
|
124
|
-
} }, { children: [desc && _jsx(DialogContentText, { children: desc }), Boolean(children)
|
124
|
+
} }, { children: [desc && _jsx(DialogContentText, { children: desc }), Boolean(children) ? children : _jsx(_Fragment, {})] })) })), !hideBottomButtons && (_jsx(DialogActions, __assign({ sx: { padding: theme.spacing(1.25) } }, { children: _jsx(Grid, __assign({ container: true, spacing: 2, justifyContent: "flex-end", alignItems: "center", sx: { margin: 0 } }, { children: buttons || (_jsxs(_Fragment, { children: [_jsx(Grid, __assign({ item: true, xs: 12, md: 3, xl: 2 }, { children: _jsx(Button, __assign({ onClick: onClose, variant: "outlined", color: color, disabled: loading, fullWidth: true }, { children: cancelText })) })), _jsx(Grid, __assign({ item: true, xs: 12, md: 3, xl: 2 }, { children: _jsx(Button, __assign({ type: noForm ? "button" : "submit", onClick: noForm ? onSubmit : onFormSubmit, variant: "contained", color: color, disabled: loading || disabled, fullWidth: true }, { children: submitText })) }))] })) })) })))] })) })));
|
125
125
|
}
|
126
126
|
var BasicModalWithRefForward = forwardRef(BasicModal);
|
127
127
|
BasicModalWithRefForward.displayName = "BasicModal";
|
@@ -34,7 +34,7 @@ function ConfirmPasswordInput(props) {
|
|
34
34
|
}
|
35
35
|
return true;
|
36
36
|
}, [value, password]);
|
37
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(TextField, __assign({ error: !isMatched, label: label, value: value, variant: variant, margin: margin, disabled: disabled, type: "password", size: "small", helperText: !isMatched
|
37
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(TextField, __assign({ error: !isMatched, label: label, value: value, variant: variant, margin: margin, disabled: disabled, type: "password", size: "small", helperText: !isMatched ? helperText : null, onChange: function (event) {
|
38
38
|
event.preventDefault();
|
39
39
|
onChange(event.target.value);
|
40
40
|
}, fullWidth: true, required: true }, rest)) })));
|
@@ -42,7 +42,7 @@ function MultipleSelector(props) {
|
|
42
42
|
onChange((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value);
|
43
43
|
}, inputProps: {
|
44
44
|
onFocus: onOpenTooltip,
|
45
|
-
onBlur: onCloseTooltip
|
45
|
+
onBlur: onCloseTooltip
|
46
46
|
}, label: label, renderValue: multiple
|
47
47
|
? function (selectedValues) {
|
48
48
|
return options
|
@@ -57,6 +57,6 @@ function MultipleSelector(props) {
|
|
57
57
|
: undefined }, { children: (options === null || options === void 0 ? void 0 : options.length) > 0 ? (options.map(function (option) {
|
58
58
|
var label = option.label, v = option.value;
|
59
59
|
return (_jsxs(MenuItem, __assign({ value: v }, { children: [showCheckmarks ? (_jsx(Checkbox, { checked: !!value.includes(v) })) : (_jsx(_Fragment, {})), _jsx(ListItemText, { primary: label })] }), v));
|
60
|
-
})) : (_jsx(MenuItem, __assign({ value: "", disabled: true }, { children: "No Options" }))) })), !!helperText && showHelperText
|
60
|
+
})) : (_jsx(MenuItem, __assign({ value: "", disabled: true }, { children: "No Options" }))) })), !!helperText && showHelperText ? (_jsx(FormHelperText, { children: helperText })) : (_jsx(_Fragment, {}))] })) })) })));
|
61
61
|
}
|
62
62
|
export default MultipleSelector;
|
@@ -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 Select from "@mui/material/Select";
|
25
25
|
import Tooltip from "@mui/material/Tooltip";
|
26
26
|
import MenuItem from "@mui/material/MenuItem";
|
@@ -40,10 +40,10 @@ function SimpleSelector(props) {
|
|
40
40
|
onChange((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value);
|
41
41
|
}, inputProps: {
|
42
42
|
onFocus: onOpenTooltip,
|
43
|
-
onBlur: onCloseTooltip
|
43
|
+
onBlur: onCloseTooltip
|
44
44
|
}, label: label }, { children: (options === null || options === void 0 ? void 0 : options.length) > 0 ? (options.map(function (option) {
|
45
45
|
var label = option.label, v = option.value, disabled = option.disabled;
|
46
46
|
return (_jsx(MenuItem, __assign({ value: v, disabled: disabled }, { children: label }), v));
|
47
|
-
})) : (_jsx(MenuItem, __assign({ value: "", disabled: true }, { children: "No Options" }))) })), !!helperText && showHelperText
|
47
|
+
})) : (_jsx(MenuItem, __assign({ value: "", disabled: true }, { children: "No Options" }))) })), !!helperText && showHelperText ? (_jsx(FormHelperText, { children: helperText })) : (_jsx(_Fragment, {}))] })) })) })));
|
48
48
|
}
|
49
49
|
export default SimpleSelector;
|
package/FormSelector/types.d.ts
CHANGED
@@ -5,8 +5,8 @@ interface SelectorBaseProps<T extends string | number> extends Omit<FormControlP
|
|
5
5
|
label?: string;
|
6
6
|
name?: string;
|
7
7
|
tooltip?: ReactNode;
|
8
|
-
showHelperText?: boolean;
|
9
8
|
helperText?: string;
|
9
|
+
showHelperText?: boolean;
|
10
10
|
multiple?: SelectProps["multiple"];
|
11
11
|
primaryColor?: CSSProperties["color"];
|
12
12
|
secondaryColor?: CSSProperties["color"];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@symply.io/basic-components",
|
3
|
-
"version": "1.7.
|
3
|
+
"version": "1.7.6-alpha.1",
|
4
4
|
"description": "Basic and reusable components for all frontend of Symply apps",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -47,7 +47,7 @@
|
|
47
47
|
"@types/react": "^18.2.16",
|
48
48
|
"@types/react-dom": "^18.2.7",
|
49
49
|
"babel-loader": "^8.2.2",
|
50
|
-
"typescript": "
|
50
|
+
"typescript": "5.3.3"
|
51
51
|
},
|
52
52
|
"dependencies": {
|
53
53
|
"@emotion/react": "^11.7.1",
|