@dataloop-ai/components 0.17.69 → 0.17.71
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/basic/DlContainer/DlContainer.vue +70 -0
- package/src/components/basic/DlContainer/index.ts +3 -0
- package/src/components/basic/DlEllipsis/DlEllipsis.vue +3 -2
- package/src/components/basic/index.ts +1 -0
- package/src/components/compound/DlOptionGroup/DlOptionGroup.vue +5 -1
- package/src/components/essential/DlRadio/DlRadio.vue +5 -1
- package/src/components/essential/DlSwitch/DlSwitch.vue +1 -1
- package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +3 -6
- package/src/utils/parse-smart-query.ts +12 -0
package/package.json
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="wrapper"
|
|
4
|
+
class="container-wrapper"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
:id="uuid"
|
|
8
|
+
ref="container"
|
|
9
|
+
:class="containerStyles"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
v-if="hasHeaderSlot"
|
|
13
|
+
class="dl-container__header"
|
|
14
|
+
>
|
|
15
|
+
<slot name="header" />
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="dl-container__content">
|
|
19
|
+
<slot />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
<script lang="ts">
|
|
25
|
+
import { v4 } from 'uuid'
|
|
26
|
+
import { defineComponent } from 'vue-demi'
|
|
27
|
+
|
|
28
|
+
export default defineComponent({
|
|
29
|
+
name: 'DlContainer',
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
uuid: `dl-container-${v4()}`
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
computed: {
|
|
36
|
+
containerStyles() {
|
|
37
|
+
return 'dl-container'
|
|
38
|
+
},
|
|
39
|
+
hasHeaderSlot(): boolean {
|
|
40
|
+
return this.$slots.header !== undefined
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style lang="scss" scoped>
|
|
47
|
+
.dl-container {
|
|
48
|
+
border: 1px solid var(--dl-color-separator);
|
|
49
|
+
user-select: none;
|
|
50
|
+
height: 100%;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
&__header {
|
|
54
|
+
display: flex;
|
|
55
|
+
padding: 10px;
|
|
56
|
+
border-bottom: 1px solid var(--dl-color-separator);
|
|
57
|
+
}
|
|
58
|
+
&__content {
|
|
59
|
+
padding: 10px;
|
|
60
|
+
height: 100%;
|
|
61
|
+
overflow-y: auto;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.container-wrapper {
|
|
66
|
+
flex-basis: var(--container-flex-basis);
|
|
67
|
+
margin: var(--row-gap) var(--column-gap);
|
|
68
|
+
height: 100%;
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -81,11 +81,12 @@ export default defineComponent({
|
|
|
81
81
|
default: () => [0, 25]
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
|
|
84
|
+
// TODO: fix type issue here
|
|
85
|
+
setup(props: any, { slots }) {
|
|
85
86
|
const dlEllipsisRef = ref(null)
|
|
86
87
|
const { hasEllipsis } = useSizeObserver(dlEllipsisRef)
|
|
87
88
|
|
|
88
|
-
const hasDefaultSlot = computed(() => !!
|
|
89
|
+
const hasDefaultSlot = computed(() => !!slots.default)
|
|
89
90
|
const splitIndex = computed(() => {
|
|
90
91
|
if (!props.text.length) return null
|
|
91
92
|
return props.split
|
|
@@ -84,7 +84,11 @@ export default defineComponent({
|
|
|
84
84
|
validator: optionsValidator
|
|
85
85
|
},
|
|
86
86
|
type: { type: String, default: 'radio', validator: typeValidator },
|
|
87
|
-
modelValue: {
|
|
87
|
+
modelValue: {
|
|
88
|
+
type: [Array, String, Number, Boolean],
|
|
89
|
+
required: false,
|
|
90
|
+
default: null
|
|
91
|
+
}
|
|
88
92
|
},
|
|
89
93
|
data() {
|
|
90
94
|
const logger = loggerFactory('DlOptionGroup')
|
|
@@ -77,7 +77,11 @@ export default defineComponent({
|
|
|
77
77
|
id: { type: [String, Number], default: null },
|
|
78
78
|
label: { type: String, default: null },
|
|
79
79
|
padding: { type: String, default: '0' },
|
|
80
|
-
modelValue: {
|
|
80
|
+
modelValue: {
|
|
81
|
+
type: [String, Number, Boolean],
|
|
82
|
+
required: false,
|
|
83
|
+
default: null
|
|
84
|
+
},
|
|
81
85
|
value: { type: [String, Number, Boolean], required: true },
|
|
82
86
|
tabindex: { type: String, default: '0' },
|
|
83
87
|
subLabel: { type: String, default: '' },
|
|
@@ -79,7 +79,7 @@ export default defineComponent({
|
|
|
79
79
|
type: String,
|
|
80
80
|
default: '0'
|
|
81
81
|
},
|
|
82
|
-
modelValue: { type: Any, required:
|
|
82
|
+
modelValue: { type: Any, required: false, default: null },
|
|
83
83
|
labelProps: {
|
|
84
84
|
type: Object as PropType<{ fontSize: number; color: string }>,
|
|
85
85
|
default: () => ({
|
|
@@ -114,12 +114,6 @@ export default defineComponent({
|
|
|
114
114
|
: 0
|
|
115
115
|
})
|
|
116
116
|
|
|
117
|
-
onMounted(() => {
|
|
118
|
-
window.addEventListener('load', setItemSize)
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
onUnmounted(() => window.removeEventListener('load', () => {}))
|
|
122
|
-
|
|
123
117
|
const setItemSize = () => {
|
|
124
118
|
scrollSizeItem.value = props.virtualScrollItemSize
|
|
125
119
|
? props.virtualScrollItemSize
|
|
@@ -260,8 +254,11 @@ export default defineComponent({
|
|
|
260
254
|
|
|
261
255
|
onMounted(() => {
|
|
262
256
|
configureScrollTarget()
|
|
257
|
+
window.addEventListener('load', setItemSize)
|
|
263
258
|
})
|
|
264
259
|
|
|
260
|
+
onUnmounted(() => window.removeEventListener('load', () => {}))
|
|
261
|
+
|
|
265
262
|
onActivated(() => {
|
|
266
263
|
configureScrollTarget()
|
|
267
264
|
})
|
|
@@ -22,6 +22,12 @@ const GeneratePureValue = (value: any) => {
|
|
|
22
22
|
return value
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Method to convert a DlSmartSearch query string to Mongo based JSON query
|
|
27
|
+
*
|
|
28
|
+
* @param { string } query DlSmartSearch query string
|
|
29
|
+
* @returns Mongo based JSON
|
|
30
|
+
*/
|
|
25
31
|
export const parseSmartQuery = (query: string) => {
|
|
26
32
|
const queryArr = query.split(' OR ')
|
|
27
33
|
const orTerms: { [key: string]: any }[] = []
|
|
@@ -93,6 +99,12 @@ export const parseSmartQuery = (query: string) => {
|
|
|
93
99
|
return builtQuery
|
|
94
100
|
}
|
|
95
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Method to convert a Mongo based JSON query to a DlSmartSearch query string
|
|
104
|
+
*
|
|
105
|
+
* @param { { [key: string]: any } } query Mongo based JSON that represents a query
|
|
106
|
+
* @returns DlSmartSearch query string
|
|
107
|
+
*/
|
|
96
108
|
export const stringifySmartQuery = (query: { [key: string]: any }) => {
|
|
97
109
|
let result = ''
|
|
98
110
|
|