@arquimedes.co/eureka-forms 2.0.3-test → 2.0.5-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/AppHooks.js +1 -1
- package/dist/FormSteps/CustomStep.d.ts +4 -1
- package/dist/FormSteps/CustomStep.js +4 -1
- package/dist/FormSteps/StepHooks.d.ts +3 -2
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +4 -4
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +1 -1
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +1 -1
- package/package.json +9 -9
package/dist/App/AppHooks.js
CHANGED
|
@@ -145,7 +145,7 @@ export var useSetupApp = function (isEmbedded, _a) {
|
|
|
145
145
|
idOrganization = match ? match[1] : '';
|
|
146
146
|
}
|
|
147
147
|
if (form) {
|
|
148
|
-
if (form)
|
|
148
|
+
if (form && classifiers)
|
|
149
149
|
form.classifiers = classifiers;
|
|
150
150
|
_loop_1 = function (section) {
|
|
151
151
|
for (var _e = 0, _f = section.steps; _e < _f.length; _e++) {
|
|
@@ -3,8 +3,11 @@ import { StepProps } from './Step';
|
|
|
3
3
|
import { Form } from '../@Types';
|
|
4
4
|
import { GlobalState } from '../States/GlobalStateReducer';
|
|
5
5
|
import { WidthStats } from '../Form/Form';
|
|
6
|
-
|
|
6
|
+
import { StepDependency } from './StepHooks';
|
|
7
|
+
import { SiteState } from '../States/SiteStateReducer';
|
|
8
|
+
export interface CustomStepProps extends StepProps, GlobalState, StepDependency {
|
|
7
9
|
form: Form;
|
|
10
|
+
dependencyStore: SiteState['dependencies'];
|
|
8
11
|
customStepProps: Record<string, any>;
|
|
9
12
|
widthStats: WidthStats;
|
|
10
13
|
}
|
|
@@ -24,13 +24,16 @@ import FormContext from '../Contexts/FormContext';
|
|
|
24
24
|
import { useAppSelector } from '../hooks';
|
|
25
25
|
import CustomStepPropsContext from '../Contexts/CustomContext';
|
|
26
26
|
import { useContext } from 'react';
|
|
27
|
+
import { useStepDependency } from './StepHooks';
|
|
27
28
|
function CustomStepComponent(_a) {
|
|
28
29
|
var _b;
|
|
29
30
|
var customStep = _a.customStep, props = __rest(_a, ["customStep"]);
|
|
30
31
|
var form = useContext(FormContext);
|
|
31
32
|
var global = useAppSelector(function (state) { return state.global; });
|
|
32
33
|
var customStepProps = useContext(CustomStepPropsContext);
|
|
34
|
+
var dependencyStore = useAppSelector(function (state) { return state.site.dependencies; });
|
|
33
35
|
var widthStats = useAppSelector(function (state) { return state.widthStats; });
|
|
34
|
-
|
|
36
|
+
var dependencyInfo = useStepDependency(props.step);
|
|
37
|
+
return customStep.component(__assign(__assign(__assign(__assign(__assign({}, props), { dependencyStore: dependencyStore, widthStats: widthStats, form: form, customStepProps: customStepProps }), dependencyInfo), global), ((_b = customStep.componentProps) !== null && _b !== void 0 ? _b : {})));
|
|
35
38
|
}
|
|
36
39
|
export default CustomStepComponent;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { GBaseStep } from '../@Types/GenericFormSteps';
|
|
2
2
|
import { Form } from '../@Types';
|
|
3
3
|
import { DependencyStore } from '../Form/Form';
|
|
4
|
-
export
|
|
4
|
+
export interface StepDependency {
|
|
5
5
|
originalValue: any;
|
|
6
6
|
isDependency: boolean;
|
|
7
7
|
handleStepDep: (value: any | undefined) => void;
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
|
+
export declare const useStepDependency: (step: GBaseStep, defaultValue?: any) => StepDependency;
|
|
9
10
|
export declare const selectDependencies: ((state: {
|
|
10
11
|
global: import("../States/GlobalStateReducer").GlobalState;
|
|
11
12
|
site: import("../States/SiteStateReducer").SiteState;
|
|
@@ -49,8 +49,8 @@ function TextAreaStep(_a) {
|
|
|
49
49
|
}
|
|
50
50
|
: {},
|
|
51
51
|
defaultValue: originalValue,
|
|
52
|
-
}), _j = _h.field, ref = _j.ref, field = __rest(_j, ["ref"]), error = _h.fieldState.error;
|
|
53
|
-
var
|
|
52
|
+
}), _j = _h.field, ref = _j.ref, onChange = _j.onChange, field = __rest(_j, ["ref", "onChange"]), error = _h.fieldState.error;
|
|
53
|
+
var handleChange = useCallback(function (value) {
|
|
54
54
|
if (isDependency) {
|
|
55
55
|
try {
|
|
56
56
|
clearTimeout(timer);
|
|
@@ -63,7 +63,7 @@ function TextAreaStep(_a) {
|
|
|
63
63
|
}, 1000));
|
|
64
64
|
}
|
|
65
65
|
onChange(value);
|
|
66
|
-
}, [handleStepDep, isDependency,
|
|
66
|
+
}, [handleStepDep, isDependency, onChange]);
|
|
67
67
|
var calcStyle = function () {
|
|
68
68
|
var backgroundColor = formStyle.stepBackgroundColor;
|
|
69
69
|
if (focus) {
|
|
@@ -127,7 +127,7 @@ function TextAreaStep(_a) {
|
|
|
127
127
|
}
|
|
128
128
|
} }, { children: _jsx(Editor, __assign({}, field, { editorRef: ref, onFocus: function () {
|
|
129
129
|
setFocus(true);
|
|
130
|
-
}, readOnly: !canEdit, stripPastedStyles: true, onEditorStateChange:
|
|
130
|
+
}, readOnly: !canEdit, stripPastedStyles: true, onEditorStateChange: handleChange, toolbarClassName: !canEdit ? ' postview-editor-toolbar' : '', editorClassName: editorClassName, wrapperClassName: styles.wrapper, placeholder: (_b = step.description) !== null && _b !== void 0 ? _b : '', toolbar: {
|
|
131
131
|
options: ['inline', 'list', 'history'],
|
|
132
132
|
inline: {
|
|
133
133
|
options: [
|
|
@@ -54,7 +54,7 @@ function TextAreaStep(_a) {
|
|
|
54
54
|
}, 1000));
|
|
55
55
|
}
|
|
56
56
|
field.onChange(e);
|
|
57
|
-
}, [handleStepDep, isDependency, field]);
|
|
57
|
+
}, [handleStepDep, isDependency, field.onChange]);
|
|
58
58
|
var canEdit = editable && !postview;
|
|
59
59
|
return (_jsxs("div", __assign({ className: styles.container, style: {
|
|
60
60
|
paddingBottom: step.required || step.description || !!error
|
|
@@ -64,7 +64,7 @@ function TextInputStep(_a) {
|
|
|
64
64
|
}, 1000));
|
|
65
65
|
}
|
|
66
66
|
field.onChange(e);
|
|
67
|
-
}, [handleStepDep, isDependency, field]);
|
|
67
|
+
}, [handleStepDep, isDependency, field.onChange]);
|
|
68
68
|
return (_jsx("div", __assign({ className: styles.container, style: {
|
|
69
69
|
width: currentBreakPoint <= step.size
|
|
70
70
|
? '100%'
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arquimedes.co/eureka-forms",
|
|
3
3
|
"repository": "git://github.com/Arquimede5/Eureka-Forms.git",
|
|
4
|
-
"version":"2.0.
|
|
4
|
+
"version":"2.0.5-test",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "react-scripts start",
|
|
7
7
|
"build": "react-scripts build",
|
|
8
8
|
"lint": "eslint 'src/**/*.ts'",
|
|
9
9
|
"test": "react-scripts test",
|
|
10
|
-
"test-ci": "react-scripts test --reporters=default --reporters=jest-junit --coverage",
|
|
10
|
+
"test-ci": "react-scripts test --reporters=default --reporters=jest-junit --coverage --coverageReporters cobertura html",
|
|
11
11
|
"tsc-build": "tsc --noEmit false --outDir ./dist --incremental false",
|
|
12
12
|
"watch": "tsc --build -w --preserveWatchOutput",
|
|
13
13
|
"storybook": "storybook dev -p 6006",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"cypress": "DISPLAY=:0 cypress open"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@date-io/date-fns": "^
|
|
19
|
-
"@material-ui/core": "^4.
|
|
20
|
-
"@material-ui/icons": "^4.11.
|
|
21
|
-
"@material-ui/lab": "4.0.0-alpha.
|
|
22
|
-
"@material-ui/pickers": "^3.3.
|
|
18
|
+
"@date-io/date-fns": "^1.3.13",
|
|
19
|
+
"@material-ui/core": "^4.11.3",
|
|
20
|
+
"@material-ui/icons": "^4.11.2",
|
|
21
|
+
"@material-ui/lab": "^4.0.0-alpha.57",
|
|
22
|
+
"@material-ui/pickers": "^3.3.10",
|
|
23
23
|
"@reduxjs/toolkit": "^1.9.7",
|
|
24
24
|
"axios": "^1.6.2",
|
|
25
|
-
"date-fns": "^2.
|
|
25
|
+
"date-fns": "^2.23.0",
|
|
26
26
|
"draft-js": "^0.11.7",
|
|
27
27
|
"logrocket": "^2.2.1",
|
|
28
28
|
"nanoid": "^3.3.7",
|
|
@@ -107,4 +107,4 @@
|
|
|
107
107
|
"/dist"
|
|
108
108
|
],
|
|
109
109
|
"proxy": "https://api.forms.eureka-test.click"
|
|
110
|
-
}
|
|
110
|
+
}
|