@dataloop-ai/components 0.20.111 → 0.20.113

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.111",
3
+ "version": "0.20.113",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -23,7 +23,7 @@
23
23
  "check-only": "if grep -E -H -r --exclude-dir=.git --exclude-dir=node_modules --exclude=*.json --exclude=*.yml '^(describe|it).only' .; then echo 'Found only in test files' && exit 1; fi"
24
24
  },
25
25
  "dependencies": {
26
- "@dataloop-ai/icons": "^3.1.8",
26
+ "@dataloop-ai/icons": "^3.1.11",
27
27
  "@types/flat": "^5.0.2",
28
28
  "@types/lodash": "^4.14.184",
29
29
  "@types/sortablejs": "^1.15.7",
@@ -71,6 +71,8 @@
71
71
  @input="handleSearchInput"
72
72
  @focus="handleSearchFocus"
73
73
  @blur="handleSearchBlur"
74
+ @keyup.enter="handleSearchEnter"
75
+ @keyup.esc="handleSearchEscape"
74
76
  />
75
77
  <dl-tooltip v-if="disabled && disabledTooltip">
76
78
  {{ disabledTooltip }}
@@ -451,6 +453,8 @@ export default defineComponent({
451
453
  emits: [
452
454
  'search-focus',
453
455
  'search-blur',
456
+ 'search-enter',
457
+ 'search-escape',
454
458
  'filter',
455
459
  'change',
456
460
  'search-input',
@@ -1023,6 +1027,16 @@ export default defineComponent({
1023
1027
 
1024
1028
  return html
1025
1029
  },
1030
+ handleSearchEnter(e: Event): void {
1031
+ if (this.searchable) {
1032
+ this.$emit('search-enter', e, this.searchInputValue)
1033
+ }
1034
+ },
1035
+ handleSearchEscape(e: Event): void {
1036
+ if (this.searchable) {
1037
+ this.$emit('search-escape', e, this.searchInputValue)
1038
+ }
1039
+ },
1026
1040
  handleSearchBlur(e: Event): void {
1027
1041
  if (this.searchable) {
1028
1042
  const inputRef = this.$refs.searchInput as HTMLInputElement
@@ -568,7 +568,9 @@ export default defineComponent({
568
568
  tableRootRef.value.onTrContextMenu(event, row, index)
569
569
  },
570
570
  updateExpandedRow: () =>
571
- updateExpandedRow(!row.isExpanded, getRowKey.value(row))
571
+ updateExpandedRow(!row.isExpanded, getRowKey.value(row)),
572
+ rowHoverStart: (...args: any) => emit('row-hover-start', ...args),
573
+ rowHoverEnd: (...args: any) => emit('row-hover-end', ...args)
572
574
  }
573
575
  })
574
576
  }
@@ -11,6 +11,8 @@ export const emits = [
11
11
  'row-double-click',
12
12
  'row-contextmenu',
13
13
  'update:visible-columns',
14
+ 'row-hover-start',
15
+ 'row-hover-end',
14
16
  ...useTableRowExpandEmits,
15
17
  ...useTreeTableRowSelectionEmits
16
18
  ]
@@ -7,8 +7,8 @@
7
7
  @click="emitRowClick($event, row, rowIndex)"
8
8
  @dblclick="onTrDoubleClick($event, row, rowIndex)"
9
9
  @contextmenu="onTrContextMenu($event, row, rowIndex)"
10
- @mouseenter="isDragIconVisible = true"
11
- @mouseleave="isDragIconVisible = false"
10
+ @mouseenter="onRowHoverStart($event, row, rowIndex)"
11
+ @mouseleave="onRowHoverEnd($event, row, rowIndex)"
12
12
  >
13
13
  <td
14
14
  v-if="hasDraggableRows"
@@ -161,7 +161,9 @@ export default defineComponent({
161
161
  'rowDoubleClick',
162
162
  'rowContextMenu',
163
163
  'update:model-value',
164
- 'updateExpandedRow'
164
+ 'updateExpandedRow',
165
+ 'rowHoverStart',
166
+ 'rowHoverEnd'
165
167
  ],
166
168
  setup(props, { emit, slots }) {
167
169
  const visibleChildren = ref(0)
@@ -190,6 +192,24 @@ export default defineComponent({
190
192
  emit('rowClick', event, row, rowIndex)
191
193
  }
192
194
 
195
+ const onRowHoverStart = (
196
+ event: MouseEvent,
197
+ row: Record<string, any>,
198
+ rowIndex: number
199
+ ) => {
200
+ isDragIconVisible.value = true
201
+ emit('rowHoverStart', event, row, rowIndex)
202
+ }
203
+
204
+ const onRowHoverEnd = (
205
+ event: MouseEvent,
206
+ row: Record<string, any>,
207
+ rowIndex: number
208
+ ) => {
209
+ isDragIconVisible.value = false
210
+ emit('rowHoverEnd', event, row, rowIndex)
211
+ }
212
+
193
213
  const onTrDoubleClick = (
194
214
  evt: MouseEvent,
195
215
  row: DlTableRow,
@@ -314,7 +334,9 @@ export default defineComponent({
314
334
  rowClass,
315
335
  getSlotByName,
316
336
  getExpandedvisibleChildren,
317
- updateExpandedvisibleChildren
337
+ updateExpandedvisibleChildren,
338
+ onRowHoverStart,
339
+ onRowHoverEnd
318
340
  }
319
341
  }
320
342
  })