@chaoswise/ui 2.6.1 → 2.6.3

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.
@@ -1,5 +1,4 @@
1
1
  import _Icon from "@chaoswise/ui/lib/Icon";
2
- import "@chaoswise/ui/lib/ErrorBoundary/index.less";
3
2
  import _ErrorBoundary from "@chaoswise/ui/lib/ErrorBoundary";
4
3
  import "@chaoswise/ui/lib/Header/index.less";
5
4
  import _Header from "@chaoswise/ui/lib/Header";
@@ -188,7 +188,7 @@ function Message(props) {
188
188
  };
189
189
  readInnerMessage(params);
190
190
  onClickStrongMessageItem(data);
191
- _CustomNotification.close(id);
191
+ _CustomNotification.destroy(id);
192
192
  },
193
193
  duration: time,
194
194
  prefixCls: "".concat(prefixCls, "-notification"),
@@ -0,0 +1,44 @@
1
+ import _useLocale2 from "@chaoswise/ui/lib/useLocale";
2
+ import React from "react";
3
+ import NoPage from "./assets/images/No-data.png";
4
+ import { formatMessage } from "../utils";
5
+ import langConfig from "./locale";
6
+ var ErrorPage = function ErrorPage() {
7
+ var _useLocale = _useLocale2(langConfig),
8
+ localeObj = _useLocale.langObj,
9
+ _useLocale$locale = _useLocale.locale,
10
+ locale = _useLocale$locale === void 0 ? "zh_CN" : _useLocale$locale;
11
+ return /*#__PURE__*/React.createElement("div", {
12
+ className: "errorBox",
13
+ style: {
14
+ width: "100%",
15
+ height: "100%",
16
+ display: "flex",
17
+ justifyContent: "center",
18
+ flexDirection: "column",
19
+ alignItems: "center",
20
+ fontSize: "16px",
21
+ color: "#333",
22
+ fontWeight: "bold"
23
+ }
24
+ }, /*#__PURE__*/React.createElement("img", {
25
+ src: NoPage,
26
+ alt: "",
27
+ style: {
28
+ maxWidth: 200,
29
+ maxHeight: 200
30
+ }
31
+ }), /*#__PURE__*/React.createElement("div", {
32
+ style: {
33
+ display: "flex"
34
+ }
35
+ }, formatMessage(localeObj["thePageIsMissing"]), /*#__PURE__*/React.createElement("a", {
36
+ onClick: function onClick() {
37
+ window.location.reload();
38
+ },
39
+ style: {
40
+ margin: locale === "en_US" ? "0 3px" : 0
41
+ }
42
+ }, formatMessage(localeObj["refresh"])), formatMessage(localeObj["retry"])));
43
+ };
44
+ export default ErrorPage;
@@ -13,9 +13,8 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
13
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : 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); }
15
15
  import React from 'react';
16
- import NoPage from './assets/images/No-data.png';
17
16
  import './history';
18
- import './index.less';
17
+ import ErrorPage from './ErrorPage';
19
18
  var ErrorBoundary = /*#__PURE__*/function (_React$PureComponent) {
20
19
  function ErrorBoundary(props) {
21
20
  var _this;
@@ -82,24 +81,7 @@ var ErrorBoundary = /*#__PURE__*/function (_React$PureComponent) {
82
81
  key: "render",
83
82
  value: function render() {
84
83
  if (this.state.hasError) {
85
- return /*#__PURE__*/React.createElement("div", {
86
- className: "errorBox"
87
- }, /*#__PURE__*/React.createElement("img", {
88
- src: NoPage,
89
- alt: "",
90
- style: {
91
- maxWidth: 200,
92
- maxHeight: 200
93
- }
94
- }), /*#__PURE__*/React.createElement("div", {
95
- style: {
96
- display: 'flex'
97
- }
98
- }, "\u54CE\u5440\uFF0C\u9875\u9762\u8D70\u4E22\u4E86\uFF0C\u8BF7", /*#__PURE__*/React.createElement("a", {
99
- onClick: function onClick() {
100
- window.location.reload();
101
- }
102
- }, "\u5237\u65B0"), "\u91CD\u8BD5"));
84
+ return /*#__PURE__*/React.createElement(ErrorPage, null);
103
85
  }
104
86
  return this.props.children;
105
87
  }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ thePageIsMissing: "Oops, the page is missing, please",
3
+ refresh: "Refresh",
4
+ retry: "Retry"
5
+ };
@@ -0,0 +1,11 @@
1
+ import zh_CN from './zh_CN.js';
2
+ import en_US from './en_US.js';
3
+ import zh_TW from './zh_TW.js';
4
+ export default {
5
+ zh_CN: zh_CN,
6
+ en_US: en_US,
7
+ zh_TW: zh_TW,
8
+ // 兼容
9
+ zh: zh_CN,
10
+ en: en_US
11
+ };
@@ -0,0 +1,5 @@
1
+ export default {
2
+ thePageIsMissing: "哎呀,页面走丢了,请",
3
+ refresh: "刷新",
4
+ retry: "重试"
5
+ };
@@ -0,0 +1,5 @@
1
+ export default {
2
+ thePageIsMissing: "哎呀,頁面走丟了,請",
3
+ refresh: "刷新",
4
+ retry: "重試"
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaoswise/ui",
3
- "version": "2.6.1",
3
+ "version": "2.6.3",
4
4
  "description": "公共UI库",
5
5
  "keywords": [
6
6
  "ui",
@@ -147,5 +147,6 @@
147
147
  "publishConfig": {
148
148
  "access": "public"
149
149
  },
150
- "license": "MIT"
150
+ "license": "MIT",
151
+ "gitHead": "1ee91e903831067fe007771a07bf5d8ca54ccdd1"
151
152
  }
@@ -1,15 +0,0 @@
1
- .errorBox {
2
- height: 100%;
3
- width: 100%;
4
- display: flex;
5
- display: -ms-flex;
6
- flex-direction: column;
7
- -ms-flex-direction: column;
8
- justify-content: center;
9
- -webkit-justify-content: center;
10
- align-items: center;
11
- -webkit-align-items: center;
12
- font-size: 16px;
13
- color: #333;
14
- font-weight: bold;
15
- }