@dataloop-ai/components 0.18.90 → 0.18.92
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
|
@@ -575,7 +575,7 @@
|
|
|
575
575
|
<dl-pagination
|
|
576
576
|
v-if="displayPagination"
|
|
577
577
|
v-bind="marginalsScope.pagination"
|
|
578
|
-
:total-items="
|
|
578
|
+
:total-items="totalItemsCount"
|
|
579
579
|
@update:rowsPerPage="
|
|
580
580
|
(v) => updatePagination(v, 'rowsPerPage')
|
|
581
581
|
"
|
|
@@ -680,7 +680,8 @@ export default defineComponent({
|
|
|
680
680
|
tableHeaderClass,
|
|
681
681
|
dense,
|
|
682
682
|
draggable,
|
|
683
|
-
virtualScroll
|
|
683
|
+
virtualScroll,
|
|
684
|
+
rows
|
|
684
685
|
} = toRefs(props)
|
|
685
686
|
|
|
686
687
|
const rootRef = ref<HTMLDivElement>(null)
|
|
@@ -794,6 +795,10 @@ export default defineComponent({
|
|
|
794
795
|
let resizableManager: ResizableManager | null = null
|
|
795
796
|
let tableEl: HTMLTableElement = null
|
|
796
797
|
|
|
798
|
+
const totalItemsCount = computed(() => {
|
|
799
|
+
return computedPagination.value.rowsNumber || rows.value.length
|
|
800
|
+
})
|
|
801
|
+
|
|
797
802
|
onMounted(() => {
|
|
798
803
|
tableEl = (rootRef.value as HTMLDivElement).querySelector(
|
|
799
804
|
'table.dl-table'
|
|
@@ -939,22 +944,21 @@ export default defineComponent({
|
|
|
939
944
|
)
|
|
940
945
|
|
|
941
946
|
const { computedFilterMethod } = useTableFilter(props, setPagination)
|
|
942
|
-
const rowsPropRef = toRef(props, 'rows')
|
|
943
947
|
|
|
944
948
|
const { isRowExpanded, setExpanded, updateExpanded } =
|
|
945
949
|
useTableRowExpand(props, emit)
|
|
946
950
|
|
|
947
951
|
const filteredSortedRows = computed(() => {
|
|
948
|
-
let
|
|
952
|
+
let filtered = rows.value as DlTableRow[]
|
|
949
953
|
|
|
950
|
-
if (
|
|
951
|
-
return rows
|
|
954
|
+
if (filtered.length === 0) {
|
|
955
|
+
return rows.value as DlTableRow[]
|
|
952
956
|
}
|
|
953
957
|
|
|
954
958
|
const { sortBy, descending } = computedPagination.value
|
|
955
959
|
|
|
956
960
|
if (props.filter) {
|
|
957
|
-
|
|
961
|
+
filtered = computedFilterMethod.value(
|
|
958
962
|
rows,
|
|
959
963
|
props.filter,
|
|
960
964
|
computedCols.value,
|
|
@@ -963,14 +967,14 @@ export default defineComponent({
|
|
|
963
967
|
}
|
|
964
968
|
|
|
965
969
|
if (columnToSort.value !== null) {
|
|
966
|
-
|
|
967
|
-
|
|
970
|
+
filtered = computedSortMethod.value(
|
|
971
|
+
rows.value === filtered ? filtered.slice() : filtered,
|
|
968
972
|
sortBy,
|
|
969
973
|
descending
|
|
970
974
|
)
|
|
971
975
|
}
|
|
972
976
|
|
|
973
|
-
return
|
|
977
|
+
return filtered
|
|
974
978
|
})
|
|
975
979
|
|
|
976
980
|
const filteredSortedRowsNumber = computed(
|
|
@@ -978,25 +982,28 @@ export default defineComponent({
|
|
|
978
982
|
)
|
|
979
983
|
|
|
980
984
|
const computedRows = computed(() => {
|
|
981
|
-
let
|
|
985
|
+
let filtered = filteredSortedRows.value
|
|
982
986
|
|
|
983
987
|
const { rowsPerPage } = computedPagination.value
|
|
984
988
|
|
|
985
989
|
if (rowsPerPage !== 0) {
|
|
986
|
-
if (firstRowIndex.value === 0 &&
|
|
987
|
-
if (
|
|
988
|
-
|
|
990
|
+
if (firstRowIndex.value === 0 && rows.value !== filtered) {
|
|
991
|
+
if (filtered.length > lastRowIndex.value) {
|
|
992
|
+
filtered = filtered.slice(0, lastRowIndex.value)
|
|
989
993
|
}
|
|
990
994
|
} else {
|
|
991
|
-
|
|
995
|
+
filtered = filtered.slice(
|
|
996
|
+
firstRowIndex.value,
|
|
997
|
+
lastRowIndex.value
|
|
998
|
+
)
|
|
992
999
|
}
|
|
993
1000
|
}
|
|
994
1001
|
|
|
995
|
-
return props.flatTreeData ? flatTreeData(
|
|
1002
|
+
return props.flatTreeData ? flatTreeData(filtered) : filtered
|
|
996
1003
|
})
|
|
997
1004
|
|
|
998
1005
|
const additionalClasses = computed(() => {
|
|
999
|
-
const classes = []
|
|
1006
|
+
const classes: string[] = []
|
|
1000
1007
|
|
|
1001
1008
|
if (hasDraggableRows.value === true) {
|
|
1002
1009
|
classes.push('dl-table--draggable-rows')
|
|
@@ -1055,7 +1062,7 @@ export default defineComponent({
|
|
|
1055
1062
|
() =>
|
|
1056
1063
|
multipleSelection.value === true &&
|
|
1057
1064
|
computedRows.value.length > 0 &&
|
|
1058
|
-
computedRows.value.length <
|
|
1065
|
+
computedRows.value.length < rows.value.length
|
|
1059
1066
|
)
|
|
1060
1067
|
|
|
1061
1068
|
function onMultipleSelectionSet(val: boolean) {
|
|
@@ -1393,7 +1400,8 @@ export default defineComponent({
|
|
|
1393
1400
|
groupOptions,
|
|
1394
1401
|
visibleColumnsState,
|
|
1395
1402
|
handleVisibleColumnsUpdate,
|
|
1396
|
-
computedVisibleCols
|
|
1403
|
+
computedVisibleCols,
|
|
1404
|
+
totalItemsCount
|
|
1397
1405
|
}
|
|
1398
1406
|
}
|
|
1399
1407
|
})
|
|
@@ -8,12 +8,16 @@ import { useTableFilterProps } from '../hooks/tableFilter'
|
|
|
8
8
|
import { useTableSortProps } from '../hooks/tableSort'
|
|
9
9
|
import { useTableColumnSelectionProps } from '../hooks/tableColumnSelection'
|
|
10
10
|
import { useTableRowSelectionProps } from '../hooks/tableRowSelection'
|
|
11
|
+
import { DlTableColumn, DlTableRow } from '../types'
|
|
11
12
|
|
|
12
13
|
export const props = {
|
|
13
|
-
columns: {
|
|
14
|
+
columns: {
|
|
15
|
+
type: Array as PropType<DlTableColumn[]>,
|
|
16
|
+
default: () => [] as DlTableColumn[]
|
|
17
|
+
},
|
|
14
18
|
rows: {
|
|
15
|
-
type: Array
|
|
16
|
-
default: () => [] as
|
|
19
|
+
type: Array as PropType<DlTableRow[]>,
|
|
20
|
+
default: () => [] as DlTableRow[]
|
|
17
21
|
},
|
|
18
22
|
rowKey: {
|
|
19
23
|
type: [String, Function],
|