@@ -65,6 +65,7 @@ function labelUp(pipValue, event) {
6565 class: selected= {isSelected (min, values, precision)}
6666 class: in - range= {isInRange (min, values, range)}
6767 style= " {orientationStart}: 0%;"
68+ data- val= {coerceFloat (min, precision)}
6869 on: pointerdown= {(e ) => {
6970 labelDown (e);
7071 }}
@@ -74,46 +75,36 @@ function labelUp(pipValue, event) {
7475 >
7576 {#if all === ' label' || first === ' label' }
7677 < span class = " pipVal" >
77- {#if prefix}< span class = " pipVal-prefix" > {prefix}< / span> {/ if }{@html formatter (
78- coerceFloat (min),
79- 0 ,
80- 0
81- )}{#if suffix}< span class = " pipVal-suffix" > {suffix}< / span> {/ if }
78+ {#if prefix}< span class = " pipVal-prefix" > {prefix}< / span> {/ if }
79+ {@html formatter (coerceFloat (min, precision), 0 , 0 )}
80+ {#if suffix}< span class = " pipVal-suffix" > {suffix}< / span> {/ if }
8281 < / span>
8382 {/ if }
8483 < / span>
8584 {/ if }
8685
8786 {#if (all && rest !== false ) || rest}
8887 {#each Array (pipCount + 1 ) as _, i}
89- {#if getValueFromIndex (i, min, max, pipStep, step) !== min && getValueFromIndex (i, min, max, pipStep, step) !== max}
88+ {@const val = getValueFromIndex (i, min, max, pipStep, step, precision)}
89+ {#if val !== min && val !== max}
9090 < span
9191 class = " pip"
92- class: selected= {isSelected (
93- getValueFromIndex (i, min, max, pipStep, step),
94- values,
95- precision
96- )}
97- class: in - range= {isInRange (getValueFromIndex (i, min, max, pipStep, step), values, range)}
98- style= " {orientationStart}: {valueAsPercent(
99- getValueFromIndex(i, min, max, pipStep, step),
100- min,
101- max
102- )}%;"
92+ class: selected= {isSelected (val, values, precision)}
93+ class: in - range= {isInRange (val, values, range)}
94+ style= " {orientationStart}: {valueAsPercent(val, min, max, precision)}%;"
95+ data- val= {val}
10396 on: pointerdown= {(e ) => {
10497 labelDown (e);
10598 }}
10699 on: pointerup= {(e ) => {
107- labelUp (getValueFromIndex (i, min, max, pipStep, step) , e);
100+ labelUp (val , e);
108101 }}
109102 >
110103 {#if all === ' label' || rest === ' label' }
111104 < span class = " pipVal" >
112- {#if prefix}< span class = " pipVal-prefix" > {prefix}< / span> {/ if }{@html formatter (
113- getValueFromIndex (i, min, max, pipStep, step),
114- i,
115- valueAsPercent (getValueFromIndex (i, min, max, pipStep, step), min, max, precision)
116- )}{#if suffix}< span class = " pipVal-suffix" > {suffix}< / span> {/ if }
105+ {#if true || prefix}< span class = " pipVal-prefix" > {prefix}< / span> {/ if }
106+ {@html formatter (val, i, valueAsPercent (val, min, max, precision))}
107+ {#if true || suffix}< span class = " pipVal-suffix" > {suffix}< / span> {/ if }
117108 < / span>
118109 {/ if }
119110 < / span>
@@ -127,6 +118,7 @@ function labelUp(pipValue, event) {
127118 class: selected= {isSelected (max, values, precision)}
128119 class: in - range= {isInRange (max, values, range)}
129120 style= " {orientationStart}: 100%;"
121+ data- val= {coerceFloat (max, precision)}
130122 on: pointerdown= {(e ) => {
131123 labelDown (e);
132124 }}
@@ -136,11 +128,9 @@ function labelUp(pipValue, event) {
136128 >
137129 {#if all === ' label' || last === ' label' }
138130 < span class = " pipVal" >
139- {#if prefix}< span class = " pipVal-prefix" > {prefix}< / span> {/ if }{@html formatter (
140- coerceFloat (max),
141- pipCount,
142- 100
143- )}{#if suffix}< span class = " pipVal-suffix" > {suffix}< / span> {/ if }
131+ {#if prefix}< span class = " pipVal-prefix" > {prefix}< / span> {/ if }
132+ {@html formatter (coerceFloat (max, precision), pipCount, 100 )}
133+ {#if suffix}< span class = " pipVal-suffix" > {suffix}< / span> {/ if }
144134 < / span>
145135 {/ if }
146136 < / span>
@@ -201,6 +191,7 @@ function labelUp(pipValue, event) {
201191 position: absolute;
202192 top: 0 .4em ;
203193 transform: translate (- 50 % , 25 % );
194+ display: inline- flex;
204195 }
205196
206197 : global (.rangePips .vertical .pipVal ) {
0 commit comments