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.
Files changed (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -22
  3. package/dist/components/DynamicComponent.d.ts +12 -0
  4. package/dist/components/FormGenerator.d.ts +37 -0
  5. package/dist/components/charts/Bar/bar.d.ts +2 -0
  6. package/dist/components/charts/Line/line.d.ts +2 -0
  7. package/dist/components/charts/Mixchart/mixChart.d.ts +2 -0
  8. package/dist/components/charts/Pie/pie.d.ts +2 -0
  9. package/dist/components/controls/Accordion/accordion.d.ts +2 -0
  10. package/dist/components/controls/Autocomplete/autocomplete.d.ts +2 -0
  11. package/dist/components/controls/CheckBox/checkbox.d.ts +3 -0
  12. package/dist/components/controls/Chip/chip.d.ts +2 -0
  13. package/dist/components/controls/DataTable/datatable.d.ts +2 -0
  14. package/dist/components/controls/DateTime/datetime.d.ts +2 -0
  15. package/dist/components/controls/DateTimePicker/datetimepicker.d.ts +2 -0
  16. package/dist/components/controls/Divider/divider.d.ts +2 -0
  17. package/dist/components/controls/Group/group.d.ts +2 -0
  18. package/dist/components/controls/Hyperlink/hyperlink.d.ts +2 -0
  19. package/dist/components/controls/ImageList/imagelist.d.ts +2 -0
  20. package/dist/components/controls/List/list.d.ts +2 -0
  21. package/dist/components/controls/MultiTextbox/multitextbox.d.ts +2 -0
  22. package/dist/components/controls/NumberField/numberfield.d.ts +2 -0
  23. package/dist/components/controls/Radio/radio.d.ts +3 -0
  24. package/dist/components/controls/Select/select.d.ts +2 -0
  25. package/dist/components/controls/Signature/signature.d.ts +2 -0
  26. package/dist/components/controls/Stepper/stepper.d.ts +8 -0
  27. package/dist/components/controls/Switch/switch.d.ts +3 -0
  28. package/dist/components/controls/Tabs/tabs.d.ts +2 -0
  29. package/dist/components/controls/TextField/textfield.d.ts +2 -0
  30. package/dist/components/controls/TimePicker/timepicker.d.ts +2 -0
  31. package/dist/components/controls/Typography/typography.d.ts +3 -0
  32. package/dist/components/controls/index.d.ts +57 -0
  33. package/dist/config/mui.d.ts +8 -0
  34. package/dist/dynamic-mui.cjs.js +1 -0
  35. package/dist/dynamic-mui.es.js +9 -0
  36. package/dist/index-BFycuK80.js +465 -0
  37. package/dist/index-CJMUh0I6.js +1 -0
  38. package/dist/index-DvtivzW0.mjs +101901 -0
  39. package/dist/index-ipsOTYQY.mjs +153 -0
  40. package/dist/index.d.ts +5 -0
  41. package/dist/loadCognitoIdentity-BwoR11En.js +1 -0
  42. package/dist/loadCognitoIdentity-Cqci1Eff.mjs +935 -0
  43. package/dist/main.d.ts +1 -0
  44. package/dist/playground/Builder.d.ts +1 -0
  45. package/dist/playground/Canvas.d.ts +9 -0
  46. package/dist/playground/PropertiesEditor.d.ts +10 -0
  47. package/dist/playground/Sidebar.d.ts +1 -0
  48. package/dist/playground/documentation.d.ts +6 -0
  49. package/dist/playground/templates.d.ts +7 -0
  50. package/dist/playground/testData.d.ts +2 -0
  51. package/dist/test/setup.d.ts +0 -0
  52. package/dist/theme/theme.d.ts +1 -0
  53. package/dist/types.d.ts +19 -0
  54. package/dist/util/helper.d.ts +64 -0
  55. package/dist/util/s3Upload.d.ts +13 -0
  56. package/dist/util/stepperComponents.d.ts +6 -0
  57. package/dist/util/useIsFirstRender.d.ts +1 -0
  58. package/dist/util/useUpdateEffect.d.ts +2 -0
  59. package/dist/util/validation.d.ts +6 -0
  60. package/package.json +65 -54
  61. package/build/asset-manifest.json +0 -10
  62. package/build/favicon.ico +0 -0
  63. package/build/index.html +0 -1
  64. package/build/logo192.png +0 -0
  65. package/build/logo512.png +0 -0
  66. package/build/manifest.json +0 -25
  67. package/build/robots.txt +0 -3
  68. package/build/static/js/main.11a67c51.js +0 -3
  69. package/build/static/js/main.11a67c51.js.LICENSE.txt +0 -85
  70. package/build/static/js/main.11a67c51.js.map +0 -1
  71. package/craco.config.js +0 -34
  72. package/dist-modules/components/DynamicComponent.js +0 -22
  73. package/dist-modules/components/FormGenerator.js +0 -200
  74. package/dist-modules/components/charts/Bar/bar.js +0 -31
  75. package/dist-modules/components/charts/Line/line.js +0 -31
  76. package/dist-modules/components/charts/Mixchart/mixChart.js +0 -59
  77. package/dist-modules/components/charts/Pie/pie.js +0 -31
  78. package/dist-modules/components/controls/CheckBox/checkbox.js +0 -56
  79. package/dist-modules/components/controls/DataTable/datatable.js +0 -28
  80. package/dist-modules/components/controls/DateTime/datetime.js +0 -53
  81. package/dist-modules/components/controls/DateTimePicker/datetimepicker.js +0 -53
  82. package/dist-modules/components/controls/Radio/radio.js +0 -88
  83. package/dist-modules/components/controls/Select/select.js +0 -173
  84. package/dist-modules/components/controls/Stepper/stepper.js +0 -192
  85. package/dist-modules/components/controls/Switch/switch.js +0 -85
  86. package/dist-modules/components/controls/TextField/textfield.js +0 -148
  87. package/dist-modules/components/controls/TimePicker/timepicker.js +0 -53
  88. package/dist-modules/components/controls/Typography/typography.js +0 -43
  89. package/dist-modules/components/controls/index.js +0 -42
  90. package/dist-modules/config/mui.js +0 -73
  91. package/dist-modules/data/checkbox.js +0 -143
  92. package/dist-modules/data/dataTable.js +0 -90
  93. package/dist-modules/data/dateTime.js +0 -136
  94. package/dist-modules/data/radio.js +0 -36
  95. package/dist-modules/data/select.js +0 -126
  96. package/dist-modules/data/stepper.js +0 -237
  97. package/dist-modules/data/switch.js +0 -123
  98. package/dist-modules/data/textfield.js +0 -240
  99. package/dist-modules/index.js +0 -16
  100. package/dist-modules/util/helper.js +0 -226
  101. package/dist-modules/util/stepperComponents.js +0 -40
  102. package/dist-modules/util/useIsFirstRender.js +0 -15
  103. package/dist-modules/util/useUpdateEffect.js +0 -19
  104. package/dist-modules/util/validation.js +0 -102
  105. package/docs/asset-manifest.json +0 -9
  106. package/docs/build/bundle.1eab2706.js +0 -2
  107. package/docs/build/bundle.1eab2706.js.LICENSE.txt +0 -153
  108. package/docs/index.html +0 -16
  109. package/public/favicon.ico +0 -0
  110. package/public/index.html +0 -43
  111. package/public/logo192.png +0 -0
  112. package/public/logo512.png +0 -0
  113. package/public/manifest.json +0 -25
  114. package/public/robots.txt +0 -3
  115. package/styleguide.config.js +0 -108
  116. package/themes/default.js +0 -114
  117. package/themes/index.js +0 -29
package/dist/main.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const Builder: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { FormField } from '../util/helper';
2
+ interface CanvasProps {
3
+ fields: FormField[];
4
+ onSelectField: (id: string) => void;
5
+ selectedId: string | null;
6
+ onDeleteField: (id: string) => void;
7
+ }
8
+ export declare const Canvas: ({ fields, onSelectField, selectedId: _selectedId, onDeleteField: _onDeleteField }: CanvasProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import { FormField } from '../util/helper';
2
+ interface PropertiesEditorProps {
3
+ field: FormField | null;
4
+ onUpdate: (field: FormField) => void;
5
+ onDelete: (id: string) => void;
6
+ allFields?: FormField[];
7
+ onAllFieldsChange?: (fields: FormField[]) => void;
8
+ }
9
+ export declare const PropertiesEditor: ({ field, onUpdate, onDelete, allFields, onAllFieldsChange }: PropertiesEditorProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ export declare const Sidebar: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export declare const COMPONENT_DOCS: Record<string, {
2
+ title: string;
3
+ description: string;
4
+ usage: string;
5
+ props: Record<string, string>;
6
+ }>;
@@ -0,0 +1,7 @@
1
+ import { FormField } from '../util/helper';
2
+ export declare const TEMPLATES: Record<string, FormField[]>;
3
+ export declare const TOOLBOX_ITEMS: {
4
+ type: string;
5
+ label: string;
6
+ icon: string;
7
+ }[];
@@ -0,0 +1,2 @@
1
+ import { FormField } from '../util/helper';
2
+ export declare const ALL_CONTROLS_TEST_DATA: FormField[];
File without changes
@@ -0,0 +1 @@
1
+ export declare const theme: import('@mui/material').Theme;
@@ -0,0 +1,19 @@
1
+ export interface ControlChangeProps {
2
+ id?: string;
3
+ value: any;
4
+ option?: any;
5
+ }
6
+ export interface ControlProps {
7
+ attributes?: {
8
+ id?: string;
9
+ value?: any;
10
+ MuiAttributes?: any;
11
+ InputProps?: any;
12
+ options?: any[];
13
+ format?: string;
14
+ [key: string]: any;
15
+ };
16
+ rules?: any;
17
+ patch?: Record<string, any>;
18
+ onChange?: (args: ControlChangeProps) => void;
19
+ }
@@ -0,0 +1,64 @@
1
+ import { CSSProperties } from 'react';
2
+ export interface LayoutConfig {
3
+ row?: number;
4
+ xs?: number;
5
+ sm?: number;
6
+ md?: number;
7
+ lg?: number;
8
+ xl?: number;
9
+ size?: any;
10
+ [key: string]: any;
11
+ }
12
+ export interface FormField {
13
+ id?: string;
14
+ type?: string;
15
+ layout?: LayoutConfig;
16
+ props?: {
17
+ id?: string;
18
+ value?: any;
19
+ MuiAttributes?: Record<string, any>;
20
+ [key: string]: any;
21
+ };
22
+ visible?: boolean;
23
+ style?: CSSProperties;
24
+ className?: string;
25
+ rules?: any;
26
+ subforms?: {
27
+ conditionValue: any;
28
+ data: FormField[];
29
+ }[];
30
+ [key: string]: any;
31
+ }
32
+ export interface LayoutResult {
33
+ wrows: FormField[][];
34
+ worows: FormField[];
35
+ }
36
+ export interface InputPropsConfig {
37
+ MuiInputAdornment?: any;
38
+ position?: 'start' | 'end';
39
+ icon?: string;
40
+ text?: string;
41
+ textstyle?: CSSProperties;
42
+ }
43
+ export declare function generateLayout(data: FormField[]): LayoutResult;
44
+ export declare function getInputProps(InputProps: InputPropsConfig): {
45
+ [x: string]: import("react/jsx-runtime").JSX.Element;
46
+ };
47
+ export declare const generateKey: (prefix?: string, index?: number) => string;
48
+ interface EnableDisableConfig {
49
+ key: string;
50
+ disableIds: string[];
51
+ compareValues?: Record<string, boolean>;
52
+ }
53
+ export declare const updatePatchData: (fields: FormField[], patch: any, guid: string, response?: Record<string, any>, enableDisableIds?: EnableDisableConfig[]) => FormField[];
54
+ export declare const DateComponent: (name: string) => any;
55
+ export declare const checkboxSX: (color?: string) => CSSProperties | any;
56
+ declare const _default: {
57
+ generateLayout: typeof generateLayout;
58
+ getInputProps: typeof getInputProps;
59
+ generateKey: (prefix?: string, index?: number) => string;
60
+ updatePatchData: (fields: FormField[], patch: any, guid: string, response?: Record<string, any>, enableDisableIds?: EnableDisableConfig[]) => FormField[];
61
+ DateComponent: (name: string) => any;
62
+ checkboxSX: (color?: string) => CSSProperties | any;
63
+ };
64
+ export default _default;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Uploads a base64 encoded image to AWS S3.
3
+ * IMPORTANT: This requires valid AWS credentials in your environment variables.
4
+ * In a real production app without backend presigned URLs, consider restricted IAM roles.
5
+ *
6
+ * @param dataUrl The base64 data URL from the signature canvas
7
+ * @param fileName The desired filename (without path)
8
+ * @param bucket S3 Bucket name from attributes
9
+ * @param region AWS Region from attributes
10
+ * @param identityPoolId AWS Cognito Identity Pool ID
11
+ * @returns The public URL of the uploaded object
12
+ */
13
+ export declare function uploadToS3(dataUrl: string, fileName: string, bucket: string, region: string, identityPoolId: string): Promise<string>;
@@ -0,0 +1,6 @@
1
+ interface StepperComponentsProps {
2
+ components?: any[];
3
+ onUpdate?: (args: any) => void;
4
+ }
5
+ export default function StepperComponents({ components, onUpdate }: StepperComponentsProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1 @@
1
+ export default function useIsFirstRender(): boolean;
@@ -0,0 +1,2 @@
1
+ import { DependencyList, EffectCallback } from 'react';
2
+ export default function useUpdateEffect(effect: EffectCallback, deps?: DependencyList): void;
@@ -0,0 +1,6 @@
1
+ type ValidationFunction = (value: string, ...args: any[]) => boolean;
2
+ interface ValidationUtils {
3
+ [key: string]: ValidationFunction;
4
+ }
5
+ declare const Validation: ValidationUtils;
6
+ export default Validation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dynamic-mui",
3
- "version": "1.1.5",
3
+ "version": "2.0.1",
4
4
  "author": "Dinakaran S",
5
5
  "user": "dinakarans",
6
6
  "repository": {
@@ -11,52 +11,49 @@
11
11
  "bugs": {
12
12
  "url": "https://github.com/DinakaranS/-dynamic-mui/issues"
13
13
  },
14
- "main": "dist-modules",
15
- "module": "src",
14
+ "main": "./dist/dynamic-mui.cjs.js",
15
+ "module": "./dist/dynamic-mui.es.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/dynamic-mui.es.js",
21
+ "require": "./dist/dynamic-mui.cjs.js"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "peerDependencies": {
28
+ "@emotion/react": "^11.0.0",
29
+ "@emotion/styled": "^11.0.0",
30
+ "@mui/icons-material": "^5.0.0 || ^6.0.0 || ^7.0.0",
31
+ "@mui/material": "^5.0.0 || ^6.0.0 || ^7.0.0",
32
+ "@mui/x-charts": "^6.0.0 || ^7.0.0",
33
+ "@mui/x-data-grid": "^6.0.0 || ^7.0.0",
34
+ "@mui/x-date-pickers": "^6.0.0 || ^7.0.0",
35
+ "react": "^18.0.0 || ^19.0.0",
36
+ "react-dom": "^18.0.0 || ^19.0.0"
37
+ },
16
38
  "dependencies": {
17
- "@babel/eslint-parser": "^7.28.6",
18
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
19
- "@babel/plugin-transform-modules-commonjs": "^7.28.6",
20
- "@emotion/react": "^11.14.0",
21
- "@emotion/styled": "^11.14.1",
22
- "@mui/icons-material": "^7.3.7",
23
- "@mui/material": "^7.3.7",
24
- "@mui/x-charts": "^8.27.0",
25
- "@mui/x-data-grid": "^8.27.0",
26
- "@mui/x-date-pickers": "^8.27.0",
27
- "@testing-library/jest-dom": "^6.9.1",
28
- "@testing-library/react": "^16.3.2",
29
- "@testing-library/user-event": "^14.6.1",
30
- "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
39
+ "@aws-sdk/client-s3": "^3.996.0",
40
+ "@aws-sdk/credential-providers": "^3.996.0",
41
+ "@dnd-kit/core": "^6.3.1",
31
42
  "dayjs": "^1.11.19",
32
43
  "lodash": "^4.17.23",
33
44
  "numeral": "^2.0.6",
34
- "prop-types": "^15.8.1",
35
- "react": "^19.2.4",
36
- "react-dom": "^19.2.4",
37
- "react-json-tree": "^0.20.0",
38
45
  "react-number-format": "^5.4.4",
39
- "react-scripts": "5.0.1",
40
- "validator": "^13.15.26",
41
- "web-vitals": "^5.1.0"
46
+ "react-signature-canvas": "^1.1.0-alpha.2",
47
+ "uuid": "^13.0.0",
48
+ "validator": "^13.15.26"
42
49
  },
43
50
  "scripts": {
44
- "start": "craco start",
45
- "build": "craco build",
46
- "test": "craco test",
47
- "eject": "craco eject",
48
- "styleguide": "styleguidist server",
49
- "styleguide:build": "rimraf docs && styleguidist build && mkdir docs && mv styleguide/* docs",
50
- "lint": "eslint .",
51
- "lint:fix": "eslint --fix .",
52
- "dist:modules": "rimraf ./dist-modules && babel ./src --out-dir ./dist-modules",
53
- "prepublish": "npm run dist:modules"
54
- },
55
- "eslintConfig": {
56
- "extends": [
57
- "react-app",
58
- "react-app/jest"
59
- ]
51
+ "dev": "vite",
52
+ "build": "tsc && vite build",
53
+ "lint": "eslint . --max-warnings 0",
54
+ "preview": "vite preview",
55
+ "test": "vitest run",
56
+ "prepublishOnly": "yarn run build"
60
57
  },
61
58
  "browserslist": {
62
59
  "production": [
@@ -71,22 +68,36 @@
71
68
  ]
72
69
  },
73
70
  "devDependencies": {
74
- "@babel/cli": "^7.28.6",
75
- "@babel/core": "^7.29.0",
76
- "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
77
- "@babel/preset-env": "^7.29.0",
78
- "@babel/preset-react": "^7.28.5",
79
- "@craco/craco": "^7.1.0",
80
- "eslint": "8.57.1",
81
- "eslint-config-airbnb": "^19.0.4",
82
- "eslint-config-prettier": "^10.1.8",
71
+ "@emotion/react": "^11.14.0",
72
+ "@emotion/styled": "^11.14.1",
73
+ "@eslint/js": "^10.0.1",
74
+ "@mui/icons-material": "^7.3.8",
75
+ "@mui/material": "^7.3.8",
76
+ "@mui/x-charts": "^8.27.0",
77
+ "@mui/x-data-grid": "^8.27.1",
78
+ "@mui/x-date-pickers": "^8.27.2",
79
+ "@testing-library/dom": "^10.4.1",
80
+ "@testing-library/jest-dom": "^6.9.1",
81
+ "@testing-library/react": "^16.3.2",
82
+ "@types/lodash": "^4.17.24",
83
+ "@types/numeral": "^2.0.5",
84
+ "@types/react": "^19.2.14",
85
+ "@types/react-dom": "^19.2.3",
86
+ "@types/validator": "^13.15.10",
87
+ "@vitejs/plugin-react": "^5.1.4",
88
+ "eslint": "^10.0.2",
83
89
  "eslint-plugin-import": "^2.32.0",
84
- "eslint-plugin-jsx-a11y": "^6.10.2",
85
- "eslint-plugin-prettier": "^5.5.5",
86
90
  "eslint-plugin-react": "^7.37.5",
87
91
  "eslint-plugin-react-hooks": "^7.0.1",
88
- "prettier": "^3.8.1",
89
- "react-styleguidist": "^13.1.4",
90
- "tinycolor2": "^1.6.0"
92
+ "eslint-plugin-react-refresh": "^0.5.2",
93
+ "globals": "^17.3.0",
94
+ "jsdom": "^28.1.0",
95
+ "react": "^19.2.4",
96
+ "react-dom": "^19.2.4",
97
+ "typescript": "^5.9.3",
98
+ "typescript-eslint": "^8.56.1",
99
+ "vite": "^7.3.1",
100
+ "vite-plugin-dts": "^4.5.4",
101
+ "vitest": "^4.0.18"
91
102
  }
92
103
  }
@@ -1,10 +0,0 @@
1
- {
2
- "files": {
3
- "main.js": "/DinakaranS/-dynamic-mui/static/js/main.11a67c51.js",
4
- "index.html": "/DinakaranS/-dynamic-mui/index.html",
5
- "main.11a67c51.js.map": "/DinakaranS/-dynamic-mui/static/js/main.11a67c51.js.map"
6
- },
7
- "entrypoints": [
8
- "static/js/main.11a67c51.js"
9
- ]
10
- }
package/build/favicon.ico DELETED
Binary file
package/build/index.html DELETED
@@ -1 +0,0 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/DinakaranS/-dynamic-mui/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/DinakaranS/-dynamic-mui/logo192.png"/><link rel="manifest" href="/DinakaranS/-dynamic-mui/manifest.json"/><title>React App</title><script defer="defer" src="/DinakaranS/-dynamic-mui/static/js/main.11a67c51.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
package/build/logo192.png DELETED
Binary file
package/build/logo512.png DELETED
Binary file
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
package/build/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow: