@dataloop-ai/components 0.20.16 → 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.16",
3
+ "version": "0.20.18",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -125,6 +125,7 @@ export default defineComponent({
125
125
  emits: ['update:model-value'],
126
126
  setup(props, { emit }) {
127
127
  const { padding, modelValue, type } = toRefs(props)
128
+ const show = ref(modelValue.value)
128
129
  const icon = computed(() => typeToIconMap[type.value as DlAlertType])
129
130
  const iconColor = computed(
130
131
  () => typeToIconColorMap[type.value as DlAlertType]
@@ -143,7 +144,7 @@ export default defineComponent({
143
144
  })
144
145
 
145
146
  watch(modelValue, (val) => {
146
- modelValue.value = val
147
+ show.value = val
147
148
  })
148
149
 
149
150
  watch(type, (val) => {
@@ -198,14 +199,14 @@ export default defineComponent({
198
199
  }
199
200
 
200
201
  function handleClose() {
201
- modelValue.value = false
202
+ show.value = false
202
203
  emit('update:model-value', false)
203
204
  }
204
205
 
205
206
  return {
206
207
  uuid: `dl-alert-${v4()}`,
207
208
  rootRef,
208
- show: modelValue,
209
+ show,
209
210
  icon,
210
211
  iconColor,
211
212
  rootStyle,
@@ -177,7 +177,7 @@
177
177
  :style="
178
178
  optionsCount > MAX_ITEMS_PER_LIST
179
179
  ? ''
180
- : `width: 100%; max-height: calc(${calculatedDropdownMaxHeight} - 20px); overflow-y: scroll;`
180
+ : `width: 100%; max-height: calc(${calculatedDropdownMaxHeight} - 20px); overflow-y: auto;`
181
181
  "
182
182
  >
183
183
  <dl-select-option
@@ -1245,9 +1245,7 @@ export default defineComponent({
1245
1245
  justify-content: center !important;
1246
1246
  align-items: center;
1247
1247
  color: var(--dl-color-medium);
1248
- transition-property:
1249
- transform,
1250
- -webkit-transform;
1248
+ transition-property: transform, -webkit-transform;
1251
1249
  transition-duration: 0.28s, 0.28s;
1252
1250
  transition-timing-function: ease, ease;
1253
1251
  transition-delay: 0s, 0s;
@@ -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
  }