1
- # @rc-component/trigger
1
+ # @rc-component/QRCode
2
2
3
- React Trigger Component
3
+ React QRCode Component
4
4
5
5
[ ![ NPM version] [ npm-image ]] [ npm-url ]
6
6
[ ![ npm download] [ download-image ]] [ download-url ]
@@ -9,59 +9,15 @@ React Trigger Component
9
9
[ ![ bundle size] [ bundlephobia-image ]] [ bundlephobia-url ]
10
10
[ ![ dumi] [ dumi-image ]] [ dumi-url ]
11
11
12
- [ npm-image ] : http://img.shields.io/npm/v/rc-checkbox.svg?style=flat-square
13
- [ npm-url ] : http://npmjs.org/package/rc-checkbox
14
- [ github-actions-image ] : https://github.com/react-component/checkbox/workflows/CI/badge.svg
15
- [ github-actions-url ] : https://github.com/react-component/checkbox/actions
16
- [ codecov-image ] : https://img.shields.io/codecov/c/github/react-component/checkbox/master.svg?style=flat-square
17
- [ codecov-url ] : https://codecov.io/gh/react-component/checkbox/branch/master
18
- [ david-url ] : https://david-dm.org/react-component/checkbox
19
- [ david-image ] : https://david-dm.org/react-component/checkbox/status.svg?style=flat-square
20
- [ david-dev-url ] : https://david-dm.org/react-component/checkbox?type=dev
21
- [ david-dev-image ] : https://david-dm.org/react-component/checkbox/dev-status.svg?style=flat-square
22
- [ download-image ] : https://img.shields.io/npm/dm/rc-checkbox.svg?style=flat-square
23
- [ download-url ] : https://npmjs.org/package/rc-checkbox
24
- [ bundlephobia-url ] : https://bundlephobia.com/result?p=rc-checkbox
25
- [ bundlephobia-image ] : https://badgen.net/bundlephobia/minzip/rc-checkbox
26
- [ dumi-image ] : https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square
27
- [ dumi-url ] : https://github.com/umijs/dumi
28
-
29
12
## Install
30
13
31
- [ ![ @rc-component/trigger ] ( https://nodei.co/npm/@rc-component/trigger .png )] ( https://npmjs.org/package/@rc-component/trigger )
14
+ [ ![ @rc-component/qrcode ] ( https://nodei.co/npm/@rc-component/qrcode .png )] ( https://npmjs.org/package/@rc-component/qrcode )
32
15
33
16
## Usage
34
17
35
- Include the default [ styling] ( https://github.com/react-component/trigger/blob/master/assets/index.less#L4:L11 ) and then:
36
-
37
- ``` js
38
- import React from ' react' ;
39
- import ReactDOM from ' react-dom' ;
40
- import Trigger from ' @rc-component/trigger' ;
41
-
42
- ReactDOM .render ((
43
- < Trigger
44
- action= {[' click' ]}
45
- popup= {< span> popup< / span> }
46
- popupAlign= {{
47
- points: [' tl' , ' bl' ],
48
- offset: [0 , 3 ]
49
- }}
50
- >
51
- < a href= ' #' > hover< / a>
52
- < / Trigger>
53
- ), container);
54
- ```
55
-
56
- ## Compatibility
57
-
58
- | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Electron |
59
- | --- | --- | --- | --- | --- |
60
- | IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
61
-
62
18
## Example
63
19
64
- http://localhost:9001
20
+ http://localhost:8001
65
21
66
22
## Development
67
23
@@ -74,175 +30,11 @@ npm start
74
30
75
31
### props
76
32
77
- <table class =" table table-bordered table-striped " >
78
- <thead>
79
- <tr>
80
- <th style="width: 100px;">name</th>
81
- <th style="width: 50px;">type</th>
82
- <th style="width: 50px;">default</th>
83
- <th>description</th>
84
- </tr>
85
- </thead>
86
- <tbody>
87
- <tr>
88
- <td>alignPoint</td>
89
- <td>bool</td>
90
- <td>false</td>
91
- <td>Popup will align with mouse position (support action of 'click', 'hover' and 'contextMenu')</td>
92
- </tr>
93
- <tr>
94
- <td>popupClassName</td>
95
- <td>string</td>
96
- <td></td>
97
- <td>additional className added to popup</td>
98
- </tr>
99
- <tr>
100
- <td>forceRender</td>
101
- <td>boolean</td>
102
- <td>false</td>
103
- <td>whether render popup before first show</td>
104
- </tr>
105
- <tr>
106
- <td>destroyPopupOnHide</td>
107
- <td>boolean</td>
108
- <td>false</td>
109
- <td>whether destroy popup when hide</td>
110
- </tr>
111
- <tr>
112
- <td>getPopupClassNameFromAlign</td>
113
- <td>getPopupClassNameFromAlign(align: Object):String</td>
114
- <td></td>
115
- <td>additional className added to popup according to align</td>
116
- </tr>
117
- <tr>
118
- <td>action</td>
119
- <td>string[]</td>
120
- <td>['hover']</td>
121
- <td>which actions cause popup shown. enum of 'hover','click','focus','contextMenu'</td>
122
- </tr>
123
- <tr>
124
- <td>mouseEnterDelay</td>
125
- <td>number</td>
126
- <td>0</td>
127
- <td>delay time to show when mouse enter. unit: s.</td>
128
- </tr>
129
- <tr>
130
- <td>mouseLeaveDelay</td>
131
- <td>number</td>
132
- <td>0.1</td>
133
- <td>delay time to hide when mouse leave. unit: s.</td>
134
- </tr>
135
- <tr>
136
- <td>popupStyle</td>
137
- <td>Object</td>
138
- <td></td>
139
- <td>additional style of popup</td>
140
- </tr>
141
- <tr>
142
- <td>prefixCls</td>
143
- <td>String</td>
144
- <td>rc-trigger-popup</td>
145
- <td>prefix class name</td>
146
- </tr>
147
- <tr>
148
- <td>popupTransitionName</td>
149
- <td>String|Object</td>
150
- <td></td>
151
- <td>https://github.com/react-component/animate</td>
152
- </tr>
153
- <tr>
154
- <td>maskTransitionName</td>
155
- <td>String|Object</td>
156
- <td></td>
157
- <td>https://github.com/react-component/animate</td>
158
- </tr>
159
- <tr>
160
- <td>onPopupVisibleChange</td>
161
- <td>Function</td>
162
- <td></td>
163
- <td>call when popup visible is changed</td>
164
- </tr>
165
- <tr>
166
- <td>mask</td>
167
- <td>boolean</td>
168
- <td>false</td>
169
- <td>whether to support mask</td>
170
- </tr>
171
- <tr>
172
- <td>maskClosable</td>
173
- <td>boolean</td>
174
- <td>true</td>
175
- <td>whether to support click mask to hide</td>
176
- </tr>
177
- <tr>
178
- <td>popupVisible</td>
179
- <td>boolean</td>
180
- <td></td>
181
- <td>whether popup is visible</td>
182
- </tr>
183
- <tr>
184
- <td>zIndex</td>
185
- <td>number</td>
186
- <td></td>
187
- <td>popup's zIndex</td>
188
- </tr>
189
- <tr>
190
- <td>defaultPopupVisible</td>
191
- <td>boolean</td>
192
- <td></td>
193
- <td>whether popup is visible initially</td>
194
- </tr>
195
- <tr>
196
- <td>popupAlign</td>
197
- <td>Object: alignConfig of [dom-align](https://github.com/yiminghe/dom-align)</td>
198
- <td></td>
199
- <td>popup 's align config</td>
200
- </tr>
201
- <tr>
202
- <td>onPopupAlign</td>
203
- <td>function(popupDomNode, align)</td>
204
- <td></td>
205
- <td>callback when popup node is aligned</td>
206
- </tr>
207
- <tr>
208
- <td>popup</td>
209
- <td>React.Element | function() => React.Element</td>
210
- <td></td>
211
- <td>popup content</td>
212
- </tr>
213
- <tr>
214
- <td>getPopupContainer</td>
215
- <td>getPopupContainer(): HTMLElement</td>
216
- <td></td>
217
- <td>function returning html node which will act as popup container</td>
218
- </tr>
219
- <tr>
220
- <td>getDocument</td>
221
- <td>getDocument(): HTMLElement</td>
222
- <td></td>
223
- <td>function returning document node which will be attached click event to close trigger</td>
224
- </tr>
225
- <tr>
226
- <td>popupPlacement</td>
227
- <td>string</td>
228
- <td></td>
229
- <td>use preset popup align config from builtinPlacements, can be merged by popupAlign prop</td>
230
- </tr>
231
- <tr>
232
- <td>builtinPlacements</td>
233
- <td>object</td>
234
- <td></td>
235
- <td>builtin placement align map. used by placement prop</td>
236
- </tr>
237
- <tr>
238
- <td>stretch</td>
239
- <td>string</td>
240
- <td></td>
241
- <td>Let popup div stretch with trigger element. enums of 'width', 'minWidth', 'height', 'minHeight'. (You can also mixed with 'height minWidth')</td>
242
- </tr>
243
- </tbody>
244
- </table >
245
33
34
+ ## API
35
+
36
+ | Name | Type | Default | Description |
37
+ | --- | --- | --- | --- |
246
38
247
39
## Test Case
248
40
@@ -255,4 +47,4 @@ open coverage/ dir
255
47
256
48
## License
257
49
258
- rc-trigger is released under the MIT license.
50
+ rc-qrcode is released under the MIT license.
0 commit comments