@arquimedes.co/eureka-forms 2.0.108 → 2.0.110
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.css
CHANGED
package/dist/App/AppHooks.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Form, Organization } from '../@Types';
|
|
2
2
|
import { AppProps } from './App';
|
|
3
3
|
import { Branding } from '../@Types/Branding';
|
|
4
|
-
export declare const useSetupApp: (isEmbedded: boolean, { preview, internal, postview, partial, editable, handleConfirmed, customSteps, valuesData, apiKey, formData, classifiers, ...others }: Omit<AppProps, 'isWidget'>) => {
|
|
4
|
+
export declare const useSetupApp: (isEmbedded: boolean, { preview, internal, postview, partial, editable, handleConfirmed, customSteps, valuesData, apiKey, formData, classifiers, idCurrentAgent, ...others }: Omit<AppProps, 'isWidget'>) => {
|
|
5
5
|
form: Form | undefined | null;
|
|
6
6
|
organization: Organization | undefined | null;
|
|
7
7
|
branding: Branding | undefined;
|
package/dist/App/AppHooks.js
CHANGED
|
@@ -70,7 +70,7 @@ import { createNextState } from '@reduxjs/toolkit';
|
|
|
70
70
|
import { BaseConfirmationMessage } from '../Contexts/FormContext';
|
|
71
71
|
export var useSetupApp = function (isEmbedded, _a) {
|
|
72
72
|
var _b;
|
|
73
|
-
var preview = _a.preview, internal = _a.internal, postview = _a.postview, partial = _a.partial, editable = _a.editable, handleConfirmed = _a.handleConfirmed, customSteps = _a.customSteps, valuesData = _a.valuesData, apiKey = _a.apiKey, formData = _a.formData, classifiers = _a.classifiers, others = __rest(_a, ["preview", "internal", "postview", "partial", "editable", "handleConfirmed", "customSteps", "valuesData", "apiKey", "formData", "classifiers"]);
|
|
73
|
+
var preview = _a.preview, internal = _a.internal, postview = _a.postview, partial = _a.partial, editable = _a.editable, handleConfirmed = _a.handleConfirmed, customSteps = _a.customSteps, valuesData = _a.valuesData, apiKey = _a.apiKey, formData = _a.formData, classifiers = _a.classifiers, idCurrentAgent = _a.idCurrentAgent, others = __rest(_a, ["preview", "internal", "postview", "partial", "editable", "handleConfirmed", "customSteps", "valuesData", "apiKey", "formData", "classifiers", "idCurrentAgent"]);
|
|
74
74
|
var _c = useState(undefined), form = _c[0], setForm = _c[1];
|
|
75
75
|
var _d = useState(undefined), organization = _d[0], setOrganization = _d[1];
|
|
76
76
|
var dispatch = useAppDispatch();
|
|
@@ -183,7 +183,7 @@ export var useSetupApp = function (isEmbedded, _a) {
|
|
|
183
183
|
: __assign(__assign({}, InternalFormStyle), ((_d = form === null || form === void 0 ? void 0 : form.style) !== null && _d !== void 0 ? _d : {})), confirmation: {
|
|
184
184
|
confirmationMessage: (_e = form.confirmationMessage) !== null && _e !== void 0 ? _e : BaseConfirmationMessage,
|
|
185
185
|
showLink: (_f = form.showLink) !== null && _f !== void 0 ? _f : false,
|
|
186
|
-
}, internal: !!internal, idOrganization: idOrganization, preview: !!preview, partial: !!partial, postview: !!postview, editable: !!(editable !== null && editable !== void 0 ? editable : true), values: values }, calcInitialSections(form)), { dependencies: calcDependencies(form.steps, customSteps, form.steps, dependencies, values), countryCode: countryCode })));
|
|
186
|
+
}, internal: !!internal, idOrganization: idOrganization, idCurrentAgent: idCurrentAgent, preview: !!preview, partial: !!partial, postview: !!postview, editable: !!(editable !== null && editable !== void 0 ? editable : true), values: values }, calcInitialSections(form)), { dependencies: calcDependencies(form.steps, customSteps, form.steps, dependencies, values), countryCode: countryCode })));
|
|
187
187
|
return [2 /*return*/];
|
|
188
188
|
}
|
|
189
189
|
});
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { createContext, useContext, useEffect, useMemo } from 'react';
|
|
14
14
|
import { IdFormContext } from '../../App/App';
|
|
15
15
|
import { DraftApi } from '../../Services/DraftService';
|
|
@@ -39,9 +39,15 @@ function SmartDraftRenderer(_a) {
|
|
|
39
39
|
if (mapped && !postview)
|
|
40
40
|
onChange === null || onChange === void 0 ? void 0 : onChange(mapped);
|
|
41
41
|
}, [mapped]);
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
var _c = useMemo(function () {
|
|
43
|
+
var content = convertFromRaw(cleanUpDraftParams(isFetching ? draft : mapped !== null && mapped !== void 0 ? mapped : draft));
|
|
44
|
+
return {
|
|
45
|
+
editorState: EditorState.createWithContent(content),
|
|
46
|
+
isEmpty: !content.hasText(),
|
|
47
|
+
};
|
|
48
|
+
}, [mapped, draft, isFetching]), editorState = _c.editorState, isEmpty = _c.isEmpty;
|
|
49
|
+
if (isEmpty)
|
|
50
|
+
return _jsx(_Fragment, {});
|
|
45
51
|
return (_jsx("div", __assign({ style: { margin: margin } }, { children: _jsx(DraftLoadingContext.Provider, __assign({ value: !postview && isFetching }, { children: _jsx(Editor, { readOnly: true, toolbarHidden: true, editorState: editorState, editorClassName: 'Erk-Forms-Draft', customDecorators: customDecorators }) })) })));
|
|
46
52
|
}
|
|
47
53
|
export default SmartDraftRenderer;
|
package/package.json
CHANGED