fluent-svelte-extra 1.1.4 → 1.1.6
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.
|
@@ -1,43 +1,50 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let values = min
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
2
|
+
const dispatch = createEventDispatcher();
|
|
3
|
+
import Slider from '@bulatdashiev/svelte-slider';
|
|
4
|
+
import { TextBlock } from 'fluent-svelte';
|
|
5
|
+
export let min = 1;
|
|
6
|
+
export let max = 100;
|
|
7
|
+
let valuesText = min + ',' + max;
|
|
8
|
+
export let values = [min, max];
|
|
9
|
+
$: {
|
|
10
|
+
if (values.toString() !== valuesText) {
|
|
11
|
+
valuesText = values[0] + "," + values[1];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function handleChange(event) {
|
|
15
|
+
valuesText = event.detail.toString();
|
|
16
|
+
dispatch('change', event.detail);
|
|
17
|
+
}
|
|
18
|
+
function handleMouseDown() {
|
|
19
|
+
document.addEventListener("mouseup", () => {
|
|
20
|
+
dispatch('finish', valuesText.toString());
|
|
21
|
+
}, { once: true });
|
|
22
|
+
}
|
|
17
23
|
</script>
|
|
18
24
|
|
|
19
|
-
<div id="sliderComp"
|
|
25
|
+
<div id="sliderComp" {...$$restProps}>
|
|
20
26
|
<Slider
|
|
21
|
-
bind:value={
|
|
27
|
+
bind:value={values}
|
|
22
28
|
{min}
|
|
23
29
|
{max}
|
|
24
30
|
range
|
|
25
|
-
|
|
31
|
+
order
|
|
32
|
+
on:input={handleChange}
|
|
26
33
|
>
|
|
27
34
|
<div
|
|
28
35
|
slot="left"
|
|
29
36
|
class="handle"
|
|
30
|
-
on:
|
|
37
|
+
on:mousedown={handleMouseDown}
|
|
31
38
|
/>
|
|
32
39
|
<div
|
|
33
40
|
slot="right"
|
|
34
41
|
class="handle"
|
|
35
|
-
on:
|
|
42
|
+
on:mousedown={handleMouseDown}
|
|
36
43
|
/>
|
|
37
44
|
</Slider>
|
|
38
45
|
<div id="vals">
|
|
39
|
-
<TextBlock>{
|
|
40
|
-
<TextBlock>{
|
|
46
|
+
<TextBlock>{valuesText.split(',')[0]}</TextBlock>
|
|
47
|
+
<TextBlock>{valuesText.split(',')[1]}</TextBlock>
|
|
41
48
|
</div>
|
|
42
49
|
</div>
|
|
43
50
|
|
|
@@ -1,33 +1,22 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} RangeSliderProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} RangeSliderEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} RangeSliderSlots */
|
|
4
|
-
export default class RangeSlider extends SvelteComponentTyped<{
|
|
5
|
-
min: any;
|
|
6
|
-
max: any;
|
|
7
|
-
width: any;
|
|
8
|
-
}, {
|
|
9
|
-
finish: CustomEvent<any>;
|
|
10
|
-
change: CustomEvent<any>;
|
|
11
|
-
} & {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}> {
|
|
14
|
-
}
|
|
15
|
-
export type RangeSliderProps = typeof __propDef.props;
|
|
16
|
-
export type RangeSliderEvents = typeof __propDef.events;
|
|
17
|
-
export type RangeSliderSlots = typeof __propDef.slots;
|
|
18
1
|
import { SvelteComponentTyped } from "svelte";
|
|
19
2
|
declare const __propDef: {
|
|
20
3
|
props: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
values?: number[];
|
|
24
8
|
};
|
|
25
9
|
events: {
|
|
26
|
-
finish: CustomEvent<any>;
|
|
27
10
|
change: CustomEvent<any>;
|
|
11
|
+
finish: CustomEvent<any>;
|
|
28
12
|
} & {
|
|
29
13
|
[evt: string]: CustomEvent<any>;
|
|
30
14
|
};
|
|
31
15
|
slots: {};
|
|
32
16
|
};
|
|
17
|
+
export declare type RangeSliderProps = typeof __propDef.props;
|
|
18
|
+
export declare type RangeSliderEvents = typeof __propDef.events;
|
|
19
|
+
export declare type RangeSliderSlots = typeof __propDef.slots;
|
|
20
|
+
export default class RangeSlider extends SvelteComponentTyped<RangeSliderProps, RangeSliderEvents, RangeSliderSlots> {
|
|
21
|
+
}
|
|
33
22
|
export {};
|
package/package.json
CHANGED