@cloud-app-dev/vidc 2.0.0-alpha.1 → 2.0.0-alpha.13
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/.umirc.ts +2 -3
- package/es/Api/index.d.ts +3 -4
- package/es/Api/index.js +7 -8
- package/es/AppRedirect/index.css +0 -0
- package/es/AppRedirect/index.d.ts +16 -0
- package/es/AppRedirect/index.js +34 -0
- package/es/AppRoute/index.d.ts +10 -0
- package/es/AppRoute/index.js +115 -0
- package/es/AppRoute/interface.d.ts +8 -0
- package/es/Auth/index.d.ts +8 -0
- package/es/Auth/index.js +17 -0
- package/es/AutoExit/index.js +15 -10
- package/es/Box/BetweenBox/index.css +5 -0
- package/es/Box/BetweenBox/index.d.ts +12 -0
- package/es/Box/BetweenBox/index.js +24 -0
- package/es/Box/InfoBox/index.css +23 -0
- package/es/Box/InfoBox/index.d.ts +12 -0
- package/es/Box/InfoBox/index.js +26 -0
- package/es/Box/TwoColumnBox/index.css +77 -0
- package/es/Box/TwoColumnBox/index.d.ts +10 -0
- package/es/Box/TwoColumnBox/index.js +50 -0
- package/es/Box/deps/content-grid.d.ts +9 -0
- package/es/Box/deps/content-grid.js +9 -0
- package/es/Box/deps/grid-factory.d.ts +10 -0
- package/es/Box/deps/grid-factory.js +72 -0
- package/es/Box/deps/simple-grid.d.ts +9 -0
- package/es/Box/deps/simple-grid.js +8 -0
- package/es/Box/index.css +9 -0
- package/es/Box/index.d.ts +14 -0
- package/es/Box/index.js +28 -0
- package/es/CheckGroupFixed/index.css +49 -0
- package/es/CheckGroupFixed/index.d.ts +17 -0
- package/es/CheckGroupFixed/index.js +148 -0
- package/es/Config/index.js +63 -6
- package/es/Config/interface.d.ts +30 -5
- package/es/Config/utils.d.ts +2 -11
- package/es/Config/utils.js +1 -12
- package/es/ConfigContext/index.d.ts +3 -0
- package/es/DeviceIcon/icon.js +5 -5
- package/es/DeviceIcon/index.js +2 -2
- package/es/DeviceSelect/TreeType.d.ts +6 -0
- package/es/DeviceSelect/TreeType.js +36 -0
- package/es/DeviceSelect/demo.js +2 -2
- package/es/DeviceSelect/index.css +6 -1
- package/es/DeviceSelect/index.d.ts +5 -0
- package/es/DeviceSelect/index.js +22 -53
- package/es/Dict/cache.d.ts +3 -0
- package/es/Dict/cache.js +21 -0
- package/es/Dict/desc.d.ts +64 -0
- package/es/Dict/desc.js +162 -0
- package/es/Dict/device.d.ts +28 -0
- package/es/Dict/device.js +117 -0
- package/es/Dict/hook.d.ts +4 -0
- package/es/Dict/hook.js +114 -0
- package/es/Dict/index.d.ts +13 -0
- package/es/Dict/index.js +14 -0
- package/es/Dict/interface.d.ts +16 -0
- package/es/Dict/utils.d.ts +11 -0
- package/es/Dict/utils.js +51 -0
- package/es/Drag/DragAndDropItem.d.ts +4 -0
- package/es/Drag/DragAndDropItem.js +145 -0
- package/es/Drag/DropItem.d.ts +4 -0
- package/es/Drag/DropItem.js +54 -0
- package/es/Drag/index.css +0 -0
- package/es/Drag/index.d.ts +7 -0
- package/es/Drag/index.js +7 -0
- package/es/Drag/interface.d.ts +16 -0
- package/es/Drawer/Demo.d.ts +3 -0
- package/es/Drawer/Demo.js +52 -0
- package/es/Drawer/Footer.d.ts +4 -0
- package/es/Drawer/Footer.js +26 -0
- package/es/Drawer/index.css +39 -0
- package/es/Drawer/index.d.ts +12 -0
- package/es/Drawer/index.js +41 -0
- package/es/Drawer/interface.d.ts +191 -0
- package/es/FullScreen/index.css +16 -0
- package/es/FullScreen/index.d.ts +10 -0
- package/es/FullScreen/index.js +68 -0
- package/es/HightLevel/index.css +3 -0
- package/es/HightLevel/index.d.ts +9 -0
- package/es/HightLevel/index.js +23 -0
- package/es/IconFont/index.d.ts +12 -0
- package/es/IconFont/index.js +57 -0
- package/es/ImageView/index.css +6 -0
- package/es/ImageView/index.d.ts +17 -0
- package/es/ImageView/index.js +58 -0
- package/es/InitialConfig/index.js +7 -11
- package/es/InitialConfig/utils.d.ts +1 -1
- package/es/InitialConfig/utils.js +8 -31
- package/es/InitialRequest/index.d.ts +1 -1
- package/es/InitialRequest/index.js +19 -11
- package/es/InitialRequest/utils.d.ts +5 -4
- package/es/InitialRequest/utils.js +58 -94
- package/es/Input/index.css +8 -0
- package/es/Input/index.d.ts +18 -0
- package/es/Input/index.js +76 -0
- package/es/LabelValue/index.css +18 -0
- package/es/LabelValue/index.d.ts +23 -0
- package/es/LabelValue/index.js +32 -0
- package/es/{DynamicDeviceList → List}/CheckExt.d.ts +0 -0
- package/es/{DynamicDeviceList → List}/CheckExt.js +4 -4
- package/es/List/DeviceList/index.css +0 -0
- package/es/List/DeviceList/index.d.ts +11 -0
- package/es/{DeviceList → List/DeviceList}/index.js +8 -20
- package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
- package/es/List/DynamicDeviceList/Demo.js +54 -0
- package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
- package/es/List/DynamicDeviceList/index.d.ts +11 -0
- package/es/List/DynamicDeviceList/index.js +205 -0
- package/es/List/DynamicDeviceList/interface.d.ts +37 -0
- package/es/List/DynamicDeviceList/utils.d.ts +16 -0
- package/es/List/DynamicDeviceList/utils.js +61 -0
- package/es/List/DynamicGridList/Demo.d.ts +2 -0
- package/es/List/DynamicGridList/Demo.js +70 -0
- package/es/List/DynamicGridList/index.d.ts +26 -0
- package/es/List/DynamicGridList/index.js +73 -0
- package/es/List/GridList/Demo.d.ts +2 -0
- package/es/List/GridList/Demo.js +91 -0
- package/es/List/GridList/hook.d.ts +13 -0
- package/es/List/GridList/hook.js +301 -0
- package/es/List/GridList/index.css +7 -0
- package/es/List/GridList/index.d.ts +15 -0
- package/es/List/GridList/index.js +47 -0
- package/es/List/GridList/interface.d.ts +59 -0
- package/es/List/GridList/utils.d.ts +9 -0
- package/es/List/GridList/utils.js +43 -0
- package/es/List/ListExt/index.css +3 -0
- package/es/List/ListExt/index.d.ts +19 -0
- package/es/List/ListExt/index.js +44 -0
- package/es/List/VList/index.css +6 -0
- package/es/List/VList/index.d.ts +18 -0
- package/es/List/VList/index.js +51 -0
- package/es/List/VList/utils.d.ts +14 -0
- package/es/List/VList/utils.js +17 -0
- package/es/List/index.css +60 -5
- package/es/List/index.d.ts +10 -13
- package/es/List/index.js +170 -36
- package/es/List/interface.d.ts +87 -0
- package/es/List/renderItem.d.ts +20 -0
- package/es/List/renderItem.js +71 -0
- package/es/LoaderApp/index.css +3 -0
- package/es/LoaderApp/index.d.ts +31 -0
- package/es/LoaderApp/index.js +135 -0
- package/es/LoaderApp/interface.d.ts +6 -0
- package/es/LoaderApp/loader.d.ts +20 -0
- package/es/LoaderApp/loader.js +86 -0
- package/es/LoaderApp/utils.d.ts +13 -0
- package/es/LoaderApp/utils.js +121 -0
- package/es/LoaderScript/index.d.ts +26 -0
- package/es/LoaderScript/index.js +127 -0
- package/es/LoaderScript/interface.d.ts +26 -0
- package/es/LoaderScript/utils.d.ts +12 -0
- package/es/LoaderScript/utils.js +133 -0
- package/es/Modal/index.css +43 -0
- package/es/Modal/index.d.ts +17 -0
- package/es/Modal/index.js +34 -0
- package/es/Modal/interface.d.ts +339 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +7 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +94 -0
- package/es/Picture/component/DefaultRects/index.css +247 -0
- package/es/Picture/component/DefaultRects/index.d.ts +12 -0
- package/es/Picture/component/DefaultRects/index.js +47 -0
- package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
- package/es/Picture/component/DefaultRects/utils.js +11 -0
- package/es/Picture/component/DrawRect/index.css +8 -0
- package/es/Picture/component/DrawRect/index.d.ts +14 -0
- package/es/Picture/component/DrawRect/index.js +41 -0
- package/es/Picture/component/MoveContent/index.css +0 -0
- package/es/Picture/component/MoveContent/index.d.ts +39 -0
- package/es/Picture/component/MoveContent/index.js +240 -0
- package/es/Picture/component/MoveContent/utils.d.ts +4 -0
- package/es/Picture/component/MoveContent/utils.js +19 -0
- package/es/Picture/component/RectMenu/index.css +31 -0
- package/es/Picture/component/RectMenu/index.d.ts +13 -0
- package/es/Picture/component/RectMenu/index.js +81 -0
- package/es/Picture/component/RectMenu/utils.d.ts +12 -0
- package/es/Picture/component/RectMenu/utils.js +22 -0
- package/es/Picture/component/Tools/index.css +42 -0
- package/es/Picture/component/Tools/index.d.ts +13 -0
- package/es/Picture/component/Tools/index.js +83 -0
- package/es/Picture/component/WheelScale/index.d.ts +6 -0
- package/es/Picture/component/WheelScale/index.js +29 -0
- package/es/Picture/dragBound.d.ts +5 -0
- package/es/Picture/dragBound.js +77 -0
- package/es/Picture/index.css +12 -0
- package/es/Picture/index.d.ts +16 -0
- package/es/Picture/index.js +344 -0
- package/es/Picture/interface.d.ts +67 -0
- package/es/Picture/loadCaptureRectImage.d.ts +8 -0
- package/es/Picture/loadCaptureRectImage.js +119 -0
- package/es/Picture/useDraw.d.ts +1 -0
- package/es/Picture/useDraw.js +136 -0
- package/es/Picture/utils.d.ts +22 -0
- package/es/Picture/utils.js +90 -0
- package/es/Progress/index.css +20 -0
- package/es/Progress/index.d.ts +11 -0
- package/es/Progress/index.js +68 -0
- package/es/RefDrawer/index.js +4 -5
- package/es/RefModal/index.js +4 -5
- package/es/Service/http.d.ts +1 -1
- package/es/Service/http.js +2 -25
- package/es/TableLayout/index.css +4 -0
- package/es/TableLayout/index.d.ts +13 -0
- package/es/TableLayout/index.js +33 -0
- package/es/ThemeAntd/index.css +501 -0
- package/es/ThemeAntd/index.d.ts +7 -0
- package/es/ThemeAntd/index.js +6 -0
- package/es/ThemeAntd/style/button.css +46 -0
- package/es/ThemeAntd/style/checkbox.css +64 -0
- package/es/ThemeAntd/style/form.css +10 -0
- package/es/ThemeAntd/style/input.css +58 -0
- package/es/ThemeAntd/style/pagination.css +44 -0
- package/es/ThemeAntd/style/picker.css +86 -0
- package/es/ThemeAntd/style/popover.css +3 -0
- package/es/ThemeAntd/style/radio.css +71 -0
- package/es/ThemeAntd/style/scrollbar.css +19 -0
- package/es/ThemeAntd/style/select.css +57 -0
- package/es/ThemeAntd/style/table.css +36 -0
- package/es/ThemeAntd/style/tree.css +4 -0
- package/es/{TreeTitle → Title}/index.css +5 -5
- package/es/{TreeTitle → Title}/index.d.ts +2 -2
- package/es/{TreeTitle → Title}/index.js +9 -6
- package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
- package/es/Tree/BaseTree/demo.js +69 -0
- package/es/Tree/BaseTree/index.css +64 -0
- package/es/Tree/BaseTree/index.d.ts +24 -0
- package/es/Tree/BaseTree/index.js +83 -0
- package/es/Tree/demo.d.ts +2 -0
- package/es/{TreeMode → Tree}/demo.js +0 -0
- package/es/{TreeMode → Tree}/index.css +1 -1
- package/es/{TreeMode → Tree}/index.d.ts +1 -1
- package/es/{TreeMode → Tree}/index.js +9 -12
- package/es/UserSelect/index.d.ts +3 -3
- package/es/UserSelect/index.js +18 -15
- package/es/WorkerFlow/Form/Condition.js +6 -8
- package/es/WorkerFlow/Form/EmptyUserSet.js +4 -6
- package/es/WorkerFlow/Form/FormAuth.js +3 -3
- package/es/WorkerFlow/Form/GroupList.js +2 -2
- package/es/WorkerFlow/Form/GroupSelect.js +4 -6
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +8 -7
- package/es/WorkerFlow/Form/LevelGroupSelect.js +5 -7
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +4 -6
- package/es/WorkerFlow/Form/UserSelect.js +4 -6
- package/es/WorkerFlow/Form/UserSelectModalContent.js +8 -6
- package/es/WorkerFlow/Form/UserSet.js +3 -3
- package/es/WorkerFlow/Nodes/Add.js +2 -3
- package/es/WorkerFlow/Nodes/AddOption.js +2 -2
- package/es/WorkerFlow/Nodes/Approver.js +2 -2
- package/es/WorkerFlow/Nodes/Condition.js +2 -2
- package/es/WorkerFlow/Nodes/Handle.js +2 -2
- package/es/WorkerFlow/Nodes/Notifier.js +2 -2
- package/es/WorkerFlow/Nodes/TitleElement.js +70 -36
- package/es/WorkerFlow/index.css +9 -3
- package/es/WorkerFlow/index.js +3 -3
- package/es/WorkerFlow/utils.js +2 -2
- package/es/core.d.ts +27 -0
- package/es/index.d.ts +27 -4
- package/es/index.js +27 -4
- package/es/useDrawer/index.d.ts +14 -0
- package/es/useDrawer/index.js +91 -0
- package/es/useHttp/index.d.ts +8 -0
- package/es/useHttp/index.js +78 -0
- package/es/useModal/index.d.ts +14 -0
- package/es/useModal/index.js +93 -0
- package/es/useNavigate/index.css +0 -0
- package/es/useNavigate/index.d.ts +4 -0
- package/es/useNavigate/index.js +14 -0
- package/es/utils.d.ts +11 -0
- package/es/utils.js +68 -1
- package/package.json +10 -8
- package/es/DeviceList/index.css +0 -32
- package/es/DeviceList/index.d.ts +0 -14
- package/es/DynamicDeviceList/Demo.js +0 -17
- package/es/DynamicDeviceList/index.d.ts +0 -35
- package/es/DynamicDeviceList/index.js +0 -224
- package/es/DynamicDeviceList/utils.d.ts +0 -2
- package/es/DynamicDeviceList/utils.js +0 -15
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AppInstance } from './interface';
|
|
2
|
+
interface createScopedCssText {
|
|
3
|
+
styleNode: HTMLStyleElement;
|
|
4
|
+
prefix: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function createScopedCssText({ styleNode, prefix }: createScopedCssText): string;
|
|
7
|
+
interface ILoaderStyleProps {
|
|
8
|
+
style: string;
|
|
9
|
+
prefix: string;
|
|
10
|
+
styleNode: HTMLStyleElement;
|
|
11
|
+
}
|
|
12
|
+
export declare function LoaderStyle({ style, prefix, styleNode }: ILoaderStyleProps): Promise<void>;
|
|
13
|
+
interface ILoaderModuleProps {
|
|
14
|
+
script: string;
|
|
15
|
+
style: string;
|
|
16
|
+
prefix: string;
|
|
17
|
+
styleNode: HTMLStyleElement;
|
|
18
|
+
}
|
|
19
|
+
export default function LoaderModule({ script, style, prefix, styleNode }: ILoaderModuleProps): Promise<AppInstance>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { arrayify, rewrite } from './utils';
|
|
3
|
+
var _global = window;
|
|
4
|
+
export function createScopedCssText(_ref) {
|
|
5
|
+
var styleNode = _ref.styleNode,
|
|
6
|
+
prefix = _ref.prefix;
|
|
7
|
+
|
|
8
|
+
var _a;
|
|
9
|
+
|
|
10
|
+
var sheet = styleNode.sheet;
|
|
11
|
+
var rules = arrayify((_a = sheet === null || sheet === void 0 ? void 0 : sheet.cssRules) !== null && _a !== void 0 ? _a : []);
|
|
12
|
+
return rewrite(rules, prefix);
|
|
13
|
+
}
|
|
14
|
+
export function LoaderStyle(_ref2) {
|
|
15
|
+
var style = _ref2.style,
|
|
16
|
+
prefix = _ref2.prefix,
|
|
17
|
+
styleNode = _ref2.styleNode;
|
|
18
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
19
|
+
var cssText, textNode, scopeCssText;
|
|
20
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
21
|
+
while (1) {
|
|
22
|
+
switch (_context.prev = _context.next) {
|
|
23
|
+
case 0:
|
|
24
|
+
if (!style) {
|
|
25
|
+
_context.next = 9;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_context.next = 3;
|
|
30
|
+
return fetch(style).then(function (r) {
|
|
31
|
+
return r.text();
|
|
32
|
+
}).catch(function () {
|
|
33
|
+
return '';
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
case 3:
|
|
37
|
+
cssText = _context.sent;
|
|
38
|
+
textNode = document.createTextNode(cssText || '');
|
|
39
|
+
styleNode.appendChild(textNode);
|
|
40
|
+
scopeCssText = createScopedCssText({
|
|
41
|
+
prefix: prefix,
|
|
42
|
+
styleNode: styleNode
|
|
43
|
+
});
|
|
44
|
+
styleNode.textContent = scopeCssText;
|
|
45
|
+
textNode.remove();
|
|
46
|
+
|
|
47
|
+
case 9:
|
|
48
|
+
case "end":
|
|
49
|
+
return _context.stop();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}, _callee);
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
export default function LoaderModule(_ref3) {
|
|
56
|
+
var script = _ref3.script,
|
|
57
|
+
style = _ref3.style,
|
|
58
|
+
prefix = _ref3.prefix,
|
|
59
|
+
styleNode = _ref3.styleNode;
|
|
60
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
61
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
62
|
+
while (1) {
|
|
63
|
+
switch (_context2.prev = _context2.next) {
|
|
64
|
+
case 0:
|
|
65
|
+
_context2.next = 2;
|
|
66
|
+
return LoaderStyle({
|
|
67
|
+
style: style,
|
|
68
|
+
prefix: prefix,
|
|
69
|
+
styleNode: styleNode
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
case 2:
|
|
73
|
+
_context2.next = 4;
|
|
74
|
+
return _global.System.import(script);
|
|
75
|
+
|
|
76
|
+
case 4:
|
|
77
|
+
return _context2.abrupt("return", _context2.sent);
|
|
78
|
+
|
|
79
|
+
case 5:
|
|
80
|
+
case "end":
|
|
81
|
+
return _context2.stop();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, _callee2);
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppItemType } from '../Config/interface';
|
|
2
|
+
export declare const getMicroConfig: (appConfig: AppItemType, appProps: any, container: HTMLDivElement) => {
|
|
3
|
+
name: string;
|
|
4
|
+
container: HTMLDivElement;
|
|
5
|
+
props: any;
|
|
6
|
+
entry: {
|
|
7
|
+
scripts: string[];
|
|
8
|
+
styles: string[];
|
|
9
|
+
html: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const arrayify: <T>(list: CSSRuleList | any[]) => T[];
|
|
13
|
+
export declare function rewrite(rules: CSSRule[], prefix?: string): string;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export var getMicroConfig = function getMicroConfig() {
|
|
2
|
+
var appConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3
|
+
var appProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
4
|
+
var container = arguments.length > 2 ? arguments[2] : undefined;
|
|
5
|
+
var routerPrefix = appConfig.routerPrefix,
|
|
6
|
+
resource = appConfig.resource;
|
|
7
|
+
var microAppEntry = {
|
|
8
|
+
scripts: [resource[0]],
|
|
9
|
+
styles: [resource[1]],
|
|
10
|
+
html: "<div id=\"".concat(routerPrefix, "\" style=\"height:100%\"></div>")
|
|
11
|
+
};
|
|
12
|
+
return {
|
|
13
|
+
name: routerPrefix,
|
|
14
|
+
container: container,
|
|
15
|
+
props: appProps,
|
|
16
|
+
entry: microAppEntry
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
var RuleType = {
|
|
20
|
+
// type: rule will be rewrote
|
|
21
|
+
STYLE: 1,
|
|
22
|
+
MEDIA: 4,
|
|
23
|
+
SUPPORTS: 12,
|
|
24
|
+
// type: value will be kept
|
|
25
|
+
IMPORT: 3,
|
|
26
|
+
FONT_FACE: 5,
|
|
27
|
+
PAGE: 6,
|
|
28
|
+
KEYFRAMES: 7,
|
|
29
|
+
KEYFRAME: 8
|
|
30
|
+
};
|
|
31
|
+
export var arrayify = function arrayify(list) {
|
|
32
|
+
return [].slice.call(list, 0);
|
|
33
|
+
};
|
|
34
|
+
export function rewrite(rules) {
|
|
35
|
+
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
36
|
+
var css = '';
|
|
37
|
+
rules.forEach(function (rule) {
|
|
38
|
+
switch (rule.type) {
|
|
39
|
+
case RuleType.STYLE:
|
|
40
|
+
css += ruleStyle(rule, prefix);
|
|
41
|
+
break;
|
|
42
|
+
|
|
43
|
+
case RuleType.MEDIA:
|
|
44
|
+
css += ruleMedia(rule, prefix);
|
|
45
|
+
break;
|
|
46
|
+
|
|
47
|
+
case RuleType.SUPPORTS:
|
|
48
|
+
css += ruleSupport(rule, prefix);
|
|
49
|
+
break;
|
|
50
|
+
|
|
51
|
+
default:
|
|
52
|
+
css += "".concat(rule.cssText);
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return css;
|
|
57
|
+
} // handle case:
|
|
58
|
+
// .app-main {}
|
|
59
|
+
// html, body {}
|
|
60
|
+
// eslint-disable-next-line class-methods-use-this
|
|
61
|
+
|
|
62
|
+
function ruleStyle(rule, prefix) {
|
|
63
|
+
var rootSelectorRE = /((?:[^\w\-.#]|^)(body|html|:root))/gm;
|
|
64
|
+
var rootCombinationRE = /(html[^\w{[]+)/gm;
|
|
65
|
+
var selector = rule.selectorText.trim();
|
|
66
|
+
var cssText = rule.cssText; // handle html { ... }
|
|
67
|
+
// handle body { ... }
|
|
68
|
+
// handle :root { ... }
|
|
69
|
+
|
|
70
|
+
if (selector === 'html' || selector === 'body' || selector === ':root') {
|
|
71
|
+
return cssText.replace(rootSelectorRE, prefix);
|
|
72
|
+
} // handle html body { ... }
|
|
73
|
+
// handle html > body { ... }
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
if (rootCombinationRE.test(rule.selectorText)) {
|
|
77
|
+
var siblingSelectorRE = /(html[^\w{]+)(\+|~)/gm; // since html + body is a non-standard rule for html
|
|
78
|
+
// transformer will ignore it
|
|
79
|
+
|
|
80
|
+
if (!siblingSelectorRE.test(rule.selectorText)) {
|
|
81
|
+
cssText = cssText.replace(rootCombinationRE, '');
|
|
82
|
+
}
|
|
83
|
+
} // handle grouping selector, a,span,p,div { ... }
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
cssText = cssText.replace(/^[\s\S]+{/, function (selectors) {
|
|
87
|
+
return selectors.replace(/(^|,\n?)([^,]+)/g, function (item, p, s) {
|
|
88
|
+
// handle div,body,span { ... }
|
|
89
|
+
if (rootSelectorRE.test(item)) {
|
|
90
|
+
return item.replace(rootSelectorRE, function (m) {
|
|
91
|
+
// do not discard valid previous character, such as body,html or *:not(:root)
|
|
92
|
+
var whitePrevChars = [',', '('];
|
|
93
|
+
|
|
94
|
+
if (m && whitePrevChars.includes(m[0])) {
|
|
95
|
+
return "".concat(m[0]).concat(prefix);
|
|
96
|
+
} // replace root selector with prefix
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
return prefix;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return "".concat(p).concat(prefix, " ").concat(s.replace(/^ */, ''));
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
return cssText;
|
|
107
|
+
} // handle case:
|
|
108
|
+
// @media screen and (max-width: 300px) {}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
function ruleMedia(rule, prefix) {
|
|
112
|
+
var css = rewrite(arrayify(rule.cssRules), prefix);
|
|
113
|
+
return "@media ".concat(rule.conditionText, " {").concat(css, "}");
|
|
114
|
+
} // handle case:
|
|
115
|
+
// @supports (display: grid) {}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
function ruleSupport(rule, prefix) {
|
|
119
|
+
var css = rewrite(arrayify(rule.cssRules), prefix);
|
|
120
|
+
return "@supports ".concat(rule.conditionText, " {").concat(css, "}");
|
|
121
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IOptionsLoader } from './interface';
|
|
3
|
+
export interface ILoaderProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 脚本加载数据源
|
|
6
|
+
* @default []
|
|
7
|
+
*/
|
|
8
|
+
options: IOptionsLoader[];
|
|
9
|
+
/**
|
|
10
|
+
* @description 加载后初始化组件
|
|
11
|
+
* @default null
|
|
12
|
+
*/
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* @description 加载后初始化组件
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
Spin?: React.ReactNode | null;
|
|
19
|
+
/**
|
|
20
|
+
* @description 加载完成触发事件
|
|
21
|
+
* @default -
|
|
22
|
+
*/
|
|
23
|
+
onLoadEnd?: () => Promise<null>;
|
|
24
|
+
}
|
|
25
|
+
declare function LoaderScripts({ options, children, Spin, onLoadEnd }: ILoaderProps): JSX.Element;
|
|
26
|
+
export default LoaderScripts;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import { __asyncValues, __awaiter } from "tslib";
|
|
14
|
+
import React, { useEffect, useState } from 'react';
|
|
15
|
+
import { createAsyncIterable } from './utils';
|
|
16
|
+
import { nextTick, tryCatch } from '../utils';
|
|
17
|
+
|
|
18
|
+
function LoaderScripts(_ref) {
|
|
19
|
+
var _this = this;
|
|
20
|
+
|
|
21
|
+
var _ref$options = _ref.options,
|
|
22
|
+
options = _ref$options === void 0 ? [] : _ref$options,
|
|
23
|
+
children = _ref.children,
|
|
24
|
+
_ref$Spin = _ref.Spin,
|
|
25
|
+
Spin = _ref$Spin === void 0 ? null : _ref$Spin,
|
|
26
|
+
onLoadEnd = _ref.onLoadEnd;
|
|
27
|
+
|
|
28
|
+
var _useState = useState(false),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
initStatus = _useState2[0],
|
|
31
|
+
setInitStatus = _useState2[1];
|
|
32
|
+
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
if (options.length === 0) {
|
|
35
|
+
return setInitStatus(true);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var asyncIter = createAsyncIterable(options);
|
|
39
|
+
tryCatch(function () {
|
|
40
|
+
return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
41
|
+
var e_1, _a, asyncIter_1, asyncIter_1_1, x;
|
|
42
|
+
|
|
43
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
44
|
+
while (1) {
|
|
45
|
+
switch (_context.prev = _context.next) {
|
|
46
|
+
case 0:
|
|
47
|
+
_context.prev = 0;
|
|
48
|
+
asyncIter_1 = __asyncValues(asyncIter);
|
|
49
|
+
|
|
50
|
+
case 2:
|
|
51
|
+
_context.next = 4;
|
|
52
|
+
return asyncIter_1.next();
|
|
53
|
+
|
|
54
|
+
case 4:
|
|
55
|
+
asyncIter_1_1 = _context.sent;
|
|
56
|
+
|
|
57
|
+
if (asyncIter_1_1.done) {
|
|
58
|
+
_context.next = 10;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
x = asyncIter_1_1.value;
|
|
63
|
+
console.log('加载完成!', options[x]);
|
|
64
|
+
|
|
65
|
+
case 8:
|
|
66
|
+
_context.next = 2;
|
|
67
|
+
break;
|
|
68
|
+
|
|
69
|
+
case 10:
|
|
70
|
+
_context.next = 15;
|
|
71
|
+
break;
|
|
72
|
+
|
|
73
|
+
case 12:
|
|
74
|
+
_context.prev = 12;
|
|
75
|
+
_context.t0 = _context["catch"](0);
|
|
76
|
+
e_1 = {
|
|
77
|
+
error: _context.t0
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
case 15:
|
|
81
|
+
_context.prev = 15;
|
|
82
|
+
_context.prev = 16;
|
|
83
|
+
|
|
84
|
+
if (!(asyncIter_1_1 && !asyncIter_1_1.done && (_a = asyncIter_1.return))) {
|
|
85
|
+
_context.next = 20;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
_context.next = 20;
|
|
90
|
+
return _a.call(asyncIter_1);
|
|
91
|
+
|
|
92
|
+
case 20:
|
|
93
|
+
_context.prev = 20;
|
|
94
|
+
|
|
95
|
+
if (!e_1) {
|
|
96
|
+
_context.next = 23;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
throw e_1.error;
|
|
101
|
+
|
|
102
|
+
case 23:
|
|
103
|
+
return _context.finish(20);
|
|
104
|
+
|
|
105
|
+
case 24:
|
|
106
|
+
return _context.finish(15);
|
|
107
|
+
|
|
108
|
+
case 25:
|
|
109
|
+
nextTick(function () {
|
|
110
|
+
return onLoadEnd ? onLoadEnd().then(function () {
|
|
111
|
+
return setInitStatus(true);
|
|
112
|
+
}) : setInitStatus(true);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
case 26:
|
|
116
|
+
case "end":
|
|
117
|
+
return _context.stop();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, _callee, null, [[0, 12, 15, 25], [16,, 20, 24]]);
|
|
121
|
+
}));
|
|
122
|
+
});
|
|
123
|
+
}, [options]);
|
|
124
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !initStatus ? Spin : children);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export default LoaderScripts;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IOptionsLoader {
|
|
4
|
+
scripts?: string[];
|
|
5
|
+
styles?: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface ILoaderProps {
|
|
8
|
+
/**
|
|
9
|
+
* @description 脚本加载数据源
|
|
10
|
+
* @default []
|
|
11
|
+
* @type {scripts?:string[],styles?:string[]}
|
|
12
|
+
*/
|
|
13
|
+
options: IOptionsLoader[];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @description 加载后初始化组件
|
|
17
|
+
* @default null
|
|
18
|
+
*/
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @description 加载后初始化组件
|
|
23
|
+
* @default null
|
|
24
|
+
*/
|
|
25
|
+
Spin?: React.ReactNode | null;
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IOptionsLoader } from './interface';
|
|
2
|
+
export declare const loadScript: (url: string) => Promise<unknown>;
|
|
3
|
+
export declare const loaderCss: (href: string) => Promise<unknown>;
|
|
4
|
+
export declare function createAsyncIterable(options: IOptionsLoader[]): {
|
|
5
|
+
[Symbol.asyncIterator](): {
|
|
6
|
+
i: number;
|
|
7
|
+
next(): Promise<{
|
|
8
|
+
value: number;
|
|
9
|
+
done: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
|
+
|
|
15
|
+
import { __awaiter } from "tslib";
|
|
16
|
+
var global = window;
|
|
17
|
+
|
|
18
|
+
if (!global._LOADER_SCRIPT_URL) {
|
|
19
|
+
global._LOADER_SCRIPT_URL = {};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export var loadScript = function loadScript(url) {
|
|
23
|
+
return new Promise(function (resolve, reject) {
|
|
24
|
+
if (global._LOADER_SCRIPT_URL[url]) {
|
|
25
|
+
resolve(null);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var script = document.createElement('script');
|
|
29
|
+
script.type = 'text/javascript';
|
|
30
|
+
|
|
31
|
+
script.onload = function () {
|
|
32
|
+
global._LOADER_SCRIPT_URL[url] = true;
|
|
33
|
+
resolve(null);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
script.onerror = function (err) {
|
|
37
|
+
reject(err);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
script.src = url;
|
|
41
|
+
document.head.appendChild(script);
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export var loaderCss = function loaderCss(href) {
|
|
45
|
+
return new Promise(function (resolve, reject) {
|
|
46
|
+
if (global._LOADER_SCRIPT_URL[href]) {
|
|
47
|
+
resolve(null);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var link = document.createElement('link');
|
|
51
|
+
link.rel = 'stylesheet';
|
|
52
|
+
link.href = href;
|
|
53
|
+
|
|
54
|
+
link.onload = function () {
|
|
55
|
+
global._LOADER_SCRIPT_URL[href] = true;
|
|
56
|
+
resolve(null);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
link.onerror = function (err) {
|
|
60
|
+
reject(err);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
document.head.appendChild(link);
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
export function createAsyncIterable(options) {
|
|
67
|
+
return _defineProperty({}, Symbol.asyncIterator, function () {
|
|
68
|
+
return {
|
|
69
|
+
i: 0,
|
|
70
|
+
next: function next() {
|
|
71
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
72
|
+
var param, arr;
|
|
73
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
74
|
+
while (1) {
|
|
75
|
+
switch (_context.prev = _context.next) {
|
|
76
|
+
case 0:
|
|
77
|
+
if (!(this.i < options.length)) {
|
|
78
|
+
_context.next = 12;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
param = options[this.i];
|
|
83
|
+
arr = [];
|
|
84
|
+
|
|
85
|
+
if (param.scripts && param.scripts.length > 0) {
|
|
86
|
+
arr.push.apply(arr, _toConsumableArray(param.scripts.map(function (v) {
|
|
87
|
+
return loadScript(v);
|
|
88
|
+
})));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (param.styles && param.styles.length > 0) {
|
|
92
|
+
arr.push.apply(arr, _toConsumableArray(param.styles.map(function (v) {
|
|
93
|
+
return loaderCss(v);
|
|
94
|
+
})));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!(arr.length > 0)) {
|
|
98
|
+
_context.next = 11;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
_context.next = 8;
|
|
103
|
+
return Promise.all(arr);
|
|
104
|
+
|
|
105
|
+
case 8:
|
|
106
|
+
return _context.abrupt("return", {
|
|
107
|
+
value: this.i++,
|
|
108
|
+
done: false
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
case 11:
|
|
112
|
+
return _context.abrupt("return", Promise.resolve({
|
|
113
|
+
value: this.i++,
|
|
114
|
+
done: false
|
|
115
|
+
}));
|
|
116
|
+
|
|
117
|
+
case 12:
|
|
118
|
+
return _context.abrupt("return", Promise.resolve({
|
|
119
|
+
value: this.i,
|
|
120
|
+
done: true
|
|
121
|
+
}));
|
|
122
|
+
|
|
123
|
+
case 13:
|
|
124
|
+
case "end":
|
|
125
|
+
return _context.stop();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}, _callee, this);
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.lm-modal-container.cloudapp-modal {
|
|
2
|
+
padding-bottom: 0;
|
|
3
|
+
color: inherit;
|
|
4
|
+
}
|
|
5
|
+
.lm-modal-container.cloudapp-modal .cloudapp-modal-content {
|
|
6
|
+
height: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
border-radius: var(--form-redius);
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
background-color: transparent;
|
|
12
|
+
}
|
|
13
|
+
.lm-modal-container.cloudapp-modal .cloudapp-modal-close .cloudapp-modal-close-x {
|
|
14
|
+
width: 48px;
|
|
15
|
+
height: 47px;
|
|
16
|
+
line-height: 48px;
|
|
17
|
+
}
|
|
18
|
+
.lm-modal-container.cloudapp-modal .cloudapp-modal-header {
|
|
19
|
+
padding: 12px 24px;
|
|
20
|
+
padding-right: 56px;
|
|
21
|
+
background: var(--modal-title-bg);
|
|
22
|
+
border-bottom-color: var(--modal-divider-color);
|
|
23
|
+
border-radius: 0;
|
|
24
|
+
color: inherit;
|
|
25
|
+
}
|
|
26
|
+
.lm-modal-container.cloudapp-modal .cloudapp-modal-header .cloudapp-modal-title {
|
|
27
|
+
color: inherit;
|
|
28
|
+
font-size: var(--fs-large);
|
|
29
|
+
}
|
|
30
|
+
.lm-modal-container.cloudapp-modal .cloudapp-modal-close {
|
|
31
|
+
color: inherit;
|
|
32
|
+
}
|
|
33
|
+
.lm-modal-container.cloudapp-modal .cloudapp-modal-body {
|
|
34
|
+
background: var(--modal-content-bg);
|
|
35
|
+
flex: 1;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
}
|
|
38
|
+
.lm-modal-container.cloudapp-modal .cloudapp-modal-footer {
|
|
39
|
+
padding: 12px 24px;
|
|
40
|
+
border-radius: 0;
|
|
41
|
+
background: var(--modal-footer-bg);
|
|
42
|
+
border-top-color: var(--modal-divider-color);
|
|
43
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ModalProps } from './interface';
|
|
2
|
+
import './index.less';
|
|
3
|
+
declare function Modal({ children, className, style, getContainer, ...props }: ModalProps): JSX.Element;
|
|
4
|
+
declare namespace Modal {
|
|
5
|
+
var defaultProps: {
|
|
6
|
+
className: string;
|
|
7
|
+
getContainer: boolean;
|
|
8
|
+
};
|
|
9
|
+
var info: import("antd/lib/modal/confirm").ModalFunc;
|
|
10
|
+
var success: import("antd/lib/modal/confirm").ModalFunc;
|
|
11
|
+
var error: import("antd/lib/modal/confirm").ModalFunc;
|
|
12
|
+
var warn: import("antd/lib/modal/confirm").ModalFunc;
|
|
13
|
+
var warning: import("antd/lib/modal/confirm").ModalFunc;
|
|
14
|
+
var confirm: import("antd/lib/modal/confirm").ModalFunc;
|
|
15
|
+
var destroyAll: () => void;
|
|
16
|
+
}
|
|
17
|
+
export default Modal;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "antd/lib/modal/style";
|
|
2
|
+
import _Modal from "antd/lib/modal";
|
|
3
|
+
import { __rest } from "tslib";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import "./index.css";
|
|
6
|
+
|
|
7
|
+
function Modal(_a) {
|
|
8
|
+
var children = _a.children,
|
|
9
|
+
className = _a.className,
|
|
10
|
+
style = _a.style,
|
|
11
|
+
getContainer = _a.getContainer,
|
|
12
|
+
props = __rest(_a, ["children", "className", "style", "getContainer"]);
|
|
13
|
+
|
|
14
|
+
return /*#__PURE__*/React.createElement(_Modal, Object.assign({
|
|
15
|
+
style: Object.assign(Object.assign({}, style), {
|
|
16
|
+
textAlign: 'left'
|
|
17
|
+
}),
|
|
18
|
+
getContainer: getContainer,
|
|
19
|
+
className: "lm-modal-container ".concat(className)
|
|
20
|
+
}, props), children);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
Modal.defaultProps = {
|
|
24
|
+
className: '',
|
|
25
|
+
getContainer: false
|
|
26
|
+
};
|
|
27
|
+
Modal.info = _Modal.info;
|
|
28
|
+
Modal.success = _Modal.success;
|
|
29
|
+
Modal.error = _Modal.error;
|
|
30
|
+
Modal.warn = _Modal.warn;
|
|
31
|
+
Modal.warning = _Modal.warning;
|
|
32
|
+
Modal.confirm = _Modal.confirm;
|
|
33
|
+
Modal.destroyAll = _Modal.destroyAll;
|
|
34
|
+
export default Modal;
|