@arquimedes.co/eureka-forms 2.0.109 → 2.0.111-test
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 +1 -1
- package/dist/App/App.d.ts +1 -0
- package/dist/App/AppHooks.js +12 -4
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +1 -0
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +1 -0
- package/dist/Form/FormFunctions.js +4 -2
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +10 -4
- package/package.json +1 -1
package/dist/App/App.css
CHANGED
package/dist/App/App.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export interface AppProps {
|
|
|
39
39
|
/** Custom Confirmation Content */
|
|
40
40
|
customConfirmation?: (confirmation: {
|
|
41
41
|
url: string;
|
|
42
|
+
idTicket: string;
|
|
42
43
|
caseNumber: string;
|
|
43
44
|
}, renderIcon: () => JSX.Element, renderConfirmation: (state?: EditorState) => JSX.Element | void, renderLink: () => JSX.Element | void, onClose: () => void) => JSX.Element;
|
|
44
45
|
customClientInfoStep?: (props: CustomStepProps) => JSX.Element;
|
package/dist/App/AppHooks.js
CHANGED
|
@@ -144,6 +144,7 @@ export var useSetupApp = function (isEmbedded, _a) {
|
|
|
144
144
|
}
|
|
145
145
|
if (form) {
|
|
146
146
|
form = createNextState(form, function (form) {
|
|
147
|
+
var _a;
|
|
147
148
|
var firstSection = form.sections[form.firstSection];
|
|
148
149
|
if (firstSection.steps === undefined &&
|
|
149
150
|
form.rootSteps !== undefined) {
|
|
@@ -153,8 +154,15 @@ export var useSetupApp = function (isEmbedded, _a) {
|
|
|
153
154
|
if (form && classifiers)
|
|
154
155
|
form.classifiers = classifiers;
|
|
155
156
|
var _loop_1 = function (section) {
|
|
156
|
-
for (var
|
|
157
|
-
var idStep = _c
|
|
157
|
+
for (var _c = 0, _d = section.steps; _c < _d.length; _c++) {
|
|
158
|
+
var idStep = _d[_c];
|
|
159
|
+
iterateNestedSteps(idStep, form.steps, function (step, path) {
|
|
160
|
+
step.idSection = section.id;
|
|
161
|
+
step.stepPath = path;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
for (var _e = 0, _f = (_a = form.hiddenSteps) !== null && _a !== void 0 ? _a : []; _e < _f.length; _e++) {
|
|
165
|
+
var idStep = _f[_e];
|
|
158
166
|
iterateNestedSteps(idStep, form.steps, function (step, path) {
|
|
159
167
|
step.idSection = section.id;
|
|
160
168
|
step.stepPath = path;
|
|
@@ -162,8 +170,8 @@ export var useSetupApp = function (isEmbedded, _a) {
|
|
|
162
170
|
}
|
|
163
171
|
};
|
|
164
172
|
/** Assign the idSection to all the forms steps */
|
|
165
|
-
for (var _i = 0,
|
|
166
|
-
var section =
|
|
173
|
+
for (var _i = 0, _b = Object.values(form.sections); _i < _b.length; _i++) {
|
|
174
|
+
var section = _b[_i];
|
|
167
175
|
_loop_1(section);
|
|
168
176
|
}
|
|
169
177
|
var CBRStep = Object.values(form.steps).find(function (step) { return step.type.startsWith('CBR'); });
|
|
@@ -86,6 +86,7 @@ function ConfirmationDialog(_a) {
|
|
|
86
86
|
} }, { children: _jsx(CloseRoundedIcon, { fontSize: "inherit" }) })), !customConfirmation && (_jsxs("div", __assign({ className: styles.container }, { children: [renderIcon(), renderConfirmation(), renderLink()] }))), customConfirmation === null || customConfirmation === void 0 ? void 0 : customConfirmation({
|
|
87
87
|
url: confirmation.url,
|
|
88
88
|
caseNumber: confirmation.case,
|
|
89
|
+
idTicket: confirmation.idTicket,
|
|
89
90
|
}, renderIcon, renderConfirmation, renderLink, onClose)] })) })));
|
|
90
91
|
}
|
|
91
92
|
export default ConfirmationDialog;
|
|
@@ -208,7 +208,7 @@ export var calcMapperSubSteps = function (step, elements, customSteps) {
|
|
|
208
208
|
return newSteps;
|
|
209
209
|
};
|
|
210
210
|
function calcStepDependency(idStep, steps, values, customSteps) {
|
|
211
|
-
var _a, _b;
|
|
211
|
+
var _a, _b, _c, _d;
|
|
212
212
|
var depStep = steps[idStep];
|
|
213
213
|
if (!depStep) {
|
|
214
214
|
var originalValue_1 = values.global[idStep];
|
|
@@ -222,9 +222,11 @@ function calcStepDependency(idStep, steps, values, customSteps) {
|
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
224
|
var originalValue = (_b = (_a = values.sections[depStep.idSection]) === null || _a === void 0 ? void 0 : _a[depStep.id]) !== null && _b !== void 0 ? _b : values.global[depStep.id];
|
|
225
|
+
if (!depStep.stepPath)
|
|
226
|
+
console.error('Missing stepPath', depStep);
|
|
225
227
|
return {
|
|
226
228
|
type: depStep.type,
|
|
227
|
-
idOriginal: depStep.stepPath[0],
|
|
229
|
+
idOriginal: (_d = (_c = depStep.stepPath) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : [idStep],
|
|
228
230
|
value: calcStepDependencyValue(depStep, originalValue, customSteps),
|
|
229
231
|
dependents: [],
|
|
230
232
|
};
|
|
@@ -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