@dataloop-ai/components 0.18.93 → 0.18.94

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.18.93",
3
+ "version": "0.18.94",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -22,7 +22,12 @@
22
22
  style="width: 100px"
23
23
  class="props"
24
24
  />
25
- { "metadata.system.width": 5 }
25
+ <div>
26
+ Template searches<br>
27
+
28
+ dir IN 'test', 'test2'<br>
29
+ { "metadata.system.width": 5 }<br>
30
+ </div>
26
31
  <dl-smart-search
27
32
  v-model="queryObject"
28
33
  :aliases="aliases"
@@ -45,6 +50,15 @@
45
50
  <br>
46
51
  Only the search
47
52
 
53
+ <dl-smart-search-input
54
+ v-model="queryObject"
55
+ :aliases="aliases"
56
+ :schema="schema"
57
+ :color-schema="colorSchema"
58
+ :strict="strictState"
59
+ :disabled="switchState"
60
+ />
61
+
48
62
  <dl-smart-search-input
49
63
  v-model="queryObject2"
50
64
  :aliases="aliases"
@@ -53,6 +67,7 @@
53
67
  :strict="strictState"
54
68
  :disabled="switchState"
55
69
  />
70
+ {{ queryObject }}
56
71
  {{ queryObject2 }}
57
72
  </div>
58
73
  </template>
@@ -370,7 +370,7 @@ const getError = (
370
370
  }
371
371
 
372
372
  const isValidByDataType = (
373
- str: string,
373
+ str: string | string[],
374
374
  dataType: string | string[],
375
375
  operator: string
376
376
  ): boolean => {
@@ -378,12 +378,20 @@ const isValidByDataType = (
378
378
  return true
379
379
  }
380
380
 
381
+ if (Array.isArray(str)) {
382
+ for (const string of str) {
383
+ if (!isValidByDataType(string, dataType, operator)) {
384
+ return false
385
+ }
386
+ }
387
+ return true
388
+ }
389
+
381
390
  /**
382
391
  * TODO: create new support to validate by operation as well
383
392
  */
384
393
 
385
394
  if (Array.isArray(dataType)) {
386
- str = str.replace(/\'/g, '')
387
395
  let isOneOf = !!getValueMatch(dataType, str)
388
396
  for (const type of dataType) {
389
397
  isOneOf = isOneOf || isValidByDataType(str, type, operator)
@@ -406,9 +414,12 @@ const isValidByDataType = (
406
414
  }
407
415
 
408
416
  const validateBracketValues = (value: string) => {
409
- value = removeBrackets(value)
410
- value = value.split(',')[0]
411
- return value
417
+ const bracketless = removeBrackets(value)
418
+ const pureValue = bracketless.split(',')
419
+ if (pureValue.length === 1) {
420
+ return pureValue[0]
421
+ }
422
+ return pureValue
412
423
  }
413
424
 
414
425
  const isValidDateIntervalPattern = (str: string) => {
@@ -426,7 +437,7 @@ const isValidBoolean = (str: string) => {
426
437
  const isValidString = (str: string) => {
427
438
  const match = str.match(/(?<=\")(.*?)(?=\")|(?<=\')(.*?)(?=\')/)
428
439
  if (!match) return false
429
- return match[0] === removeQuotes(str)
440
+ return match[0] === removeQuotes(str.trim())
430
441
  }
431
442
 
432
443
  const getOperatorByDataType = (dataType: string) => {