@cloud-app-dev/vidc 2.2.0-alpha.1 → 2.2.0-alpha.5
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.js +1 -1
- package/es/DeviceSelect/index.js +1 -1
- package/es/Drawer/Demo.js +24 -3
- package/es/Drawer/index.d.ts +29 -4
- package/es/Drawer/index.js +155 -4
- package/es/FrontendPlayer/index.d.ts +2 -0
- package/es/FrontendPlayer/index.js +2 -0
- package/es/FullScreen/index.d.ts +3 -3
- package/es/FullScreen/index.js +18 -42
- package/es/HightLevel/index.js +1 -1
- package/es/List/GridList/index.js +0 -1
- package/es/Modal/index.d.ts +27 -1
- package/es/Modal/index.js +155 -1
- package/es/Picture/component/MoveContent/index.js +18 -14
- package/es/Picture/component/Tools/index.js +0 -5
- package/es/Picture/demo.d.ts +2 -0
- package/es/Picture/demo.js +16 -0
- package/es/Picture/index.js +2 -2
- package/es/Picture/utils.js +1 -1
- package/es/Player/api/index.js +1 -1
- package/es/Player/contraller_bar/contraller_event.js +1 -0
- package/es/Player/frontend_player.d.ts +1 -7
- package/es/Player/frontend_timeline.js +11 -14
- package/es/Player/index.d.ts +1 -3
- package/es/Player/index.js +1 -3
- package/es/Player/player.d.ts +15 -0
- package/es/Player/segment_player.d.ts +1 -5
- package/es/Player/single_player.js +4 -3
- package/es/PlayerExt/demo.d.ts +2 -0
- package/es/PlayerExt/demo.js +165 -0
- package/es/PlayerExt/index.css +13 -0
- package/es/PlayerExt/index.d.ts +42 -0
- package/es/PlayerExt/index.js +145 -0
- package/es/SegmentPlayer/index.d.ts +2 -0
- package/es/SegmentPlayer/index.js +2 -0
- package/es/Service/fetch-adapter.d.ts +12 -0
- package/es/Service/fetch-adapter.js +184 -0
- package/es/Service/http.d.ts +1 -1
- package/es/Service/http.js +4 -2
- package/es/Service/interface.d.ts +2 -1
- package/es/Tree/BaseTree/demo.js +3 -1
- package/es/UserSelect/index.js +1 -1
- package/es/WorkerFlow/Form/Condition.js +2 -1
- package/es/WorkerFlow/Form/EmptyUserSet.js +3 -2
- package/es/WorkerFlow/Form/FormAuth.js +1 -1
- package/es/WorkerFlow/Form/GroupSelect.js +3 -2
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +1 -1
- package/es/WorkerFlow/Form/LevelGroupSelect.js +3 -2
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +3 -2
- package/es/WorkerFlow/Form/UserSelect.js +3 -2
- package/es/WorkerFlow/Form/UserSelectModalContent.js +1 -1
- package/es/WorkerFlow/Form/UserSet.js +1 -1
- package/es/WorkerFlow/Nodes/TitleElement.js +6 -2
- package/es/WorkerFlow/index.js +3 -2
- package/es/WorkerFlow/utils.js +1 -1
- package/es/index.d.ts +3 -5
- package/es/index.js +4 -6
- package/es/typings.d.ts +1 -0
- package/package.json +11 -10
- package/tsconfig.json +4 -3
- package/typings/global.d.ts +4 -0
- package/es/AppRedirect/index.css +0 -0
- package/es/AppRedirect/index.d.ts +0 -17
- package/es/AppRedirect/index.js +0 -33
- package/es/RefDrawer/index.d.ts +0 -15
- package/es/RefDrawer/index.js +0 -71
- package/es/RefModal/index.d.ts +0 -15
- package/es/RefModal/index.js +0 -73
- package/es/useDrawer/index.d.ts +0 -14
- package/es/useDrawer/index.js +0 -91
- package/es/useModal/index.d.ts +0 -14
- package/es/useModal/index.js +0 -93
- package/typings.d.ts +0 -2
package/.umirc.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { defineConfig } from 'dumi';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
4
|
const token =
|
|
5
|
-
'eyJhbGciOiJIUzI1NiJ9.
|
|
5
|
+
'eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDExMDAwMDA5NiIsImV4dCI6MTY1NTI1OTQ3OTYyNSwidWlkIjoiMTAxMDAzMDAwMDAzIiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDEwMDIwMDAwODNdLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMTAwMDM1IiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjU0NjU0Njc5NjI1fQ.EE4w6MrRwc-iWpC9nSEmQylaqi-hhi-HAWH-VNBVAbk';
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
title: 'CloudApp VIDC',
|
|
@@ -32,14 +32,13 @@ export default defineConfig({
|
|
|
32
32
|
},
|
|
33
33
|
proxy: {
|
|
34
34
|
'/api': {
|
|
35
|
-
target: 'http://192.168.
|
|
35
|
+
target: 'http://192.168.100.9:2235',
|
|
36
36
|
changeOrigin: true,
|
|
37
37
|
onProxyReq(proxyReq: any) {
|
|
38
38
|
proxyReq.setHeader('authorization', token);
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
|
-
|
|
43
42
|
// mfsu: {
|
|
44
43
|
// development: {
|
|
45
44
|
// output: './.mfsu/dev',
|
package/es/Api/index.js
CHANGED
package/es/DeviceSelect/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
22
22
|
import TreeMode from '../Tree';
|
|
23
23
|
import DynamicDeviceList from '../List/DynamicDeviceList';
|
|
24
24
|
import DeviceList from '../List/DeviceList';
|
|
25
|
-
import { uniq, uniqBy } from 'lodash';
|
|
25
|
+
import { uniq, uniqBy } from 'lodash-es';
|
|
26
26
|
import TreeType from './TreeType';
|
|
27
27
|
import "./index.css";
|
|
28
28
|
|
package/es/Drawer/Demo.js
CHANGED
|
@@ -15,10 +15,13 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
15
15
|
|
|
16
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
17
|
|
|
18
|
-
import React, { useState } from 'react';
|
|
18
|
+
import React, { useRef, useState } from 'react';
|
|
19
19
|
import Drawer from './index';
|
|
20
20
|
|
|
21
21
|
var App = function App() {
|
|
22
|
+
var drawer = Drawer.useDrawer();
|
|
23
|
+
var ref = useRef();
|
|
24
|
+
|
|
22
25
|
var _useState = useState(false),
|
|
23
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
24
27
|
visible = _useState2[0],
|
|
@@ -34,7 +37,7 @@ var App = function App() {
|
|
|
34
37
|
|
|
35
38
|
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
36
39
|
prefixCls: "cloudapp"
|
|
37
|
-
}, /*#__PURE__*/React.createElement(_Button, {
|
|
40
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, {
|
|
38
41
|
type: "primary",
|
|
39
42
|
onClick: showDrawer
|
|
40
43
|
}, "Open"), /*#__PURE__*/React.createElement(Drawer, {
|
|
@@ -46,7 +49,25 @@ var App = function App() {
|
|
|
46
49
|
alert('确定!');
|
|
47
50
|
onClose();
|
|
48
51
|
}
|
|
49
|
-
}, /*#__PURE__*/React.createElement("p", null, "Some contents..."), /*#__PURE__*/React.createElement("p", null, "Some contents..."), /*#__PURE__*/React.createElement("p", null, "Some contents...")))
|
|
52
|
+
}, /*#__PURE__*/React.createElement("p", null, "Some contents..."), /*#__PURE__*/React.createElement("p", null, "Some contents..."), /*#__PURE__*/React.createElement("p", null, "Some contents..."))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, {
|
|
53
|
+
type: "primary",
|
|
54
|
+
onClick: function onClick() {
|
|
55
|
+
return drawer.open({
|
|
56
|
+
content: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "Some contents..."), /*#__PURE__*/React.createElement("p", null, "Some contents..."), /*#__PURE__*/React.createElement("p", null, "Some contents..."))
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}, "useDrawer")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, {
|
|
60
|
+
type: "primary",
|
|
61
|
+
onClick: function onClick() {
|
|
62
|
+
var _a;
|
|
63
|
+
|
|
64
|
+
return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.open({
|
|
65
|
+
content: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "Some contents..."), /*#__PURE__*/React.createElement("p", null, "Some contents..."), /*#__PURE__*/React.createElement("p", null, "Some contents..."))
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, "RefDrawer"), /*#__PURE__*/React.createElement(Drawer.RefDrawer, {
|
|
69
|
+
ref: ref
|
|
70
|
+
})));
|
|
50
71
|
};
|
|
51
72
|
|
|
52
73
|
export default App;
|
package/es/Drawer/index.d.ts
CHANGED
|
@@ -1,13 +1,38 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DrawerProps } from './interface';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import './index.less';
|
|
4
|
-
declare function
|
|
5
|
-
declare namespace
|
|
4
|
+
declare function Drawer({ style, getContainer, onClose, className, onOk, cancelText, okText, children, ...props }: DrawerProps): JSX.Element;
|
|
5
|
+
declare namespace Drawer {
|
|
6
6
|
var defaultProps: {
|
|
7
7
|
getContainer: boolean;
|
|
8
8
|
className: string;
|
|
9
9
|
cancelText: string;
|
|
10
10
|
okText: string;
|
|
11
11
|
};
|
|
12
|
+
var useDrawer: (prefixCls?: string) => {
|
|
13
|
+
open: (options: IUseDrawerHookState) => void;
|
|
14
|
+
close: () => void;
|
|
15
|
+
};
|
|
16
|
+
var RefDrawer: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<IRefDrawerMethodsProps>>;
|
|
17
|
+
}
|
|
18
|
+
export interface IUseDrawerHookState {
|
|
19
|
+
content?: React.ReactNode;
|
|
20
|
+
visible?: boolean;
|
|
21
|
+
title?: React.ReactNode;
|
|
22
|
+
onOk?: () => void;
|
|
23
|
+
width?: number | string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface IUseDrawerHookState {
|
|
27
|
+
content?: React.ReactNode;
|
|
28
|
+
visible?: boolean;
|
|
29
|
+
title?: React.ReactNode;
|
|
30
|
+
onOk?: () => void;
|
|
31
|
+
width?: number | string;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IRefDrawerMethodsProps {
|
|
35
|
+
open: (options: IUseDrawerHookState) => void;
|
|
36
|
+
close: () => void;
|
|
12
37
|
}
|
|
13
|
-
export default
|
|
38
|
+
export default Drawer;
|
package/es/Drawer/index.js
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
|
+
import "antd/lib/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/lib/config-provider";
|
|
1
3
|
import "antd/lib/drawer/style";
|
|
2
4
|
import _Drawer from "antd/lib/drawer";
|
|
5
|
+
|
|
6
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
+
|
|
8
|
+
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."); }
|
|
9
|
+
|
|
10
|
+
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); }
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
|
|
3
18
|
import { __rest } from "tslib";
|
|
4
|
-
import React from 'react';
|
|
5
19
|
import Footer from './Footer';
|
|
20
|
+
import React, { useContext, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
|
21
|
+
import * as ReactDOMClient from 'react-dom/client';
|
|
22
|
+
import CC from '../ConfigContext';
|
|
6
23
|
import "./index.css";
|
|
24
|
+
import ConfigContext from '../ConfigContext';
|
|
7
25
|
|
|
8
|
-
function
|
|
26
|
+
function Drawer(_a) {
|
|
9
27
|
var style = _a.style,
|
|
10
28
|
getContainer = _a.getContainer,
|
|
11
29
|
onClose = _a.onClose,
|
|
@@ -32,10 +50,143 @@ function ZVDrawer(_a) {
|
|
|
32
50
|
}, props), children);
|
|
33
51
|
}
|
|
34
52
|
|
|
35
|
-
|
|
53
|
+
Drawer.defaultProps = {
|
|
36
54
|
getContainer: false,
|
|
37
55
|
className: '',
|
|
38
56
|
cancelText: '取消',
|
|
39
57
|
okText: '确定'
|
|
40
58
|
};
|
|
41
|
-
|
|
59
|
+
|
|
60
|
+
function useDrawer() {
|
|
61
|
+
var prefixCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cloudapp';
|
|
62
|
+
var context = useContext(CC.Context);
|
|
63
|
+
var container = useMemo(function () {
|
|
64
|
+
var _a;
|
|
65
|
+
|
|
66
|
+
return (_a = context === null || context === void 0 ? void 0 : context.root) !== null && _a !== void 0 ? _a : document.body;
|
|
67
|
+
}, [context === null || context === void 0 ? void 0 : context.root]);
|
|
68
|
+
var div = useMemo(function () {
|
|
69
|
+
return document.createElement('div');
|
|
70
|
+
}, []);
|
|
71
|
+
|
|
72
|
+
var _useState = useState({
|
|
73
|
+
content: null,
|
|
74
|
+
visible: false,
|
|
75
|
+
title: '',
|
|
76
|
+
onOk: undefined,
|
|
77
|
+
width: undefined,
|
|
78
|
+
className: undefined
|
|
79
|
+
}),
|
|
80
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
81
|
+
state = _useState2[0],
|
|
82
|
+
setState = _useState2[1];
|
|
83
|
+
|
|
84
|
+
var root = useMemo(function () {
|
|
85
|
+
return ReactDOMClient.createRoot(div, {
|
|
86
|
+
onRecoverableError: console.error
|
|
87
|
+
});
|
|
88
|
+
}, []);
|
|
89
|
+
useEffect(function () {
|
|
90
|
+
container.appendChild(div);
|
|
91
|
+
return function () {
|
|
92
|
+
setTimeout(function () {
|
|
93
|
+
return root.unmount(), div.remove();
|
|
94
|
+
}, 100);
|
|
95
|
+
};
|
|
96
|
+
}, []);
|
|
97
|
+
useEffect(function () {
|
|
98
|
+
root.render( /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
99
|
+
prefixCls: prefixCls,
|
|
100
|
+
getPopupContainer: function getPopupContainer() {
|
|
101
|
+
return container;
|
|
102
|
+
}
|
|
103
|
+
}, /*#__PURE__*/React.createElement(Drawer, {
|
|
104
|
+
visible: state.visible,
|
|
105
|
+
onOk: state.onOk,
|
|
106
|
+
onClose: close,
|
|
107
|
+
destroyOnClose: true,
|
|
108
|
+
title: state.title,
|
|
109
|
+
width: state.width,
|
|
110
|
+
className: state.className,
|
|
111
|
+
getContainer: false
|
|
112
|
+
}, state.content)));
|
|
113
|
+
}, [state.content, state.visible, state.title, state.onOk, state.width, state.className]);
|
|
114
|
+
|
|
115
|
+
var open = function open(options) {
|
|
116
|
+
setState(function (old) {
|
|
117
|
+
return Object.assign(Object.assign(Object.assign({}, old), options), {
|
|
118
|
+
visible: true
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
var close = function close() {
|
|
124
|
+
setState(function (old) {
|
|
125
|
+
return Object.assign(Object.assign({}, old), {
|
|
126
|
+
visible: false
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
open: open,
|
|
133
|
+
close: close
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
var RefDrawer = /*#__PURE__*/React.forwardRef(function RefDrawer(_, ref) {
|
|
138
|
+
var context = useContext(ConfigContext.Context);
|
|
139
|
+
var root = useMemo(function () {
|
|
140
|
+
return (context === null || context === void 0 ? void 0 : context.root) || document.body;
|
|
141
|
+
}, [context === null || context === void 0 ? void 0 : context.root]);
|
|
142
|
+
|
|
143
|
+
var _useState3 = useState({
|
|
144
|
+
content: null,
|
|
145
|
+
visible: false,
|
|
146
|
+
title: '',
|
|
147
|
+
onOk: undefined,
|
|
148
|
+
width: undefined,
|
|
149
|
+
className: undefined
|
|
150
|
+
}),
|
|
151
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
152
|
+
state = _useState4[0],
|
|
153
|
+
setState = _useState4[1];
|
|
154
|
+
|
|
155
|
+
var open = function open(options) {
|
|
156
|
+
setState(function (old) {
|
|
157
|
+
return Object.assign(Object.assign(Object.assign({}, old), options), {
|
|
158
|
+
visible: true
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
var close = function close() {
|
|
164
|
+
setState(function (old) {
|
|
165
|
+
return Object.assign(Object.assign({}, old), {
|
|
166
|
+
visible: false
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
useImperativeHandle(ref, function () {
|
|
172
|
+
return {
|
|
173
|
+
open: open,
|
|
174
|
+
close: close
|
|
175
|
+
};
|
|
176
|
+
}, [state]);
|
|
177
|
+
return /*#__PURE__*/React.createElement(Drawer, {
|
|
178
|
+
visible: state.visible,
|
|
179
|
+
onOk: state.onOk,
|
|
180
|
+
onClose: close,
|
|
181
|
+
destroyOnClose: true,
|
|
182
|
+
title: state.title,
|
|
183
|
+
width: state.width,
|
|
184
|
+
className: state.className,
|
|
185
|
+
getContainer: function getContainer() {
|
|
186
|
+
return root;
|
|
187
|
+
}
|
|
188
|
+
}, state.content);
|
|
189
|
+
});
|
|
190
|
+
Drawer.useDrawer = useDrawer;
|
|
191
|
+
Drawer.RefDrawer = RefDrawer;
|
|
192
|
+
export default Drawer;
|
package/es/FullScreen/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import './index.less';
|
|
3
3
|
interface IFullScrenProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
getContainer: () => HTMLElement | Element;
|
|
6
6
|
fullScreenChange?: (flag: boolean) => void;
|
|
7
|
-
|
|
7
|
+
hasText?: boolean;
|
|
8
8
|
}
|
|
9
|
-
declare function FullScreen({
|
|
9
|
+
declare function FullScreen({ className, getContainer, fullScreenChange, hasText }: IFullScrenProps): JSX.Element;
|
|
10
10
|
export default FullScreen;
|
package/es/FullScreen/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _useFullscreen3 from "ahooks/es/useFullscreen";
|
|
2
2
|
|
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
4
|
|
|
@@ -12,57 +12,33 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
12
12
|
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
|
|
15
|
-
import React, {
|
|
15
|
+
import React, { useEffect } from 'react';
|
|
16
16
|
import IconFont from '../IconFont';
|
|
17
17
|
import "./index.css";
|
|
18
18
|
|
|
19
19
|
function FullScreen(_ref) {
|
|
20
|
-
var
|
|
21
|
-
className = _ref.className,
|
|
20
|
+
var className = _ref.className,
|
|
22
21
|
getContainer = _ref.getContainer,
|
|
23
|
-
fullScreenChange = _ref.fullScreenChange
|
|
22
|
+
fullScreenChange = _ref.fullScreenChange,
|
|
23
|
+
hasText = _ref.hasText;
|
|
24
24
|
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
var _useFullscreen = _useFullscreen3(getContainer),
|
|
26
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
27
|
+
isFullscreen = _useFullscreen2[0],
|
|
28
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
29
29
|
|
|
30
30
|
useEffect(function () {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var container = getContainer();
|
|
35
|
-
var flag = container === fullScreenEle;
|
|
36
|
-
setScreenState(flag);
|
|
37
|
-
fullScreenChange && fullScreenChange(flag);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
document.addEventListener('webkitfullscreenchange', onfullscreenchange, false);
|
|
41
|
-
return function () {
|
|
42
|
-
return document.removeEventListener('webkitfullscreenchange', onfullscreenchange, false);
|
|
43
|
-
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
|
-
}, [screenState]);
|
|
45
|
-
|
|
46
|
-
function onClickFullScreen() {
|
|
47
|
-
var container = getContainer();
|
|
48
|
-
|
|
49
|
-
var fullScreenEle = _fullScreenHelper.isFullscreen();
|
|
50
|
-
|
|
51
|
-
var flag = fullScreenEle === container;
|
|
52
|
-
flag ? _fullScreenHelper.exitFullscreen() : _fullScreenHelper.fullscreen(container);
|
|
53
|
-
setScreenState(!flag);
|
|
54
|
-
fullScreenChange && fullScreenChange(!flag);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: "tools-screen-layer ".concat(className ? className : ''),
|
|
59
|
-
onClick: function onClick() {
|
|
60
|
-
return onClickFullScreen();
|
|
31
|
+
if (isFullscreen) {
|
|
32
|
+
fullScreenChange(isFullscreen);
|
|
61
33
|
}
|
|
62
|
-
},
|
|
34
|
+
}, [isFullscreen]);
|
|
35
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
className: "tools-screen-layer ".concat(className !== null && className !== void 0 ? className : ''),
|
|
37
|
+
onClick: toggleFullscreen
|
|
38
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
63
39
|
className: "defualt-fullscreen-icon icon-primary",
|
|
64
|
-
type: !
|
|
65
|
-
}), !
|
|
40
|
+
type: !isFullscreen ? 'icon-S_View_ScreenViewFull' : 'icon-S_View_ScreenViewExit'
|
|
41
|
+
}), hasText ? !isFullscreen ? '全屏' : '窗口' : undefined);
|
|
66
42
|
}
|
|
67
43
|
|
|
68
44
|
export default FullScreen;
|
package/es/HightLevel/index.js
CHANGED
|
@@ -14,7 +14,6 @@ function GridList(props, ref) {
|
|
|
14
14
|
useImperativeHandle(ref, function () {
|
|
15
15
|
return containerRef.current;
|
|
16
16
|
}, []);
|
|
17
|
-
console.log(renderData);
|
|
18
17
|
return /*#__PURE__*/React.createElement("div", {
|
|
19
18
|
ref: containerRef,
|
|
20
19
|
className: "cloudapp-grid-list ".concat(props.className || '')
|
package/es/Modal/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ModalProps } from './interface';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare function Modal({ children, className, style, getContainer, ...props }: ModalProps): JSX.Element;
|
|
5
5
|
declare namespace Modal {
|
|
@@ -14,5 +14,31 @@ declare namespace Modal {
|
|
|
14
14
|
var warning: import("antd/lib/modal/confirm").ModalFunc;
|
|
15
15
|
var confirm: import("antd/lib/modal/confirm").ModalFunc;
|
|
16
16
|
var destroyAll: () => void;
|
|
17
|
+
var useModal: (prefixCls?: string) => {
|
|
18
|
+
open: (options: IUseModalHookState) => void;
|
|
19
|
+
close: () => void;
|
|
20
|
+
};
|
|
21
|
+
var useAntdModal: typeof import("antd/lib/modal/useModal").default;
|
|
22
|
+
var RefModal: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<IRefModalMethodsProps>>;
|
|
23
|
+
}
|
|
24
|
+
export interface IUseModalHookState {
|
|
25
|
+
content?: React.ReactNode;
|
|
26
|
+
visible?: boolean;
|
|
27
|
+
title?: React.ReactNode;
|
|
28
|
+
onOk?: () => void;
|
|
29
|
+
width?: number | string;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface IUseModalHookState {
|
|
33
|
+
content?: React.ReactNode;
|
|
34
|
+
visible?: boolean;
|
|
35
|
+
title?: React.ReactNode;
|
|
36
|
+
onOk?: () => void;
|
|
37
|
+
width?: number | string;
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface IRefModalMethodsProps {
|
|
41
|
+
open: (options: IUseModalHookState) => void;
|
|
42
|
+
close: () => void;
|
|
17
43
|
}
|
|
18
44
|
export default Modal;
|
package/es/Modal/index.js
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
|
+
import "antd/lib/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/lib/config-provider";
|
|
1
3
|
import "antd/lib/modal/style";
|
|
2
4
|
import _Modal from "antd/lib/modal";
|
|
5
|
+
|
|
6
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
+
|
|
8
|
+
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."); }
|
|
9
|
+
|
|
10
|
+
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); }
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
|
|
3
18
|
import { __rest } from "tslib";
|
|
4
|
-
import React from 'react';
|
|
19
|
+
import React, { useContext, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
|
20
|
+
import * as ReactDOMClient from 'react-dom/client';
|
|
21
|
+
import CC from '../ConfigContext';
|
|
5
22
|
import "./index.css";
|
|
23
|
+
import ConfigContext from '../ConfigContext';
|
|
6
24
|
|
|
7
25
|
function Modal(_a) {
|
|
8
26
|
var children = _a.children,
|
|
@@ -24,6 +42,139 @@ Modal.defaultProps = {
|
|
|
24
42
|
className: '',
|
|
25
43
|
getContainer: false
|
|
26
44
|
};
|
|
45
|
+
|
|
46
|
+
function useModal() {
|
|
47
|
+
var prefixCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cloudapp';
|
|
48
|
+
var context = useContext(CC.Context);
|
|
49
|
+
var container = useMemo(function () {
|
|
50
|
+
var _a;
|
|
51
|
+
|
|
52
|
+
return (_a = context === null || context === void 0 ? void 0 : context.root) !== null && _a !== void 0 ? _a : document.body;
|
|
53
|
+
}, [context === null || context === void 0 ? void 0 : context.root]);
|
|
54
|
+
var div = useMemo(function () {
|
|
55
|
+
return document.createElement('div');
|
|
56
|
+
}, []);
|
|
57
|
+
|
|
58
|
+
var _useState = useState({
|
|
59
|
+
content: null,
|
|
60
|
+
visible: false,
|
|
61
|
+
title: '',
|
|
62
|
+
onOk: undefined,
|
|
63
|
+
width: undefined,
|
|
64
|
+
className: undefined
|
|
65
|
+
}),
|
|
66
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
67
|
+
state = _useState2[0],
|
|
68
|
+
setState = _useState2[1];
|
|
69
|
+
|
|
70
|
+
var root = useMemo(function () {
|
|
71
|
+
return ReactDOMClient.createRoot(div);
|
|
72
|
+
}, []);
|
|
73
|
+
useEffect(function () {
|
|
74
|
+
container.appendChild(div);
|
|
75
|
+
return function () {
|
|
76
|
+
setTimeout(function () {
|
|
77
|
+
return root.unmount(), div.remove();
|
|
78
|
+
}, 100);
|
|
79
|
+
};
|
|
80
|
+
}, []);
|
|
81
|
+
useEffect(function () {
|
|
82
|
+
root.render( /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
83
|
+
prefixCls: prefixCls,
|
|
84
|
+
getPopupContainer: function getPopupContainer() {
|
|
85
|
+
return container;
|
|
86
|
+
}
|
|
87
|
+
}, /*#__PURE__*/React.createElement(Modal, {
|
|
88
|
+
okText: "\u786E\u5B9A",
|
|
89
|
+
cancelText: "\u53D6\u6D88",
|
|
90
|
+
visible: state.visible,
|
|
91
|
+
onOk: state.onOk,
|
|
92
|
+
onCancel: close,
|
|
93
|
+
destroyOnClose: true,
|
|
94
|
+
title: state.title,
|
|
95
|
+
width: state.width,
|
|
96
|
+
className: state.className,
|
|
97
|
+
getContainer: false
|
|
98
|
+
}, state.content)));
|
|
99
|
+
}, [state.content, state.visible, state.title, state.onOk, state.width, state.className]);
|
|
100
|
+
|
|
101
|
+
var open = function open(options) {
|
|
102
|
+
setState(function (old) {
|
|
103
|
+
return Object.assign(Object.assign(Object.assign({}, old), options), {
|
|
104
|
+
visible: true
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
var close = function close() {
|
|
110
|
+
setState(function (old) {
|
|
111
|
+
return Object.assign(Object.assign({}, old), {
|
|
112
|
+
visible: false
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
open: open,
|
|
119
|
+
close: close
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
var RefModal = /*#__PURE__*/React.forwardRef(function RefModal(_, ref) {
|
|
124
|
+
var context = useContext(ConfigContext.Context);
|
|
125
|
+
var root = useMemo(function () {
|
|
126
|
+
return (context === null || context === void 0 ? void 0 : context.root) || document.body;
|
|
127
|
+
}, [context === null || context === void 0 ? void 0 : context.root]);
|
|
128
|
+
|
|
129
|
+
var _useState3 = useState({
|
|
130
|
+
content: null,
|
|
131
|
+
visible: false,
|
|
132
|
+
title: '',
|
|
133
|
+
onOk: undefined,
|
|
134
|
+
width: undefined,
|
|
135
|
+
className: undefined
|
|
136
|
+
}),
|
|
137
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
138
|
+
state = _useState4[0],
|
|
139
|
+
setState = _useState4[1];
|
|
140
|
+
|
|
141
|
+
var open = function open(options) {
|
|
142
|
+
setState(function (old) {
|
|
143
|
+
return Object.assign(Object.assign(Object.assign({}, old), options), {
|
|
144
|
+
visible: true
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
var close = function close() {
|
|
150
|
+
setState(function (old) {
|
|
151
|
+
return Object.assign(Object.assign({}, old), {
|
|
152
|
+
visible: false
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
useImperativeHandle(ref, function () {
|
|
158
|
+
return {
|
|
159
|
+
open: open,
|
|
160
|
+
close: close
|
|
161
|
+
};
|
|
162
|
+
}, [state]);
|
|
163
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
164
|
+
okText: "\u786E\u5B9A",
|
|
165
|
+
cancelText: "\u53D6\u6D88",
|
|
166
|
+
visible: state.visible,
|
|
167
|
+
onOk: state.onOk,
|
|
168
|
+
onCancel: close,
|
|
169
|
+
destroyOnClose: true,
|
|
170
|
+
title: state.title,
|
|
171
|
+
width: state.width,
|
|
172
|
+
className: state.className,
|
|
173
|
+
getContainer: function getContainer() {
|
|
174
|
+
return root;
|
|
175
|
+
}
|
|
176
|
+
}, state.content);
|
|
177
|
+
});
|
|
27
178
|
Modal.info = _Modal.info;
|
|
28
179
|
Modal.success = _Modal.success;
|
|
29
180
|
Modal.error = _Modal.error;
|
|
@@ -31,4 +182,7 @@ Modal.warn = _Modal.warn;
|
|
|
31
182
|
Modal.warning = _Modal.warning;
|
|
32
183
|
Modal.confirm = _Modal.confirm;
|
|
33
184
|
Modal.destroyAll = _Modal.destroyAll;
|
|
185
|
+
Modal.useModal = useModal;
|
|
186
|
+
Modal.useAntdModal = _Modal.useModal;
|
|
187
|
+
Modal.RefModal = RefModal;
|
|
34
188
|
export default Modal;
|