nuxt-ui-tools 1.16.8 → 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 +1 -1
- package/dist/runtime/form/components/renderer/form-field-renderer.vue +2 -1
- package/dist/runtime/form/components/root/form.vue +7 -1
- package/dist/runtime/shared/types/query.d.ts +4 -3
- package/dist/runtime/table/composables/use-table-data.js +3 -2
- package/dist/runtime/table/composables/use-table-filter-options.js +1 -0
- package/dist/runtime/table/types/source.d.ts +2 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -86,6 +86,7 @@ const controlAttrs = computed(() => {
|
|
|
86
86
|
provideFormFieldBare(bare);
|
|
87
87
|
provideFormFieldControlAttrs(controlAttrs);
|
|
88
88
|
const field = computed(() => createFormFieldInstance(props.field));
|
|
89
|
+
const headless = computed(() => !field.value.capability.has("layout"));
|
|
89
90
|
const path = computed(() => fieldPath(props.parentPath, props.field));
|
|
90
91
|
const childPath = computed(() => childParentPath(props.parentPath, props.field));
|
|
91
92
|
const visible = computed(() => form.shouldRender(props.field, path.value));
|
|
@@ -200,7 +201,7 @@ function resolveControlLabel(controlField) {
|
|
|
200
201
|
</script>
|
|
201
202
|
|
|
202
203
|
<template>
|
|
203
|
-
<template v-if="visible && bare">
|
|
204
|
+
<template v-if="visible && (bare || headless)">
|
|
204
205
|
<component :is="renderer" v-if="renderer" v-bind="rendererProps" />
|
|
205
206
|
<UAlert
|
|
206
207
|
v-else
|
|
@@ -9,6 +9,7 @@ import { useUiToolsLocale } from "#ui-tools/i18n";
|
|
|
9
9
|
import { useFormActions } from "../../composables/use-form-actions";
|
|
10
10
|
import { useFormGridLayout } from "../../composables/use-form-layout";
|
|
11
11
|
import { useFormRoot } from "../../composables/use-form-root";
|
|
12
|
+
import { createFormFieldInstance } from "../../utils/field-instance";
|
|
12
13
|
import { getFormHeader } from "../../utils/overlay";
|
|
13
14
|
import { isRecord } from "../../utils/path";
|
|
14
15
|
import { isFunction, isNumber, isString } from "../../utils/predicate";
|
|
@@ -69,6 +70,11 @@ watch(
|
|
|
69
70
|
const displayedStep = computed(
|
|
70
71
|
() => isSteppedSchema(schemaRef.value) ? getSchemaSteps(schemaRef.value)[displayedStepIndex.value] : void 0
|
|
71
72
|
);
|
|
73
|
+
const skeletonFields = computed(
|
|
74
|
+
() => runtime.currentFields.value.filter(
|
|
75
|
+
(field) => createFormFieldInstance(field).capability.has("layout")
|
|
76
|
+
)
|
|
77
|
+
);
|
|
72
78
|
const displayedFields = computed(
|
|
73
79
|
() => isSteppedSchema(schemaRef.value) ? displayedStep.value?.fields ?? [] : getSchemaFields(schemaRef.value)
|
|
74
80
|
);
|
|
@@ -295,7 +301,7 @@ function getSchemaShowStepper(schema) {
|
|
|
295
301
|
:style="grid.style.value"
|
|
296
302
|
>
|
|
297
303
|
<div
|
|
298
|
-
v-for="field in
|
|
304
|
+
v-for="field in skeletonFields"
|
|
299
305
|
:key="field.key"
|
|
300
306
|
:class="mergeFormUiClass('grid gap-2', formUi.ui.value.root?.ui?.skeletonField)"
|
|
301
307
|
>
|
|
@@ -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`,
|
|
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 (!
|
|
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
|
-
|
|
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.
|
|
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",
|