@dataloop-ai/components 0.20.119 → 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 +1 -1
- package/src/components/compound/DlJsonEditor/DlJsonEditor.vue +2 -1
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchJsonEditorDialog.vue +10 -0
- package/src/components/compound/DlSelect/DlSelect.vue +44 -12
- package/src/demos/DlSelectDemo.vue +26 -1
package/package.json
CHANGED
|
@@ -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
|
}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
:class="{
|
|
7
7
|
'root-container--s': isSmall,
|
|
8
8
|
[identifierClass]: true,
|
|
9
|
-
'fit-content': fitContent
|
|
9
|
+
'fit-content': fitContent,
|
|
10
|
+
'row-root': !!errorIcon.length
|
|
10
11
|
}"
|
|
11
12
|
>
|
|
12
13
|
<div
|
|
@@ -318,17 +319,42 @@
|
|
|
318
319
|
v-if="!isSmall && (!!infoMessage.length || !!errorMessage.length)"
|
|
319
320
|
class="bottom-message-container"
|
|
320
321
|
>
|
|
321
|
-
<
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
322
|
+
<span v-if="!!errorIcon.length">
|
|
323
|
+
<dl-icon
|
|
324
|
+
v-if="!!infoMessage.length && !error"
|
|
325
|
+
icon="icon-dl-info"
|
|
326
|
+
:inline="false"
|
|
327
|
+
:size="iconSize"
|
|
328
|
+
>
|
|
329
|
+
<dl-tooltip>
|
|
330
|
+
{{ infoMessage }}
|
|
331
|
+
</dl-tooltip>
|
|
332
|
+
</dl-icon>
|
|
333
|
+
<dl-icon
|
|
334
|
+
v-if="error && !!errorMessage.length"
|
|
335
|
+
:icon="errorIcon"
|
|
336
|
+
:inline="false"
|
|
337
|
+
color="dl-color-negative"
|
|
338
|
+
:size="iconSize"
|
|
339
|
+
>
|
|
340
|
+
<dl-tooltip>
|
|
341
|
+
{{ errorMessage }}
|
|
342
|
+
</dl-tooltip>
|
|
343
|
+
</dl-icon>
|
|
344
|
+
</span>
|
|
345
|
+
<span v-else>
|
|
346
|
+
<dl-info-error-message
|
|
347
|
+
v-if="!!infoMessage.length && !error"
|
|
348
|
+
position="below"
|
|
349
|
+
:value="infoMessage"
|
|
350
|
+
/>
|
|
351
|
+
<dl-info-error-message
|
|
352
|
+
v-if="error && !!errorMessage.length"
|
|
353
|
+
position="below"
|
|
354
|
+
error
|
|
355
|
+
:value="errorMessage"
|
|
356
|
+
/>
|
|
357
|
+
</span>
|
|
332
358
|
</div>
|
|
333
359
|
</div>
|
|
334
360
|
</template>
|
|
@@ -409,6 +435,7 @@ export default defineComponent({
|
|
|
409
435
|
infoMessage: { type: String, default: '' },
|
|
410
436
|
errorMessage: { type: String, default: '' },
|
|
411
437
|
error: { type: Boolean, default: false },
|
|
438
|
+
errorIcon: { type: String, default: '' },
|
|
412
439
|
disabled: { type: Boolean, default: false },
|
|
413
440
|
readonly: { type: Boolean, default: false },
|
|
414
441
|
emitValue: { type: Boolean, default: false }, // We emit the value from the option and compare with it as a modelvalue
|
|
@@ -1418,4 +1445,9 @@ export default defineComponent({
|
|
|
1418
1445
|
.fit-content > * {
|
|
1419
1446
|
max-width: fit-content;
|
|
1420
1447
|
}
|
|
1448
|
+
.row-root {
|
|
1449
|
+
display: flex;
|
|
1450
|
+
gap: 8px;
|
|
1451
|
+
align-items: center;
|
|
1452
|
+
}
|
|
1421
1453
|
</style>
|
|
@@ -732,6 +732,30 @@
|
|
|
732
732
|
<div>{{ scope.opt.label }}</div>
|
|
733
733
|
</template>
|
|
734
734
|
</dl-select>
|
|
735
|
+
Recipe for a select with {{ labelInputError }} as labels
|
|
736
|
+
<dl-select
|
|
737
|
+
ref="newLabelInput"
|
|
738
|
+
v-model.trim="labelInputError"
|
|
739
|
+
hide-dropdown-icon
|
|
740
|
+
:input-debounce="0"
|
|
741
|
+
:options="searchOptions"
|
|
742
|
+
:error="labelInputError.length === 0"
|
|
743
|
+
error-message="label Input Error Message"
|
|
744
|
+
hide-selected
|
|
745
|
+
searchable
|
|
746
|
+
placeholder="Insert label number"
|
|
747
|
+
size="m"
|
|
748
|
+
style="width: 80%; margin-bottom: 0"
|
|
749
|
+
custom-filter
|
|
750
|
+
hide-chevron
|
|
751
|
+
open-menu-during-search
|
|
752
|
+
disable-search-highlighting
|
|
753
|
+
menu-class="--js-add-new-recipe-label"
|
|
754
|
+
class="--js-add-new-recipe-label"
|
|
755
|
+
error-icon="icon-dl-error-filled"
|
|
756
|
+
>
|
|
757
|
+
<template #prepend><span /></template>
|
|
758
|
+
</dl-select>
|
|
735
759
|
</div>
|
|
736
760
|
</template>
|
|
737
761
|
|
|
@@ -1023,7 +1047,8 @@ export default defineComponent({
|
|
|
1023
1047
|
disabledSelected: 'disabled option',
|
|
1024
1048
|
preSelectedValue: null,
|
|
1025
1049
|
optionsAsNumbers,
|
|
1026
|
-
selectedNumbers: []
|
|
1050
|
+
selectedNumbers: [],
|
|
1051
|
+
labelInputError: ''
|
|
1027
1052
|
}
|
|
1028
1053
|
},
|
|
1029
1054
|
computed: {
|