@cloud-app-dev/vidc 2.1.0-alpha.7 → 2.2.0-alpha.1
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 +1 -1
- package/es/AppContext/Sync.d.ts +1 -0
- package/es/AppContext/interface.d.ts +4 -1
- package/es/AppRedirect/index.d.ts +1 -0
- package/es/CheckGroupFixed/index.d.ts +1 -0
- package/es/DeviceSelect/TreeType.d.ts +1 -0
- package/es/DeviceSelect/demo.d.ts +1 -0
- package/es/DeviceSelect/index.d.ts +1 -0
- package/es/DeviceSelect/index.js +1 -1
- package/es/Dict/hook.d.ts +0 -1
- package/es/Dict/hook.js +5 -21
- package/es/Dict/index.d.ts +1 -5
- package/es/Dict/index.js +2 -6
- package/es/Dict/utils.d.ts +0 -1
- package/es/Dict/utils.js +0 -7
- package/es/Drag/DragAndDropItem.js +2 -2
- package/es/Drag/DropItem.js +2 -2
- package/es/Drawer/Footer.d.ts +1 -0
- package/es/Drawer/index.d.ts +1 -0
- package/es/InitialConfig/index.js +0 -2
- package/es/InitialConfig/utils.d.ts +5 -5
- package/es/InitialConfig/utils.js +19 -19
- package/es/Input/index.d.ts +1 -0
- package/es/List/CheckExt.d.ts +1 -0
- package/es/List/DeviceList/index.js +1 -1
- package/es/List/DynamicDeviceList/Demo.d.ts +1 -0
- package/es/List/DynamicDeviceList/index.d.ts +1 -0
- package/es/List/VList/index.d.ts +1 -0
- package/es/List/index.d.ts +1 -0
- package/es/LoaderApp/index.js +26 -22
- package/es/LoaderApp/loader.js +2 -6
- package/es/LoaderApp/utils.d.ts +1 -0
- package/es/LoaderApp/utils.js +37 -0
- package/es/Modal/index.d.ts +1 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -0
- package/es/Picture/component/DefaultRects/index.d.ts +2 -1
- package/es/Picture/component/DrawRect/index.d.ts +3 -4
- package/es/Picture/component/RectMenu/index.d.ts +2 -3
- package/es/Picture/component/WheelScale/index.d.ts +1 -0
- package/es/Picture/component/WheelScale/index.js +3 -3
- package/es/Picture/index.d.ts +1 -0
- package/es/Picture/index.js +4 -2
- package/es/Picture/interface.d.ts +4 -2
- package/es/Picture/utils.d.ts +1 -0
- package/es/Player/api/index.d.ts +71 -0
- package/es/Player/api/index.js +284 -0
- package/es/Player/contraller_bar/bar.d.ts +8 -0
- package/es/Player/contraller_bar/bar.js +21 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +9 -0
- package/es/Player/contraller_bar/contraller_event.js +57 -0
- package/es/Player/contraller_bar/index.d.ts +19 -0
- package/es/Player/contraller_bar/index.js +37 -0
- package/es/Player/contraller_bar/left_bar.d.ts +15 -0
- package/es/Player/contraller_bar/left_bar.js +91 -0
- package/es/Player/contraller_bar/right_bar.d.ts +13 -0
- package/es/Player/contraller_bar/right_bar.js +55 -0
- package/es/Player/contraller_bar/useBarStatus.d.ts +3 -0
- package/es/Player/contraller_bar/useBarStatus.js +52 -0
- package/es/Player/demo.d.ts +2 -0
- package/es/Player/demo.js +269 -0
- package/es/Player/event/browserTabEvent.d.ts +9 -0
- package/es/Player/event/browserTabEvent.js +57 -0
- package/es/Player/event/errorEvent.d.ts +16 -0
- package/es/Player/event/errorEvent.js +120 -0
- package/es/Player/event/eventName.d.ts +3 -0
- package/es/Player/event/eventName.js +15 -0
- package/es/Player/event/index.d.ts +22 -0
- package/es/Player/event/index.js +175 -0
- package/es/Player/frontend_player.d.ts +15 -0
- package/es/Player/frontend_player.js +90 -0
- package/es/Player/frontend_timeline.d.ts +14 -0
- package/es/Player/frontend_timeline.js +141 -0
- package/es/Player/iconfont.d.ts +13 -0
- package/es/Player/iconfont.js +18 -0
- package/es/Player/index.d.ts +4 -0
- package/es/Player/index.js +4 -0
- package/es/Player/live_heart.d.ts +6 -0
- package/es/Player/live_heart.js +29 -0
- package/es/Player/message.d.ts +11 -0
- package/es/Player/message.js +150 -0
- package/es/Player/player.d.ts +75 -0
- package/es/Player/segment_player.d.ts +13 -0
- package/es/Player/segment_player.js +191 -0
- package/es/Player/segment_timeline.d.ts +16 -0
- package/es/Player/segment_timeline.js +154 -0
- package/es/Player/single_player.d.ts +5 -0
- package/es/Player/single_player.js +185 -0
- package/es/Player/style/bar.css +37 -0
- package/es/Player/style/iconfont.css +62 -0
- package/es/Player/style/index.css +22 -0
- package/es/Player/style/message.css +49 -0
- package/es/Player/style/slider.css +96 -0
- package/es/Player/style/timeline.css +92 -0
- package/es/Player/timeline.d.ts +11 -0
- package/es/Player/timeline.js +104 -0
- package/es/Player/util.d.ts +48 -0
- package/es/Player/util.js +172 -0
- package/es/Progress/index.d.ts +1 -0
- package/es/Tree/BaseTree/demo.d.ts +1 -0
- package/es/Tree/BaseTree/index.d.ts +2 -2
- package/es/Tree/demo.d.ts +1 -0
- package/es/Tree/index.js +1 -1
- package/es/UserSelect/demo.d.ts +1 -0
- package/es/WorkerFlow/Form/Approver.d.ts +1 -0
- package/es/WorkerFlow/Form/Condition.d.ts +1 -0
- package/es/WorkerFlow/Form/EmptyUserSet.d.ts +1 -0
- package/es/WorkerFlow/Form/FormAuth.d.ts +1 -0
- package/es/WorkerFlow/Form/GroupList.d.ts +1 -0
- package/es/WorkerFlow/Form/GroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/Handle.d.ts +1 -0
- package/es/WorkerFlow/Form/LevelGroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/Notifier.d.ts +1 -0
- package/es/WorkerFlow/Form/UserAndGroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/UserSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/UserSet.d.ts +1 -0
- package/es/WorkerFlow/Form/UsersHandleType.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Add.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Add.js +1 -1
- package/es/WorkerFlow/Nodes/AddOption.d.ts +1 -0
- package/es/WorkerFlow/Nodes/AddOptionList.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Approver.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Condition.d.ts +1 -0
- package/es/WorkerFlow/Nodes/End.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Handle.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Node.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Notifier.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Render.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Start.d.ts +1 -0
- package/es/WorkerFlow/Nodes/TitleElement.d.ts +1 -0
- package/es/index.d.ts +3 -3
- package/es/index.js +4 -4
- package/package.json +13 -10
- package/es/AppRouter/index.d.ts +0 -8
- package/es/AppRouter/index.js +0 -17
- package/es/Dict/desc.d.ts +0 -64
- package/es/Dict/desc.js +0 -162
package/es/Tree/index.js
CHANGED
package/es/UserSelect/demo.d.ts
CHANGED
package/es/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as Api } from './Api';
|
|
2
2
|
export { default as AppContext } from './AppContext';
|
|
3
3
|
export { default as AppRedirect } from './AppRedirect';
|
|
4
|
-
export { default as AppRouter } from './AppRouter';
|
|
5
4
|
export { default as Auth } from './Auth';
|
|
6
5
|
export { default as AutoExit } from './AutoExit';
|
|
7
6
|
export { default as Box } from './Box';
|
|
@@ -27,6 +26,7 @@ export { default as LoaderApp } from './LoaderApp';
|
|
|
27
26
|
export { default as LoaderScript } from './LoaderScript';
|
|
28
27
|
export { default as Modal } from './Modal';
|
|
29
28
|
export { default as Picture } from './Picture';
|
|
29
|
+
export { default as Player } from './Player';
|
|
30
30
|
export { default as Progress } from './Progress';
|
|
31
31
|
export { default as RefDrawer } from './RefDrawer';
|
|
32
32
|
export { default as RefModal } from './RefModal';
|
|
@@ -35,9 +35,9 @@ export { default as TableLayout } from './TableLayout';
|
|
|
35
35
|
export { default as ThemeAntd } from './ThemeAntd';
|
|
36
36
|
export { default as Title } from './Title';
|
|
37
37
|
export { default as Tree } from './Tree';
|
|
38
|
+
export { default as UserSelect } from './UserSelect';
|
|
39
|
+
export { default as WorkerFlow } from './WorkerFlow';
|
|
38
40
|
export { default as useDrawer } from './useDrawer';
|
|
39
41
|
export { default as useHistory } from './useHistory';
|
|
40
42
|
export { default as useHttp } from './useHttp';
|
|
41
43
|
export { default as useModal } from './useModal';
|
|
42
|
-
export { default as UserSelect } from './UserSelect';
|
|
43
|
-
export { default as WorkerFlow } from './WorkerFlow';
|
package/es/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as Api } from './Api';
|
|
2
2
|
export { default as AppContext } from './AppContext';
|
|
3
3
|
export { default as AppRedirect } from './AppRedirect';
|
|
4
|
-
export { default as AppRouter } from './AppRouter';
|
|
5
4
|
export { default as Auth } from './Auth';
|
|
6
5
|
export { default as AutoExit } from './AutoExit';
|
|
7
6
|
export { default as Box } from './Box';
|
|
@@ -27,6 +26,7 @@ export { default as LoaderApp } from './LoaderApp';
|
|
|
27
26
|
export { default as LoaderScript } from './LoaderScript';
|
|
28
27
|
export { default as Modal } from './Modal';
|
|
29
28
|
export { default as Picture } from './Picture';
|
|
29
|
+
export { default as Player } from './Player';
|
|
30
30
|
export { default as Progress } from './Progress';
|
|
31
31
|
export { default as RefDrawer } from './RefDrawer';
|
|
32
32
|
export { default as RefModal } from './RefModal';
|
|
@@ -35,9 +35,9 @@ export { default as TableLayout } from './TableLayout';
|
|
|
35
35
|
export { default as ThemeAntd } from './ThemeAntd';
|
|
36
36
|
export { default as Title } from './Title';
|
|
37
37
|
export { default as Tree } from './Tree';
|
|
38
|
+
export { default as UserSelect } from './UserSelect';
|
|
39
|
+
export { default as WorkerFlow } from './WorkerFlow';
|
|
38
40
|
export { default as useDrawer } from './useDrawer';
|
|
39
41
|
export { default as useHistory } from './useHistory';
|
|
40
42
|
export { default as useHttp } from './useHttp';
|
|
41
|
-
export { default as useModal } from './useModal';
|
|
42
|
-
export { default as UserSelect } from './UserSelect';
|
|
43
|
-
export { default as WorkerFlow } from './WorkerFlow';
|
|
43
|
+
export { default as useModal } from './useModal';
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@cloud-app-dev/vidc",
|
|
4
4
|
"description": "Video Image Data Componennts",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.2.0-alpha.1",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "dumi dev",
|
|
8
8
|
"docs:build": "dumi build",
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
"ahooks": "^3.1.0",
|
|
35
35
|
"chroma-js": "^2.1.2",
|
|
36
36
|
"fetch-like-axios": "^0.0.5",
|
|
37
|
+
"flv.zv.js": "^2.2.0",
|
|
38
|
+
"hls.js": "^1.1.5",
|
|
37
39
|
"immer": "^9.0.5",
|
|
38
40
|
"lodash": "^4.17.21",
|
|
39
41
|
"rc-queue-anim": "^2.0.0"
|
|
@@ -44,21 +46,22 @@
|
|
|
44
46
|
"@types/chroma-js": "^2.1.3",
|
|
45
47
|
"@types/lodash": "^4.14.178",
|
|
46
48
|
"@types/node": "^17.0.5",
|
|
49
|
+
"@types/react": "^18.0.9",
|
|
50
|
+
"@types/react-dom": "^18.0.4",
|
|
47
51
|
"@umijs/test": "^3.0.5",
|
|
48
|
-
"antd": "^4.
|
|
52
|
+
"antd": "^4.20.5",
|
|
49
53
|
"babel-plugin-import": "^1.13.3",
|
|
50
|
-
"dumi": "^1.1.
|
|
51
|
-
"father-build": "^1.
|
|
54
|
+
"dumi": "^1.1.40",
|
|
55
|
+
"father-build": "^1.22.1",
|
|
52
56
|
"gh-pages": "^3.0.0",
|
|
53
57
|
"lint-staged": "^10.0.7",
|
|
54
58
|
"prettier": "^2.2.1",
|
|
55
|
-
"react": "^
|
|
56
|
-
"react-dom": "^
|
|
57
|
-
"react-router-dom": "^6.
|
|
58
|
-
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
59
|
-
"tslib": "^2.3.1",
|
|
59
|
+
"react": "^18.1.0",
|
|
60
|
+
"react-dom": "^18.1.0",
|
|
61
|
+
"react-router-dom": "^6.3.0",
|
|
60
62
|
"typescript": "^4.5.4",
|
|
61
|
-
"yorkie": "^2.0.0"
|
|
63
|
+
"yorkie": "^2.0.0",
|
|
64
|
+
"history": "^5.3.0"
|
|
62
65
|
},
|
|
63
66
|
"repository": {
|
|
64
67
|
"type": "git",
|
package/es/AppRouter/index.d.ts
DELETED
package/es/AppRouter/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Router, Routes } from 'react-router-dom';
|
|
4
|
-
import InstanceHistory from '../InstanceHistory';
|
|
5
|
-
|
|
6
|
-
function AppRouter(_a) {
|
|
7
|
-
var children = _a.children,
|
|
8
|
-
props = __rest(_a, ["children"]);
|
|
9
|
-
|
|
10
|
-
return /*#__PURE__*/React.createElement(Router, Object.assign({}, props, {
|
|
11
|
-
navigator: InstanceHistory,
|
|
12
|
-
navigationType: InstanceHistory.action,
|
|
13
|
-
location: InstanceHistory.location
|
|
14
|
-
}), /*#__PURE__*/React.createElement(Routes, null, children));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default AppRouter;
|
package/es/Dict/desc.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DictItem } from './interface';
|
|
3
|
-
export declare function withDict(codes?: any[], isWebVisible?: boolean): (Component: any) => (props: any) => JSX.Element;
|
|
4
|
-
export declare function withTypeCodes(Component: any): {
|
|
5
|
-
new (props: any): {
|
|
6
|
-
componentDidMount(): void;
|
|
7
|
-
render(): JSX.Element;
|
|
8
|
-
context: any;
|
|
9
|
-
setState<K extends "typeCodes" | "isInit">(state: {
|
|
10
|
-
typeCodes: DictItem[];
|
|
11
|
-
isInit: boolean;
|
|
12
|
-
} | ((prevState: Readonly<{
|
|
13
|
-
typeCodes: DictItem[];
|
|
14
|
-
isInit: boolean;
|
|
15
|
-
}>, props: Readonly<any>) => {
|
|
16
|
-
typeCodes: DictItem[];
|
|
17
|
-
isInit: boolean;
|
|
18
|
-
} | Pick<{
|
|
19
|
-
typeCodes: DictItem[];
|
|
20
|
-
isInit: boolean;
|
|
21
|
-
}, K>) | Pick<{
|
|
22
|
-
typeCodes: DictItem[];
|
|
23
|
-
isInit: boolean;
|
|
24
|
-
}, K>, callback?: () => void): void;
|
|
25
|
-
forceUpdate(callback?: () => void): void;
|
|
26
|
-
readonly props: Readonly<any> & Readonly<{
|
|
27
|
-
children?: React.ReactNode;
|
|
28
|
-
}>;
|
|
29
|
-
state: Readonly<{
|
|
30
|
-
typeCodes: DictItem[];
|
|
31
|
-
isInit: boolean;
|
|
32
|
-
}>;
|
|
33
|
-
refs: {
|
|
34
|
-
[key: string]: React.ReactInstance;
|
|
35
|
-
};
|
|
36
|
-
shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<{
|
|
37
|
-
typeCodes: DictItem[];
|
|
38
|
-
isInit: boolean;
|
|
39
|
-
}>, nextContext: any): boolean;
|
|
40
|
-
componentWillUnmount?(): void;
|
|
41
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
42
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<{
|
|
43
|
-
typeCodes: DictItem[];
|
|
44
|
-
isInit: boolean;
|
|
45
|
-
}>): any;
|
|
46
|
-
componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<{
|
|
47
|
-
typeCodes: DictItem[];
|
|
48
|
-
isInit: boolean;
|
|
49
|
-
}>, snapshot?: any): void;
|
|
50
|
-
componentWillMount?(): void;
|
|
51
|
-
UNSAFE_componentWillMount?(): void;
|
|
52
|
-
componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
53
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
|
|
54
|
-
componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{
|
|
55
|
-
typeCodes: DictItem[];
|
|
56
|
-
isInit: boolean;
|
|
57
|
-
}>, nextContext: any): void;
|
|
58
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{
|
|
59
|
-
typeCodes: DictItem[];
|
|
60
|
-
isInit: boolean;
|
|
61
|
-
}>, nextContext: any): void;
|
|
62
|
-
};
|
|
63
|
-
contextType?: React.Context<any>;
|
|
64
|
-
};
|
package/es/Dict/desc.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
|
|
3
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
|
|
5
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
6
|
-
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
-
|
|
11
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
-
|
|
13
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
|
|
15
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
16
|
-
|
|
17
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
-
|
|
19
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
-
|
|
21
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
-
|
|
23
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
24
|
-
|
|
25
|
-
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."); }
|
|
26
|
-
|
|
27
|
-
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); }
|
|
28
|
-
|
|
29
|
-
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; }
|
|
30
|
-
|
|
31
|
-
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; }
|
|
32
|
-
|
|
33
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
34
|
-
|
|
35
|
-
import React, { useRef, useState, useEffect } from 'react';
|
|
36
|
-
import { queryByTypeCodes, queryTypeCodes, formartItemTextExt } from './utils';
|
|
37
|
-
import LMDict from './cache';
|
|
38
|
-
export function withDict() {
|
|
39
|
-
var codes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
40
|
-
var isWebVisible = arguments.length > 1 ? arguments[1] : undefined;
|
|
41
|
-
return function (Component) {
|
|
42
|
-
return function (props) {
|
|
43
|
-
var isInitRef = useRef(false);
|
|
44
|
-
|
|
45
|
-
var _useState = useState(function () {
|
|
46
|
-
var map = {};
|
|
47
|
-
codes.forEach(function (code) {
|
|
48
|
-
if (LMDict.data[code]) {
|
|
49
|
-
map[code] = LMDict.data[code];
|
|
50
|
-
} else {
|
|
51
|
-
map[code] = [];
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
return map;
|
|
55
|
-
}),
|
|
56
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
-
dictMap = _useState2[0],
|
|
58
|
-
setDictMap = _useState2[1];
|
|
59
|
-
|
|
60
|
-
useEffect(function () {
|
|
61
|
-
var nocacheCodes = codes.filter(function (v) {
|
|
62
|
-
return !LMDict.data[v];
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
if (nocacheCodes.length === 0) {
|
|
66
|
-
isInitRef.current = true;
|
|
67
|
-
setDictMap(function (old) {
|
|
68
|
-
return Object.assign({}, old);
|
|
69
|
-
});
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
queryByTypeCodes(nocacheCodes, isWebVisible).then(function (res) {
|
|
74
|
-
isInitRef.current = true;
|
|
75
|
-
var data = res.data;
|
|
76
|
-
data.forEach(function (item) {
|
|
77
|
-
item.label = item.name;
|
|
78
|
-
item.value = item.code;
|
|
79
|
-
item = Object.assign(Object.assign({}, item), formartItemTextExt(item.extText));
|
|
80
|
-
});
|
|
81
|
-
setDictMap(function (old) {
|
|
82
|
-
nocacheCodes.forEach(function (code) {
|
|
83
|
-
var itemCodes = data.filter(function (v1) {
|
|
84
|
-
return +v1.typeCode === +code;
|
|
85
|
-
});
|
|
86
|
-
old[code] = itemCodes;
|
|
87
|
-
LMDict.updateDictMap(code, itemCodes);
|
|
88
|
-
});
|
|
89
|
-
return Object.assign({}, old);
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
}, []);
|
|
93
|
-
|
|
94
|
-
if (!isInitRef.current) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return /*#__PURE__*/React.createElement(Component, Object.assign({}, props, {
|
|
99
|
-
dictMap: dictMap
|
|
100
|
-
}));
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
export function withTypeCodes(Component) {
|
|
105
|
-
return /*#__PURE__*/function (_React$Component) {
|
|
106
|
-
_inherits(withTypeCodesComponent, _React$Component);
|
|
107
|
-
|
|
108
|
-
var _super = _createSuper(withTypeCodesComponent);
|
|
109
|
-
|
|
110
|
-
function withTypeCodesComponent(props) {
|
|
111
|
-
var _this;
|
|
112
|
-
|
|
113
|
-
_classCallCheck(this, withTypeCodesComponent);
|
|
114
|
-
|
|
115
|
-
_this = _super.call(this, props);
|
|
116
|
-
_this.state = {
|
|
117
|
-
typeCodes: LMDict.data['typeCodes'] || [],
|
|
118
|
-
isInit: false
|
|
119
|
-
};
|
|
120
|
-
return _this;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
_createClass(withTypeCodesComponent, [{
|
|
124
|
-
key: "componentDidMount",
|
|
125
|
-
value: function componentDidMount() {
|
|
126
|
-
var _this2 = this;
|
|
127
|
-
|
|
128
|
-
if (!LMDict.data['typeCodes']) {
|
|
129
|
-
queryTypeCodes().then(function (res) {
|
|
130
|
-
LMDict.updateDictMap('typeCodes', res);
|
|
131
|
-
|
|
132
|
-
_this2.setState({
|
|
133
|
-
typeCodes: res,
|
|
134
|
-
isInit: true
|
|
135
|
-
});
|
|
136
|
-
}).catch(function () {
|
|
137
|
-
_this2.setState({
|
|
138
|
-
typeCodes: [],
|
|
139
|
-
isInit: true
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
} else this.setState({
|
|
143
|
-
typeCodes: LMDict.data['typeCodes'],
|
|
144
|
-
isInit: true
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}, {
|
|
148
|
-
key: "render",
|
|
149
|
-
value: function render() {
|
|
150
|
-
if (!this.state.isInit) {
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return /*#__PURE__*/React.createElement(Component, Object.assign({}, this.props, {
|
|
155
|
-
typeCodes: this.state.typeCodes
|
|
156
|
-
}));
|
|
157
|
-
}
|
|
158
|
-
}]);
|
|
159
|
-
|
|
160
|
-
return withTypeCodesComponent;
|
|
161
|
-
}(React.Component);
|
|
162
|
-
}
|