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.
- package/README.md +20 -5
- package/dist/components/DynamicComponent.d.ts +13 -0
- package/dist/components/FormGenerator.d.ts +38 -0
- package/dist/components/charts/Bar/bar.d.ts +3 -0
- package/dist/components/charts/Line/line.d.ts +3 -0
- package/dist/components/charts/Mixchart/mixChart.d.ts +3 -0
- package/dist/components/charts/Pie/pie.d.ts +3 -0
- package/dist/components/controls/Accordion/accordion.d.ts +3 -0
- package/dist/components/controls/Autocomplete/autocomplete.d.ts +3 -0
- package/dist/components/controls/CheckBox/checkbox.d.ts +4 -0
- package/dist/components/controls/Chip/chip.d.ts +3 -0
- package/dist/components/controls/DataTable/datatable.d.ts +3 -0
- package/dist/components/controls/DateTime/datetime.d.ts +3 -0
- package/dist/components/controls/DateTimePicker/datetimepicker.d.ts +3 -0
- package/dist/components/controls/Divider/divider.d.ts +3 -0
- package/dist/components/controls/Group/group.d.ts +3 -0
- package/dist/components/controls/ImageList/imagelist.d.ts +3 -0
- package/dist/components/controls/List/list.d.ts +3 -0
- package/dist/components/controls/MultiTextbox/multitextbox.d.ts +3 -0
- package/dist/components/controls/NumberField/numberfield.d.ts +3 -0
- package/dist/components/controls/Radio/radio.d.ts +4 -0
- package/dist/components/controls/Select/select.d.ts +3 -0
- package/dist/components/controls/Signature/signature.d.ts +3 -0
- package/dist/components/controls/Stepper/stepper.d.ts +9 -0
- package/dist/components/controls/Switch/switch.d.ts +4 -0
- package/dist/components/controls/Tabs/tabs.d.ts +3 -0
- package/dist/components/controls/TextField/textfield.d.ts +3 -0
- package/dist/components/controls/TimePicker/timepicker.d.ts +3 -0
- package/dist/components/controls/Typography/typography.d.ts +4 -0
- package/dist/components/controls/index.d.ts +56 -0
- package/dist/config/mui.d.ts +8 -0
- package/dist/dynamic-mui.cjs.js +496 -0
- package/dist/dynamic-mui.es.js +82175 -0
- package/dist/index.d.ts +5 -0
- package/dist/main.d.ts +1 -0
- package/dist/playground/Builder.d.ts +1 -0
- package/dist/playground/Canvas.d.ts +10 -0
- package/dist/playground/PropertiesEditor.d.ts +11 -0
- package/dist/playground/Sidebar.d.ts +1 -0
- package/dist/playground/documentation.d.ts +6 -0
- package/dist/playground/templates.d.ts +8 -0
- package/dist/playground/testData.d.ts +3 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/theme/theme.d.ts +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/util/helper.d.ts +61 -0
- package/dist/util/stepperComponents.d.ts +6 -0
- package/dist/util/useIsFirstRender.d.ts +1 -0
- package/dist/util/useUpdateEffect.d.ts +3 -0
- package/dist/util/validation.d.ts +6 -0
- package/package.json +69 -55
- 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/dist/index.d.ts
ADDED
|
@@ -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 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const theme: import('@mui/material').Theme;
|
package/dist/types.d.ts
ADDED
|
@@ -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 @@
|
|
|
1
|
+
export default function useIsFirstRender(): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dynamic-mui",
|
|
3
|
-
"version": "
|
|
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-
|
|
15
|
-
"module": "
|
|
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
|
-
"@
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
22
|
-
"
|
|
23
|
-
"
|
|
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
|
-
"
|
|
35
|
-
"react": "^
|
|
36
|
-
"
|
|
37
|
-
"
|
|
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
|
-
"
|
|
45
|
-
"build": "
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
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
|
-
"@
|
|
75
|
-
"@
|
|
76
|
-
"@
|
|
77
|
-
"@
|
|
78
|
-
"@
|
|
79
|
-
"@
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"react
|
|
90
|
-
"
|
|
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
|
package/build/manifest.json
DELETED
|
@@ -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