@dataloop-ai/components 0.17.60 → 0.17.61
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 +4 -0
- package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +21 -14
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchFilters.vue +2 -0
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +2 -0
- package/src/components/compound/DlSearches/DlSmartSearch/utils/utils.ts +3 -3
- package/src/components/compound/index.ts +8 -1
package/package.json
CHANGED
|
@@ -11,6 +11,10 @@ import { JSONEditor, Mode } from 'vanilla-jsoneditor'
|
|
|
11
11
|
import { debounce } from 'lodash'
|
|
12
12
|
|
|
13
13
|
export default defineComponent({
|
|
14
|
+
model: {
|
|
15
|
+
prop: 'modelValue',
|
|
16
|
+
event: 'update:modelValue'
|
|
17
|
+
},
|
|
14
18
|
props: {
|
|
15
19
|
/**
|
|
16
20
|
* The string to display and modify as JSON
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
class="dl-smart-search__input-wrapper"
|
|
10
10
|
>
|
|
11
11
|
<dl-smart-search-input
|
|
12
|
-
v-show="!jsonEditorModel"
|
|
13
12
|
:status="computedStatus"
|
|
14
13
|
:style-model="defineStyleModel"
|
|
15
14
|
:with-save-button="true"
|
|
@@ -185,14 +184,16 @@
|
|
|
185
184
|
</template>
|
|
186
185
|
<script lang="ts">
|
|
187
186
|
import { defineComponent, PropType, ref } from 'vue-demi'
|
|
188
|
-
import DlSmartSearchInput from './components/DlSmartSearchInput.vue'
|
|
189
|
-
import DlSmartSearchFilters from './components/DlSmartSearchFilters.vue'
|
|
190
|
-
import { DlJsonEditor } from '../../DlJsonEditor'
|
|
191
|
-
import { DlDialogBox, DlDialogBoxHeader } from '../../DlDialogBox'
|
|
192
|
-
import { DlInput } from '../../DlInput'
|
|
193
187
|
import { DlTypography, DlMenu } from '../../../essential'
|
|
194
188
|
import { DlButton } from '../../../basic'
|
|
195
|
-
import { DlSelect } from '
|
|
189
|
+
import { DlSelect } from '../../DlSelect'
|
|
190
|
+
import { DlInput } from '../../DlInput'
|
|
191
|
+
import { DlDialogBox, DlDialogBoxHeader } from '../../DlDialogBox'
|
|
192
|
+
import { DlJsonEditor } from '../../DlJsonEditor'
|
|
193
|
+
|
|
194
|
+
import DlSmartSearchInput from './components/DlSmartSearchInput.vue'
|
|
195
|
+
import DlSmartSearchFilters from './components/DlSmartSearchFilters.vue'
|
|
196
|
+
|
|
196
197
|
import {
|
|
197
198
|
useSuggestions,
|
|
198
199
|
Schema,
|
|
@@ -394,21 +395,27 @@ export default defineComponent({
|
|
|
394
395
|
: this.inputModel
|
|
395
396
|
},
|
|
396
397
|
deleteButtonState(): boolean {
|
|
397
|
-
return !this.filters
|
|
398
|
+
return !this.filters?.saved?.filter(
|
|
398
399
|
(q: Query) => q.name === this.activeQuery?.name
|
|
399
400
|
).length
|
|
400
401
|
},
|
|
401
402
|
selectOptions(): Record<string, string>[] {
|
|
402
|
-
|
|
403
|
+
const options: Record<string, string>[] = [
|
|
403
404
|
{
|
|
404
405
|
label: 'New Query',
|
|
405
406
|
value: '{}'
|
|
406
|
-
}
|
|
407
|
-
...this.filters.saved.map((q: Query) => ({
|
|
408
|
-
label: q.name,
|
|
409
|
-
value: q.query
|
|
410
|
-
}))
|
|
407
|
+
}
|
|
411
408
|
]
|
|
409
|
+
|
|
410
|
+
const filters = this.filters?.saved ?? []
|
|
411
|
+
for (const filter of filters) {
|
|
412
|
+
options.push({
|
|
413
|
+
label: filter.name,
|
|
414
|
+
value: filter.query
|
|
415
|
+
})
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return options
|
|
412
419
|
}
|
|
413
420
|
},
|
|
414
421
|
watch: {
|
package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchFilters.vue
CHANGED
|
@@ -38,6 +38,7 @@ import { DlTabPanels, DlTabPanel } from '../../../DlTabPanels'
|
|
|
38
38
|
import { Filters } from '../../../DlSearches/DlSmartSearch/types'
|
|
39
39
|
import { getTabItems } from '../utils/utils'
|
|
40
40
|
import FiltersQuery from './FiltersQuery.vue'
|
|
41
|
+
import { v4 } from 'uuid'
|
|
41
42
|
|
|
42
43
|
export default defineComponent({
|
|
43
44
|
components: {
|
|
@@ -55,6 +56,7 @@ export default defineComponent({
|
|
|
55
56
|
emits: ['filters-delete', 'filters-search'],
|
|
56
57
|
data() {
|
|
57
58
|
return {
|
|
59
|
+
uuid: `dl-smart-search-filters-${v4()}`,
|
|
58
60
|
currentTab: 'saved'
|
|
59
61
|
}
|
|
60
62
|
},
|
|
@@ -496,6 +496,7 @@ export default defineComponent({
|
|
|
496
496
|
element.scrollLeft = 0
|
|
497
497
|
element.scrollTop = 0
|
|
498
498
|
this.focused = false
|
|
499
|
+
this.expanded = false
|
|
499
500
|
this.$emit('focus', false)
|
|
500
501
|
} else {
|
|
501
502
|
this.focus()
|
|
@@ -600,6 +601,7 @@ export default defineComponent({
|
|
|
600
601
|
}
|
|
601
602
|
|
|
602
603
|
&--expanded {
|
|
604
|
+
z-index: var(--dl-z-index-overlay);
|
|
603
605
|
transition: height 0.3s ease-out;
|
|
604
606
|
position: relative;
|
|
605
607
|
top: 0;
|
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
export function getTabItems(filters: Filters) {
|
|
11
11
|
return [
|
|
12
12
|
{
|
|
13
|
-
label: `Saved DQL Queries (${filters.saved
|
|
13
|
+
label: `Saved DQL Queries (${filters.saved?.length ?? 0})`,
|
|
14
14
|
name: 'saved'
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
label: `Recent Searches (${filters.recent
|
|
17
|
+
label: `Recent Searches (${filters.recent?.length ?? 0})`,
|
|
18
18
|
name: 'recent'
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
label: `Suggested Searches (${filters.suggested
|
|
21
|
+
label: `Suggested Searches (${filters.suggested?.length ?? 0})`,
|
|
22
22
|
name: 'suggested'
|
|
23
23
|
}
|
|
24
24
|
]
|
|
@@ -7,7 +7,6 @@ export * from './DlItem'
|
|
|
7
7
|
export * from './DlOptionGroup'
|
|
8
8
|
export * from './DlPagination'
|
|
9
9
|
export * from './DlRange'
|
|
10
|
-
export * from './DlSearches'
|
|
11
10
|
export * from './DlSelect'
|
|
12
11
|
export * from './DlSlider'
|
|
13
12
|
export * from './DlStepper'
|
|
@@ -15,6 +14,14 @@ export * from './DlTable'
|
|
|
15
14
|
export * from './DlTabPanels'
|
|
16
15
|
export * from './DlTabs'
|
|
17
16
|
export * from './DlToast'
|
|
17
|
+
|
|
18
|
+
// uses other compound
|
|
18
19
|
export * from './DlDialogBox'
|
|
19
20
|
export * from './DlToggleButton'
|
|
20
21
|
export * from './DlJsonEditor'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Moved to bottom of file as dlsmartsearch specifically uses other components here and needs to be initialized last
|
|
25
|
+
* todo: Fix potential circular dependency
|
|
26
|
+
*/
|
|
27
|
+
export * from './DlSearches'
|