xmirror-components 1.0.16 → 1.0.17
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/build/dist/index.cjs +35 -12
- package/build/dist/index.mjs +2247 -945
- package/build/es/components/AntdApp/index.js +2 -0
- package/build/es/components/GlobalLoading/index.d.ts +6 -0
- package/build/es/components/GlobalLoading/index.js +35 -0
- package/build/es/components/IconFont/index.d.ts +1 -1
- package/build/lib/components/AntdApp/index.js +2 -0
- package/build/lib/components/GlobalLoading/index.d.ts +6 -0
- package/build/lib/components/GlobalLoading/index.js +71 -0
- package/build/lib/components/IconFont/index.d.ts +1 -1
- package/build/lib/index.d.ts +1 -1
- package/build/package.json +1 -1
- package/build/types/components/GlobalLoading/index.d.ts +6 -0
- package/build/types/components/IconFont/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import React from 'react';
|
|
24
24
|
import { App, message as AntdMessage, notification as AntdNotification, Modal as AntdModal } from 'antd';
|
|
25
|
+
import GlobalLoading from './../GlobalLoading';
|
|
25
26
|
var message = AntdMessage;
|
|
26
27
|
var notification = AntdNotification;
|
|
27
28
|
var modal = AntdModal;
|
|
@@ -36,6 +37,7 @@ function InitApp(_a) {
|
|
|
36
37
|
function Index(_a) {
|
|
37
38
|
var children = _a.children, props = __rest(_a, ["children"]);
|
|
38
39
|
return (React.createElement(App, __assign({}, props),
|
|
40
|
+
React.createElement(GlobalLoading, null),
|
|
39
41
|
React.createElement(InitApp, null, children)));
|
|
40
42
|
}
|
|
41
43
|
export { message, notification, modal };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { CSSTransition } from 'react-transition-group';
|
|
3
|
+
import './index.less';
|
|
4
|
+
var setGlobalLoading = function (_value) {
|
|
5
|
+
console.warn('GlobalLoading 未被引入,你可以直接使用 App 组件,或直接引用 GlobalLoading 组件到项目中!');
|
|
6
|
+
};
|
|
7
|
+
function GlobalLoading() {
|
|
8
|
+
var ref = useRef(null);
|
|
9
|
+
var _a = useState(false), loading = _a[0], setLoading = _a[1];
|
|
10
|
+
useEffect(function () {
|
|
11
|
+
setGlobalLoading = function (value) {
|
|
12
|
+
setLoading(value);
|
|
13
|
+
};
|
|
14
|
+
}, []);
|
|
15
|
+
return (React.createElement(CSSTransition, { in: loading, nodeRef: ref, timeout: 500, classNames: "global-loading-transition", unmountOnExit: true }, function () {
|
|
16
|
+
return (React.createElement("div", { ref: ref, className: "global-loading" },
|
|
17
|
+
React.createElement("div", { className: "global-loading-container" },
|
|
18
|
+
React.createElement("div", { className: "dot dot-1" }),
|
|
19
|
+
React.createElement("div", { className: "dot dot-2" }),
|
|
20
|
+
React.createElement("div", { className: "dot dot-3" }),
|
|
21
|
+
React.createElement("div", { className: "dot dot-4" }),
|
|
22
|
+
React.createElement("div", { className: "dot dot-5" })),
|
|
23
|
+
React.createElement("svg", { style: {
|
|
24
|
+
visibility: 'hidden',
|
|
25
|
+
position: 'absolute'
|
|
26
|
+
} },
|
|
27
|
+
React.createElement("defs", null,
|
|
28
|
+
React.createElement("filter", { id: "goo" },
|
|
29
|
+
React.createElement("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "3", result: "blur" }),
|
|
30
|
+
React.createElement("feColorMatrix", { in: "blur", type: "matrix", values: "\n 1 0 0 0 0\n 0 1 0 0 0\n 0 0 1 0 0\n 0 0 0 18 -2" }),
|
|
31
|
+
React.createElement("feComposite", { in: "SourceGraphic", in2: "goo", operator: "atop" }))))));
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
export { setGlobalLoading };
|
|
35
|
+
export default GlobalLoading;
|
|
@@ -17,5 +17,5 @@ declare const IconFont: React.ForwardRefExoticComponent<((IconFontCommonProps &
|
|
|
17
17
|
symbol?: false;
|
|
18
18
|
}) | Omit<IconFontCommonProps & React.SVGProps<SVGSVGElement> & {
|
|
19
19
|
symbol: true;
|
|
20
|
-
}, "ref">) & React.RefAttributes<
|
|
20
|
+
}, "ref">) & React.RefAttributes<HTMLElement | SVGSVGElement>>;
|
|
21
21
|
export default IconFont;
|
|
@@ -28,6 +28,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
28
28
|
exports.modal = exports.notification = exports.message = void 0;
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var antd_1 = require("antd");
|
|
31
|
+
var GlobalLoading_1 = __importDefault(require("./../GlobalLoading"));
|
|
31
32
|
var message = antd_1.message;
|
|
32
33
|
exports.message = message;
|
|
33
34
|
var notification = antd_1.notification;
|
|
@@ -45,6 +46,7 @@ function InitApp(_a) {
|
|
|
45
46
|
function Index(_a) {
|
|
46
47
|
var children = _a.children, props = __rest(_a, ["children"]);
|
|
47
48
|
return (react_1.default.createElement(antd_1.App, __assign({}, props),
|
|
49
|
+
react_1.default.createElement(GlobalLoading_1.default, null),
|
|
48
50
|
react_1.default.createElement(InitApp, null, children)));
|
|
49
51
|
}
|
|
50
52
|
exports.default = Index;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.setGlobalLoading = void 0;
|
|
37
|
+
var react_1 = __importStar(require("react"));
|
|
38
|
+
var react_transition_group_1 = require("react-transition-group");
|
|
39
|
+
require("./index.less");
|
|
40
|
+
var setGlobalLoading = function (_value) {
|
|
41
|
+
console.warn('GlobalLoading 未被引入,你可以直接使用 App 组件,或直接引用 GlobalLoading 组件到项目中!');
|
|
42
|
+
};
|
|
43
|
+
exports.setGlobalLoading = setGlobalLoading;
|
|
44
|
+
function GlobalLoading() {
|
|
45
|
+
var ref = (0, react_1.useRef)(null);
|
|
46
|
+
var _a = (0, react_1.useState)(false), loading = _a[0], setLoading = _a[1];
|
|
47
|
+
(0, react_1.useEffect)(function () {
|
|
48
|
+
exports.setGlobalLoading = setGlobalLoading = function (value) {
|
|
49
|
+
setLoading(value);
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
52
|
+
return (react_1.default.createElement(react_transition_group_1.CSSTransition, { in: loading, nodeRef: ref, timeout: 500, classNames: "global-loading-transition", unmountOnExit: true }, function () {
|
|
53
|
+
return (react_1.default.createElement("div", { ref: ref, className: "global-loading" },
|
|
54
|
+
react_1.default.createElement("div", { className: "global-loading-container" },
|
|
55
|
+
react_1.default.createElement("div", { className: "dot dot-1" }),
|
|
56
|
+
react_1.default.createElement("div", { className: "dot dot-2" }),
|
|
57
|
+
react_1.default.createElement("div", { className: "dot dot-3" }),
|
|
58
|
+
react_1.default.createElement("div", { className: "dot dot-4" }),
|
|
59
|
+
react_1.default.createElement("div", { className: "dot dot-5" })),
|
|
60
|
+
react_1.default.createElement("svg", { style: {
|
|
61
|
+
visibility: 'hidden',
|
|
62
|
+
position: 'absolute'
|
|
63
|
+
} },
|
|
64
|
+
react_1.default.createElement("defs", null,
|
|
65
|
+
react_1.default.createElement("filter", { id: "goo" },
|
|
66
|
+
react_1.default.createElement("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "3", result: "blur" }),
|
|
67
|
+
react_1.default.createElement("feColorMatrix", { in: "blur", type: "matrix", values: "\n 1 0 0 0 0\n 0 1 0 0 0\n 0 0 1 0 0\n 0 0 0 18 -2" }),
|
|
68
|
+
react_1.default.createElement("feComposite", { in: "SourceGraphic", in2: "goo", operator: "atop" }))))));
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
exports.default = GlobalLoading;
|
|
@@ -17,5 +17,5 @@ declare const IconFont: React.ForwardRefExoticComponent<((IconFontCommonProps &
|
|
|
17
17
|
symbol?: false;
|
|
18
18
|
}) | Omit<IconFontCommonProps & React.SVGProps<SVGSVGElement> & {
|
|
19
19
|
symbol: true;
|
|
20
|
-
}, "ref">) & React.RefAttributes<
|
|
20
|
+
}, "ref">) & React.RefAttributes<HTMLElement | SVGSVGElement>>;
|
|
21
21
|
export default IconFont;
|
package/build/lib/index.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export declare const IconFont: React_2.ForwardRefExoticComponent<((IconFontCommo
|
|
|
96
96
|
symbol?: false;
|
|
97
97
|
}) | Omit<IconFontCommonProps & React_2.SVGProps<SVGSVGElement> & {
|
|
98
98
|
symbol: true;
|
|
99
|
-
}, "ref">) & React_2.RefAttributes<
|
|
99
|
+
}, "ref">) & React_2.RefAttributes<HTMLElement | SVGSVGElement>>;
|
|
100
100
|
|
|
101
101
|
declare interface IconFontCommonProps {
|
|
102
102
|
/**
|
package/build/package.json
CHANGED
|
@@ -17,5 +17,5 @@ declare const IconFont: React.ForwardRefExoticComponent<((IconFontCommonProps &
|
|
|
17
17
|
symbol?: false;
|
|
18
18
|
}) | Omit<IconFontCommonProps & React.SVGProps<SVGSVGElement> & {
|
|
19
19
|
symbol: true;
|
|
20
|
-
}, "ref">) & React.RefAttributes<
|
|
20
|
+
}, "ref">) & React.RefAttributes<HTMLElement | SVGSVGElement>>;
|
|
21
21
|
export default IconFont;
|