@dataloop-ai/components 0.19.164 → 0.19.165
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
|
@@ -676,25 +676,20 @@ export default defineComponent({
|
|
|
676
676
|
}
|
|
677
677
|
|
|
678
678
|
const handleValueTrim = () => {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
isInternalChange.value = true
|
|
679
|
+
const trimmed = String(modelValue.value).trim()
|
|
680
|
+
if (trimmed !== String(modelValue.value)) {
|
|
681
|
+
isInternalChange.value = true
|
|
683
682
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
683
|
+
input.value.innerHTML = trimmed
|
|
684
|
+
.toString()
|
|
685
|
+
.replace(/ /g, ' ')
|
|
686
|
+
updateSyntax()
|
|
687
|
+
setCaretAtTheEnd(input.value)
|
|
689
688
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
emit('input', toEmit)
|
|
695
|
-
emit('update:model-value', toEmit)
|
|
696
|
-
}
|
|
697
|
-
})
|
|
689
|
+
const toEmit = trimmed.replace(new RegExp(' ', 'g'), ' ')
|
|
690
|
+
emit('input', toEmit)
|
|
691
|
+
emit('update:model-value', toEmit)
|
|
692
|
+
}
|
|
698
693
|
}
|
|
699
694
|
|
|
700
695
|
const debouncedHandleValueTrim = computed<Function>(() => {
|
|
@@ -838,7 +833,7 @@ export default defineComponent({
|
|
|
838
833
|
})
|
|
839
834
|
|
|
840
835
|
const onModelValueChange = (val: string | number) => {
|
|
841
|
-
if (
|
|
836
|
+
if (val !== null && val !== undefined) {
|
|
842
837
|
if (readonly.value || disabled.value) {
|
|
843
838
|
return
|
|
844
839
|
}
|
|
@@ -848,9 +843,8 @@ export default defineComponent({
|
|
|
848
843
|
}
|
|
849
844
|
|
|
850
845
|
input.value.innerHTML = val.toString().replace(/ /g, ' ')
|
|
851
|
-
} else {
|
|
852
|
-
isInternalChange.value = false
|
|
853
846
|
}
|
|
847
|
+
isInternalChange.value = false
|
|
854
848
|
}
|
|
855
849
|
|
|
856
850
|
const debouncedOnModelValueChange = computed<Function>(() => {
|
|
@@ -869,6 +863,11 @@ export default defineComponent({
|
|
|
869
863
|
watch(
|
|
870
864
|
modelValue,
|
|
871
865
|
(val: string | number) => {
|
|
866
|
+
if (isInternalChange.value) {
|
|
867
|
+
isInternalChange.value = false
|
|
868
|
+
return
|
|
869
|
+
}
|
|
870
|
+
|
|
872
871
|
nextTick(() => {
|
|
873
872
|
if (firstTime.value) {
|
|
874
873
|
if (readonly.value || disabled.value) {
|
|
@@ -1170,6 +1169,10 @@ export default defineComponent({
|
|
|
1170
1169
|
e.preventDefault()
|
|
1171
1170
|
return
|
|
1172
1171
|
}
|
|
1172
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
1173
|
+
e.preventDefault()
|
|
1174
|
+
return
|
|
1175
|
+
}
|
|
1173
1176
|
}
|
|
1174
1177
|
},
|
|
1175
1178
|
onClick(e: Event, item: DlInputSuggestion) {
|