jrs-react 1.1.11 → 1.1.13

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.11",
3
+ "version": "1.1.13",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.es.js",
@@ -1,10 +1,9 @@
1
- import { po } from "../JRUtils";
1
+ import React from "react";
2
2
  import { TFoot, THead } from "./THead";
3
3
  import { TBodies } from "./TBodies";
4
4
  import { StyledJRTable } from "./StyledJRTable";
5
- import JRFrame from "../JRFrame/JRFrame";
6
- import { Button, Checkbox } from "antd";
7
- import React from "react";
5
+ import JRSubmit from "../JRSubmit";
6
+ // import JRFrame from "../JRFrame/JRFrame";
8
7
 
9
8
 
10
9
  const getMapObject=(map,names)=>{
@@ -27,7 +26,7 @@ const setMapObject=(map,names,value)=>{
27
26
  }
28
27
  }
29
28
 
30
- export default class JRTable extends JRFrame {
29
+ export default class JRTable extends JRSubmit {
31
30
  constructor(props) {
32
31
  super(props)
33
32
  this.colGroupRef = React.createRef()
@@ -44,7 +43,7 @@ export default class JRTable extends JRFrame {
44
43
  checkableColumn(props){
45
44
  return {//方法1
46
45
  render({value,onChange}){
47
- return <Checkbox checked={value} onChange={(e)=>{onChange(e.target.checked)}}/>
46
+ return <checkbox checked={value} onChange={(e)=>{onChange(e.target.checked)}}/>
48
47
  }
49
48
  ,align:'center'
50
49
  ,name:'checked'
@@ -69,12 +68,12 @@ export default class JRTable extends JRFrame {
69
68
  deletableColumn({name='deletable',sendValue,sendName,valueName,...props}){
70
69
  return {
71
70
  render({value,onChange}){
72
- return <Checkbox checked={value} onChange={(e)=>{onChange(e.target.checked)}}/>
71
+ return <checkbox checked={value} onChange={(e)=>{onChange(e.target.checked)}}/>
73
72
  }
74
73
  ,align:'center'
75
74
  ,name
76
75
  ,label(){
77
- return <Button
76
+ return <button
78
77
  onClick={()=>{
79
78
  const value=this.props.delete.value
80
79
  ?? this.getDataSource()?.filter(record=>record[name]).map(record=>sendValue?record[sendValue]:record)
@@ -88,7 +87,7 @@ export default class JRTable extends JRFrame {
88
87
  ,...props
89
88
  })
90
89
  }}
91
- >刪除</Button>
90
+ >刪除</button>
92
91
  }
93
92
  ,...props
94
93
  }
package/src/index.js CHANGED
@@ -1,9 +1,8 @@
1
1
  import JRSubmit from './components/JRSubmit'
2
2
  import JRFrame from './components/JRFrame/JRFrame'
3
- // import JRTable from './components/JRTable/JRTable'
3
+ import JRTable from './components/JRTable/JRTable'
4
4
  import JRTest,{JRTestReact} from './components/JRTest'
5
5
  export {
6
6
  JRTest,JRTestReact
7
- ,JRSubmit,JRFrame//,JRTable
8
-
7
+ ,JRSubmit,JRFrame,JRTable
9
8
  }
@@ -1,89 +0,0 @@
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: (
10
- <>
11
- <div className="message">{props.message}</div>
12
- <CloseOutlined
13
- onClick={() => {
14
- message.destroy(key);
15
- }}
16
- />
17
- </>
18
- ),
19
- className: "info",
20
- key,
21
- ...props
22
- });
23
- };
24
-
25
- const success = (props) => {
26
- const key = Date.now();
27
- message.success({
28
- content: (
29
- <>
30
- <div className="message">{props.message}</div>
31
- <CloseOutlined
32
- onClick={() => {
33
- message.destroy(key);
34
- }}
35
- />
36
- </>
37
- ),
38
- className: "success",
39
- key,
40
- ...props
41
- });
42
- };
43
-
44
- const warning = (props) => {
45
- const key = Date.now();
46
- message.warning({
47
- content: (
48
- <>
49
- <div className="message">{props.message}</div>
50
- <CloseOutlined
51
- onClick={() => {
52
- message.destroy(key);
53
- }}
54
- />
55
- </>
56
- ),
57
- className: "warning",
58
- key,
59
- ...props
60
- });
61
- };
62
-
63
- const error = (props) => {
64
- const key = Date.now();
65
- message.error({
66
- content: (
67
- <>
68
- <div className="message">{props.message}</div>
69
- <CloseOutlined
70
- onClick={() => {
71
- message.destroy(key);
72
- }}
73
- />
74
- </>
75
- ),
76
- className: "error",
77
- key,
78
- ...props
79
- });
80
- };
81
-
82
- const msg = {
83
- info,
84
- success,
85
- warning,
86
- error
87
- };
88
-
89
- export default msg;