@dataloop-ai/components 0.18.96 → 0.18.97
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
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
Template searches<br>
|
|
27
27
|
|
|
28
28
|
dir IN 'test', 'test2'<br>
|
|
29
|
+
type = 'dir'<br>
|
|
29
30
|
{ "metadata.system.width": 5 }<br>
|
|
30
31
|
</div>
|
|
31
32
|
<dl-smart-search
|
|
@@ -97,7 +98,6 @@ export default defineComponent({
|
|
|
97
98
|
filename: 'string',
|
|
98
99
|
name: 'string',
|
|
99
100
|
url: 'string',
|
|
100
|
-
type: 'string',
|
|
101
101
|
dataset: 'string',
|
|
102
102
|
datasetId: 'string',
|
|
103
103
|
dir: 'string',
|
|
@@ -113,7 +113,10 @@ export default defineComponent({
|
|
|
113
113
|
},
|
|
114
114
|
test: 'any',
|
|
115
115
|
'*': 'any'
|
|
116
|
-
}
|
|
116
|
+
},
|
|
117
|
+
type: ['dir', 'file'],
|
|
118
|
+
test1: ['5', '6', 'number'],
|
|
119
|
+
test2: ['true', 'false']
|
|
117
120
|
}
|
|
118
121
|
const schema2: any = {
|
|
119
122
|
type: [
|
|
@@ -521,14 +521,26 @@ const insensitive = (str: string): string => str.toLowerCase()
|
|
|
521
521
|
const getMatch = (strArr: string[], str: string) =>
|
|
522
522
|
strArr.find((val) => insensitive(val) === insensitive(str)) ?? null
|
|
523
523
|
|
|
524
|
-
const getValueMatch = (
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
524
|
+
const getValueMatch = (
|
|
525
|
+
strArr: (string | number | boolean)[],
|
|
526
|
+
str: string | number | boolean
|
|
527
|
+
) => {
|
|
528
|
+
for (const s of strArr) {
|
|
529
|
+
let term = str
|
|
530
|
+
let serach = s
|
|
531
|
+
|
|
532
|
+
if (typeof str === 'string') {
|
|
533
|
+
term = insensitive(str.replace(/["']/gi, ''))
|
|
534
|
+
}
|
|
535
|
+
if (typeof s === 'string') {
|
|
536
|
+
serach = insensitive(s)
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
if (serach === term) {
|
|
540
|
+
return s
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return null
|
|
532
544
|
}
|
|
533
545
|
const getMatches = (strArr: string[], str: string | number | boolean) =>
|
|
534
546
|
strArr.filter((val) =>
|