nuxt-ui-tools 1.16.9 → 1.16.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.
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "configKey": "nuxtUiTools",
6
6
  "docs": "https://ui.nuxt.com/docs/getting-started/installation/nuxt",
7
7
  "name": "nuxt-ui-tools",
8
- "version": "1.16.9",
8
+ "version": "1.16.10",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "1.0.3",
11
11
  "unbuild": "unknown"
@@ -1,13 +1,14 @@
1
- import type { DataTag, QueryFunction, QueryKey, UseQueryOptions } from '@tanstack/vue-query';
1
+ import type { DataTag, QueryFunction, QueryKey, QueryMeta, UseQueryOptions } from '@tanstack/vue-query';
2
2
  import type { UnwrapRef } from 'vue';
3
3
  /**
4
4
  * TanStack query definition accepted by runtime domains that own the `useQuery` call themselves
5
- * (table sources, dashboard queries): an explicit `queryKey`, an optional `queryFn`, and any other
6
- * query option.
5
+ * (table sources, dashboard queries): an explicit `queryKey`, an optional `queryFn`, the `meta`
6
+ * that every derived table query carries over, and any other query option.
7
7
  */
8
8
  export type QueryDefinition<TData = unknown> = Omit<UseQueryOptions<TData>, 'queryFn'> & {
9
9
  queryKey: QueryKey;
10
10
  queryFn?: QueryFunction<TData, QueryKey, string | null>;
11
+ meta?: QueryMeta;
11
12
  };
12
13
  /**
13
14
  * The smallest query definition: a key and the function that fetches it. Covariant in its data, so
@@ -289,7 +289,7 @@ export function useTableData(params) {
289
289
  ...result
290
290
  })),
291
291
  queries: () => {
292
- if (!isPageContextEnabled.value) {
292
+ if (!isActiveDataSuccess.value) {
293
293
  return [];
294
294
  }
295
295
  return pageContextItems.value.map(
@@ -298,7 +298,7 @@ export function useTableData(params) {
298
298
  context: contextData.value,
299
299
  rows: data.value.rows
300
300
  }),
301
- true,
301
+ isPageContextEnabled.value,
302
302
  {
303
303
  refetchOnWindowFocus: QUERY_DEFAULTS.refetchOnWindowFocus,
304
304
  staleTime: QUERY_DEFAULTS.staleTime.context
@@ -606,6 +606,7 @@ function createCursorQueryDefinition(options) {
606
606
  }
607
607
  return {
608
608
  enabled: isQueryDefinitionEnabled(firstPageDefinition),
609
+ meta: firstPageDefinition.meta,
609
610
  getNextPageParam(lastPage) {
610
611
  return isTableCursorPageResult(lastPage) ? lastPage.pageInfo.nextCursor ?? void 0 : void 0;
611
612
  },
@@ -233,6 +233,7 @@ export function useTableFilterOptions(options) {
233
233
  });
234
234
  return { result, values };
235
235
  },
236
+ meta: definition.meta,
236
237
  queryKey: ["table-filter-page-facets", ...definition.queryKey],
237
238
  refetchOnWindowFocus: QUERY_DEFAULTS.refetchOnWindowFocus,
238
239
  staleTime: QUERY_DEFAULTS.staleTime.filterOptions
@@ -1,4 +1,4 @@
1
- import type { InfiniteData, QueryFunction, QueryKey, UseQueryOptions } from '@tanstack/vue-query';
1
+ import type { InfiniteData, QueryFunction, QueryKey, QueryMeta, UseQueryOptions } from '@tanstack/vue-query';
2
2
  import type { QueryDefinition } from '../../shared/types/query.js';
3
3
  import type { TableResolvedFilterGroup } from './filters.js';
4
4
  import type { GenericObject, TableKnownFieldPath, TablePaginationState, TableSortKey, TableSortingRule, TableRowsFromSourceResult } from './utils.js';
@@ -19,6 +19,7 @@ export interface TableInfiniteQueryDefinition<TData = unknown> {
19
19
  initialPageParam: string | null;
20
20
  getNextPageParam: (lastPage: TData, allPages: TData[], lastPageParam: string | null, allPageParams: (string | null)[]) => string | null | undefined;
21
21
  enabled?: boolean;
22
+ meta?: QueryMeta;
22
23
  staleTime?: number;
23
24
  gcTime?: number;
24
25
  refetchOnWindowFocus?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-ui-tools",
3
- "version": "1.16.9",
3
+ "version": "1.16.10",
4
4
  "description": "Nuxt module and runtime toolkit for UI-heavy Nuxt applications",
5
5
  "homepage": "https://github.com/ChronicStone/nuxt-ui-tools#readme",
6
6
  "bugs": "https://github.com/ChronicStone/nuxt-ui-tools/issues",