jrs-react 1.1.29 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jrs-react",
3
- "version": "1.1.29",
3
+ "version": "1.2.1",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.es.js",
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import axios from 'axios'
3
3
  import { colonValueString, flexType, po } from './JRUtils'
4
4
  import { displaySpinner } from './LoadingBar'
5
- // import msg from '../jrx/IMessage'
5
+ import msg from './Message'
6
6
  import styled from 'styled-components'
7
7
 
8
8
 
@@ -274,11 +274,11 @@ export default class JRSubmit extends React.Component {
274
274
  this.setRes(isSuccess,response,config)
275
275
  if (isSuccess) {
276
276
  if (config.successMessage) {
277
- // msg.success({ message:config.successMessage });+++++++++++++++++++++
277
+ msg.success({ message:config.successMessage })
278
278
  }
279
279
  } else {
280
280
  if (config.failedMessage) {
281
- // msg.error({ message:config.failedMessage });+++++++++++++++++++++++
281
+ msg.error({ message:config.failedMessage })
282
282
  }
283
283
  }
284
284
  config.callback?.bind(this)(isSuccess,response,payload)
@@ -0,0 +1,53 @@
1
+ import { message } from "antd";
2
+ import { CloseOutlined } from "@ant-design/icons";
3
+
4
+ message.config({ duration: 3 });
5
+
6
+ const info = (props) => {
7
+ const key = Date.now();
8
+ message.info({
9
+ content: props.message,
10
+ className: "info",
11
+ key,
12
+ ...props
13
+ });
14
+ };
15
+
16
+ const success = (props) => {
17
+ const key = Date.now();
18
+ message.success({
19
+ content: props.message,
20
+ className: "success",
21
+ key,
22
+ ...props
23
+ });
24
+ };
25
+
26
+ const warning = (props) => {
27
+ const key = Date.now();
28
+ message.warning({
29
+ content:props.message,
30
+ className: "warning",
31
+ key,
32
+ ...props
33
+ });
34
+ };
35
+
36
+ const error = (props) => {
37
+ const key = Date.now();
38
+ message.error({
39
+ content: props.message,
40
+ className: "error",
41
+ key,
42
+ ...props
43
+ });
44
+ };
45
+
46
+ const msg = {
47
+ info,
48
+ success,
49
+ warning,
50
+ error
51
+ };
52
+
53
+ export default msg;
package/src/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import JRSubmit from './components/JRSubmit'
2
+ import JRFrame from './components/JRFrame/JRFrame'
3
+ // import JRTable from './components/JRTable/JRTable'
2
4
  import JRTestReact from './components/JRTest'
3
5
  export {
4
6
  JRTestReact
5
- ,JRSubmit
7
+ ,JRSubmit,JRFrame//,JRTable
6
8
  }