@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.20.17",
3
+ "version": "0.20.18",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -13,26 +13,15 @@
13
13
  data-test="track-container"
14
14
  v-on="trackContainerEvents"
15
15
  >
16
- <div
17
- class="track"
18
- :style="trackStyle"
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 'ontouchstart' in window
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
 
@@ -67,7 +67,9 @@ export default defineComponent({
67
67
  emit('update:model-value', value)
68
68
 
69
69
  if (isUpdated) {
70
- if (sliderInput.value) sliderInput.value.value = value
70
+ if (sliderInput.value) {
71
+ sliderInput.value.value = String(value)
72
+ }
71
73
  }
72
74
  }
73
75
 
@@ -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.toString(), isUpdated }
6
+ return { value: clampedValue, isUpdated }
7
7
  }
@@ -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 ('ontouchstart' in window) {
12
+ if (isMobileOrTablet()) {
11
13
  selection.addRange(document.createRange())
12
14
  }
13
15
  }