@pagopa/selfcare-common-frontend 1.0.0 → 1.2.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +97 -1
  3. package/build.info +2 -2
  4. package/components/EndingPage.d.ts +17 -0
  5. package/components/EndingPage.js +9 -0
  6. package/components/EndingPage.js.map +1 -0
  7. package/components/ErrorBoundary/ErrorBoundary.js +29 -8
  8. package/components/ErrorBoundary/ErrorBoundary.js.map +1 -1
  9. package/components/ErrorBoundary/components/BlockingErrorPage.js +3 -2
  10. package/components/ErrorBoundary/components/BlockingErrorPage.js.map +1 -1
  11. package/components/FilterModal.d.ts +1 -1
  12. package/components/Footer/Footer.d.ts +2 -1
  13. package/components/Footer/Footer.js +10 -5
  14. package/components/Footer/Footer.js.map +1 -1
  15. package/components/TitleBox.d.ts +6 -3
  16. package/components/TitleBox.js +2 -2
  17. package/components/TitleBox.js.map +1 -1
  18. package/components/UnloadEventHandler.d.ts +8 -0
  19. package/components/UnloadEventHandler.js +33 -0
  20. package/components/UnloadEventHandler.js.map +1 -0
  21. package/components/UserNotifyHandle.d.ts +7 -0
  22. package/components/UserNotifyHandle.js +55 -0
  23. package/components/UserNotifyHandle.js.map +1 -0
  24. package/components/icons/CheckIllustrationIcon.d.ts +4 -0
  25. package/components/icons/CheckIllustrationIcon.js +7 -0
  26. package/components/icons/CheckIllustrationIcon.js.map +1 -0
  27. package/components/icons/FaultIcon.d.ts +4 -0
  28. package/components/icons/FaultIcon.js +7 -0
  29. package/components/icons/FaultIcon.js.map +1 -0
  30. package/config/env.d.ts +1 -0
  31. package/config/env.js +1 -0
  32. package/config/env.js.map +1 -1
  33. package/hooks/useErrorDispatcher.d.ts +1 -1
  34. package/hooks/useErrorDispatcher.js +1 -1
  35. package/hooks/useErrorDispatcher.js.map +1 -1
  36. package/hooks/useLoading.d.ts +1 -1
  37. package/hooks/useLoading.js +1 -1
  38. package/hooks/useLoading.js.map +1 -1
  39. package/hooks/useLogin.js +9 -7
  40. package/hooks/useLogin.js.map +1 -1
  41. package/hooks/useUnloadEventInterceptor.d.ts +17 -0
  42. package/hooks/useUnloadEventInterceptor.js +60 -0
  43. package/hooks/useUnloadEventInterceptor.js.map +1 -0
  44. package/hooks/useUserNotify.d.ts +3 -0
  45. package/hooks/useUserNotify.js +11 -0
  46. package/hooks/useUserNotify.js.map +1 -0
  47. package/index.d.ts +1 -0
  48. package/index.js +3 -1
  49. package/index.js.map +1 -1
  50. package/model/UserNotify.d.ts +23 -0
  51. package/model/UserNotify.js +3 -0
  52. package/model/UserNotify.js.map +1 -0
  53. package/package.json +16 -6
  54. package/redux/slices/appStateSlice.d.ts +47 -2
  55. package/redux/slices/appStateSlice.js +43 -0
  56. package/redux/slices/appStateSlice.js.map +1 -1
  57. package/redux/slices/userSlice.d.ts +3 -1
  58. package/redux/slices/userSlice.js.map +1 -1
  59. package/services/assistanceService.d.ts +1 -0
  60. package/services/assistanceService.js +19 -0
  61. package/services/assistanceService.js.map +1 -0
  62. package/utils/api-utils.d.ts +16 -0
  63. package/utils/api-utils.js +63 -0
  64. package/utils/api-utils.js.map +1 -0
  65. package/utils/constants.d.ts +3 -0
  66. package/utils/constants.js +3 -0
  67. package/utils/constants.js.map +1 -1
  68. package/utils/fixSwagger20ArraySchemaDef.js +67 -0
  69. package/utils/routes-utils.d.ts +1 -0
  70. package/utils/routes-utils.js +1 -0
  71. package/utils/routes-utils.js.map +1 -1
  72. package/utils/storage-utils.d.ts +3 -0
  73. package/utils/storage-utils.js +3 -0
  74. package/utils/storage-utils.js.map +1 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ ### Changelog
2
+
3
+ All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4
+
5
+ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
+
7
+ #### 1.2.1
8
+
9
+ - SELC-417 fixed useUnloadEventInterceptor useEffect [`#12`](https://github.com/pagopa/selfcare-common-frontend/pull/12)
10
+ - added api-utils and utility to use together with @pagopa/openapi-codegen-ts [`#11`](https://github.com/pagopa/selfcare-common-frontend/pull/11)
11
+ - Selc-408 fix concurrent notify [`#10`](https://github.com/pagopa/selfcare-common-frontend/pull/10)
12
+ - bug fix [`#8`](https://github.com/pagopa/selfcare-common-frontend/pull/8)
13
+ - Selc 408 Implementare gestione notifiche utente [`#7`](https://github.com/pagopa/selfcare-common-frontend/pull/7)
14
+ - fix EndingPage width [`#6`](https://github.com/pagopa/selfcare-common-frontend/pull/6)
15
+ - SELC 369 [`#5`](https://github.com/pagopa/selfcare-common-frontend/pull/5)
16
+ - SELC-393 Gestione visualizzazione errore tramite Toast [`#4`](https://github.com/pagopa/selfcare-common-frontend/pull/4)
17
+ - Bump node-fetch from 3.0.0 to 3.1.1 [`#3`](https://github.com/pagopa/selfcare-common-frontend/pull/3)
18
+ - Bump nanoid from 3.1.30 to 3.2.0 [`#2`](https://github.com/pagopa/selfcare-common-frontend/pull/2)
19
+ - Bump follow-redirects from 1.14.4 to 1.14.7 [`#1`](https://github.com/pagopa/selfcare-common-frontend/pull/1)
20
+ - common logic extracted [`06d5b9c`](https://github.com/pagopa/selfcare-common-frontend/commit/06d5b9cc4d9a653e8ed08294efa011cd40cf80b7)
21
+ - Selc 417 (#9) - UnloadEventInterceptor feature [`59e769d`](https://github.com/pagopa/selfcare-common-frontend/commit/59e769d382f422a7ab6c687a0e8655854df25193)
22
+ - example code [`37e354d`](https://github.com/pagopa/selfcare-common-frontend/commit/37e354d15a0d7e74a6e568127267ce17cd6b78fa)
package/README.md CHANGED
@@ -81,7 +81,7 @@ Selfcare's page title
81
81
  | title | string | Y | The title to show |
82
82
  | subTitle | string | N | The subtitle to show |
83
83
  | mtTitle | number | N | The margin top of the title |
84
- | mbTitle | GridSize | N | The margin bottom of the title |
84
+ | mbTitle | number | N | The margin bottom of the title |
85
85
  | mbSubTitle | number | N | The margin bottom of the subtitle |
86
86
  | variantTitle | Variant | N | The variant of the Typografy used for the title |
87
87
  | variantSubTitle | Variant | N | The variant of the Typografy used for the subtitle |
@@ -98,6 +98,63 @@ Selfcare's toast
98
98
  | message | React.ReactNode | Y | The toast body |
99
99
  | onCloseToast | ()=>void | Y | The function to be invoked when closing the toast |
100
100
 
101
+ ## Ending Page
102
+ Selfcare's ending page
103
+
104
+ | Prop | Type | Mandatory | Description |
105
+ |------|------|-----------|-------------|
106
+ | icon | React.ReactElement | N | The ending page icon |
107
+ | title | string | Y | The ending page title |
108
+ | description | string | Y | The ending page description |
109
+ | buttonLabel | string | N | The ending page button label if any |
110
+ | onButtonClick | () => void | N | if defined it will show a button that will performe this action on click |
111
+
112
+ # Utility functions
113
+ ## api-utils
114
+ ### onRedirectToLogin: (store: EnhancedStore) => void
115
+ To show an error popup to inform of the not valid session
116
+
117
+ ### buildFetchApi = (timeoutMs: number = 300000) => fetch
118
+ Return the implementation of fetch configured with a timeout
119
+
120
+ ### extractResponse <R>(response: t.Validation<TypeofApiResponse<any>>, successHttpStatus: number, onRedirectToLogin: () => void, notValidTokenHttpStatus: number | null = 401, notAuthorizedTokenHttpStatus: number | null = 403, emptyResponseHttpStatus: number | null = 404): Promise<R>
121
+ Extract the response of a @pagopa/openapi-codegen-ts generated client rest invocation having status code successHttpStatus.
122
+ If notValidTokenHttpStatus is not null and the returned status is equal to notValidTokenHttpStatus, it will call the onRedirectToLogin function and will schedule the redirect towards logout path.
123
+ If notAuthorizedTokenHttpStatus is not null and the returned status is equal to notAuthorizedTokenHttpStatus, it will throw an Error with message "Operation not allowed".
124
+ If emptyResponseHttpStatus is not null and the returned status is equal to emptyResponseHttpStatus, it will return a promise that resolve to null value.
125
+ Other statuses will return will throw a generic error.
126
+
127
+ ## constants
128
+ ### STORAGE_KEY_USER: string
129
+ The key used to store in the session storage the loggedUser in selfcare projects
130
+
131
+ ### STORAGE_KEY_TOKEN: string
132
+ The key used to store in the session storage the logged user token in selfcare projects
133
+
134
+ ### roleLabels: { [key in UserRole]: { shortLabel: string; longLabel: string } }
135
+ The short and long labels used for the roles of selfcare's projects
136
+
137
+ ## routes-utils
138
+ ### resolvePathVariables: (path: string, pathVariables: { [key: string]: string }): string
139
+ It will resolve the path variables in path using the provided map
140
+
141
+ ## storage-utils
142
+ ### storageDelete: (key: string) => void
143
+ It will delete a key from the local session storage
144
+
145
+ ### storageWrite: (key: string, value: StorageValue, type: StorageValueType) => void
146
+ It will store a key/value pair in the local session storage
147
+
148
+ ### function storageRead: (key: string, type: StorageValueType) => void
149
+ It will read a key from the local session storage
150
+
151
+ ## utils
152
+ ### formatDateAsLongString: (date: Date) => string
153
+ It will return a string representing the provided date in the italian format gg mmm aaaa
154
+
155
+ ## fixSwagger20ArraySchemaDef.js
156
+ An utility script to use when generating the stub through @pagopa/openapi-codegen-ts in order to handle the REST api whose operations returns an array of objects
157
+
101
158
  # Common decorators used in pagopa/selfcare react projects
102
159
  ## withLogin
103
160
  This feature is based on react-redux library and require to register the reducer build in userSlice into the application's redux store.
@@ -135,5 +192,44 @@ The error to be submitted has type AppError which has the following fields:
135
192
  | onRetry | () => void | N | If defined, in case of not blocking error, it will render a retry button which will execute this function |
136
193
  | onClose | () => void | N | If defined, in case of not blocking error, it will be executed when closing the popup |
137
194
  | toNotify | boolean | Y | If true, it will notify the error |
195
+ | component | string | N | Can render a SessionModal or Toast component |
138
196
 
139
197
  ASIS the notify consists just on the console.error invocation
198
+
199
+ ## UserNotifyHandle
200
+ This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
201
+ It allows to dispatch User Notifies in order to display a pop up or a toast notification.
202
+
203
+ To use this feature you have to put UserNotifyHandle in your App as a child of a redux Provider component.
204
+ In order to dispatch a User Notify, you have to use the custom hook useUserNotify which will return a fuction to be used to dispatch the User Notify.
205
+
206
+ The user notify to be submitted has type UserNotify which has the following fields:
207
+
208
+ | Field | Type | Mandatory | Description |
209
+ |-------|------|-----------|-------------|
210
+ | id | string | Y | The identifier used to recognize the user notify: it cannot be possible to have the same error id at the same time |
211
+ | title | string | Y | / The title to show in the popup or toast |
212
+ | message | React.ReactNode | Y | The body to show in the popup or toast |
213
+ | logo | React.ElementType | N | If component === 'Toast'. The logo to be rendered. As default a confirm logo will be used |
214
+ | leftBorderColor | string | N | If component === 'Toast'. The color used for the left border |
215
+ | onConfirm | () => void | N | If component === 'SessionModal'. If defined, it will render a confirm button which will execute this function |
216
+ | confirmLabel | string | N | If component === 'SessionModal'. If present, this string will rappresent the confirm button label |
217
+ | onClose | () => void | N | If defined, it will be executed when closing the popup |
218
+ | closeLabel | string | N | If component === 'SessionModal'. The close button label |
219
+ | component | string | N | Can render a SessionModal or Toast component |
220
+
221
+ ## UnloadEventHandler
222
+ This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
223
+ It allows to intercept when the user try to exit from the current page and ask him if he wants to continue or not.
224
+
225
+ To use this feature you have to put UnloadEventHandler in your App as a child of a redux Provider component.
226
+ In order to use this feature you have to use the custom hook useUnloadEventInterceptor, which will return an object having the following keys:
227
+ 1. registerUnloadEvent: an arrow function which takes two optional parameters to customize the title and the description of the pop-up opened when invoking the exitAction function (see below) and enable the functionality.
228
+ 2. unregisterUnloadEvent: an arrow function to call in order to disable this functionality.
229
+
230
+ If you wont to enable immediately this functionality when invoking the custom hook you can use the hook useUnloadEventInterceptorAndActivate, which will enable the functionality and will disable it when unmounting the component.
231
+
232
+ In order to show a custom pop-up when the user trigger an exit action you have to use the custom hook useUnloadEventOnExit which will return an arrow function to invoke instead of the exit action passing to it the exitAction itself.
233
+
234
+ When the exitAction is the Logout you can use the custom hook useUnloadEventLogout which is the customization of the useUnloadEventOnExit using the logout as an exit action.
235
+
package/build.info CHANGED
@@ -1,2 +1,2 @@
1
- 20220121.2 - selfcare-common-frontend.deploy(17450)
2
- tags/v1.0.0^0 1ac54a318d67e1333e3adf0273be68560dcbadcd
1
+ 20220202.1 - selfcare-common-frontend.deploy(18826)
2
+ tags/v1.2.1^0 6b0cd321c093e09f56475232a105594d155f220d
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { SvgIconProps } from '@mui/material';
3
+ declare type Props = {
4
+ /** The ending page icon */
5
+ icon?: React.ReactElement<SvgIconProps>;
6
+ /** The ending page title */
7
+ title: string;
8
+ /** The ending page description */
9
+ description: string;
10
+ /** The ending page button label if any */
11
+ buttonLabel?: string;
12
+ /** if defined it will show a button that will performe this action on click */
13
+ onButtonClick?: () => void;
14
+ };
15
+ declare const _default: ({ description, onButtonClick, icon, title, buttonLabel }: Props) => JSX.Element;
16
+ /** Selfcare's Ending Page */
17
+ export default _default;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const material_1 = require("@mui/material");
6
+ const CheckIllustrationIcon_1 = (0, tslib_1.__importDefault)(require("./icons/CheckIllustrationIcon"));
7
+ /** Selfcare's Ending Page */
8
+ exports.default = ({ description, onButtonClick, icon = (0, jsx_runtime_1.jsx)(CheckIllustrationIcon_1.default, {}, void 0), title, buttonLabel }) => ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { minHeight: '100vh' }, display: "flex", flexGrow: 1 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true, direction: "column", style: { textAlign: 'center' }, margin: 'auto' }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center", mb: 5 }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: icon }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h2" }, { children: title }), void 0) }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center", mb: 7, mt: 1 }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, { children: description }, void 0) }), void 0) }), void 0), onButtonClick && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 4 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", sx: { width: '200px', alignSelf: 'center' }, onClick: onButtonClick }, { children: buttonLabel }), void 0) }), void 0) }), void 0))] }), "0") }), void 0));
9
+ //# sourceMappingURL=EndingPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EndingPage.js","sourceRoot":"","sources":["../../src/lib/components/EndingPage.tsx"],"names":[],"mappings":";;;;AAAA,4CAA4E;AAC5E,uGAAkE;AAelE,6BAA6B;AAC7B,kBAAe,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,GAAG,uBAAC,+BAAqB,aAAG,EAAE,KAAK,EAAE,WAAW,EAAS,EAAE,EAAE,CAAC,CAC9G,uBAAC,cAAG,kBAAC,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,OAAO,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC,gBACzD,wBAAC,eAAI,kBAAC,SAAS,QAAC,SAAS,EAAC,QAAQ,EAAS,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,iBACvF,uBAAC,eAAI,kBAAC,SAAS,QAAC,IAAI,QAAC,cAAc,EAAC,QAAQ,EAAC,EAAE,EAAE,CAAC,gBAChD,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACb,IAAI,YACA,YACF,EACP,uBAAC,eAAI,kBAAC,SAAS,QAAC,IAAI,QAAC,cAAc,EAAC,QAAQ,gBAC1C,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACd,uBAAC,qBAAU,kBAAC,OAAO,EAAC,IAAI,gBAAE,KAAK,YAAc,YACxC,YACF,EACP,uBAAC,eAAI,kBAAC,SAAS,QAAC,IAAI,QAAC,cAAc,EAAC,QAAQ,EAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,gBACvD,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACd,uBAAC,qBAAU,cACR,WAAW,WACD,YACR,YACF,EACN,aAAa,IAAI,CAChB,uBAAC,eAAI,kBAAC,SAAS,QAAC,IAAI,QAAC,cAAc,EAAC,QAAQ,gBAC1C,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACd,uBAAC,iBAAM,kBACL,OAAO,EAAC,WAAW,EACnB,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAC3C,OAAO,EAAE,aAAa,gBAErB,WAAW,YACL,YACJ,YACF,CACR,MA9BoC,GAAG,CA+BnC,YACH,CACP,CAAC"}
@@ -9,14 +9,25 @@ const reselect_1 = require("reselect");
9
9
  const appStateSlice_1 = require("../../redux/slices/appStateSlice");
10
10
  const errorService_1 = require("../../services/errorService");
11
11
  const SessionModal_1 = (0, tslib_1.__importDefault)(require("../SessionModal"));
12
+ const Toast_1 = (0, tslib_1.__importDefault)(require("../Toast"));
13
+ const FaultIcon_1 = (0, tslib_1.__importDefault)(require("../icons/FaultIcon"));
12
14
  const BlockingErrorPage_1 = (0, tslib_1.__importDefault)(require("./components/BlockingErrorPage"));
13
15
  /** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
14
16
  It allows to dispatch errors in order to display a warning or the error page to the user.
15
17
  Errors dispatched will be notified using errorService
16
18
 
17
- To use this feature you have to put ErrorBOundary in your App as a child of a redux Provider component.
19
+ To use this feature you have to put ErrorBoundary in your App as a child of a redux Provider component.
18
20
  In order to dispatch an error you have to use the custom hook useErrorDispatcher which will return a fuction to be used to dispatch the error. */
19
21
  class ErrorBoundary extends react_1.Component {
22
+ constructor(props) {
23
+ super(props);
24
+ this.buildNotBlockingError.bind(this);
25
+ this.buildErrorModal.bind(this);
26
+ this.buildErrorToast.bind(this);
27
+ this.handleClose.bind(this);
28
+ this.popError.bind(this);
29
+ this.retryError.bind(this);
30
+ }
20
31
  componentDidCatch(error, errorInfo) {
21
32
  this.props.addError({
22
33
  id: (0, lodash_1.uniqueId)('uncaught-'),
@@ -35,20 +46,24 @@ class ErrorBoundary extends react_1.Component {
35
46
  (0, errorService_1.handleErrors)(this.props.errors);
36
47
  }
37
48
  if (!hasBlockingError) {
38
- return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [this.props.children, hasError && this.buildErrorModal(this.props.errors[0])] }, void 0));
49
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [this.props.children, hasError && this.buildNotBlockingError(this.props.errors)] }, void 0));
39
50
  }
40
51
  else {
41
52
  return ((0, jsx_runtime_1.jsx)(BlockingErrorPage_1.default, { description: blockingErrors[0].displayableDescription, assistanceEmail: this.props.assistanceEmail }, void 0));
42
53
  }
43
54
  }
55
+ buildNotBlockingError(errors) {
56
+ const errorModal = errors.find((e) => e.component === 'SessionModal');
57
+ const errorToast = errors.find((e) => e.component === 'Toast');
58
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [errorModal && this.buildErrorModal(errorModal), errorToast && this.buildErrorToast(errorToast)] }, void 0));
59
+ }
60
+ buildErrorToast(error) {
61
+ var _a, _b;
62
+ return ((0, jsx_runtime_1.jsx)(Toast_1.default, { open: true, title: (_a = error.displayableTitle) !== null && _a !== void 0 ? _a : 'ERRORE', message: (_b = error.displayableDescription) !== null && _b !== void 0 ? _b : 'Spiacenti, qualcosa è andato storto.', logo: FaultIcon_1.default, leftBorderColor: "#C02927", onCloseToast: () => this.handleClose(error) }, void 0));
63
+ }
44
64
  buildErrorModal(error) {
45
65
  var _a, _b;
46
- return ((0, jsx_runtime_1.jsx)(SessionModal_1.default, { open: true, title: (_a = error.displayableTitle) !== null && _a !== void 0 ? _a : 'Errore', message: (_b = error.displayableDescription) !== null && _b !== void 0 ? _b : 'Spiacenti, qualcosa è andato storto.', onConfirm: error.onRetry ? () => this.retryError(error) : undefined, handleClose: () => {
47
- this.popError(error);
48
- if (error.onClose) {
49
- error.onClose();
50
- }
51
- } }, void 0));
66
+ return ((0, jsx_runtime_1.jsx)(SessionModal_1.default, { open: true, title: (_a = error.displayableTitle) !== null && _a !== void 0 ? _a : 'Errore', message: (_b = error.displayableDescription) !== null && _b !== void 0 ? _b : 'Spiacenti, qualcosa è andato storto.', onConfirm: error.onRetry ? () => this.retryError(error) : undefined, handleClose: () => this.handleClose(error) }, void 0));
52
67
  }
53
68
  retryError(error) {
54
69
  this.popError(error);
@@ -59,6 +74,12 @@ class ErrorBoundary extends react_1.Component {
59
74
  popError(error) {
60
75
  this.props.removeError(error);
61
76
  }
77
+ handleClose(error) {
78
+ this.popError(error);
79
+ if (error.onClose) {
80
+ error.onClose();
81
+ }
82
+ }
62
83
  }
63
84
  const errorsSelector = (0, reselect_1.createSelector)(appStateSlice_1.appStateSelectors.selectErrors, (errors) => errors);
64
85
  function mapStateToProps(state) {
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../src/lib/components/ErrorBoundary/ErrorBoundary.tsx"],"names":[],"mappings":";;;;AACA,mCAAkC;AAClC,iCAAgF;AAChF,6CAAsC;AACtC,uCAA0C;AAC1C,oEAAgG;AAChG,8DAA2D;AAC3D,gFAA2C;AAC3C,oGAA+D;AAa/D;;;;;iJAKiJ;AACjJ,MAAM,aAAc,SAAQ,iBAAiC;IACpD,iBAAiB,CAAC,KAAY,EAAE,SAAoB;QACzD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;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AQ,CAAC,+BAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxE,WAAW,EAAE,CAAC,KAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,+BAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;CAC/E,CAAC,CAAC;AAEH,MAAM,sBAAsB,GAA0C,IAAA,qBAAO,EAC3E,eAAe,EACf,kBAAkB,CACnB,CAAC,aAAa,CAAC,CAAC;AACjB,kBAAe,sBAAsB,CAAC"}
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const material_1 = require("@mui/material");
5
+ const assistanceService_1 = require("../../../services/assistanceService");
6
+ const EndingPage_1 = (0, tslib_1.__importDefault)(require("../../EndingPage"));
6
7
  const ErrorIcon_1 = (0, tslib_1.__importDefault)(require("../../icons/ErrorIcon"));
7
- exports.default = ({ description, assistanceEmail }) => ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { minHeight: '100vh' }, display: "flex" }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true, direction: "column", style: { textAlign: 'center' }, margin: 'auto' }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center", mb: 5 }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(ErrorIcon_1.default, {}, void 0) }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h2" }, { children: "Spiacenti, qualcosa \u00E8 andato storto." }), void 0) }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center", mb: 7, mt: 1 }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, { children: description !== null && description !== void 0 ? description : 'A causa di un errore del sistema non è possibile completare la procedura.' }, void 0) }), void 0) }), void 0), assistanceEmail && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, item: true, justifyContent: "center" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 4 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", sx: { width: '200px', alignSelf: 'center' }, onClick: () => window.location.assign(`mailto:${assistanceEmail}`) }, { children: "Contatta l\"assistenza" }), void 0) }), void 0) }), void 0))] }), "0") }), void 0));
8
+ exports.default = ({ description, assistanceEmail }) => ((0, jsx_runtime_1.jsx)(EndingPage_1.default, { icon: (0, jsx_runtime_1.jsx)(ErrorIcon_1.default, {}, void 0), title: 'Spiacenti, qualcosa \u00E8 andato storto.', description: description !== null && description !== void 0 ? description : 'A causa di un errore del sistema non è possibile completare la procedura.', onButtonClick: assistanceEmail ? () => window.location.assign((0, assistanceService_1.buildAssistanceURI)(assistanceEmail)) : undefined, buttonLabel: "Contatta l'assistenza" }, void 0));
8
9
  //# sourceMappingURL=BlockingErrorPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockingErrorPage.js","sourceRoot":"","sources":["../../../../src/lib/components/ErrorBoundary/components/BlockingErrorPage.tsx"],"names":[],"mappings":";;;;AAAA,4CAA8D;AAC9D,mFAA8C;AAO9C,kBAAe,CAAC,EAAE,WAAW,EAAE,eAAe,EAAS,EAAE,EAAE,CAAC,CAC1D,uBAAC,cAAG,kBAAC,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,OAAO,EAAC,MAAM,gBAC7C,wBAAC,eAAI,kBAAC,SAAS,QAAC,SAAS,EAAC,QAAQ,EAAS,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,iBACvF,uBAAC,eAAI,kBAAC,SAAS,QAAC,IAAI,QAAC,cAAc,EAAC,QAAQ,EAAC,EAAE,EAAE,CAAC,gBAChD,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACd,uBAAC,mBAAS,aAAG,YACR,YACF,EACP,uBAAC,eAAI,kBAAC,SAAS,QAAC,IAAI,QAAC,cAAc,EAAC,QAAQ,gBAC1C,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACd,uBAAC,qBAAU,kBAAC,OAAO,EAAC,IAAI,uEAAkD,YACrE,YACF,EACP,uBAAC,eAAI,kBAAC,SAAS,QAAC,IAAI,QAAC,cAAc,EAAC,QAAQ,EAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,gBACvD,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACd,uBAAC,qBAAU,cACR,WAAW,aAAX,WAAW,cAAX,WAAW,GACV,2EAA2E,WAClE,YACR,YACF,EACN,eAAe,IAAI,CAClB,uBAAC,eAAI,kBAAC,SAAS,QAAC,IAAI,QAAC,cAAc,EAAC,QAAQ,gBAC1C,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,CAAC,gBACd,uBAAC,iBAAM,kBACL,OAAO,EAAC,WAAW,EACnB,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,eAAe,EAAE,CAAC,oDAG3D,YACJ,YACF,CACR,MA/BoC,GAAG,CAgCnC,YACH,CACP,CAAC"}
1
+ {"version":3,"file":"BlockingErrorPage.js","sourceRoot":"","sources":["../../../../src/lib/components/ErrorBoundary/components/BlockingErrorPage.tsx"],"names":[],"mappings":";;;;AAAA,2EAAyE;AACzE,+EAA0C;AAC1C,mFAA8C;AAM9C,kBAAe,CAAC,EAAE,WAAW,EAAE,eAAe,EAAS,EAAE,EAAE,CAAC,CAC1D,uBAAC,oBAAU,IACT,IAAI,EAAE,uBAAC,mBAAS,aAAG,EACnB,KAAK,EAAC,2CAAsC,EAC5C,WAAW,EAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,2EAA2E,EACxG,aAAa,EAAG,eAAe,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAA,sCAAkB,EAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAC/G,WAAW,EAAE,uBAAuB,WACpC,CAAE,CAAC"}
@@ -6,7 +6,7 @@ declare type Props = {
6
6
  handleClose: React.MouseEventHandler<HTMLButtonElement>;
7
7
  /** The popup title */
8
8
  title: string;
9
- /** @see FilterModalConfig */
9
+ /** @see {@link FilterModalConfig} */
10
10
  filterModalConfig?: FilterModalConfig<any, any>;
11
11
  /** The popup height */
12
12
  height?: string;
@@ -1,7 +1,8 @@
1
1
  declare type Props = {
2
2
  /** The email to which the assistance button will ask to send an email */
3
3
  assistanceEmail?: string;
4
+ onExit?: (exitAction: () => void) => void;
4
5
  };
5
6
  /** SelfCare Footer component */
6
- declare const Footer: ({ assistanceEmail }: Props) => JSX.Element;
7
+ declare const Footer: ({ assistanceEmail, onExit }: Props) => JSX.Element;
7
8
  export default Footer;
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
+ const assistanceService_1 = require("../../services/assistanceService");
6
7
  const PagoPaIcon_1 = (0, tslib_1.__importDefault)(require("../icons/PagoPaIcon"));
7
8
  /** SelfCare Footer component */
8
- const Footer = ({ assistanceEmail }) => ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "footer", sx: {
9
+ const Footer = ({ assistanceEmail, onExit = exitAction => exitAction() }) => ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "footer", sx: {
9
10
  pt: '32px',
10
11
  height: '156px',
11
12
  mt: 'auto',
@@ -26,22 +27,26 @@ const Footer = ({ assistanceEmail }) => ((0, jsx_runtime_1.jsxs)(material_1.Box,
26
27
  lineHeight: '15px',
27
28
  textAlign: 'left',
28
29
  padding: '0px',
29
- }, component: "div" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ href: "https://www.pagopa.it/it/privacy-policy/", underline: "none", sx: {
30
+ }, component: "div" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ onClick: () => onExit(() => window.location.assign('https://www.pagopa.it/it/privacy-policy/')), underline: "none", sx: {
30
31
  marginRight: '10px',
31
32
  color: '#9BB7CB !important',
32
33
  textDecoration: 'none !important',
33
- } }, { children: 'Privacy Policy ' }), void 0), (0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ href: "https://www.pagopa.it/it/termini-e-condizioni-di-utilizzo-del-sito/", underline: "none", sx: {
34
+ cursor: 'pointer'
35
+ } }, { children: 'Privacy Policy ' }), void 0), (0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ onClick: () => onExit(() => window.location.assign('https://www.pagopa.it/it/termini-e-condizioni-di-utilizzo-del-sito/')), underline: "none", sx: {
34
36
  margin: '10px',
35
37
  color: '#9BB7CB !important',
36
38
  textDecoration: 'none !important',
37
- } }, { children: 'Termini e condizioni d’uso del sito ' }), void 0), (0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ href: "https://www.pagopa.it/static/781646994f1f8ddad2d95af3aaedac3d/Sicurezza-delle-informazioni_PagoPA-S.p.A..pdft", underline: "none", sx: {
39
+ cursor: 'pointer'
40
+ } }, { children: 'Termini e condizioni d’uso del sito ' }), void 0), (0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ onClick: () => onExit(() => window.location.assign('https://www.pagopa.it/static/781646994f1f8ddad2d95af3aaedac3d/Sicurezza-delle-informazioni_PagoPA-S.p.A..pdft')), underline: "none", sx: {
38
41
  marginRight: '10px',
39
42
  color: '#9BB7CB !important',
40
43
  textDecoration: 'none !important',
41
- } }, { children: 'Sicurezza delle informazioni ' }), void 0), assistanceEmail && ((0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ href: `mailto:${assistanceEmail}`, underline: "none", sx: {
44
+ cursor: 'pointer'
45
+ } }, { children: 'Sicurezza delle informazioni ' }), void 0), assistanceEmail && ((0, jsx_runtime_1.jsx)(material_1.Link, Object.assign({ onClick: () => onExit(() => window.location.assign((0, assistanceService_1.buildAssistanceURI)(assistanceEmail))), underline: "none", sx: {
42
46
  margin: '10px',
43
47
  color: '#9BB7CB !important',
44
48
  textDecoration: 'none !important',
49
+ cursor: 'pointer'
45
50
  } }, { children: 'Assistenza ' }), void 0))] }), void 0) }), void 0) }), void 0)] }), void 0));
46
51
  exports.default = Footer;
47
52
  //# sourceMappingURL=Footer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../src/lib/components/Footer/Footer.tsx"],"names":[],"mappings":";;;;AAAA,4CAA4D;AAC5D,kFAA6C;AAO7C,gCAAgC;AAChC,MAAM,MAAM,GAAG,CAAC,EAAE,eAAe,EAAS,EAAE,EAAE,CAAC,CAC7C,wBAAC,cAAG,kBACF,SAAS,EAAC,QAAQ,EAClB,EAAE,EAAE;QACF,EAAE,EAAE,MAAM;QACV,MAAM,EAAE,OAAO;QACf,EAAE,EAAE,MAAM;QACV,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,UAAU;KACrB,iBAED,uBAAC,eAAI,kBAAC,SAAS,QAAC,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,gBAC5D,wBAAC,cAAG,kBAAC,EAAE,EAAE,EAAE,KAA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AAM,EAChB,EAAE,EAAE;gCACF,MAAM,EAAE,MAAM;gCACd,KAAK,EAAE,oBAAoB;gCAC3B,cAAc,EAAE,iBAAiB;6BAClC,gBAEA,sCAAsC,YAClC,EACP,uBAAC,eAAI,kBACH,IAAI,EAAC,+GAA+G,EACpH,SAAS,EAAC,MAAM,EAChB,EAAE,EAAE;gCACF,WAAW,EAAE,MAAM;gCACnB,KAAK,EAAE,oBAAoB;gCAC3B,cAAc,EAAE,iBAAiB;6BAClC,gBAEA,+BAA+B,YAC3B,EACN,eAAe,IAAI,CAClB,uBAAC,eAAI,kBACH,IAAI,EAAE,UAAU,eAAe,EAAE,EACjC,SAAS,EAAC,MAAM,EAChB,EAAE,EAAE;gCACF,MAAM,EAAE,MAAM;gCACd,KAAK,EAAE,oBAAoB;gCAC3B,cAAc,EAAE,iBAAiB;6BAClC,gBAEA,aAAa,YACT,CACR,aACU,YACT,YACD,aACH,CACP,CAAC;AAEF,kBAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../src/lib/components/Footer/Footer.tsx"],"names":[],"mappings":";;;;AAAA,4CAA4D;AAC5D,wEAAsE;AACtE,kFAA6C;AAQ7C,gCAAgC;AAChC,MAAM,MAAM,GAAG,CAAC,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,EAAQ,EAAE,EAAE,CAAC,CACjF,wBAAC,cAAG,kBACF,SAAS,EAAC,QAAQ,EAClB,EAAE,EAAE;QACF,EAAE,EAAE,MAAM;QACV,MAAM,EAAE,OAAO;QACf,EAAE,EAAE,MAAM;QACV,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,UAAU;KACrB,iBAED,uBAAC,eAAI,kBAAC,SAAS,QAAC,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,gBAC5D,wBAAC,cAAG,kBAAC,EAAE,EA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AAc,EAAE,iBAAiB;gCACjC,MAAM,EAAE,SAAS;6BAClB,gBAEA,iBAAiB,YACb,EACP,uBAAC,eAAI,kBACH,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,qEAAqE,CAAC,CAAC,EAC1H,SAAS,EAAC,MAAM,EAChB,EAAE,EAAE;gCACF,MAAM,EAAE,MAAM;gCACd,KAAK,EAAE,oBAAoB;gCAC3B,cAAc,EAAE,iBAAiB;gCACjC,MAAM,EAAE,SAAS;6BAClB,gBAEA,sCAAsC,YAClC,EACP,uBAAC,eAAI,kBACH,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,+GAA+G,CAAC,CAAC,EACpK,SAAS,EAAC,MAAM,EAChB,EAAE,EAAE;gCACF,WAAW,EAAE,MAAM;gCACnB,KAAK,EAAE,oBAAoB;gCAC3B,cAAc,EAAE,iBAAiB;gCACjC,MAAM,EAAE,SAAS;6BAClB,gBAEA,+BAA+B,YAC3B,EACN,eAAe,IAAI,CAClB,uBAAC,eAAI,kBACH,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAA,sCAAkB,EAAC,eAAe,CAAC,CAAC,CAAC,EACxF,SAAS,EAAC,MAAM,EAChB,EAAE,EAAE;gCACF,MAAM,EAAE,MAAM;gCACd,KAAK,EAAE,oBAAoB;gCAC3B,cAAc,EAAE,iBAAiB;gCACjC,MAAM,EAAE,SAAS;6BAClB,gBAEA,aAAa,YACT,CACR,aACU,YACT,YACD,aACH,CACP,CAAC;AAEF,kBAAe,MAAM,CAAC"}
@@ -1,4 +1,3 @@
1
- import { GridSize } from '@mui/material';
2
1
  import { Variant } from '@mui/material/styles/createTypography';
3
2
  declare type Props = {
4
3
  /** The title to show */
@@ -8,14 +7,18 @@ declare type Props = {
8
7
  /** The margin top of the title */
9
8
  mtTitle?: number;
10
9
  /** The margin bottom of the title */
11
- mbTitle?: GridSize;
10
+ mbTitle?: number;
12
11
  /** The margin bottom of the subtitle */
13
12
  mbSubTitle?: number;
14
13
  /** The variant of the Typografy used for the title */
15
14
  variantTitle?: Variant;
16
15
  /** The variant of the Typografy used for the subtitle */
17
16
  variantSubTitle?: Variant;
17
+ /** The variant of the title font size */
18
+ titleFontSize?: string;
19
+ /** The variant of the subtitle font size */
20
+ subTitleFontSize?: string;
18
21
  };
19
22
  /** Selfcare's page title */
20
- export default function TitleBox({ title, subTitle, mbTitle, mtTitle, mbSubTitle, variantTitle, variantSubTitle, }: Props): JSX.Element;
23
+ export default function TitleBox({ title, subTitle, mbTitle, mtTitle, mbSubTitle, variantTitle, variantSubTitle, titleFontSize, subTitleFontSize }: Props): JSX.Element;
21
24
  export {};
@@ -6,8 +6,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const material_1 = require("@mui/material");
7
7
  const material_2 = require("@mui/material");
8
8
  /** Selfcare's page title */
9
- function TitleBox({ title, subTitle, mbTitle = 2, mtTitle, mbSubTitle, variantTitle = 'h1', variantSubTitle = 'h5', }) {
10
- return ((0, jsx_runtime_1.jsxs)(material_2.Grid, Object.assign({ container: true, mt: mtTitle }, { children: [(0, jsx_runtime_1.jsx)(material_2.Grid, Object.assign({ item: true, xs: 12, mb: mbTitle }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: variantTitle }, { children: title }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_2.Grid, Object.assign({ item: true, xs: 12, mb: mbSubTitle }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: variantSubTitle, sx: { fontSize: '18px' } }, { children: subTitle }), void 0) }), void 0)] }), void 0));
9
+ function TitleBox({ title, subTitle, mbTitle = 2, mtTitle, mbSubTitle, variantTitle = 'h1', variantSubTitle = 'h5', titleFontSize, subTitleFontSize = '18px' }) {
10
+ return ((0, jsx_runtime_1.jsxs)(material_2.Grid, Object.assign({ container: true, mt: mtTitle }, { children: [(0, jsx_runtime_1.jsx)(material_2.Grid, Object.assign({ item: true, xs: 12, mb: mbTitle }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: variantTitle, sx: { fontSize: titleFontSize } }, { children: title }), void 0) }), void 0), (0, jsx_runtime_1.jsx)(material_2.Grid, Object.assign({ item: true, xs: 12, mb: mbSubTitle }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: variantSubTitle, sx: { fontSize: subTitleFontSize } }, { children: subTitle }), void 0) }), void 0)] }), void 0));
11
11
  }
12
12
  exports.default = TitleBox;
13
13
  //# sourceMappingURL=TitleBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TitleBox.js","sourceRoot":"","sources":["../../src/lib/components/TitleBox.tsx"],"names":[],"mappings":";;;AAAA,4BAA4B;AAC5B,uCAAuC;AACvC,4CAAqD;AACrD,4CAAqC;AAoBrC,4BAA4B;AAC5B,SAAwB,QAAQ,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,CAAC,EACX,OAAO,EACP,UAAU,EACV,YAAY,GAAG,IAAI,EACnB,eAAe,GAAG,IAAI,GAChB;IACN,OAAO,CACL,wBAAC,eAAI,kBAAC,SAAS,QAAC,EAAE,EAAE,OAAO,iBACzB,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,gBAC5B,uBAAC,qBAAU,kBAAC,OAAO,EAAE,YAAY,gBAAG,KAAK,YAAc,YAClD,EACP,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,gBAC/B,uBAAC,qBAAU,kBAAC,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAC3D,QAAQ,YACE,YACR,aACF,CACR,CAAC;AACJ,CAAC;AArBD,2BAqBC"}
1
+ {"version":3,"file":"TitleBox.js","sourceRoot":"","sources":["../../src/lib/components/TitleBox.tsx"],"names":[],"mappings":";;;AAAA,4BAA4B;AAC5B,uCAAuC;AACvC,4CAA2C;AAC3C,4CAAqC;AAwBrC,4BAA4B;AAC5B,SAAwB,QAAQ,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,CAAC,EACX,OAAO,EACP,UAAU,EACV,YAAY,GAAG,IAAI,EACnB,eAAe,GAAG,IAAI,EACtB,aAAa,EACb,gBAAgB,GAAG,MAAM,EACnB;IACN,OAAO,CACL,wBAAC,eAAI,kBAAC,SAAS,QAAC,EAAE,EAAE,OAAO,iBACzB,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,gBAC5B,uBAAC,qBAAU,kBAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,EAAC,QAAQ,EAAE,aAAa,EAAC,gBAAG,KAAK,YAAc,YACjF,EACP,uBAAC,eAAI,kBAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,gBAC/B,uBAAC,qBAAU,kBAAC,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBACrE,QAAQ,YACE,YACR,aACF,CACR,CAAC;AACJ,CAAC;AAvBD,2BAuBC"}
@@ -0,0 +1,8 @@
1
+ /** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
2
+ It allows to intercept when the user try to exit from the current page and ask him if he wants to continue or not.
3
+
4
+ To use this feature you have to put UnloadEventHandler in your App as a child of a redux Provider component.
5
+ In order to use this feature you have to use the custom hook useUnloadEventInterceptor.
6
+ @see {@link useUnloadEventInterceptor}
7
+ */
8
+ export default function UnloadEventHandler(): JSX.Element;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_redux_1 = require("react-redux");
6
+ const useUnloadEventInterceptor_1 = require("../hooks/useUnloadEventInterceptor");
7
+ const appStateSlice_1 = require("../redux/slices/appStateSlice");
8
+ const SessionModal_1 = (0, tslib_1.__importDefault)(require("./SessionModal"));
9
+ /** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
10
+ It allows to intercept when the user try to exit from the current page and ask him if he wants to continue or not.
11
+
12
+ To use this feature you have to put UnloadEventHandler in your App as a child of a redux Provider component.
13
+ In order to use this feature you have to use the custom hook useUnloadEventInterceptor.
14
+ @see {@link useUnloadEventInterceptor}
15
+ */
16
+ function UnloadEventHandler() {
17
+ var _a, _b;
18
+ const dispatch = (0, react_redux_1.useDispatch)();
19
+ const unloadEventconfiguration = (0, react_redux_1.useSelector)(appStateSlice_1.appStateSelectors.selectUnloadEventConfiguration);
20
+ const { unregisterUnloadEvent } = (0, useUnloadEventInterceptor_1.useUnloadEventInterceptor)();
21
+ const onClose = () => {
22
+ dispatch(appStateSlice_1.appStateActions.closeUnloadEventNotify());
23
+ };
24
+ const onConfirm = () => {
25
+ unregisterUnloadEvent();
26
+ if (unloadEventconfiguration.exitAction) {
27
+ unloadEventconfiguration.exitAction();
28
+ }
29
+ };
30
+ return ((0, jsx_runtime_1.jsx)(SessionModal_1.default, { open: unloadEventconfiguration.enabled && unloadEventconfiguration.open, title: (_a = unloadEventconfiguration.title) !== null && _a !== void 0 ? _a : 'Vuoi davvero uscire?', message: (_b = unloadEventconfiguration.description) !== null && _b !== void 0 ? _b : 'Se esci, la richiesta di assistenza andrà persa.', onConfirm: onConfirm, onConfirmLabel: 'Esci', handleClose: onClose }, void 0));
31
+ }
32
+ exports.default = UnloadEventHandler;
33
+ //# sourceMappingURL=UnloadEventHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnloadEventHandler.js","sourceRoot":"","sources":["../../src/lib/components/UnloadEventHandler.tsx"],"names":[],"mappings":";;;;AAAA,6CAAuD;AACvD,kFAA+E;AAC/E,iEAAmF;AACnF,+EAA0C;AAE1C;;;;;;EAME;AACF,SAAwB,kBAAkB;;IACxC,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,MAAM,wBAAwB,GAAG,IAAA,yBAAW,EAAC,iCAAiB,CAAC,8BAA8B,CAAC,CAAC;IAC/F,MAAM,EAAC,qBAAqB,EAAC,GAAG,IAAA,qDAAyB,GAAE,CAAC;IAE5D,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,QAAQ,CAAC,+BAAe,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACrD,CAAC,CAAC;IACF,MAAM,SAAS,GAAG,GAAG,EAAE;QACrB,qBAAqB,EAAE,CAAC;QACxB,IAAI,wBAAwB,CAAC,UAAU,EAAE;YACvC,wBAAwB,CAAC,UAAU,EAAE,CAAC;SACvC;IACH,CAAC,CAAC;IACF,OAAO,CACL,uBAAC,sBAAY,IACX,IAAI,EAAE,wBAAwB,CAAC,OAAO,IAAI,wBAAwB,CAAC,IAAI,EACvE,KAAK,EAAE,MAAA,wBAAwB,CAAC,KAAK,mCAAI,sBAAsB,EAC/D,OAAO,EACL,MAAA,wBAAwB,CAAC,WAAW,mCAAI,kDAAkD,EAE5F,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,OAAO,WACpB,CACH,CAAC;AACJ,CAAC;AA1BD,qCA0BC"}
@@ -0,0 +1,7 @@
1
+ /** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
2
+ It allows to dispatch User Notifies in order to display a pop up or a toast notification.
3
+
4
+ To use this feature you have to put UserNotifyHandle in your App as a child of a redux Provider component.
5
+ In order to dispatch a User Notify, you have to use the custom hook useUserNotify which will return a fuction to be used to dispatch the User Notify. */
6
+ declare function UserNotifyHandle(): JSX.Element;
7
+ export default UserNotifyHandle;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const react_1 = require("react");
5
+ const react_redux_1 = require("react-redux");
6
+ const __1 = require("..");
7
+ const appStateSlice_1 = require("../redux/slices/appStateSlice");
8
+ /** This feature is based on react-redux library and require to register the reducer build in appStateSlice into the application's redux store.
9
+ It allows to dispatch User Notifies in order to display a pop up or a toast notification.
10
+
11
+ To use this feature you have to put UserNotifyHandle in your App as a child of a redux Provider component.
12
+ In order to dispatch a User Notify, you have to use the custom hook useUserNotify which will return a fuction to be used to dispatch the User Notify. */
13
+ function UserNotifyHandle() {
14
+ var _a, _b;
15
+ const dispatch = (0, react_redux_1.useDispatch)();
16
+ const notifies = (0, react_redux_1.useSelector)(appStateSlice_1.appStateSelectors.selectNotifies);
17
+ const lastNotifyToast = (0, react_1.useRef)();
18
+ const lastNotifyModal = (0, react_1.useRef)();
19
+ const { openModal, openToast } = updateCurrents(lastNotifyModal, lastNotifyToast, notifies);
20
+ const notifyModal = lastNotifyModal.current;
21
+ const notifyToast = lastNotifyToast.current;
22
+ const onClose = (notify) => {
23
+ dispatch(appStateSlice_1.appStateActions.removeNotify(notify));
24
+ if (notify === null || notify === void 0 ? void 0 : notify.onClose) {
25
+ notify.onClose();
26
+ }
27
+ };
28
+ const onConfirm = (notify) => {
29
+ dispatch(appStateSlice_1.appStateActions.removeNotify(notify));
30
+ if (notify === null || notify === void 0 ? void 0 : notify.onConfirm) {
31
+ notify.onConfirm();
32
+ }
33
+ };
34
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(__1.Toast, { open: openToast, title: (_a = notifyToast === null || notifyToast === void 0 ? void 0 : notifyToast.title) !== null && _a !== void 0 ? _a : 'Notify Title', message: notifyToast === null || notifyToast === void 0 ? void 0 : notifyToast.message, logo: notifyToast === null || notifyToast === void 0 ? void 0 : notifyToast.logo, leftBorderColor: notifyToast === null || notifyToast === void 0 ? void 0 : notifyToast.leftBorderColor, onCloseToast: () => onClose(notifyToast) }, void 0), (0, jsx_runtime_1.jsx)(__1.SessionModal, { open: openModal, title: (_b = notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.title) !== null && _b !== void 0 ? _b : 'Notify Title', message: notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.message, onConfirm: () => onConfirm(notifyModal), onConfirmLabel: notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.confirmLabel, handleClose: () => onClose(notifyModal), onCloseLabel: notifyModal === null || notifyModal === void 0 ? void 0 : notifyModal.closeLabel }, void 0)] }, void 0));
35
+ }
36
+ exports.default = UserNotifyHandle;
37
+ function updateCurrents(lastNotifyModalRef, lastNotifyToastRef, notifies) {
38
+ const lastNotifyToast = notifies.find((e) => e.component === 'Toast');
39
+ const lastNotifySessionModal = notifies.find((e) => e.component === 'SessionModal');
40
+ const openToast = !!lastNotifyToast;
41
+ const openModal = !!lastNotifySessionModal;
42
+ if (lastNotifySessionModal && lastNotifySessionModal !== (lastNotifyModalRef === null || lastNotifyModalRef === void 0 ? void 0 : lastNotifyModalRef.current)) {
43
+ // eslint-disable-next-line functional/immutable-data
44
+ lastNotifyModalRef.current = lastNotifySessionModal;
45
+ }
46
+ if (lastNotifyToast && lastNotifyToast !== (lastNotifyToastRef === null || lastNotifyToastRef === void 0 ? void 0 : lastNotifyToastRef.current)) {
47
+ // eslint-disable-next-line functional/immutable-data
48
+ lastNotifyToastRef.current = lastNotifyToast;
49
+ }
50
+ return {
51
+ openToast,
52
+ openModal,
53
+ };
54
+ }
55
+ //# sourceMappingURL=UserNotifyHandle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserNotifyHandle.js","sourceRoot":"","sources":["../../src/lib/components/UserNotifyHandle.tsx"],"names":[],"mappings":";;;AAAA,iCAAiD;AACjD,6CAAuD;AACvD,0BAAyC;AAEzC,iEAAmF;AAEnF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,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CAAA,EAAE;QACtE,qDAAqD;QACrD,kBAAkB,CAAC,OAAO,GAAG,eAAe,CAAC;KAC9C;IACD,OAAO;QACL,SAAS;QACT,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { SvgIconTypeMap } from '@mui/material/SvgIcon';
2
+ import { DefaultComponentProps } from '@mui/material/OverridableComponent';
3
+ declare const _default: (props: DefaultComponentProps<SvgIconTypeMap>) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const SvgIcon_1 = (0, tslib_1.__importDefault)(require("@mui/material/SvgIcon"));
6
+ exports.default = (props) => ((0, jsx_runtime_1.jsxs)(SvgIcon_1.default, Object.assign({ width: "120", height: "120", viewBox: "0 0 120 120", sx: { width: '120px', height: '120px' }, fill: "none" }, props, { children: [(0, jsx_runtime_1.jsx)("mask", Object.assign({ id: "mask0_4967_20179", style: { maskType: 'alpha' }, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "120", height: "120" }, { children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M59.9565 0.506348C27.1467 0.506348 0.452393 27.2007 0.452393 60.0105C0.452393 92.8203 27.1467 119.515 59.9565 119.515C92.7663 119.515 119.461 92.8203 119.461 60.0105C119.461 27.2007 92.7663 0.506348 59.9565 0.506348ZM59.9565 113.569C30.4229 113.569 6.39795 89.5441 6.39795 60.0105C6.39795 30.4768 30.4229 6.45191 59.9565 6.45191C89.4902 6.45191 113.515 30.4768 113.515 60.0105C113.515 89.5441 89.4902 113.569 59.9565 113.569ZM52.7248 68.2129L75.5363 45.5227C76.7012 44.3579 78.5698 44.3579 79.7346 45.5227C80.8752 46.6876 80.8752 48.5562 79.7103 49.721L54.7875 74.4982C54.2051 75.0807 53.4528 75.3719 52.7005 75.3719C51.924 75.3719 51.1717 75.0807 50.5892 74.4982L40.1784 64.0146C39.0379 62.8498 39.0379 60.9569 40.2027 59.8163C41.3675 58.6758 43.2362 58.6758 44.401 59.8406L52.7248 68.2129Z", fill: "white" }, void 0) }), void 0), (0, jsx_runtime_1.jsx)("g", Object.assign({ mask: "url(#mask0_4967_20179)" }, { children: (0, jsx_runtime_1.jsx)("rect", { x: "-8.92554", y: "-23.8018", width: "144.793", height: "152.727", fill: "#00C5CA" }, void 0) }), void 0)] }), void 0));
7
+ //# sourceMappingURL=CheckIllustrationIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckIllustrationIcon.js","sourceRoot":"","sources":["../../../src/lib/components/icons/CheckIllustrationIcon.tsx"],"names":[],"mappings":";;;;AAAA,iFAAgE;AAGhE,kBAAe,CAAC,KAA4C,EAAE,EAAE,CAAC,CAC/D,wBAAC,iBAAO,kBACN,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,EACZ,OAAO,EAAC,aAAa,EACrB,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EACvC,IAAI,EAAC,MAAM,IACP,KAAK,eAET,+CACE,EAAE,EAAC,kBAAkB,EACrB,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAC5B,SAAS,EAAC,gBAAgB,EAC1B,CAAC,EAAC,GAAG,EACL,CAAC,EAAC,GAAG,EACL,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,gBAEZ,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,yxBAAyxB,EAC3xB,IAAI,EAAC,OAAO,WACZ,YACG,EACP,4CAAG,IAAI,EAAC,wBAAwB,gBAC9B,iCAAM,CAAC,EAAC,UAAU,EAAC,CAAC,EAAC,UAAU,EAAC,KAAK,EAAC,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,IAAI,EAAC,SAAS,WAAG,YAChF,aACI,CACX,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare const icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
2
+ muiName: string;
3
+ };
4
+ export default icon;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const material_1 = require("@mui/material");
5
+ const icon = (0, material_1.createSvgIcon)((0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M29.3337 10.5346V21.6013L21.467 29.3346H10.5337L2.66699 21.6013V10.5346L10.5337 2.66797H21.467L29.3337 10.5346ZM15.3337 7.6013V18.9346H16.9337V7.6013H15.3337ZM16.8003 24.4013H15.2003V22.0013H16.8003V24.4013ZM20.9337 4.0013L28.0003 11.068V21.068L20.9337 28.0013H11.067L4.00033 21.068V11.068L11.067 4.0013H20.9337Z", fill: "#D1344C" }, void 0), 'Fault');
6
+ exports.default = icon;
7
+ //# sourceMappingURL=FaultIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FaultIcon.js","sourceRoot":"","sources":["../../../src/lib/components/icons/FaultIcon.tsx"],"names":[],"mappings":";;;AAAA,4CAA8C;AAE9C,MAAM,IAAI,GAAG,IAAA,wBAAa,EACxB,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,0TAA0T,EAC5T,IAAI,EAAC,SAAS,WACd,EACF,OAAO,CACR,CAAC;AAEF,kBAAe,IAAI,CAAC"}