dynamic-mui 1.1.5 → 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 +57 -22
- package/dist/components/DynamicComponent.d.ts +12 -0
- package/dist/components/FormGenerator.d.ts +37 -0
- package/dist/components/charts/Bar/bar.d.ts +2 -0
- package/dist/components/charts/Line/line.d.ts +2 -0
- package/dist/components/charts/Mixchart/mixChart.d.ts +2 -0
- package/dist/components/charts/Pie/pie.d.ts +2 -0
- package/dist/components/controls/Accordion/accordion.d.ts +2 -0
- package/dist/components/controls/Autocomplete/autocomplete.d.ts +2 -0
- package/dist/components/controls/CheckBox/checkbox.d.ts +3 -0
- package/dist/components/controls/Chip/chip.d.ts +2 -0
- package/dist/components/controls/DataTable/datatable.d.ts +2 -0
- package/dist/components/controls/DateTime/datetime.d.ts +2 -0
- package/dist/components/controls/DateTimePicker/datetimepicker.d.ts +2 -0
- package/dist/components/controls/Divider/divider.d.ts +2 -0
- package/dist/components/controls/Group/group.d.ts +2 -0
- package/dist/components/controls/Hyperlink/hyperlink.d.ts +2 -0
- package/dist/components/controls/ImageList/imagelist.d.ts +2 -0
- package/dist/components/controls/List/list.d.ts +2 -0
- package/dist/components/controls/MultiTextbox/multitextbox.d.ts +2 -0
- package/dist/components/controls/NumberField/numberfield.d.ts +2 -0
- package/dist/components/controls/Radio/radio.d.ts +3 -0
- package/dist/components/controls/Select/select.d.ts +2 -0
- package/dist/components/controls/Signature/signature.d.ts +2 -0
- package/dist/components/controls/Stepper/stepper.d.ts +8 -0
- package/dist/components/controls/Switch/switch.d.ts +3 -0
- package/dist/components/controls/Tabs/tabs.d.ts +2 -0
- package/dist/components/controls/TextField/textfield.d.ts +2 -0
- package/dist/components/controls/TimePicker/timepicker.d.ts +2 -0
- package/dist/components/controls/Typography/typography.d.ts +3 -0
- package/dist/components/controls/index.d.ts +57 -0
- package/dist/config/mui.d.ts +8 -0
- package/dist/dynamic-mui.cjs.js +1 -0
- package/dist/dynamic-mui.es.js +9 -0
- 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/index.d.ts +5 -0
- package/dist/loadCognitoIdentity-BwoR11En.js +1 -0
- package/dist/loadCognitoIdentity-Cqci1Eff.mjs +935 -0
- package/dist/main.d.ts +1 -0
- package/dist/playground/Builder.d.ts +1 -0
- package/dist/playground/Canvas.d.ts +9 -0
- package/dist/playground/PropertiesEditor.d.ts +10 -0
- package/dist/playground/Sidebar.d.ts +1 -0
- package/dist/playground/documentation.d.ts +6 -0
- package/dist/playground/templates.d.ts +7 -0
- package/dist/playground/testData.d.ts +2 -0
- package/dist/test/setup.d.ts +0 -0
- package/dist/theme/theme.d.ts +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/util/helper.d.ts +64 -0
- package/dist/util/s3Upload.d.ts +13 -0
- package/dist/util/stepperComponents.d.ts +6 -0
- package/dist/util/useIsFirstRender.d.ts +1 -0
- package/dist/util/useUpdateEffect.d.ts +2 -0
- package/dist/util/validation.d.ts +6 -0
- package/package.json +65 -54
- package/build/asset-manifest.json +0 -10
- package/build/favicon.ico +0 -0
- package/build/index.html +0 -1
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +0 -25
- package/build/robots.txt +0 -3
- package/build/static/js/main.11a67c51.js +0 -3
- package/build/static/js/main.11a67c51.js.LICENSE.txt +0 -85
- package/build/static/js/main.11a67c51.js.map +0 -1
- package/craco.config.js +0 -34
- package/dist-modules/components/DynamicComponent.js +0 -22
- package/dist-modules/components/FormGenerator.js +0 -200
- package/dist-modules/components/charts/Bar/bar.js +0 -31
- package/dist-modules/components/charts/Line/line.js +0 -31
- package/dist-modules/components/charts/Mixchart/mixChart.js +0 -59
- package/dist-modules/components/charts/Pie/pie.js +0 -31
- package/dist-modules/components/controls/CheckBox/checkbox.js +0 -56
- package/dist-modules/components/controls/DataTable/datatable.js +0 -28
- package/dist-modules/components/controls/DateTime/datetime.js +0 -53
- package/dist-modules/components/controls/DateTimePicker/datetimepicker.js +0 -53
- package/dist-modules/components/controls/Radio/radio.js +0 -88
- package/dist-modules/components/controls/Select/select.js +0 -173
- package/dist-modules/components/controls/Stepper/stepper.js +0 -192
- package/dist-modules/components/controls/Switch/switch.js +0 -85
- package/dist-modules/components/controls/TextField/textfield.js +0 -148
- package/dist-modules/components/controls/TimePicker/timepicker.js +0 -53
- package/dist-modules/components/controls/Typography/typography.js +0 -43
- package/dist-modules/components/controls/index.js +0 -42
- package/dist-modules/config/mui.js +0 -73
- package/dist-modules/data/checkbox.js +0 -143
- package/dist-modules/data/dataTable.js +0 -90
- package/dist-modules/data/dateTime.js +0 -136
- package/dist-modules/data/radio.js +0 -36
- package/dist-modules/data/select.js +0 -126
- package/dist-modules/data/stepper.js +0 -237
- package/dist-modules/data/switch.js +0 -123
- package/dist-modules/data/textfield.js +0 -240
- package/dist-modules/index.js +0 -16
- package/dist-modules/util/helper.js +0 -226
- package/dist-modules/util/stepperComponents.js +0 -40
- package/dist-modules/util/useIsFirstRender.js +0 -15
- package/dist-modules/util/useUpdateEffect.js +0 -19
- package/dist-modules/util/validation.js +0 -102
- package/docs/asset-manifest.json +0 -9
- package/docs/build/bundle.1eab2706.js +0 -2
- package/docs/build/bundle.1eab2706.js.LICENSE.txt +0 -153
- package/docs/index.html +0 -16
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/styleguide.config.js +0 -108
- package/themes/default.js +0 -114
- package/themes/index.js +0 -29
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,33 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
# dynamic-mui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A powerful, dynamic form builder and generator for React using Material UI.
|
|
4
|
+
|
|
5
|
+
## Features (v2.0.0)
|
|
4
6
|
|
|
5
|
-
|
|
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.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
7
16
|
|
|
8
|
-
|
|
17
|
+
```bash
|
|
18
|
+
npm install @mui/material @emotion/react @emotion/styled
|
|
19
|
+
npm install dynamic-mui --save
|
|
9
20
|
```
|
|
10
|
-
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { FormGenerator } from 'dynamic-mui';
|
|
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
|
+
];
|
|
11
41
|
|
|
12
42
|
export default function DynamicForm() {
|
|
43
|
+
const handleSubmit = (data) => {
|
|
44
|
+
console.log('Form Data:', data);
|
|
45
|
+
};
|
|
46
|
+
|
|
13
47
|
return (
|
|
14
48
|
<FormGenerator
|
|
15
|
-
data={
|
|
16
|
-
|
|
17
|
-
type: 'textfield',
|
|
18
|
-
props: {
|
|
19
|
-
MuiAttributes: { placeholder: 'Standard', fullWidth: true, variant: 'standard' },
|
|
20
|
-
},
|
|
21
|
-
layout: {
|
|
22
|
-
row: 1,
|
|
23
|
-
xs: 4,
|
|
24
|
-
sm: 4,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
]}
|
|
28
|
-
guid="Testing"
|
|
29
|
-
library={MUI}
|
|
49
|
+
data={formSchema}
|
|
50
|
+
onSubmit={handleSubmit}
|
|
30
51
|
/>
|
|
31
52
|
);
|
|
32
|
-
}
|
|
53
|
+
}
|
|
33
54
|
```
|
|
55
|
+
|
|
56
|
+
## Local Development (Playground)
|
|
57
|
+
|
|
58
|
+
To run the local playground and test changes:
|
|
59
|
+
|
|
60
|
+
1. `npm install`
|
|
61
|
+
2. `npm run dev`
|
|
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
|
|
67
|
+
|
|
68
|
+
MIT © [Dinakaran S](https://github.com/DinakaranS)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ControlProps } from '../types';
|
|
2
|
+
interface DynamicComponentProps extends ControlProps {
|
|
3
|
+
map?: string;
|
|
4
|
+
option?: string;
|
|
5
|
+
control?: any;
|
|
6
|
+
currentStep?: number;
|
|
7
|
+
patch?: any;
|
|
8
|
+
onStepUpdate?: any;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export default function DynamicComponent(props: DynamicComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { GridProps } from '@mui/material';
|
|
3
|
+
import { FormField } from '../util/helper';
|
|
4
|
+
export declare const FormData: (id?: string) => any;
|
|
5
|
+
export declare const ClearFormData: (id?: string) => void;
|
|
6
|
+
export interface FormGeneratorProps {
|
|
7
|
+
/** Component unique identifier */
|
|
8
|
+
guid: string;
|
|
9
|
+
/** Component json data */
|
|
10
|
+
data: FormField[];
|
|
11
|
+
/** Json data to assign value */
|
|
12
|
+
patch?: Record<string, any>;
|
|
13
|
+
/** Component Ref */
|
|
14
|
+
formRef?: React.Ref<HTMLButtonElement>;
|
|
15
|
+
/** Component Submit Function */
|
|
16
|
+
onSubmit?: (response: any, errors: any[], data: FormField[], guid: string) => void;
|
|
17
|
+
/** Component On Change Function */
|
|
18
|
+
onChange?: (args: {
|
|
19
|
+
id: string;
|
|
20
|
+
value: any;
|
|
21
|
+
option?: any;
|
|
22
|
+
}) => void;
|
|
23
|
+
/** Component On Step Change Function */
|
|
24
|
+
onStepChange?: (currentStep: number, isScreenChange: boolean, isLastStep: boolean) => void;
|
|
25
|
+
/** Grid Container Attributes */
|
|
26
|
+
MuiGridAttributes?: GridProps;
|
|
27
|
+
/** Stepper Active Step */
|
|
28
|
+
/** Stepper Active Step */
|
|
29
|
+
activeStep?: number;
|
|
30
|
+
/** On Field Click (Internal/Builder) */
|
|
31
|
+
onFieldClick?: (field: FormField) => void;
|
|
32
|
+
/** On Field Double Click (Internal/Builder) */
|
|
33
|
+
onFieldDoubleClick?: (field: FormField) => void;
|
|
34
|
+
/** On Field Context Menu (Internal/Builder) */
|
|
35
|
+
onFieldContextMenu?: (event: React.MouseEvent, field: FormField) => void;
|
|
36
|
+
}
|
|
37
|
+
export declare function FormGenerator({ data, patch, guid, formRef, onSubmit, onChange, onStepChange, MuiGridAttributes, activeStep, onFieldClick, onFieldDoubleClick, onFieldContextMenu, }: FormGeneratorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ControlProps } from '../../../types';
|
|
2
|
+
interface StepperProps extends ControlProps {
|
|
3
|
+
onStepUpdate?: (newStep: number, isScreenChange: boolean, isLastStep: boolean) => void;
|
|
4
|
+
currentStep?: number;
|
|
5
|
+
patch?: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
export default function Stepper({ attributes, onChange, onStepUpdate, currentStep, patch }: StepperProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as Typography } from './Typography/typography';
|
|
2
|
+
import { default as TextField } from './TextField/textfield';
|
|
3
|
+
import { default as Table } from './DataTable/datatable';
|
|
4
|
+
import { default as DateTime } from './DateTime/datetime';
|
|
5
|
+
import { default as DateTimePicker } from './DateTimePicker/datetimepicker';
|
|
6
|
+
import { default as TimePicker } from './TimePicker/timepicker';
|
|
7
|
+
import { default as Select } from './Select/select';
|
|
8
|
+
import { default as CheckBox } from './CheckBox/checkbox';
|
|
9
|
+
import { default as Switch } from './Switch/switch';
|
|
10
|
+
import { default as Radio } from './Radio/radio';
|
|
11
|
+
import { default as Stepper } from './Stepper/stepper';
|
|
12
|
+
import { default as Bar } from '../charts/Bar/bar';
|
|
13
|
+
import { default as Line } from '../charts/Line/line';
|
|
14
|
+
import { default as Pie } from '../charts/Pie/pie';
|
|
15
|
+
import { default as MixChart } from '../charts/Mixchart/mixChart';
|
|
16
|
+
import { default as Divider } from './Divider/divider';
|
|
17
|
+
import { default as Chip } from './Chip/chip';
|
|
18
|
+
import { default as List } from './List/list';
|
|
19
|
+
import { default as NumberField } from './NumberField/numberfield';
|
|
20
|
+
import { default as MultiTextbox } from './MultiTextbox/multitextbox';
|
|
21
|
+
import { default as Signature } from './Signature/signature';
|
|
22
|
+
import { default as Group } from './Group/group';
|
|
23
|
+
import { default as Accordion } from './Accordion/accordion';
|
|
24
|
+
import { default as Tabs } from './Tabs/tabs';
|
|
25
|
+
import { default as AutoComplete } from './Autocomplete/autocomplete';
|
|
26
|
+
import { default as ImgList } from './ImageList/imagelist';
|
|
27
|
+
import { default as Hyperlink } from './Hyperlink/hyperlink';
|
|
28
|
+
declare const Controls: {
|
|
29
|
+
Typography: typeof Typography;
|
|
30
|
+
TextField: typeof TextField;
|
|
31
|
+
Table: typeof Table;
|
|
32
|
+
DateTime: typeof DateTime;
|
|
33
|
+
DateTimePicker: typeof DateTimePicker;
|
|
34
|
+
TimePicker: typeof TimePicker;
|
|
35
|
+
Select: typeof Select;
|
|
36
|
+
CheckBox: typeof CheckBox;
|
|
37
|
+
Switch: typeof Switch;
|
|
38
|
+
Radio: typeof Radio;
|
|
39
|
+
Stepper: typeof Stepper;
|
|
40
|
+
Bar: typeof Bar;
|
|
41
|
+
Line: typeof Line;
|
|
42
|
+
Pie: typeof Pie;
|
|
43
|
+
MixChart: typeof MixChart;
|
|
44
|
+
Divider: typeof Divider;
|
|
45
|
+
Chip: typeof Chip;
|
|
46
|
+
List: typeof List;
|
|
47
|
+
NumberField: typeof NumberField;
|
|
48
|
+
MultiTextbox: typeof MultiTextbox;
|
|
49
|
+
Signature: typeof Signature;
|
|
50
|
+
Group: typeof Group;
|
|
51
|
+
Accordion: typeof Accordion;
|
|
52
|
+
Tabs: typeof Tabs;
|
|
53
|
+
AutoComplete: typeof AutoComplete;
|
|
54
|
+
ImgList: typeof ImgList;
|
|
55
|
+
Hyperlink: typeof Hyperlink;
|
|
56
|
+
};
|
|
57
|
+
export default Controls;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-BFycuK80.js");exports.ClearFormData=o.ClearFormData;exports.Controls=o.Controls;exports.DynamicComponent=o.DynamicComponent;exports.FormData=o.FormData;exports.FormGenerator=o.FormGenerator;exports.MuiConfig=o.mui;
|