@bjj/nuxt-layer-shadcn-ui 0.11.8 → 0.11.10

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.
@@ -34,7 +34,7 @@ const emit = defineEmits<{
34
34
  defineSlots<{
35
35
  toolbar?: () => any
36
36
  empty?: () => any
37
- [key: string]: ((props?: any) => any) | undefined
37
+ [key: string]: ((props: any) => any) | undefined
38
38
  }>()
39
39
 
40
40
  const { t } = useI18n()
@@ -43,7 +43,7 @@ defineSlots<{
43
43
  footer?: () => any
44
44
  bodyStart?: () => any
45
45
  bodyEnd?: () => any
46
- [key: string]: ((props?: any) => any) | undefined
46
+ [key: string]: ((props: any) => any) | undefined
47
47
  }>()
48
48
 
49
49
  const T = useTranslations('components.ui.DataTable')
@@ -26,7 +26,7 @@ const slots = defineSlots<{
26
26
  default?: () => any
27
27
  popup?: (props: { hide: () => void }) => any
28
28
  empty?: () => any
29
- [key: string]: ((props?: any) => any) | undefined
29
+ [key: string]: ((props: any) => any) | undefined
30
30
  }>()
31
31
 
32
32
  const T = useTranslations('components.ui.Dropdown')
@@ -116,7 +116,7 @@ onBeforeUnmount(() => {
116
116
 
117
117
  <!-- Default menu dropdown -->
118
118
  <MenuItems
119
- v-else-if="menus.length"
119
+ v-else-if="menus?.length"
120
120
  :menus="menus"
121
121
  />
122
122
 
@@ -4,7 +4,6 @@ import { useEventListener } from '@vueuse/core'
4
4
 
5
5
  const props = withDefaults(defineProps<InfiniteDataTableProps<TData>>(), {
6
6
  columns: () => [],
7
- fetchMethod: undefined,
8
7
  autoFetch: true,
9
8
  filters: undefined,
10
9
  pageSize: 30,
@@ -20,7 +19,7 @@ const emit = defineEmits<{
20
19
  defineSlots<{
21
20
  footer?: () => any
22
21
  bodyEnd?: () => any
23
- [key: string]: ((props?: any) => any) | undefined
22
+ [key: string]: ((props: any) => any) | undefined
24
23
  }>()
25
24
 
26
25
  const { t } = useI18n()
@@ -100,7 +99,6 @@ function resetState () {
100
99
  // -- Loading --
101
100
 
102
101
  async function loadMore () {
103
- if (!props.fetchMethod) return
104
102
  if (loading.value || !hasMore.value) return
105
103
 
106
104
  // Calling loadMore is the retry path; the IntersectionChecker is hidden
@@ -18,10 +18,10 @@ export interface InfiniteDataTableFetchResult<T = Record<string, any>> {
18
18
  }
19
19
 
20
20
  export interface InfiniteDataTableProps<T = Record<string, any>> {
21
+ /** Async function to fetch a page of rows */
22
+ fetchMethod: (params: InfiniteDataTableFetchParams) => Promise<InfiniteDataTableFetchResult<T>>
21
23
  /** Column definitions */
22
24
  columns?: DataTableColumn[]
23
- /** Async function to fetch a page of rows */
24
- fetchMethod?: (params: InfiniteDataTableFetchParams) => Promise<InfiniteDataTableFetchResult<T>>
25
25
  /** Whether to fetch the first page on mount (default: true) */
26
26
  autoFetch?: boolean
27
27
  /** External filter state — changing this resets and reloads */
@@ -28,7 +28,7 @@ const emit = defineEmits<{
28
28
 
29
29
  defineSlots<{
30
30
  toolbar?: () => any
31
- [key: string]: ((props?: any) => any) | undefined
31
+ [key: string]: ((props: any) => any) | undefined
32
32
  }>()
33
33
 
34
34
  const T = useTranslations('components.ui.StaticDataTable')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bjj/nuxt-layer-shadcn-ui",
3
- "version": "0.11.8",
3
+ "version": "0.11.10",
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": "6c93065163612f8b07a290db5e793e3fd651a6cf"
45
+ "gitHead": "a4211b0981d194c33509a377b05ee3901783ee91"
46
46
  }