@dataloop-ai/components 0.20.143 → 0.20.145

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.143",
3
+ "version": "0.20.145",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -507,6 +507,10 @@ export default defineComponent({
507
507
  afterOptionsPadding: {
508
508
  type: String,
509
509
  default: null
510
+ },
511
+ keepFocusOnBlur: {
512
+ type: Boolean,
513
+ default: false
510
514
  }
511
515
  },
512
516
  emits: [
@@ -1119,11 +1123,18 @@ export default defineComponent({
1119
1123
  }
1120
1124
  },
1121
1125
  handleSearchBlur(e: Event): void {
1122
- if (this.searchable) {
1126
+ if (!this.searchable) return
1127
+
1128
+ const focusEvent = e as FocusEvent
1129
+ const shouldKeepFocus =
1130
+ this.keepFocusOnBlur && !focusEvent.relatedTarget
1131
+
1132
+ this.$nextTick(() => {
1123
1133
  const inputRef = this.$refs.searchInput as HTMLInputElement
1124
- this.$nextTick(() => {
1125
- inputRef?.focus({})
1126
- })
1134
+ inputRef?.focus({})
1135
+ })
1136
+
1137
+ if (!shouldKeepFocus) {
1127
1138
  this.$emit('search-blur', e)
1128
1139
  }
1129
1140
  },
@@ -482,6 +482,12 @@ export default defineComponent({
482
482
  }
483
483
  }
484
484
  }
485
+
486
+ const clearSelectionWithRerender = () => {
487
+ clearSelection()
488
+ mainTableKey.value = v4()
489
+ }
490
+
485
491
  const updateSelectionHierarchy = (
486
492
  adding: boolean,
487
493
  event: any,
@@ -943,7 +949,9 @@ export default defineComponent({
943
949
  mainTbodyUuid,
944
950
  vue2h,
945
951
  containerClass,
946
- computedFilter
952
+ computedFilter,
953
+ clearSelection,
954
+ clearSelectionWithRerender
947
955
  }
948
956
  },
949
957
  // adding ignore here as overloading the render function like this is not a known type
@@ -75,6 +75,7 @@ export function useTreeTableRowSelection(
75
75
 
76
76
  function clearSelection() {
77
77
  selectedRows.value = []
78
+ selectedItemsNested.value = []
78
79
  }
79
80
 
80
81
  function updateSelection(