@dataloop-ai/components 0.20.120 → 0.20.121

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.120",
3
+ "version": "0.20.121",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -58,7 +58,7 @@ export default defineComponent({
58
58
  default: Mode.text
59
59
  }
60
60
  },
61
- emits: ['update:model-value', 'align-text', 'change', 'focus', 'blur'],
61
+ emits: ['update:model-value', 'align-text', 'change', 'content-error', 'focus', 'blur'],
62
62
  setup(props, { emit }) {
63
63
  const { modelValue, indentation, readonly, mode } = toRefs(props)
64
64
 
@@ -99,6 +99,7 @@ export default defineComponent({
99
99
  '[DlJsonEditor] Failed to parse JSON'
100
100
  )
101
101
  }
102
+ emit('content-error')
102
103
  return
103
104
  }
104
105
 
@@ -43,6 +43,7 @@
43
43
  flat
44
44
  color="secondary"
45
45
  padding="0px 3px"
46
+ :disabled="alignDisabled"
46
47
  @click="alignJSON"
47
48
  />
48
49
  </div>
@@ -51,6 +52,7 @@
51
52
  v-model="stringifiedJSON"
52
53
  class="json-editor"
53
54
  @change="onChange"
55
+ @content-error="onContentError"
54
56
  />
55
57
  </div>
56
58
  </template>
@@ -230,6 +232,7 @@ export default defineComponent({
230
232
  const showSaveDialog = ref(false)
231
233
  const showDeleteDialog = ref(false)
232
234
  const newQueryName = ref('')
235
+ const alignDisabled = ref(false)
233
236
 
234
237
  const selectOptions = computed<DlSelectOption[]>(() => {
235
238
  return uniqBy(
@@ -313,6 +316,11 @@ export default defineComponent({
313
316
  const parsed = toObject(json)
314
317
  if (!parsed) return
315
318
  emit('change', parsed)
319
+ alignDisabled.value = false
320
+ }
321
+
322
+ const onContentError = () => {
323
+ alignDisabled.value = true
316
324
  }
317
325
 
318
326
  const saveQuery = (searchAfterSave = false) => {
@@ -386,10 +394,12 @@ export default defineComponent({
386
394
  alignJSON,
387
395
  onQuerySelect,
388
396
  newQueryName,
397
+ alignDisabled,
389
398
  showDeleteDialog,
390
399
  selectOptions,
391
400
  search,
392
401
  onChange,
402
+ onContentError,
393
403
  saveQuery,
394
404
  deleteQuery
395
405
  }