@symply.io/basic-components 1.7.12-alpha.2 → 1.7.12
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 +2 -1
- package/package.json +1 -1
package/BasicModal/index.js
CHANGED
|
@@ -83,6 +83,7 @@ function BasicModal(props, ref) {
|
|
|
83
83
|
var formRef = useRef(null);
|
|
84
84
|
var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
|
|
85
85
|
var fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
|
|
86
|
+
var buttonFullWidth = useMediaQuery(theme.breakpoints.down("md"));
|
|
86
87
|
var onFormSubmit = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
87
88
|
var allValid;
|
|
88
89
|
return __generator(this, function (_a) {
|
|
@@ -121,7 +122,7 @@ function BasicModal(props, ref) {
|
|
|
121
122
|
? undefined
|
|
122
123
|
: function (ev) {
|
|
123
124
|
ev.preventDefault();
|
|
124
|
-
} }, { children: [desc && _jsx(DialogContentText, { children: desc }), Boolean(children) && cloneElement(children)] })) })), !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,
|
|
125
|
+
} }, { children: [desc && _jsx(DialogContentText, { children: desc }), Boolean(children) && cloneElement(children)] })) })), !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: "auto" }, { children: _jsx(Button, __assign({ onClick: onClose, variant: "outlined", color: cancelButtonColor || color, disabled: loading, fullWidth: buttonFullWidth }, { children: cancelText })) })), _jsx(Grid, __assign({ item: true, xs: 12, md: "auto" }, { children: _jsx(Button, __assign({ type: noForm ? "button" : "submit", onClick: noForm ? onSubmit : onFormSubmit, variant: "contained", color: submitButtonColor || color, disabled: loading || disabled, fullWidth: buttonFullWidth }, { children: submitText })) }))] })) })) })))] })) })));
|
|
125
126
|
}
|
|
126
127
|
var BasicModalWithRefForward = forwardRef(BasicModal);
|
|
127
128
|
BasicModalWithRefForward.displayName = "BasicModal";
|