dynamic-mui 2.0.0 → 2.0.2

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.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -20
  3. package/dist/components/DynamicComponent.d.ts +0 -1
  4. package/dist/components/FormGenerator.d.ts +1 -2
  5. package/dist/components/charts/Bar/bar.d.ts +0 -1
  6. package/dist/components/charts/Line/line.d.ts +0 -1
  7. package/dist/components/charts/Mixchart/mixChart.d.ts +0 -1
  8. package/dist/components/charts/Pie/pie.d.ts +0 -1
  9. package/dist/components/controls/Accordion/accordion.d.ts +0 -1
  10. package/dist/components/controls/Autocomplete/autocomplete.d.ts +1 -2
  11. package/dist/components/controls/CheckBox/checkbox.d.ts +1 -2
  12. package/dist/components/controls/Chip/chip.d.ts +0 -1
  13. package/dist/components/controls/DataTable/datatable.d.ts +0 -1
  14. package/dist/components/controls/DateTime/datetime.d.ts +1 -2
  15. package/dist/components/controls/DateTimePicker/datetimepicker.d.ts +1 -2
  16. package/dist/components/controls/Divider/divider.d.ts +0 -1
  17. package/dist/components/controls/Group/group.d.ts +0 -1
  18. package/dist/components/controls/Hyperlink/hyperlink.d.ts +2 -0
  19. package/dist/components/controls/ImageList/imagelist.d.ts +0 -1
  20. package/dist/components/controls/List/list.d.ts +0 -1
  21. package/dist/components/controls/MultiTextbox/multitextbox.d.ts +1 -2
  22. package/dist/components/controls/NumberField/numberfield.d.ts +1 -2
  23. package/dist/components/controls/Radio/radio.d.ts +1 -2
  24. package/dist/components/controls/Select/select.d.ts +1 -2
  25. package/dist/components/controls/Signature/signature.d.ts +1 -2
  26. package/dist/components/controls/Stepper/stepper.d.ts +0 -1
  27. package/dist/components/controls/Switch/switch.d.ts +1 -2
  28. package/dist/components/controls/Tabs/tabs.d.ts +0 -1
  29. package/dist/components/controls/TextField/textfield.d.ts +0 -1
  30. package/dist/components/controls/TimePicker/timepicker.d.ts +1 -2
  31. package/dist/components/controls/Typography/typography.d.ts +0 -1
  32. package/dist/components/controls/index.d.ts +2 -1
  33. package/dist/dynamic-mui.cjs.js +1 -496
  34. package/dist/dynamic-mui.es.js +7 -82173
  35. package/dist/index-B0FG-JGp.js +465 -0
  36. package/dist/index-BBxdfRTC.js +1 -0
  37. package/dist/index-BVwk54iw.mjs +101923 -0
  38. package/dist/index-Cz6j-hVM.mjs +153 -0
  39. package/dist/loadCognitoIdentity-CjHrMl-Z.mjs +935 -0
  40. package/dist/loadCognitoIdentity-CpHBN3et.js +1 -0
  41. package/dist/playground/Canvas.d.ts +0 -1
  42. package/dist/playground/PropertiesEditor.d.ts +0 -1
  43. package/dist/playground/templates.d.ts +0 -1
  44. package/dist/playground/testData.d.ts +0 -1
  45. package/dist/test/setup.d.ts +0 -1
  46. package/dist/util/helper.d.ts +4 -1
  47. package/dist/util/s3Upload.d.ts +14 -0
  48. package/dist/util/useUpdateEffect.d.ts +0 -1
  49. 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
- Build dynamic forms using Material UI
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
- `npm install @mui/material @emotion/react @emotion/styled`
6
- `npm install dynamic-mui --save`
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) in your browser.
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
- The playground entry point is located at `src/main.tsx`.
68
+ MIT © [Dinakaran S](https://github.com/DinakaranS)
@@ -1,5 +1,4 @@
1
1
  import { ControlProps } from '../types';
2
-
3
2
  interface DynamicComponentProps extends ControlProps {
4
3
  map?: string;
5
4
  option?: string;
@@ -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.RefObject<HTMLButtonElement>;
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
2
  export default function Bar({ attributes }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  export default function Line({ attributes }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  export default function MixChart({ attributes }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  export default function Pie({ attributes }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  export default function Accordion({ attributes, patch, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -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
2
  export default function Chip({ attributes }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  export default function DataTable({ attributes }: 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
2
  export default function Divider({ attributes }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  export default function Group({ attributes, patch, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ControlProps } from '../../../types';
2
+ export default function Hyperlink({ attributes, rules }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  export default function ImgList({ attributes }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  export default function List({ attributes }: 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,5 +1,4 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  interface StepperProps extends ControlProps {
4
3
  onStepUpdate?: (newStep: number, isScreenChange: boolean, isLastStep: boolean) => void;
5
4
  currentStep?: number;
@@ -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
2
  export default function Tabs({ attributes, patch, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  export default function TextField({ 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;
@@ -1,4 +1,3 @@
1
1
  import { ControlProps } from '../../../types';
2
-
3
2
  /** Typography Component */
4
3
  export default function Typography({ attributes }: 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;