@arquimedes.co/eureka-forms 2.0.75 → 2.0.77

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/dist/App/App.d.ts CHANGED
@@ -31,6 +31,11 @@ export interface AppProps {
31
31
  customStepProps?: Record<string, unknown>;
32
32
  /** Classifiers dict */
33
33
  classifiers?: Record<string, Classifier>;
34
+ /** Custom Confirmation Content */
35
+ customConfirmation?: (confirmation: {
36
+ url: string;
37
+ caseNumber: string;
38
+ }, renderIcon: () => JSX.Element, renderConfirmation: () => JSX.Element | void, renderLink: () => JSX.Element | void) => JSX.Element;
34
39
  /** Custom function to call on send */
35
40
  customSubmit?: (values: Record<string, unknown>, reload: () => void) => Promise<void>;
36
41
  /** Custom submit function, when passed it is called */
@@ -1,10 +1,12 @@
1
1
  /// <reference types="react" />
2
+ import { AppProps } from '../../App/App';
2
3
  interface ConfirmationDialogProps {
3
4
  confirmation: {
4
5
  case: string;
5
6
  url: string;
6
7
  };
8
+ customConfirmation?: AppProps['customConfirmation'];
7
9
  onClose: () => void;
8
10
  }
9
- declare function ConfirmationDialog({ confirmation, onClose, }: ConfirmationDialogProps): JSX.Element;
11
+ declare function ConfirmationDialog({ onClose, confirmation, customConfirmation, }: ConfirmationDialogProps): JSX.Element;
10
12
  export default ConfirmationDialog;
@@ -32,7 +32,7 @@ import { useContext, useMemo } from 'react';
32
32
  import { mapDraftEntities } from '../../Utils/DraftFunctions';
33
33
  import FormContext from '../../Contexts/FormContext';
34
34
  function ConfirmationDialog(_a) {
35
- var confirmation = _a.confirmation, onClose = _a.onClose;
35
+ var onClose = _a.onClose, confirmation = _a.confirmation, customConfirmation = _a.customConfirmation;
36
36
  var _b = useAppSelector(function (state) { return state.global; }), formStyle = _b.formStyle, global = __rest(_b, ["formStyle"]);
37
37
  var form = useContext(FormContext);
38
38
  var dependencies = useAppSelector(function (state) { return state.site.dependencies; });
@@ -44,6 +44,32 @@ function ConfirmationDialog(_a) {
44
44
  }, JSON.parse(JSON.stringify(global.confirmation.confirmationMessage)))));
45
45
  }, [global.confirmation, dependencies, form]);
46
46
  var hasText = editorState.getCurrentContent().hasText();
47
+ var renderIcon = function () {
48
+ return (_jsx("div", __assign({ className: styles.checkContainer, style: {
49
+ color: formStyle.primaryColor,
50
+ paddingTop: widthStats.isMobile ? '20px' : '30px',
51
+ } }, { children: _jsx(CheckCircleOutlineRoundedIcon, { fontSize: "inherit", style: {
52
+ fontSize: widthStats.isMobile ? '100px' : '160px',
53
+ } }) })));
54
+ };
55
+ var renderConfirmation = function () {
56
+ if (hasText) {
57
+ return (_jsx("div", __assign({ className: styles.messageContainer, style: {
58
+ fontSize: widthStats.isMobile ? '1.1rem' : '1.4rem',
59
+ padding: widthStats.isMobile ? '5px 0px' : '20px 0px',
60
+ } }, { children: _jsx(Editor, { editorClassName: 'Erk-Forms-Confirmation', editorState: editorState, readOnly: true, toolbarHidden: true }) })));
61
+ }
62
+ };
63
+ var renderLink = function () {
64
+ if (global.confirmation.showLink) {
65
+ return (_jsxs(_Fragment, { children: [_jsx("div", __assign({ className: widthStats.isMobile
66
+ ? styles.mobileLinkContainer
67
+ : styles.linkContainer }, { children: "Puedes consultar el estado aqui:" })), _jsx("a", __assign({ className: styles.url, "data-testid": "ResUrl", target: "_blank", href: confirmation.url, style: {
68
+ color: '#293241',
69
+ fontSize: widthStats.isMobile ? '1rem' : '1.2rem',
70
+ } }, { children: confirmation.url }))] }));
71
+ }
72
+ };
47
73
  return (_jsx(Dialog, __assign({ PaperProps: {
48
74
  style: {
49
75
  borderRadius: '20px',
@@ -55,27 +81,9 @@ function ConfirmationDialog(_a) {
55
81
  padding: widthStats.isMobile ? '0px 20px' : '0px 30px',
56
82
  } }, { children: [_jsx("div", __assign({ className: styles.closeIcon, onClick: function () {
57
83
  onClose();
58
- } }, { children: _jsx(CloseRoundedIcon, { fontSize: "inherit" }) })), _jsxs("div", __assign({ className: styles.container }, { children: [_jsx("div", __assign({ className: styles.checkContainer, style: {
59
- color: formStyle.primaryColor,
60
- paddingTop: widthStats.isMobile ? '20px' : '30px',
61
- } }, { children: _jsx(CheckCircleOutlineRoundedIcon, { fontSize: "inherit", style: {
62
- fontSize: widthStats.isMobile
63
- ? '100px'
64
- : '160px',
65
- } }) })), hasText && (_jsx("div", __assign({ className: styles.messageContainer, style: {
66
- fontSize: widthStats.isMobile
67
- ? '1.1rem'
68
- : '1.4rem',
69
- padding: widthStats.isMobile
70
- ? '5px 0px'
71
- : '20px 0px',
72
- } }, { children: _jsx(Editor, { editorClassName: 'Erk-Forms-Confirmation', editorState: editorState, readOnly: true, toolbarHidden: true }) }))), global.confirmation.showLink && (_jsxs(_Fragment, { children: [_jsx("div", __assign({ className: widthStats.isMobile
73
- ? styles.mobileLinkContainer
74
- : styles.linkContainer }, { children: "Puedes consultar el estado aqui:" })), _jsx("a", __assign({ className: styles.url, "data-testid": "ResUrl", target: "_blank", href: confirmation.url, style: {
75
- color: '#293241',
76
- fontSize: widthStats.isMobile
77
- ? '1rem'
78
- : '1.2rem',
79
- } }, { children: confirmation.url }))] }))] }))] })) })));
84
+ } }, { children: _jsx(CloseRoundedIcon, { fontSize: "inherit" }) })), !customConfirmation && (_jsxs("div", __assign({ className: styles.container }, { children: [renderIcon(), renderConfirmation(), renderLink()] }))), customConfirmation === null || customConfirmation === void 0 ? void 0 : customConfirmation({
85
+ url: confirmation.url,
86
+ caseNumber: confirmation.case,
87
+ }, renderIcon, renderConfirmation, renderLink)] })) })));
80
88
  }
81
89
  export default ConfirmationDialog;
@@ -198,19 +198,20 @@ function CustomSelect(_a) {
198
198
  var _x = useState(false), open = _x[0], setOpen = _x[1];
199
199
  var ref = React.useRef(null);
200
200
  var handleChange = useCallback(function (value) {
201
- if (value.days === 0) {
202
- delete value.days;
201
+ var time = __assign({}, value);
202
+ if (time.days === 0) {
203
+ delete time.days;
203
204
  }
204
205
  if (value.hours === 0) {
205
- delete value.hours;
206
+ delete time.hours;
206
207
  }
207
- if (value.minutes === 0) {
208
- delete value.minutes;
208
+ if (time.minutes === 0) {
209
+ delete time.minutes;
209
210
  }
210
211
  if (working !== undefined) {
211
- value.working = working;
212
+ time.working = working;
212
213
  }
213
- onChange === null || onChange === void 0 ? void 0 : onChange(value);
214
+ onChange === null || onChange === void 0 ? void 0 : onChange(time);
214
215
  }, []);
215
216
  var calcLabel = function () {
216
217
  var parts = [label];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version": "2.0.75",
4
+ "version": "2.0.77",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",