@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 +1 -1
- package/src/components/basic/DlAlert/DlAlert.vue +4 -3
- package/src/components/compound/DlSelect/DlSelect.vue +2 -4
- package/src/components/compound/DlSlider/components/DlSliderBase.vue +8 -17
- package/src/components/compound/DlSlider/components/DlSliderInput.vue +3 -1
- package/src/components/compound/DlSlider/utils.ts +1 -1
- package/src/utils/selection.ts +3 -1
package/package.json
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
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:
|
|
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="
|
|
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
|
}
|