@hievilmath/browser-formidavim 0.0.1 → 1.0.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/index.d.ts +2 -1
- package/index.js +2712 -23
- package/index.mjs +31915 -1350
- package/lib/components/ComponentFactory.d.ts +24 -0
- package/lib/components/FlowFormRenderer.d.ts +6 -0
- package/lib/components/FlowProgressTracker.d.ts +8 -0
- package/lib/components/FlowRenderer.d.ts +7 -0
- package/lib/components/FormComponentRenderer.d.ts +8 -0
- package/lib/components/FormRenderer.d.ts +6 -0
- package/lib/components/FormWrapper.d.ts +7 -0
- package/lib/components/NetworkAwareWrapper.d.ts +8 -0
- package/lib/components/{render.d.ts → Renderer.d.ts} +3 -2
- package/lib/components/RendererWrapper.d.ts +8 -0
- package/lib/components/index.d.ts +10 -0
- package/lib/components/inputs/Checkbox.d.ts +5 -0
- package/lib/components/inputs/Number.d.ts +5 -0
- package/lib/components/inputs/Radio.d.ts +15 -0
- package/lib/components/inputs/Scale.d.ts +13 -0
- package/lib/components/inputs/TextArea.d.ts +5 -0
- package/lib/components/inputs/TextInput.d.ts +5 -0
- package/lib/components/inputs/template.d.ts +5 -0
- package/lib/components/visual/Header.d.ts +10 -0
- package/lib/components/visual/Image.d.ts +5 -0
- package/lib/components/visual/Paragraph.d.ts +10 -0
- package/lib/components/visual/RenderError.d.ts +4 -0
- package/lib/components/visual/Rule.d.ts +5 -0
- package/lib/components/visual/SmallText.d.ts +10 -0
- package/lib/components/visual/TextTip.d.ts +5 -0
- package/lib/components/visual/WeightLossChart.d.ts +5 -0
- package/lib/constants/api.constant.d.ts +2 -0
- package/lib/constants/components.d.ts +5 -0
- package/lib/constants/theme.d.ts +58 -0
- package/lib/constants/urls.constant.d.ts +4 -0
- package/lib/hooks/useConditionEvaluator.d.ts +7 -0
- package/lib/hooks/useFlowStore.d.ts +11 -0
- package/lib/state/slices/flow.slice.d.ts +22 -0
- package/lib/state/slices/patient.slice.d.ts +17 -0
- package/lib/state/store.d.ts +9 -0
- package/lib/styled-components/layout.d.ts +135 -0
- package/lib/styled-components/typography.d.ts +51 -0
- package/lib/styled-components/uiComponents.d.ts +135 -0
- package/lib/utils/conditionEvaluator.d.ts +18 -0
- package/lib/utils/formDataGenerator.d.ts +18 -0
- package/package.json +5 -2
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
interface BaseButtonProps {
|
|
2
|
+
$radius?: string;
|
|
3
|
+
$btnStyle?: 'black' | 'gray' | 'green' | 'alt';
|
|
4
|
+
$case?: 'uppercase' | 'lowercase' | 'capitalize' | 'none';
|
|
5
|
+
$minWidth?: string;
|
|
6
|
+
$margin?: string;
|
|
7
|
+
$disable?: boolean;
|
|
8
|
+
$disabled?: boolean;
|
|
9
|
+
$allowDisableClick?: boolean;
|
|
10
|
+
$includeIcon?: boolean;
|
|
11
|
+
$icon?: string;
|
|
12
|
+
$isLastStep?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface SmallButtonProps {
|
|
15
|
+
$bgColor?: string;
|
|
16
|
+
$color?: string;
|
|
17
|
+
$margin?: string;
|
|
18
|
+
$icon?: string;
|
|
19
|
+
}
|
|
20
|
+
interface RoundIconProps {
|
|
21
|
+
$icon?: string;
|
|
22
|
+
$bgColor?: string;
|
|
23
|
+
$bgcolor?: string;
|
|
24
|
+
$margin?: string;
|
|
25
|
+
$width?: string;
|
|
26
|
+
$height?: string;
|
|
27
|
+
$color?: string;
|
|
28
|
+
$bRadius?: string;
|
|
29
|
+
$top?: string;
|
|
30
|
+
$bottom?: string;
|
|
31
|
+
$left?: string;
|
|
32
|
+
$right?: string;
|
|
33
|
+
$transform?: string;
|
|
34
|
+
$rotate?: boolean;
|
|
35
|
+
theme?: string;
|
|
36
|
+
}
|
|
37
|
+
interface CardProps {
|
|
38
|
+
$header?: string;
|
|
39
|
+
$bgColor?: string;
|
|
40
|
+
$bgcolor?: string;
|
|
41
|
+
$headerBgColor?: string;
|
|
42
|
+
$collapsible?: string;
|
|
43
|
+
$show?: boolean;
|
|
44
|
+
$maxHeight?: string;
|
|
45
|
+
}
|
|
46
|
+
interface AcctHeaderProps {
|
|
47
|
+
$headerText?: string;
|
|
48
|
+
}
|
|
49
|
+
interface BackNavProps {
|
|
50
|
+
$fadeout?: boolean;
|
|
51
|
+
}
|
|
52
|
+
interface ModalProps {
|
|
53
|
+
$show?: string;
|
|
54
|
+
$maxHeight?: string;
|
|
55
|
+
}
|
|
56
|
+
interface BottomModalProps {
|
|
57
|
+
$show?: string;
|
|
58
|
+
}
|
|
59
|
+
interface FormProps {
|
|
60
|
+
$padding?: string;
|
|
61
|
+
$margin?: string;
|
|
62
|
+
}
|
|
63
|
+
interface StyledHrProps {
|
|
64
|
+
$margin?: string;
|
|
65
|
+
}
|
|
66
|
+
interface IvimLogoProps {
|
|
67
|
+
$width?: string;
|
|
68
|
+
$height?: string;
|
|
69
|
+
$margin?: string;
|
|
70
|
+
$bgColor?: string;
|
|
71
|
+
$rotate?: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface BadgeProps {
|
|
74
|
+
$top?: string;
|
|
75
|
+
$bottom?: string;
|
|
76
|
+
$left?: string;
|
|
77
|
+
$right?: string;
|
|
78
|
+
$transform?: string;
|
|
79
|
+
$case?: string;
|
|
80
|
+
$bgColor?: string;
|
|
81
|
+
$color?: string;
|
|
82
|
+
$bRadius?: string;
|
|
83
|
+
$width?: string;
|
|
84
|
+
$height?: string;
|
|
85
|
+
$margin?: string;
|
|
86
|
+
}
|
|
87
|
+
interface FormHeaderProps {
|
|
88
|
+
$banner?: boolean;
|
|
89
|
+
$borderOff?: boolean;
|
|
90
|
+
}
|
|
91
|
+
interface FlowBtnWrapperDesktopProps {
|
|
92
|
+
$flexWrap?: string;
|
|
93
|
+
$flex?: string;
|
|
94
|
+
$align?: string;
|
|
95
|
+
$borderOff?: boolean;
|
|
96
|
+
}
|
|
97
|
+
export declare const MdBtn: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, BaseButtonProps>> & string;
|
|
98
|
+
export declare const SmBtn: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, SmallButtonProps>> & string;
|
|
99
|
+
export declare const MdBtnA: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, BaseButtonProps>> & string;
|
|
100
|
+
export declare const SmBtnA: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, SmallButtonProps>> & string;
|
|
101
|
+
export declare const XCloseButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
102
|
+
export declare const TrashButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
103
|
+
export declare const PrimaryBtn: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, BaseButtonProps>> & string;
|
|
104
|
+
export declare const SecondaryBtn: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, BaseButtonProps>> & string;
|
|
105
|
+
export declare const AccountNavLink: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('react-router-dom').LinkProps & import('react').RefAttributes<HTMLAnchorElement>, "ref"> & {
|
|
106
|
+
ref?: ((instance: HTMLAnchorElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLAnchorElement> | null | undefined;
|
|
107
|
+
}, never>> & string & Omit<import('react').ForwardRefExoticComponent<import('react-router-dom').LinkProps & import('react').RefAttributes<HTMLAnchorElement>>, keyof import('react').Component<any, {}, any>>;
|
|
108
|
+
export declare const SecondaryBtnA: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, BaseButtonProps>> & string;
|
|
109
|
+
export declare const BackNav: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<Omit<import('react-router-dom').LinkProps & import('react').RefAttributes<HTMLAnchorElement>, "ref"> & {
|
|
110
|
+
ref?: ((instance: HTMLAnchorElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLAnchorElement> | null | undefined;
|
|
111
|
+
}, BackNavProps>> & string & Omit<import('react').ForwardRefExoticComponent<import('react-router-dom').LinkProps & import('react').RefAttributes<HTMLAnchorElement>>, keyof import('react').Component<any, {}, any>>;
|
|
112
|
+
export declare const PrimaryBtnA: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, BaseButtonProps>> & string;
|
|
113
|
+
export declare const RoundIconBtn: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, RoundIconProps>> & string;
|
|
114
|
+
export declare const RoundIcon: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, RoundIconProps>> & string;
|
|
115
|
+
export declare const AcctHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, AcctHeaderProps>> & string;
|
|
116
|
+
export declare const Card: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, CardProps>> & string;
|
|
117
|
+
export declare const Modal: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ModalProps>> & string;
|
|
118
|
+
export declare const BottomModal: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, BottomModalProps>> & string;
|
|
119
|
+
export declare const Form: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, FormProps>> & string;
|
|
120
|
+
export declare const FormLogo: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
|
|
121
|
+
export declare const FormBackArrowDesktop: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
122
|
+
export declare const FormBackArrowMobile: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>, "ref"> & {
|
|
123
|
+
ref?: ((instance: HTMLButtonElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLButtonElement> | null | undefined;
|
|
124
|
+
}, never>> & string;
|
|
125
|
+
export declare const StyledHr: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLHRElement>, HTMLHRElement>, StyledHrProps>> & string;
|
|
126
|
+
export declare const IvimLogo: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, IvimLogoProps>> & string;
|
|
127
|
+
export declare const Badge: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, BadgeProps>> & string;
|
|
128
|
+
export declare const FormHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, FormHeaderProps>> & string;
|
|
129
|
+
export declare const FlowBtnWrapperDesktop: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, FlowBtnWrapperDesktopProps>> & string;
|
|
130
|
+
export declare const StyledImage: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {
|
|
131
|
+
$maxHeight?: string;
|
|
132
|
+
$margin?: string;
|
|
133
|
+
}>> & string;
|
|
134
|
+
export declare const StyledRadioLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
|
|
135
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Condition, PatientProfileDto } from '../../../../../axios/formidavim/src/index.ts';
|
|
2
|
+
type GetFieldValueFn = (field: string) => any;
|
|
3
|
+
/**
|
|
4
|
+
* Evaluates condition groups using flow store data
|
|
5
|
+
* Each condition group is an array of IndividualCondition that should be ANDed together
|
|
6
|
+
* Multiple condition groups are ORed together
|
|
7
|
+
*
|
|
8
|
+
* @param condition - The condition object containing condition groups
|
|
9
|
+
* @param getFieldValue - Function to get field values from the flow store
|
|
10
|
+
* @returns boolean indicating if any condition group is satisfied
|
|
11
|
+
*/
|
|
12
|
+
export declare const evaluateConditionWithFlowStore: (condition: Condition | undefined, getFieldValue: GetFieldValueFn) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Legacy function for backward compatibility
|
|
15
|
+
* @deprecated Use evaluateConditionWithFlowStore instead
|
|
16
|
+
*/
|
|
17
|
+
export declare const evaluateCondition: (condition: Condition | undefined, data: PatientProfileDto) => boolean;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Flow } from '../../../../../axios/formidavim/src/index.ts';
|
|
2
|
+
export interface ComponentWithPropertyId {
|
|
3
|
+
propertyId: string;
|
|
4
|
+
type: string;
|
|
5
|
+
isArray?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Extracts all components from a flow config that have a propertyId
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractComponentsWithPropertyId(flow: Partial<Flow>): ComponentWithPropertyId[];
|
|
11
|
+
/**
|
|
12
|
+
* Generates initial form data object based on components with propertyId
|
|
13
|
+
*/
|
|
14
|
+
export declare function generateInitialFormData(components: ComponentWithPropertyId[]): Record<string, any>;
|
|
15
|
+
/**
|
|
16
|
+
* Generates initial form data from flow config
|
|
17
|
+
*/
|
|
18
|
+
export declare function generateFormDataFromFlow(flow: Partial<Flow>): Record<string, any>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hievilmath/browser-formidavim",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"module": "./index.mjs",
|
|
6
|
-
"typings": "./index.d.ts"
|
|
6
|
+
"typings": "./index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@hievilmath/axios-formidavim": "^1.0.3"
|
|
9
|
+
}
|
|
7
10
|
}
|