Skip to content

Commit 1f8b476

Browse files
committed
prepare v2
1 parent 2245302 commit 1f8b476

30 files changed

Lines changed: 20955 additions & 3691 deletions

.babelrc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"presets": ["env", "stage-0", "react"],
3-
"plugins": [
4-
"transform-decorators-legacy"
2+
"extends": "@trendmicro/babel-config",
3+
"presets": [
4+
"@babel/preset-env",
5+
"@babel/preset-react"
56
]
67
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ npm-debug.log
33
package-lock.json
44
/.nyc_output
55
/coverage
6+
/dist
67
/lib

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ os:
99

1010
node_js:
1111
- '8'
12-
- '6'
12+
- '10'
1313

1414
before_install:
1515
- npm install -g npm

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ npm install --save react-repeatable
1414

1515
## Usage
1616

17-
```js
17+
```jsx
1818
<Repeatable
19-
style={{ display: 'inline-block' }}
2019
repeatDelay={500}
2120
repeatInterval={32}
2221
onPress{(event) => {
@@ -35,12 +34,26 @@ npm install --save react-repeatable
3534
// Callback fired when the mouseup, touchcancel, or touchend event is triggered.
3635
}}
3736
>
38-
<button type="button">
39-
Press Me
40-
</button>
37+
Press Me
4138
</Repeatable>
4239
```
4340

41+
### Repeatable Button
42+
43+
```jsx
44+
const RepeatableButton = ({ onClick, ...props }) => (
45+
<Repeatable
46+
tag="button"
47+
type="button"
48+
onHold={onClick}
49+
onRelease={onClick}
50+
{...props}
51+
/>
52+
);
53+
54+
<RepeatableButton onClick={handleClick} />
55+
```
56+
4457
## API
4558

4659
### Sequence of Events
@@ -55,7 +68,7 @@ onPress -> onRelease
5568

5669
Name | Type | Default | Description
5770
:--- | :--- | :------ | :----------
58-
componentClass | element | 'div' | A custom element for this component.
71+
tag | element | 'div' | A custom element for this component.
5972
disabled | Boolean | false | Set it to true to disable event actions.
6073
repeatDelay | Number | 500 | The time (in milliseconds) to wait before the first hold action is being triggered.
6174
repeatInterval | Number | 32 | The time interval (in milliseconds) on how often to trigger a hold action.

docs/build/bundle.55aecd75.js

Lines changed: 15967 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)