Skip to content

Commit 13aa2a6

Browse files
committed
Upgrade to React 17; convert to TypeScript; fix ref; add aria attributes; deprecate inputProps
1 parent 8f9a86d commit 13aa2a6

26 files changed

+5098
-7272
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"test": {
1515
"presets": [
1616
"@babel/preset-env",
17-
"@babel/preset-react"
17+
"@babel/preset-react",
18+
"@babel/preset-typescript"
1819
],
1920
"plugins": [
2021
"@babel/plugin-proposal-class-properties"

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ coverage
88
rollup.config.js
99
yarn-error.log
1010
.github
11-
CONTRIBUTING.md
11+
CONTRIBUTING.md
12+
*.tgz

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const MyComponent = () => {
5353

5454
## Features
5555

56-
- Compatible with React Bootstrap v1.0.0+ and Bootstrap 4;
56+
- Compatible with React Bootstrap v1.0.0+ and Bootstrap 4+;
5757
- Implemented using HTML5 `<input type="range">` element;
5858
- A tooltip can be configured to automatically display on hover or be constantly visible;
5959
- A custom tooltip formatter function can be provided.
@@ -66,8 +66,8 @@ const MyComponent = () => {
6666
| Property | Type | Default | Description |
6767
| --- | --- | --- | --- |
6868
| `value` | `number` | | The current value of the slider. |
69-
| `onChange` | `function` | | A callback fired when the range slider's value changes. |
70-
| `onAfterChange` | `function` | | A callback fired after interaction with the slider has finished if the value has changed. |
69+
| `onChange` | `function` | | A callback fired when the range slider's value changes. The callback's first argument is a `React.ChangeEvent`. The second argument is the slider's new value as a `number`. |
70+
| `onAfterChange` | `function` | | A callback fired after interaction with the slider has finished if the value has changed. The callback function's signature is the same as for `onChange`. |
7171
| `min` | `number` | `0` | The minimum value of the slider. |
7272
| `max` | `number` | `100` | The maximum value of the slider. |
7373
| `step` | `number` | `1` | The granularity with which the slider can step through values. |
@@ -79,8 +79,8 @@ const MyComponent = () => {
7979
| `tooltipLabel` | `function` | | A function that returns the tooltip's content (either a string or element). The function's first argument is the current slider value. |
8080
| `tooltipStyle` | `object` | | Style to be applied to tooltip div. |
8181
| `tooltipProps` | `object` | | Properties applied to the tooltip's `<div>` element. |
82-
| `inputProps` | `object` | | Properties applied to the `<input>` element. |
83-
| `ref` | `ReactRef` | | If provided, ref will be forwarded to the underlying `<input>` element. |
82+
| `inputProps` | `object` | | Properties applied to the `<input>` element. DEPRECATED: additional props added to the RangeSlider component's props will be passed to the underlying `<input>` element. |
83+
| `ref` | `React.Ref<HTMLInputElement>` | | If provided, ref will be forwarded to the underlying `<input>` element. |
8484
| `bsPrefix` | `string` | `'range-slider'` | Change the underlying component CSS base class name and modifier class names prefix. **This is an escape hatch** for working with heavily customized bootstrap css. |
8585

8686
## Sass / Customizing Bootstrap

0 commit comments

Comments
 (0)