@micromerce/formbuilder-react 1.0.912 → 1.0.915
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/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
- package/dist/components/FormBuilder/FormBuilder.d.ts +3 -2
- package/dist/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.d.ts +1 -1
- package/dist/components/FormBuilder/utils/extractFormControlValues/index.d.ts +1 -0
- package/dist/components/FormBuilder/utils/jsonToUrlEncoded/jsonToUrlEncoded.d.ts +2 -2
- package/dist/components/FormFooter/FormFooter.d.ts +1 -1
- package/dist/components/QueryControl/utils/getMatchingControls.d.ts +2 -2
- package/dist/components/controls/DateRangeGroup/components/CalendarModal.d.ts +2 -2
- package/dist/components/controls/MrnInput/hooks/useMrn.d.ts +12 -7
- package/dist/components/controls/MrnInput/services/fetchMrn.d.ts +1 -1
- package/dist/components/controls/MrnInput/ui-helper/Link/Link.d.ts +1 -1
- package/dist/components/controls/MrnInput/utils/mrnUtils/mrnUtils.d.ts +1 -1
- package/dist/components/controls/MrnInput/utils/resolveMrnLinks/resolveMrnLink.d.ts +1 -1
- package/dist/components/controls/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.d.ts +1 -1
- package/dist/components/controls/MultiSelect/utils/extractSelectedOptionValues/extractSelectedOptionValues.d.ts +9 -9
- package/dist/components/controls/Select/utils/getSelectedOption.d.ts +1 -1
- package/dist/components/controls/Textarea/aiWrapper/aiAction.d.ts +1 -1
- package/dist/components/controls/Textarea/aiWrapper/index.d.ts +1 -1
- package/dist/components/controls/Textarea/aiWrapper/useAi.d.ts +4 -4
- package/dist/context/FormData.d.ts +7 -4
- package/dist/formbuilder.js +4 -4
- package/dist/formbuilder.js.map +1 -1
- package/dist/hooks/useDependent/enhanced/useInputDependent/useInputDependent.d.ts +2 -2
- package/dist/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.d.ts +4 -4
- package/dist/hooks/useDependent/useDependent.d.ts +3 -3
- package/dist/hooks/useValueGenerator/useValueGenerator.d.ts +2 -2
- package/dist/styles/Textfield.styles.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/ui/menu/hooks/useMenu.d.ts +3 -3
- package/dist/ui/menu/index.d.ts +1 -1
- package/dist/utils/findFormControlError/index.d.ts +1 -1
- package/package.json +4 -2
- package/dist/__mocks__/platejs.d.ts +0 -314
- package/dist/testutils.d.ts +0 -15
|
@@ -11,6 +11,6 @@ declare class ErrorBoundary extends Component<Props, State> {
|
|
|
11
11
|
state: State;
|
|
12
12
|
static getDerivedStateFromError(error: Error): State;
|
|
13
13
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
14
|
-
render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
15
15
|
}
|
|
16
16
|
export default ErrorBoundary;
|
|
@@ -4,6 +4,7 @@ import { FileUploaderConfig, FormBuilderConfig, resolveUrl } from "../../types";
|
|
|
4
4
|
import type { controlProps } from "../../types/controlProps";
|
|
5
5
|
import type { queryControl } from "../QueryControl/data/defaultControls";
|
|
6
6
|
import "../../styles/theme.module.scss";
|
|
7
|
+
import { IFormState } from "./utils/extractFormControlValues";
|
|
7
8
|
export type FormState = "processing" | "success" | "error";
|
|
8
9
|
export interface IProps {
|
|
9
10
|
config: FormBuilderConfig;
|
|
@@ -13,11 +14,11 @@ export interface IProps {
|
|
|
13
14
|
iconType?: string;
|
|
14
15
|
state?: FormState | "";
|
|
15
16
|
resolveUrl?: resolveUrl;
|
|
16
|
-
onSubmit?: (urlEncodedFormValues: string, formValues:
|
|
17
|
+
onSubmit?: (urlEncodedFormValues: string, formValues: IFormState) => Promise<any>;
|
|
17
18
|
onValidationFail?: () => void;
|
|
18
19
|
postGenAiMessage?: ({ message, profile, }: PostMessageProps) => Promise<PostMessageResponse>;
|
|
19
20
|
}
|
|
20
|
-
declare const FormBuilder: ({ config, controlProps, customControls, fileUploaderConfig, iconType, state, resolveUrl, onSubmit, onValidationFail, postGenAiMessage, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const FormBuilder: ({ config, controlProps, customControls, fileUploaderConfig, iconType, state, resolveUrl, onSubmit, onValidationFail, postGenAiMessage, }: IProps) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
21
22
|
interface FormProps {
|
|
22
23
|
method: string;
|
|
23
24
|
formSubmitted: boolean;
|
package/dist/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FormControls } from "../../../../types";
|
|
2
2
|
export interface IFormState {
|
|
3
|
-
[key: string]: string | string[] | IFormState | IFormState[];
|
|
3
|
+
[key: string]: string | string[] | IFormState | IFormState[] | undefined;
|
|
4
4
|
}
|
|
5
5
|
declare const extractFormControlValues: (controls: FormControls) => IFormState;
|
|
6
6
|
export default extractFormControlValues;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface IUrlObj {
|
|
2
|
-
[key: string]: string | string[] | IUrlObj | IUrlObj[];
|
|
2
|
+
[key: string]: string | string[] | IUrlObj | IUrlObj[] | undefined;
|
|
3
3
|
}
|
|
4
|
-
declare const jsonToUrlEncoded: (obj: IUrlObj) =>
|
|
4
|
+
declare const jsonToUrlEncoded: (obj: IUrlObj) => string;
|
|
5
5
|
export default jsonToUrlEncoded;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const getMatchingControls: (formControl: any, customControls: any, defaultControls: any, id
|
|
2
|
-
declare const getHighestMatchingControl: (formControl: any, customControls: any, defaultControls: any, id
|
|
1
|
+
export declare const getMatchingControls: (formControl: any, customControls: any, defaultControls: any, id?: string) => any[];
|
|
2
|
+
declare const getHighestMatchingControl: (formControl: any, customControls: any, defaultControls: any, id?: string) => {
|
|
3
3
|
control: any;
|
|
4
4
|
error?: undefined;
|
|
5
5
|
} | {
|
|
@@ -5,8 +5,8 @@ export interface CalendarModalInterface {
|
|
|
5
5
|
}
|
|
6
6
|
interface ICalendarModal {
|
|
7
7
|
handleDateChange: (date: CalendarModalInterface, keepModalState?: boolean) => void;
|
|
8
|
-
from
|
|
9
|
-
to
|
|
8
|
+
from?: string;
|
|
9
|
+
to?: string;
|
|
10
10
|
}
|
|
11
11
|
declare const CalendarModal: ({ handleDateChange, from, to }: ICalendarModal) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export default CalendarModal;
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import { CustomAttributes, OnChangeValueType } from "../../../../types";
|
|
2
|
+
export interface MrnOption {
|
|
3
|
+
key: string;
|
|
4
|
+
mrn: string;
|
|
5
|
+
mrnEntries: Record<string, unknown>;
|
|
6
|
+
}
|
|
2
7
|
interface IUseMrnProps {
|
|
3
8
|
value: string;
|
|
4
|
-
customAttributes
|
|
5
|
-
objectPathId
|
|
9
|
+
customAttributes?: CustomAttributes;
|
|
10
|
+
objectPathId?: string;
|
|
6
11
|
onChangeValue: (newProperties: OnChangeValueType) => void;
|
|
7
12
|
}
|
|
8
13
|
declare const useMrn: ({ value, customAttributes, objectPathId, onChangeValue, }: IUseMrnProps) => {
|
|
9
14
|
isLoading: boolean;
|
|
10
15
|
isOpen: boolean;
|
|
11
16
|
isDisabled: boolean;
|
|
12
|
-
mrnOptions:
|
|
13
|
-
selectedOption:
|
|
14
|
-
setSelectedOption: import("react").Dispatch<
|
|
17
|
+
mrnOptions: MrnOption[];
|
|
18
|
+
selectedOption: MrnOption | null;
|
|
19
|
+
setSelectedOption: import("react").Dispatch<import("react").SetStateAction<MrnOption | null>>;
|
|
15
20
|
setSearchText: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
16
21
|
setIsOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
17
|
-
currentMrnOption: CustomAttributes | import("../../../../types").MrnInputMultipleServices;
|
|
22
|
+
currentMrnOption: CustomAttributes | import("../../../../types").MrnInputMultipleServices | undefined;
|
|
18
23
|
onChangeCurrentMrnOption: (newSource: any) => void;
|
|
19
|
-
dependentControls: string[];
|
|
24
|
+
dependentControls: (string | undefined)[];
|
|
20
25
|
};
|
|
21
26
|
export default useMrn;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CustomAttributes, resolveUrl } from "../../../../types";
|
|
2
|
-
declare const fetchMrn: (mrnRef: string, attributes?: CustomAttributes, params?: string, resolveUrl?: resolveUrl) => Promise<any>;
|
|
2
|
+
declare const fetchMrn: (mrnRef: string, attributes?: CustomAttributes, params?: string | null, resolveUrl?: resolveUrl) => Promise<any>;
|
|
3
3
|
export default fetchMrn;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
declare const Link: (children: ReactNode, mrnRef: string, displayName: string, disableMrnLink: boolean, params: any) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Link: (children: ReactNode, mrnRef: string, displayName: string, disableMrnLink: boolean | undefined, params: any) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Link;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const resolveMrnLink: (windowLocation: any, mrn: string, applicationId
|
|
1
|
+
declare const resolveMrnLink: (windowLocation: any, mrn: string, applicationId?: string) => string;
|
|
2
2
|
export default resolveMrnLink;
|
package/dist/components/controls/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const resolveNestedQueryLink: (objectPath: string, query: string) => string;
|
|
1
|
+
declare const resolveNestedQueryLink: (objectPath: string | null | undefined, query: string) => string;
|
|
2
2
|
export default resolveNestedQueryLink;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { MultiSelectOption } from "../../MultiSelect";
|
|
2
2
|
import { SelectFormControlOption } from "../../../../../types";
|
|
3
|
-
declare const extractSelectedOptionValues: (options: SelectFormControlOption[], selectedOptions: MultiSelectOption[]) => {
|
|
3
|
+
declare const extractSelectedOptionValues: (options: SelectFormControlOption[] | undefined, selectedOptions: MultiSelectOption[]) => {
|
|
4
4
|
optionValues: string | string[];
|
|
5
5
|
updatedOptions: {
|
|
6
6
|
selected: boolean;
|
|
7
7
|
value: string;
|
|
8
8
|
text: string;
|
|
9
9
|
phone?: string;
|
|
10
|
-
key?: string;
|
|
10
|
+
key?: string | undefined;
|
|
11
11
|
mrnEntries?: {
|
|
12
12
|
[key: string]: any;
|
|
13
|
-
};
|
|
14
|
-
hasChanged?: boolean;
|
|
13
|
+
} | undefined;
|
|
14
|
+
hasChanged?: boolean | undefined;
|
|
15
15
|
error?: {
|
|
16
16
|
message: string;
|
|
17
|
-
};
|
|
18
|
-
required?: boolean;
|
|
19
|
-
placeholder?: string;
|
|
20
|
-
hasEdited?: "edited" | "not-edited" | undefined;
|
|
21
|
-
"custom-attributes"?: import("../../../../../types").CustomAttributes;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: boolean | undefined;
|
|
19
|
+
placeholder?: string | undefined;
|
|
20
|
+
hasEdited?: "edited" | "not-edited" | undefined | undefined;
|
|
21
|
+
"custom-attributes"?: import("../../../../../types").CustomAttributes | undefined;
|
|
22
22
|
}[];
|
|
23
23
|
};
|
|
24
24
|
export default extractSelectedOptionValues;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectFormControlOption } from "../../../../types";
|
|
2
|
-
declare const getSelectedOption: (options: SelectFormControlOption[], value: string) => SelectFormControlOption;
|
|
2
|
+
declare const getSelectedOption: (options: SelectFormControlOption[] | undefined, value: string | undefined) => SelectFormControlOption | undefined;
|
|
3
3
|
export default getSelectedOption;
|
|
@@ -5,7 +5,7 @@ interface AiActionProps {
|
|
|
5
5
|
isLoading: boolean;
|
|
6
6
|
isDisabled: boolean;
|
|
7
7
|
index: number;
|
|
8
|
-
onClick: (prompt: string, profile: string, index: number) => void;
|
|
8
|
+
onClick: (prompt: string, profile: string | undefined, index: number) => void;
|
|
9
9
|
}
|
|
10
10
|
declare const AiAction: ({ action, objectPathId, isLoading, isDisabled, index, onClick, }: AiActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default AiAction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FillMode, GenAiPrompts, OnChangeValueType } from "../../../../types";
|
|
2
2
|
import React from "react";
|
|
3
3
|
export interface AiWrapperProps {
|
|
4
|
-
aiActions
|
|
4
|
+
aiActions?: GenAiPrompts;
|
|
5
5
|
inputControl: React.ReactNode;
|
|
6
6
|
AiResponseControl: React.FC<any>;
|
|
7
7
|
objectPathId: string | null;
|
|
@@ -3,17 +3,17 @@ export interface useAiProps {
|
|
|
3
3
|
onAcceptAiResponse: (newProperties: OnChangeValueType) => void;
|
|
4
4
|
}
|
|
5
5
|
declare const useAi: ({ onAcceptAiResponse }: useAiProps) => {
|
|
6
|
-
aiResponse: PostMessageResponse;
|
|
6
|
+
aiResponse: PostMessageResponse | null;
|
|
7
7
|
editedResponseValue: string;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
isError: {
|
|
10
10
|
state: boolean;
|
|
11
11
|
message: string;
|
|
12
12
|
prompt: string;
|
|
13
|
-
profile
|
|
13
|
+
profile?: string;
|
|
14
14
|
};
|
|
15
|
-
loadingActionIndex: number;
|
|
16
|
-
handleAiActionClick: (prompt: string, profile: string, index: number) => Promise<void>;
|
|
15
|
+
loadingActionIndex: number | null;
|
|
16
|
+
handleAiActionClick: (prompt: string, profile: string | undefined, index: number | null) => Promise<void>;
|
|
17
17
|
handleAiResponseChange: (newProperties: OnChangeValueType) => void;
|
|
18
18
|
handleAccept: () => void;
|
|
19
19
|
handleDiscard: () => void;
|
|
@@ -2,12 +2,14 @@ import React, { FC } from "react";
|
|
|
2
2
|
import type { queryControl } from "../components/QueryControl/data/defaultControls";
|
|
3
3
|
import type { PostMessageProps, PostMessageResponse } from "../types";
|
|
4
4
|
import { FileUploaderConfig, FormControl, FormControls, resolveUrl } from "../types";
|
|
5
|
-
interface
|
|
5
|
+
interface ContextDefaults {
|
|
6
6
|
formControls: FormControls;
|
|
7
|
-
fileUploaderConfig: FileUploaderConfig;
|
|
8
|
-
customControls: queryControl[];
|
|
9
7
|
hasExpertMode: boolean;
|
|
10
8
|
isExpertMode: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface ContextProps extends ContextDefaults {
|
|
11
|
+
fileUploaderConfig: FileUploaderConfig;
|
|
12
|
+
customControls: queryControl[];
|
|
11
13
|
enableExpertMode: () => void;
|
|
12
14
|
toggleExpertMode: () => void;
|
|
13
15
|
resolveUrl: resolveUrl;
|
|
@@ -23,7 +25,8 @@ interface ContextProps {
|
|
|
23
25
|
showValidationErrors: boolean;
|
|
24
26
|
postGenAiMessage?: ({ message, profile, }: PostMessageProps) => Promise<PostMessageResponse>;
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
type FormDataContextValue = ContextDefaults & Partial<Omit<ContextProps, keyof ContextDefaults>>;
|
|
29
|
+
export declare const FormDataContext: React.Context<FormDataContextValue>;
|
|
27
30
|
export declare const getControlByPath: (formControls: FormControls, path: string) => FormControl;
|
|
28
31
|
export interface ProviderProps {
|
|
29
32
|
children: React.ReactNode;
|