@dataloop-ai/components 0.20.138 → 0.20.140
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 +1 -1
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +1 -1
- package/src/components/compound/DlTreeTable/DlTreeTable.vue +28 -0
- package/src/components/compound/DlTreeTable/emits.ts +2 -0
- package/src/components/compound/DlTreeTable/types.ts +9 -0
- package/src/components/compound/types.ts +1 -0
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@ import { DlEmptyState } from '../../basic'
|
|
|
16
16
|
import DlTable from '../DlTable/DlTable.vue'
|
|
17
17
|
import DlTrTreeView from './views/DlTrTreeView.vue'
|
|
18
18
|
import { DlTableColumn, DlTableProps, DlTableRow } from '../DlTable/types'
|
|
19
|
+
|
|
19
20
|
import { useTreeTableRowSelection } from './utils/treeTableRowSelection'
|
|
20
21
|
import { useNestedTableFilter } from './hooks/nestedTableFilter'
|
|
21
22
|
import { getFromChildren } from './utils/getFromChildren'
|
|
@@ -38,6 +39,7 @@ import { useTableFilterProps } from '../DlTable/hooks/tableFilter'
|
|
|
38
39
|
import { useTableSortProps } from '../DlTable/hooks/tableSort'
|
|
39
40
|
import { useTableColumnSelectionProps } from '../DlTable/hooks/tableColumnSelection'
|
|
40
41
|
import { useTableRowSelectionProps } from '../DlTable/hooks/tableRowSelection'
|
|
42
|
+
import { RowExpandEventData } from './types'
|
|
41
43
|
|
|
42
44
|
let prevMouseY = 0
|
|
43
45
|
|
|
@@ -431,6 +433,22 @@ export default defineComponent({
|
|
|
431
433
|
row.isExpanded = isExpanded
|
|
432
434
|
}
|
|
433
435
|
updateNestedRows(row, isExpanded)
|
|
436
|
+
|
|
437
|
+
const eventData: RowExpandEventData = {
|
|
438
|
+
row,
|
|
439
|
+
rowKey: getRowKey.value(row),
|
|
440
|
+
isExpanded,
|
|
441
|
+
level: row.level || 1,
|
|
442
|
+
hasChildren: (row.children || []).length > 0
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
if (isExpanded) {
|
|
446
|
+
emit('row-expand', eventData)
|
|
447
|
+
} else {
|
|
448
|
+
emit('row-collapse', eventData)
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
break
|
|
434
452
|
} else {
|
|
435
453
|
if ((row.children || []).length > 0) {
|
|
436
454
|
updateExpandedRow(isExpanded, name, row.children)
|
|
@@ -514,6 +532,14 @@ export default defineComponent({
|
|
|
514
532
|
emit('th-click', payload)
|
|
515
533
|
}
|
|
516
534
|
|
|
535
|
+
const emitRowExpand = (eventData: RowExpandEventData) => {
|
|
536
|
+
emit('row-expand', eventData)
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
const emitRowCollapse = (eventData: RowExpandEventData) => {
|
|
540
|
+
emit('row-collapse', eventData)
|
|
541
|
+
}
|
|
542
|
+
|
|
517
543
|
const hasSlotByName = (name: string) => !!slots[name]
|
|
518
544
|
|
|
519
545
|
const getSlotByName = (name: string) => {
|
|
@@ -898,6 +924,8 @@ export default defineComponent({
|
|
|
898
924
|
emitRowClick,
|
|
899
925
|
emitRowDblclick,
|
|
900
926
|
emitThClick,
|
|
927
|
+
emitRowExpand,
|
|
928
|
+
emitRowCollapse,
|
|
901
929
|
hasSlotByName,
|
|
902
930
|
getSlotByName,
|
|
903
931
|
renderTBody,
|