@cniot/android-pda-components 0.2.23 → 0.2.27

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 (108) hide show
  1. package/build/assets/{index.5e20b0aa.js → index.57eb17de.js} +1 -1
  2. package/build/index.html +1 -1
  3. package/es/index.cjs.js +7 -0
  4. package/es/index.es.js +2201 -0
  5. package/es/style.css +1 -0
  6. package/package.json +5 -5
  7. package/packages/AppList/doc.jsx +0 -138
  8. package/packages/AppList/index.jsx +0 -33
  9. package/packages/AppList/index.less +0 -52
  10. package/packages/BaseLayout/BarcodeScan.jsx +0 -88
  11. package/packages/BaseLayout/BaseLayoutContainer.jsx +0 -208
  12. package/packages/BaseLayout/RfidOnce.jsx +0 -106
  13. package/packages/BaseLayout/RfidScan.jsx +0 -118
  14. package/packages/BaseLayout/doc.jsx +0 -177
  15. package/packages/BaseLayout/index.jsx +0 -52
  16. package/packages/BaseLayout/index.less +0 -47
  17. package/packages/Button/doc.jsx +0 -62
  18. package/packages/Button/index.jsx +0 -27
  19. package/packages/Button/index.less +0 -62
  20. package/packages/Confirm/doc.jsx +0 -147
  21. package/packages/Confirm/index.jsx +0 -71
  22. package/packages/Confirm/index.less +0 -55
  23. package/packages/Header/doc.jsx +0 -171
  24. package/packages/Header/index.jsx +0 -191
  25. package/packages/Header/index.less +0 -71
  26. package/packages/InfoCard/doc.jsx +0 -244
  27. package/packages/InfoCard/index.jsx +0 -67
  28. package/packages/InfoCard/index.less +0 -111
  29. package/packages/List/doc.jsx +0 -89
  30. package/packages/List/index.jsx +0 -54
  31. package/packages/List/index.less +0 -43
  32. package/packages/Overlay/doc.jsx +0 -103
  33. package/packages/Overlay/index.jsx +0 -42
  34. package/packages/Overlay/index.less +0 -28
  35. package/packages/PdaActionSheet/doc.jsx +0 -193
  36. package/packages/PdaActionSheet/index.jsx +0 -44
  37. package/packages/PdaActionSheet/index.less +0 -65
  38. package/packages/PdaDistanceCard/doc.jsx +0 -62
  39. package/packages/PdaDistanceCard/index.jsx +0 -35
  40. package/packages/PdaDistanceCard/index.less +0 -42
  41. package/packages/PdaFinishCard/doc.jsx +0 -111
  42. package/packages/PdaFinishCard/index.jsx +0 -62
  43. package/packages/PdaFinishCard/index.less +0 -62
  44. package/packages/PdaInfiniteScroll/doc.jsx +0 -121
  45. package/packages/PdaInfiniteScroll/index.jsx +0 -114
  46. package/packages/PdaInfiniteScroll/index.less +0 -12
  47. package/packages/PdaInfiniteScroll/utils.jsx +0 -25
  48. package/packages/PdaSteps/PdaStep/index.jsx +0 -38
  49. package/packages/PdaSteps/PdaStep/index.less +0 -70
  50. package/packages/PdaSteps/PdaSteps/index.jsx +0 -33
  51. package/packages/PdaSteps/PdaSteps/index.less +0 -0
  52. package/packages/PdaSteps/doc.jsx +0 -131
  53. package/packages/PdaSteps/index.jsx +0 -5
  54. package/packages/PdaTitle/doc.jsx +0 -102
  55. package/packages/PdaTitle/index.jsx +0 -51
  56. package/packages/Presentation/doc.jsx +0 -72
  57. package/packages/Presentation/index.jsx +0 -25
  58. package/packages/Presentation/index.less +0 -31
  59. package/packages/SelectCard/doc.jsx +0 -57
  60. package/packages/SelectCard/index.jsx +0 -13
  61. package/packages/SelectCard/index.less +0 -30
  62. package/packages/SimpleCard/doc.jsx +0 -59
  63. package/packages/SimpleCard/index.jsx +0 -13
  64. package/packages/SimpleCard/index.less +0 -38
  65. package/packages/SimpleCardBlock/doc.jsx +0 -77
  66. package/packages/SimpleCardBlock/index.jsx +0 -43
  67. package/packages/SimpleCardBlock/index.less +0 -26
  68. package/packages/SubCard/doc.jsx +0 -63
  69. package/packages/SubCard/index.jsx +0 -28
  70. package/packages/SubCard/index.less +0 -64
  71. package/packages/Tag/doc.jsx +0 -47
  72. package/packages/Tag/index.jsx +0 -12
  73. package/packages/Tag/index.less +0 -22
  74. package/packages/TaskCard/doc.jsx +0 -151
  75. package/packages/TaskCard/index.jsx +0 -65
  76. package/packages/TaskCard/index.less +0 -101
  77. package/packages/Toast/doc.jsx +0 -112
  78. package/packages/Toast/index.jsx +0 -7
  79. package/packages/Toast/index.less +0 -23
  80. package/packages/Toast/methods.jsx +0 -77
  81. package/packages/Toast/toast.jsx +0 -96
  82. package/packages/WakeKeyborard/doc.jsx +0 -170
  83. package/packages/WakeKeyborard/index.jsx +0 -61
  84. package/packages/WakeKeyborard/index.less +0 -55
  85. package/packages/WakeKeyborard/keyborard.jsx +0 -61
  86. package/packages/doc.jsx +0 -19
  87. package/packages/global.less +0 -7
  88. package/packages/index.jsx +0 -60
  89. package/packages/index.less +0 -3
  90. package/packages/pageflow-system-pages/alert/doc.jsx +0 -70
  91. package/packages/pageflow-system-pages/alert/index.jsx +0 -22
  92. package/packages/pageflow-system-pages/confirm/doc.jsx +0 -118
  93. package/packages/pageflow-system-pages/confirm/index.jsx +0 -31
  94. package/packages/pageflow-system-pages/debug/index.jsx +0 -27
  95. package/packages/pageflow-system-pages/debug/index.less +0 -5
  96. package/packages/pageflow-system-pages/index.jsx +0 -38
  97. package/packages/pageflow-system-pages/loading/index.jsx +0 -37
  98. package/packages/pageflow-system-pages/not-found/index.jsx +0 -12
  99. package/packages/pageflow-system-pages/not-found/index.less +0 -26
  100. package/packages/pageflow-system-pages/prompt/doc.jsx +0 -95
  101. package/packages/pageflow-system-pages/prompt/index.jsx +0 -43
  102. package/packages/pageflow-system-pages/prompt/index.less +0 -44
  103. package/packages/pageflow-system-pages/start/index.jsx +0 -28
  104. package/packages/pageflow-system-pages/start/index.less +0 -12
  105. package/packages/pageflow-system-pages/toast/doc.jsx +0 -76
  106. package/packages/pageflow-system-pages/toast/index.jsx +0 -42
  107. package/packages/utils/index.js +0 -56
  108. package/packages/variable.less +0 -4
@@ -1,106 +0,0 @@
1
- import React from "react";
2
- import BaseLayoutContainer from './BaseLayoutContainer'
3
- import classNames from "classnames";
4
- import { playSound } from "../utils";
5
-
6
- const blankFunc = () => { };
7
-
8
- export default class RfidOnce extends React.Component {
9
- constructor(props) {
10
- super(props);
11
- this._rfidBeginScan = false;
12
- this._handleRfidScan = e => {
13
- const { onRfidOnce, onRfidBoxOnce, onRfidPalletOnce } = this.props;
14
- const data = e.param;
15
- const isBox = data.rfidData.startsWith("0F006");
16
- const isPallet = data.rfidData.startsWith("0F011");
17
-
18
- playSound('single_recog');
19
-
20
- if(isPallet) {
21
- let rfidData = data.rfidData;
22
- data.originData = rfidData;
23
- data.rfidData = rfidData.substr(5, 12)
24
- }
25
-
26
- if(onRfidBoxOnce && isBox) {
27
- this._stopWork();
28
- onRfidBoxOnce(data);
29
- } else if(onRfidPalletOnce && isPallet) {
30
- this._stopWork();
31
- onRfidPalletOnce(data);
32
- }
33
- if(onRfidOnce){
34
- this._stopWork();
35
- onRfidOnce(data);
36
- }
37
- }
38
- this._startWork = e => {
39
- // console.log('start work');
40
- document.addEventListener('ContinuousRfidScan', this._handleRfidScan);
41
- WindVane.call('WindvanePlugin', 'invoke', "{'domain': 'rfid', 'method': 'startScan', 'params': null}", function(e) {
42
- // alert('success ' + JSON.stringify(e));
43
- }, function(e) {
44
- // alert('failure ' + JSON.stringify(e));
45
- });
46
- this._rfidBeginScan = true;
47
- }
48
- this._stopWork = e => {
49
- // console.log('stop work');
50
- document.removeEventListener('ContinuousRfidScan', this._handleRfidScan);
51
- WindVane.call('WindvanePlugin', 'invoke', "{'domain': 'rfid', 'method': 'stopRfidScan', 'params':null}", function(e) {
52
- }, function(e) {
53
- });
54
- }
55
- this._handleKeyDown = e => {
56
- const { code, keyCode, key } = e; // code: F23/F24; keyCode: 0; key: uniden...
57
- if (code === 'F22' || code === 'F23' || code === 'F24' || code === 'F9' || code ==='F16') {
58
- // console.log('keydown', this._rfidBeginScan);
59
- if (!this._rfidBeginScan) {
60
- this._startWork();
61
- }
62
- }
63
- }
64
- this._handleKeyUp = e => {
65
- const { code, keyCode, key } = e; // code: F23/F24; keyCode: 0; key: uniden...
66
- if (code === 'F22' || code === 'F23' || code === 'F24' || code === 'F9' || code ==='F16') {
67
- // console.log('keyup stop');
68
- this._stopWork();
69
- this._rfidBeginScan = false;
70
- }
71
- }
72
- }
73
-
74
- componentDidMount() {
75
- document.addEventListener('keydown', this._handleKeyDown);
76
- document.addEventListener('keyup', this._handleKeyUp);
77
- // document.addEventListener('ContinuousRfidScan', function (data) {
78
- // // console.log(JSON.stringify(data));
79
- // // console.log(data);
80
- // }, false);
81
-
82
- WindVane.call('WindvanePlugin', 'invoke', "{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'RFID'}}", function (e) {
83
- // alert('success ' + JSON.stringify(e));
84
- }, function (e) {
85
- // alert('failure ' + JSON.stringify(e));
86
- });
87
- }
88
- componentWillUnmount() {
89
- document.removeEventListener('keydown', this._handleKeyDown);
90
- document.removeEventListener('keyup', this._handleKeyUp);
91
- this._stopWork();
92
- }
93
-
94
- render() {
95
- // console.log('onRfidOnce render');
96
-
97
- const props = this.props;
98
- const { onRfidOnce = blankFunc, ...opts } = props;
99
-
100
- return (
101
- <BaseLayoutContainer
102
- {...opts}
103
- />
104
- )
105
- }
106
- }
@@ -1,118 +0,0 @@
1
- import React from "react";
2
- import BaseLayoutContainer from './BaseLayoutContainer'
3
- import classNames from "classnames";
4
-
5
- const blankFunc = () => { };
6
-
7
- export default class RfidOnce extends React.Component {
8
- static defaultProps = {
9
- rfidReaderSleep: false,
10
- }
11
- constructor(props) {
12
- super(props);
13
- this._rfidBeginScan = false;
14
- this._handleRfidScan = e => {
15
- const { onRfidScan, onRfidBoxScan, onRfidPalletScan } = this.props;
16
- const data = e.param;
17
- const isBox = data.rfidData.startsWith("0F006");
18
- const isPallet = data.rfidData.startsWith("0F011");
19
- if(isPallet) {
20
- let rfidData = data.rfidData;
21
- data.originData = rfidData;
22
- data.rfidData = rfidData.substr(5, 12)
23
- }
24
-
25
- if(isBox && onRfidBoxScan) {
26
- onRfidBoxScan(data);
27
- } else if(isPallet && onRfidPalletScan) {
28
- onRfidPalletScan(data);
29
- }
30
- if(onRfidScan) {
31
- onRfidScan(data);
32
- }
33
- }
34
- this._startWork = e => {
35
- document.addEventListener('ContinuousRfidScan', this._handleRfidScan);
36
- WindVane.call('WindvanePlugin', 'invoke', "{'domain': 'rfid', 'method': 'startScan', 'params': null}", function(e) {
37
-
38
- }, function(e) {
39
-
40
- });
41
- this._rfidBeginScan = true;
42
- }
43
- this._stopWork = e => {
44
- document.removeEventListener('ContinuousRfidScan', this._handleRfidScan);
45
- // WindVane.call('WindvanePlugin', 'invoke', "{'domain': 'rfid', 'method': 'stopScan', 'params':null}", function(e) {
46
- // }, function(e) {
47
- // });
48
- WindVane.call('WindvanePlugin', 'invoke', "{'domain': 'rfid', 'method': 'stopRfidScan', 'params':null}", function(e) {
49
- }, function(e) {
50
- });
51
- }
52
- this._handleKeyDown = e => {
53
- const { code, keyCode, key } = e; // code: F23/F24; keyCode: 0; key: uniden...
54
- if (code === 'F22' || code === 'F23' || code === 'F24' || code === 'F9' || code ==='F16') {
55
- if (!this._rfidBeginScan) {
56
- this._startWork();
57
- }
58
- }
59
- }
60
- this._handleKeyUp = e => {
61
- const { code, keyCode, key } = e; // code: F23/F24; keyCode: 0; key: uniden...
62
- if (code === 'F22' || code === 'F23' || code === 'F24' || code === 'F9' || code ==='F16') {
63
- this._stopWork();
64
- this._rfidBeginScan = false;
65
- }
66
- }
67
- }
68
-
69
- componentDidMount() {
70
- // console.log('Rfid Scan didMount');
71
- const { autoRfidScan = false, rfidReaderSleep } = this.props;
72
-
73
- WindVane.call('WindvanePlugin', 'invoke', "{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'RFID'}}", function (e) {
74
- // alert('success ' + JSON.stringify(e));
75
- }, function (e) {
76
- // alert('failure ' + JSON.stringify(e));
77
- });
78
-
79
- if(!autoRfidScan) {
80
- document.addEventListener('keydown', this._handleKeyDown);
81
- document.addEventListener('keyup', this._handleKeyUp);
82
- } else {
83
- if(!rfidReaderSleep) {
84
- this._startWork();
85
- }
86
- }
87
- }
88
- componentWillUnmount() {
89
- // const { autoRfidScan = false } = this.props;
90
- document.removeEventListener('keydown', this._handleKeyDown);
91
- document.removeEventListener('keyup', this._handleKeyUp);
92
- this._stopWork();
93
- }
94
- shouldComponentUpdate(nextProps, nextState) {
95
- if(this.props.autoRfidScan && (this.props.rfidReaderSleep !== nextProps.rfidReaderSleep) ) {
96
- if(!nextProps.rfidReaderSleep) {
97
- this._startWork();
98
- } else {
99
- this._stopWork();
100
- }
101
- }
102
- return true;
103
- }
104
-
105
-
106
- render() {
107
- // console.log('onRfidScan render');
108
-
109
- const props = this.props;
110
- const { onRfidScan = blankFunc, autoRfidScan, ...opts } = props;
111
-
112
- return (
113
- <BaseLayoutContainer
114
- {...opts}
115
- />
116
- )
117
- }
118
- }
@@ -1,177 +0,0 @@
1
- import React, {useState} from "react";
2
- import BaseLayout from "./index";
3
- import Title from '../PdaTitle';
4
- import InfoCard from '../InfoCard';
5
- import Button from '../Button';
6
- import Presentation from '../Presentation';
7
-
8
- // const ButtonGroup = Button.Group;
9
-
10
- export default function () {
11
- const [loading, setLoading] = useState(false);
12
-
13
- const header = <Title></Title>;
14
- const footer = (
15
- <Button.Group>
16
- <Button type="cutout" onClick={e => {
17
- console.log('cancle')
18
- setLoading(true);
19
- if(!loading) {
20
- setTimeout(() => {
21
- setLoading(false);
22
- }, 2000);
23
- }
24
- }}>取消</Button>
25
- <Button type="primary">确认</Button>
26
- </Button.Group>
27
- )
28
- const infoCard = [{}, {}, {}]
29
-
30
- return (
31
- <div>
32
- <h1>Scan</h1>
33
- <p>扫码组件</p>
34
- <h2>示例</h2>
35
- {/* const { type="default", width, style = {}, onClick } = this.props; */}
36
- <div className="light-block" style={{display: 'flex'}}>
37
- <div style={{width: 480, height: 800, position: 'relative'}}>
38
- <BaseLayout
39
- style={{backgroundColor: 'black', marginRight: 20,}}
40
- header={header}
41
- footer={footer}
42
- loading={loading}
43
- // loadingTimeout={2000}
44
- >
45
- <Presentation text="请靠近箱码进行识别" ></Presentation>
46
-
47
- </BaseLayout>
48
- </div>
49
- <div style={{width: 480, height: 800, position: 'relative'}}>
50
- <BaseLayout
51
- style={{backgroundColor: 'black'}}
52
- header={header}
53
- footer={footer}
54
- >
55
- {
56
- infoCard.map((item, index) => {
57
- return <InfoCard
58
- key={index}
59
- title="待拣件数"
60
- highlightInfo="800"
61
- highlightInfoCN = "件"
62
- highlightSubInfo="/800"
63
- highlightSubInfoCN="件"
64
- boldInfo="加粗显示:512/五厂综包一楼,这是加粗显示的货品名称可能有多行"
65
- style={{
66
- width: '400px',
67
- backgroundColor: 'black',
68
- }}
69
- theme='dark'
70
- infoList={
71
- [
72
- {label: '商品条码', content: '623126388798'},
73
- {label: '截止日期', content: '2022-07-25'},
74
- {label: '产品名称', content: '商品的名称'},
75
- {label: '品号', content: '12398765423'},
76
- ]
77
- }
78
- />
79
- })
80
- }
81
- </BaseLayout>
82
- </div>
83
- </div>
84
- <code className="code">{`
85
- const header = <Title></Title>;
86
- const footer = (
87
- <Button.Group>
88
- <Button type="cutout" onClick={e => console.log('cancle')}>取消</Button>
89
- <Button type="primary">确认</Button>
90
- </Button.Group>
91
- )
92
-
93
- <BaseLayout
94
- header={header}
95
- footer={footer}
96
- >
97
- <Presentation text="请靠近箱码进行识别" ></Presentation>
98
- </BaseLayout>
99
- `}</code>
100
- <h2>参数</h2>
101
- <table className="pure-table pure-table-bordered">
102
- <thead>
103
- <tr>
104
- <th>属性</th>
105
- <th>说明</th>
106
- <th>类型</th>
107
- <th>默认值</th>
108
- </tr>
109
- </thead>
110
- <tbody>
111
- <tr>
112
- <td>header</td>
113
- <td>吸顶组件</td>
114
- <td></td>
115
- <td></td>
116
- </tr>
117
- <tr>
118
- <td>footer</td>
119
- <td>吸底组件</td>
120
- <td></td>
121
- <td></td>
122
- </tr>
123
- <tr>
124
- <td>onBarcodeScan</td>
125
- <td>注册扫描二维码/条形码[徐福记项目专用]</td>
126
- <td>Function</td>
127
- <td>data => data.scanData</td>
128
- </tr>
129
-
130
- <tr>
131
- <td>onScanBarcode</td>
132
- <td>注册扫描二维码/条形码[推荐使用]</td>
133
- <td>Function</td>
134
- <td>data => data.scanData</td>
135
- </tr>
136
-
137
- <tr>
138
- <td>onRfidOnce</td>
139
- <td>按键按下/抬起,只触发第一个rfid码</td>
140
- <td>Function</td>
141
- <td>data => {}</td>
142
- </tr>
143
- <tr>
144
- <td>onRfidBoxOnce</td>
145
- <td>按键按下/抬起,只触发第一个 rfid 箱码</td>
146
- <td>Function</td>
147
- <td>data => {}</td>
148
- </tr>
149
- <tr>
150
- <td>onRfidPalletOnce</td>
151
- <td>按键按下/抬起,只触发第一个 rfid 栈板码</td>
152
- <td>Function</td>
153
- <td>data => {}</td>
154
- </tr>
155
- <tr>
156
- <td>onRfidScan</td>
157
- <td>按键按下/抬起触发 rfid 连续扫描</td>
158
- <td>Function</td>
159
- <td>data => {}</td>
160
- </tr>
161
- <tr>
162
- <td>onRfidBoxScan</td>
163
- <td>按键按下/抬起触发 rfid 箱码连续扫描</td>
164
- <td>Function</td>
165
- <td>data => {}</td>
166
- </tr>
167
- <tr>
168
- <td>onRfidPalletScan</td>
169
- <td>按键按下/抬起触发 rfid 栈板码连续扫描</td>
170
- <td>Function</td>
171
- <td>data => {}</td>
172
- </tr>
173
- </tbody>
174
- </table>
175
- </div>
176
- );
177
- }
@@ -1,52 +0,0 @@
1
- import React from "react";
2
- import BaseLayoutContainer from './BaseLayoutContainer';
3
- import RfidOnce from './RfidOnce';
4
- import RfidScan from './RfidScan';
5
- import BarcodeScan from './BarcodeScan';
6
- import classNames from "classnames";
7
-
8
- const blankFunc = () => { };
9
-
10
- export default class BaseLayout extends React.Component {
11
- constructor(props) {
12
- super(props);
13
- }
14
-
15
- render() {
16
- const props = this.props;
17
- // onScanBarcode 一直监听
18
- // onBarcodeScan 按下某些建才监听
19
- const {onBarcodeScan, onScanBarcode, onRfidOnce, onRfidBoxOnce, onRfidPalletOnce, onRfidScan, onRfidBoxScan, onRfidPalletScan } = props;
20
-
21
- if(onRfidOnce || onRfidBoxOnce || onRfidPalletOnce) {
22
- return (
23
- <RfidOnce
24
- // onRfidOnce={onRfidOnce}
25
- {...props}
26
- />
27
- )
28
- }
29
- if(onRfidScan || onRfidBoxScan || onRfidPalletScan) {
30
- return (
31
- <RfidScan
32
- // onRfidScan={onRfidScan}
33
- {...props}
34
- />
35
- )
36
- }
37
- if(onBarcodeScan || onScanBarcode) {
38
- return (
39
- <BarcodeScan
40
- // onBarcodeScan= {onBarcodeScan}
41
- {...props}
42
- />
43
- )
44
- }
45
-
46
- return (
47
- <BaseLayoutContainer
48
- {...props}
49
- />
50
- )
51
- }
52
- }
@@ -1,47 +0,0 @@
1
- .baselayout-wrapper {
2
- height: 100%;
3
- min-height: 100%;
4
- display: flex;
5
- flex-direction: column;
6
- position: absolute;
7
- top: 0;
8
- left: 0;
9
- right: 0;
10
- bottom: 0;
11
- background-color: black;
12
-
13
- .baselayout-header {
14
- // height: 84px;
15
- }
16
- .baselayout-container {
17
- // height: calc(100% - 84px);
18
- padding: 0 24px;
19
- overflow-x: auto;
20
- flex: 1;
21
-
22
- &>* {
23
- margin-top: 16px;
24
- }
25
- padding-bottom: 16px;
26
- }
27
- .baselayout-footer {
28
- padding: 16px 0;
29
- }
30
- // .baselayout-paddingbottom {
31
- // height: 24px;
32
- // }
33
-
34
- .loading {
35
- position: absolute;
36
- top: 0;
37
- left: 0;
38
- right: 0;
39
- bottom: 0;
40
- color: white;
41
- background-color: rgba(0,0,0,0.4);
42
- background-image: url(https://img.alicdn.com/imgextra/i2/O1CN01PRSptR1YO1wOlBHCr_!!6000000003048-1-tps-240-240.gif);
43
- background-repeat: no-repeat;
44
- background-position: center;
45
- background-size: 120px 120px;
46
- }
47
- }
@@ -1,62 +0,0 @@
1
- import React from "react";
2
- import Button from "./index";
3
-
4
- export default function () {
5
- return (
6
- <div>
7
- <h1>Button</h1>
8
- <p>扫码组件</p>
9
- <h2>示例</h2>
10
- {/* const { type="default", width, style = {}, onClick } = this.props; */}
11
- <div className="light-block">
12
- <Button dataClick='arms track'>按钮</Button>
13
- <Button type='primary' onClick={e => console.log(e) } dataClick=''>确认</Button>
14
- <Button type='dark'>深色</Button>
15
- <Button.Group>
16
- <Button type="cutout">镂空</Button>
17
- <Button>按钮</Button>
18
- </Button.Group>
19
- </div>
20
- <code className="code">{`
21
- <Button dataClick='arms track'>按钮</Button>
22
- <Button type='primary' onClick={e => console.log(e) }>确认</Button>
23
- <Button type='dark'>深色</Button>
24
- <Button.Group>
25
- <Button type="cutout">镂空</Button>
26
- <Button>按钮</Button>
27
- </Button.Group>
28
- `}</code>
29
- <h2>参数</h2>
30
- <table className="pure-table pure-table-bordered">
31
- <thead>
32
- <tr>
33
- <th>属性</th>
34
- <th>说明</th>
35
- <th>类型</th>
36
- <th>默认值</th>
37
- </tr>
38
- </thead>
39
- <tbody>
40
- <tr>
41
- <td>type</td>
42
- <td>类型</td>
43
- <td>string: primary | dark | cutout</td>
44
- <td>default</td>
45
- </tr>
46
- <tr>
47
- <td>onClick</td>
48
- <td>点击事件</td>
49
- <td>function</td>
50
- <td></td>
51
- </tr>
52
- <tr>
53
- <td>dataClick</td>
54
- <td>arms 监控使用</td>
55
- <td>string</td>
56
- <td></td>
57
- </tr>
58
- </tbody>
59
- </table>
60
- </div>
61
- );
62
- }
@@ -1,27 +0,0 @@
1
- import React from "react";
2
- // import OPInput from "../OPInput";
3
- import "./index.less";
4
-
5
-
6
- export default function Button(props){
7
- const { type="default", onClick, className="", tabIndex=1, dataClick=''} = props;
8
- let opt = {};
9
- if(dataClick) {
10
- opt['data-click'] = dataClick;
11
- }
12
- return (
13
- <button className={`pda-button pda-button-${type} ${className}`} onClick={onClick} tabIndex={tabIndex} {...opt}>
14
- {props.children}
15
- </button>
16
- )
17
- }
18
-
19
- export function ButtonGroup(props){
20
- return (
21
- <div className="button-group" >
22
- {props.children}
23
- </div>
24
- )
25
- }
26
-
27
- Button.Group = ButtonGroup;
@@ -1,62 +0,0 @@
1
- .pda-button {
2
- display: block;
3
- box-sizing: border-box;
4
- padding-right: 0;
5
- text-align: center;
6
- font-size: 40px;
7
- height: 90px;
8
- line-height: 40px;
9
- // color: #000;
10
- color: #fff;
11
- background-color: #F3F4F8;
12
- border-radius: 10px;
13
- width: 100%;
14
- border-width: 0;
15
- word-break: keep-all;
16
-
17
- &.pda-button-default {
18
- color: #000;
19
- }
20
- &:active {
21
- background-color: #979797;
22
- }
23
-
24
- &.pda-button-primary {
25
- background-color: #0091EA;
26
- // color: #fff;
27
- &:active {
28
- background-color: #0074BB;
29
- }
30
- }
31
-
32
- &.pda-button-dark {
33
- background-color: #282828;
34
- // color: #fff;
35
- &:active {
36
- background-color: #979797;
37
- }
38
- }
39
-
40
- &.pda-button-cutout {
41
- // background-color: #282828;
42
- // color: #fff;
43
- color: #0091EA;
44
- border-width: 4px;
45
- border-color: #0091EA;
46
- // &:active {
47
- // background-color: #979797;
48
- // }
49
- }
50
- }
51
-
52
- .button-group {
53
- display: flex;
54
- flex-direction: row;
55
- padding: 20px 24px;
56
- width: 100%;
57
- .pda-button {
58
- &:not(:last-child){
59
- margin-right: 16px;
60
- }
61
- }
62
- }