svelte-range-slider-pips
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -25,3 +25,3 @@ import { SvelteComponent } from "svelte"; | ||
focus: boolean; | ||
orientationStart: string; | ||
orientationStart: 'left' | 'right' | 'top' | 'bottom'; | ||
moveHandle: (index: number | null, value: number) => void; | ||
@@ -28,0 +28,0 @@ }; |
@@ -84,2 +84,2 @@ import type { NormalisedClient } from './types.js'; | ||
*/ | ||
export declare const getValueFromIndex: (index: number, min: number, max: number, pipStep: number, step: number) => number; | ||
export declare const getValueFromIndex: (index: number, min: number, max: number, pipStep: number, step: number, precision?: number) => number; |
@@ -152,4 +152,4 @@ /** | ||
*/ | ||
export const getValueFromIndex = (index, min, max, pipStep, step) => { | ||
return coerceFloat(min + index * step * pipStep); | ||
export const getValueFromIndex = (index, min, max, pipStep, step, precision = 2) => { | ||
return coerceFloat(min + index * step * pipStep, precision); | ||
}; |
{ | ||
"name": "svelte-range-slider-pips", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Multi-Thumb, Accessible, Beautiful Range Slider with Pips", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -68,3 +68,3 @@ <div align="center"> | ||
### In a svelte project | ||
### In a svelte 4/5 project | ||
@@ -92,2 +92,6 @@ Assuming you have a Svelte app up and running; | ||
### In a svelte 3 project | ||
โ _Version 3 of Range Slider Pips is not compatible with Svelte 3. [see below](#svelte-3)_ | ||
### As a regular JS file | ||
@@ -128,3 +132,3 @@ | ||
### As a JS module | ||
### As a JS module, or with Vue & React | ||
@@ -162,2 +166,3 @@ If you're building a bleeding-edge JS application (maybe Vue or React), you might | ||
| ------------------- | ------------------ | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| **value** | `Number` | `50` | Value to apply on the slider. | | ||
| **values** | `Array` | `[50]` | Array of values to apply on the slider. Multiple values creates multiple handles. (_**note:** A slider with `range` property set can only have two values max_) | | ||
@@ -234,11 +239,35 @@ | **min** | `Number` | `0` | Minimum value for the slider _(should be `< max`)_ | | ||
<br> | ||
<br> | ||
--- | ||
## Support / Donate | ||
## Notes | ||
### Svelte 3 | ||
Because of the code in Range Slider Pips 3, it is now incompatible with Svelte version 3. | ||
If you are unable to upgrade your project, then I suggest looking for [Svelte-Range-Slider-Pips version `2.3.1`](https://github.com/simeydotme/svelte-range-slider-pips/tree/2.3.1) which | ||
will not be upgraded, but it's still pretty robust. You can install it like so; | ||
```bash | ||
yarn add svelte-range-slider-pips@2.3.1 --dev # or | ||
npm install svelte-range-slider-pips@2.3.1 --save-dev # if you prefer npm | ||
``` | ||
<br> | ||
<br> | ||
<br> | ||
--- | ||
## Support / Tip | ||
I'd be super excited if you find this project useful and wish to donate a small amount for my efforts! | ||
| <img src="https://user-images.githubusercontent.com/2817396/149629283-6002944f-9253-4e35-917d-89b476deae4e.png" width=20> | [![ยฃ1 One Pound Donation](https://user-images.githubusercontent.com/2817396/149629980-08b9a952-bd6a-4c23-be78-05e3fd534352.png)](https://www.paypal.com/paypalme/simey/1) | [ยฃ1 GBP donation](https://www.paypal.com/paypalme/simey/1) | | ||
| <img src="https://user-images.githubusercontent.com/2817396/149629283-6002944f-9253-4e35-917d-89b476deae4e.png" width=30> | [![ยฃ1 One Pound Tip](https://user-images.githubusercontent.com/2817396/149629980-08b9a952-bd6a-4c23-be78-05e3fd534352.png)](https://www.paypal.com/paypalme/simey/1) | [ยฃ1 GBP Tip](https://www.paypal.com/paypalme/simey/1) | | ||
| ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------ | | ||
| <img src="https://user-images.githubusercontent.com/2817396/149629283-6002944f-9253-4e35-917d-89b476deae4e.png" width=20> | [![ยฃ5 Five Pounds Donation](https://user-images.githubusercontent.com/2817396/149629994-3a99770c-d333-46e7-9818-ab6b18ad0202.png)](https://www.paypal.com/paypalme/simey/5) | [ยฃ5 GBP donation](https://www.paypal.com/paypalme/simey/5) | | ||
| <img src="https://user-images.githubusercontent.com/2817396/149629283-6002944f-9253-4e35-917d-89b476deae4e.png" width=20> | [![ยฃ10 Ten Pounds Donation](https://user-images.githubusercontent.com/2817396/149630000-95aa4234-ff67-4e7c-a7f4-ffd52f25e6d8.png)](https://www.paypal.com/paypalme/simey/10) | [ยฃ10 GBP donation](https://www.paypal.com/paypalme/simey/10) | | ||
| <img src="https://user-images.githubusercontent.com/2817396/149629283-6002944f-9253-4e35-917d-89b476deae4e.png" width=30> | [![ยฃ5 Five Pound Tip](https://user-images.githubusercontent.com/2817396/149629994-3a99770c-d333-46e7-9818-ab6b18ad0202.png)](https://www.paypal.com/paypalme/simey/5) | [ยฃ5 GBP Tip](https://www.paypal.com/paypalme/simey/5) | | ||
| <img src="https://user-images.githubusercontent.com/2817396/149629283-6002944f-9253-4e35-917d-89b476deae4e.png" width=30> | [![ยฃ10 Ten Pound Tip](https://user-images.githubusercontent.com/2817396/149630000-95aa4234-ff67-4e7c-a7f4-ffd52f25e6d8.png)](https://www.paypal.com/paypalme/simey/10) | [ยฃ10 GBP Tip](https://www.paypal.com/paypalme/simey/10) | | ||
@@ -173,5 +173,6 @@ import type { NormalisedClient } from './types.js'; | ||
pipStep: number, | ||
step: number | ||
step: number, | ||
precision: number = 2 | ||
) => { | ||
return coerceFloat(min + index * step * pipStep); | ||
return coerceFloat(min + index * step * pipStep, precision); | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8934
269
359198