@pagopa/selfcare-common-frontend 1.5.15 → 1.5.16

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/CHANGELOG.md CHANGED
@@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v1.5.16](https://github.com/pagopa/selfcare-common-frontend/compare/v1.5.15...v1.5.16)
8
+
9
+ - SessionModal confirm button can be disabled [`#44`](https://github.com/pagopa/selfcare-common-frontend/pull/44)
10
+
7
11
  #### [v1.5.15](https://github.com/pagopa/selfcare-common-frontend/compare/v1.5.14...v1.5.15)
8
12
 
13
+ > 28 February 2022
14
+
9
15
  - SessionModal message can accept ReactNode [`#43`](https://github.com/pagopa/selfcare-common-frontend/pull/43)
10
16
  - Bump url-parse from 1.5.7 to 1.5.10 [`#42`](https://github.com/pagopa/selfcare-common-frontend/pull/42)
11
17
  - Bump urijs from 1.19.7 to 1.19.8 [`#41`](https://github.com/pagopa/selfcare-common-frontend/pull/41)
package/README.md CHANGED
@@ -80,6 +80,7 @@ Selfcare's popup
80
80
  | title | string | Y | The title to show in the popup |
81
81
  | message | React.ReactNode | Y | The body to show in the popup |
82
82
  | onConfirm | React.MouseEventHandler`<HTMLButtonElement>` | N | If defined, it will render a confirm button using this function as behavior |
83
+ | onConfirmEnabled | boolean | N | If the confirm button should be enabled. Default true |
83
84
  | onConfirmLabel | string | N | The confirm label text |
84
85
  | handleClose | React.MouseEventHandler`<HTMLButtonElement>` | Y | The function invoked when clicking on close button or in the showed X icon |
85
86
  | handleExit | React.MouseEventHandler`<HTMLButtonElement>` | N | If defined, it allow to set a different behavior when clicking on X icon |
package/build.info CHANGED
@@ -1,2 +1,2 @@
1
- 20220228.1 - selfcare-common-frontend.deploy(21838)
2
- tags/v1.5.15^0 9850f39b8f4d90907b9862c27b2aee21f52c45e3
1
+ 20220228.2 - selfcare-common-frontend.deploy(21880)
2
+ tags/v1.5.16^0 0cc2140a7f621e4c082cee23e2ea5abddd95bdb8
@@ -8,6 +8,8 @@ declare type Props = {
8
8
  message: React.ReactNode;
9
9
  /** If defined, it will render a confirm button using this function as behavior */
10
10
  onConfirm?: React.MouseEventHandler<HTMLButtonElement> | undefined;
11
+ /** If the confirm button should be enabled. Default true */
12
+ onConfirmEnabled?: boolean;
11
13
  /** The confirm label text */
12
14
  onConfirmLabel?: string;
13
15
  /** The function invoked when clicking on close button or in the showed X icon */
@@ -24,5 +26,5 @@ declare type Props = {
24
26
  width?: string;
25
27
  };
26
28
  /** Selfcare's popup */
27
- export default function SessionModal({ open, title, message, onConfirm, onConfirmLabel, handleClose, handleExit, onCloseLabel, height, minHeight, width, }: Props): JSX.Element;
29
+ export default function SessionModal({ open, title, message, onConfirm, onConfirmEnabled, onConfirmLabel, handleClose, handleExit, onCloseLabel, height, minHeight, width, }: Props): JSX.Element;
28
30
  export {};
@@ -8,10 +8,10 @@ const useMediaQuery_1 = (0, tslib_1.__importDefault)(require("@mui/material/useM
8
8
  const styles_1 = require("@mui/material/styles");
9
9
  const ClearOutlined_1 = (0, tslib_1.__importDefault)(require("@mui/icons-material/ClearOutlined"));
10
10
  /** Selfcare's popup */
11
- function SessionModal({ open, title, message, onConfirm, onConfirmLabel = 'Riprova', handleClose, handleExit = handleClose, onCloseLabel = 'Annulla', height, minHeight, width = '21.9em', }) {
11
+ function SessionModal({ open, title, message, onConfirm, onConfirmEnabled = true, onConfirmLabel = 'Riprova', handleClose, handleExit = handleClose, onCloseLabel = 'Annulla', height, minHeight, width = '21.9em', }) {
12
12
  const theme = (0, styles_1.useTheme)();
13
13
  const fullScreen = (0, useMediaQuery_1.default)(theme.breakpoints.down('xs'));
14
- return ((0, jsx_runtime_1.jsx)(Dialog_1.default, Object.assign({ fullScreen: fullScreen, open: open, onClose: handleClose, "aria-labelledby": "responsive-dialog-title" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, direction: "column", sx: { height, minHeight, width } }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ mx: 3, sx: { height: '100%' } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, mt: 4 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 10 }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleExit, style: { position: 'absolute', top: '20px', right: '16px', zIndex: 100 } }, { children: (0, jsx_runtime_1.jsx)(ClearOutlined_1.default, {}, void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", sx: { fontSize: '18px', fontWeight: '600' } }, { children: title }), void 0)] }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, my: 3 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "div", variant: "body2" }, { children: message }), void 0) }), void 0) }), void 0), onConfirm && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, mb: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ sx: { width: '100%' }, color: "primary", variant: "contained", onClick: onConfirm }, { children: onConfirmLabel }), void 0) }), void 0)), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, mb: 3, mt: 0 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleClose, sx: { width: '100%' }, color: "primary", variant: "outlined" }, { children: onCloseLabel }), void 0) }), void 0)] }), void 0) }), void 0) }), void 0));
14
+ return ((0, jsx_runtime_1.jsx)(Dialog_1.default, Object.assign({ fullScreen: fullScreen, open: open, onClose: handleClose, "aria-labelledby": "responsive-dialog-title" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, direction: "column", sx: { height, minHeight, width } }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ mx: 3, sx: { height: '100%' } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, mt: 4 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 10 }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleExit, style: { position: 'absolute', top: '20px', right: '16px', zIndex: 100 } }, { children: (0, jsx_runtime_1.jsx)(ClearOutlined_1.default, {}, void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", sx: { fontSize: '18px', fontWeight: '600' } }, { children: title }), void 0)] }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, my: 3 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "div", variant: "body2" }, { children: message }), void 0) }), void 0) }), void 0), onConfirm && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, mb: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ sx: { width: '100%' }, color: "primary", variant: "contained", onClick: onConfirm, disabled: !onConfirmEnabled }, { children: onConfirmLabel }), void 0) }), void 0)), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, mb: 3, mt: 0 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleClose, sx: { width: '100%' }, color: "primary", variant: "outlined" }, { children: onCloseLabel }), void 0) }), void 0)] }), void 0) }), void 0) }), void 0));
15
15
  }
16
16
  exports.default = SessionModal;
17
17
  //# sourceMappingURL=SessionModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SessionModal.js","sourceRoot":"","sources":["../../src/lib/components/SessionModal.tsx"],"names":[],"mappings":";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BACjE,KAAK,YACK,aACR,YACF,EAEP,uBAAC,eAAI,kBAAC,SAAS,QAAC,IAAI,sBAClB,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,gBACtB,uBAAC,qBAAU,kBAAC,SAAS,EAAC,KAAK,EAAC,OAAO,EAAC,OAAO,gBACxC,OAAO,YACG,YACR,YACF,EAEN,SAAS,IAAI,CACZ,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,gBACtB,uBAAC,iBAAM,kBACL,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACrB,KAAK,EAAC,SAAS,EACf,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,SAAS,gBAEjB,cAAc,YACR,YACJ,CACR,EAED,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,gBAC7B,uBAAC,iBAAM,kBAAC,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAC,SAAS,EAAC,OAAO,EAAC,UAAU,gBACpF,YAAY,YACN,YACJ,aACH,YACD,YACA,CACV,CAAC;AACJ,CAAC;AArED,+BAqEC"}
1
+ {"version":3,"file":"SessionModal.js","sourceRoot":"","sources":["../../src/lib/components/SessionModal.tsx"],"names":[],"mappings":";;;;AACA,4CAA0E;AAC1E,+EAA0C;AAC1C,6FAAwD;AACxD,iDAAgD;AAChD,mGAAkE;AA6BlE,uBAAuB;AACvB,SAAwB,YAAY,CAAC,EACnC,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACT,gBAAgB,GAAG,IAAI,EACvB,cAAc,GAAG,SAAS,EAC1B,WAAW,EACX,UAAU,GAAG,WAAW,EACxB,YAAY,GAAG,SAAS,EACxB,MAAM,EACN,SAAS,EACT,KAAK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C,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,gBACtB,uBAAC,iBAAM,kBACL,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACrB,KAAK,EAAC,SAAS,EACf,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,CAAC,gBAAgB,gBAE1B,cAAc,YACR,YACJ,CACR,EAED,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,gBAC7B,uBAAC,iBAAM,kBAAC,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAC,SAAS,EAAC,OAAO,EAAC,UAAU,gBACpF,YAAY,YACN,YACJ,aACH,YACD,YACA,CACV,CAAC;AACJ,CAAC;AAvED,+BAuEC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pagopa/selfcare-common-frontend",
3
3
  "description": "Shared React components for the pagopa selfcare project",
4
- "version": "1.5.15",
4
+ "version": "1.5.16",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/pagopa/selfcare-common-frontend",
7
7
  "author": "https://www.pagopa.gov.it",