@dataloop-ai/components 0.18.125 → 0.18.126

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.18.125",
3
+ "version": "0.18.126",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -16,7 +16,7 @@ export type TablePagination = {
16
16
  page?: number
17
17
  rowsPerPage?: number
18
18
  rowsNumber?: number
19
- maxPages?: number
19
+ maxDisplayRange?: number
20
20
  }
21
21
 
22
22
  function samePagination(oldPag: TablePagination, newPag: TablePagination) {
@@ -69,7 +69,8 @@ export function useTablePaginationState(
69
69
  ? rowsPerPageOptions.value[0]
70
70
  : 5,
71
71
  min: 1,
72
- maxPages: 0,
72
+ // todo: calculate based on width of element
73
+ maxDisplayRange: 7,
73
74
  boundaryNumbers: true,
74
75
  boundaryLinks: true,
75
76
  directionLinks: true,
@@ -50,13 +50,9 @@ export type DlTableSortMethod = (
50
50
  descending: boolean
51
51
  ) => DlTableRow[]
52
52
 
53
- export type DlTablePagination = {
54
- page: number
55
- rowsPerPage: number
56
- rowsNumber?: number
57
- sortBy?: string | null
58
- descending?: boolean
59
- }
53
+ import { TablePagination } from './hooks/tablePagination'
54
+
55
+ export type DlTablePagination = TablePagination
60
56
 
61
57
  export type DlTableRequestProp = {
62
58
  pagination: DlTablePagination
@@ -446,6 +446,7 @@ import {
446
446
  } from '../components'
447
447
  import { defineComponent, ref, computed, nextTick } from 'vue-demi'
448
448
  import { times, cloneDeep, isNumber } from 'lodash'
449
+ import { DlTablePagination } from '../types'
449
450
 
450
451
  const columns = [
451
452
  {
@@ -591,7 +592,7 @@ const rows = [
591
592
  calcium: '12%',
592
593
  iron: '6%'
593
594
  },
594
- ...times(100, (index) => ({
595
+ ...times(1000, (index) => ({
595
596
  name: 'KitKat' + index,
596
597
  calories: 518,
597
598
  fat: 26.0,
@@ -681,11 +682,12 @@ export default defineComponent({
681
682
  }
682
683
  }
683
684
 
684
- const pagination = ref({
685
+ const pagination = ref<DlTablePagination>({
685
686
  sortBy: 'desc',
686
687
  descending: false,
687
688
  page: 2,
688
- rowsPerPage: 3
689
+ rowsPerPage: 3,
690
+ maxDisplayRange: 9
689
691
  // rowsNumber: xx if getting data from a server
690
692
  })
691
693