m3-svelte 5.15.1 → 5.15.2
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.
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
} & Omit<HTMLInputAttributes, "size"> = $props();
|
|
39
39
|
// @ts-expect-error deprecated backwards compatibility with ticks
|
|
40
40
|
let stops = $derived(extra.ticks ? true : _stops);
|
|
41
|
-
let
|
|
41
|
+
let offsetWidth = $state(600);
|
|
42
|
+
let offsetHeight = $state(600);
|
|
43
|
+
let inlineSize = $derived(vertical ? offsetHeight : offsetWidth);
|
|
42
44
|
|
|
43
45
|
const valueDisplayed = new Spring(value, { stiffness: 0.3, damping: 1 });
|
|
44
46
|
const updateValue = (e: Event & { currentTarget: EventTarget & HTMLInputElement }) => {
|
|
@@ -72,7 +74,8 @@
|
|
|
72
74
|
<div
|
|
73
75
|
class="m3-container {size} {vertical ? 'vertical' : ''}"
|
|
74
76
|
style:--handle={handle - 0.5}
|
|
75
|
-
bind:offsetWidth
|
|
77
|
+
bind:offsetWidth
|
|
78
|
+
bind:offsetHeight
|
|
76
79
|
>
|
|
77
80
|
<input
|
|
78
81
|
type="range"
|
|
@@ -97,13 +100,13 @@
|
|
|
97
100
|
{#if leadingIcon}
|
|
98
101
|
<Icon
|
|
99
102
|
icon={leadingIcon}
|
|
100
|
-
class={"leading" + (
|
|
103
|
+
class={"leading" + (inlineSize * handle < (size == "xl" ? 48 : 40) ? " pop" : "")}
|
|
101
104
|
/>
|
|
102
105
|
{/if}
|
|
103
106
|
{#if trailingIcon}
|
|
104
107
|
<Icon
|
|
105
108
|
icon={trailingIcon}
|
|
106
|
-
class={"trailing" + (
|
|
109
|
+
class={"trailing" + (inlineSize * (1 - handle) < (size == "xl" ? 48 : 40) ? " pop" : "")}
|
|
107
110
|
/>
|
|
108
111
|
{/if}
|
|
109
112
|
<div class="handle"></div>
|