@lingxiteam/assets 1.0.11 → 1.0.12

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.
Files changed (137) hide show
  1. package/es/dealDsl/preprocess/common.js +27 -16
  2. package/es/error/errorDisplay/Web/Drawer/Drawer.less +31 -0
  3. package/es/error/errorDisplay/Web/Drawer/index.js +12 -4
  4. package/es/error/errorDisplay/Web/ErrorMsg/index.js +27 -4
  5. package/es/error/errorDisplay/Web/Notification/index.js +22 -11
  6. package/es/rootConfig/mobile/BusiComp.js +1 -1
  7. package/es/rootConfig/mobile/MobileModal.js +1 -1
  8. package/es/rootConfig/mobile/MobilePopover.js +1 -1
  9. package/es/rootConfig/pc/BusiComp.js +1 -1
  10. package/es/rootConfig/pc/Drawer.js +1 -1
  11. package/es/rootConfig/pc/Modal.js +1 -1
  12. package/es/rootConfig/pc/Popover.js +1 -1
  13. package/es/rootConfig/todoActionList.js +1 -1
  14. package/es/rootConfig/todoOptionList.js +1 -1
  15. package/es/theme/bin/cucc/theme.js +275 -0
  16. package/es/theme/bin/cucc/theme.less +272 -0
  17. package/es/theme/bin/cucc/theme.scss +272 -0
  18. package/es/theme/bin/default/theme.js +275 -0
  19. package/es/theme/bin/default/theme.less +272 -0
  20. package/es/theme/bin/default/theme.scss +272 -0
  21. package/es/theme/build.js +42 -0
  22. package/es/theme/src/cucc/index.js +131 -0
  23. package/es/theme/src/default/index.js +131 -0
  24. package/es/theme/utils/colorPaletteMixin.js +59 -0
  25. package/es/theme/utils/px2Num.js +12 -0
  26. package/es/theme/utils/renderColors.js +16 -0
  27. package/lib/IconSvg/index.d.ts +6 -0
  28. package/lib/IconSvg/index.js +30 -0
  29. package/lib/dealDsl/PropType.d.ts +7 -0
  30. package/lib/dealDsl/PropType.js +5 -0
  31. package/lib/dealDsl/events/actionObj.d.ts +3 -0
  32. package/lib/dealDsl/events/actionObj.js +13 -0
  33. package/lib/dealDsl/events/index.d.ts +6 -0
  34. package/lib/dealDsl/events/index.js +21 -0
  35. package/lib/dealDsl/index.d.ts +2 -0
  36. package/lib/dealDsl/index.js +31 -0
  37. package/lib/dealDsl/preprocess/common.d.ts +9 -0
  38. package/lib/dealDsl/preprocess/common.js +277 -0
  39. package/lib/dealDsl/preprocess/editor.d.ts +9 -0
  40. package/lib/dealDsl/preprocess/editor.js +28 -0
  41. package/lib/dealDsl/preprocess/engine.d.ts +9 -0
  42. package/lib/dealDsl/preprocess/engine.js +26 -0
  43. package/lib/dealDsl/preprocessDSL.d.ts +21 -0
  44. package/lib/dealDsl/preprocessDSL.js +88 -0
  45. package/lib/dealDsl/utils/index.d.ts +13 -0
  46. package/lib/dealDsl/utils/index.js +29 -0
  47. package/lib/error/errorCatch/index.js +48 -0
  48. package/lib/error/errorDisplay/Mobile/Drawer/Drawer.js +115 -0
  49. package/lib/error/errorDisplay/Mobile/Drawer/Drawer.less +201 -0
  50. package/lib/error/errorDisplay/Mobile/Drawer/index.js +140 -0
  51. package/lib/error/errorDisplay/Mobile/ErrorMsg/index.js +207 -0
  52. package/lib/error/errorDisplay/Mobile/Modal/Modal.js +53 -0
  53. package/lib/error/errorDisplay/Mobile/Modal/Modal.less +146 -0
  54. package/lib/error/errorDisplay/Mobile/Modal/index.js +127 -0
  55. package/lib/error/errorDisplay/Mobile/defaultGlobalConfig.js +21 -0
  56. package/lib/error/errorDisplay/SVGstring.js +18 -0
  57. package/lib/error/errorDisplay/Web/Drawer/Drawer.js +274 -0
  58. package/lib/error/errorDisplay/Web/Drawer/Drawer.less +420 -0
  59. package/lib/error/errorDisplay/Web/Drawer/DrawerConnect.js +213 -0
  60. package/lib/error/errorDisplay/Web/Drawer/index.js +142 -0
  61. package/lib/error/errorDisplay/Web/ErrorMsg/index.js +301 -0
  62. package/lib/error/errorDisplay/Web/Notification/Notice.js +161 -0
  63. package/lib/error/errorDisplay/Web/Notification/Notification.js +149 -0
  64. package/lib/error/errorDisplay/Web/Notification/Notification.less +137 -0
  65. package/lib/error/errorDisplay/Web/Notification/index.js +104 -0
  66. package/lib/error/errorDisplay/Web/defaultGlobalConfig.js +29 -0
  67. package/lib/error/errorDisplay/animation.less +112 -0
  68. package/lib/error/errorDisplay/compUtils.js +52 -0
  69. package/lib/error/errorDisplay/const.js +83 -0
  70. package/lib/error/errorDisplay/http.js +103 -0
  71. package/lib/error/errorDisplay/variables.less +1 -0
  72. package/lib/error/index.js +34 -0
  73. package/lib/images/ico-back.png +0 -0
  74. package/lib/index.d.ts +9 -0
  75. package/lib/rootConfig/index.d.ts +5 -0
  76. package/lib/rootConfig/index.js +28 -0
  77. package/lib/rootConfig/mobile/BusiComp.d.ts +66 -0
  78. package/lib/rootConfig/mobile/BusiComp.js +88 -0
  79. package/lib/rootConfig/mobile/MobileModal.d.ts +114 -0
  80. package/lib/rootConfig/mobile/MobileModal.js +140 -0
  81. package/lib/rootConfig/mobile/MobilePopover.d.ts +81 -0
  82. package/lib/rootConfig/mobile/MobilePopover.js +89 -0
  83. package/lib/rootConfig/mobile/index.d.ts +4 -0
  84. package/lib/rootConfig/mobile/index.js +34 -0
  85. package/lib/rootConfig/mobile/page.d.ts +157 -0
  86. package/lib/rootConfig/mobile/page.js +161 -0
  87. package/lib/rootConfig/pc/BusiComp.d.ts +66 -0
  88. package/lib/rootConfig/pc/BusiComp.js +88 -0
  89. package/lib/rootConfig/pc/Drawer.d.ts +150 -0
  90. package/lib/rootConfig/pc/Drawer.js +203 -0
  91. package/lib/rootConfig/pc/Modal.d.ts +160 -0
  92. package/lib/rootConfig/pc/Modal.js +195 -0
  93. package/lib/rootConfig/pc/Popover.d.ts +90 -0
  94. package/lib/rootConfig/pc/Popover.js +104 -0
  95. package/lib/rootConfig/pc/index.d.ts +5 -0
  96. package/lib/rootConfig/pc/index.js +41 -0
  97. package/lib/rootConfig/pc/page.d.ts +146 -0
  98. package/lib/rootConfig/pc/page.js +153 -0
  99. package/lib/rootConfig/todoActionList.d.ts +3082 -0
  100. package/lib/rootConfig/todoActionList.js +3600 -0
  101. package/lib/rootConfig/todoOptionList.d.ts +1466 -0
  102. package/lib/rootConfig/todoOptionList.js +1685 -0
  103. package/lib/security/const.d.ts +22 -0
  104. package/lib/security/const.js +38 -0
  105. package/lib/security/encipher/aes.d.ts +2 -0
  106. package/lib/security/encipher/aes.js +35 -0
  107. package/lib/security/encipher/des.d.ts +2 -0
  108. package/lib/security/encipher/des.js +34 -0
  109. package/lib/security/encipher/rsa.d.ts +2 -0
  110. package/lib/security/encipher/rsa.js +26 -0
  111. package/lib/security/encipher/sign.d.ts +6 -0
  112. package/lib/security/encipher/sign.js +102 -0
  113. package/lib/security/fetch.d.ts +9 -0
  114. package/lib/security/fetch.js +212 -0
  115. package/lib/security/httpEncryption.js +83 -0
  116. package/lib/security/index.d.ts +39 -0
  117. package/lib/security/index.js +29 -0
  118. package/lib/svg/check.svg +10 -0
  119. package/lib/svg/normal-check.svg +10 -0
  120. package/lib/svg/webViewError.svg +40 -0
  121. package/lib/theme/bin/cucc/theme.js +277 -0
  122. package/lib/theme/bin/cucc/theme.less +272 -0
  123. package/lib/theme/bin/cucc/theme.scss +272 -0
  124. package/lib/theme/bin/default/theme.js +277 -0
  125. package/lib/theme/bin/default/theme.less +272 -0
  126. package/lib/theme/bin/default/theme.scss +272 -0
  127. package/lib/theme/build.js +44 -0
  128. package/lib/theme/src/cucc/index.js +133 -0
  129. package/lib/theme/src/default/index.js +133 -0
  130. package/lib/theme/utils/colorPaletteMixin.js +61 -0
  131. package/lib/theme/utils/px2Num.js +14 -0
  132. package/lib/theme/utils/renderColors.js +18 -0
  133. package/lib/utils/img.d.ts +1 -0
  134. package/lib/utils/img.js +10 -0
  135. package/lib/utils/url.d.ts +16 -0
  136. package/lib/utils/url.js +111 -0
  137. package/package.json +6 -3
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.drawerHandel = exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactDom = require("react-dom");
9
+ var _Drawer = _interopRequireDefault(require("./Drawer"));
10
+ var _DrawerConnect = _interopRequireDefault(require("./DrawerConnect"));
11
+ var _excluded = ["open"],
12
+ _excluded2 = ["getContainer", "visible"];
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ 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); }
17
+ 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); }
18
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
19
+ 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."); }
20
+ 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); }
21
+ 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; }
22
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
23
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
+ 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; }
25
+ 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; }
26
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
28
+ 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; }
29
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
30
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
31
+ var drawerNbr = 0;
32
+ var drawerInstances = {};
33
+ function getDrawerInstance() {
34
+ var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35
+ var callback = arguments.length > 1 ? arguments[1] : undefined;
36
+ var cacheKey = "lx-drawer-".concat(drawerNbr);
37
+ var cacheInstance = drawerInstances[cacheKey];
38
+ if (cacheInstance) {
39
+ Promise.resolve(cacheInstance).then(function (instance) {
40
+ callback({
41
+ instance: instance
42
+ });
43
+ });
44
+ return;
45
+ }
46
+ drawerInstances[cacheKey] = new Promise(function (resolve) {
47
+ var newParams = _objectSpread({
48
+ cacheKey: cacheKey
49
+ }, args);
50
+ _DrawerConnect.default.insert(newParams, function (drawerInstance) {
51
+ resolve(drawerInstance);
52
+ callback({
53
+ instance: drawerInstance,
54
+ close: function close() {
55
+ drawerInstance === null || drawerInstance === void 0 ? void 0 : drawerInstance.close(cacheKey);
56
+ },
57
+ update: function update() {
58
+ var prarms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
59
+ drawerInstance === null || drawerInstance === void 0 ? void 0 : drawerInstance.update(_objectSpread(_objectSpread({}, prarms), {}, {
60
+ key: cacheKey
61
+ }));
62
+ },
63
+ key: cacheKey
64
+ });
65
+ });
66
+ });
67
+ drawerNbr += 1;
68
+ }
69
+ var drawerHandel = {
70
+ open: function open(options) {
71
+ return new Promise(function (resolve) {
72
+ getDrawerInstance(options, function (_ref) {
73
+ var instance = _ref.instance,
74
+ _close = _ref.close,
75
+ update = _ref.update,
76
+ key = _ref.key;
77
+ var _ref2 = instance || {},
78
+ open = _ref2.open,
79
+ otherInstace = _objectWithoutProperties(_ref2, _excluded);
80
+ open(options);
81
+ drawerHandel.key = key;
82
+ resolve(_objectSpread(_objectSpread({}, otherInstace), {}, {
83
+ close: function close() {
84
+ if ((options === null || options === void 0 ? void 0 : options.onClose) instanceof Function) {
85
+ options === null || options === void 0 ? void 0 : options.onClose();
86
+ }
87
+ if (_close instanceof Function) {
88
+ _close();
89
+ }
90
+ },
91
+ update: update
92
+ }));
93
+ });
94
+ });
95
+ },
96
+ close: function close() {
97
+ var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : drawerHandel.key;
98
+ Object.keys(drawerInstances).forEach(function (cacheKey) {
99
+ Promise.resolve(drawerInstances[cacheKey]).then(function (instance) {
100
+ if (instance === null || instance === void 0 ? void 0 : instance.remove) {
101
+ instance.remove(key);
102
+ } else {
103
+ instance.close(key);
104
+ }
105
+ });
106
+ delete drawerInstances[cacheKey];
107
+ });
108
+ }
109
+ };
110
+ exports.drawerHandel = drawerHandel;
111
+ var _default = function _default(props) {
112
+ var _props$getContainer = props.getContainer,
113
+ getContainer = _props$getContainer === void 0 ? function () {
114
+ return document.body;
115
+ } : _props$getContainer,
116
+ _props$visible = props.visible,
117
+ visible = _props$visible === void 0 ? false : _props$visible,
118
+ otherProps = _objectWithoutProperties(props, _excluded2);
119
+ var _useState = (0, _react.useState)(visible),
120
+ _useState2 = _slicedToArray(_useState, 2),
121
+ openVis = _useState2[0],
122
+ setOpenVis = _useState2[1];
123
+ var root = getContainer() || document.body;
124
+ var closeTimer;
125
+ (0, _react.useEffect)(function () {
126
+ if (visible) {
127
+ setOpenVis(true);
128
+ } else {
129
+ closeTimer = setTimeout(function () {
130
+ setOpenVis(false);
131
+ clearTimeout(closeTimer);
132
+ }, 200);
133
+ }
134
+ return function () {
135
+ clearTimeout(closeTimer);
136
+ };
137
+ }, [visible]);
138
+ return openVis ? /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_Drawer.default, _extends({
139
+ visible: visible
140
+ }, otherProps)), root) : '';
141
+ };
142
+ exports.default = _default;
@@ -0,0 +1,301 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _Notification = _interopRequireWildcard(require("../Notification"));
9
+ var _Drawer = require("../Drawer");
10
+ var _http = _interopRequireDefault(require("../../http"));
11
+ var _const = require("../../const");
12
+ var _defaultGlobalConfig = require("../defaultGlobalConfig");
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
17
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
18
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
19
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
+ 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; }
22
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
23
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
24
+ 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); }
25
+ var isElm = function isElm(val) {
26
+ return ['number', 'string'].includes(_typeof(val)) || /*#__PURE__*/(0, _react.isValidElement)(val);
27
+ };
28
+ var emptyTxt = '暂无匹配信息,请联系平台管理员';
29
+ var getInstance = function getInstance(placement) {
30
+ return _Notification.notificationInstance["lx-notification-root ".concat(placement)];
31
+ };
32
+ var renderErrList = function renderErrList(errList, opts) {
33
+ var erorrListShowType = opts.erorrListShowType;
34
+ if (Array.isArray(errList) && errList.length > 0) {
35
+ return errList.map(function (item) {
36
+ var _item$guidance, _item$guidance2;
37
+ return {
38
+ key: item === null || item === void 0 ? void 0 : item.errorInfoId,
39
+ title: item === null || item === void 0 ? void 0 : item.errorTypeName,
40
+ code: item === null || item === void 0 ? void 0 : item.errorCode,
41
+ content: item === null || item === void 0 ? void 0 : item.errorMsg,
42
+ status: _const.statusClrMap[item === null || item === void 0 ? void 0 : item.errorType],
43
+ subContent: erorrListShowType === 'innerWindow' && (item === null || item === void 0 ? void 0 : (_item$guidance = item.guidance) === null || _item$guidance === void 0 ? void 0 : _item$guidance.content),
44
+ url: item === null || item === void 0 ? void 0 : (_item$guidance2 = item.guidance) === null || _item$guidance2 === void 0 ? void 0 : _item$guidance2.guidanceUrl,
45
+ extra: (item === null || item === void 0 ? void 0 : item.guidance) && erorrListShowType === 'openDrawer' && /*#__PURE__*/_react.default.createElement("a", {
46
+ onClick: function onClick() {
47
+ var _item$guidance3;
48
+ _Drawer.drawerHandel.open({
49
+ title: item === null || item === void 0 ? void 0 : item.errorTypeName,
50
+ status: _const.statusClrMap[item === null || item === void 0 ? void 0 : item.errorType],
51
+ mode: 'default',
52
+ content: /*#__PURE__*/_react.default.createElement("div", {
53
+ // eslint-disable-next-line react/no-danger
54
+ dangerouslySetInnerHTML: {
55
+ __html: item === null || item === void 0 ? void 0 : (_item$guidance3 = item.guidance) === null || _item$guidance3 === void 0 ? void 0 : _item$guidance3.content
56
+ }
57
+ })
58
+ });
59
+ }
60
+ }, "\u8BE6\u60C5")
61
+ };
62
+ });
63
+ }
64
+ return /*#__PURE__*/_react.default.createElement("div", {
65
+ className: "lx-drawer-empty"
66
+ }, emptyTxt);
67
+ };
68
+ var renderGuidance = function renderGuidance(guidance) {
69
+ return (guidance === null || guidance === void 0 ? void 0 : guidance.title) || (guidance === null || guidance === void 0 ? void 0 : guidance.content) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
70
+ className: "lx-drawer-group-article lx-drawer-article"
71
+ // eslint-disable-next-line react/no-danger
72
+ ,
73
+ dangerouslySetInnerHTML: {
74
+ __html: guidance === null || guidance === void 0 ? void 0 : guidance.content
75
+ }
76
+ }), (guidance === null || guidance === void 0 ? void 0 : guidance.guidanceUrl) ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("a", {
77
+ onClick: function onClick() {
78
+ window.open(guidance === null || guidance === void 0 ? void 0 : guidance.guidanceUrl, '_blank');
79
+ }
80
+ }, "\u6587\u6863\u94FE\u63A5")) : null) : /*#__PURE__*/_react.default.createElement("div", {
81
+ className: "lx-drawer-empty"
82
+ }, emptyTxt);
83
+ };
84
+ var renderTitle = function renderTitle(msg) {
85
+ if (isElm(msg === null || msg === void 0 ? void 0 : msg.title)) {
86
+ return msg.title;
87
+ }
88
+ if (typeof (msg === null || msg === void 0 ? void 0 : msg.code) === 'string') {
89
+ var _msg$code;
90
+ var nbr = msg === null || msg === void 0 ? void 0 : (_msg$code = msg.code) === null || _msg$code === void 0 ? void 0 : _msg$code.split('-')[0];
91
+ return nbr && _const.errTypeTitMap[nbr] ? _const.errTypeTitMap[nbr] : '';
92
+ }
93
+ return '';
94
+ };
95
+ var ErrorMsg = {
96
+ open: function open(msg) {
97
+ var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
98
+ var opts = _objectSpread(_objectSpread({}, _defaultGlobalConfig.defaultGlobalConfig), option);
99
+ if (msg) {
100
+ // 展示个数控制
101
+ if (_defaultGlobalConfig.defaultGlobalConfig.maxCount) {
102
+ var ins = getInstance(opts.placement);
103
+ if (ins) {
104
+ var openList = ins.getOpenList();
105
+ if (openList.length > _defaultGlobalConfig.defaultGlobalConfig.maxCount) {
106
+ openList.slice(0, openList.length - _defaultGlobalConfig.defaultGlobalConfig.maxCount + 1).forEach(function (item) {
107
+ item.close();
108
+ });
109
+ }
110
+ }
111
+ }
112
+
113
+ // 打开错误提示
114
+ _Notification.default.open(_objectSpread({
115
+ title: renderTitle(msg),
116
+ code: msg === null || msg === void 0 ? void 0 : msg.code,
117
+ content: msg === null || msg === void 0 ? void 0 : msg.msg,
118
+ footer: function () {
119
+ var _footer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
120
+ var _msg$resolve;
121
+ var resolve, _ref, feedbackCallback, footerContent;
122
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
123
+ while (1) {
124
+ switch (_context2.prev = _context2.next) {
125
+ case 0:
126
+ _context2.next = 2;
127
+ return (_msg$resolve = msg === null || msg === void 0 ? void 0 : msg.resolve) !== null && _msg$resolve !== void 0 ? _msg$resolve : opts.resolve;
128
+ case 2:
129
+ resolve = _context2.sent;
130
+ _ref = msg || {}, feedbackCallback = _ref.feedbackCallback;
131
+ footerContent = [];
132
+ if (typeof feedbackCallback === 'function') {
133
+ footerContent.push( /*#__PURE__*/_react.default.createElement("a", {
134
+ onClick: function onClick() {
135
+ if (feedbackCallback()) {
136
+ _Notification.default.close();
137
+ }
138
+ }
139
+ }, "\u6545\u969C\u4E0A\u62A5"));
140
+ }
141
+ if (opts.extendFooter) {
142
+ if (typeof opts.footer === 'function') {
143
+ footerContent.push(opts.extendFooter());
144
+ } else {
145
+ footerContent.push(opts.extendFooter);
146
+ }
147
+ }
148
+ if (resolve) {
149
+ footerContent.push( /*#__PURE__*/_react.default.createElement("a", {
150
+ onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
151
+ var _detRes;
152
+ var detRes, url, errMsg;
153
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
154
+ while (1) {
155
+ switch (_context.prev = _context.next) {
156
+ case 0:
157
+ detRes = {};
158
+ if ((resolve === null || resolve === void 0 ? void 0 : resolve.article) || (resolve === null || resolve === void 0 ? void 0 : resolve.extend)) {
159
+ // 已预设解决方案
160
+ detRes = {
161
+ article: resolve === null || resolve === void 0 ? void 0 : resolve.article,
162
+ extend: resolve === null || resolve === void 0 ? void 0 : resolve.extend
163
+ };
164
+ }
165
+ if (!_const.articleMap[msg.code]) {
166
+ _context.next = 6;
167
+ break;
168
+ }
169
+ // 网络异常无法获取解决方案,使用内置的
170
+ detRes = {
171
+ article: _const.articleMap[msg.code],
172
+ extend: []
173
+ };
174
+ _context.next = 21;
175
+ break;
176
+ case 6:
177
+ // 请求后端获取解决方案
178
+
179
+ if (typeof resolve === 'string') {
180
+ url = resolve;
181
+ } else if (_typeof(resolve) === 'object') {
182
+ url = resolve.href;
183
+ }
184
+ if (!url) {
185
+ _context.next = 20;
186
+ break;
187
+ }
188
+ _context.prev = 8;
189
+ _context.next = 11;
190
+ return _http.default.get(url, {
191
+ params: {
192
+ errorCode: msg === null || msg === void 0 ? void 0 : msg.code,
193
+ errorMsg: msg === null || msg === void 0 ? void 0 : msg.msg
194
+ }
195
+ });
196
+ case 11:
197
+ errMsg = _context.sent;
198
+ detRes = {
199
+ article: errMsg === null || errMsg === void 0 ? void 0 : errMsg.guidance,
200
+ extend: errMsg === null || errMsg === void 0 ? void 0 : errMsg.errorInfos
201
+ };
202
+ _context.next = 18;
203
+ break;
204
+ case 15:
205
+ _context.prev = 15;
206
+ _context.t0 = _context["catch"](8);
207
+ // eslint-disable-next-line no-console
208
+ console.error(new Error("ErrorMsg\u7EC4\u4EF6: \u83B7\u53D6\u89E3\u51B3\u65B9\u6848\u5931\u8D25\uFF0C".concat(_context.t0)));
209
+ case 18:
210
+ _context.next = 21;
211
+ break;
212
+ case 20:
213
+ // eslint-disable-next-line no-console
214
+ console.error(new Error('ErrorMsg组件: 无效resolve'));
215
+ case 21:
216
+ _Drawer.drawerHandel.open({
217
+ title: "".concat(renderTitle(msg), "(").concat((msg === null || msg === void 0 ? void 0 : msg.code) || '', ")"),
218
+ status: 'error',
219
+ mode: 'errorInfo',
220
+ content: msg === null || msg === void 0 ? void 0 : msg.stack,
221
+ errorInfoProps: {
222
+ tabs: [{
223
+ key: 'article',
224
+ tab: '解决方案'
225
+ }, {
226
+ key: 'extend',
227
+ tab: '错误信息匹配'
228
+ }],
229
+ tabsActiveKey: 'article',
230
+ tabsContent: renderGuidance((_detRes = detRes) === null || _detRes === void 0 ? void 0 : _detRes.article),
231
+ onTabsChange: function onTabsChange(record) {
232
+ var _detRes2, _detRes3;
233
+ switch (record === null || record === void 0 ? void 0 : record.key) {
234
+ case 'article':
235
+ record.update({
236
+ errorInfoProps: {
237
+ tabsActiveKey: record === null || record === void 0 ? void 0 : record.key,
238
+ tabsContent: renderGuidance((_detRes2 = detRes) === null || _detRes2 === void 0 ? void 0 : _detRes2.article)
239
+ }
240
+ });
241
+ break;
242
+ case 'extend':
243
+ record.update({
244
+ errorInfoProps: {
245
+ tabsActiveKey: record === null || record === void 0 ? void 0 : record.key,
246
+ tabsContent: renderErrList((_detRes3 = detRes) === null || _detRes3 === void 0 ? void 0 : _detRes3.extend, opts)
247
+ }
248
+ });
249
+ break;
250
+ default:
251
+ break;
252
+ }
253
+ }
254
+ },
255
+ footer: typeof feedbackCallback === 'function' ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("a", {
256
+ className: "lx-drawer-btn",
257
+ onClick: function onClick() {
258
+ _Drawer.drawerHandel.close();
259
+ }
260
+ }, "\u53D6 \u6D88"), /*#__PURE__*/_react.default.createElement("a", {
261
+ className: "lx-drawer-btn lx-drawer-btn-primary",
262
+ onClick: function onClick() {
263
+ if (feedbackCallback()) {
264
+ _Drawer.drawerHandel.close();
265
+ }
266
+ }
267
+ }, "\u6545\u969C\u4E0A\u62A5")) : null
268
+ });
269
+ case 22:
270
+ case "end":
271
+ return _context.stop();
272
+ }
273
+ }
274
+ }, _callee, null, [[8, 15]]);
275
+ }))
276
+ }, "\u5F02\u5E38\u5E2E\u52A9"));
277
+ }
278
+ return _context2.abrupt("return", footerContent);
279
+ case 9:
280
+ case "end":
281
+ return _context2.stop();
282
+ }
283
+ }
284
+ }, _callee2);
285
+ }));
286
+ function footer() {
287
+ return _footer.apply(this, arguments);
288
+ }
289
+ return footer;
290
+ }()
291
+ }, opts));
292
+ }
293
+ },
294
+ config: function config() {
295
+ var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
296
+ (0, _defaultGlobalConfig.setGlobalConfig)(option);
297
+ }
298
+ // getInstance,
299
+ };
300
+ var _default = ErrorMsg;
301
+ exports.default = _default;
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _SVGstring = require("../../SVGstring");
10
+ var _img = require("../../../../utils/img");
11
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
+ 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."); }
15
+ 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); }
16
+ 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; }
17
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
18
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
+ var isDomEle = function isDomEle(target) {
20
+ return typeof target === 'string' || /*#__PURE__*/(0, _react.isValidElement)(target);
21
+ };
22
+ var Notice = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
23
+ var title = props.title,
24
+ code = props.code,
25
+ extra = props.extra,
26
+ content = props.content,
27
+ onClose = props.onClose,
28
+ footer = props.footer,
29
+ maxLine = props.maxLine,
30
+ maxLen = props.maxLen,
31
+ duration = props.duration;
32
+ var _useState = (0, _react.useState)(),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ footerContent = _useState2[0],
35
+ setFooterContent = _useState2[1];
36
+ var _useState3 = (0, _react.useState)(!!duration),
37
+ _useState4 = _slicedToArray(_useState3, 2),
38
+ isCountDown = _useState4[0],
39
+ setIsCountDown = _useState4[1];
40
+ var circleRef = (0, _react.useRef)();
41
+ var countDownTime = (0, _react.useRef)(duration);
42
+ var lastTime = (0, _react.useRef)();
43
+ var timer = (0, _react.useRef)();
44
+ var updateCountDown = (0, _react.useCallback)(function (timestamp) {
45
+ lastTime.current = lastTime.current || timestamp;
46
+ var tickInterval = timestamp - lastTime.current;
47
+ if (countDownTime.current - tickInterval > 0) {
48
+ var _circleRef$current;
49
+ countDownTime.current -= tickInterval;
50
+ lastTime.current = timestamp;
51
+ circleRef === null || circleRef === void 0 ? void 0 : (_circleRef$current = circleRef.current) === null || _circleRef$current === void 0 ? void 0 : _circleRef$current.setAttribute('stroke-dasharray', "".concat(57 * (countDownTime.current / duration), " 57"));
52
+ timer.current = window.requestAnimationFrame(updateCountDown);
53
+ } else {
54
+ onClose();
55
+ }
56
+ });
57
+ var autoClose = function autoClose() {
58
+ if (onClose instanceof Function && typeof duration === 'number') {
59
+ setIsCountDown(true);
60
+ timer.current = window.requestAnimationFrame(updateCountDown);
61
+ }
62
+ };
63
+ var stopAutoClose = function stopAutoClose() {
64
+ setIsCountDown(false);
65
+ lastTime.current = null;
66
+ window.cancelAnimationFrame(timer.current);
67
+ };
68
+ (0, _react.useEffect)(function () {
69
+ autoClose();
70
+ return function () {
71
+ stopAutoClose();
72
+ };
73
+ }, [onClose, duration]);
74
+ (0, _react.useEffect)(function () {
75
+ if (typeof footer === 'function') {
76
+ footer({
77
+ title: title,
78
+ content: content,
79
+ handels: {
80
+ stopAutoClose: stopAutoClose,
81
+ autoClose: autoClose,
82
+ onClose: onClose
83
+ }
84
+ }).then(function (els) {
85
+ setFooterContent(els);
86
+ });
87
+ }
88
+ }, []);
89
+ return /*#__PURE__*/_react.default.createElement("div", {
90
+ className: "lx-notification-wraper opening",
91
+ ref: ref,
92
+ onFocus: function onFocus() {
93
+ stopAutoClose();
94
+ },
95
+ onBlur: function onBlur() {
96
+ autoClose();
97
+ },
98
+ onMouseEnter: function onMouseEnter() {
99
+ stopAutoClose();
100
+ },
101
+ onMouseLeave: function onMouseLeave() {
102
+ autoClose();
103
+ }
104
+ }, /*#__PURE__*/_react.default.createElement("div", {
105
+ className: "lx-notification-notice"
106
+ }, isDomEle(title) ? /*#__PURE__*/_react.default.createElement("div", {
107
+ className: "lx-notification-notice-head"
108
+ }, /*#__PURE__*/_react.default.createElement("img", {
109
+ src: (0, _img.getSvgImageBase64)(_SVGstring.WarnIcon),
110
+ alt: "",
111
+ className: "lx-notification-notice-head-state"
112
+ }), /*#__PURE__*/_react.default.createElement("div", {
113
+ className: "lx-notification-notice-head-title"
114
+ }, title, isDomEle(code) ? /*#__PURE__*/_react.default.createElement("span", {
115
+ className: "lx-notification-notice-head-code"
116
+ }, code) : ''), isDomEle(extra) ? /*#__PURE__*/_react.default.createElement("div", {
117
+ className: "lx-notification-notice-head-extra"
118
+ }, extra) : null, isCountDown ? /*#__PURE__*/_react.default.createElement("svg", {
119
+ width: "20",
120
+ height: "20",
121
+ viewBox: "0 0 20 20",
122
+ className: "lx-notification-notice-head-count-down"
123
+ }, /*#__PURE__*/_react.default.createElement("circle", {
124
+ cx: "10",
125
+ cy: "10",
126
+ r: "9",
127
+ strokeWidth: "2",
128
+ stroke: "#D1D3D7",
129
+ fill: "none",
130
+ strokeLinecap: "round"
131
+ }), /*#__PURE__*/_react.default.createElement("circle", {
132
+ cx: "10",
133
+ cy: "10",
134
+ r: "9",
135
+ strokeWidth: "2",
136
+ stroke: "#4477ee",
137
+ fill: "none",
138
+ transform: "matrix(0,-1,1,0,0,20)",
139
+ ref: circleRef,
140
+ strokeDasharray: "57 57",
141
+ strokeLinecap: "round"
142
+ })) : /*#__PURE__*/_react.default.createElement("div", {
143
+ className: "lx-notification-notice-head-extra",
144
+ onClick: function onClick() {
145
+ onClose();
146
+ }
147
+ }, /*#__PURE__*/_react.default.createElement("img", {
148
+ src: (0, _img.getSvgImageBase64)(_SVGstring.CloseIcon),
149
+ alt: "",
150
+ className: "lx-notification-notice-head-ico"
151
+ }))) : null, isDomEle(content) ? /*#__PURE__*/_react.default.createElement("div", {
152
+ className: "lx-notification-notice-content ".concat(maxLine && 'max-line'),
153
+ style: maxLine ? {
154
+ WebkitLineClamp: maxLine
155
+ } : {}
156
+ }, maxLen && typeof content === 'string' && content.length > maxLen ? "".concat(content.slice(0, maxLen), "...") : content) : null, footerContent ? /*#__PURE__*/_react.default.createElement("div", {
157
+ className: "lx-notification-notice-footer"
158
+ }, footerContent) : null));
159
+ });
160
+ var _default = Notice;
161
+ exports.default = _default;