@movalib/movalib-commons 1.59.19 → 1.59.20

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.
@@ -11,7 +11,7 @@ interface MovaDialogProps {
11
11
  message?: string;
12
12
  transition?: "fade";
13
13
  leafImageColor?: "green" | "yellow" | "pink";
14
- title?: string;
14
+ title?: string | React.ReactNode;
15
15
  titleStyle?: CSSProperties;
16
16
  sx?: SxProps<Theme>;
17
17
  maxWidth?: Breakpoint | false;
@@ -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' }), title && (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, {}) })), (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ sx: { textAlign: 'center', fontSize: 20, flexGrow: 1, pl: closable ? '20px' : 'Opx', pr: closable ? '40px' : '0px' }, 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 }))] })), actions && (0, jsx_runtime_1.jsx)(material_1.DialogActions, __assign({ sx: { justifyContent: 'center' } }, { children: actions }))] })));
63
+ }, alt: 'Feuille Movalib' }), title && (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, {}) })), typeof title === typeof 'poney' && (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ sx: { textAlign: 'center', fontSize: 20, flexGrow: 1, pl: closable ? '20px' : 'Opx', pr: closable ? '40px' : '0px' }, style: titleStyle }, { children: title })), typeof title !== typeof 'poney' && 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 }))] })), actions && (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.59.19",
3
+ "version": "1.59.20",
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",
@@ -14,10 +14,10 @@ interface MovaDialogProps {
14
14
  onClose: () => void,
15
15
  closable?: boolean,
16
16
  actions?: React.ReactNode,
17
- message?:string,
17
+ message?: string,
18
18
  transition?: "fade",
19
19
  leafImageColor?: "green" | "yellow" | "pink",
20
- title?: string,
20
+ title?: string | React.ReactNode,
21
21
  titleStyle?: CSSProperties;
22
22
  sx?: SxProps<Theme>;
23
23
  maxWidth? : Breakpoint | false;
@@ -99,9 +99,10 @@ const MovaDialog: FC<MovaDialogProps> = ({fullScreen, open, onClose, closable =
99
99
  >
100
100
  <BackIcon />
101
101
  </IconButton>}
102
- <Typography sx={{ textAlign:'center', fontSize: 20, flexGrow: 1, pl: closable ? '20px' : 'Opx', pr: closable ? '40px' : '0px' }} style={titleStyle}>
102
+ {typeof title === typeof 'poney' && <Typography sx={{ textAlign:'center', fontSize: 20, flexGrow: 1, pl: closable ? '20px' : 'Opx', pr: closable ? '40px' : '0px' }} style={titleStyle}>
103
103
  {title}
104
- </Typography>
104
+ </Typography>}
105
+ {typeof title !== typeof 'poney' && title}
105
106
  </Toolbar>
106
107
  </AppBar>
107
108
  </DialogTitle>