@dataloop-ai/components 0.19.91 → 0.19.93
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
|
@@ -803,7 +803,7 @@ export default defineComponent({
|
|
|
803
803
|
return modelValue.value?.toString()
|
|
804
804
|
})
|
|
805
805
|
|
|
806
|
-
const onModelValueChange = (val: string) => {
|
|
806
|
+
const onModelValueChange = (val: string | number) => {
|
|
807
807
|
if (!isInternalChange.value && val !== null && val !== undefined) {
|
|
808
808
|
if (readonly.value || disabled.value) {
|
|
809
809
|
return
|
|
@@ -830,10 +830,17 @@ export default defineComponent({
|
|
|
830
830
|
return debounced
|
|
831
831
|
})
|
|
832
832
|
|
|
833
|
+
const firstTime = ref(true)
|
|
834
|
+
|
|
833
835
|
watch(
|
|
834
836
|
modelValue,
|
|
835
|
-
(val) => {
|
|
837
|
+
(val: string | number) => {
|
|
836
838
|
nextTick(() => {
|
|
839
|
+
if (firstTime.value) {
|
|
840
|
+
firstTime.value = false
|
|
841
|
+
onModelValueChange(val)
|
|
842
|
+
return
|
|
843
|
+
}
|
|
837
844
|
debouncedOnModelValueChange.value(val)
|
|
838
845
|
})
|
|
839
846
|
},
|
|
@@ -195,7 +195,10 @@ export default defineComponent({
|
|
|
195
195
|
type: String,
|
|
196
196
|
default: '28px'
|
|
197
197
|
},
|
|
198
|
-
|
|
198
|
+
omitSuggestions: {
|
|
199
|
+
type: Array as PropType<string[]>,
|
|
200
|
+
default: () => [] as string[]
|
|
201
|
+
},
|
|
199
202
|
strict: {
|
|
200
203
|
type: Boolean,
|
|
201
204
|
default: false
|
|
@@ -226,6 +229,7 @@ export default defineComponent({
|
|
|
226
229
|
status,
|
|
227
230
|
disabled,
|
|
228
231
|
schema,
|
|
232
|
+
omitSuggestions,
|
|
229
233
|
height,
|
|
230
234
|
width
|
|
231
235
|
} = toRefs(props)
|
|
@@ -252,7 +256,7 @@ export default defineComponent({
|
|
|
252
256
|
const { suggestions, error, findSuggestions } = useSuggestions(
|
|
253
257
|
schema,
|
|
254
258
|
aliases,
|
|
255
|
-
{ strict }
|
|
259
|
+
{ strict, omitSuggestions }
|
|
256
260
|
)
|
|
257
261
|
//#endregion
|
|
258
262
|
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
|
|
80
80
|
<br>
|
|
81
81
|
<br>
|
|
82
|
-
With placeholder
|
|
82
|
+
With placeholder and [OR, true] suggestions omitted
|
|
83
83
|
<dl-smart-search-input
|
|
84
84
|
v-model="queryObject"
|
|
85
85
|
:aliases="aliases"
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
:color-schema="colorSchema"
|
|
88
88
|
:strict="strictState"
|
|
89
89
|
:disabled="switchState"
|
|
90
|
+
:omit-suggestions="['OR', 'true']"
|
|
90
91
|
placeholder="I am a placeholder"
|
|
91
92
|
/>
|
|
92
93
|
</div>
|
|
@@ -119,9 +119,9 @@ const mergeWords = (words: string[]) => {
|
|
|
119
119
|
export const useSuggestions = (
|
|
120
120
|
schema: Ref<Schema>,
|
|
121
121
|
aliases: Ref<Alias[]>,
|
|
122
|
-
options: { strict?: Ref<boolean> } = {}
|
|
122
|
+
options: { strict?: Ref<boolean>; omitSuggestions?: Ref<string[]> } = {}
|
|
123
123
|
) => {
|
|
124
|
-
const { strict } = options
|
|
124
|
+
const { strict, omitSuggestions } = options
|
|
125
125
|
const aliasesArray = aliases.value ?? []
|
|
126
126
|
const schemaValue = schema.value ?? {}
|
|
127
127
|
|
|
@@ -286,7 +286,10 @@ export const useSuggestions = (
|
|
|
286
286
|
? getError(schemaValue, aliasesArray, expressions, { strict })
|
|
287
287
|
: null
|
|
288
288
|
|
|
289
|
-
suggestions.value = localSuggestions
|
|
289
|
+
suggestions.value = localSuggestions.filter(
|
|
290
|
+
(value) =>
|
|
291
|
+
!omitSuggestions || !omitSuggestions.value.includes(value)
|
|
292
|
+
)
|
|
290
293
|
}
|
|
291
294
|
|
|
292
295
|
return { suggestions, findSuggestions, error }
|