@chaoswise/ui 2.5.2 → 2.5.4
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/lib/Ace/ace.js +6 -7
- package/lib/Ace/diff.js +6 -7
- package/lib/Ace/split.js +6 -7
- package/lib/Antd4Form/FormItemChildren.js +5 -6
- package/lib/CWSelect/antd-select.js +6 -7
- package/lib/CWTable/util.js +1 -1
- package/lib/CWTree/index.js +65 -64
- package/lib/CWUpload/upload/Upload.js +5 -6
- package/lib/CWUpload/upload/UploadList.js +5 -6
- package/lib/Checkbox/Checkbox.js +6 -7
- package/lib/Checkbox/Group.js +6 -7
- package/lib/ErrorBoundary/index.js +6 -7
- package/lib/Menu/menu/MenuItem.js +5 -6
- package/lib/Menu/menu/SubMenu.js +5 -6
- package/lib/Menu/menu/index.js +6 -8
- package/lib/Modal/Modal.js +6 -7
- package/lib/ModuleFederation/ErrorBoundary/index.js +5 -6
- package/lib/Radio/Group.js +6 -7
- package/lib/Radio/Radio.js +6 -7
- package/lib/SiderMenu/Item.js +5 -6
- package/lib/SingleSpa/hooks/useErrorHandle.js +65 -0
- package/lib/SingleSpa/hooks/useModel.js +31 -0
- package/lib/SingleSpa/import-html/utils.js +14 -11
- package/lib/SingleSpa/index.js +35 -13
- package/lib/SingleSpa/singleSpa/single-spa.dev.js +11 -6
- package/lib/SingleSpa/system/amd.js +1 -0
- package/lib/SingleSpa/system/system.js +23 -16
- package/lib/SingleSpa/utils.js +15 -2
- package/lib/Table/index.js +29 -2
- package/lib/Table/util.js +15 -0
- package/lib/TimeRangeSlider/Refresh/index.js +161 -0
- package/lib/TimeRangeSlider/Refresh/index.less +26 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/assets/LimitAreaSvg.js +110 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/BottomSlider/BottomPlaceholder.js +70 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/BottomSlider/BottomTimeDateProcess.js +36 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/BottomSlider/index.js +38 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/BottomSlider/index.less +113 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/TopSlider/TopDateProcess.js +36 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/TopSlider/TopPlaceholder.js +36 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/TopSlider/index.js +31 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/components/TopSlider/index.less +79 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useHover.js +31 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useMouse.js +325 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/index.js +73 -0
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/utils/index.js +227 -0
- package/lib/TimeRangeSlider/TimeSpan/index.js +81 -0
- package/lib/TimeRangeSlider/TimeSpan/index.less +12 -0
- package/lib/TimeRangeSlider/assets/Calendar.js +15 -0
- package/lib/TimeRangeSlider/assets/Calendar2.js +15 -0
- package/lib/TimeRangeSlider/assets/Recover.js +18 -0
- package/lib/TimeRangeSlider/assets/Refresh1.js +14 -0
- package/lib/TimeRangeSlider/assets/Refresh2.js +14 -0
- package/lib/TimeRangeSlider/assets/Refresh3.js +14 -0
- package/lib/TimeRangeSlider/assets/live.js +19 -0
- package/lib/TimeRangeSlider/assets/more.js +23 -0
- package/lib/TimeRangeSlider/index.js +480 -0
- package/lib/TimeRangeSlider/index.less +122 -0
- package/lib/TimeRangeSlider/locale/en_US.js +29 -0
- package/lib/TimeRangeSlider/locale/index.js +11 -0
- package/lib/TimeRangeSlider/locale/zh_CN.js +29 -0
- package/lib/TimeRangeSlider/locale/zh_TW.js +29 -0
- package/lib/TimeRangeSlider/utils/index.js +712 -0
- package/lib/TooltipText/ResizeObserverManager.js +56 -0
- package/lib/TooltipText/index.js +50 -60
- package/package.json +3 -3
- package/lib/Col/Collapse.less +0 -129
- package/lib/Select/TreeSelect.less +0 -10
- package/lib/Tree/TreeSelect.less +0 -10
|
@@ -4,13 +4,13 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
4
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function
|
|
8
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
-
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); }; }
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
8
|
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); }
|
|
11
9
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
11
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
+
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); }
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
14
|
var __rest = this && this.__rest || function (s, e) {
|
|
15
15
|
var t = {};
|
|
16
16
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -35,11 +35,10 @@ import Tooltip from 'antd/es/tooltip';
|
|
|
35
35
|
import { SiderContext } from 'antd/es/layout/Sider';
|
|
36
36
|
var MenuItem = /*#__PURE__*/function (_React$Component) {
|
|
37
37
|
_inherits(MenuItem, _React$Component);
|
|
38
|
-
var _super = _createSuper(MenuItem);
|
|
39
38
|
function MenuItem() {
|
|
40
39
|
var _this;
|
|
41
40
|
_classCallCheck(this, MenuItem);
|
|
42
|
-
_this =
|
|
41
|
+
_this = _callSuper(this, MenuItem, arguments);
|
|
43
42
|
_this.onKeyDown = function (e) {
|
|
44
43
|
_this.menuItem.onKeyDown(e);
|
|
45
44
|
};
|
package/lib/Menu/menu/SubMenu.js
CHANGED
|
@@ -4,13 +4,13 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
4
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function
|
|
8
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
-
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); }; }
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
8
|
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); }
|
|
11
9
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
11
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
+
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); }
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
14
|
/*
|
|
15
15
|
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
16
16
|
* @Date: 2022-12-12 15:56:53
|
|
@@ -27,11 +27,10 @@ import classNames from 'classnames';
|
|
|
27
27
|
import MenuContext from './MenuContext';
|
|
28
28
|
var SubMenu = /*#__PURE__*/function (_React$Component) {
|
|
29
29
|
_inherits(SubMenu, _React$Component);
|
|
30
|
-
var _super = _createSuper(SubMenu);
|
|
31
30
|
function SubMenu() {
|
|
32
31
|
var _this;
|
|
33
32
|
_classCallCheck(this, SubMenu);
|
|
34
|
-
_this =
|
|
33
|
+
_this = _callSuper(this, SubMenu, arguments);
|
|
35
34
|
_this.onKeyDown = function (e) {
|
|
36
35
|
_this.subMenu.onKeyDown(e);
|
|
37
36
|
};
|
package/lib/Menu/menu/index.js
CHANGED
|
@@ -5,13 +5,13 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
5
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
function
|
|
9
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
-
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); }; }
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
9
|
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); }
|
|
12
10
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
13
|
-
function _isNativeReflectConstruct() {
|
|
11
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
12
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
13
|
+
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); }
|
|
14
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
15
|
// @ts-nocheck
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import RcMenu, { Divider, ItemGroup } from 'rc-menu';
|
|
@@ -28,11 +28,10 @@ import collapseMotion from 'antd/es/_util/motion';
|
|
|
28
28
|
import MenuContext from './MenuContext';
|
|
29
29
|
var InternalMenu = /*#__PURE__*/function (_React$Component) {
|
|
30
30
|
_inherits(InternalMenu, _React$Component);
|
|
31
|
-
var _super = _createSuper(InternalMenu);
|
|
32
31
|
function InternalMenu(props) {
|
|
33
32
|
var _this;
|
|
34
33
|
_classCallCheck(this, InternalMenu);
|
|
35
|
-
_this =
|
|
34
|
+
_this = _callSuper(this, InternalMenu, [props]);
|
|
36
35
|
// Restore vertical mode when menu is collapsed responsively when mounted
|
|
37
36
|
// https://github.com/ant-design/ant-design/issues/13104
|
|
38
37
|
// TODO: not a perfect solution, looking a new way to avoid setting switchingModeFromInline in this situation
|
|
@@ -263,10 +262,9 @@ polyfill(InternalMenu);
|
|
|
263
262
|
// We should keep this as ref-able
|
|
264
263
|
var Menu = /*#__PURE__*/function (_React$Component2) {
|
|
265
264
|
_inherits(Menu, _React$Component2);
|
|
266
|
-
var _super2 = _createSuper(Menu);
|
|
267
265
|
function Menu() {
|
|
268
266
|
_classCallCheck(this, Menu);
|
|
269
|
-
return
|
|
267
|
+
return _callSuper(this, Menu, arguments);
|
|
270
268
|
}
|
|
271
269
|
_createClass(Menu, [{
|
|
272
270
|
key: "render",
|
package/lib/Modal/Modal.js
CHANGED
|
@@ -9,13 +9,13 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
9
9
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
10
|
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
11
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
function
|
|
13
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
-
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); }; }
|
|
12
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
13
|
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
|
-
function
|
|
17
|
-
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; } }
|
|
14
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
15
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
17
|
+
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); }
|
|
18
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
19
19
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
20
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
21
21
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -23,11 +23,10 @@ import React, { Component } from 'react';
|
|
|
23
23
|
import CloseSvg from './assets/Close';
|
|
24
24
|
var AntDraggableModal = /*#__PURE__*/function (_Component) {
|
|
25
25
|
_inherits(AntDraggableModal, _Component);
|
|
26
|
-
var _super = _createSuper(AntDraggableModal);
|
|
27
26
|
function AntDraggableModal(props) {
|
|
28
27
|
var _this;
|
|
29
28
|
_classCallCheck(this, AntDraggableModal);
|
|
30
|
-
_this =
|
|
29
|
+
_this = _callSuper(this, AntDraggableModal, [props]);
|
|
31
30
|
_defineProperty(_assertThisInitialized(_this), "handleMove", function (event) {
|
|
32
31
|
var deltaX = event.pageX - _this.mouseDownX;
|
|
33
32
|
var deltaY = event.pageY - _this.mouseDownY;
|
|
@@ -4,21 +4,20 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
4
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function
|
|
8
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
-
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); }; }
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
8
|
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); }
|
|
11
9
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
11
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
+
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); }
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
14
|
import React from 'react';
|
|
15
15
|
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
16
16
|
_inherits(ErrorBoundary, _React$Component);
|
|
17
|
-
var _super = _createSuper(ErrorBoundary);
|
|
18
17
|
function ErrorBoundary(props) {
|
|
19
18
|
var _this;
|
|
20
19
|
_classCallCheck(this, ErrorBoundary);
|
|
21
|
-
_this =
|
|
20
|
+
_this = _callSuper(this, ErrorBoundary, [props]);
|
|
22
21
|
_this.state = {
|
|
23
22
|
hasError: false
|
|
24
23
|
};
|
package/lib/Radio/Group.js
CHANGED
|
@@ -2,13 +2,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
3
|
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function
|
|
6
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
7
|
-
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); }; }
|
|
5
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
6
|
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); }
|
|
9
|
-
function
|
|
10
|
-
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; } }
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
8
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
9
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
10
|
+
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); }
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -34,11 +34,10 @@ function getCheckedValue(children) {
|
|
|
34
34
|
}
|
|
35
35
|
var RadioGroup = /*#__PURE__*/function (_Component) {
|
|
36
36
|
_inherits(RadioGroup, _Component);
|
|
37
|
-
var _super = _createSuper(RadioGroup);
|
|
38
37
|
function RadioGroup(_props) {
|
|
39
38
|
var _this;
|
|
40
39
|
_classCallCheck(this, RadioGroup);
|
|
41
|
-
_this =
|
|
40
|
+
_this = _callSuper(this, RadioGroup, [_props]);
|
|
42
41
|
_defineProperty(_assertThisInitialized(_this), "onRadioChange", function (ev) {
|
|
43
42
|
var lastValue = _this.state.value;
|
|
44
43
|
var value = ev.target.value;
|
package/lib/Radio/Radio.js
CHANGED
|
@@ -8,13 +8,13 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
8
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
9
|
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
10
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
-
function
|
|
12
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
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); }; }
|
|
11
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
12
|
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); }
|
|
15
|
-
function
|
|
16
|
-
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; } }
|
|
13
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
14
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
15
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
+
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); }
|
|
17
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
18
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
19
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
20
20
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -27,14 +27,13 @@ import PropTypes from "prop-types";
|
|
|
27
27
|
import "./index.less";
|
|
28
28
|
var Radio = /*#__PURE__*/function (_Component) {
|
|
29
29
|
_inherits(Radio, _Component);
|
|
30
|
-
var _super = _createSuper(Radio);
|
|
31
30
|
function Radio() {
|
|
32
31
|
var _this;
|
|
33
32
|
_classCallCheck(this, Radio);
|
|
34
33
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
35
34
|
args[_key] = arguments[_key];
|
|
36
35
|
}
|
|
37
|
-
_this =
|
|
36
|
+
_this = _callSuper(this, Radio, [].concat(args));
|
|
38
37
|
_defineProperty(_assertThisInitialized(_this), "saveCheckbox", function (node) {
|
|
39
38
|
_this.rcCheckbox = node;
|
|
40
39
|
});
|
package/lib/SiderMenu/Item.js
CHANGED
|
@@ -9,13 +9,13 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
9
9
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
11
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
-
function
|
|
13
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
-
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); }; }
|
|
12
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
13
|
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
14
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
17
|
-
function _isNativeReflectConstruct() {
|
|
15
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
17
|
+
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); }
|
|
18
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
19
19
|
/*
|
|
20
20
|
* @Author: andrew.qiao andrew.qiao@cloudwise.com
|
|
21
21
|
* @Date: 2022-12-08 16:09:20
|
|
@@ -30,10 +30,9 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
30
30
|
import React from 'react';
|
|
31
31
|
var Item = /*#__PURE__*/function (_Menu$Item) {
|
|
32
32
|
_inherits(Item, _Menu$Item);
|
|
33
|
-
var _super = _createSuper(Item);
|
|
34
33
|
function Item(props) {
|
|
35
34
|
_classCallCheck(this, Item);
|
|
36
|
-
return
|
|
35
|
+
return _callSuper(this, Item, [props]);
|
|
37
36
|
}
|
|
38
37
|
_createClass(Item, [{
|
|
39
38
|
key: "render",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { useCallback, useEffect, useState, useRef } from "react";
|
|
14
|
+
import { addErrorHandler, removeErrorHandler } from "../singleSpa/single-spa.dev";
|
|
15
|
+
var useErrorHandle = function useErrorHandle(appId) {
|
|
16
|
+
var timer = useRef(null);
|
|
17
|
+
var _useState = useState({}),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
errorInfoByAppId = _useState2[0],
|
|
20
|
+
setErrorInfoByAppId = _useState2[1];
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
timer.current = setTimeout(function () {
|
|
23
|
+
sessionStorage.setItem('singleSpaErrorCount', 0);
|
|
24
|
+
}, 10000);
|
|
25
|
+
}, []);
|
|
26
|
+
var handleReloadError = useCallback(function (errorInfo) {
|
|
27
|
+
clearTimeout(timer.current);
|
|
28
|
+
var judgeIsMissScript = function judgeIsMissScript(errorInfo) {
|
|
29
|
+
if (errorInfo.includes("Unexpected token '<'")) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
};
|
|
34
|
+
if (errorInfo && judgeIsMissScript(errorInfo)) {
|
|
35
|
+
if (!sessionStorage.getItem('singleSpaErrorCount')) {
|
|
36
|
+
sessionStorage.setItem('singleSpaErrorCount', 0);
|
|
37
|
+
}
|
|
38
|
+
var errorCount = parseInt(sessionStorage.getItem('singleSpaErrorCount'));
|
|
39
|
+
if (errorCount < 3) {
|
|
40
|
+
errorCount++;
|
|
41
|
+
sessionStorage.setItem('singleSpaErrorCount', errorCount);
|
|
42
|
+
window.location.reload();
|
|
43
|
+
} else {
|
|
44
|
+
timer.current = setTimeout(function () {
|
|
45
|
+
sessionStorage.setItem('singleSpaErrorCount', 0);
|
|
46
|
+
}, 3000);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
50
|
+
var errorHandle = useCallback(function (error) {
|
|
51
|
+
var errorAppId = error.appOrParcelName;
|
|
52
|
+
setErrorInfoByAppId(function (pre) {
|
|
53
|
+
return _objectSpread(_objectSpread({}, pre), {}, _defineProperty({}, errorAppId, error.message));
|
|
54
|
+
});
|
|
55
|
+
handleReloadError(error.message);
|
|
56
|
+
}, [handleReloadError]);
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
addErrorHandler(errorHandle);
|
|
59
|
+
return function () {
|
|
60
|
+
removeErrorHandler(errorHandle);
|
|
61
|
+
};
|
|
62
|
+
}, [errorHandle]);
|
|
63
|
+
return errorInfoByAppId[appId];
|
|
64
|
+
};
|
|
65
|
+
export default useErrorHandle;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { createModel } from "hox";
|
|
9
|
+
function useModel() {
|
|
10
|
+
var _useState = useState(null),
|
|
11
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
+
currentAppId = _useState2[0],
|
|
13
|
+
setCurrentAppId = _useState2[1];
|
|
14
|
+
var _useState3 = useState([]),
|
|
15
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
16
|
+
loadedIds = _useState4[0],
|
|
17
|
+
setLoadedIds = _useState4[1];
|
|
18
|
+
var updateCurrentAppId = function updateCurrentAppId(id) {
|
|
19
|
+
return setCurrentAppId(id);
|
|
20
|
+
};
|
|
21
|
+
var updateLoadedIds = function updateLoadedIds(id) {
|
|
22
|
+
return setLoadedIds(loadedIds.concat(id));
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
currentAppId: currentAppId,
|
|
26
|
+
loadedIds: loadedIds,
|
|
27
|
+
updateCurrentAppId: updateCurrentAppId,
|
|
28
|
+
updateLoadedIds: updateLoadedIds
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export default createModel(useModel);
|
|
@@ -84,17 +84,20 @@ export function isModuleScriptSupported() {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// RIC and shim for browsers setTimeout() without it
|
|
87
|
-
export
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
};
|
|
87
|
+
// export const requestIdleCallback =
|
|
88
|
+
// window.requestIdleCallback ||
|
|
89
|
+
// function requestIdleCallback(cb) {
|
|
90
|
+
// const start = Date.now();
|
|
91
|
+
// return setTimeout(() => {
|
|
92
|
+
// cb({
|
|
93
|
+
// didTimeout: false,
|
|
94
|
+
// timeRemaining() {
|
|
95
|
+
// return Math.max(0, 50 - (Date.now() - start));
|
|
96
|
+
// },
|
|
97
|
+
// });
|
|
98
|
+
// }, 1);
|
|
99
|
+
// };
|
|
100
|
+
|
|
98
101
|
export function readResAsString(response, autoDetectCharset) {
|
|
99
102
|
// 未启用自动检测
|
|
100
103
|
if (!autoDetectCharset) {
|
package/lib/SingleSpa/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
|
|
2
|
+
import _Skeleton from "@chaoswise/ui/lib/Skeleton";
|
|
3
|
+
import "@chaoswise/ui/lib/Exception/index.less";
|
|
4
|
+
import _Exception from "@chaoswise/ui/lib/Exception";
|
|
5
|
+
var _excluded = ["apps", "props", "routerPrefix", "style", "routerType"];
|
|
3
6
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -12,16 +15,15 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
12
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
13
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
14
17
|
/* eslint-disable */
|
|
15
|
-
import React, { useEffect, useRef } from 'react';
|
|
16
|
-
import { registerApplication, start, unloadApplication } from './singleSpa/single-spa.dev';
|
|
18
|
+
import React, { useEffect, useRef, useState, useMemo } from 'react';
|
|
19
|
+
import { registerApplication, start, unloadApplication, setUnmountMaxTime, getAppNames } from './singleSpa/single-spa.dev';
|
|
17
20
|
import { SystemCss } from './system/index';
|
|
18
21
|
import { importScripts, hashPrefix, formatUrl, removeStyleAndScript } from './utils';
|
|
19
22
|
import importHTML from './import-html';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var registeredApps = [];
|
|
23
|
+
import useErrorHandle from './hooks/useErrorHandle';
|
|
24
|
+
import useModel from './hooks/useModel';
|
|
25
|
+
// Fixed 子应用阻塞,singleSpa被阻塞
|
|
26
|
+
setUnmountMaxTime(3000, true);
|
|
25
27
|
var storeObj = {};
|
|
26
28
|
var SingleSpa = function SingleSpa(_ref) {
|
|
27
29
|
var _ref$apps = _ref.apps,
|
|
@@ -32,8 +34,19 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
32
34
|
routerPrefix = _ref$routerPrefix === void 0 ? '' : _ref$routerPrefix,
|
|
33
35
|
_ref$style = _ref.style,
|
|
34
36
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
37
|
+
_ref$routerType = _ref.routerType,
|
|
38
|
+
routerType = _ref$routerType === void 0 ? "hash" : _ref$routerType,
|
|
35
39
|
res = _objectWithoutProperties(_ref, _excluded);
|
|
36
40
|
var container = useRef();
|
|
41
|
+
var model = useModel();
|
|
42
|
+
var currentAppId = model.currentAppId;
|
|
43
|
+
var loadedIds = model.loadedIds;
|
|
44
|
+
var loading = useMemo(function () {
|
|
45
|
+
return !loadedIds.includes(currentAppId);
|
|
46
|
+
}, [currentAppId, loadedIds]);
|
|
47
|
+
|
|
48
|
+
// 错误处理
|
|
49
|
+
var errorInfo = useErrorHandle(currentAppId);
|
|
37
50
|
useEffect(function () {
|
|
38
51
|
// 更新路由前缀
|
|
39
52
|
storeObj.routerPrefix = routerPrefix;
|
|
@@ -42,8 +55,9 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
42
55
|
storeObj.container = container.current;
|
|
43
56
|
}, []);
|
|
44
57
|
useEffect(function () {
|
|
58
|
+
var registeredApps = getAppNames();
|
|
45
59
|
apps.filter(function (project) {
|
|
46
|
-
return
|
|
60
|
+
return registeredApps.indexOf(project.id) < 0;
|
|
47
61
|
}).forEach(function (project) {
|
|
48
62
|
if (!project.id || !project.entry) {
|
|
49
63
|
console.error("project.id & project.entry is required!");
|
|
@@ -81,6 +95,7 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
81
95
|
_context.next = 12;
|
|
82
96
|
return importScripts(script).then(function (result) {
|
|
83
97
|
var _result$default;
|
|
98
|
+
model.updateLoadedIds(project.id);
|
|
84
99
|
// 子应用umount周期卸载相关样式(防止样式冲突)
|
|
85
100
|
(_result$default = result["default"]) === null || _result$default === void 0 || (_result$default = _result$default.unmount) === null || _result$default === void 0 || _result$default.push(function () {
|
|
86
101
|
unloadApplication(project.id, {
|
|
@@ -109,14 +124,12 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
109
124
|
}, _callee, null, [[9, 16]]);
|
|
110
125
|
})),
|
|
111
126
|
// 是否展示子应用判断
|
|
112
|
-
hashPrefix(project.id, storeObj), // 给子产品通信
|
|
127
|
+
hashPrefix(project.id, storeObj, routerType, model.updateCurrentAppId), // 给子产品通信
|
|
113
128
|
_objectSpread({
|
|
114
129
|
getContainer: function getContainer() {
|
|
115
130
|
return storeObj.container;
|
|
116
131
|
}
|
|
117
132
|
}, props));
|
|
118
|
-
// 注册过进行标记
|
|
119
|
-
registeredApps.push(project.id);
|
|
120
133
|
});
|
|
121
134
|
start();
|
|
122
135
|
});
|
|
@@ -126,6 +139,15 @@ var SingleSpa = function SingleSpa(_ref) {
|
|
|
126
139
|
}, style)
|
|
127
140
|
}, res, {
|
|
128
141
|
ref: container
|
|
129
|
-
})
|
|
142
|
+
}), errorInfo ? /*#__PURE__*/React.createElement(_Exception, {
|
|
143
|
+
type: "500",
|
|
144
|
+
desc: errorInfo
|
|
145
|
+
}) : null, !errorInfo && loading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Skeleton, {
|
|
146
|
+
active: true
|
|
147
|
+
}), /*#__PURE__*/React.createElement(_Skeleton, {
|
|
148
|
+
active: true
|
|
149
|
+
}), /*#__PURE__*/React.createElement(_Skeleton, {
|
|
150
|
+
active: true
|
|
151
|
+
})) : null);
|
|
130
152
|
};
|
|
131
153
|
export default SingleSpa;
|
|
@@ -919,14 +919,15 @@ function captureRoutingEvents(originalJQueryFunction, nativeFunctionToCall, even
|
|
|
919
919
|
if (typeof eventString !== "string") {
|
|
920
920
|
return originalJQueryFunction.apply(this, originalArgs);
|
|
921
921
|
}
|
|
922
|
+
var _eventString = eventString;
|
|
922
923
|
var eventNames = eventString.split(/\s+/);
|
|
923
924
|
eventNames.forEach(function (eventName) {
|
|
924
925
|
if (routingEventsListeningTo.indexOf(eventName) >= 0) {
|
|
925
926
|
nativeFunctionToCall(eventName, fn);
|
|
926
|
-
|
|
927
|
+
_eventString = eventString.replace(eventName, "");
|
|
927
928
|
}
|
|
928
929
|
});
|
|
929
|
-
if (
|
|
930
|
+
if (_eventString.trim() === "") {
|
|
930
931
|
return this;
|
|
931
932
|
} else {
|
|
932
933
|
return originalJQueryFunction.apply(this, originalArgs);
|
|
@@ -934,6 +935,10 @@ function captureRoutingEvents(originalJQueryFunction, nativeFunctionToCall, even
|
|
|
934
935
|
}
|
|
935
936
|
var appsToUnload = {};
|
|
936
937
|
function toUnloadPromise(app) {
|
|
938
|
+
// TODO 临时修复工作台切换卸载子应用会卸载组件样式的问题
|
|
939
|
+
if (window.location.hash.includes("portal")) {
|
|
940
|
+
return Promise.resolve(app);
|
|
941
|
+
}
|
|
937
942
|
return Promise.resolve().then(function () {
|
|
938
943
|
var unloadInfo = appsToUnload[toName(app)];
|
|
939
944
|
if (!unloadInfo) {
|
|
@@ -1183,7 +1188,7 @@ function validateRegisterWithConfig(config) {
|
|
|
1183
1188
|
if (!validCustomProps(config.customProps)) throw Error(formatErrorMessage(22, "The optional config.customProps must be an object"));
|
|
1184
1189
|
}
|
|
1185
1190
|
function validCustomProps(customProps) {
|
|
1186
|
-
return !customProps || typeof customProps === "function" || _typeof(customProps) === "object" && customProps
|
|
1191
|
+
return !customProps || typeof customProps === "function" || _typeof(customProps) === "object" && customProps != null && !Array.isArray(customProps);
|
|
1187
1192
|
}
|
|
1188
1193
|
function sanitizeArguments(appNameOrConfig, appOrLoadApp, activeWhen, customProps) {
|
|
1189
1194
|
var usingObjectAPI = _typeof(appNameOrConfig) === "object";
|
|
@@ -1443,9 +1448,9 @@ function reroute() {
|
|
|
1443
1448
|
};
|
|
1444
1449
|
function addApp(app, status) {
|
|
1445
1450
|
var appName = toName(app);
|
|
1446
|
-
|
|
1447
|
-
newAppStatuses[appName] =
|
|
1448
|
-
var statusArr = appsByNewStatus[
|
|
1451
|
+
var _status = status || getAppStatus(appName);
|
|
1452
|
+
newAppStatuses[appName] = _status;
|
|
1453
|
+
var statusArr = appsByNewStatus[_status] = appsByNewStatus[_status] || [];
|
|
1449
1454
|
statusArr.push(appName);
|
|
1450
1455
|
}
|
|
1451
1456
|
}
|