@hievilmath/browser-formidavim 1.9.1 → 1.9.3
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/README.md +11 -0
- package/index.js +492 -441
- package/index.mjs +31981 -30204
- package/lib/components/DataRenderer.d.ts +1 -2
- package/lib/components/FlowRenderer.d.ts +1 -2
- package/lib/components/PipelineProcessor.d.ts +1 -1
- package/lib/components/Renderer.d.ts +1 -2
- package/lib/components/inputs/Redirect.d.ts +8 -0
- package/lib/constants/components.d.ts +41 -2
- package/lib/hooks/useFlowStore.d.ts +2 -0
- package/lib/state/slices/flow.slice.d.ts +8 -1
- package/package.json +3 -2
|
@@ -11,10 +11,9 @@ export declare const DataRenderer: FC<PropsWithChildren<{
|
|
|
11
11
|
onPrevStep?: (data: eventData) => any;
|
|
12
12
|
onFormInit?: (data: eventData) => any;
|
|
13
13
|
onFlowInit?: (data: eventData) => any;
|
|
14
|
-
onSubmit?: (data: eventData,
|
|
14
|
+
onSubmit?: (data: eventData, redirectUrl?: string) => Promise<any>;
|
|
15
15
|
onFormidavimFallback?: () => void;
|
|
16
16
|
onConfigFetchError?: (error: any) => any;
|
|
17
|
-
shouldRedirect?: boolean;
|
|
18
17
|
setIsLoadingExternal?: (isLoading: boolean) => void;
|
|
19
18
|
expirationOverride?: string;
|
|
20
19
|
}>>;
|
|
@@ -18,9 +18,8 @@ export declare const FlowRenderer: FC<{
|
|
|
18
18
|
flow: Partial<Flow> | null;
|
|
19
19
|
isPreview: boolean;
|
|
20
20
|
$bgColor?: string;
|
|
21
|
-
onSubmit: (data: eventData,
|
|
21
|
+
onSubmit: (data: eventData, redirectUrl?: string) => Promise<any>;
|
|
22
22
|
onNextStep?: (data: eventData) => any;
|
|
23
23
|
onPrevStep?: (data: eventData) => any;
|
|
24
24
|
onFormInit?: (data: eventData) => any;
|
|
25
|
-
shouldRedirect?: boolean;
|
|
26
25
|
}>;
|
|
@@ -14,7 +14,7 @@ export declare const PipelineProcessor: FC<PropsWithChildren<{
|
|
|
14
14
|
onFlowInit?: (data: eventData) => any;
|
|
15
15
|
onFormInit?: (data: eventData) => any;
|
|
16
16
|
onPipelineInit?: (data: eventData) => any;
|
|
17
|
-
onSubmit?: (data: eventData) => Promise<((config?: PipelineDto) => void) | void>;
|
|
17
|
+
onSubmit?: (data: eventData) => Promise<((config?: PipelineDto, redirectUrl?: string) => void) | void>;
|
|
18
18
|
onNoFlowsAvailable?: () => void;
|
|
19
19
|
onFormidavimFallback?: () => void;
|
|
20
20
|
onConfigFetchError?: (error: any) => any;
|
|
@@ -10,12 +10,11 @@ export declare const Renderer: FC<{
|
|
|
10
10
|
data: PatientProfileResponse | null;
|
|
11
11
|
config: Partial<Flow>;
|
|
12
12
|
isPreview: boolean;
|
|
13
|
-
onSubmit: (data: eventData,
|
|
13
|
+
onSubmit: (data: eventData, redirectUrl?: string) => Promise<any>;
|
|
14
14
|
onNextStep?: (data: eventData) => any;
|
|
15
15
|
onPrevStep?: (data: eventData) => any;
|
|
16
16
|
onFlowInit?: (data: eventData) => any;
|
|
17
17
|
onFormInit?: (data: eventData) => any;
|
|
18
|
-
shouldRedirect?: boolean;
|
|
19
18
|
formidavimHost?: string;
|
|
20
19
|
setIsLoadingExternal?: (isLoading: boolean) => void;
|
|
21
20
|
}>;
|
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { FormComponentProps } from '../components/ComponentFactory';
|
|
3
3
|
export type ComponentMap = Record<string, FC<FormComponentProps>>;
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
4
|
+
export declare const ComponentKeyEnum: {
|
|
5
|
+
Header: string;
|
|
6
|
+
Image: string;
|
|
7
|
+
WeightLossChart: string;
|
|
8
|
+
HorizontalRule: string;
|
|
9
|
+
TextTip: string;
|
|
10
|
+
SmallText: string;
|
|
11
|
+
Paragraph: string;
|
|
12
|
+
RefillRequest: string;
|
|
13
|
+
AddonRequest: string;
|
|
14
|
+
HipaaConsent: string;
|
|
15
|
+
LinkButton: string;
|
|
16
|
+
Confetti: string;
|
|
17
|
+
Video: string;
|
|
18
|
+
Checkout: string;
|
|
19
|
+
CheckboxSingle: string;
|
|
20
|
+
CheckboxMulti: string;
|
|
21
|
+
Radio: string;
|
|
22
|
+
RadioGroup: string;
|
|
23
|
+
Number: string;
|
|
24
|
+
Dropdown: string;
|
|
25
|
+
Datepicker: string;
|
|
26
|
+
Scale: string;
|
|
27
|
+
TextInput: string;
|
|
28
|
+
Textarea: string;
|
|
29
|
+
TitrationSelect: string;
|
|
30
|
+
DosingCustomUnits: string;
|
|
31
|
+
Email: string;
|
|
32
|
+
Password: string;
|
|
33
|
+
Phone: string;
|
|
34
|
+
Otp: string;
|
|
35
|
+
Address: string;
|
|
36
|
+
Hidden: string;
|
|
37
|
+
GAClientId: string;
|
|
38
|
+
Cookie: string;
|
|
39
|
+
File: string;
|
|
40
|
+
VouchedSend: string;
|
|
41
|
+
Redirect: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const COMPONENT_CONFIGS: Record<keyof typeof ComponentKeyEnum | string, string | number | boolean | boolean[] | any[]>;
|
|
44
|
+
export declare const COMPONENTS_WITHOUT_MARGIN: readonly [string, string, string];
|
|
6
45
|
export declare const components: ComponentMap;
|
|
@@ -397,6 +397,8 @@ export declare const useFlowStore: () => {
|
|
|
397
397
|
getShowLoader: () => boolean;
|
|
398
398
|
getFormidavimHost: () => string | undefined;
|
|
399
399
|
setFormidavimHostValue: (host: string | undefined) => void;
|
|
400
|
+
getFlowRedirectUrl: () => string | null | undefined;
|
|
401
|
+
setFlowRedirectUrlValue: (url: string | null | undefined) => void;
|
|
400
402
|
setFlowAndPatientValue: (field: string, value: any) => void;
|
|
401
403
|
generateFormDataFromFlow: (flow: Partial<Flow>) => Record<string, any>;
|
|
402
404
|
};
|
|
@@ -9,6 +9,7 @@ export interface FlowSliceState {
|
|
|
9
9
|
currentForm: Partial<Form>;
|
|
10
10
|
showLoader: boolean;
|
|
11
11
|
formidavimHost?: string;
|
|
12
|
+
flowRedirectUrl?: string | null;
|
|
12
13
|
}
|
|
13
14
|
export declare const flowSlice: import('@reduxjs/toolkit').Slice<FlowSliceState, {
|
|
14
15
|
setInputValue: (state: import('immer').WritableDraft<FlowSliceState>, action: PayloadAction<{
|
|
@@ -28,6 +29,7 @@ export declare const flowSlice: import('@reduxjs/toolkit').Slice<FlowSliceState,
|
|
|
28
29
|
setCurrentForm: (state: import('immer').WritableDraft<FlowSliceState>, action: PayloadAction<Partial<Form>>) => void;
|
|
29
30
|
setShowLoader: (state: import('immer').WritableDraft<FlowSliceState>, action: PayloadAction<boolean>) => void;
|
|
30
31
|
setFormidavimHost: (state: import('immer').WritableDraft<FlowSliceState>, action: PayloadAction<string | undefined>) => void;
|
|
32
|
+
setFlowRedirectUrl: (state: import('immer').WritableDraft<FlowSliceState>, action: PayloadAction<string | null | undefined>) => void;
|
|
31
33
|
}, "flow", "flow", {
|
|
32
34
|
selectInputValues: (state: FlowSliceState) => Record<string, any>;
|
|
33
35
|
selectInputErrors: (state: FlowSliceState) => Record<string, any>;
|
|
@@ -37,6 +39,7 @@ export declare const flowSlice: import('@reduxjs/toolkit').Slice<FlowSliceState,
|
|
|
37
39
|
selectCurrentForm: (state: FlowSliceState) => Partial<Form>;
|
|
38
40
|
selectShowLoader: (state: FlowSliceState) => boolean;
|
|
39
41
|
selectFormidavimHost: (state: FlowSliceState) => string | undefined;
|
|
42
|
+
selectFlowRedirectUrl: (state: FlowSliceState) => string | null | undefined;
|
|
40
43
|
}>;
|
|
41
44
|
export declare const setInputValue: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
42
45
|
field: string;
|
|
@@ -44,7 +47,7 @@ export declare const setInputValue: import('@reduxjs/toolkit').ActionCreatorWith
|
|
|
44
47
|
}, "flow/setInputValue">, setInputValues: import('@reduxjs/toolkit').ActionCreatorWithPayload<Record<string, any>, "flow/setInputValues">, resetInputValues: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Partial<Flow> | undefined, "flow/resetInputValues">, resetAndSetInputValues: import('@reduxjs/toolkit').ActionCreatorWithPayload<Record<string, any>, "flow/resetAndSetInputValues">, setInputError: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
45
48
|
field: string;
|
|
46
49
|
error: string | null;
|
|
47
|
-
}, "flow/setInputError">, setDisableSubmit: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "flow/setDisableSubmit">, setManualDisableSubmit: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "flow/setManualDisableSubmit">, setCurrentFlow: import('@reduxjs/toolkit').ActionCreatorWithPayload<Partial<Flow>, "flow/setCurrentFlow">, setCurrentForm: import('@reduxjs/toolkit').ActionCreatorWithPayload<Partial<Form>, "flow/setCurrentForm">, setShowLoader: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "flow/setShowLoader">, setFormidavimHost: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string | undefined, "flow/setFormidavimHost">;
|
|
50
|
+
}, "flow/setInputError">, setDisableSubmit: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "flow/setDisableSubmit">, setManualDisableSubmit: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "flow/setManualDisableSubmit">, setCurrentFlow: import('@reduxjs/toolkit').ActionCreatorWithPayload<Partial<Flow>, "flow/setCurrentFlow">, setCurrentForm: import('@reduxjs/toolkit').ActionCreatorWithPayload<Partial<Form>, "flow/setCurrentForm">, setShowLoader: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "flow/setShowLoader">, setFormidavimHost: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string | undefined, "flow/setFormidavimHost">, setFlowRedirectUrl: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string | null | undefined, "flow/setFlowRedirectUrl">;
|
|
48
51
|
export declare const selectInputValues: import('reselect').Selector<{
|
|
49
52
|
flow: FlowSliceState;
|
|
50
53
|
}, Record<string, any>, []> & {
|
|
@@ -77,4 +80,8 @@ export declare const selectInputValues: import('reselect').Selector<{
|
|
|
77
80
|
flow: FlowSliceState;
|
|
78
81
|
}, string | undefined, []> & {
|
|
79
82
|
unwrapped: (state: FlowSliceState) => string | undefined;
|
|
83
|
+
}, selectFlowRedirectUrl: import('reselect').Selector<{
|
|
84
|
+
flow: FlowSliceState;
|
|
85
|
+
}, string | null | undefined, []> & {
|
|
86
|
+
unwrapped: (state: FlowSliceState) => string | null | undefined;
|
|
80
87
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hievilmath/browser-formidavim",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"module": "./index.mjs",
|
|
6
6
|
"typings": "./index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@hievilmath/axios-formidavim": "1.1.1",
|
|
9
9
|
"jsonata": "^2.1.0",
|
|
10
|
-
"react-confetti": "^6.4.0"
|
|
10
|
+
"react-confetti": "^6.4.0",
|
|
11
|
+
"lodash": "^4.17.21"
|
|
11
12
|
},
|
|
12
13
|
"peerDependencies": {
|
|
13
14
|
"axios": "*",
|