ag-common 0.0.195 → 0.0.196
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.
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const Loader: ({ name }: {
|
|
2
|
+
export declare const Loader: ({ name, height, width, }: {
|
|
3
|
+
/**
|
|
4
|
+
* default 2rem
|
|
5
|
+
*/
|
|
6
|
+
width?: string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* default 2rem
|
|
9
|
+
*/
|
|
10
|
+
height?: string | undefined;
|
|
3
11
|
name: string;
|
|
4
12
|
}) => JSX.Element;
|
|
@@ -35,7 +35,6 @@ const SLoader = styled_components_1.default.div `
|
|
|
35
35
|
border-radius: 50%;
|
|
36
36
|
animation: spin 2s linear infinite;
|
|
37
37
|
padding: 2px;
|
|
38
|
-
width: 100%;
|
|
39
38
|
overflow: hidden;
|
|
40
39
|
|
|
41
40
|
@keyframes spin {
|
|
@@ -64,12 +63,12 @@ const LoadingBack = styled_components_1.default.div `
|
|
|
64
63
|
}
|
|
65
64
|
transition: opacity 5s;
|
|
66
65
|
`;
|
|
67
|
-
const Loader = ({ name }) => {
|
|
66
|
+
const Loader = ({ name, height = '2rem', width = '2rem', }) => {
|
|
68
67
|
const [trans, setTrans] = (0, react_1.useState)(true);
|
|
69
68
|
(0, react_1.useEffect)(() => {
|
|
70
69
|
setTrans(false);
|
|
71
70
|
}, []);
|
|
72
71
|
return (react_1.default.createElement(LoadingBack, { "data-loading": name, "data-transparent": trans },
|
|
73
|
-
react_1.default.createElement(SLoader,
|
|
72
|
+
react_1.default.createElement(SLoader, { style: { width, height } })));
|
|
74
73
|
};
|
|
75
74
|
exports.Loader = Loader;
|