@dataloop-ai/components 0.19.60 → 0.19.62
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/blocks/DlLabelPicker/DlLabelPicker.vue +3 -5
- package/src/components/compound/DlTable/DlTable.vue +1 -1
- package/src/components/compound/DlTreeTable/DlTreeTable.vue +28 -28
- package/src/components/compound/DlTreeTable/components/DlTrTree.vue +3 -0
- package/src/demos/DlLabelPickerDemo.vue +10 -2
- package/src/demos/DlTableDemo.vue +24 -0
package/package.json
CHANGED
|
@@ -78,8 +78,6 @@ export default defineComponent({
|
|
|
78
78
|
]
|
|
79
79
|
|
|
80
80
|
const inputValue = ref('')
|
|
81
|
-
const isInputActive = ref(false)
|
|
82
|
-
const inputBorderLeft = ref('2px solid transparent')
|
|
83
81
|
const currentSelectedLabel = ref<DlLabelPickerItem>(null)
|
|
84
82
|
|
|
85
83
|
const handleRowClick = (_: MouseEvent, item: DlLabelPickerItem) => {
|
|
@@ -103,16 +101,16 @@ export default defineComponent({
|
|
|
103
101
|
})
|
|
104
102
|
|
|
105
103
|
const inputStyles = computed(() => {
|
|
104
|
+
if (!selectedColor.value) {
|
|
105
|
+
return {}
|
|
106
|
+
}
|
|
106
107
|
return { 'border-left': `2px solid ${selectedColor.value}` }
|
|
107
108
|
})
|
|
108
109
|
|
|
109
110
|
return {
|
|
110
111
|
handleRowClick,
|
|
111
112
|
inputValue,
|
|
112
|
-
inputBorderLeft,
|
|
113
|
-
isInputActive,
|
|
114
113
|
columns,
|
|
115
|
-
selectedColor,
|
|
116
114
|
placeHolderText,
|
|
117
115
|
inputStyles
|
|
118
116
|
}
|
|
@@ -294,7 +294,7 @@ export default defineComponent({
|
|
|
294
294
|
|
|
295
295
|
const mainTbodyUuid = `dl-tree-table-tbody-${v4()}`
|
|
296
296
|
|
|
297
|
-
const mainTableKey = ref()
|
|
297
|
+
const mainTableKey = ref(v4())
|
|
298
298
|
|
|
299
299
|
const { rows: tableRows, columns: tableColumns } = toRefs(props)
|
|
300
300
|
|
|
@@ -317,7 +317,8 @@ export default defineComponent({
|
|
|
317
317
|
const getRowKey = computed(() =>
|
|
318
318
|
typeof props.rowKey === 'function'
|
|
319
319
|
? props.rowKey
|
|
320
|
-
: (row: Record<string, any>) =>
|
|
320
|
+
: (row: Record<string, any>) =>
|
|
321
|
+
row[props.rowKey as string] ?? ''
|
|
321
322
|
)
|
|
322
323
|
|
|
323
324
|
const hasDraggableRows = computed(() =>
|
|
@@ -347,45 +348,44 @@ export default defineComponent({
|
|
|
347
348
|
name: string,
|
|
348
349
|
rowsArr: DlTableRow[] = tableRows.value
|
|
349
350
|
) => {
|
|
350
|
-
rowsArr
|
|
351
|
-
if (getRowKey.value(
|
|
351
|
+
for (const row of rowsArr) {
|
|
352
|
+
if (getRowKey.value(row) === name) {
|
|
352
353
|
if (isVue2) {
|
|
353
|
-
set(
|
|
354
|
+
set(row, 'isExpanded', isExpanded)
|
|
354
355
|
} else {
|
|
355
|
-
|
|
356
|
+
row.isExpanded = isExpanded
|
|
356
357
|
}
|
|
357
|
-
updateNestedRows(
|
|
358
|
+
updateNestedRows(row, isExpanded)
|
|
358
359
|
} else {
|
|
359
|
-
if ((
|
|
360
|
-
updateExpandedRow(isExpanded, name,
|
|
360
|
+
if ((row.children || []).length > 0) {
|
|
361
|
+
updateExpandedRow(isExpanded, name, row.children)
|
|
361
362
|
}
|
|
362
363
|
}
|
|
363
|
-
}
|
|
364
|
+
}
|
|
364
365
|
}
|
|
365
366
|
const updateNestedRows = (
|
|
366
367
|
row: (typeof computedRows.value)[number],
|
|
367
368
|
isExpanded: boolean
|
|
368
369
|
) => {
|
|
369
|
-
if (
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
if (isVue2) {
|
|
380
|
-
set(r, 'isExpanded', isExpanded)
|
|
381
|
-
} else {
|
|
382
|
-
r.isExpanded = isExpanded
|
|
383
|
-
}
|
|
370
|
+
if (!row.children) {
|
|
371
|
+
return
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
for (const r of row.children) {
|
|
375
|
+
if (isVue2) {
|
|
376
|
+
set(r, 'isExpanded', isExpanded)
|
|
377
|
+
} else {
|
|
378
|
+
r.isExpanded = isExpanded
|
|
379
|
+
}
|
|
384
380
|
|
|
385
|
-
|
|
386
|
-
|
|
381
|
+
if (!isExpanded) {
|
|
382
|
+
if (isVue2) {
|
|
383
|
+
set(r, 'isExpanded', isExpanded)
|
|
384
|
+
} else {
|
|
385
|
+
r.isExpanded = isExpanded
|
|
387
386
|
}
|
|
388
|
-
|
|
387
|
+
updateNestedRows(r, isExpanded)
|
|
388
|
+
}
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
const updateSelectionHierarchy = (
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<div>Label picker component</div>
|
|
4
|
-
<DlLabelPicker
|
|
4
|
+
<DlLabelPicker
|
|
5
|
+
:items="items"
|
|
6
|
+
@selected-label="setSelectedEvent"
|
|
7
|
+
/>
|
|
8
|
+
<div>last selected: {{ lastSelected }}</div>
|
|
5
9
|
</div>
|
|
6
10
|
</template>
|
|
7
11
|
|
|
@@ -63,7 +67,11 @@ export default defineComponent({
|
|
|
63
67
|
},
|
|
64
68
|
setup() {
|
|
65
69
|
const items = ref(rows)
|
|
66
|
-
|
|
70
|
+
const lastSelected = ref<DlLabelPickerItem>(null)
|
|
71
|
+
const setSelectedEvent = (item: DlLabelPickerItem) => {
|
|
72
|
+
lastSelected.value = item
|
|
73
|
+
}
|
|
74
|
+
return { items, lastSelected, setSelectedEvent }
|
|
67
75
|
}
|
|
68
76
|
})
|
|
69
77
|
</script>
|
|
@@ -506,6 +506,30 @@
|
|
|
506
506
|
no-data-label="NOoooooOOOOOoooooo"
|
|
507
507
|
/>
|
|
508
508
|
</div>
|
|
509
|
+
<div>
|
|
510
|
+
<p>With empty data virtual scroll</p>
|
|
511
|
+
<DlTable
|
|
512
|
+
:rows="[]"
|
|
513
|
+
:columns="tableColumns"
|
|
514
|
+
title="empty data"
|
|
515
|
+
no-data-label="NOoooooOOOOOoooooo"
|
|
516
|
+
virtual-scroll
|
|
517
|
+
/>
|
|
518
|
+
</div>
|
|
519
|
+
<div>
|
|
520
|
+
<p>With empty data virtual scroll no data slot</p>
|
|
521
|
+
<DlTable
|
|
522
|
+
:rows="[]"
|
|
523
|
+
:columns="tableColumns"
|
|
524
|
+
title="empty data"
|
|
525
|
+
virtual-scroll
|
|
526
|
+
hide-bottom
|
|
527
|
+
>
|
|
528
|
+
<template #no-data>
|
|
529
|
+
<div>< slot#no-data ></div>
|
|
530
|
+
</template>
|
|
531
|
+
</DlTable>
|
|
532
|
+
</div>
|
|
509
533
|
<div>
|
|
510
534
|
<p>With alignments</p>
|
|
511
535
|
<DlTable
|