@dataloop-ai/components 0.20.17 → 0.20.18
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/package.json
CHANGED
|
@@ -13,26 +13,15 @@
|
|
|
13
13
|
data-test="track-container"
|
|
14
14
|
v-on="trackContainerEvents"
|
|
15
15
|
>
|
|
16
|
-
<div
|
|
17
|
-
class="
|
|
18
|
-
:style="
|
|
19
|
-
data-test="track"
|
|
20
|
-
>
|
|
21
|
-
<div
|
|
22
|
-
class="selection"
|
|
23
|
-
:style="selectionBarStyle"
|
|
24
|
-
/>
|
|
25
|
-
<div
|
|
26
|
-
class="thumb"
|
|
27
|
-
:style="thumbStyle"
|
|
28
|
-
data-test="thumb"
|
|
29
|
-
>
|
|
16
|
+
<div class="track" :style="trackStyle" data-test="track">
|
|
17
|
+
<div class="selection" :style="selectionBarStyle" />
|
|
18
|
+
<div class="thumb" :style="thumbStyle" data-test="thumb">
|
|
30
19
|
<input
|
|
31
20
|
v-if="name !== null && disabled !== true"
|
|
32
21
|
type="hidden"
|
|
33
22
|
:name="name"
|
|
34
23
|
:value="model"
|
|
35
|
-
|
|
24
|
+
/>
|
|
36
25
|
</div>
|
|
37
26
|
</div>
|
|
38
27
|
</div>
|
|
@@ -48,7 +37,8 @@ import {
|
|
|
48
37
|
stopAndPrevent,
|
|
49
38
|
position,
|
|
50
39
|
keyCodes,
|
|
51
|
-
between
|
|
40
|
+
between,
|
|
41
|
+
isMobileOrTablet
|
|
52
42
|
} from '../../../../utils'
|
|
53
43
|
import touchPanDirective from '../../../../directives/TouchPan'
|
|
54
44
|
|
|
@@ -131,7 +121,7 @@ export default defineComponent({
|
|
|
131
121
|
},
|
|
132
122
|
computed: {
|
|
133
123
|
isMobile(): boolean {
|
|
134
|
-
return
|
|
124
|
+
return isMobileOrTablet()
|
|
135
125
|
},
|
|
136
126
|
modelRatio(): number {
|
|
137
127
|
return this.convertModelToRatio(this.model)
|
|
@@ -324,6 +314,7 @@ export default defineComponent({
|
|
|
324
314
|
return between(val, this.minRation, this.maxRatio)
|
|
325
315
|
},
|
|
326
316
|
onActivate(evt: MouseEvent) {
|
|
317
|
+
console.log('hiihihihihihih')
|
|
327
318
|
this.updatePosition(evt, this.getDragging(evt))
|
|
328
319
|
this.updateValue()
|
|
329
320
|
|
|
@@ -3,5 +3,5 @@ export const getInputValue = (value: string, min: number, max: number) => {
|
|
|
3
3
|
const clampedValue = Math.max(min, Math.min(numericValue, max))
|
|
4
4
|
const isUpdated = numericValue !== clampedValue
|
|
5
5
|
|
|
6
|
-
return { value: clampedValue
|
|
6
|
+
return { value: clampedValue, isUpdated }
|
|
7
7
|
}
|
package/src/utils/selection.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isMobileOrTablet } from '.'
|
|
2
|
+
|
|
1
3
|
export function clearSelection() {
|
|
2
4
|
if (window.getSelection) {
|
|
3
5
|
const selection = window.getSelection()
|
|
@@ -7,7 +9,7 @@ export function clearSelection() {
|
|
|
7
9
|
selection.empty()
|
|
8
10
|
} else if (selection.removeAllRanges) {
|
|
9
11
|
selection.removeAllRanges()
|
|
10
|
-
if (
|
|
12
|
+
if (isMobileOrTablet()) {
|
|
11
13
|
selection.addRange(document.createRange())
|
|
12
14
|
}
|
|
13
15
|
}
|