@dataloop-ai/components 0.20.259-new-json.0 → 0.20.259-new-json.2

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.259-new-json.0",
3
+ "version": "0.20.259-new-json.2",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -42,7 +42,7 @@
42
42
  "tokenizr": "^1.7.0",
43
43
  "uuid": "^8.3.2",
44
44
  "v-wave": "^1.5.0",
45
- "vanilla-jsoneditor": "^0.15.1",
45
+ "vanilla-jsoneditor": "^0.10.4",
46
46
  "vue-demi": "^0.14.5",
47
47
  "vue-sortable": "^0.1.3",
48
48
  "vue2-teleport": "^1.0.1"
@@ -76,6 +76,13 @@ export default defineComponent({
76
76
  const jsonEditor = ref<JSONEditor>(null as any)
77
77
  const innerUpdate = ref(false)
78
78
 
79
+ const blurActiveEditorElement = () => {
80
+ const target = jsonEditorRef.value as HTMLElement | null
81
+ if (target?.contains(document.activeElement)) {
82
+ ;(document.activeElement as HTMLElement)?.blur()
83
+ }
84
+ }
85
+
79
86
  watch(modelValue, (val) => {
80
87
  if (innerUpdate.value) {
81
88
  innerUpdate.value = false
@@ -162,13 +169,15 @@ export default defineComponent({
162
169
  jsonEditor.value?.set({
163
170
  text: modelValue.value
164
171
  })
165
-
166
172
  nextTick(() => {
167
173
  jsonEditor.value?.refresh()
168
- if (autoFocus.value) {
169
- jsonEditor.value?.focus()
170
- }
171
174
  })
175
+
176
+ if (!autoFocus.value) {
177
+ nextTick(() => {
178
+ blurActiveEditorElement()
179
+ })
180
+ }
172
181
  }
173
182
 
174
183
  watch(readonly, (val) => {