@micromerce/formbuilder-react 1.0.595 → 1.0.596
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formbuilder.js +660 -0
- package/dist/formbuilder.js.LICENSE.txt +60 -0
- package/dist/formbuilder.js.map +1 -0
- package/package.json +51 -44
- package/dist/esm/index.js +0 -128984
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/assets/icons/error/Error.d.ts +0 -2
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +0 -10
- package/dist/esm/types/components/Checkbox/index.d.ts +0 -1
- package/dist/esm/types/components/ControlWrapper/ControlWrapper.d.ts +0 -11
- package/dist/esm/types/components/ControlWrapper/index.d.ts +0 -1
- package/dist/esm/types/components/DateRangeGroup/DateRangeGroup.d.ts +0 -10
- package/dist/esm/types/components/DateRangeGroup/DateRangeGroup.styles.d.ts +0 -3
- package/dist/esm/types/components/DateRangeGroup/components/CalendarModal.d.ts +0 -14
- package/dist/esm/types/components/DateRangeGroup/index.d.ts +0 -1
- package/dist/esm/types/components/ErrorBoundary/ErrorBoundary.d.ts +0 -14
- package/dist/esm/types/components/FileUploader/FileUploader.d.ts +0 -9
- package/dist/esm/types/components/FileUploader/index.d.ts +0 -1
- package/dist/esm/types/components/FormBuilder/FormBuilder.d.ts +0 -25
- package/dist/esm/types/components/FormBuilder/index.d.ts +0 -1
- package/dist/esm/types/components/FormBuilder/utils/extractFormControlValues/extractFormControlValues.d.ts +0 -6
- package/dist/esm/types/components/FormBuilder/utils/extractFormControlValues/index.d.ts +0 -1
- package/dist/esm/types/components/FormBuilder/utils/jsonToUrlEncoded/index.d.ts +0 -1
- package/dist/esm/types/components/FormBuilder/utils/jsonToUrlEncoded/jsonToUrlEncoded.d.ts +0 -5
- package/dist/esm/types/components/FormFooter/FormFooter.d.ts +0 -15
- package/dist/esm/types/components/FormFooter/components/Switch.d.ts +0 -1
- package/dist/esm/types/components/FormFooter/index.d.ts +0 -1
- package/dist/esm/types/components/FormGroup/FormGroup.d.ts +0 -15
- package/dist/esm/types/components/FormGroup/index.d.ts +0 -1
- package/dist/esm/types/components/FormList/FormList.d.ts +0 -11
- package/dist/esm/types/components/FormList/index.d.ts +0 -1
- package/dist/esm/types/components/GeneralFormGroup/GeneralFormGroup.d.ts +0 -5
- package/dist/esm/types/components/GeneralFormGroup/index.d.ts +0 -1
- package/dist/esm/types/components/Group/Group.d.ts +0 -12
- package/dist/esm/types/components/Group/index.d.ts +0 -1
- package/dist/esm/types/components/Input/Input.d.ts +0 -14
- package/dist/esm/types/components/Input/index.d.ts +0 -1
- package/dist/esm/types/components/Input/input.styles.d.ts +0 -9
- package/dist/esm/types/components/InputFreeSolo/InputFreeSolo.d.ts +0 -10
- package/dist/esm/types/components/InputFreeSolo/index.d.ts +0 -1
- package/dist/esm/types/components/MrnInput/MrnInput.d.ts +0 -11
- package/dist/esm/types/components/MrnInput/hooks/useMrn.d.ts +0 -22
- package/dist/esm/types/components/MrnInput/index.d.ts +0 -1
- package/dist/esm/types/components/MrnInput/services/fetchMrn.d.ts +0 -3
- package/dist/esm/types/components/MrnInput/ui-helper/Link/Link.d.ts +0 -3
- package/dist/esm/types/components/MrnInput/utils/mrnUtils/mrnUtils.d.ts +0 -8
- package/dist/esm/types/components/MrnInput/utils/resolveMrnLinks/resolveMrnLink.d.ts +0 -2
- package/dist/esm/types/components/MrnInput/utils/resolveNestedQueryLink/resolveNestedQueryLink.d.ts +0 -2
- package/dist/esm/types/components/MrnInput/utils/urlSearchParam/urlSearchParam.d.ts +0 -1
- package/dist/esm/types/components/MultiSelect/MultiSelect.d.ts +0 -17
- package/dist/esm/types/components/MultiSelect/index.d.ts +0 -1
- package/dist/esm/types/components/MultiSelect/utils/extractSelectedOptionValues/extractSelectedOptionValues.d.ts +0 -24
- package/dist/esm/types/components/MultiSelect/utils/extractSelectedOptionValues/index.d.ts +0 -1
- package/dist/esm/types/components/PasswordInput/PasswordInput.d.ts +0 -12
- package/dist/esm/types/components/PasswordInput/index.d.ts +0 -1
- package/dist/esm/types/components/QueryControl/QueryControl.d.ts +0 -13
- package/dist/esm/types/components/QueryControl/data/defaultControls.d.ts +0 -9
- package/dist/esm/types/components/QueryControl/index.d.ts +0 -1
- package/dist/esm/types/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.d.ts +0 -8
- package/dist/esm/types/components/QueryControl/ui-helper/Wrapper/QueryControlWrapper.styles.d.ts +0 -6
- package/dist/esm/types/components/QueryControl/ui-helper/Wrapper/index.d.ts +0 -1
- package/dist/esm/types/components/QueryControl/utils/allControlsHidden/allControlsHidden.d.ts +0 -3
- package/dist/esm/types/components/QueryControl/utils/allControlsHidden/index.d.ts +0 -1
- package/dist/esm/types/components/QueryControl/utils/getMatchingControls.d.ts +0 -9
- package/dist/esm/types/components/QueryControl/utils/hasExpertControl/hasExpertControl.d.ts +0 -3
- package/dist/esm/types/components/QueryControl/utils/hasExpertControl/index.d.ts +0 -1
- package/dist/esm/types/components/QueryControl/utils/hideGroup/hideGroup.d.ts +0 -3
- package/dist/esm/types/components/QueryControl/utils/hideGroup/index.d.ts +0 -1
- package/dist/esm/types/components/Select/Select.d.ts +0 -12
- package/dist/esm/types/components/Select/index.d.ts +0 -1
- package/dist/esm/types/components/Select/utils/getSelectedOption.d.ts +0 -3
- package/dist/esm/types/components/Textarea/Textarea.d.ts +0 -10
- package/dist/esm/types/components/Textarea/Textarea.types.d.ts +0 -12
- package/dist/esm/types/components/Textarea/aiWrapper/aiAction.d.ts +0 -12
- package/dist/esm/types/components/Textarea/aiWrapper/aiLayout.d.ts +0 -10
- package/dist/esm/types/components/Textarea/aiWrapper/index.d.ts +0 -11
- package/dist/esm/types/components/Textarea/aiWrapper/useAi.d.ts +0 -21
- package/dist/esm/types/components/Textarea/editors/Default.d.ts +0 -13
- package/dist/esm/types/components/Textarea/editors/Html.d.ts +0 -10
- package/dist/esm/types/components/Textarea/editors/Json.d.ts +0 -10
- package/dist/esm/types/components/Textarea/editors/Markdown.d.ts +0 -10
- package/dist/esm/types/components/Textarea/editors/Richtext.d.ts +0 -12
- package/dist/esm/types/components/Textarea/index.d.ts +0 -1
- package/dist/esm/types/components/addressGroup/AddressGroup.d.ts +0 -12
- package/dist/esm/types/components/addressGroup/index.d.ts +0 -1
- package/dist/esm/types/components/addressGroup/utils/Countries.d.ts +0 -3
- package/dist/esm/types/components/states/error/index.d.ts +0 -5
- package/dist/esm/types/context/FormData.d.ts +0 -33
- package/dist/esm/types/hooks/useDependent/enhanced/useInputDependent/useInputDependent.d.ts +0 -12
- package/dist/esm/types/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.d.ts +0 -15
- package/dist/esm/types/hooks/useDependent/useDependent.d.ts +0 -11
- package/dist/esm/types/hooks/useValueGenerator/useValueGenerator.d.ts +0 -18
- package/dist/esm/types/index.d.ts +0 -2
- package/dist/esm/types/styles/Hidden.styles.d.ts +0 -7
- package/dist/esm/types/styles/Skeleton.d.ts +0 -7
- package/dist/esm/types/styles/Textfield.styles.d.ts +0 -5
- package/dist/esm/types/testutils.d.ts +0 -14
- package/dist/esm/types/types/controlProps.d.ts +0 -70
- package/dist/esm/types/types/index.d.ts +0 -166
- package/dist/esm/types/ui/menu/hooks/useMenu.d.ts +0 -14
- package/dist/esm/types/ui/menu/index.d.ts +0 -13
- package/dist/esm/types/ui/menu/test/createControl.d.ts +0 -15
- package/dist/esm/types/ui/menu/utils/detemineSubmenuTabs/index.d.ts +0 -14
- package/dist/esm/types/ui-helper/HeaderCollapseButton/index.d.ts +0 -7
- package/dist/esm/types/ui-helper/notifications/Error.d.ts +0 -6
- package/dist/esm/types/ui-helper/notifications/images/background.d.ts +0 -2
- package/dist/esm/types/ui-helper/notifications/images/spinner.d.ts +0 -2
- package/dist/esm/types/ui-helper/notifications/images/under-improvement.d.ts +0 -2
- package/dist/esm/types/utils/findFormControlError/index.d.ts +0 -3
- package/dist/esm/types/utils/hasGroupRequiredFieldsWithValues/index.d.ts +0 -6
- package/dist/types/index.d.ts +0 -244
@@ -1,21 +0,0 @@
|
|
1
|
-
import type { OnChangeValueType, PostMessageResponse } from "../../../types";
|
2
|
-
export interface useAiProps {
|
3
|
-
onAcceptAiResponse: (newProperties: OnChangeValueType) => void;
|
4
|
-
}
|
5
|
-
declare const useAi: ({ onAcceptAiResponse }: useAiProps) => {
|
6
|
-
aiResponse: PostMessageResponse;
|
7
|
-
isLoading: boolean;
|
8
|
-
isError: {
|
9
|
-
state: boolean;
|
10
|
-
message: string;
|
11
|
-
prompt: string;
|
12
|
-
profile: string;
|
13
|
-
};
|
14
|
-
loadingActionIndex: number;
|
15
|
-
handleAiActionClick: (prompt: string, profile: string, index: number) => Promise<void>;
|
16
|
-
handleAccept: () => void;
|
17
|
-
handleDiscard: () => void;
|
18
|
-
handleBack: () => void;
|
19
|
-
handleRetry: () => Promise<void>;
|
20
|
-
};
|
21
|
-
export default useAi;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { DetailedHTMLProps, TextareaHTMLAttributes } from "react";
|
2
|
-
import { OnChangeValueType, TextareaFormControl } from "../../../types";
|
3
|
-
export interface IProps extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
|
4
|
-
control?: TextareaFormControl;
|
5
|
-
value?: string;
|
6
|
-
onChange?: (newProperties: OnChangeValueType) => void;
|
7
|
-
id?: string;
|
8
|
-
readOnly?: boolean;
|
9
|
-
textColor?: string;
|
10
|
-
errorClass?: string;
|
11
|
-
}
|
12
|
-
declare const DefaultEditor: ({ value, onChange, id, readOnly, control, errorClass, textColor, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
13
|
-
export default DefaultEditor;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { OnChangeValueType } from "../../../types";
|
3
|
-
interface IHtmlEditorProps {
|
4
|
-
value: string;
|
5
|
-
onChange: (newProperties: OnChangeValueType) => void;
|
6
|
-
id: string;
|
7
|
-
readOnly: boolean;
|
8
|
-
}
|
9
|
-
declare const HtmlEditor: React.FC<IHtmlEditorProps>;
|
10
|
-
export default HtmlEditor;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { OnChangeValueType } from "../../../types";
|
3
|
-
interface ICodeEditorProps {
|
4
|
-
value: string;
|
5
|
-
onChange: (newProperties: OnChangeValueType) => void;
|
6
|
-
id: string;
|
7
|
-
readOnly: boolean;
|
8
|
-
}
|
9
|
-
declare const CodeEditor: React.FC<ICodeEditorProps>;
|
10
|
-
export default CodeEditor;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { OnChangeValueType } from "../../../types";
|
3
|
-
interface IMarkdownEditorProps {
|
4
|
-
value: string;
|
5
|
-
onChange: (newProperties: OnChangeValueType) => void;
|
6
|
-
id: string;
|
7
|
-
readOnly: boolean;
|
8
|
-
}
|
9
|
-
declare const MarkdownEditor: React.FC<IMarkdownEditorProps>;
|
10
|
-
export default MarkdownEditor;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import "react-quill/dist/quill.snow.css";
|
3
|
-
import { OnChangeValueType } from "../../../types";
|
4
|
-
import "./Richtext.css";
|
5
|
-
interface IRichTextEditorProps {
|
6
|
-
value: string;
|
7
|
-
onChange: (newProperties: OnChangeValueType) => void;
|
8
|
-
id: string;
|
9
|
-
readOnly: boolean;
|
10
|
-
}
|
11
|
-
declare const RichTextEditor: React.FC<IRichTextEditorProps>;
|
12
|
-
export default RichTextEditor;
|
@@ -1 +0,0 @@
|
|
1
|
-
export { default } from "./Textarea";
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { controlProps } from "../../types/controlProps";
|
2
|
-
import { GroupFormControl } from "../../types/index";
|
3
|
-
export interface IProps {
|
4
|
-
id: string;
|
5
|
-
control: GroupFormControl;
|
6
|
-
objectPathId?: string;
|
7
|
-
groupIsRequired?: boolean;
|
8
|
-
isInGroup?: boolean;
|
9
|
-
controlProps?: controlProps;
|
10
|
-
}
|
11
|
-
declare const AddressGroup: ({ ...props }: IProps) => import("react/jsx-runtime").JSX.Element;
|
12
|
-
export default AddressGroup;
|
@@ -1 +0,0 @@
|
|
1
|
-
export { default } from "./AddressGroup";
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import React, { FC } from "react";
|
2
|
-
import type { PostMessageProps, PostMessageResponse } from "../types";
|
3
|
-
import { FileUploaderConfig, FormControl, FormControls, resolveUrl } from "../types";
|
4
|
-
interface ContextProps {
|
5
|
-
formControls: FormControls;
|
6
|
-
fileUploaderConfig: FileUploaderConfig;
|
7
|
-
hasExpertMode: boolean;
|
8
|
-
isExpertMode: boolean;
|
9
|
-
enableExpertMode: () => void;
|
10
|
-
toggleExpertMode: () => void;
|
11
|
-
resolveUrl: resolveUrl;
|
12
|
-
updateControl: (id: string, control: FormControl) => void;
|
13
|
-
addListItem: (listName: string) => void;
|
14
|
-
addFileUploaderConfig: (endpoints: FileUploaderConfig) => void;
|
15
|
-
moveListItemUp: (listName: string, index: number) => void;
|
16
|
-
moveListItemDown: (listName: string, index: number) => void;
|
17
|
-
removeListItem: (listName: string, index: number) => void;
|
18
|
-
getControlByObjectPath: (path: string) => FormControl;
|
19
|
-
toggleRerendered: boolean;
|
20
|
-
postGenAiMessage?: ({ message, profile, }: PostMessageProps) => Promise<PostMessageResponse>;
|
21
|
-
}
|
22
|
-
export declare const FormDataContext: React.Context<Partial<ContextProps>>;
|
23
|
-
export declare const getControlByPath: (formControls: FormControls, path: string) => FormControl;
|
24
|
-
export interface ProviderProps {
|
25
|
-
children: React.ReactNode;
|
26
|
-
controls: FormControls;
|
27
|
-
fileUploaderConfig?: FileUploaderConfig;
|
28
|
-
resolveUrl?: resolveUrl;
|
29
|
-
postGenAiMessage?: ({ message, profile, }: PostMessageProps) => Promise<PostMessageResponse>;
|
30
|
-
}
|
31
|
-
export declare const getEnhancedControls: (controls: FormControls) => FormControls;
|
32
|
-
export declare const FormDataProvider: FC<ProviderProps>;
|
33
|
-
export {};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { ControlCommons, OnChangeValueType } from "../../../../types";
|
2
|
-
interface IUseInputDependentProps {
|
3
|
-
onChangeValue: (newProperties: OnChangeValueType, customizer?: (...args: any) => any) => void;
|
4
|
-
query: string;
|
5
|
-
objectPathId: string;
|
6
|
-
value: string;
|
7
|
-
hasEdited?: ControlCommons["hasEdited"];
|
8
|
-
}
|
9
|
-
declare const useInputDependent: ({ onChangeValue, query, objectPathId, value, hasEdited, }: IUseInputDependentProps) => {
|
10
|
-
textColor: string;
|
11
|
-
};
|
12
|
-
export default useInputDependent;
|
package/dist/esm/types/hooks/useDependent/enhanced/useOptionsGenerator/useOptionsGenerator.d.ts
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
import type { SelectFormControlOption } from "../../../../types";
|
2
|
-
interface IUseOptionsGeneratorProps {
|
3
|
-
query: string;
|
4
|
-
controlKey: string;
|
5
|
-
objectPathId: string;
|
6
|
-
options: SelectFormControlOption[];
|
7
|
-
}
|
8
|
-
declare const useOptionsGenerator: ({ query, controlKey, objectPathId, options, }: IUseOptionsGeneratorProps) => {
|
9
|
-
options: SelectFormControlOption[];
|
10
|
-
mrnEntriesLoaded?: undefined;
|
11
|
-
} | {
|
12
|
-
options: any;
|
13
|
-
mrnEntriesLoaded: boolean;
|
14
|
-
};
|
15
|
-
export default useOptionsGenerator;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
interface IUseDependentProps {
|
2
|
-
query: string | null;
|
3
|
-
objectPathId: string | null;
|
4
|
-
}
|
5
|
-
declare const useDependent: ({ query, objectPathId }: IUseDependentProps) => {
|
6
|
-
dependentControls: string[];
|
7
|
-
resolvedQuery: string;
|
8
|
-
isDisabled: boolean;
|
9
|
-
mrnEntriesLoaded: boolean;
|
10
|
-
};
|
11
|
-
export default useDependent;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import type { FormControls } from "../../types";
|
2
|
-
interface IUseValueGeneratorProps {
|
3
|
-
query: string | null;
|
4
|
-
objectPathId: string | null;
|
5
|
-
}
|
6
|
-
interface IUseValueGeneratorWithContextProps extends IUseValueGeneratorProps {
|
7
|
-
formControls: FormControls;
|
8
|
-
}
|
9
|
-
declare const useValueGenerator: ({ query, formControls, objectPathId, }: IUseValueGeneratorWithContextProps) => {
|
10
|
-
value: any;
|
11
|
-
hasQuery: boolean;
|
12
|
-
};
|
13
|
-
declare const useValueGeneratorWithContext: ({ query, objectPathId, }: IUseValueGeneratorProps) => {
|
14
|
-
value: any;
|
15
|
-
hasQuery: boolean;
|
16
|
-
};
|
17
|
-
export { useValueGenerator, useValueGeneratorWithContext };
|
18
|
-
export default useValueGeneratorWithContext;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
interface StyledVisibilityContainerProps {
|
2
|
-
visible: boolean;
|
3
|
-
error?: string;
|
4
|
-
}
|
5
|
-
export declare const StyledVisibilityContainer: import("styled-components").StyledComponent<"div", any, StyledVisibilityContainerProps, never>;
|
6
|
-
export declare const StyledVisibilityContainerProgress: import("styled-components").StyledComponent<"progress", any, StyledVisibilityContainerProps, never>;
|
7
|
-
export {};
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { TextFieldProps } from "@mui/material";
|
2
|
-
declare const StyledTextField: import("@emotion/styled").StyledComponent<{
|
3
|
-
variant?: import("@mui/material").TextFieldVariants;
|
4
|
-
} & Omit<import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & TextFieldProps, {}, {}>;
|
5
|
-
export default StyledTextField;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import React, { FC, ReactElement } from "react";
|
2
|
-
import { RenderOptions } from "@testing-library/react";
|
3
|
-
import { FileUploaderConfig, FormControls, resolveUrl } from "./types";
|
4
|
-
interface IProps {
|
5
|
-
children?: React.ReactNode;
|
6
|
-
controls?: FormControls;
|
7
|
-
fileUploaderConfig?: FileUploaderConfig;
|
8
|
-
resolveUrl?: resolveUrl;
|
9
|
-
}
|
10
|
-
export declare const TestWrapper: FC<IProps>;
|
11
|
-
declare const customRender: (ui: ReactElement, options?: Omit<RenderOptions, "wrapper">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
12
|
-
export declare const renderViaFormBuilder: (controls: FormControls, fileUploaderConfig?: FileUploaderConfig, resolveUrl?: resolveUrl, options?: RenderOptions) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
13
|
-
export * from "@testing-library/react";
|
14
|
-
export { customRender as render };
|
@@ -1,70 +0,0 @@
|
|
1
|
-
import type { SxProps } from "@mui/material";
|
2
|
-
import React from "react";
|
3
|
-
export type controlProps = {
|
4
|
-
formProps?: {
|
5
|
-
style?: React.CSSProperties;
|
6
|
-
};
|
7
|
-
inputProps?: {
|
8
|
-
style?: React.CSSProperties;
|
9
|
-
};
|
10
|
-
mrnProps?: {
|
11
|
-
disableMrnLink?: boolean;
|
12
|
-
};
|
13
|
-
selectProps?: {
|
14
|
-
sx?: SxProps;
|
15
|
-
textField?: {
|
16
|
-
sx?: SxProps;
|
17
|
-
};
|
18
|
-
listBox?: {
|
19
|
-
sx?: SxProps;
|
20
|
-
};
|
21
|
-
};
|
22
|
-
footerProps?: {
|
23
|
-
style?: React.CSSProperties;
|
24
|
-
container?: {
|
25
|
-
style?: React.CSSProperties;
|
26
|
-
};
|
27
|
-
submitButtonContainer?: {
|
28
|
-
style?: React.CSSProperties;
|
29
|
-
};
|
30
|
-
submitButton?: {
|
31
|
-
sx?: SxProps;
|
32
|
-
};
|
33
|
-
};
|
34
|
-
addressProps?: {
|
35
|
-
style?: React.CSSProperties;
|
36
|
-
label?: {
|
37
|
-
style?: React.CSSProperties;
|
38
|
-
};
|
39
|
-
container?: {
|
40
|
-
style?: React.CSSProperties;
|
41
|
-
};
|
42
|
-
};
|
43
|
-
controlWrapperProps?: {
|
44
|
-
style?: React.CSSProperties;
|
45
|
-
label?: {
|
46
|
-
style?: React.CSSProperties;
|
47
|
-
};
|
48
|
-
container?: {
|
49
|
-
style?: React.CSSProperties;
|
50
|
-
};
|
51
|
-
};
|
52
|
-
groupProps?: {
|
53
|
-
style?: React.CSSProperties;
|
54
|
-
label?: {
|
55
|
-
style?: React.CSSProperties;
|
56
|
-
};
|
57
|
-
};
|
58
|
-
listProps?: {
|
59
|
-
style?: React.CSSProperties;
|
60
|
-
addButton?: {
|
61
|
-
sx?: SxProps;
|
62
|
-
};
|
63
|
-
label?: {
|
64
|
-
style?: React.CSSProperties;
|
65
|
-
};
|
66
|
-
container?: {
|
67
|
-
style?: React.CSSProperties;
|
68
|
-
};
|
69
|
-
};
|
70
|
-
};
|
@@ -1,166 +0,0 @@
|
|
1
|
-
export type CaseSensitivity<T extends string> = string extends T ? string : T extends `${infer F1}${infer F2}${infer R}` ? `${Uppercase<F1> | Lowercase<F1>}${Uppercase<F2> | Lowercase<F2>}${CaseSensitivity<R>}` : T extends `${infer F}${infer R}` ? `${Uppercase<F> | Lowercase<F>}${CaseSensitivity<R>}` : "";
|
2
|
-
export interface ControlCommons {
|
3
|
-
key?: string;
|
4
|
-
displayName?: string;
|
5
|
-
value?: string;
|
6
|
-
mrnEntries?: {
|
7
|
-
[key: string]: any;
|
8
|
-
};
|
9
|
-
hasChanged?: boolean;
|
10
|
-
error?: {
|
11
|
-
message: string;
|
12
|
-
};
|
13
|
-
required?: boolean;
|
14
|
-
placeholder?: string;
|
15
|
-
hasEdited?: "edited" | "not-edited" | undefined;
|
16
|
-
"custom-attributes"?: CustomAttributes;
|
17
|
-
}
|
18
|
-
export type FormVisibility = "hidden" | "visible" | "expert" | {
|
19
|
-
hideOnCondition: string;
|
20
|
-
};
|
21
|
-
export type GenAiPrompt = {
|
22
|
-
displayValue: string;
|
23
|
-
promptTemplate: string;
|
24
|
-
profile?: string;
|
25
|
-
};
|
26
|
-
export type GenAiPrompts = GenAiPrompt[];
|
27
|
-
export interface CustomAttributes {
|
28
|
-
media?: string;
|
29
|
-
"mrn-ref"?: string;
|
30
|
-
"mrn-ref-display-field"?: string;
|
31
|
-
"mrn-ref-params"?: string;
|
32
|
-
"mrn-ref-mrn-field"?: string;
|
33
|
-
options?: InputFreeSoloOptions[];
|
34
|
-
mrnPreview?: {
|
35
|
-
displayField?: string;
|
36
|
-
linkDisabled?: boolean;
|
37
|
-
};
|
38
|
-
submenu?: {
|
39
|
-
icon?: string;
|
40
|
-
};
|
41
|
-
mrnSources?: MrnInputMultipleServices[];
|
42
|
-
defaultValue?: string;
|
43
|
-
defaultCollapseThreshold?: string;
|
44
|
-
visibility?: {
|
45
|
-
form?: FormVisibility;
|
46
|
-
detailView?: "hidden" | "visible";
|
47
|
-
table?: "hidden" | "visible";
|
48
|
-
};
|
49
|
-
editor?: "richtext" | "markdown" | "code" | "plate";
|
50
|
-
viewer?: "html" | "markdown";
|
51
|
-
tags?: string | string[];
|
52
|
-
genAiPrompts?: GenAiPrompts;
|
53
|
-
tooltip?: string;
|
54
|
-
[key: string]: any;
|
55
|
-
}
|
56
|
-
export type MrnInputMultipleServices = {
|
57
|
-
name: string;
|
58
|
-
mrn: string;
|
59
|
-
query: string;
|
60
|
-
mrnField: string;
|
61
|
-
displayField: string;
|
62
|
-
[key: string]: any;
|
63
|
-
};
|
64
|
-
export interface GroupFormControl extends ControlCommons {
|
65
|
-
control: "group";
|
66
|
-
controls: FormControls;
|
67
|
-
}
|
68
|
-
export interface InputFormControl extends ControlCommons {
|
69
|
-
control: "input";
|
70
|
-
type: "plain" | "html" | "hex" | "color" | "mrn" | "url" | "date" | "time" | "datetime" | "number" | "email" | "password" | "geolocation";
|
71
|
-
placeholder?: string;
|
72
|
-
pattern?: string;
|
73
|
-
minLength?: number;
|
74
|
-
maxLength?: number;
|
75
|
-
step?: number;
|
76
|
-
}
|
77
|
-
export interface InputFreeSoloOptions {
|
78
|
-
value: string;
|
79
|
-
text?: string;
|
80
|
-
tooltip?: string;
|
81
|
-
default?: "true" | "false" | undefined;
|
82
|
-
}
|
83
|
-
export interface TextareaFormControl extends ControlCommons {
|
84
|
-
control: "textarea";
|
85
|
-
type: "plain" | "html" | "json";
|
86
|
-
}
|
87
|
-
export interface CheckboxFormControl extends ControlCommons {
|
88
|
-
control: "checkbox";
|
89
|
-
selected?: boolean;
|
90
|
-
}
|
91
|
-
export interface SelectFormControlOption extends Omit<ControlCommons, "displayName"> {
|
92
|
-
value: string;
|
93
|
-
text: string;
|
94
|
-
phone?: string;
|
95
|
-
selected?: boolean;
|
96
|
-
}
|
97
|
-
export interface SelectFormControl extends ControlCommons {
|
98
|
-
control: "select";
|
99
|
-
options?: SelectFormControlOption[];
|
100
|
-
multiple?: boolean;
|
101
|
-
}
|
102
|
-
export interface MrnInputServiceSelection {
|
103
|
-
}
|
104
|
-
export interface MultiSelectFormControl extends Omit<SelectFormControl, "value"> {
|
105
|
-
value?: string | string[];
|
106
|
-
}
|
107
|
-
export interface ListFormControl extends ControlCommons {
|
108
|
-
control: "list";
|
109
|
-
items?: FormControls[];
|
110
|
-
required?: boolean;
|
111
|
-
template: FormControls;
|
112
|
-
}
|
113
|
-
export type Control = "input" | "textarea" | "checkbox" | "select" | "list";
|
114
|
-
export type ControlType = "plain" | "html" | "hex" | "color" | "mrn" | "url" | "date" | "time" | "datetime" | "number" | "email" | "password" | "geolocation" | "json";
|
115
|
-
export type FormControl = InputFormControl | TextareaFormControl | CheckboxFormControl | SelectFormControl | MultiSelectFormControl | ListFormControl | GroupFormControl;
|
116
|
-
export interface FormControls {
|
117
|
-
[key: string]: FormControl;
|
118
|
-
}
|
119
|
-
type fileUploaderEndpoint = {
|
120
|
-
url: string;
|
121
|
-
name: string;
|
122
|
-
};
|
123
|
-
export type FileUploaderConfig = {
|
124
|
-
info?: string;
|
125
|
-
endpoints?: fileUploaderEndpoint[];
|
126
|
-
language?: string;
|
127
|
-
previewUrl?: (url: string) => Promise<any>;
|
128
|
-
authorizationHeader?: (url: string, method: string) => string;
|
129
|
-
};
|
130
|
-
export interface FormBuilderConfigLink {
|
131
|
-
href: string;
|
132
|
-
rel: string;
|
133
|
-
text: string;
|
134
|
-
}
|
135
|
-
export interface FormBuilderConfig {
|
136
|
-
method: "POST" | "GET";
|
137
|
-
links: FormBuilderConfigLink[];
|
138
|
-
error?: {
|
139
|
-
message: string;
|
140
|
-
};
|
141
|
-
items: FormControls;
|
142
|
-
}
|
143
|
-
export type OnChangeValueType = {
|
144
|
-
value?: string | string[] | number;
|
145
|
-
[key: string]: any;
|
146
|
-
};
|
147
|
-
export interface resolveUrl {
|
148
|
-
(mrn: string, params: string, opts: any): Promise<any>;
|
149
|
-
}
|
150
|
-
export type MessageType = string;
|
151
|
-
export type MessageStatus = "error" | "success";
|
152
|
-
export interface PostMessageProps {
|
153
|
-
message: MessageType;
|
154
|
-
profile: string;
|
155
|
-
}
|
156
|
-
export type PostMessageResponse = {
|
157
|
-
message: MessageType;
|
158
|
-
model: string;
|
159
|
-
usage: {
|
160
|
-
answer: string;
|
161
|
-
prompt: string;
|
162
|
-
total: string;
|
163
|
-
};
|
164
|
-
status: MessageStatus;
|
165
|
-
};
|
166
|
-
export {};
|
@@ -1,14 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import type { MenuItem } from "..";
|
3
|
-
import type { FormControls } from "../../../types";
|
4
|
-
import type { controlGroups } from "../utils/detemineSubmenuTabs";
|
5
|
-
export declare const updateMenuIndexOnSubmit: (hasSubmenuAndError: boolean, cb: () => void) => void;
|
6
|
-
declare const useMenu: (formControls: FormControls, formSubmitted: boolean, isExpertMode: boolean) => {
|
7
|
-
activeFormControls: FormControls;
|
8
|
-
activeMenuItemIndex: number;
|
9
|
-
controlGroups: controlGroups;
|
10
|
-
hasSubmenu: boolean;
|
11
|
-
menuItems: MenuItem[];
|
12
|
-
setActiveMenuItemIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
|
13
|
-
};
|
14
|
-
export default useMenu;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
export type MenuItem = {
|
3
|
-
name: string;
|
4
|
-
icon: string;
|
5
|
-
};
|
6
|
-
interface IMenuProps {
|
7
|
-
children: React.ReactNode;
|
8
|
-
menuItems: MenuItem[];
|
9
|
-
activeMenuItemIndex: number;
|
10
|
-
onActiveMenuItemIndex: (key: number) => void;
|
11
|
-
}
|
12
|
-
declare const Menu: ({ children, menuItems, activeMenuItemIndex, onActiveMenuItemIndex, }: IMenuProps) => import("react/jsx-runtime").JSX.Element;
|
13
|
-
export default Menu;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import type { FormControl, FormVisibility } from "../../../types";
|
2
|
-
type createControl = {
|
3
|
-
displayName: string;
|
4
|
-
isGroup: boolean;
|
5
|
-
submenu?: {
|
6
|
-
icon?: string;
|
7
|
-
};
|
8
|
-
visibility?: "hidden" | "expert";
|
9
|
-
groupChildVisibility?: FormVisibility;
|
10
|
-
error?: {
|
11
|
-
message: string;
|
12
|
-
};
|
13
|
-
};
|
14
|
-
declare const createControl: ({ displayName, isGroup, submenu, visibility, groupChildVisibility, error, }: createControl) => FormControl;
|
15
|
-
export default createControl;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import type { MenuItem } from "../..";
|
2
|
-
import type { FormControls } from "../../../../types";
|
3
|
-
export type controlGroups = {
|
4
|
-
[key: string]: FormControls;
|
5
|
-
};
|
6
|
-
export declare const INFORMATION_TAB_KEY = "0";
|
7
|
-
export declare const INFO_MENU_ITEM: MenuItem;
|
8
|
-
export declare const hasControlWithSubmenu: (controls: FormControls, isExpertMode: boolean) => boolean;
|
9
|
-
export declare const determineMenuTabIndexWithControlError: (controlGroups: controlGroups) => number;
|
10
|
-
declare const determineSubmenuTabs: (controls: FormControls, isExpertMode: boolean) => FormControls | {
|
11
|
-
controlGroups: controlGroups;
|
12
|
-
menuItems: MenuItem[];
|
13
|
-
};
|
14
|
-
export default determineSubmenuTabs;
|