mobigrid-module 1.1.0 → 1.1.3
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/components/InvalidConfig.tsx +26 -0
- package/components/LoadingConfig.tsx +38 -0
- package/dist/components/InvalidConfig.d.ts +2 -0
- package/dist/components/LoadingConfig.d.ts +2 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -0
- package/dist/index.tsx +1 -1
- package/dist/index.tsx.map +1 -1
- package/index.tsx +6 -64
- package/package.json +4 -2
- package/tsconfig.json +36 -0
package/index.tsx
CHANGED
@@ -7,6 +7,8 @@ import { AlertCircle } from "lucide-react";
|
|
7
7
|
import { PageHeader } from "./components/Layout/PageHeader";
|
8
8
|
import { CustomTable } from "./components/CustomTable/CustomTable";
|
9
9
|
import Pagination from "./components/CustomTable/Pagination";
|
10
|
+
import LoadingConfig from "./components/LoadingConfig";
|
11
|
+
import InvalidConfig from "./components/InvalidConfig";
|
10
12
|
|
11
13
|
const ITEMS_PER_PAGE = 14;
|
12
14
|
|
@@ -159,68 +161,8 @@ const MobigridModule = ({
|
|
159
161
|
}
|
160
162
|
};
|
161
163
|
|
162
|
-
if (invalidConfig)
|
163
|
-
|
164
|
-
<div
|
165
|
-
style={{
|
166
|
-
display: "flex",
|
167
|
-
justifyContent: "center",
|
168
|
-
alignItems: "center",
|
169
|
-
height: "100vh",
|
170
|
-
}}
|
171
|
-
>
|
172
|
-
<div style={{ position: "absolute" }}>
|
173
|
-
<svg
|
174
|
-
className="h-5 w-5 mx-auto mb-2"
|
175
|
-
xmlns="http://www.w3.org/2000/svg"
|
176
|
-
viewBox="0 0 24 24"
|
177
|
-
fill="red"
|
178
|
-
>
|
179
|
-
<path d="M18.3 5.71a.996.996 0 00-1.41 0L12 10.59 7.11 5.7A.996.996 0 105.7 7.11L10.59 12 5.7 16.89a.996.996 0 101.41 1.41L12 13.41l4.89 4.89a.996.996 0 101.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z" />
|
180
|
-
</svg>
|
181
|
-
<div>Invalid configuration</div>
|
182
|
-
</div>
|
183
|
-
</div>
|
184
|
-
);
|
185
|
-
}
|
186
|
-
|
187
|
-
if (!config) {
|
188
|
-
return (
|
189
|
-
<div
|
190
|
-
style={{
|
191
|
-
display: "flex",
|
192
|
-
justifyContent: "center",
|
193
|
-
alignItems: "center",
|
194
|
-
height: "100vh",
|
195
|
-
}}
|
196
|
-
>
|
197
|
-
<div style={{ position: "absolute" }}>
|
198
|
-
<svg
|
199
|
-
className="animate-spin h-5 w-5 mx-auto mb-2"
|
200
|
-
xmlns="http://www.w3.org/2000/svg"
|
201
|
-
fill="none"
|
202
|
-
viewBox="0 0 24 24"
|
203
|
-
>
|
204
|
-
<circle
|
205
|
-
className="opacity-25"
|
206
|
-
cx="12"
|
207
|
-
cy="12"
|
208
|
-
r="10"
|
209
|
-
stroke="currentColor"
|
210
|
-
strokeWidth="4"
|
211
|
-
></circle>
|
212
|
-
<path
|
213
|
-
className="opacity-75"
|
214
|
-
fill="currentColor"
|
215
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
216
|
-
></path>
|
217
|
-
</svg>
|
218
|
-
<div>Loading configuration...</div>
|
219
|
-
</div>
|
220
|
-
</div>
|
221
|
-
);
|
222
|
-
}
|
223
|
-
|
164
|
+
if (invalidConfig) return <InvalidConfig />;
|
165
|
+
if (!config) return <LoadingConfig />;
|
224
166
|
return (
|
225
167
|
<div className="flex flex-col gap-4 p-4 max-w-[1300px] mx-auto mt-8 mb-">
|
226
168
|
<PageHeader
|
@@ -249,6 +191,6 @@ const MobigridModule = ({
|
|
249
191
|
{children}
|
250
192
|
</div>
|
251
193
|
);
|
252
|
-
}
|
194
|
+
};
|
253
195
|
|
254
|
-
export {MobigridModule as default};
|
196
|
+
export { MobigridModule as default };
|
package/package.json
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "mobigrid-module",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.3",
|
4
4
|
"description": "",
|
5
5
|
"type": "module",
|
6
6
|
"main": "index.tsx",
|
7
|
+
"typings": "index.d.ts",
|
7
8
|
"scripts": {
|
8
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
9
10
|
"build": "rollup -c"
|
@@ -69,6 +70,7 @@
|
|
69
70
|
"index.tsx",
|
70
71
|
"index.d.ts",
|
71
72
|
"components",
|
72
|
-
"lib"
|
73
|
+
"lib",
|
74
|
+
"tsconfig.json"
|
73
75
|
]
|
74
76
|
}
|
package/tsconfig.json
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "ES5",
|
4
|
+
"module": "ESNext",
|
5
|
+
"declaration": true,
|
6
|
+
"declarationDir": "dist/types",
|
7
|
+
"outDir": "dist",
|
8
|
+
"jsx": "react",
|
9
|
+
"strict": true,
|
10
|
+
"esModuleInterop": true,
|
11
|
+
"skipLibCheck": true,
|
12
|
+
"moduleResolution": "node",
|
13
|
+
"baseUrl": "./",
|
14
|
+
"paths": {
|
15
|
+
"*": [
|
16
|
+
"node_modules/*"
|
17
|
+
]
|
18
|
+
},
|
19
|
+
"typeRoots": [
|
20
|
+
"./node_modules/@types",
|
21
|
+
"./typings"
|
22
|
+
],
|
23
|
+
},
|
24
|
+
"include": [
|
25
|
+
"./**/*",
|
26
|
+
"typings",
|
27
|
+
"components",
|
28
|
+
"lib",
|
29
|
+
"types",
|
30
|
+
"index.tsx"
|
31
|
+
],
|
32
|
+
"exclude": [
|
33
|
+
"node_modules",
|
34
|
+
"dist"
|
35
|
+
]
|
36
|
+
}
|