@dataloop-ai/components 0.19.244 → 0.19.245

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.244",
3
+ "version": "0.19.245",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -17,6 +17,7 @@
17
17
  </template>
18
18
  </dl-input>
19
19
  <dl-tree-table
20
+ v-if="isFilterString(inputValue)"
20
21
  draggable="none"
21
22
  separator="none"
22
23
  :hide-pagination="true"
@@ -166,13 +167,28 @@ export default defineComponent({
166
167
  )
167
168
  )
168
169
  const rows = computed(() => mapItems.value)
170
+ const isFilterString = (input: string) => {
171
+ const stack = [...items.value]
172
+ const filter = (input ?? '').toLowerCase()
173
+ while (stack.length) {
174
+ const item = stack.pop()
175
+ if (item.displayLabel?.toLowerCase?.().includes(filter)) {
176
+ return true
177
+ }
178
+ if (item.children) {
179
+ stack.push(...item.children)
180
+ }
181
+ }
182
+ return false
183
+ }
169
184
  return {
170
185
  handleRowClick,
171
186
  inputValue,
172
187
  columns,
173
188
  placeHolderText,
174
189
  inputStyles,
175
- rows
190
+ rows,
191
+ isFilterString
176
192
  }
177
193
  }
178
194
  })
@@ -423,7 +423,10 @@ export default defineComponent({
423
423
  words.push(lastWord)
424
424
  }
425
425
  queryLeftSide = words.join('.')
426
- } else if (queryLeftSide.endsWith(' ')) {
426
+ } else if (
427
+ queryLeftSide.endsWith(' ') &&
428
+ (queryLeftSide.match(/'/g)?.length ?? 0) % 2 === 0
429
+ ) {
427
430
  // caret after space: only replace multiple spaces on the left
428
431
  queryLeftSide = queryLeftSide.trimEnd() + ' '
429
432
  } else if (/\.\S+$/.test(queryLeftSide)) {
@@ -440,7 +443,10 @@ export default defineComponent({
440
443
  queryRightSide = queryRightSide.trimStart()
441
444
  } else {
442
445
  // this|situation: replace whatever is there on both sides with the value
443
- queryLeftSide = queryLeftSide.replace(/\S+$/, '')
446
+ queryLeftSide = queryLeftSide.replace(
447
+ /('[^']+'?|[^'\s]+)$/,
448
+ ''
449
+ )
444
450
  queryRightSide =
445
451
  removeLeadingExpression(queryRightSide).trimStart()
446
452
  }
@@ -615,7 +621,18 @@ export default defineComponent({
615
621
  }
616
622
 
617
623
  const endsWithOperator = computed(() => {
618
- const operators = ['>=', '<=', '!=', '=', '>', '<', 'IN', 'NOT-IN']
624
+ const operators = [
625
+ '>=',
626
+ '<=',
627
+ '!=',
628
+ '=',
629
+ '>',
630
+ '<',
631
+ 'IN',
632
+ 'NOT-IN',
633
+ 'EXISTS',
634
+ 'DOESNT-EXIST'
635
+ ]
619
636
 
620
637
  for (const op of operators) {
621
638
  if (