dynamic-mui 2.0.0 → 2.0.1
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/LICENSE +21 -0
- package/README.md +40 -20
- package/dist/components/DynamicComponent.d.ts +0 -1
- package/dist/components/FormGenerator.d.ts +1 -2
- package/dist/components/charts/Bar/bar.d.ts +0 -1
- package/dist/components/charts/Line/line.d.ts +0 -1
- package/dist/components/charts/Mixchart/mixChart.d.ts +0 -1
- package/dist/components/charts/Pie/pie.d.ts +0 -1
- package/dist/components/controls/Accordion/accordion.d.ts +0 -1
- package/dist/components/controls/Autocomplete/autocomplete.d.ts +1 -2
- package/dist/components/controls/CheckBox/checkbox.d.ts +1 -2
- package/dist/components/controls/Chip/chip.d.ts +0 -1
- package/dist/components/controls/DataTable/datatable.d.ts +0 -1
- package/dist/components/controls/DateTime/datetime.d.ts +1 -2
- package/dist/components/controls/DateTimePicker/datetimepicker.d.ts +1 -2
- package/dist/components/controls/Divider/divider.d.ts +0 -1
- package/dist/components/controls/Group/group.d.ts +0 -1
- package/dist/components/controls/Hyperlink/hyperlink.d.ts +2 -0
- package/dist/components/controls/ImageList/imagelist.d.ts +0 -1
- package/dist/components/controls/List/list.d.ts +0 -1
- package/dist/components/controls/MultiTextbox/multitextbox.d.ts +1 -2
- package/dist/components/controls/NumberField/numberfield.d.ts +1 -2
- package/dist/components/controls/Radio/radio.d.ts +1 -2
- package/dist/components/controls/Select/select.d.ts +1 -2
- package/dist/components/controls/Signature/signature.d.ts +1 -2
- package/dist/components/controls/Stepper/stepper.d.ts +0 -1
- package/dist/components/controls/Switch/switch.d.ts +1 -2
- package/dist/components/controls/Tabs/tabs.d.ts +0 -1
- package/dist/components/controls/TextField/textfield.d.ts +0 -1
- package/dist/components/controls/TimePicker/timepicker.d.ts +1 -2
- package/dist/components/controls/Typography/typography.d.ts +0 -1
- package/dist/components/controls/index.d.ts +2 -1
- package/dist/dynamic-mui.cjs.js +1 -496
- package/dist/dynamic-mui.es.js +7 -82173
- package/dist/index-BFycuK80.js +465 -0
- package/dist/index-CJMUh0I6.js +1 -0
- package/dist/index-DvtivzW0.mjs +101901 -0
- package/dist/index-ipsOTYQY.mjs +153 -0
- package/dist/loadCognitoIdentity-BwoR11En.js +1 -0
- package/dist/loadCognitoIdentity-Cqci1Eff.mjs +935 -0
- package/dist/playground/Canvas.d.ts +0 -1
- package/dist/playground/PropertiesEditor.d.ts +0 -1
- package/dist/playground/templates.d.ts +0 -1
- package/dist/playground/testData.d.ts +0 -1
- package/dist/test/setup.d.ts +0 -1
- package/dist/util/helper.d.ts +4 -1
- package/dist/util/s3Upload.d.ts +13 -0
- package/dist/util/useUpdateEffect.d.ts +0 -1
- package/package.json +33 -36
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dinakaran S
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,36 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
# dynamic-mui
|
|
2
|
+
|
|
3
|
+
A powerful, dynamic form builder and generator for React using Material UI.
|
|
4
|
+
|
|
5
|
+
## Features (v2.0.0)
|
|
6
|
+
|
|
7
|
+
- **Dynamic Form Generation**: Render complex forms from JSON schema.
|
|
8
|
+
- **Visual Form Builder**: Drag-and-drop interface to build forms visually.
|
|
9
|
+
- **New Documentation Mode**: Integrated documentation sidebar with component details.
|
|
10
|
+
- **Advanced Validation**: Mandatory field validation with visual indicators (`*` and red error states).
|
|
11
|
+
- **Rich Component Library**: Includes TextField, Select, Date/Time Pickers, Checkbox, Radio, Switch, Signature, and more.
|
|
12
|
+
- **JSON Editing**: Edit form schema directly or use the visual builder.
|
|
13
|
+
- **Data Preview**: View current form data in real-time.
|
|
2
14
|
|
|
3
15
|
## Installation
|
|
4
16
|
|
|
5
|
-
|
|
6
|
-
|
|
17
|
+
```bash
|
|
18
|
+
npm install @mui/material @emotion/react @emotion/styled
|
|
19
|
+
npm install dynamic-mui --save
|
|
20
|
+
```
|
|
7
21
|
|
|
8
22
|
## Usage
|
|
9
23
|
|
|
10
24
|
```tsx
|
|
11
25
|
import { FormGenerator } from 'dynamic-mui';
|
|
12
26
|
|
|
27
|
+
const formSchema = [
|
|
28
|
+
{
|
|
29
|
+
type: 'textfield',
|
|
30
|
+
props: {
|
|
31
|
+
id: 'name',
|
|
32
|
+
label: 'Full Name',
|
|
33
|
+
MuiAttributes: { fullWidth: true, variant: 'outlined' },
|
|
34
|
+
rules: {
|
|
35
|
+
validation: [{ rule: 'mandatory', message: 'Name is required' }]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
layout: { row: 1, xs: 12, md: 6 }
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
|
|
13
42
|
export default function DynamicForm() {
|
|
14
43
|
const handleSubmit = (data) => {
|
|
15
|
-
console.log(data);
|
|
44
|
+
console.log('Form Data:', data);
|
|
16
45
|
};
|
|
17
46
|
|
|
18
47
|
return (
|
|
19
48
|
<FormGenerator
|
|
20
|
-
data={
|
|
21
|
-
{
|
|
22
|
-
type: 'textfield',
|
|
23
|
-
props: {
|
|
24
|
-
MuiAttributes: { placeholder: 'Standard', fullWidth: true, variant: 'standard' },
|
|
25
|
-
},
|
|
26
|
-
layout: {
|
|
27
|
-
row: 1,
|
|
28
|
-
xs: 4,
|
|
29
|
-
sm: 4,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
]}
|
|
33
|
-
guid="Testing"
|
|
49
|
+
data={formSchema}
|
|
34
50
|
onSubmit={handleSubmit}
|
|
35
51
|
/>
|
|
36
52
|
);
|
|
@@ -43,6 +59,10 @@ To run the local playground and test changes:
|
|
|
43
59
|
|
|
44
60
|
1. `npm install`
|
|
45
61
|
2. `npm run dev`
|
|
46
|
-
3. Open `http://localhost:5173` (or the port shown in terminal)
|
|
62
|
+
3. Open `http://localhost:5173` (or the port shown in terminal).
|
|
63
|
+
|
|
64
|
+
The playground allows you to build forms visually, view the generated JSON, and test validation.
|
|
65
|
+
|
|
66
|
+
## License
|
|
47
67
|
|
|
48
|
-
|
|
68
|
+
MIT © [Dinakaran S](https://github.com/DinakaranS)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { GridProps } from '@mui/material';
|
|
3
3
|
import { FormField } from '../util/helper';
|
|
4
|
-
|
|
5
4
|
export declare const FormData: (id?: string) => any;
|
|
6
5
|
export declare const ClearFormData: (id?: string) => void;
|
|
7
6
|
export interface FormGeneratorProps {
|
|
@@ -12,7 +11,7 @@ export interface FormGeneratorProps {
|
|
|
12
11
|
/** Json data to assign value */
|
|
13
12
|
patch?: Record<string, any>;
|
|
14
13
|
/** Component Ref */
|
|
15
|
-
formRef?: React.
|
|
14
|
+
formRef?: React.Ref<HTMLButtonElement>;
|
|
16
15
|
/** Component Submit Function */
|
|
17
16
|
onSubmit?: (response: any, errors: any[], data: FormField[], guid: string) => void;
|
|
18
17
|
/** Component On Change Function */
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
|
-
export default function AutoComplete({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function AutoComplete({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
2
|
/** Playground Component */
|
|
4
|
-
export default function CheckBox({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default function CheckBox({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
|
-
export default function DateTime({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function DateTime({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
|
-
export default function DateTimePicker({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function DateTimePicker({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
|
-
export default function MultiTextbox({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MultiTextbox({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
|
-
export default function NumberField({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function NumberField({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
2
|
/** Radio Component */
|
|
4
|
-
export default function Radio({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default function Radio({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
|
-
export default function Select({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Select({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
|
-
export default function Signature({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Signature({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
2
|
/** Switch Component */
|
|
4
|
-
export default function Switch({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default function Switch({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
|
|
3
|
-
export default function TimePicker({ attributes, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function TimePicker({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,7 +24,7 @@ import { default as Accordion } from './Accordion/accordion';
|
|
|
24
24
|
import { default as Tabs } from './Tabs/tabs';
|
|
25
25
|
import { default as AutoComplete } from './Autocomplete/autocomplete';
|
|
26
26
|
import { default as ImgList } from './ImageList/imagelist';
|
|
27
|
-
|
|
27
|
+
import { default as Hyperlink } from './Hyperlink/hyperlink';
|
|
28
28
|
declare const Controls: {
|
|
29
29
|
Typography: typeof Typography;
|
|
30
30
|
TextField: typeof TextField;
|
|
@@ -52,5 +52,6 @@ declare const Controls: {
|
|
|
52
52
|
Tabs: typeof Tabs;
|
|
53
53
|
AutoComplete: typeof AutoComplete;
|
|
54
54
|
ImgList: typeof ImgList;
|
|
55
|
+
Hyperlink: typeof Hyperlink;
|
|
55
56
|
};
|
|
56
57
|
export default Controls;
|