@verikit/vue 0.24.3 → 0.25.0
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/README.md +5 -1
- package/dist/components/combobox.d.ts +163 -0
- package/dist/components/combobox.d.ts.map +1 -0
- package/dist/components/combobox.js +179 -0
- package/dist/layout/render-schema-node.d.ts.map +1 -1
- package/dist/layout/render-schema-node.js +6 -3
- package/dist/layout/types.d.ts +5 -0
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/query/use-resource-table.d.ts +7 -2
- package/dist/query/use-resource-table.d.ts.map +1 -1
- package/dist/query/use-resource-table.js +27 -8
- package/dist/relationships/belongs-to-field.d.ts +39 -2
- package/dist/relationships/belongs-to-field.d.ts.map +1 -1
- package/dist/relationships/belongs-to-field.js +92 -41
- package/dist/relationships/use-relationship-picker.d.ts +41 -0
- package/dist/relationships/use-relationship-picker.d.ts.map +1 -0
- package/dist/relationships/use-relationship-picker.js +92 -0
- package/dist/resource/resource-detail.d.ts +41 -2
- package/dist/resource/resource-detail.d.ts.map +1 -1
- package/dist/resource/resource-detail.js +65 -20
- package/dist/resource/resource-form.d.ts.map +1 -1
- package/dist/resource/resource-form.js +1 -0
- package/dist/resource/resource-table.d.ts +46 -0
- package/dist/resource/resource-table.d.ts.map +1 -1
- package/dist/resource/resource-table.js +65 -8
- package/package.json +23 -13
- package/tailwind-sources.css +3 -0
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import { defineComponent, h } from "vue";
|
|
1
|
+
import { defineComponent, h, ref } from "vue";
|
|
2
|
+
import { Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, } from "#components/combobox";
|
|
2
3
|
import { Label } from "#components/label";
|
|
3
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "#components/select";
|
|
4
4
|
import { cn } from "#lib/utils";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const RELATIONSHIP_PICKER_PAGE_SIZE = 100;
|
|
9
|
-
function recordId(record) {
|
|
10
|
-
return String(record.id);
|
|
11
|
-
}
|
|
12
|
-
function recordLabel(record, displayField) {
|
|
13
|
-
const raw = displayField ? record[displayField] : undefined;
|
|
14
|
-
return raw === null || raw === undefined ? recordId(record) : String(raw);
|
|
5
|
+
import { useRelationshipPicker } from "./use-relationship-picker.js";
|
|
6
|
+
function valueString(value) {
|
|
7
|
+
return value === null || value === undefined ? "" : String(value);
|
|
15
8
|
}
|
|
16
9
|
/**
|
|
17
|
-
* Renders a `belongsTo` relationship as a permission-aware
|
|
18
|
-
* reading and writing the related record's ID through its `.via()`
|
|
10
|
+
* Renders a `belongsTo` relationship as a permission-aware, searchable
|
|
11
|
+
* combobox, reading and writing the related record's ID through its `.via()`
|
|
12
|
+
* field. Typing searches the server (the target's `displayField` and
|
|
13
|
+
* `.searchable()` fields), options load 25 at a time with "Load more", and the
|
|
14
|
+
* selected record's label is shown even when it isn't among the loaded
|
|
15
|
+
* options.
|
|
19
16
|
*/
|
|
20
17
|
export const BelongsToRelationshipField = defineComponent({
|
|
21
18
|
name: "BelongsToRelationshipField",
|
|
@@ -24,79 +21,133 @@ export const BelongsToRelationshipField = defineComponent({
|
|
|
24
21
|
type: Object,
|
|
25
22
|
required: true,
|
|
26
23
|
},
|
|
24
|
+
/**
|
|
25
|
+
* Name of the resource that owns the relationship (the one being edited).
|
|
26
|
+
* Options come from its `/relationships/:name` route. Defaults to the
|
|
27
|
+
* target resource, which only matches for a self-referencing relationship.
|
|
28
|
+
*/
|
|
29
|
+
resourceName: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: undefined,
|
|
32
|
+
},
|
|
27
33
|
id: { type: String, default: undefined },
|
|
34
|
+
/** Current foreign-key value (the selected record's id), if any. */
|
|
28
35
|
value: { type: null, required: false },
|
|
36
|
+
/** Error content shown below the picker and linked with ARIA. */
|
|
29
37
|
error: { type: null, required: false },
|
|
38
|
+
/** Disables the picker. */
|
|
30
39
|
disabled: {
|
|
31
40
|
type: Boolean,
|
|
32
41
|
default: undefined,
|
|
33
42
|
},
|
|
43
|
+
/** Marks the picker as read-only. */
|
|
34
44
|
readOnly: {
|
|
35
45
|
type: Boolean,
|
|
36
46
|
default: undefined,
|
|
37
47
|
},
|
|
48
|
+
/** Class name applied to the outer wrapper. */
|
|
38
49
|
className: {
|
|
39
50
|
type: String,
|
|
40
51
|
default: undefined,
|
|
41
52
|
},
|
|
53
|
+
/** Called with the next foreign-key value (or `null` when cleared). */
|
|
42
54
|
onValueChange: {
|
|
43
55
|
type: Function,
|
|
44
56
|
default: undefined,
|
|
45
57
|
},
|
|
58
|
+
/** Called when the picker's input loses focus. */
|
|
46
59
|
onBlur: {
|
|
47
60
|
type: Function,
|
|
48
61
|
default: undefined,
|
|
49
62
|
},
|
|
50
63
|
},
|
|
51
64
|
setup(props) {
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
const
|
|
65
|
+
// While the popup is open the input holds what's typed (the selected
|
|
66
|
+
// record's label stays visible as the placeholder); closed, it shows that
|
|
67
|
+
// label.
|
|
68
|
+
const open = ref(false);
|
|
69
|
+
const search = ref("");
|
|
70
|
+
// Created once in setup: calling composables during render would add
|
|
71
|
+
// watchers on every update.
|
|
72
|
+
const picker = useRelationshipPicker({
|
|
73
|
+
resourceName: props.resourceName ?? props.relationship.resource,
|
|
74
|
+
relationship: props.relationship,
|
|
75
|
+
value: () => valueString(props.value),
|
|
76
|
+
search,
|
|
77
|
+
});
|
|
78
|
+
function handleOpenChange(next) {
|
|
79
|
+
// A read-only picker still opens on arrow keys; keep it shut.
|
|
80
|
+
if (next && props.readOnly === true)
|
|
81
|
+
return;
|
|
82
|
+
open.value = next;
|
|
83
|
+
if (!next)
|
|
84
|
+
search.value = "";
|
|
85
|
+
}
|
|
56
86
|
return () => {
|
|
57
87
|
const inputId = props.id ??
|
|
58
|
-
`verikit-relationship-${props.relationship.resource}-${
|
|
88
|
+
`verikit-relationship-${props.relationship.resource}-${props.relationship.name ?? ""}`;
|
|
59
89
|
const errorId = props.error ? `${inputId}-error` : undefined;
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
: String(props.value);
|
|
90
|
+
const currentValue = valueString(props.value);
|
|
91
|
+
const selectedLabel = currentValue ? picker.labelFor(currentValue) : "";
|
|
92
|
+
const editable = props.disabled !== true && props.readOnly !== true;
|
|
64
93
|
return h("div", { class: cn("grid gap-2", props.className) }, [
|
|
65
94
|
props.relationship.label
|
|
66
95
|
? h(Label, { for: inputId }, { default: () => props.relationship.label })
|
|
67
96
|
: null,
|
|
68
|
-
h(
|
|
69
|
-
|
|
70
|
-
|
|
97
|
+
h(Combobox, {
|
|
98
|
+
value: currentValue === "" ? null : currentValue,
|
|
99
|
+
open: open.value,
|
|
100
|
+
// Options are already searched on the server.
|
|
101
|
+
ignoreFilter: true,
|
|
102
|
+
name: props.relationship.name,
|
|
71
103
|
disabled: props.disabled === true,
|
|
72
|
-
|
|
104
|
+
onOpenChange: handleOpenChange,
|
|
105
|
+
onValueChange: (next) => props.onValueChange?.(next),
|
|
73
106
|
}, {
|
|
74
107
|
default: () => [
|
|
75
|
-
h(
|
|
108
|
+
h(ComboboxInput, {
|
|
76
109
|
id: inputId,
|
|
77
|
-
|
|
110
|
+
value: open.value ? search.value : selectedLabel,
|
|
111
|
+
placeholder: picker.isLoading.value
|
|
112
|
+
? "Loading…"
|
|
113
|
+
: selectedLabel || "Search…",
|
|
114
|
+
showClear: editable && currentValue !== "",
|
|
115
|
+
readOnly: props.readOnly === true,
|
|
116
|
+
onInputValueChange: (text) => {
|
|
117
|
+
search.value = text;
|
|
118
|
+
},
|
|
78
119
|
onBlur: props.onBlur,
|
|
79
120
|
"aria-describedby": errorId,
|
|
80
121
|
"aria-invalid": props.error ? true : undefined,
|
|
81
|
-
}, {
|
|
82
|
-
default: () => h(SelectValue, {
|
|
83
|
-
placeholder: relationshipQuery.isLoading.value
|
|
84
|
-
? "Loading…"
|
|
85
|
-
: "Select…",
|
|
86
|
-
}),
|
|
87
122
|
}),
|
|
88
|
-
h(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
123
|
+
h(ComboboxContent, {}, {
|
|
124
|
+
// Read reactive state inside these slots, not above: Reka's
|
|
125
|
+
// popper content is memoized, so only its own re-renders
|
|
126
|
+
// pick up newly loaded options.
|
|
127
|
+
default: () => [
|
|
128
|
+
h(ComboboxEmpty, {}, {
|
|
129
|
+
default: () => picker.isLoading.value ? "Loading…" : "No matches.",
|
|
130
|
+
}),
|
|
131
|
+
h(ComboboxList, {}, {
|
|
132
|
+
default: () => picker.ids.value.map((optionId) => h(ComboboxItem, { key: optionId, value: optionId }, { default: () => picker.labelFor(optionId) })),
|
|
133
|
+
}),
|
|
134
|
+
picker.hasMore.value
|
|
135
|
+
? h("button", {
|
|
136
|
+
type: "button",
|
|
137
|
+
class: "w-full rounded-md px-1.5 py-1 text-left text-sm text-muted-foreground hover:bg-accent disabled:opacity-50",
|
|
138
|
+
disabled: picker.isLoadingMore.value,
|
|
139
|
+
onClick: picker.loadMore,
|
|
140
|
+
}, picker.isLoadingMore.value ? "Loading…" : "Load more")
|
|
141
|
+
: null,
|
|
142
|
+
],
|
|
92
143
|
}),
|
|
93
144
|
],
|
|
94
145
|
}),
|
|
95
146
|
props.error
|
|
96
147
|
? h("p", { id: errorId, class: "text-sm text-destructive" }, props.error)
|
|
97
148
|
: null,
|
|
98
|
-
|
|
99
|
-
? h("p", { role: "alert", class: "text-sm text-destructive" },
|
|
149
|
+
picker.error.value
|
|
150
|
+
? h("p", { role: "alert", class: "text-sm text-destructive" }, picker.error.value.message)
|
|
100
151
|
: null,
|
|
101
152
|
]);
|
|
102
153
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { BelongsToRelationshipSchema } from "@verikit/core";
|
|
2
|
+
import { type ComputedRef, type MaybeRefOrGetter } from "vue";
|
|
3
|
+
/** Records fetched per page as the picker's list is scrolled through. */
|
|
4
|
+
export declare const RELATIONSHIP_PICKER_PAGE_SIZE = 25;
|
|
5
|
+
/** How long the picker waits after the last keystroke before searching. */
|
|
6
|
+
export declare const RELATIONSHIP_SEARCH_DEBOUNCE_MS = 250;
|
|
7
|
+
type PickerRecord = Record<string, unknown>;
|
|
8
|
+
/** A record's label: its `displayField` value, or its id when that's empty. */
|
|
9
|
+
export declare function relationshipRecordLabel(record: PickerRecord, displayField: string | undefined): string;
|
|
10
|
+
/** Options for {@link useRelationshipPicker}. */
|
|
11
|
+
export interface UseRelationshipPickerOptions {
|
|
12
|
+
/** Resource that owns the relationship; options come from its picker route. */
|
|
13
|
+
resourceName: string;
|
|
14
|
+
relationship: BelongsToRelationshipSchema;
|
|
15
|
+
/** The selected record's id, or `""` for none. */
|
|
16
|
+
value: MaybeRefOrGetter<string>;
|
|
17
|
+
/** The text typed into the picker, searched after a short pause. */
|
|
18
|
+
search: MaybeRefOrGetter<string>;
|
|
19
|
+
}
|
|
20
|
+
/** State returned by {@link useRelationshipPicker}. */
|
|
21
|
+
export interface UseRelationshipPickerResult {
|
|
22
|
+
/** Ids of the loaded options, in server order. */
|
|
23
|
+
ids: ComputedRef<string[]>;
|
|
24
|
+
/** Label for an id: loaded, or looked up for the selected value. */
|
|
25
|
+
labelFor: (id: string) => string;
|
|
26
|
+
isLoading: ComputedRef<boolean>;
|
|
27
|
+
error: ComputedRef<Error | null>;
|
|
28
|
+
/** True when the server has more matching records than are loaded. */
|
|
29
|
+
hasMore: ComputedRef<boolean>;
|
|
30
|
+
isLoadingMore: ComputedRef<boolean>;
|
|
31
|
+
loadMore: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Loads a `belongsTo` picker's options from the server: searched by what's
|
|
35
|
+
* typed (the server searches the target's `displayField` and `.searchable()`
|
|
36
|
+
* fields), a page at a time. When the selected record isn't among the loaded
|
|
37
|
+
* options, it is fetched by id so its label can still be shown.
|
|
38
|
+
*/
|
|
39
|
+
export declare function useRelationshipPicker({ resourceName, relationship, value, search, }: UseRelationshipPickerOptions): UseRelationshipPickerResult;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=use-relationship-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-relationship-picker.d.ts","sourceRoot":"","sources":["../../src/relationships/use-relationship-picker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EAEtB,MAAM,KAAK,CAAC;AAGb,yEAAyE;AACzE,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,2EAA2E;AAC3E,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAyB5C,+EAA+E;AAC/E,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,MAAM,CAIR;AAED,iDAAiD;AACjD,MAAM,WAAW,4BAA4B;IAC3C,+EAA+E;IAC/E,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,2BAA2B,CAAC;IAC1C,kDAAkD;IAClD,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,oEAAoE;IACpE,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,uDAAuD;AACvD,MAAM,WAAW,2BAA2B;IAC1C,kDAAkD;IAClD,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IACjC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC,KAAK,EAAE,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IACjC,sEAAsE;IACtE,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B,aAAa,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,MAAM,GACP,EAAE,4BAA4B,GAAG,2BAA2B,CAyF5D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useInfiniteQuery, useQuery } from "@tanstack/vue-query";
|
|
2
|
+
import { resourceQueryKeys } from "@verikit/ui-core/query/query-keys";
|
|
3
|
+
import { computed, ref, toValue, watch, } from "vue";
|
|
4
|
+
import { useVerikitClient } from "../client/use-verikit-client.js";
|
|
5
|
+
/** Records fetched per page as the picker's list is scrolled through. */
|
|
6
|
+
export const RELATIONSHIP_PICKER_PAGE_SIZE = 25;
|
|
7
|
+
/** How long the picker waits after the last keystroke before searching. */
|
|
8
|
+
export const RELATIONSHIP_SEARCH_DEBOUNCE_MS = 250;
|
|
9
|
+
function useDebouncedValue(source, delay) {
|
|
10
|
+
const debounced = ref(toValue(source));
|
|
11
|
+
watch(() => toValue(source), (value, _previous, onCleanup) => {
|
|
12
|
+
const timer = setTimeout(() => {
|
|
13
|
+
debounced.value = value;
|
|
14
|
+
}, delay);
|
|
15
|
+
onCleanup(() => clearTimeout(timer));
|
|
16
|
+
});
|
|
17
|
+
return debounced;
|
|
18
|
+
}
|
|
19
|
+
function recordId(record) {
|
|
20
|
+
return String(record.id);
|
|
21
|
+
}
|
|
22
|
+
/** A record's label: its `displayField` value, or its id when that's empty. */
|
|
23
|
+
export function relationshipRecordLabel(record, displayField) {
|
|
24
|
+
const raw = displayField ? record[displayField] : undefined;
|
|
25
|
+
return raw === null || raw === undefined ? recordId(record) : String(raw);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Loads a `belongsTo` picker's options from the server: searched by what's
|
|
29
|
+
* typed (the server searches the target's `displayField` and `.searchable()`
|
|
30
|
+
* fields), a page at a time. When the selected record isn't among the loaded
|
|
31
|
+
* options, it is fetched by id so its label can still be shown.
|
|
32
|
+
*/
|
|
33
|
+
export function useRelationshipPicker({ resourceName, relationship, value, search, }) {
|
|
34
|
+
const client = useVerikitClient();
|
|
35
|
+
const keys = resourceQueryKeys(resourceName, client);
|
|
36
|
+
const relationshipName = relationship.name ?? "";
|
|
37
|
+
const enabled = relationshipName.length > 0;
|
|
38
|
+
const term = useDebouncedValue(() => toValue(search).trim(), RELATIONSHIP_SEARCH_DEBOUNCE_MS);
|
|
39
|
+
const params = computed(() => ({
|
|
40
|
+
pageSize: RELATIONSHIP_PICKER_PAGE_SIZE,
|
|
41
|
+
...(term.value && { search: term.value }),
|
|
42
|
+
}));
|
|
43
|
+
const pages = useInfiniteQuery({
|
|
44
|
+
queryKey: computed(() => keys.relationshipPages(relationshipName, params.value)),
|
|
45
|
+
queryFn: ({ pageParam, signal }) => client
|
|
46
|
+
.resource(resourceName)
|
|
47
|
+
.relationship(relationshipName, { ...params.value, page: pageParam }, { signal }),
|
|
48
|
+
initialPageParam: 1,
|
|
49
|
+
getNextPageParam: (last, all) => all.reduce((count, page) => count + page.records.length, 0) <
|
|
50
|
+
last.total && last.records.length > 0
|
|
51
|
+
? last.page + 1
|
|
52
|
+
: undefined,
|
|
53
|
+
enabled,
|
|
54
|
+
});
|
|
55
|
+
const records = computed(() => pages.data.value?.pages.flatMap((page) => page.records) ?? []);
|
|
56
|
+
const loaded = computed(() => records.value.some((record) => recordId(record) === toValue(value)));
|
|
57
|
+
const selectedParams = computed(() => ({
|
|
58
|
+
ids: [toValue(value)],
|
|
59
|
+
pageSize: 1,
|
|
60
|
+
}));
|
|
61
|
+
const selected = useQuery({
|
|
62
|
+
queryKey: computed(() => keys.relationship(relationshipName, selectedParams.value)),
|
|
63
|
+
queryFn: ({ signal }) => client
|
|
64
|
+
.resource(resourceName)
|
|
65
|
+
.relationship(relationshipName, selectedParams.value, {
|
|
66
|
+
signal,
|
|
67
|
+
}),
|
|
68
|
+
enabled: computed(() => enabled &&
|
|
69
|
+
toValue(value) !== "" &&
|
|
70
|
+
!loaded.value &&
|
|
71
|
+
pages.isSuccess.value),
|
|
72
|
+
});
|
|
73
|
+
const labels = computed(() => {
|
|
74
|
+
const map = new Map();
|
|
75
|
+
for (const record of [
|
|
76
|
+
...(selected.data.value?.records ?? []),
|
|
77
|
+
...records.value,
|
|
78
|
+
]) {
|
|
79
|
+
map.set(recordId(record), relationshipRecordLabel(record, relationship.displayField));
|
|
80
|
+
}
|
|
81
|
+
return map;
|
|
82
|
+
});
|
|
83
|
+
return {
|
|
84
|
+
ids: computed(() => [...new Set(records.value.map(recordId))]),
|
|
85
|
+
labelFor: (id) => labels.value.get(id) ?? id,
|
|
86
|
+
isLoading: computed(() => pages.isLoading.value),
|
|
87
|
+
error: computed(() => pages.error.value),
|
|
88
|
+
hasMore: computed(() => pages.hasNextPage.value),
|
|
89
|
+
isLoadingMore: computed(() => pages.isFetchingNextPage.value),
|
|
90
|
+
loadMore: () => void pages.fetchNextPage(),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
@@ -8,9 +8,21 @@ export interface ResourceDetailProps {
|
|
|
8
8
|
/** Id of the record to show. */
|
|
9
9
|
id: string;
|
|
10
10
|
/**
|
|
11
|
-
* Renders the built-in Edit
|
|
11
|
+
* Renders the built-in Edit and Delete actions, and the default for `editAction`, `deleteAction`, and `resourceActions`.
|
|
12
12
|
*/
|
|
13
13
|
actions?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Renders the built-in Edit action, which opens a `ResourceForm` dialog pre-filled from the record. Hidden when the server reports the actor can't update the record, or when an update is denied (403 or 404) for the rest of this component's lifetime. Defaults to `actions`.
|
|
16
|
+
*/
|
|
17
|
+
editAction?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Renders the built-in Delete action, which opens a confirmation dialog. Hidden when the server reports the actor can't delete the record, or when a delete is denied (403 or 404) for the rest of this component's lifetime. Defaults to `actions`.
|
|
20
|
+
*/
|
|
21
|
+
deleteAction?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Replaces the built-in edit dialog: the Edit action calls this with the record instead (for example, to navigate to an edit page). Edit is still hidden when the server reports the actor can't update the record. Bind it as a prop (`:on-edit`) or a listener (`@edit`).
|
|
24
|
+
*/
|
|
25
|
+
onEdit?: (record: DetailRecord) => void;
|
|
14
26
|
/**
|
|
15
27
|
* Renders the record-scoped actions declared on the resource via `defineResource({ actions })`. The page asks the server which of them the actor can't run on this record: those it may not run are hidden, and those that can't run right now are disabled, with the reason as a tooltip. An action denied when run (403 or 404) is hidden for the rest of this component's lifetime. Defaults to `actions`.
|
|
16
28
|
*/
|
|
@@ -25,7 +37,7 @@ export interface ResourceDetailProps {
|
|
|
25
37
|
className?: string;
|
|
26
38
|
}
|
|
27
39
|
/**
|
|
28
|
-
* Shows one record's fields as a label/value list, with its actions: the built-in Edit and Delete, and the record-scoped actions declared on the resource. Fields marked `.hidden()`, or left out by the server because the actor can't read them, aren't shown. A record the actor can't read shows as not found, as the server doesn't reveal whether it exists.
|
|
40
|
+
* Shows one record's fields as a label/value list, with its actions: the built-in Edit and Delete, and the record-scoped actions declared on the resource. Edit and Delete are hidden up front when the server reports the actor can't update or delete the record. Fields marked `.hidden()`, or left out by the server because the actor can't read them, aren't shown. A `belongsTo` relationship is shown in place of its foreign-key field, as the related record's `displayField` (or the raw key when the actor can't read that). A record the actor can't read shows as not found, as the server doesn't reveal whether it exists.
|
|
29
41
|
*/
|
|
30
42
|
export declare const ResourceDetail: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
31
43
|
resource: {
|
|
@@ -40,6 +52,14 @@ export declare const ResourceDetail: import("vue").DefineComponent<import("vue")
|
|
|
40
52
|
type: BooleanConstructor;
|
|
41
53
|
default: boolean;
|
|
42
54
|
};
|
|
55
|
+
editAction: {
|
|
56
|
+
type: PropType<boolean | undefined>;
|
|
57
|
+
default: undefined;
|
|
58
|
+
};
|
|
59
|
+
deleteAction: {
|
|
60
|
+
type: PropType<boolean | undefined>;
|
|
61
|
+
default: undefined;
|
|
62
|
+
};
|
|
43
63
|
resourceActions: {
|
|
44
64
|
type: PropType<boolean | undefined>;
|
|
45
65
|
default: undefined;
|
|
@@ -48,6 +68,10 @@ export declare const ResourceDetail: import("vue").DefineComponent<import("vue")
|
|
|
48
68
|
type: PropType<ResourceDetailProps["renderActions"]>;
|
|
49
69
|
default: undefined;
|
|
50
70
|
};
|
|
71
|
+
onEdit: {
|
|
72
|
+
type: PropType<ResourceDetailProps["onEdit"]>;
|
|
73
|
+
default: undefined;
|
|
74
|
+
};
|
|
51
75
|
onDeleted: {
|
|
52
76
|
type: PropType<ResourceDetailProps["onDeleted"]>;
|
|
53
77
|
default: undefined;
|
|
@@ -71,6 +95,14 @@ export declare const ResourceDetail: import("vue").DefineComponent<import("vue")
|
|
|
71
95
|
type: BooleanConstructor;
|
|
72
96
|
default: boolean;
|
|
73
97
|
};
|
|
98
|
+
editAction: {
|
|
99
|
+
type: PropType<boolean | undefined>;
|
|
100
|
+
default: undefined;
|
|
101
|
+
};
|
|
102
|
+
deleteAction: {
|
|
103
|
+
type: PropType<boolean | undefined>;
|
|
104
|
+
default: undefined;
|
|
105
|
+
};
|
|
74
106
|
resourceActions: {
|
|
75
107
|
type: PropType<boolean | undefined>;
|
|
76
108
|
default: undefined;
|
|
@@ -79,6 +111,10 @@ export declare const ResourceDetail: import("vue").DefineComponent<import("vue")
|
|
|
79
111
|
type: PropType<ResourceDetailProps["renderActions"]>;
|
|
80
112
|
default: undefined;
|
|
81
113
|
};
|
|
114
|
+
onEdit: {
|
|
115
|
+
type: PropType<ResourceDetailProps["onEdit"]>;
|
|
116
|
+
default: undefined;
|
|
117
|
+
};
|
|
82
118
|
onDeleted: {
|
|
83
119
|
type: PropType<ResourceDetailProps["onDeleted"]>;
|
|
84
120
|
default: undefined;
|
|
@@ -91,7 +127,10 @@ export declare const ResourceDetail: import("vue").DefineComponent<import("vue")
|
|
|
91
127
|
className: string | undefined;
|
|
92
128
|
actions: boolean;
|
|
93
129
|
renderActions: ((record: DetailRecord) => VNodeChild) | undefined;
|
|
130
|
+
onEdit: ((record: DetailRecord) => void) | undefined;
|
|
94
131
|
onDeleted: ((record: DetailRecord) => void) | undefined;
|
|
132
|
+
editAction: boolean | undefined;
|
|
133
|
+
deleteAction: boolean | undefined;
|
|
95
134
|
resourceActions: boolean | undefined;
|
|
96
135
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
97
136
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-detail.d.ts","sourceRoot":"","sources":["../../src/resource/resource-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAa9E,OAAO,KAAK,EAAoB,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"resource-detail.d.ts","sourceRoot":"","sources":["../../src/resource/resource-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAa9E,OAAO,KAAK,EAAoB,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAqBhF,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5C,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,QAAQ,EAAE,QAAQ,GAAG,cAAc,CAAC;IACpC,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,MA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B,YAAY,KAAK,UAAU;sBANlC,YAAY,KAAK,IAAI;yBAUlB,YAAY,KAAK,IAAI;;;;4EAya1C,CAAC"}
|
|
@@ -4,15 +4,15 @@ import { Button } from "#components/button";
|
|
|
4
4
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "#components/dialog";
|
|
5
5
|
import { cn } from "#lib/utils";
|
|
6
6
|
import { actionNeedsDialog, resourceActionSchemas, } from "@verikit/ui-core/actions/resource-actions";
|
|
7
|
-
import { resolveVerikitFields } from "@verikit/ui-core/form/resolve-fields";
|
|
8
7
|
import { formatFieldValue } from "@verikit/ui-core/layout/format-value";
|
|
8
|
+
import { relationshipCellText, resourceColumnSpecs, } from "@verikit/ui-core/layout/table-columns";
|
|
9
9
|
import { useDeleteResource } from "../query/use-resource-mutations.js";
|
|
10
10
|
import { useResourceFindWithActions } from "../query/use-resource-queries.js";
|
|
11
11
|
import { declaredActionButton } from "./declared-action-button.js";
|
|
12
|
-
import { hasStatus, isActionDenied,
|
|
12
|
+
import { hasStatus, isActionDenied, ResourceActionDialog, useRunResourceAction, } from "./resource-action-dialog.js";
|
|
13
13
|
import { ResourceForm } from "./resource-form.js";
|
|
14
14
|
/**
|
|
15
|
-
* Shows one record's fields as a label/value list, with its actions: the built-in Edit and Delete, and the record-scoped actions declared on the resource. Fields marked `.hidden()`, or left out by the server because the actor can't read them, aren't shown. A record the actor can't read shows as not found, as the server doesn't reveal whether it exists.
|
|
15
|
+
* Shows one record's fields as a label/value list, with its actions: the built-in Edit and Delete, and the record-scoped actions declared on the resource. Edit and Delete are hidden up front when the server reports the actor can't update or delete the record. Fields marked `.hidden()`, or left out by the server because the actor can't read them, aren't shown. A `belongsTo` relationship is shown in place of its foreign-key field, as the related record's `displayField` (or the raw key when the actor can't read that). A record the actor can't read shows as not found, as the server doesn't reveal whether it exists.
|
|
16
16
|
*/
|
|
17
17
|
export const ResourceDetail = defineComponent({
|
|
18
18
|
name: "ResourceDetail",
|
|
@@ -23,6 +23,14 @@ export const ResourceDetail = defineComponent({
|
|
|
23
23
|
},
|
|
24
24
|
id: { type: String, required: true },
|
|
25
25
|
actions: { type: Boolean, default: false },
|
|
26
|
+
editAction: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: undefined,
|
|
29
|
+
},
|
|
30
|
+
deleteAction: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: undefined,
|
|
33
|
+
},
|
|
26
34
|
resourceActions: {
|
|
27
35
|
type: Boolean,
|
|
28
36
|
default: undefined,
|
|
@@ -31,6 +39,12 @@ export const ResourceDetail = defineComponent({
|
|
|
31
39
|
type: Function,
|
|
32
40
|
default: undefined,
|
|
33
41
|
},
|
|
42
|
+
// A prop rather than an emit, so the page can tell whether a parent
|
|
43
|
+
// handles it and skip its built-in dialog; `@edit` still binds here.
|
|
44
|
+
onEdit: {
|
|
45
|
+
type: Function,
|
|
46
|
+
default: undefined,
|
|
47
|
+
},
|
|
34
48
|
onDeleted: {
|
|
35
49
|
type: Function,
|
|
36
50
|
default: undefined,
|
|
@@ -43,7 +57,7 @@ export const ResourceDetail = defineComponent({
|
|
|
43
57
|
setup(props) {
|
|
44
58
|
const deleted = ref(false);
|
|
45
59
|
const query = useResourceFindWithActions(props.resource.name, () => props.id, { enabled: () => !deleted.value });
|
|
46
|
-
const
|
|
60
|
+
const rows = resourceColumnSpecs(props.resource, { view: "detail" });
|
|
47
61
|
const recordActions = (props.resourceActions ?? props.actions)
|
|
48
62
|
? resourceActionSchemas(props.resource, "record")
|
|
49
63
|
: [];
|
|
@@ -81,7 +95,9 @@ export const ResourceDetail = defineComponent({
|
|
|
81
95
|
}
|
|
82
96
|
const deleteMutation = useDeleteResource(props.resource.name, {
|
|
83
97
|
onError: (mutationError) => {
|
|
84
|
-
|
|
98
|
+
// The server answers a denied delete with 404 so as not to reveal
|
|
99
|
+
// whether the record exists, the same as a denied record action.
|
|
100
|
+
if (isActionDenied(mutationError, props.id)) {
|
|
85
101
|
deniedDelete.value = true;
|
|
86
102
|
deleteOpen.value = false;
|
|
87
103
|
}
|
|
@@ -98,7 +114,7 @@ export const ResourceDetail = defineComponent({
|
|
|
98
114
|
class: cn("text-sm text-muted-foreground", props.className),
|
|
99
115
|
}, message);
|
|
100
116
|
}
|
|
101
|
-
function actionBar(record) {
|
|
117
|
+
function actionBar(record, showEdit, showDelete) {
|
|
102
118
|
const unavailable = query.data.value.actions;
|
|
103
119
|
return h("div", { class: "flex flex-wrap items-center justify-end gap-2 pb-3" }, [
|
|
104
120
|
...recordActions.map((action) => deniedActions.value[action.name]
|
|
@@ -110,17 +126,22 @@ export const ResourceDetail = defineComponent({
|
|
|
110
126
|
disabled: directAction.isPending.value,
|
|
111
127
|
onClick: () => startAction(action),
|
|
112
128
|
})),
|
|
113
|
-
|
|
129
|
+
showEdit
|
|
114
130
|
? h(Button, {
|
|
115
131
|
type: "button",
|
|
116
132
|
variant: "outline",
|
|
117
133
|
size: "sm",
|
|
118
134
|
onClick: () => {
|
|
119
|
-
|
|
135
|
+
if (props.onEdit) {
|
|
136
|
+
props.onEdit(record);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
editOpen.value = true;
|
|
140
|
+
}
|
|
120
141
|
},
|
|
121
142
|
}, { default: () => [h(PencilIcon), "Edit"] })
|
|
122
143
|
: null,
|
|
123
|
-
|
|
144
|
+
showDelete
|
|
124
145
|
? h(Button, {
|
|
125
146
|
type: "button",
|
|
126
147
|
variant: "outline",
|
|
@@ -154,7 +175,7 @@ export const ResourceDetail = defineComponent({
|
|
|
154
175
|
editOpen.value = false;
|
|
155
176
|
},
|
|
156
177
|
onError: (mutationError) => {
|
|
157
|
-
if (
|
|
178
|
+
if (isActionDenied(mutationError, props.id)) {
|
|
158
179
|
deniedUpdate.value = true;
|
|
159
180
|
editOpen.value = false;
|
|
160
181
|
}
|
|
@@ -183,7 +204,7 @@ export const ResourceDetail = defineComponent({
|
|
|
183
204
|
],
|
|
184
205
|
}),
|
|
185
206
|
deleteMutation.error.value &&
|
|
186
|
-
!
|
|
207
|
+
!isActionDenied(deleteMutation.error.value, props.id)
|
|
187
208
|
? h("p", { role: "alert", class: "text-sm text-destructive" }, deleteMutation.error.value.message)
|
|
188
209
|
: null,
|
|
189
210
|
h(DialogFooter, {}, {
|
|
@@ -223,21 +244,45 @@ export const ResourceDetail = defineComponent({
|
|
|
223
244
|
class: cn("text-sm text-destructive", props.className),
|
|
224
245
|
}, error.message);
|
|
225
246
|
}
|
|
226
|
-
const record = query.data.value
|
|
227
|
-
const
|
|
228
|
-
const
|
|
247
|
+
const { record, operations, relationships } = query.data.value;
|
|
248
|
+
const editEnabled = props.editAction ?? props.actions;
|
|
249
|
+
const deleteEnabled = props.deleteAction ?? props.actions;
|
|
250
|
+
const showEdit = editEnabled && !deniedUpdate.value && !operations.update;
|
|
251
|
+
const showDelete = deleteEnabled && !deniedDelete.value && !operations.delete;
|
|
252
|
+
// The server leaves out fields the actor can't read.
|
|
253
|
+
const visibleRows = rows.flatMap((row) => row.kind === "field"
|
|
254
|
+
? Object.hasOwn(record, row.field.name)
|
|
255
|
+
? [
|
|
256
|
+
{
|
|
257
|
+
key: row.field.name,
|
|
258
|
+
label: row.field.label ?? row.field.name,
|
|
259
|
+
value: formatFieldValue(record[row.field.name]),
|
|
260
|
+
},
|
|
261
|
+
]
|
|
262
|
+
: []
|
|
263
|
+
: Object.hasOwn(record, row.foreignKey)
|
|
264
|
+
? [
|
|
265
|
+
{
|
|
266
|
+
key: row.name,
|
|
267
|
+
label: row.label,
|
|
268
|
+
value: relationshipCellText(relationships, row, record),
|
|
269
|
+
},
|
|
270
|
+
]
|
|
271
|
+
: []);
|
|
272
|
+
const hasActions = showEdit ||
|
|
273
|
+
showDelete ||
|
|
229
274
|
recordActions.length > 0 ||
|
|
230
275
|
Boolean(props.renderActions);
|
|
231
276
|
return h("div", { class: cn("w-full", props.className) }, [
|
|
232
|
-
hasActions ? actionBar(record) : null,
|
|
277
|
+
hasActions ? actionBar(record, showEdit, showDelete) : null,
|
|
233
278
|
actionError.value
|
|
234
279
|
? h("p", { role: "alert", class: "pb-3 text-sm text-destructive" }, actionError.value)
|
|
235
280
|
: null,
|
|
236
281
|
h("dl", {
|
|
237
282
|
class: "grid gap-x-6 gap-y-3 rounded-lg border border-border p-4 sm:grid-cols-[minmax(8rem,max-content)_1fr]",
|
|
238
|
-
},
|
|
239
|
-
h("dt", { class: "text-sm font-medium text-muted-foreground" },
|
|
240
|
-
h("dd", { class: "text-sm break-words" },
|
|
283
|
+
}, visibleRows.map((row) => h("div", { key: row.key, class: "contents" }, [
|
|
284
|
+
h("dt", { class: "text-sm font-medium text-muted-foreground" }, row.label),
|
|
285
|
+
h("dd", { class: "text-sm break-words" }, row.value),
|
|
241
286
|
]))),
|
|
242
287
|
recordActions.length > 0
|
|
243
288
|
? h(ResourceActionDialog, {
|
|
@@ -250,8 +295,8 @@ export const ResourceDetail = defineComponent({
|
|
|
250
295
|
onDenied: denyAction,
|
|
251
296
|
})
|
|
252
297
|
: null,
|
|
253
|
-
props.
|
|
254
|
-
|
|
298
|
+
editEnabled && !props.onEdit ? editDialog(record) : null,
|
|
299
|
+
deleteEnabled ? deleteDialog() : null,
|
|
255
300
|
]);
|
|
256
301
|
};
|
|
257
302
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-form.d.ts","sourceRoot":"","sources":["../../src/resource/resource-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAsB,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAGzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAu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