@dataloop-ai/components 0.20.135 → 0.20.137

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.135",
3
+ "version": "0.20.137",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -1,6 +1,9 @@
1
1
  import { cloneDeep } from 'lodash'
2
2
 
3
- export function convertToNestedObject(selectedRows: Record<string, any>[]) {
3
+ export function convertToNestedObject(
4
+ selectedRows: Record<string, any>[],
5
+ getRowKey: Function
6
+ ) {
4
7
  const clonedSelectedRows = cloneDeep(selectedRows)
5
8
  let selectedItems: Record<string, any>[] = []
6
9
 
@@ -11,7 +14,9 @@ export function convertToNestedObject(selectedRows: Record<string, any>[]) {
11
14
  for (const rowsItem of rows) {
12
15
  if (rowsItem.children) {
13
16
  const indexItem = rowsItem.children.findIndex(
14
- (item: Record<string, any>) => item.name === row.name
17
+ (item: Record<string, any>) => {
18
+ return getRowKey(item) === getRowKey(row)
19
+ }
15
20
  )
16
21
 
17
22
  if (indexItem > -1) {
@@ -116,7 +116,10 @@ export function useTreeTableRowSelection(
116
116
 
117
117
  selectedRows.value = payload
118
118
 
119
- const { selectedItems } = convertToNestedObject(payload)
119
+ const { selectedItems } = convertToNestedObject(
120
+ payload,
121
+ getRowKey.value
122
+ )
120
123
  selectedItemsNested.value = selectedItems
121
124
 
122
125
  emit('selected-items', selectedItems)
@@ -23,8 +23,8 @@
23
23
  :color="
24
24
  isDragIconHovered ? 'dl-color-darker' : 'dl-color-lighter'
25
25
  "
26
- @mouseenter="isDragIconHovered = true"
27
- @mouseleave="isDragIconHovered = false"
26
+ @mouseenter.native="isDragIconHovered = true"
27
+ @mouseleave.native="isDragIconHovered = false"
28
28
  />
29
29
  </td>
30
30
  <td v-if="hasSelectionMode" class="dl-table--col-auto-width">
@@ -73,13 +73,13 @@
73
73
  :class="col.tdClass(row)"
74
74
  :style="
75
75
  col.tdStyle(row) +
76
- `padding-left: ${
77
- setTrPadding(
78
- level,
79
- (row.children || []).length > 0,
80
- colIndex
81
- ) + 1
82
- }px;`
76
+ `padding-left: ${
77
+ setTrPadding(
78
+ level,
79
+ (row.children || []).length > 0,
80
+ colIndex
81
+ ) + 1
82
+ }px;`
83
83
  "
84
84
  :col-index="colIndex"
85
85
  :tooltip="tooltip"