@movalib/movalib-commons 1.0.97 → 1.0.98

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.
@@ -22,7 +22,7 @@ var leaf_green_large_png_1 = __importDefault(require("./assets/images/leaf_green
22
22
  var leaf_yellow_large_png_1 = __importDefault(require("./assets/images/leaf_yellow_large.png"));
23
23
  var leaf_pink_large_png_1 = __importDefault(require("./assets/images/leaf_pink_large.png"));
24
24
  var MovaDialog = function (_a) {
25
- var fullScreen = _a.fullScreen, open = _a.open, onClose = _a.onClose, _b = _a.closable, closable = _b === void 0 ? false : _b, children = _a.children, title = _a.title, titleStyle = _a.titleStyle, message = _a.message, leafImageColor = _a.leafImageColor, transition = _a.transition, actions = _a.actions, sx = _a.sx;
25
+ var fullScreen = _a.fullScreen, open = _a.open, onClose = _a.onClose, _b = _a.closable, closable = _b === void 0 ? true : _b, children = _a.children, title = _a.title, titleStyle = _a.titleStyle, message = _a.message, leafImageColor = _a.leafImageColor, transition = _a.transition, actions = _a.actions, sx = _a.sx;
26
26
  var getTransition = function () {
27
27
  switch (transition) {
28
28
  case "fade":
@@ -60,6 +60,6 @@ var MovaDialog = function (_a) {
60
60
  zIndex: 0,
61
61
  left: 0,
62
62
  opacity: '0.2'
63
- }, alt: 'Feuille Movalib' }), (0, jsx_runtime_1.jsx)(material_1.DialogTitle, __assign({ id: "garage-dialog-title", sx: { textAlign: 'center', p: 0, pt: 1, mt: 0, mb: 0, zIndex: 10 } }, { children: (0, jsx_runtime_1.jsx)(material_1.AppBar, __assign({ sx: { position: 'relative' }, color: "transparent", elevation: 0 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Toolbar, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ edge: "start", color: "inherit", onClick: handleOnBack, "aria-label": "close" }, { children: (0, jsx_runtime_1.jsx)(ArrowBackIosNewRounded_1.default, {}) })), title && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ sx: { textAlign: 'center', fontSize: 20, flexGrow: 1, pl: '20px', pr: '40px' }, style: titleStyle }, { children: title }))] }) })) })), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, __assign({ sx: { zIndex: 20 } }, { children: [children, message && (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: "error", sx: { mb: 2 } }, { children: message }))] })), (0, jsx_runtime_1.jsx)(material_1.DialogActions, __assign({ sx: { justifyContent: 'center' } }, { children: actions }))] })));
63
+ }, alt: 'Feuille Movalib' }), (0, jsx_runtime_1.jsx)(material_1.DialogTitle, __assign({ id: "garage-dialog-title", sx: { textAlign: 'center', p: 0, pt: 1, mt: 0, mb: 0, zIndex: 10 } }, { children: (0, jsx_runtime_1.jsx)(material_1.AppBar, __assign({ sx: { position: 'relative' }, color: "transparent", elevation: 0 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Toolbar, { children: [closable && (0, jsx_runtime_1.jsx)(material_1.IconButton, __assign({ edge: "start", color: "inherit", onClick: handleOnBack, "aria-label": "close" }, { children: (0, jsx_runtime_1.jsx)(ArrowBackIosNewRounded_1.default, {}) })), title && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ sx: { textAlign: 'center', fontSize: 20, flexGrow: 1, pl: '20px', pr: '40px' }, style: titleStyle }, { children: title }))] }) })) })), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, __assign({ sx: { zIndex: 20 } }, { children: [children, message && (0, jsx_runtime_1.jsx)(material_1.Alert, __assign({ severity: "error", sx: { mb: 2 } }, { children: message }))] })), (0, jsx_runtime_1.jsx)(material_1.DialogActions, __assign({ sx: { justifyContent: 'center' } }, { children: actions }))] })));
64
64
  };
65
65
  exports.default = MovaDialog;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.0.97",
3
+ "version": "1.0.98",
4
4
  "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@ interface MovaDialogProps {
22
22
  sx?: SxProps<Theme>;
23
23
  }
24
24
 
25
- const MovaDialog: FC<MovaDialogProps> = ({fullScreen, open, onClose, closable = false, children, title, titleStyle,
25
+ const MovaDialog: FC<MovaDialogProps> = ({fullScreen, open, onClose, closable = true, children, title, titleStyle,
26
26
  message, leafImageColor, transition, actions, sx}) => {
27
27
 
28
28
  const getTransition = () => {
@@ -89,14 +89,14 @@ const MovaDialog: FC<MovaDialogProps> = ({fullScreen, open, onClose, closable =
89
89
  <DialogTitle id="garage-dialog-title" sx={{ textAlign:'center', p: 0, pt: 1, mt: 0, mb: 0, zIndex: 10 }} >
90
90
  <AppBar sx={{ position: 'relative' }} color="transparent" elevation={0}>
91
91
  <Toolbar>
92
- <IconButton
92
+ {closable && <IconButton
93
93
  edge="start"
94
94
  color="inherit"
95
95
  onClick={handleOnBack}
96
96
  aria-label="close"
97
97
  >
98
98
  <BackIcon />
99
- </IconButton>
99
+ </IconButton>}
100
100
  {title && <Typography sx={{ textAlign:'center', fontSize: 20, flexGrow: 1, pl: '20px', pr: '40px' }} style={titleStyle}>
101
101
  {title}
102
102
  </Typography>}