@polymarbot/nuxt-layer-shadcn-ui 0.7.0 → 0.7.1

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.
@@ -32,7 +32,7 @@ const columns: DataTableColumn[] = [
32
32
  { field: 'createdAt', title: 'Created', width: '140px', type: 'date' },
33
33
  ]
34
34
 
35
- /** Mock fetch using offset as the opaque `next` token */
35
+ /** Mock fetch using offset as the opaque cursor */
36
36
  function mockFetch (params: InfiniteDataTableFetchParams): Promise<InfiniteDataTableFetchResult<User>> {
37
37
  return new Promise(resolve => {
38
38
  setTimeout(() => {
@@ -53,7 +53,7 @@ function mockFetch (params: InfiniteDataTableFetchParams): Promise<InfiniteDataT
53
53
  })
54
54
  }
55
55
 
56
- const offset = params.next ? Number(params.next) : 0
56
+ const offset = params.cursor ? Number(params.cursor) : 0
57
57
  const items = data.slice(offset, offset + params.limit)
58
58
  const nextOffset = offset + items.length
59
59
  resolve({
@@ -22,7 +22,7 @@ const T = useTranslations('components.ui.InfiniteDataTable')
22
22
 
23
23
  const loading = ref(false)
24
24
  const internalData = ref<TData[]>([]) as Ref<TData[]>
25
- const next = ref<string | undefined>(undefined)
25
+ const cursor = ref<string | undefined>(undefined)
26
26
  const hasMore = ref(true)
27
27
  const total = ref<number | undefined>(undefined)
28
28
  const requestVersion = ref(0)
@@ -56,14 +56,14 @@ function getFilters (): Record<string, any> {
56
56
  function buildFetchParams (): InfiniteDataTableFetchParams {
57
57
  return {
58
58
  ...getFilters(),
59
- next: next.value,
59
+ cursor: cursor.value,
60
60
  limit: props.pageSize,
61
61
  }
62
62
  }
63
63
 
64
64
  function resetState () {
65
65
  internalData.value = []
66
- next.value = undefined
66
+ cursor.value = undefined
67
67
  hasMore.value = true
68
68
  total.value = undefined
69
69
  }
@@ -82,7 +82,7 @@ async function loadMore () {
82
82
 
83
83
  internalData.value = [ ...internalData.value, ...result.items ]
84
84
  if (result.total != null) total.value = result.total
85
- next.value = result.next
85
+ cursor.value = result.next
86
86
  hasMore.value = !!result.next
87
87
  } catch (error) {
88
88
  if (currentVersion !== requestVersion.value) return
@@ -1,8 +1,8 @@
1
1
  import type { DataTableColumn } from '../DataTable/types'
2
2
 
3
3
  export interface InfiniteDataTableFetchParams {
4
- /** Opaque token returned by the previous page; absent on the first page */
5
- next?: string
4
+ /** Opaque cursor pointing at the next page; absent on the first page */
5
+ cursor?: string
6
6
  /** Page size requested */
7
7
  limit: number
8
8
  /** Filter / sort fields are spread onto the params object */
@@ -11,7 +11,7 @@ export interface InfiniteDataTableFetchParams {
11
11
 
12
12
  export interface InfiniteDataTableFetchResult<T = Record<string, any>> {
13
13
  items: T[]
14
- /** Token for the next page; absent signals "no more" */
14
+ /** Cursor for the next page; pass back as `cursor` on the next request. Absent signals "no more". */
15
15
  next?: string
16
16
  /** Optional total count */
17
17
  total?: number
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/nuxt-layer-shadcn-ui",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Nuxt layer providing shadcn-vue based UI components",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -42,5 +42,5 @@
42
42
  "vue-i18n": "^11",
43
43
  "vue-router": "^4 || ^5"
44
44
  },
45
- "gitHead": "37550d310f0b22d2986416d852f611782694ec8c"
45
+ "gitHead": "9e9256215d7979ca5a8088e864cc7c54a7042548"
46
46
  }