fluent-svelte-extra 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,15 +4,19 @@ import Slider from '@bulatdashiev/svelte-slider';
4
4
  import { TextBlock } from 'fluent-svelte';
5
5
  export let min = 1;
6
6
  export let max = 100;
7
+ export let step = 1;
7
8
  let valuesText = min + ',' + max;
8
9
  export let values = [min, max];
10
+ function escapeFloatingPoint(number) {
11
+ return Number(parseFloat(number).toPrecision(12));
12
+ }
9
13
  $: {
10
14
  if (values.toString() !== valuesText) {
11
- valuesText = values[0] + "," + values[1];
15
+ valuesText = escapeFloatingPoint(values[0]) + "," + escapeFloatingPoint(values[1]);
12
16
  }
13
17
  }
14
18
  function handleChange(event) {
15
- valuesText = event.detail.toString();
19
+ valuesText = escapeFloatingPoint(event.detail[0]) + "," + escapeFloatingPoint(event.detail[1]);
16
20
  dispatch('change', event.detail);
17
21
  }
18
22
  function handleMouseDown() {
@@ -27,6 +31,7 @@ function handleMouseDown() {
27
31
  bind:value={values}
28
32
  {min}
29
33
  {max}
34
+ {step}
30
35
  range
31
36
  order
32
37
  on:input={handleChange}
@@ -4,6 +4,7 @@ declare const __propDef: {
4
4
  [x: string]: any;
5
5
  min?: number;
6
6
  max?: number;
7
+ step?: number;
7
8
  values?: number[];
8
9
  };
9
10
  events: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluent-svelte-extra",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "A faithful implementation of Microsoft's Fluent Design System in Svelte.",
5
5
  "homepage": "https://github.com/OpenAnime/fluent-svelte-extra",
6
6
  "license": "MIT",