@arquimedes.co/eureka-forms 2.0.82 → 2.0.83
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/@Types/GenericFormSteps.d.ts +1 -0
- package/dist/App/App.d.ts +2 -1
- package/dist/App/App.js +1 -0
- package/dist/Contexts/CustomContext.d.ts +2 -1
- package/dist/FormSteps/CustomStep.d.ts +3 -2
- package/dist/FormSteps/CustomStep.js +2 -3
- package/dist/FormSteps/Step.js +6 -3
- package/package.json +1 -1
package/dist/App/App.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Classifier, Form } from '../@Types/Form';
|
|
3
3
|
import './App.css';
|
|
4
|
-
import { CustomStep } from '../FormSteps/CustomStep';
|
|
4
|
+
import { CustomStep, CustomStepProps } from '../FormSteps/CustomStep';
|
|
5
5
|
import { EditorState } from 'draft-js';
|
|
6
6
|
export interface AppProps {
|
|
7
7
|
/** If the app is currently a widget */
|
|
@@ -37,6 +37,7 @@ export interface AppProps {
|
|
|
37
37
|
url: string;
|
|
38
38
|
caseNumber: string;
|
|
39
39
|
}, renderIcon: () => JSX.Element, renderConfirmation: (state?: EditorState) => JSX.Element | void, renderLink: () => JSX.Element | void, onClose: () => void) => JSX.Element;
|
|
40
|
+
customClientInfoStep?: (props: CustomStepProps) => JSX.Element;
|
|
40
41
|
/** Custom function to call on send */
|
|
41
42
|
customSubmit?: (values: Record<string, unknown>, reload: () => void) => Promise<void>;
|
|
42
43
|
/** Custom submit function, when passed it is called */
|
package/dist/App/App.js
CHANGED
|
@@ -74,6 +74,7 @@ function App(_a) {
|
|
|
74
74
|
sendLabel: props.sendLabel,
|
|
75
75
|
fetchDownloadUrl: props.fetchDownloadUrl,
|
|
76
76
|
customStepProps: (_g = props.customStepProps) !== null && _g !== void 0 ? _g : {},
|
|
77
|
+
customClientInfoStep: props.customClientInfoStep,
|
|
77
78
|
} }, { children: _jsx("div", __assign({ className: styles.container }, { children: _jsx(FormComponent, { form: form, reload: reload, branding: branding, apiKey: props.apiKey, isWidget: !!isWidget, customSteps: customSteps, containerRef: containerRef, setSubmit: props.setSubmit, customSubmit: props.customSubmit, scrollToTop: props.scrollToTop, customSubmitBtns: props.customSubmitBtns, customConfirmation: props.customConfirmation }) })) })));
|
|
78
79
|
}
|
|
79
80
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CustomStep } from '../FormSteps/CustomStep';
|
|
2
|
+
import { CustomStep, CustomStepProps } from '../FormSteps/CustomStep';
|
|
3
3
|
export interface CustomContextData {
|
|
4
4
|
sendLabel?: string;
|
|
5
5
|
customStepProps: Record<string, unknown>;
|
|
6
6
|
customSteps: Record<string, CustomStep>;
|
|
7
|
+
customClientInfoStep?: (props: CustomStepProps) => JSX.Element;
|
|
7
8
|
/** Function to call on postview to fetch the download url of a file */
|
|
8
9
|
fetchDownloadUrl?: (S3Key: string, fileName: string) => Promise<string>;
|
|
9
10
|
}
|
|
@@ -20,7 +20,8 @@ export interface CustomStep {
|
|
|
20
20
|
calcDependencyValue?: (step: any, value: any) => any;
|
|
21
21
|
}
|
|
22
22
|
interface CustomStepComponentProps extends StepProps {
|
|
23
|
-
|
|
23
|
+
customComponent: (props: CustomStepProps) => JSX.Element;
|
|
24
|
+
customProps?: Record<string, any>;
|
|
24
25
|
}
|
|
25
|
-
declare function CustomStepComponent({
|
|
26
|
+
declare function CustomStepComponent({ customComponent, customProps, ...props }: CustomStepComponentProps): JSX.Element;
|
|
26
27
|
export default CustomStepComponent;
|
|
@@ -26,14 +26,13 @@ import CustomStepPropsContext from '../Contexts/CustomContext';
|
|
|
26
26
|
import { useContext } from 'react';
|
|
27
27
|
import { useStepDependency } from './StepHooks';
|
|
28
28
|
function CustomStepComponent(_a) {
|
|
29
|
-
var _b;
|
|
30
|
-
var customStep = _a.customStep, props = __rest(_a, ["customStep"]);
|
|
29
|
+
var customComponent = _a.customComponent, _b = _a.customProps, customProps = _b === void 0 ? {} : _b, props = __rest(_a, ["customComponent", "customProps"]);
|
|
31
30
|
var form = useContext(FormContext);
|
|
32
31
|
var global = useAppSelector(function (state) { return state.global; });
|
|
33
32
|
var customStepProps = useContext(CustomStepPropsContext).customStepProps;
|
|
34
33
|
var dependencyStore = useAppSelector(function (state) { return state.site.dependencies; });
|
|
35
34
|
var widthStats = useAppSelector(function (state) { return state.widthStats; });
|
|
36
35
|
var dependencyInfo = useStepDependency(props.step, undefined);
|
|
37
|
-
return
|
|
36
|
+
return customComponent(__assign(__assign(__assign(__assign(__assign({}, global), dependencyInfo), props), { dependencyStore: dependencyStore, widthStats: widthStats, form: form, customStepProps: customStepProps }), customProps));
|
|
38
37
|
}
|
|
39
38
|
export default CustomStepComponent;
|
package/dist/FormSteps/Step.js
CHANGED
|
@@ -38,7 +38,7 @@ import EntityValuePickerStep from './EntityValueStep/EntityValuePickerStep';
|
|
|
38
38
|
import MapperStep from './MapperStep/MapperStep';
|
|
39
39
|
import CollapsibleStep from './CollapsibleStep/CollapsibleStep';
|
|
40
40
|
import ApiSelectorStep from './ApiSelectorStep/ApiSelectorStep';
|
|
41
|
-
import
|
|
41
|
+
import CustomStepComponent from './CustomStep';
|
|
42
42
|
import { useAppSelector } from '../hooks';
|
|
43
43
|
import { useContext } from 'react';
|
|
44
44
|
import CustomContext from '../Contexts/CustomContext';
|
|
@@ -52,7 +52,7 @@ function StepComponent(_a) {
|
|
|
52
52
|
return _jsx("div", {});
|
|
53
53
|
}
|
|
54
54
|
var _c = useAppSelector(function (state) { return state.global; }), postview = _c.postview, partial = _c.partial;
|
|
55
|
-
var
|
|
55
|
+
var _d = useContext(CustomContext), customSteps = _d.customSteps, customClientInfoStep = _d.customClientInfoStep;
|
|
56
56
|
var originalValue = useAppSelector(function (state) {
|
|
57
57
|
return selectOriginalValue(state, step);
|
|
58
58
|
});
|
|
@@ -67,7 +67,10 @@ function StepComponent(_a) {
|
|
|
67
67
|
return _jsx("div", {});
|
|
68
68
|
}
|
|
69
69
|
if (customStep) {
|
|
70
|
-
return (_jsx(
|
|
70
|
+
return (_jsx(CustomStepComponent, __assign({}, props, { customComponent: customStep.component, customProps: customStep.componentProps, step: step, editable: editable })));
|
|
71
|
+
}
|
|
72
|
+
if (customClientInfoStep && step.clientInfoType) {
|
|
73
|
+
return (_jsx(CustomStepComponent, __assign({}, props, { customComponent: customClientInfoStep, step: step, editable: editable })));
|
|
71
74
|
}
|
|
72
75
|
switch (step.type) {
|
|
73
76
|
case FormStepTypes.TITLE: {
|