@dataloop-ai/components 0.19.72 → 0.19.74
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
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
selection="none"
|
|
27
27
|
:loading="false"
|
|
28
28
|
:filter="inputValue"
|
|
29
|
-
:rows="
|
|
29
|
+
:rows="rows"
|
|
30
30
|
row-key="identifier"
|
|
31
31
|
color="dl-color-secondary"
|
|
32
32
|
@row-click="handleRowClick"
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
</template>
|
|
44
44
|
|
|
45
45
|
<script lang="ts">
|
|
46
|
-
import { ref, PropType, defineComponent, computed } from 'vue-demi'
|
|
46
|
+
import { ref, PropType, defineComponent, computed, toRefs } from 'vue-demi'
|
|
47
47
|
import { DlLabel, DlIcon } from '../../essential'
|
|
48
48
|
import { DlInput, DlTreeTable } from '../../compound'
|
|
49
|
-
import { DlTableColumn } from '../../types'
|
|
49
|
+
import { DlTableColumn, DlTableRow } from '../../types'
|
|
50
50
|
import { DlLabelPickerItem } from './types'
|
|
51
51
|
|
|
52
52
|
export default defineComponent({
|
|
@@ -63,8 +63,10 @@ export default defineComponent({
|
|
|
63
63
|
default: () => [] as PropType<DlLabelPickerItem[]>
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
emits: ['selectedLabel'],
|
|
66
|
+
emits: ['selectedLabel', 'click'],
|
|
67
67
|
setup(props, { emit, slots }) {
|
|
68
|
+
const { items } = toRefs(props)
|
|
69
|
+
|
|
68
70
|
const columns: DlTableColumn[] = [
|
|
69
71
|
{
|
|
70
72
|
name: 'displayLabel',
|
|
@@ -83,6 +85,7 @@ export default defineComponent({
|
|
|
83
85
|
const handleRowClick = (_: MouseEvent, item: DlLabelPickerItem) => {
|
|
84
86
|
currentSelectedLabel.value = item
|
|
85
87
|
emit('selectedLabel', item)
|
|
88
|
+
emit('click', item)
|
|
86
89
|
}
|
|
87
90
|
|
|
88
91
|
const placeHolderText = computed(() => {
|
|
@@ -107,12 +110,20 @@ export default defineComponent({
|
|
|
107
110
|
return { 'border-left': `2px solid ${selectedColor.value}` }
|
|
108
111
|
})
|
|
109
112
|
|
|
113
|
+
const rows = computed<DlTableRow[]>(() => {
|
|
114
|
+
return items.value?.map((i: DlLabelPickerItem) => ({
|
|
115
|
+
...i,
|
|
116
|
+
name: i.displayLabel
|
|
117
|
+
}))
|
|
118
|
+
})
|
|
119
|
+
|
|
110
120
|
return {
|
|
111
121
|
handleRowClick,
|
|
112
122
|
inputValue,
|
|
113
123
|
columns,
|
|
114
124
|
placeHolderText,
|
|
115
|
-
inputStyles
|
|
125
|
+
inputStyles,
|
|
126
|
+
rows
|
|
116
127
|
}
|
|
117
128
|
}
|
|
118
129
|
})
|
|
@@ -75,11 +75,7 @@ export function useTableColumnSelection(
|
|
|
75
75
|
align,
|
|
76
76
|
iconClass: `dl-table__sort-icon dl-table__sort-icon--${align}`,
|
|
77
77
|
thClass:
|
|
78
|
-
alignClass +
|
|
79
|
-
headerClass +
|
|
80
|
-
sortableClass +
|
|
81
|
-
sortOrderClass +
|
|
82
|
-
textTransformClass,
|
|
78
|
+
alignClass + headerClass + sortableClass + sortOrderClass,
|
|
83
79
|
tdStyle: assignTdStyles(col),
|
|
84
80
|
tdClass: assignTdClasses(col, alignClass, textTransformClass)
|
|
85
81
|
}
|
|
@@ -352,7 +352,8 @@ export default defineComponent({
|
|
|
352
352
|
filter = filter.toLowerCase()
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
-
|
|
355
|
+
// todo: row is not always defined. which will cause the filter not to work.
|
|
356
|
+
return row.name?.toLowerCase?.().includes(filter)
|
|
356
357
|
}
|
|
357
358
|
)
|
|
358
359
|
|