@form-engine-ts/mui 2.9.2 → 2.9.4
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 +36 -4
- package/dist/index.cjs +1246 -274
- package/dist/index.d.cts +118 -4
- package/dist/index.d.ts +118 -4
- package/dist/index.js +1224 -299
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,122 @@
|
|
|
1
|
-
import { FormBuilderComponents,
|
|
2
|
-
import
|
|
1
|
+
import { BuilderActionIconType, BuilderButtonProps, BuilderCheckboxProps, BuilderErrorMessageProps, BuilderFieldsetProps, BuilderIconButtonProps, BuilderSectionProps, BuilderSelectProps, BuilderTextAreaProps, BuilderTextInputProps, FormBuilderComponents, FormBuilderSlots, FormBuilderProps, BuilderFieldEditorSlotProps, BuilderLocalizationSlotProps, BuilderOptionEditorSlotProps, BuilderToolbarSlotProps } from '@form-engine-ts/react';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ComponentType, ReactNode } from 'react';
|
|
4
|
+
import { CardProps, PaperProps, StackProps, AccordionProps } from '@mui/material';
|
|
5
|
+
|
|
6
|
+
type BuilderSectionName = "basicSettings" | "completionMessage" | "questions" | "addQuestion" | "localization";
|
|
7
|
+
type MuiButtonVariant = "contained" | "outlined" | "text";
|
|
8
|
+
interface MuiLayoutOptions {
|
|
9
|
+
readonly sectionOrder?: readonly BuilderSectionName[];
|
|
10
|
+
}
|
|
11
|
+
interface MuiLocalizationOptions {
|
|
12
|
+
readonly collapsible?: boolean;
|
|
13
|
+
readonly defaultExpanded?: boolean | "when-configured";
|
|
14
|
+
}
|
|
15
|
+
interface MuiBuilderSlotProps {
|
|
16
|
+
readonly card?: Partial<CardProps>;
|
|
17
|
+
readonly paper?: Partial<PaperProps>;
|
|
18
|
+
readonly stack?: Partial<StackProps>;
|
|
19
|
+
readonly accordion?: Partial<AccordionProps>;
|
|
20
|
+
}
|
|
21
|
+
interface MuiAdapterOptions {
|
|
22
|
+
readonly size?: "small" | "medium";
|
|
23
|
+
readonly variant?: "outlined" | "filled" | "standard";
|
|
24
|
+
readonly buttonVariant?: "contained" | "outlined" | "text";
|
|
25
|
+
readonly buttonVariants?: {
|
|
26
|
+
readonly primary?: MuiButtonVariant;
|
|
27
|
+
readonly secondary?: MuiButtonVariant;
|
|
28
|
+
readonly danger?: MuiButtonVariant;
|
|
29
|
+
};
|
|
30
|
+
readonly fullWidth?: boolean;
|
|
31
|
+
readonly dense?: boolean;
|
|
32
|
+
readonly getLocaleLabel?: (locale: string) => string;
|
|
33
|
+
readonly getActionLabel?: (actionType: BuilderActionIconType) => string;
|
|
34
|
+
readonly layoutOptions?: MuiLayoutOptions;
|
|
35
|
+
readonly localizationOptions?: MuiLocalizationOptions;
|
|
36
|
+
readonly muiSlotProps?: MuiBuilderSlotProps;
|
|
37
|
+
}
|
|
38
|
+
interface ResolvedMuiAdapterOptions {
|
|
39
|
+
readonly size: "small" | "medium";
|
|
40
|
+
readonly variant: "outlined" | "filled" | "standard";
|
|
41
|
+
readonly buttonVariant: "contained" | "outlined" | "text";
|
|
42
|
+
readonly buttonVariants?: {
|
|
43
|
+
readonly primary: MuiButtonVariant;
|
|
44
|
+
readonly secondary: MuiButtonVariant;
|
|
45
|
+
readonly danger: MuiButtonVariant;
|
|
46
|
+
};
|
|
47
|
+
readonly fullWidth: boolean;
|
|
48
|
+
readonly dense: boolean;
|
|
49
|
+
readonly getLocaleLabel?: (locale: string) => string;
|
|
50
|
+
readonly getActionLabel?: (actionType: BuilderActionIconType) => string;
|
|
51
|
+
readonly layoutOptions?: MuiLayoutOptions;
|
|
52
|
+
readonly localizationOptions?: MuiLocalizationOptions;
|
|
53
|
+
readonly muiSlotProps?: MuiBuilderSlotProps;
|
|
54
|
+
}
|
|
55
|
+
declare const DEFAULT_MUI_SECTION_ORDER: readonly BuilderSectionName[];
|
|
56
|
+
declare function resolveMuiAdapterOptions(options?: MuiAdapterOptions): ResolvedMuiAdapterOptions;
|
|
57
|
+
|
|
58
|
+
declare function createMuiButtonAdapter(options?: MuiAdapterOptions): ComponentType<BuilderButtonProps>;
|
|
59
|
+
declare const MuiButtonAdapter: ComponentType<BuilderButtonProps>;
|
|
60
|
+
|
|
61
|
+
declare function createMuiCheckboxAdapter(options?: MuiAdapterOptions): ComponentType<BuilderCheckboxProps>;
|
|
62
|
+
declare const MuiCheckboxAdapter: ComponentType<BuilderCheckboxProps>;
|
|
63
|
+
|
|
64
|
+
declare function createMuiErrorMessageAdapter(_options?: MuiAdapterOptions): ComponentType<BuilderErrorMessageProps>;
|
|
65
|
+
declare const MuiErrorMessageAdapter: ComponentType<BuilderErrorMessageProps>;
|
|
66
|
+
|
|
67
|
+
declare function createMuiFieldsetAdapter(options?: MuiAdapterOptions): ComponentType<BuilderFieldsetProps>;
|
|
68
|
+
declare const MuiFieldsetAdapter: ComponentType<BuilderFieldsetProps>;
|
|
69
|
+
|
|
70
|
+
declare function createMuiIconButtonAdapter(options?: MuiAdapterOptions): ComponentType<BuilderIconButtonProps>;
|
|
71
|
+
declare const MuiIconButtonAdapter: ComponentType<BuilderIconButtonProps>;
|
|
72
|
+
|
|
73
|
+
declare function createMuiSectionAdapter(options?: MuiAdapterOptions): ComponentType<BuilderSectionProps>;
|
|
74
|
+
declare const MuiSectionAdapter: ComponentType<BuilderSectionProps>;
|
|
75
|
+
|
|
76
|
+
declare function createMuiSelectAdapter(options?: MuiAdapterOptions): ComponentType<BuilderSelectProps>;
|
|
77
|
+
declare const MuiSelectAdapter: ComponentType<BuilderSelectProps>;
|
|
78
|
+
|
|
79
|
+
declare function createMuiTextAreaAdapter(options?: MuiAdapterOptions): ComponentType<BuilderTextAreaProps>;
|
|
80
|
+
declare const MuiTextAreaAdapter: ComponentType<BuilderTextAreaProps>;
|
|
81
|
+
|
|
82
|
+
declare function createMuiTextInputAdapter(options?: MuiAdapterOptions): ComponentType<BuilderTextInputProps>;
|
|
83
|
+
declare const MuiTextInputAdapter: ComponentType<BuilderTextInputProps>;
|
|
84
|
+
|
|
85
|
+
interface MuiBuilderOverrides {
|
|
86
|
+
readonly components?: Partial<FormBuilderComponents>;
|
|
87
|
+
readonly slots?: Partial<FormBuilderSlots>;
|
|
88
|
+
}
|
|
89
|
+
declare function createMuiBuilderProps(options?: MuiAdapterOptions, overrides?: MuiBuilderOverrides): Pick<FormBuilderProps, "components" | "disableDefaultStyles" | "slots">;
|
|
3
90
|
|
|
4
|
-
declare function muiDefaultIconResolver(actionType: BuilderActionIconType): ReactNode;
|
|
5
91
|
declare const muiBuilderComponents: FormBuilderComponents;
|
|
6
92
|
declare function createMuiBuilderComponents(customOverrides?: Partial<FormBuilderComponents>): FormBuilderComponents;
|
|
93
|
+
declare function createMuiBuilderComponents(options?: MuiAdapterOptions, customOverrides?: Partial<FormBuilderComponents>): FormBuilderComponents;
|
|
94
|
+
|
|
95
|
+
declare function muiDefaultIconResolver(actionType: BuilderActionIconType): ReactNode;
|
|
96
|
+
|
|
97
|
+
interface MuiFormBuilderProps extends Omit<FormBuilderProps, "components" | "disableDefaultStyles" | "slots" | "unstyled"> {
|
|
98
|
+
readonly muiOptions?: MuiAdapterOptions;
|
|
99
|
+
readonly layoutOptions?: MuiLayoutOptions;
|
|
100
|
+
readonly localizationOptions?: MuiLocalizationOptions;
|
|
101
|
+
readonly muiSlotProps?: MuiBuilderSlotProps;
|
|
102
|
+
readonly components?: Partial<FormBuilderComponents>;
|
|
103
|
+
readonly slots?: Partial<FormBuilderSlots>;
|
|
104
|
+
}
|
|
105
|
+
declare function MuiFormBuilder({ muiOptions, layoutOptions, localizationOptions, muiSlotProps, components: customComponents, slots: customSlots, ...props }: MuiFormBuilderProps): react.JSX.Element;
|
|
106
|
+
|
|
107
|
+
declare function createMuiFieldEditorSlot(options?: MuiAdapterOptions): ComponentType<BuilderFieldEditorSlotProps>;
|
|
108
|
+
declare const MuiFieldEditorSlot: NonNullable<FormBuilderSlots["fieldEditor"]>;
|
|
109
|
+
|
|
110
|
+
declare function createMuiLocalizationSlot(options?: MuiAdapterOptions): ComponentType<BuilderLocalizationSlotProps>;
|
|
111
|
+
declare const MuiLocalizationSlot: NonNullable<FormBuilderSlots["localization"]>;
|
|
112
|
+
|
|
113
|
+
declare function createMuiOptionEditorSlot(options?: MuiAdapterOptions): ComponentType<BuilderOptionEditorSlotProps>;
|
|
114
|
+
declare const MuiOptionEditorSlot: NonNullable<FormBuilderSlots["optionEditor"]>;
|
|
115
|
+
|
|
116
|
+
declare function createMuiToolbarSlot(options?: MuiAdapterOptions): ComponentType<BuilderToolbarSlotProps>;
|
|
117
|
+
declare const MuiToolbarSlot: NonNullable<FormBuilderSlots["toolbar"]>;
|
|
118
|
+
|
|
119
|
+
declare const muiBuilderSlots: FormBuilderSlots;
|
|
120
|
+
declare function createMuiBuilderSlots(options?: MuiAdapterOptions, customOverrides?: Partial<FormBuilderSlots>): FormBuilderSlots;
|
|
7
121
|
|
|
8
|
-
export { createMuiBuilderComponents, muiBuilderComponents, muiDefaultIconResolver };
|
|
122
|
+
export { type BuilderSectionName, DEFAULT_MUI_SECTION_ORDER, type MuiAdapterOptions, type MuiBuilderOverrides, type MuiBuilderSlotProps, MuiButtonAdapter, type MuiButtonVariant, MuiCheckboxAdapter, MuiErrorMessageAdapter, MuiFieldEditorSlot, MuiFieldsetAdapter, MuiFormBuilder, type MuiFormBuilderProps, MuiIconButtonAdapter, type MuiLayoutOptions, type MuiLocalizationOptions, MuiLocalizationSlot, MuiOptionEditorSlot, MuiSectionAdapter, MuiSelectAdapter, MuiTextAreaAdapter, MuiTextInputAdapter, MuiToolbarSlot, type ResolvedMuiAdapterOptions, createMuiBuilderComponents, createMuiBuilderProps, createMuiBuilderSlots, createMuiButtonAdapter, createMuiCheckboxAdapter, createMuiErrorMessageAdapter, createMuiFieldEditorSlot, createMuiFieldsetAdapter, createMuiIconButtonAdapter, createMuiLocalizationSlot, createMuiOptionEditorSlot, createMuiSectionAdapter, createMuiSelectAdapter, createMuiTextAreaAdapter, createMuiTextInputAdapter, createMuiToolbarSlot, muiBuilderComponents, muiBuilderSlots, muiDefaultIconResolver, resolveMuiAdapterOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,122 @@
|
|
|
1
|
-
import { FormBuilderComponents,
|
|
2
|
-
import
|
|
1
|
+
import { BuilderActionIconType, BuilderButtonProps, BuilderCheckboxProps, BuilderErrorMessageProps, BuilderFieldsetProps, BuilderIconButtonProps, BuilderSectionProps, BuilderSelectProps, BuilderTextAreaProps, BuilderTextInputProps, FormBuilderComponents, FormBuilderSlots, FormBuilderProps, BuilderFieldEditorSlotProps, BuilderLocalizationSlotProps, BuilderOptionEditorSlotProps, BuilderToolbarSlotProps } from '@form-engine-ts/react';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ComponentType, ReactNode } from 'react';
|
|
4
|
+
import { CardProps, PaperProps, StackProps, AccordionProps } from '@mui/material';
|
|
5
|
+
|
|
6
|
+
type BuilderSectionName = "basicSettings" | "completionMessage" | "questions" | "addQuestion" | "localization";
|
|
7
|
+
type MuiButtonVariant = "contained" | "outlined" | "text";
|
|
8
|
+
interface MuiLayoutOptions {
|
|
9
|
+
readonly sectionOrder?: readonly BuilderSectionName[];
|
|
10
|
+
}
|
|
11
|
+
interface MuiLocalizationOptions {
|
|
12
|
+
readonly collapsible?: boolean;
|
|
13
|
+
readonly defaultExpanded?: boolean | "when-configured";
|
|
14
|
+
}
|
|
15
|
+
interface MuiBuilderSlotProps {
|
|
16
|
+
readonly card?: Partial<CardProps>;
|
|
17
|
+
readonly paper?: Partial<PaperProps>;
|
|
18
|
+
readonly stack?: Partial<StackProps>;
|
|
19
|
+
readonly accordion?: Partial<AccordionProps>;
|
|
20
|
+
}
|
|
21
|
+
interface MuiAdapterOptions {
|
|
22
|
+
readonly size?: "small" | "medium";
|
|
23
|
+
readonly variant?: "outlined" | "filled" | "standard";
|
|
24
|
+
readonly buttonVariant?: "contained" | "outlined" | "text";
|
|
25
|
+
readonly buttonVariants?: {
|
|
26
|
+
readonly primary?: MuiButtonVariant;
|
|
27
|
+
readonly secondary?: MuiButtonVariant;
|
|
28
|
+
readonly danger?: MuiButtonVariant;
|
|
29
|
+
};
|
|
30
|
+
readonly fullWidth?: boolean;
|
|
31
|
+
readonly dense?: boolean;
|
|
32
|
+
readonly getLocaleLabel?: (locale: string) => string;
|
|
33
|
+
readonly getActionLabel?: (actionType: BuilderActionIconType) => string;
|
|
34
|
+
readonly layoutOptions?: MuiLayoutOptions;
|
|
35
|
+
readonly localizationOptions?: MuiLocalizationOptions;
|
|
36
|
+
readonly muiSlotProps?: MuiBuilderSlotProps;
|
|
37
|
+
}
|
|
38
|
+
interface ResolvedMuiAdapterOptions {
|
|
39
|
+
readonly size: "small" | "medium";
|
|
40
|
+
readonly variant: "outlined" | "filled" | "standard";
|
|
41
|
+
readonly buttonVariant: "contained" | "outlined" | "text";
|
|
42
|
+
readonly buttonVariants?: {
|
|
43
|
+
readonly primary: MuiButtonVariant;
|
|
44
|
+
readonly secondary: MuiButtonVariant;
|
|
45
|
+
readonly danger: MuiButtonVariant;
|
|
46
|
+
};
|
|
47
|
+
readonly fullWidth: boolean;
|
|
48
|
+
readonly dense: boolean;
|
|
49
|
+
readonly getLocaleLabel?: (locale: string) => string;
|
|
50
|
+
readonly getActionLabel?: (actionType: BuilderActionIconType) => string;
|
|
51
|
+
readonly layoutOptions?: MuiLayoutOptions;
|
|
52
|
+
readonly localizationOptions?: MuiLocalizationOptions;
|
|
53
|
+
readonly muiSlotProps?: MuiBuilderSlotProps;
|
|
54
|
+
}
|
|
55
|
+
declare const DEFAULT_MUI_SECTION_ORDER: readonly BuilderSectionName[];
|
|
56
|
+
declare function resolveMuiAdapterOptions(options?: MuiAdapterOptions): ResolvedMuiAdapterOptions;
|
|
57
|
+
|
|
58
|
+
declare function createMuiButtonAdapter(options?: MuiAdapterOptions): ComponentType<BuilderButtonProps>;
|
|
59
|
+
declare const MuiButtonAdapter: ComponentType<BuilderButtonProps>;
|
|
60
|
+
|
|
61
|
+
declare function createMuiCheckboxAdapter(options?: MuiAdapterOptions): ComponentType<BuilderCheckboxProps>;
|
|
62
|
+
declare const MuiCheckboxAdapter: ComponentType<BuilderCheckboxProps>;
|
|
63
|
+
|
|
64
|
+
declare function createMuiErrorMessageAdapter(_options?: MuiAdapterOptions): ComponentType<BuilderErrorMessageProps>;
|
|
65
|
+
declare const MuiErrorMessageAdapter: ComponentType<BuilderErrorMessageProps>;
|
|
66
|
+
|
|
67
|
+
declare function createMuiFieldsetAdapter(options?: MuiAdapterOptions): ComponentType<BuilderFieldsetProps>;
|
|
68
|
+
declare const MuiFieldsetAdapter: ComponentType<BuilderFieldsetProps>;
|
|
69
|
+
|
|
70
|
+
declare function createMuiIconButtonAdapter(options?: MuiAdapterOptions): ComponentType<BuilderIconButtonProps>;
|
|
71
|
+
declare const MuiIconButtonAdapter: ComponentType<BuilderIconButtonProps>;
|
|
72
|
+
|
|
73
|
+
declare function createMuiSectionAdapter(options?: MuiAdapterOptions): ComponentType<BuilderSectionProps>;
|
|
74
|
+
declare const MuiSectionAdapter: ComponentType<BuilderSectionProps>;
|
|
75
|
+
|
|
76
|
+
declare function createMuiSelectAdapter(options?: MuiAdapterOptions): ComponentType<BuilderSelectProps>;
|
|
77
|
+
declare const MuiSelectAdapter: ComponentType<BuilderSelectProps>;
|
|
78
|
+
|
|
79
|
+
declare function createMuiTextAreaAdapter(options?: MuiAdapterOptions): ComponentType<BuilderTextAreaProps>;
|
|
80
|
+
declare const MuiTextAreaAdapter: ComponentType<BuilderTextAreaProps>;
|
|
81
|
+
|
|
82
|
+
declare function createMuiTextInputAdapter(options?: MuiAdapterOptions): ComponentType<BuilderTextInputProps>;
|
|
83
|
+
declare const MuiTextInputAdapter: ComponentType<BuilderTextInputProps>;
|
|
84
|
+
|
|
85
|
+
interface MuiBuilderOverrides {
|
|
86
|
+
readonly components?: Partial<FormBuilderComponents>;
|
|
87
|
+
readonly slots?: Partial<FormBuilderSlots>;
|
|
88
|
+
}
|
|
89
|
+
declare function createMuiBuilderProps(options?: MuiAdapterOptions, overrides?: MuiBuilderOverrides): Pick<FormBuilderProps, "components" | "disableDefaultStyles" | "slots">;
|
|
3
90
|
|
|
4
|
-
declare function muiDefaultIconResolver(actionType: BuilderActionIconType): ReactNode;
|
|
5
91
|
declare const muiBuilderComponents: FormBuilderComponents;
|
|
6
92
|
declare function createMuiBuilderComponents(customOverrides?: Partial<FormBuilderComponents>): FormBuilderComponents;
|
|
93
|
+
declare function createMuiBuilderComponents(options?: MuiAdapterOptions, customOverrides?: Partial<FormBuilderComponents>): FormBuilderComponents;
|
|
94
|
+
|
|
95
|
+
declare function muiDefaultIconResolver(actionType: BuilderActionIconType): ReactNode;
|
|
96
|
+
|
|
97
|
+
interface MuiFormBuilderProps extends Omit<FormBuilderProps, "components" | "disableDefaultStyles" | "slots" | "unstyled"> {
|
|
98
|
+
readonly muiOptions?: MuiAdapterOptions;
|
|
99
|
+
readonly layoutOptions?: MuiLayoutOptions;
|
|
100
|
+
readonly localizationOptions?: MuiLocalizationOptions;
|
|
101
|
+
readonly muiSlotProps?: MuiBuilderSlotProps;
|
|
102
|
+
readonly components?: Partial<FormBuilderComponents>;
|
|
103
|
+
readonly slots?: Partial<FormBuilderSlots>;
|
|
104
|
+
}
|
|
105
|
+
declare function MuiFormBuilder({ muiOptions, layoutOptions, localizationOptions, muiSlotProps, components: customComponents, slots: customSlots, ...props }: MuiFormBuilderProps): react.JSX.Element;
|
|
106
|
+
|
|
107
|
+
declare function createMuiFieldEditorSlot(options?: MuiAdapterOptions): ComponentType<BuilderFieldEditorSlotProps>;
|
|
108
|
+
declare const MuiFieldEditorSlot: NonNullable<FormBuilderSlots["fieldEditor"]>;
|
|
109
|
+
|
|
110
|
+
declare function createMuiLocalizationSlot(options?: MuiAdapterOptions): ComponentType<BuilderLocalizationSlotProps>;
|
|
111
|
+
declare const MuiLocalizationSlot: NonNullable<FormBuilderSlots["localization"]>;
|
|
112
|
+
|
|
113
|
+
declare function createMuiOptionEditorSlot(options?: MuiAdapterOptions): ComponentType<BuilderOptionEditorSlotProps>;
|
|
114
|
+
declare const MuiOptionEditorSlot: NonNullable<FormBuilderSlots["optionEditor"]>;
|
|
115
|
+
|
|
116
|
+
declare function createMuiToolbarSlot(options?: MuiAdapterOptions): ComponentType<BuilderToolbarSlotProps>;
|
|
117
|
+
declare const MuiToolbarSlot: NonNullable<FormBuilderSlots["toolbar"]>;
|
|
118
|
+
|
|
119
|
+
declare const muiBuilderSlots: FormBuilderSlots;
|
|
120
|
+
declare function createMuiBuilderSlots(options?: MuiAdapterOptions, customOverrides?: Partial<FormBuilderSlots>): FormBuilderSlots;
|
|
7
121
|
|
|
8
|
-
export { createMuiBuilderComponents, muiBuilderComponents, muiDefaultIconResolver };
|
|
122
|
+
export { type BuilderSectionName, DEFAULT_MUI_SECTION_ORDER, type MuiAdapterOptions, type MuiBuilderOverrides, type MuiBuilderSlotProps, MuiButtonAdapter, type MuiButtonVariant, MuiCheckboxAdapter, MuiErrorMessageAdapter, MuiFieldEditorSlot, MuiFieldsetAdapter, MuiFormBuilder, type MuiFormBuilderProps, MuiIconButtonAdapter, type MuiLayoutOptions, type MuiLocalizationOptions, MuiLocalizationSlot, MuiOptionEditorSlot, MuiSectionAdapter, MuiSelectAdapter, MuiTextAreaAdapter, MuiTextInputAdapter, MuiToolbarSlot, type ResolvedMuiAdapterOptions, createMuiBuilderComponents, createMuiBuilderProps, createMuiBuilderSlots, createMuiButtonAdapter, createMuiCheckboxAdapter, createMuiErrorMessageAdapter, createMuiFieldEditorSlot, createMuiFieldsetAdapter, createMuiIconButtonAdapter, createMuiLocalizationSlot, createMuiOptionEditorSlot, createMuiSectionAdapter, createMuiSelectAdapter, createMuiTextAreaAdapter, createMuiTextInputAdapter, createMuiToolbarSlot, muiBuilderComponents, muiBuilderSlots, muiDefaultIconResolver, resolveMuiAdapterOptions };
|