@dataloop-ai/components 0.20.168-ds-v3.0 → 0.20.168-ds-v3.1
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/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +6 -1
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchJsonEditorDialog.vue +25 -19
- package/src/components/compound/DlTreeTable/DlTreeTable.vue +19 -2
- package/src/components/essential/DlSwitch/DlSwitch.vue +14 -4
- package/src/demos/SmartSearchDemo/DlSmartSearchDemo.vue +1 -0
package/package.json
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
55
|
<dl-tooltip
|
|
56
|
-
v-if="!focused"
|
|
56
|
+
v-if="!focused && !noTooltip"
|
|
57
57
|
border="1px solid var(--dl-color-separator)"
|
|
58
58
|
background-color="dl-color-panel-background"
|
|
59
59
|
color="dl-color-darker"
|
|
@@ -248,6 +248,10 @@ export default defineComponent({
|
|
|
248
248
|
type: String,
|
|
249
249
|
default: '28px'
|
|
250
250
|
},
|
|
251
|
+
noTooltip: {
|
|
252
|
+
type: Boolean,
|
|
253
|
+
default: false
|
|
254
|
+
},
|
|
251
255
|
omitSuggestions: {
|
|
252
256
|
type: Array as PropType<string[]>,
|
|
253
257
|
default: () => [] as string[]
|
|
@@ -297,6 +301,7 @@ export default defineComponent({
|
|
|
297
301
|
defaultIcon,
|
|
298
302
|
defaultIconColor,
|
|
299
303
|
schema,
|
|
304
|
+
noTooltip,
|
|
300
305
|
omitSuggestions,
|
|
301
306
|
operatorsOverride,
|
|
302
307
|
height,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
v-model="isOpen"
|
|
5
5
|
:height="500"
|
|
6
6
|
:width="800"
|
|
7
|
-
style="--dl-dialog-box-footer-padding: 10px 16px"
|
|
7
|
+
style="--dl-dialog-box-footer-padding: 10px 16px; --dl-dialog-box-content-padding: 0"
|
|
8
8
|
>
|
|
9
9
|
<template #header>
|
|
10
10
|
<dl-dialog-box-header
|
|
@@ -15,10 +15,7 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
<template #body>
|
|
17
17
|
<div class="json-editor-layout">
|
|
18
|
-
<div
|
|
19
|
-
class="json-query-menu"
|
|
20
|
-
style="margin-bottom: 10px"
|
|
21
|
-
>
|
|
18
|
+
<div class="json-query-menu">
|
|
22
19
|
<dl-select
|
|
23
20
|
:model-value="selectedOption"
|
|
24
21
|
ref="jsonQueryMenu"
|
|
@@ -26,6 +23,7 @@
|
|
|
26
23
|
:options="selectOptions"
|
|
27
24
|
placeholder="New Query"
|
|
28
25
|
searchable
|
|
26
|
+
size="m"
|
|
29
27
|
after-options-padding="0"
|
|
30
28
|
no-options-padding="0"
|
|
31
29
|
menu-style="overflow-y: hidden;"
|
|
@@ -37,7 +35,15 @@
|
|
|
37
35
|
</span>
|
|
38
36
|
</template>
|
|
39
37
|
<template #option="scope">
|
|
40
|
-
<div
|
|
38
|
+
<div
|
|
39
|
+
v-if="selectOptions.length < 2"
|
|
40
|
+
class="json-query-menu-no-option"
|
|
41
|
+
disabled
|
|
42
|
+
style="cursor: default !important; padding: 14px 0 10px 0;"
|
|
43
|
+
>
|
|
44
|
+
No Saved Queries
|
|
45
|
+
</div>
|
|
46
|
+
<div v-else class="json-query-menu-option">
|
|
41
47
|
<div class="json-query-menu-option-label">
|
|
42
48
|
{{ scope.opt.label }}
|
|
43
49
|
</div>
|
|
@@ -70,7 +76,7 @@
|
|
|
70
76
|
</template>
|
|
71
77
|
<template #no-options>
|
|
72
78
|
<div class="json-query-menu-no-option">
|
|
73
|
-
|
|
79
|
+
No Results Found
|
|
74
80
|
</div>
|
|
75
81
|
<dl-separator
|
|
76
82
|
style="margin: 0 0 2px 0 !important"
|
|
@@ -334,12 +340,6 @@ export default defineComponent({
|
|
|
334
340
|
}
|
|
335
341
|
)
|
|
336
342
|
|
|
337
|
-
const noOptionsLabel = computed<string>(() => {
|
|
338
|
-
return selectOptions.value.length
|
|
339
|
-
? 'No Results Found'
|
|
340
|
-
: 'No Saved Queries'
|
|
341
|
-
})
|
|
342
|
-
|
|
343
343
|
watch(
|
|
344
344
|
selectedFilter,
|
|
345
345
|
() => {
|
|
@@ -483,7 +483,6 @@ export default defineComponent({
|
|
|
483
483
|
showSaveDialog,
|
|
484
484
|
stringifiedJSON,
|
|
485
485
|
selectedOption,
|
|
486
|
-
noOptionsLabel,
|
|
487
486
|
hasActiveFilter,
|
|
488
487
|
alignJSON,
|
|
489
488
|
copyJSON,
|
|
@@ -503,22 +502,29 @@ export default defineComponent({
|
|
|
503
502
|
})
|
|
504
503
|
</script>
|
|
505
504
|
|
|
506
|
-
<style scoped
|
|
505
|
+
<style scoped>
|
|
507
506
|
.json-editor-layout {
|
|
508
507
|
display: flex;
|
|
509
508
|
flex-direction: column;
|
|
510
509
|
height: 100%;
|
|
511
510
|
}
|
|
512
511
|
|
|
513
|
-
.json-editor-footer
|
|
514
|
-
.json-query-menu {
|
|
512
|
+
.json-editor-footer {
|
|
515
513
|
width: 100%;
|
|
516
514
|
display: flex;
|
|
517
515
|
align-items: center;
|
|
518
516
|
justify-content: space-between;
|
|
519
517
|
}
|
|
518
|
+
.json-query-menu {
|
|
519
|
+
display: flex;
|
|
520
|
+
align-items: center;
|
|
521
|
+
background-color: var(--dl-color-fill);
|
|
522
|
+
justify-content: space-between;
|
|
523
|
+
padding: 6px 16px;
|
|
524
|
+
}
|
|
520
525
|
.json-editor {
|
|
521
|
-
height: 100
|
|
526
|
+
height: calc(100% - 40px);
|
|
527
|
+
--jse-main-border: none;
|
|
522
528
|
}
|
|
523
529
|
|
|
524
530
|
.json-query-menu-option {
|
|
@@ -527,7 +533,7 @@ export default defineComponent({
|
|
|
527
533
|
}
|
|
528
534
|
.json-query-menu-option-label,
|
|
529
535
|
.json-query-menu-selected {
|
|
530
|
-
|
|
536
|
+
padding-top: 3px;
|
|
531
537
|
white-space: nowrap;
|
|
532
538
|
display: inline-block;
|
|
533
539
|
width: 265px;
|
|
@@ -788,11 +788,12 @@ export default defineComponent({
|
|
|
788
788
|
let shouldSkipValidation = false
|
|
789
789
|
|
|
790
790
|
if (storedValidTarget.value && targetRow.value) {
|
|
791
|
-
const
|
|
791
|
+
const isStoredTargetAncestor = isAncestor(
|
|
792
|
+
storedValidTarget.value.id,
|
|
792
793
|
targetRow.value.id,
|
|
793
794
|
tableRows.value
|
|
794
795
|
)
|
|
795
|
-
if (
|
|
796
|
+
if (isStoredTargetAncestor) {
|
|
796
797
|
finalTarget = storedValidTarget.value
|
|
797
798
|
shouldSkipValidation = true
|
|
798
799
|
}
|
|
@@ -1029,6 +1030,22 @@ export default defineComponent({
|
|
|
1029
1030
|
return parentMap.get(childId) || null
|
|
1030
1031
|
}
|
|
1031
1032
|
|
|
1033
|
+
const isAncestor = (
|
|
1034
|
+
ancestorId: string,
|
|
1035
|
+
childId: string,
|
|
1036
|
+
rows: DlTableRow[]
|
|
1037
|
+
): boolean => {
|
|
1038
|
+
const parentMap = buildParentMap(rows)
|
|
1039
|
+
while (parentMap.has(childId)) {
|
|
1040
|
+
const parentId = parentMap.get(childId)!
|
|
1041
|
+
if (parentId === ancestorId) {
|
|
1042
|
+
return true
|
|
1043
|
+
}
|
|
1044
|
+
childId = parentId
|
|
1045
|
+
}
|
|
1046
|
+
return false
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1032
1049
|
const calculateRowLevel = (row: DlTableRow): number => {
|
|
1033
1050
|
const parentMap = buildParentMap(props.rows)
|
|
1034
1051
|
let level = 1
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
}`"
|
|
8
8
|
>
|
|
9
9
|
<label
|
|
10
|
-
v-if="
|
|
10
|
+
v-if="hasLeftLabel"
|
|
11
11
|
class="left dl-switch-label"
|
|
12
12
|
:for="computedId"
|
|
13
13
|
:style="cssLabelVars"
|
|
14
14
|
>
|
|
15
|
-
|
|
15
|
+
<slot name="left-label">
|
|
16
|
+
{{ leftLabel }}
|
|
17
|
+
</slot>
|
|
16
18
|
</label>
|
|
17
19
|
<span
|
|
18
20
|
class="dl-switch-container"
|
|
@@ -35,12 +37,14 @@
|
|
|
35
37
|
/>
|
|
36
38
|
</span>
|
|
37
39
|
<label
|
|
38
|
-
v-if="
|
|
40
|
+
v-if="hasRightLabel"
|
|
39
41
|
class="right dl-switch-label"
|
|
40
42
|
:for="computedId"
|
|
41
43
|
:style="cssLabelVars"
|
|
42
44
|
>
|
|
43
|
-
|
|
45
|
+
<slot name="right-label">
|
|
46
|
+
{{ rightLabel }}
|
|
47
|
+
</slot>
|
|
44
48
|
</label>
|
|
45
49
|
</div>
|
|
46
50
|
</template>
|
|
@@ -143,6 +147,12 @@ export default defineComponent({
|
|
|
143
147
|
? this.index === -1
|
|
144
148
|
: toRaw(this.modelValue) === toRaw(this.falseValue)
|
|
145
149
|
},
|
|
150
|
+
hasLeftLabel(): boolean {
|
|
151
|
+
return !!this.leftLabel || !!this.$slots['left-label']
|
|
152
|
+
},
|
|
153
|
+
hasRightLabel(): boolean {
|
|
154
|
+
return !!this.rightLabel || !!this.$slots['right-label']
|
|
155
|
+
},
|
|
146
156
|
cssVars(): Record<string, string> {
|
|
147
157
|
return {
|
|
148
158
|
'--dl-checkbox-height': `${this.size}px`,
|