dynamic-mui 1.1.5 → 2.0.0

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 (108) hide show
  1. package/README.md +20 -5
  2. package/dist/components/DynamicComponent.d.ts +13 -0
  3. package/dist/components/FormGenerator.d.ts +38 -0
  4. package/dist/components/charts/Bar/bar.d.ts +3 -0
  5. package/dist/components/charts/Line/line.d.ts +3 -0
  6. package/dist/components/charts/Mixchart/mixChart.d.ts +3 -0
  7. package/dist/components/charts/Pie/pie.d.ts +3 -0
  8. package/dist/components/controls/Accordion/accordion.d.ts +3 -0
  9. package/dist/components/controls/Autocomplete/autocomplete.d.ts +3 -0
  10. package/dist/components/controls/CheckBox/checkbox.d.ts +4 -0
  11. package/dist/components/controls/Chip/chip.d.ts +3 -0
  12. package/dist/components/controls/DataTable/datatable.d.ts +3 -0
  13. package/dist/components/controls/DateTime/datetime.d.ts +3 -0
  14. package/dist/components/controls/DateTimePicker/datetimepicker.d.ts +3 -0
  15. package/dist/components/controls/Divider/divider.d.ts +3 -0
  16. package/dist/components/controls/Group/group.d.ts +3 -0
  17. package/dist/components/controls/ImageList/imagelist.d.ts +3 -0
  18. package/dist/components/controls/List/list.d.ts +3 -0
  19. package/dist/components/controls/MultiTextbox/multitextbox.d.ts +3 -0
  20. package/dist/components/controls/NumberField/numberfield.d.ts +3 -0
  21. package/dist/components/controls/Radio/radio.d.ts +4 -0
  22. package/dist/components/controls/Select/select.d.ts +3 -0
  23. package/dist/components/controls/Signature/signature.d.ts +3 -0
  24. package/dist/components/controls/Stepper/stepper.d.ts +9 -0
  25. package/dist/components/controls/Switch/switch.d.ts +4 -0
  26. package/dist/components/controls/Tabs/tabs.d.ts +3 -0
  27. package/dist/components/controls/TextField/textfield.d.ts +3 -0
  28. package/dist/components/controls/TimePicker/timepicker.d.ts +3 -0
  29. package/dist/components/controls/Typography/typography.d.ts +4 -0
  30. package/dist/components/controls/index.d.ts +56 -0
  31. package/dist/config/mui.d.ts +8 -0
  32. package/dist/dynamic-mui.cjs.js +496 -0
  33. package/dist/dynamic-mui.es.js +82175 -0
  34. package/dist/index.d.ts +5 -0
  35. package/dist/main.d.ts +1 -0
  36. package/dist/playground/Builder.d.ts +1 -0
  37. package/dist/playground/Canvas.d.ts +10 -0
  38. package/dist/playground/PropertiesEditor.d.ts +11 -0
  39. package/dist/playground/Sidebar.d.ts +1 -0
  40. package/dist/playground/documentation.d.ts +6 -0
  41. package/dist/playground/templates.d.ts +8 -0
  42. package/dist/playground/testData.d.ts +3 -0
  43. package/dist/test/setup.d.ts +1 -0
  44. package/dist/theme/theme.d.ts +1 -0
  45. package/dist/types.d.ts +19 -0
  46. package/dist/util/helper.d.ts +61 -0
  47. package/dist/util/stepperComponents.d.ts +6 -0
  48. package/dist/util/useIsFirstRender.d.ts +1 -0
  49. package/dist/util/useUpdateEffect.d.ts +3 -0
  50. package/dist/util/validation.d.ts +6 -0
  51. package/package.json +69 -55
  52. package/build/asset-manifest.json +0 -10
  53. package/build/favicon.ico +0 -0
  54. package/build/index.html +0 -1
  55. package/build/logo192.png +0 -0
  56. package/build/logo512.png +0 -0
  57. package/build/manifest.json +0 -25
  58. package/build/robots.txt +0 -3
  59. package/build/static/js/main.11a67c51.js +0 -3
  60. package/build/static/js/main.11a67c51.js.LICENSE.txt +0 -85
  61. package/build/static/js/main.11a67c51.js.map +0 -1
  62. package/craco.config.js +0 -34
  63. package/dist-modules/components/DynamicComponent.js +0 -22
  64. package/dist-modules/components/FormGenerator.js +0 -200
  65. package/dist-modules/components/charts/Bar/bar.js +0 -31
  66. package/dist-modules/components/charts/Line/line.js +0 -31
  67. package/dist-modules/components/charts/Mixchart/mixChart.js +0 -59
  68. package/dist-modules/components/charts/Pie/pie.js +0 -31
  69. package/dist-modules/components/controls/CheckBox/checkbox.js +0 -56
  70. package/dist-modules/components/controls/DataTable/datatable.js +0 -28
  71. package/dist-modules/components/controls/DateTime/datetime.js +0 -53
  72. package/dist-modules/components/controls/DateTimePicker/datetimepicker.js +0 -53
  73. package/dist-modules/components/controls/Radio/radio.js +0 -88
  74. package/dist-modules/components/controls/Select/select.js +0 -173
  75. package/dist-modules/components/controls/Stepper/stepper.js +0 -192
  76. package/dist-modules/components/controls/Switch/switch.js +0 -85
  77. package/dist-modules/components/controls/TextField/textfield.js +0 -148
  78. package/dist-modules/components/controls/TimePicker/timepicker.js +0 -53
  79. package/dist-modules/components/controls/Typography/typography.js +0 -43
  80. package/dist-modules/components/controls/index.js +0 -42
  81. package/dist-modules/config/mui.js +0 -73
  82. package/dist-modules/data/checkbox.js +0 -143
  83. package/dist-modules/data/dataTable.js +0 -90
  84. package/dist-modules/data/dateTime.js +0 -136
  85. package/dist-modules/data/radio.js +0 -36
  86. package/dist-modules/data/select.js +0 -126
  87. package/dist-modules/data/stepper.js +0 -237
  88. package/dist-modules/data/switch.js +0 -123
  89. package/dist-modules/data/textfield.js +0 -240
  90. package/dist-modules/index.js +0 -16
  91. package/dist-modules/util/helper.js +0 -226
  92. package/dist-modules/util/stepperComponents.js +0 -40
  93. package/dist-modules/util/useIsFirstRender.js +0 -15
  94. package/dist-modules/util/useUpdateEffect.js +0 -19
  95. package/dist-modules/util/validation.js +0 -102
  96. package/docs/asset-manifest.json +0 -9
  97. package/docs/build/bundle.1eab2706.js +0 -2
  98. package/docs/build/bundle.1eab2706.js.LICENSE.txt +0 -153
  99. package/docs/index.html +0 -16
  100. package/public/favicon.ico +0 -0
  101. package/public/index.html +0 -43
  102. package/public/logo192.png +0 -0
  103. package/public/logo512.png +0 -0
  104. package/public/manifest.json +0 -25
  105. package/public/robots.txt +0 -3
  106. package/styleguide.config.js +0 -108
  107. package/themes/default.js +0 -114
  108. package/themes/index.js +0 -29
@@ -0,0 +1,5 @@
1
+ export { FormGenerator, FormData, ClearFormData } from './components/FormGenerator';
2
+ export { default as DynamicComponent } from './components/DynamicComponent';
3
+ export { default as Controls } from './components/controls';
4
+ export { default as MuiConfig } from './config/mui';
5
+ export * from './types';
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,10 @@
1
+ import { FormField } from '../util/helper';
2
+
3
+ interface CanvasProps {
4
+ fields: FormField[];
5
+ onSelectField: (id: string) => void;
6
+ selectedId: string | null;
7
+ onDeleteField: (id: string) => void;
8
+ }
9
+ export declare const Canvas: ({ fields, onSelectField, selectedId: _selectedId, onDeleteField: _onDeleteField }: CanvasProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import { FormField } from '../util/helper';
2
+
3
+ interface PropertiesEditorProps {
4
+ field: FormField | null;
5
+ onUpdate: (field: FormField) => void;
6
+ onDelete: (id: string) => void;
7
+ allFields?: FormField[];
8
+ onAllFieldsChange?: (fields: FormField[]) => void;
9
+ }
10
+ export declare const PropertiesEditor: ({ field, onUpdate, onDelete, allFields, onAllFieldsChange }: PropertiesEditorProps) => import("react/jsx-runtime").JSX.Element;
11
+ 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,8 @@
1
+ import { FormField } from '../util/helper';
2
+
3
+ export declare const TEMPLATES: Record<string, FormField[]>;
4
+ export declare const TOOLBOX_ITEMS: {
5
+ type: string;
6
+ label: string;
7
+ icon: string;
8
+ }[];
@@ -0,0 +1,3 @@
1
+ import { FormField } from '../util/helper';
2
+
3
+ export declare const ALL_CONTROLS_TEST_DATA: FormField[];
@@ -0,0 +1 @@
1
+
@@ -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,61 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ export interface LayoutConfig {
4
+ row?: number;
5
+ xs?: number;
6
+ sm?: number;
7
+ md?: number;
8
+ lg?: number;
9
+ xl?: number;
10
+ size?: any;
11
+ [key: string]: any;
12
+ }
13
+ export interface FormField {
14
+ id?: string;
15
+ type?: string;
16
+ layout?: LayoutConfig;
17
+ props?: {
18
+ id?: string;
19
+ value?: any;
20
+ MuiAttributes?: Record<string, any>;
21
+ [key: string]: any;
22
+ };
23
+ visible?: boolean;
24
+ style?: CSSProperties;
25
+ className?: string;
26
+ rules?: any;
27
+ [key: string]: any;
28
+ }
29
+ export interface LayoutResult {
30
+ wrows: FormField[][];
31
+ worows: FormField[];
32
+ }
33
+ export interface InputPropsConfig {
34
+ MuiInputAdornment?: any;
35
+ position?: 'start' | 'end';
36
+ icon?: string;
37
+ text?: string;
38
+ textstyle?: CSSProperties;
39
+ }
40
+ export declare function generateLayout(data: FormField[]): LayoutResult;
41
+ export declare function getInputProps(InputProps: InputPropsConfig): {
42
+ [x: string]: import("react/jsx-runtime").JSX.Element;
43
+ };
44
+ export declare const generateKey: (prefix?: string, index?: number) => string;
45
+ interface EnableDisableConfig {
46
+ key: string;
47
+ disableIds: string[];
48
+ compareValues?: Record<string, boolean>;
49
+ }
50
+ export declare const updatePatchData: (fields: FormField[], patch: any, guid: string, response?: Record<string, any>, enableDisableIds?: EnableDisableConfig[]) => FormField[];
51
+ export declare const DateComponent: (name: string) => any;
52
+ export declare const checkboxSX: (color?: string) => CSSProperties | any;
53
+ declare const _default: {
54
+ generateLayout: typeof generateLayout;
55
+ getInputProps: typeof getInputProps;
56
+ generateKey: (prefix?: string, index?: number) => string;
57
+ updatePatchData: (fields: FormField[], patch: any, guid: string, response?: Record<string, any>, enableDisableIds?: EnableDisableConfig[]) => FormField[];
58
+ DateComponent: (name: string) => any;
59
+ checkboxSX: (color?: string) => CSSProperties | any;
60
+ };
61
+ export default _default;
@@ -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,3 @@
1
+ import { DependencyList, EffectCallback } from 'react';
2
+
3
+ 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.0",
4
4
  "author": "Dinakaran S",
5
5
  "user": "dinakarans",
6
6
  "repository": {
@@ -11,46 +11,50 @@
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
+ "import": "./dist/dynamic-mui.es.js",
20
+ "require": "./dist/dynamic-mui.cjs.js",
21
+ "types": "./dist/index.d.ts"
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",
31
- "dayjs": "^1.11.19",
32
- "lodash": "^4.17.23",
39
+ "@dnd-kit/core": "^6.3.1",
40
+ "@dnd-kit/sortable": "^10.0.0",
41
+ "@dnd-kit/utilities": "^3.2.2",
42
+ "@types/react-signature-canvas": "^1.0.7",
43
+ "@types/uuid": "^10.0.0",
44
+ "dayjs": "^1.11.10",
45
+ "lodash": "^4.17.21",
33
46
  "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
- "react-number-format": "^5.4.4",
39
- "react-scripts": "5.0.1",
40
- "validator": "^13.15.26",
41
- "web-vitals": "^5.1.0"
47
+ "react-number-format": "^5.3.1",
48
+ "react-signature-canvas": "^1.1.0-alpha.2",
49
+ "uuid": "^13.0.0",
50
+ "validator": "^13.11.0"
42
51
  },
43
52
  "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"
53
+ "dev": "vite",
54
+ "build": "tsc && vite build",
55
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
56
+ "preview": "vite preview",
57
+ "prepublishOnly": "yarn run build"
54
58
  },
55
59
  "eslintConfig": {
56
60
  "extends": [
@@ -71,22 +75,32 @@
71
75
  ]
72
76
  },
73
77
  "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",
83
- "eslint-plugin-import": "^2.32.0",
84
- "eslint-plugin-jsx-a11y": "^6.10.2",
85
- "eslint-plugin-prettier": "^5.5.5",
86
- "eslint-plugin-react": "^7.37.5",
87
- "eslint-plugin-react-hooks": "^7.0.1",
88
- "prettier": "^3.8.1",
89
- "react-styleguidist": "^13.1.4",
90
- "tinycolor2": "^1.6.0"
78
+ "@emotion/react": "^11.14.0",
79
+ "@emotion/styled": "^11.14.1",
80
+ "@mui/icons-material": "^7.3.8",
81
+ "@mui/material": "^7.3.8",
82
+ "@mui/x-charts": "^7.24.1",
83
+ "@mui/x-data-grid": "^7.26.0",
84
+ "@mui/x-date-pickers": "^7.26.0",
85
+ "@testing-library/jest-dom": "^6.9.1",
86
+ "@testing-library/react": "^16.3.2",
87
+ "@testing-library/user-event": "^14.6.1",
88
+ "@types/lodash": "^4.17.23",
89
+ "@types/numeral": "^2.0.5",
90
+ "@types/react": "^18.2.66",
91
+ "@types/react-dom": "^18.2.22",
92
+ "@types/validator": "^13.15.10",
93
+ "@vitejs/plugin-react": "^4.2.1",
94
+ "baseline-browser-mapping": "^2.9.19",
95
+ "eslint": "^9.21.0",
96
+ "eslint-plugin-react-hooks": "^5.1.0",
97
+ "eslint-plugin-react-refresh": "^0.4.19",
98
+ "jsdom": "^28.1.0",
99
+ "react": "^19.0.0",
100
+ "react-dom": "^19.0.0",
101
+ "typescript": "^5.2.2",
102
+ "vite": "^5.2.0",
103
+ "vite-plugin-dts": "^3.8.1",
104
+ "vitest": "^4.0.18"
91
105
  }
92
- }
106
+ }
@@ -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: