mobigrid-module 1.0.6 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- package/components/CustomTable/CustomTable.tsx +182 -0
- package/components/CustomTable/Pagination.tsx +136 -0
- package/components/Icon.tsx +27 -0
- package/components/Layout/PageHeader.tsx +270 -0
- package/components/ui/alert.tsx +59 -0
- package/components/ui/button.tsx +57 -0
- package/components/ui/calendar.tsx +70 -0
- package/components/ui/date-picker-with-range.tsx +167 -0
- package/components/ui/dialog.tsx +120 -0
- package/components/ui/input.tsx +22 -0
- package/components/ui/pagination.tsx +117 -0
- package/components/ui/popover.tsx +31 -0
- package/components/ui/select.tsx +157 -0
- package/components/ui/sonner.tsx +30 -0
- package/components/ui/table.tsx +120 -0
- package/dist/components/ui/alert.d.ts +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/pagination.d.ts +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.tsx.map +1 -1
- package/index.d.ts +55 -0
- package/index.tsx +4 -4
- package/lib/utils.ts +6 -0
- package/package.json +7 -5
package/index.d.ts
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
declare module "mobigrid-module" {
|
2
|
+
import { ReactNode } from "react";
|
3
|
+
|
4
|
+
export interface FilterOption {
|
5
|
+
name: string;
|
6
|
+
type: string;
|
7
|
+
urlSource?: string;
|
8
|
+
options?: any[];
|
9
|
+
label?: string;
|
10
|
+
placeholder?: string;
|
11
|
+
required?: boolean;
|
12
|
+
}
|
13
|
+
|
14
|
+
export interface Column {
|
15
|
+
field: string;
|
16
|
+
headerName: string;
|
17
|
+
width?: number;
|
18
|
+
sortable?: boolean;
|
19
|
+
renderCell?: (params: any) => ReactNode;
|
20
|
+
}
|
21
|
+
|
22
|
+
export interface Config {
|
23
|
+
title: string;
|
24
|
+
data_url: string;
|
25
|
+
colomns: Column[];
|
26
|
+
Filters?: FilterOption[][];
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface FilterState {
|
30
|
+
fromDate: string;
|
31
|
+
toDate: string;
|
32
|
+
[key: string]: any;
|
33
|
+
}
|
34
|
+
|
35
|
+
export interface ApiResponse {
|
36
|
+
DATA: any[];
|
37
|
+
PAGESNUM: number;
|
38
|
+
}
|
39
|
+
|
40
|
+
export interface Error {
|
41
|
+
title: string;
|
42
|
+
message: string;
|
43
|
+
}
|
44
|
+
|
45
|
+
export interface MobigridModuleProps {
|
46
|
+
configUrl: string;
|
47
|
+
preJsUrl: string;
|
48
|
+
itemsPerPage?: number;
|
49
|
+
children?: ReactNode;
|
50
|
+
}
|
51
|
+
|
52
|
+
const MobigridModule: React.FC<MobigridModuleProps>;
|
53
|
+
|
54
|
+
export default MobigridModule;
|
55
|
+
}
|
package/index.tsx
CHANGED
@@ -2,11 +2,11 @@ import React from "react";
|
|
2
2
|
import { useEffect, useState } from "react";
|
3
3
|
import { format } from "date-fns";
|
4
4
|
import axios from "axios";
|
5
|
-
import { Alert, AlertTitle, AlertDescription } from "./components/ui/alert
|
5
|
+
import { Alert, AlertTitle, AlertDescription } from "./components/ui/alert";
|
6
6
|
import { AlertCircle } from "lucide-react";
|
7
|
-
import { PageHeader } from "./components/Layout/PageHeader
|
8
|
-
import { CustomTable } from "./components/CustomTable/CustomTable
|
9
|
-
import Pagination from "./components/CustomTable/Pagination
|
7
|
+
import { PageHeader } from "./components/Layout/PageHeader";
|
8
|
+
import { CustomTable } from "./components/CustomTable/CustomTable";
|
9
|
+
import Pagination from "./components/CustomTable/Pagination";
|
10
10
|
|
11
11
|
const ITEMS_PER_PAGE = 14;
|
12
12
|
|
package/lib/utils.ts
ADDED
package/package.json
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "mobigrid-module",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.8",
|
4
4
|
"description": "",
|
5
|
-
"main": "index.tsx",
|
6
5
|
"type": "module",
|
7
6
|
"scripts": {
|
8
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
@@ -52,7 +51,6 @@
|
|
52
51
|
"eslint-plugin-react-hooks": "^5.0.0",
|
53
52
|
"eslint-plugin-react-refresh": "^0.4.14",
|
54
53
|
"globals": "^15.11.0",
|
55
|
-
"lucide-react": "^0.456.0",
|
56
54
|
"postcss": "^8.4.47",
|
57
55
|
"react": "^18.3.1",
|
58
56
|
"react-dom": "^18.3.1",
|
@@ -64,8 +62,12 @@
|
|
64
62
|
"typescript-eslint": "^8.11.0",
|
65
63
|
"vite": "^5.4.10"
|
66
64
|
},
|
67
|
-
"types": "dist/index.d
|
65
|
+
"types": "dist/index.d",
|
68
66
|
"files": [
|
69
|
-
"dist"
|
67
|
+
"dist",
|
68
|
+
"index.tsx",
|
69
|
+
"index.d.ts",
|
70
|
+
"components",
|
71
|
+
"lib"
|
70
72
|
]
|
71
73
|
}
|