nuxt-ui-tools 1.22.0 → 1.22.2
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
|
@@ -145,6 +145,19 @@ onBeforeUnmount(() => unregister?.());
|
|
|
145
145
|
v-if="status || page.dirtyCheck.value || $slots.actions"
|
|
146
146
|
:class="mergeFormUiClass('ms-auto -my-1.5 flex items-center gap-2', pageUi?.sectionActions)"
|
|
147
147
|
>
|
|
148
|
+
<slot name="actions" :section />
|
|
149
|
+
<UButton
|
|
150
|
+
v-if="page.dirtyCheck.value"
|
|
151
|
+
type="button"
|
|
152
|
+
color="neutral"
|
|
153
|
+
variant="ghost"
|
|
154
|
+
size="sm"
|
|
155
|
+
icon="i-lucide-rotate-ccw"
|
|
156
|
+
:label="t('form.page.resetSection')"
|
|
157
|
+
:class="mergeFormUiClass(dirty ? void 0 : 'invisible', pageUi?.sectionReset)"
|
|
158
|
+
:data-form-page-reset="dirty ? '' : void 0"
|
|
159
|
+
@click="page.resetSection(section.key)"
|
|
160
|
+
/>
|
|
148
161
|
<UBadge
|
|
149
162
|
v-if="status"
|
|
150
163
|
:color="status.color"
|
|
@@ -160,19 +173,6 @@ onBeforeUnmount(() => unregister?.());
|
|
|
160
173
|
:data-form-page-status="section.status"
|
|
161
174
|
:data-form-page-optional="section.status === 'optional' ? '' : void 0"
|
|
162
175
|
/>
|
|
163
|
-
<slot name="actions" :section />
|
|
164
|
-
<UButton
|
|
165
|
-
v-if="page.dirtyCheck.value"
|
|
166
|
-
type="button"
|
|
167
|
-
color="neutral"
|
|
168
|
-
variant="ghost"
|
|
169
|
-
size="sm"
|
|
170
|
-
icon="i-lucide-rotate-ccw"
|
|
171
|
-
:label="t('form.page.resetSection')"
|
|
172
|
-
:class="mergeFormUiClass(dirty ? void 0 : 'invisible', pageUi?.sectionReset)"
|
|
173
|
-
:data-form-page-reset="dirty ? '' : void 0"
|
|
174
|
-
@click="page.resetSection(section.key)"
|
|
175
|
-
/>
|
|
176
176
|
</div>
|
|
177
177
|
</header>
|
|
178
178
|
<div
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
keepPreviousData,
|
|
3
|
+
useInfiniteQuery,
|
|
4
|
+
useQueries,
|
|
5
|
+
useQuery,
|
|
6
|
+
useQueryClient
|
|
7
|
+
} from "@tanstack/vue-query";
|
|
2
8
|
import { computed, readonly, ref, shallowRef, watch } from "vue";
|
|
3
9
|
import { isArray, isFunction, isNumber, isObject, isString } from "../../shared/utils/predicate.js";
|
|
4
10
|
import { QUERY_DEFAULTS } from "../constants/query-state.js";
|
|
@@ -95,22 +101,35 @@ export function useTableData(params) {
|
|
|
95
101
|
const searchParams = requestContext;
|
|
96
102
|
const dataStaleTime = computed(() => QUERY_DEFAULTS.staleTime.data);
|
|
97
103
|
const isCursorPagination = computed(() => requestPagination.value.mode === "cursor");
|
|
104
|
+
const sourceDefinition = computed(
|
|
105
|
+
() => resolveSourceDefinition({
|
|
106
|
+
context: contextData.value,
|
|
107
|
+
request: requestContext.value,
|
|
108
|
+
sourceRequest: sourceRequest.value,
|
|
109
|
+
source: params.schema.value.source
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
const cachedSourceKey = isCursorPagination.value ? createTableCursorQueryKey(
|
|
113
|
+
sourceDefinition.value.queryKey,
|
|
114
|
+
params.state.queryState.paginationRevision.value
|
|
115
|
+
) : sourceDefinition.value.queryKey;
|
|
116
|
+
if (isQueryDefinitionEnabled(sourceDefinition.value) && useQueryClient().getQueryData(cachedSourceKey) !== void 0) {
|
|
117
|
+
params.startup.start();
|
|
118
|
+
}
|
|
98
119
|
const query = useQuery(
|
|
99
120
|
computed(() => {
|
|
100
|
-
const definition = resolveSourceDefinition({
|
|
101
|
-
context: contextData.value,
|
|
102
|
-
request: requestContext.value,
|
|
103
|
-
sourceRequest: sourceRequest.value,
|
|
104
|
-
source: params.schema.value.source
|
|
105
|
-
});
|
|
106
121
|
if (isCursorPagination.value) {
|
|
107
122
|
return disabledQueryDefinition("cursor");
|
|
108
123
|
}
|
|
109
|
-
return withEnabled(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
124
|
+
return withEnabled(
|
|
125
|
+
sourceDefinition.value,
|
|
126
|
+
params.startup.isActive.value && isContextReady.value,
|
|
127
|
+
{
|
|
128
|
+
placeholderData: keepPreviousData,
|
|
129
|
+
refetchOnWindowFocus: QUERY_DEFAULTS.refetchOnWindowFocus,
|
|
130
|
+
staleTime: dataStaleTime.value
|
|
131
|
+
}
|
|
132
|
+
);
|
|
114
133
|
})
|
|
115
134
|
);
|
|
116
135
|
const infiniteQuery = useInfiniteQuery(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-ui-tools",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.2",
|
|
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",
|