@dataloop-ai/components 0.19.132 → 0.19.133

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.19.132",
3
+ "version": "0.19.133",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -346,7 +346,8 @@ export default defineComponent({
346
346
  }
347
347
  }
348
348
 
349
- const setInputFromSuggestion = (value: string) => {
349
+ const setInputFromSuggestion = (suggestion: any) => {
350
+ const value = '' + suggestion
350
351
  let stringValue = ''
351
352
  let caretPosition = 0
352
353
  if (searchQuery.value.length) {
@@ -28,7 +28,7 @@
28
28
  :highlighted="suggestionIndex === highlightedIndex"
29
29
  @click="handleOption(item)"
30
30
  >
31
- {{ item }}
31
+ {{ removeQuotes(item) }}
32
32
  </dl-list-item>
33
33
  </dl-list>
34
34
  </dl-menu>
@@ -115,11 +115,18 @@ export default defineComponent({
115
115
  emit('update:model-value', false)
116
116
  }
117
117
 
118
+ const removeQuotes = (item: any) => {
119
+ const str = '' + item
120
+ const match = str.match(/^'(.*)'$/)
121
+ return match ? match[1] : str
122
+ }
123
+
118
124
  return {
119
125
  defaultTarget,
120
126
  setHighlightedIndex,
121
127
  handleSelectedItem,
122
128
  highlightedIndex,
129
+ removeQuotes,
123
130
  onShow,
124
131
  onHide,
125
132
  emitModelValue,
@@ -136,6 +136,7 @@ export default defineComponent({
136
136
  '*': 'any'
137
137
  },
138
138
  type: ['dir', 'file'],
139
+ test0: ['why wont', 'this work', 123],
139
140
  test1: ['5', '6', 'number'],
140
141
  test2: ['true', 'false']
141
142
  }
@@ -260,11 +260,15 @@ export const useSuggestions = (
260
260
  }
261
261
 
262
262
  if (Array.isArray(dataType)) {
263
- localSuggestions = dataType.filter(
264
- (type) =>
265
- typeof type === 'string' &&
266
- !knownDataTypes.includes(type)
267
- ) as string[]
263
+ localSuggestions = dataType
264
+ .filter(
265
+ (type) =>
266
+ !knownDataTypes.includes(type as string) &&
267
+ typeof type !== 'object'
268
+ )
269
+ .map((type) =>
270
+ typeof type === 'string' ? `'${type}'` : type
271
+ ) as string[]
268
272
 
269
273
  if (!value) continue
270
274
 
@@ -704,7 +708,7 @@ const getValueSuggestions = (
704
708
  !knownDataTypes.includes(type as string) &&
705
709
  typeof type !== 'object'
706
710
  ) {
707
- suggestion.push(type)
711
+ suggestion.push(typeof type === 'string' ? `'${type}'` : type)
708
712
  }
709
713
  }
710
714
  }