Skip to content

Commit c47cec3

Browse files
authored
Merge pull request #4 from kiner-tang/master
feat: initial commit
2 parents f7b73b6 + 0538ebe commit c47cec3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1911
-8786
lines changed

.dumirc.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,12 @@ import path from 'path';
33

44
export default defineConfig({
55
alias: {
6-
'rc-trigger$': path.resolve('src'),
7-
'rc-trigger/es': path.resolve('src'),
6+
'rc-qrcode$': path.resolve('src'),
7+
'rc-qrcode/es': path.resolve('src'),
88
},
9-
mfsu: false,
109
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
1110
themeConfig: {
12-
name: 'Trigger',
11+
name: 'Qrcode',
1312
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
1413
},
15-
styles: [
16-
`
17-
.dumi-default-previewer-demo {
18-
position: relative;
19-
min-height: 300px;
20-
}
21-
`,
22-
]
2314
});

.fatherrc.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { defineConfig } from 'father';
22

33
export default defineConfig({
4-
plugins: ['@rc-component/father-plugin'],
5-
});
4+
platform: 'browser',
5+
cjs: { output: 'lib' },
6+
esm: {
7+
output: 'es',
8+
alias: { 'rc-util/lib': 'rc-util/es' },
9+
},
10+
});

HISTORY.md

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,6 @@
11
# History
22
----
33

4-
## 4.1.0 / 2020-05-08
4+
## 1.0.0
55

6-
- upgrade rc-animate to `3.x`
7-
8-
## 2.5.0 / 2018-06-05
9-
10-
- support `alignPoint`
11-
12-
## 2.1.0 / 2017-10-16
13-
14-
- add action `contextMenu`
15-
16-
## 2.0.0 / 2017-09-25
17-
18-
- support React 16
19-
20-
## 1.11.0 / 2017-06-07
21-
22-
- add es
23-
24-
## 1.9.0 / 2017-02-27
25-
26-
- add getDocument prop
27-
28-
## 1.8.2 / 2017-02-24
29-
30-
- change default container to absolute to fix scrollbar change problem
31-
32-
## 1.7.0 / 2016-07-18
33-
34-
- use getContainerRenderMixin from 'rc-util'
35-
36-
## 1.6.0 / 2016-05-26
37-
38-
- support popup as function
39-
40-
## 1.5.0 / 2016-05-26
41-
42-
- add forcePopupAlign method
43-
44-
## 1.4.0 / 2016-04-06
45-
46-
- support onPopupAlign
47-
48-
## 1.3.0 / 2016-03-25
49-
50-
- support mask/maskTransitionName/zIndex
51-
52-
## 1.2.0 / 2016-03-01
53-
54-
- add showAction/hideAction
55-
56-
## 1.1.0 / 2016-01-06
57-
58-
- add root trigger node as parameter of getPopupContainer
6+
- feat: initial project

README.md

Lines changed: 9 additions & 217 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# @rc-component/trigger
1+
# @rc-component/QRCode
22

3-
React Trigger Component
3+
React QRCode Component
44

55
[![NPM version][npm-image]][npm-url]
66
[![npm download][download-image]][download-url]
@@ -9,59 +9,15 @@ React Trigger Component
99
[![bundle size][bundlephobia-image]][bundlephobia-url]
1010
[![dumi][dumi-image]][dumi-url]
1111

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-
2912
## Install
3013

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)
3215

3316
## Usage
3417

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-
6218
## Example
6319

64-
http://localhost:9001
20+
http://localhost:8001
6521

6622
## Development
6723

@@ -74,175 +30,11 @@ npm start
7430

7531
### props
7632

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>
24533

34+
## API
35+
36+
| Name | Type | Default | Description |
37+
| --- | --- | --- | --- |
24638

24739
## Test Case
24840

@@ -255,4 +47,4 @@ open coverage/ dir
25547

25648
## License
25749

258-
rc-trigger is released under the MIT license.
50+
rc-qrcode is released under the MIT license.

docs/demos/basic.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Basic
3+
nav:
4+
title: Demo
5+
path: /demo
6+
---
7+
8+
<code src="../examples/basic.tsx"></code>

docs/demos/body-overflow.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/demos/case.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/demos/click-nested.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)