@dataloop-ai/components 0.20.93 → 0.20.95
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataloop-ai/components",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.95",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.ts",
|
|
6
6
|
"./models": "./models.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"check-only": "if grep -E -H -r --exclude-dir=.git --exclude-dir=node_modules --exclude=*.json --exclude=*.yml '^(describe|it).only' .; then echo 'Found only in test files' && exit 1; fi"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@dataloop-ai/icons": "^3.0.
|
|
26
|
+
"@dataloop-ai/icons": "^3.0.185",
|
|
27
27
|
"@types/flat": "^5.0.2",
|
|
28
28
|
"@types/lodash": "^4.14.184",
|
|
29
29
|
"@types/sortablejs": "^1.15.7",
|
|
@@ -245,6 +245,10 @@ export default defineComponent({
|
|
|
245
245
|
type: Array as PropType<string[]>,
|
|
246
246
|
default: () => [] as string[]
|
|
247
247
|
},
|
|
248
|
+
operatorsOverride: {
|
|
249
|
+
type: Object as PropType<{[name: string]: string[]}>,
|
|
250
|
+
default: () => ({})
|
|
251
|
+
},
|
|
248
252
|
forbiddenKeys: {
|
|
249
253
|
type: Array as PropType<string[]>,
|
|
250
254
|
default: () => [] as string[]
|
|
@@ -285,6 +289,7 @@ export default defineComponent({
|
|
|
285
289
|
disabled,
|
|
286
290
|
schema,
|
|
287
291
|
omitSuggestions,
|
|
292
|
+
operatorsOverride,
|
|
288
293
|
height,
|
|
289
294
|
width,
|
|
290
295
|
forbiddenKeys,
|
|
@@ -316,7 +321,8 @@ export default defineComponent({
|
|
|
316
321
|
useSuggestions(schema, aliases, {
|
|
317
322
|
strict,
|
|
318
323
|
forbiddenKeys,
|
|
319
|
-
omitSuggestions
|
|
324
|
+
omitSuggestions,
|
|
325
|
+
operatorsOverride
|
|
320
326
|
})
|
|
321
327
|
//#endregion
|
|
322
328
|
|
|
@@ -145,9 +145,10 @@ export const useSuggestions = (
|
|
|
145
145
|
strict?: Ref<boolean>
|
|
146
146
|
forbiddenKeys?: Ref<string[]>
|
|
147
147
|
omitSuggestions?: Ref<string[]>
|
|
148
|
+
operatorsOverride?: Ref<{[name: string]: string[]}>
|
|
148
149
|
} = {}
|
|
149
150
|
) => {
|
|
150
|
-
const { strict, forbiddenKeys, omitSuggestions } = options
|
|
151
|
+
const { strict, forbiddenKeys, omitSuggestions, operatorsOverride } = options
|
|
151
152
|
const aliasesArray = aliases.value ?? []
|
|
152
153
|
const schemaValue = schema.value ?? {}
|
|
153
154
|
|
|
@@ -261,11 +262,16 @@ export const useSuggestions = (
|
|
|
261
262
|
}
|
|
262
263
|
}
|
|
263
264
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
265
|
+
localSuggestions = operatorsOverride?.value?.[
|
|
266
|
+
getAliasObjByAlias(aliasesArray, matchedField)?.key ?? matchedField
|
|
267
|
+
]
|
|
268
|
+
if (!localSuggestions) {
|
|
269
|
+
const ops: string[] = Array.isArray(dataType)
|
|
270
|
+
? getGenericOperators()
|
|
271
|
+
: getOperatorByDataType(dataType)
|
|
267
272
|
|
|
268
|
-
|
|
273
|
+
localSuggestions = getOperators(ops)
|
|
274
|
+
}
|
|
269
275
|
|
|
270
276
|
if (!operator) {
|
|
271
277
|
const dotSeparated = matchedField.split('.')
|