poe-svelte-ui-lib 1.2.27 → 1.2.28
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.
- package/dist/Slider/Slider.svelte +11 -6
- package/package.json +1 -1
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
: (e) => {
|
|
100
100
|
const newValue = Math.min(Number((e.target as HTMLInputElement).value), upperValue)
|
|
101
101
|
lowerValue = roundToClean(newValue == upperValue ? upperValue - number.step : newValue)
|
|
102
|
+
onUpdate([lowerValue, upperValue])
|
|
102
103
|
}}
|
|
103
104
|
onmousedown={() => (activeRound = 'ceil')}
|
|
104
105
|
{disabled}
|
|
@@ -113,7 +114,7 @@
|
|
|
113
114
|
[&::-webkit-slider-thumb]:size-4
|
|
114
115
|
[&::-webkit-slider-thumb]:cursor-pointer
|
|
115
116
|
[&::-webkit-slider-thumb]:rounded-full
|
|
116
|
-
|
|
117
|
+
[&::-webkit-slider-thumb]:shadow-[var(--focus-shadow),]
|
|
117
118
|
${
|
|
118
119
|
userAgent.includes('iOS') || userAgent.includes('iPhone') || userAgent.includes('iPad')
|
|
119
120
|
? '[&::-webkit-slider-thumb]:ring-[6.5px]'
|
|
@@ -132,6 +133,7 @@
|
|
|
132
133
|
`[&::-moz-range-thumb]:shadow-[calc(100rem+0.5rem)_0_0_100rem]
|
|
133
134
|
[&::-webkit-slider-thumb]:shadow-[calc(100rem+0.5rem)_0_0_100rem]`,
|
|
134
135
|
)}
|
|
136
|
+
style={`flex-basis: calc(${(centerNum / number.maxNum) * 100}%+2rem+5px)`}
|
|
135
137
|
/>
|
|
136
138
|
<input
|
|
137
139
|
type="range"
|
|
@@ -144,6 +146,7 @@
|
|
|
144
146
|
: (e) => {
|
|
145
147
|
const newValue = Math.max(Number((e.target as HTMLInputElement).value), lowerValue)
|
|
146
148
|
upperValue = roundToClean(newValue == lowerValue ? newValue + number.step : upperValue)
|
|
149
|
+
onUpdate([lowerValue, upperValue])
|
|
147
150
|
}}
|
|
148
151
|
onmousedown={() => (activeRound = 'floor')}
|
|
149
152
|
{disabled}
|
|
@@ -158,7 +161,7 @@
|
|
|
158
161
|
[&::-webkit-slider-thumb]:size-4
|
|
159
162
|
[&::-webkit-slider-thumb]:cursor-pointer
|
|
160
163
|
[&::-webkit-slider-thumb]:rounded-full
|
|
161
|
-
|
|
164
|
+
[&::-webkit-slider-thumb]:shadow-[var(--focus-shadow),]
|
|
162
165
|
${
|
|
163
166
|
userAgent.includes('iOS') || userAgent.includes('iPhone') || userAgent.includes('iPad')
|
|
164
167
|
? '[&::-webkit-slider-thumb]:ring-[6.5px]'
|
|
@@ -177,6 +180,7 @@
|
|
|
177
180
|
`[&::-moz-range-thumb]:shadow-[calc(100rem*-1-0.5rem)_0_0_100rem]
|
|
178
181
|
[&::-webkit-slider-thumb]:shadow-[calc(100rem*-1-0.5rem)_0_0_100rem]`,
|
|
179
182
|
)}
|
|
183
|
+
style={`flex-basis: calc(${(centerNum / number.maxNum) * 100}%+2rem+5px)`}
|
|
180
184
|
/>
|
|
181
185
|
</div>
|
|
182
186
|
{:else}
|
|
@@ -185,6 +189,11 @@
|
|
|
185
189
|
<div class="absolute h-full w-full">
|
|
186
190
|
<input
|
|
187
191
|
type="range"
|
|
192
|
+
min={number.minNum}
|
|
193
|
+
max={number.maxNum}
|
|
194
|
+
step={number.step}
|
|
195
|
+
bind:value={singleValue}
|
|
196
|
+
oninput={() => onUpdate(singleValue)}
|
|
188
197
|
class={twMerge(
|
|
189
198
|
`slider-bg h-8 w-full appearance-none overflow-hidden rounded-full accent-(--back-color)
|
|
190
199
|
[&::-webkit-slider-runnable-track]:rounded-full
|
|
@@ -215,10 +224,6 @@
|
|
|
215
224
|
`[&::-moz-range-thumb]:shadow-[calc(100rem*-1-0.5rem)_0_0_100rem]
|
|
216
225
|
[&::-webkit-slider-thumb]:shadow-[calc(100rem*-1-0.5rem)_0_0_100rem]`,
|
|
217
226
|
)}
|
|
218
|
-
min={number.minNum}
|
|
219
|
-
max={number.maxNum}
|
|
220
|
-
step={number.step}
|
|
221
|
-
bind:value={singleValue}
|
|
222
227
|
/>
|
|
223
228
|
</div>
|
|
224
229
|
{/if}
|