master-data-management-react 0.0.1 → 0.1.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.
- package/README.md +136 -72
- package/dist/components/ServerSideGrid/styles.d.ts +18 -6
- package/dist/components/ServerSideGrid/styles.d.ts.map +1 -1
- package/dist/hooks/useApiService.d.ts +22 -4
- package/dist/hooks/useApiService.d.ts.map +1 -1
- package/dist/index.cjs +10 -7
- package/dist/index.d.ts +6 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1159 -2604
- package/dist/master-data-management-react.css +1 -1
- package/dist/pages/MasterForm/MasterForm.d.ts +14 -2
- package/dist/pages/MasterForm/MasterForm.d.ts.map +1 -1
- package/dist/pages/MasterView/MasterView.d.ts +11 -2
- package/dist/pages/MasterView/MasterView.d.ts.map +1 -1
- package/package.json +28 -14
- package/dist/App.d.ts +0 -6
- package/dist/App.d.ts.map +0 -1
- package/dist/config/index.d.ts +0 -6
- package/dist/config/index.d.ts.map +0 -1
- package/dist/contexts/MasterDataContext.d.ts +0 -51
- package/dist/contexts/MasterDataContext.d.ts.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/routes/AppRoutes.d.ts +0 -3
- package/dist/routes/AppRoutes.d.ts.map +0 -1
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import './
|
|
2
|
-
|
|
1
|
+
import './index.scss';
|
|
2
|
+
import type { FormMode } from '../../constants/form.constants';
|
|
3
|
+
import { type ApiEndpoints } from '../../hooks/useApiService';
|
|
4
|
+
import type { AxiosInstance } from 'axios';
|
|
5
|
+
export interface MasterFormProps {
|
|
6
|
+
apiClient: AxiosInstance;
|
|
7
|
+
apiEndpoints: ApiEndpoints;
|
|
8
|
+
entity: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
mode: FormMode;
|
|
11
|
+
onBack?: () => void;
|
|
12
|
+
onSuccess?: (data: any) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const MasterForm: ({ apiClient, apiEndpoints, entity, id, mode, onBack, onSuccess }: MasterFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
15
|
export default MasterForm;
|
|
4
16
|
//# sourceMappingURL=MasterForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MasterForm.d.ts","sourceRoot":"","sources":["../../../src/pages/MasterForm/MasterForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MasterForm.d.ts","sourceRoot":"","sources":["../../../src/pages/MasterForm/MasterForm.tsx"],"names":[],"mappings":"AAWA,OAAO,cAAc,CAAC;AActB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAa3C,MAAM,WAAW,eAAe;IAC5B,SAAS,EAAE,aAAa,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,QAAA,MAAM,UAAU,GAAI,kEAQjB,eAAe,4CA2VjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import './
|
|
2
|
-
|
|
1
|
+
import './index.scss';
|
|
2
|
+
import { type ApiEndpoints } from '../../hooks/useApiService';
|
|
3
|
+
import type { AxiosInstance } from 'axios';
|
|
4
|
+
export interface MasterViewProps {
|
|
5
|
+
apiClient: AxiosInstance;
|
|
6
|
+
apiEndpoints: ApiEndpoints;
|
|
7
|
+
onNavigateToNew?: (entity: string) => void;
|
|
8
|
+
onNavigateToView?: (entity: string, id: string | number) => void;
|
|
9
|
+
onNavigateToEdit?: (entity: string, id: string | number) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const MasterView: ({ apiClient, apiEndpoints, onNavigateToNew, onNavigateToEdit }: MasterViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
12
|
export default MasterView;
|
|
4
13
|
//# sourceMappingURL=MasterView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MasterView.d.ts","sourceRoot":"","sources":["../../../src/pages/MasterView/MasterView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MasterView.d.ts","sourceRoot":"","sources":["../../../src/pages/MasterView/MasterView.tsx"],"names":[],"mappings":"AAcA,OAAO,cAAc,CAAC;AAgBtB,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAM3C,MAAM,WAAW,eAAe;IAC5B,SAAS,EAAE,aAAa,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IACjE,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACpE;AAED,QAAA,MAAM,UAAU,GAAI,gEAKjB,eAAe,4CAwajB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "master-data-management-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A flexible, configurable React package for managing master data with dynamic forms and tables",
|
|
5
5
|
"type": "module",
|
|
6
|
+
|
|
6
7
|
"main": "./dist/index.cjs",
|
|
7
8
|
"module": "./dist/index.js",
|
|
8
9
|
"types": "./dist/index.d.ts",
|
|
10
|
+
|
|
9
11
|
"exports": {
|
|
10
12
|
".": {
|
|
11
13
|
"types": "./dist/index.d.ts",
|
|
@@ -14,10 +16,12 @@
|
|
|
14
16
|
},
|
|
15
17
|
"./styles": "./dist/style.css"
|
|
16
18
|
},
|
|
19
|
+
|
|
17
20
|
"files": [
|
|
18
21
|
"dist",
|
|
19
22
|
"README.md"
|
|
20
23
|
],
|
|
24
|
+
|
|
21
25
|
"keywords": [
|
|
22
26
|
"react",
|
|
23
27
|
"master-data",
|
|
@@ -26,40 +30,50 @@
|
|
|
26
30
|
"data-management",
|
|
27
31
|
"admin-panel"
|
|
28
32
|
],
|
|
33
|
+
|
|
29
34
|
"license": "MIT",
|
|
35
|
+
|
|
30
36
|
"scripts": {
|
|
31
37
|
"dev": "vite",
|
|
32
|
-
"build": "
|
|
38
|
+
"build": "npm run build:lib",
|
|
33
39
|
"build:lib": "vite build --mode lib && tsc -p tsconfig.lib.json",
|
|
34
40
|
"lint": "eslint .",
|
|
35
41
|
"preview": "vite preview",
|
|
36
42
|
"prepublishOnly": "npm run build:lib"
|
|
37
43
|
},
|
|
44
|
+
|
|
38
45
|
"peerDependencies": {
|
|
39
|
-
"react": "^18.0.0
|
|
40
|
-
"react-dom": "^18.0.0
|
|
41
|
-
"react-router-dom": "^6.0.0
|
|
46
|
+
"react": "^18.0.0",
|
|
47
|
+
"react-dom": "^18.0.0",
|
|
48
|
+
"react-router-dom": "^6.0.0",
|
|
49
|
+
|
|
42
50
|
"@mui/material": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
43
51
|
"@emotion/react": "^11.0.0",
|
|
44
52
|
"@emotion/styled": "^11.0.0",
|
|
45
|
-
|
|
46
|
-
"ag-grid-community": "^30.0.0 || ^31.0.0 || ^32.0.0 || ^35.0.0"
|
|
53
|
+
|
|
54
|
+
"ag-grid-community": "^30.0.0 || ^31.0.0 || ^32.0.0 || ^35.0.0",
|
|
55
|
+
"ag-grid-react": "^30.0.0 || ^31.0.0 || ^32.0.0 || ^35.0.0"
|
|
47
56
|
},
|
|
57
|
+
|
|
48
58
|
"dependencies": {
|
|
49
59
|
"axios": "^1.13.2"
|
|
50
60
|
},
|
|
61
|
+
|
|
51
62
|
"devDependencies": {
|
|
52
|
-
"@
|
|
53
|
-
"@types/
|
|
54
|
-
|
|
55
|
-
"@types/react-dom": "^19.2.3",
|
|
63
|
+
"@types/react": "^18.2.0",
|
|
64
|
+
"@types/react-dom": "^18.2.0",
|
|
65
|
+
|
|
56
66
|
"@vitejs/plugin-react-swc": "^4.2.2",
|
|
67
|
+
"vite": "^7.2.4",
|
|
68
|
+
|
|
69
|
+
"typescript": "~5.9.3",
|
|
70
|
+
"@types/node": "^24.10.1",
|
|
71
|
+
|
|
57
72
|
"eslint": "^9.39.1",
|
|
73
|
+
"@eslint/js": "^9.39.1",
|
|
58
74
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
59
75
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
60
76
|
"globals": "^16.5.0",
|
|
61
|
-
"
|
|
62
|
-
"typescript-eslint": "^8.46.4",
|
|
63
|
-
"vite": "^7.2.4"
|
|
77
|
+
"sass": "^1.97.2"
|
|
64
78
|
}
|
|
65
79
|
}
|
package/dist/App.d.ts
DELETED
package/dist/App.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAEA,OAAO,WAAW,CAAA;AAElB,OAAO,sCAAsC,CAAC;AAC9C,OAAO,8CAA8C,CAAC;AAGtD,iBAAS,GAAG,4CAiBX;AAED,eAAe,GAAG,CAAA"}
|
package/dist/config/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,cAAc,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Master Data Management – Minimal Config Context
|
|
3
|
-
* Only exposes what a package consumer SHOULD control
|
|
4
|
-
*/
|
|
5
|
-
import type { ReactNode } from 'react';
|
|
6
|
-
import type { AxiosInstance } from 'axios';
|
|
7
|
-
export interface ApiServiceFunctions {
|
|
8
|
-
getEntities?: () => Promise<any>;
|
|
9
|
-
getMetadata?: (entity: string) => Promise<any>;
|
|
10
|
-
getRecords?: (entity: string, params?: any) => Promise<any>;
|
|
11
|
-
getRecord?: (entity: string, id: string | number) => Promise<any>;
|
|
12
|
-
createRecord?: (entity: string, data: any) => Promise<any>;
|
|
13
|
-
updateRecord?: (entity: string, id: string | number, data: any) => Promise<any>;
|
|
14
|
-
deleteRecord?: (entity: string, id: string | number) => Promise<any>;
|
|
15
|
-
exportCSV?: (entity: string, params?: any) => Promise<any>;
|
|
16
|
-
exportExcel?: (entity: string, params?: any) => Promise<any>;
|
|
17
|
-
}
|
|
18
|
-
export interface ApiEndpointsConfig {
|
|
19
|
-
entities: string;
|
|
20
|
-
metadata: (entity: string) => string;
|
|
21
|
-
records: (entity: string) => string;
|
|
22
|
-
recordById: (entity: string, id: string | number) => string;
|
|
23
|
-
exportCSV: (entity: string) => string;
|
|
24
|
-
exportExcel: (entity: string) => string;
|
|
25
|
-
}
|
|
26
|
-
export interface RouteConfig {
|
|
27
|
-
basePath: string;
|
|
28
|
-
entityNew: (entity: string) => string;
|
|
29
|
-
entityView: (entity: string, id: string | number) => string;
|
|
30
|
-
entityEdit: (entity: string, id: string | number) => string;
|
|
31
|
-
}
|
|
32
|
-
export interface MasterDataConfig {
|
|
33
|
-
apiClient?: AxiosInstance;
|
|
34
|
-
apiEndpoints?: Partial<ApiEndpointsConfig>;
|
|
35
|
-
apiService?: ApiServiceFunctions;
|
|
36
|
-
routes?: Partial<RouteConfig>;
|
|
37
|
-
}
|
|
38
|
-
export interface MasterDataContextValue {
|
|
39
|
-
apiClient?: AxiosInstance;
|
|
40
|
-
apiEndpoints: ApiEndpointsConfig;
|
|
41
|
-
routes: RouteConfig;
|
|
42
|
-
apiService?: ApiServiceFunctions;
|
|
43
|
-
}
|
|
44
|
-
interface MasterDataProviderProps {
|
|
45
|
-
config?: MasterDataConfig;
|
|
46
|
-
children: ReactNode;
|
|
47
|
-
}
|
|
48
|
-
export declare const MasterDataProvider: ({ config, children, }: MasterDataProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
|
-
export declare const useMasterDataConfig: () => MasterDataContextValue;
|
|
50
|
-
export {};
|
|
51
|
-
//# sourceMappingURL=MasterDataContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MasterDataContext.d.ts","sourceRoot":"","sources":["../../src/contexts/MasterDataContext.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAM3C,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/C,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAClE,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAA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MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/B;AAMD,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,YAAY,EAAE,kBAAkB,CAAC;IACjC,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC;AAYD,UAAU,uBAAuB;IAC/B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,GAAI,uBAGhC,uBAAuB,4CAmBzB,CAAC;AAMF,eAAO,MAAM,mBAAmB,8BAU/B,CAAC"}
|
package/dist/main.d.ts
DELETED
package/dist/main.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppRoutes.d.ts","sourceRoot":"","sources":["../../src/routes/AppRoutes.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,SAAS,+CAad,CAAC;AAEF,eAAe,SAAS,CAAC"}
|