@chelone/vue 0.2.0 → 0.4.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/dist/array/use-array-input.d.ts +4 -3
- package/dist/choices/use-choices.d.ts +19 -12
- package/dist/choices/use-choices.js +8 -11
- package/dist/components/admin/auth/auth-error.vue.d.ts +1 -1
- package/dist/components/admin/buttons/dual-approval-button.vue.d.ts +19 -15
- package/dist/components/admin/buttons/dual-approval-button.vue.js +3 -1
- package/dist/components/admin/buttons/save-button.vue.d.ts +1 -1
- package/dist/components/admin/buttons/sort-button.vue.d.ts +2 -1
- package/dist/components/admin/buttons/status-transition-button.vue.d.ts +19 -14
- package/dist/components/admin/buttons/status-transition-button.vue.js +3 -1
- package/dist/components/admin/buttons/update-button.vue.d.ts +3 -3
- package/dist/components/admin/feedback/linear-progress.vue.d.ts +1 -1
- package/dist/components/admin/fields/api-key-field.vue.d.ts +27 -9
- package/dist/components/admin/fields/api-key-field.vue.js +3 -1
- package/dist/components/admin/fields/array-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/badge-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/boolean-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/chip-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/color-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/cron-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/currency-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/date-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/duration-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/email-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/file-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/file-field.vue.js +3 -3
- package/dist/components/admin/fields/function-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/image-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/image-field.vue.js +3 -3
- package/dist/components/admin/fields/json-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/number-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/phone-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/rating-field.vue.d.ts +22 -7
- package/dist/components/admin/fields/rating-field.vue.js +3 -1
- package/dist/components/admin/fields/record-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/reference-array-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/reference-field.vue.d.ts +2 -1
- package/dist/components/admin/fields/reference-many-count.vue.d.ts +2 -2
- package/dist/components/admin/fields/reference-many-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/reference-one-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/select-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/select-field.vue.js +1 -1
- package/dist/components/admin/fields/subscription-plan-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/text-array-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/text-field.vue.d.ts +2 -8
- package/dist/components/admin/fields/url-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/usage-meter-field.vue.d.ts +22 -7
- package/dist/components/admin/fields/usage-meter-field.vue.js +3 -1
- package/dist/components/admin/fields/webhook-endpoint-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/wrapper-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/wrapper-field.vue.js +6 -0
- package/dist/components/admin/inputs/api-key-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/array-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/autocomplete-array-input.vue.d.ts +14 -6
- package/dist/components/admin/inputs/autocomplete-array-input.vue.js +2 -3
- package/dist/components/admin/inputs/autocomplete-input.vue.d.ts +14 -6
- package/dist/components/admin/inputs/autocomplete-input.vue.js +2 -3
- package/dist/components/admin/inputs/boolean-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/checkbox-group-input.vue.d.ts +1 -1
- package/dist/components/admin/inputs/choice-input-props.d.ts +7 -7
- package/dist/components/admin/inputs/color-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/cron-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/currency-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/date-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/date-time-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/duration-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/file-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/nullable-boolean-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/number-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/password-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/phone-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/radio-button-group-input.vue.d.ts +1 -1
- package/dist/components/admin/inputs/rating-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/reference-array-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/reference-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/resettable-text-input.vue.d.ts +2 -1
- package/dist/components/admin/inputs/search-input.vue.d.ts +3 -3
- package/dist/components/admin/inputs/select-array-input.vue.d.ts +14 -5
- package/dist/components/admin/inputs/select-array-input.vue.js +1 -1
- package/dist/components/admin/inputs/select-input.vue.d.ts +14 -7
- package/dist/components/admin/inputs/select-input.vue.js +1 -1
- package/dist/components/admin/inputs/subscription-plan-picker.vue.d.ts +2 -2
- package/dist/components/admin/inputs/text-array-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/text-input.vue.d.ts +2 -1
- package/dist/components/admin/inputs/time-input.vue.d.ts +2 -1
- package/dist/components/admin/inputs/use-choice-input.d.ts +13 -19
- package/dist/components/admin/inputs/use-choice-input.js +4 -1
- package/dist/components/admin/inputs/webhook-endpoint-input.vue.d.ts +2 -2
- package/dist/components/admin/list/calendar-list.vue.d.ts +8 -8
- package/dist/components/admin/list/data-table-col.vue.d.ts +2 -2
- package/dist/components/admin/list/data-table-number-col.vue.d.ts +2 -1
- package/dist/components/admin/list/filter-form.vue.js +2 -10
- package/dist/components/admin/list/filter-live-search.vue.d.ts +1 -1
- package/dist/components/admin/list/kanban-board.vue.d.ts +41 -0
- package/dist/components/admin/list/kanban-board.vue.js +275 -0
- package/dist/components/admin/list/kanban-board2.vue.js +4 -0
- package/dist/components/admin/list/list-icons.d.ts +2 -0
- package/dist/components/admin/list/list-icons.js +7 -0
- package/dist/components/admin/list/tree-list.vue.d.ts +7 -6
- package/dist/components/admin/list/tree-list.vue.js +3 -9
- package/dist/components/admin/view/labeled.vue.d.ts +6 -5
- package/dist/components/admin/view/labeled.vue.js +4 -1
- package/dist/components/admin/view/tabbed-show-layout-tab.vue.d.ts +2 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/components/maps/geo-json-field.vue.d.ts +2 -1
- package/dist/components/maps/lat-lng-field.vue.d.ts +3 -3
- package/dist/components/maps/lat-lng-input.vue.d.ts +4 -4
- package/dist/components/maps-draw/shape-input.vue.d.ts +4 -4
- package/dist/components/maps-draw/simplify-input.vue.d.ts +2 -2
- package/dist/components/maps-osm/geocoding-input.vue.d.ts +6 -6
- package/dist/components/maps-osm/map-with-search.vue.d.ts +4 -4
- package/dist/components/maps-osm/osm-feature-operator.vue.d.ts +3 -3
- package/dist/components/maps-osm/reverse-geocode-field.vue.d.ts +3 -3
- package/dist/components/mdx-editor/mdx-field.vue.d.ts +2 -2
- package/dist/components/mdx-editor/mdx-input.vue.d.ts +2 -2
- package/dist/components/monaco/monaco-json-field.vue.d.ts +2 -2
- package/dist/components/monaco/monaco-json-input.vue.d.ts +2 -2
- package/dist/components/ui/alert.d.ts +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.vue.d.ts +1 -1
- package/dist/components/ui/command/command-dialog.vue.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.vue.js +9 -3
- package/dist/components/ui/input.vue.d.ts +2 -2
- package/dist/components/ui/sidebar/sidebar-menu-button.vue.d.ts +1 -1
- package/dist/components/ui/textarea.vue.d.ts +2 -2
- package/dist/controllers/use-controller-for-id.d.ts +6 -2
- package/dist/controllers/use-controller-for-id.js +2 -1
- package/dist/create-resource-components.d.ts +743 -0
- package/dist/create-resource-components.js +171 -0
- package/dist/data/create-chelone-hooks.d.ts +28 -8
- package/dist/data/mutations.d.ts +28 -8
- package/dist/form/use-input.d.ts +9 -6
- package/dist/form/use-input.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +248 -243
- package/dist/label/use-get-record-representation.d.ts +2 -1
- package/dist/label/use-get-record-representation.js +1 -13
- package/dist/record/use-field-value.d.ts +22 -11
- package/dist/record/use-field-value.js +3 -20
- package/package.json +4 -4
- package/dist/components/admin/fields/get-path.d.ts +0 -7
- package/dist/components/admin/fields/get-path.js +0 -14
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { defineComponent, computed, getCurrentInstance, shallowRef, ref, openBlock, createElementBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, toDisplayString, createCommentVNode, renderSlot, withModifiers, createVNode, withCtx, createBlock, createTextVNode } from "vue";
|
|
2
|
+
import { buildKanbanBuckets, planKanbanMove, getAtPath } from "@chelone/core";
|
|
3
|
+
import { useResourceDefinition } from "../../../admin/resource-registry.js";
|
|
4
|
+
import { useCheloneNotifications } from "../../../context.js";
|
|
5
|
+
import { useUpdate } from "../../../data/mutations.js";
|
|
6
|
+
import { useTranslate } from "../../../i18n/use-translate.js";
|
|
7
|
+
import { useGetRecordRepresentation } from "../../../label/use-get-record-representation.js";
|
|
8
|
+
import { cn } from "../../../lib/utils.js";
|
|
9
|
+
import { useListContext } from "../../../list/list-context.js";
|
|
10
|
+
import { useResourceContext } from "../../../resource-context.js";
|
|
11
|
+
import _sfc_main$3 from "../../ui/button.vue.js";
|
|
12
|
+
import { useMenuAccess } from "../layout/use-menu-access.js";
|
|
13
|
+
import { ArrowRightLeftIcon } from "./list-icons.js";
|
|
14
|
+
import { useNavigate, useCreatePath } from "../../../router/nav-composables.js";
|
|
15
|
+
import _sfc_main$1 from "../../ui/dropdown-menu/dropdown-menu.vue.js";
|
|
16
|
+
import _sfc_main$2 from "../../ui/dropdown-menu/dropdown-menu-trigger.vue.js";
|
|
17
|
+
import _sfc_main$4 from "../../ui/dropdown-menu/dropdown-menu-content.vue.js";
|
|
18
|
+
import _sfc_main$5 from "../../ui/dropdown-menu/dropdown-menu-item.vue.js";
|
|
19
|
+
const _hoisted_1 = ["aria-label", "data-column-id"];
|
|
20
|
+
const _hoisted_2 = { class: "flex items-center justify-between px-1 text-sm font-medium" };
|
|
21
|
+
const _hoisted_3 = {
|
|
22
|
+
"data-slot": "kanban-column-count",
|
|
23
|
+
class: "text-muted-foreground"
|
|
24
|
+
};
|
|
25
|
+
const _hoisted_4 = ["data-over", "onDragover", "onDragleave", "onDrop"];
|
|
26
|
+
const _hoisted_5 = {
|
|
27
|
+
key: 0,
|
|
28
|
+
"data-slot": "kanban-empty",
|
|
29
|
+
class: "px-1 py-2 text-sm text-muted-foreground"
|
|
30
|
+
};
|
|
31
|
+
const _hoisted_6 = ["data-record-id", "data-dragging", "draggable", "onClick", "onKeydown", "onDragstart"];
|
|
32
|
+
const _hoisted_7 = { class: "flex min-w-0 flex-1 flex-col gap-1" };
|
|
33
|
+
const _hoisted_8 = {
|
|
34
|
+
"data-slot": "kanban-card-title",
|
|
35
|
+
class: "font-medium"
|
|
36
|
+
};
|
|
37
|
+
const _hoisted_9 = {
|
|
38
|
+
key: 0,
|
|
39
|
+
"data-slot": "kanban-card-description",
|
|
40
|
+
class: "text-muted-foreground"
|
|
41
|
+
};
|
|
42
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
43
|
+
__name: "kanban-board",
|
|
44
|
+
props: {
|
|
45
|
+
groupSource: {},
|
|
46
|
+
columns: {},
|
|
47
|
+
titleSource: { default: void 0 },
|
|
48
|
+
descriptionSource: { default: void 0 },
|
|
49
|
+
linkType: { type: [String, Boolean], default: void 0 },
|
|
50
|
+
class: {}
|
|
51
|
+
},
|
|
52
|
+
emits: ["select-card"],
|
|
53
|
+
setup(__props, { emit: __emit }) {
|
|
54
|
+
const props = __props;
|
|
55
|
+
const emit = __emit;
|
|
56
|
+
const list = useListContext();
|
|
57
|
+
const resource = useResourceContext();
|
|
58
|
+
const translate = useTranslate();
|
|
59
|
+
const getRepresentation = useGetRecordRepresentation(resource);
|
|
60
|
+
const navigate = useNavigate();
|
|
61
|
+
const createPath = useCreatePath();
|
|
62
|
+
const definition = useResourceDefinition(() => ({ resource }));
|
|
63
|
+
const notifications = useCheloneNotifications();
|
|
64
|
+
const { canAccess, isPending: isAccessPending } = useMenuAccess(
|
|
65
|
+
computed(() => ({
|
|
66
|
+
action: "edit",
|
|
67
|
+
resource: resource ?? ""
|
|
68
|
+
}))
|
|
69
|
+
);
|
|
70
|
+
const update = useUpdate(resource ?? "", { mutationMode: "optimistic" });
|
|
71
|
+
const draggable = computed(
|
|
72
|
+
() => !!resource && canAccess.value && !isAccessPending.value
|
|
73
|
+
);
|
|
74
|
+
const instance = getCurrentInstance();
|
|
75
|
+
const hasListener = () => {
|
|
76
|
+
const listeners = instance?.vnode.props;
|
|
77
|
+
return !!(listeners?.onSelectCard || listeners?.onSelectCardOnce);
|
|
78
|
+
};
|
|
79
|
+
const buckets = computed(
|
|
80
|
+
() => buildKanbanBuckets(list.data ?? [], props.groupSource, props.columns)
|
|
81
|
+
);
|
|
82
|
+
const grabbed = shallowRef(null);
|
|
83
|
+
const draggingId = ref();
|
|
84
|
+
const overColumn = ref();
|
|
85
|
+
function clearDrag() {
|
|
86
|
+
grabbed.value = null;
|
|
87
|
+
draggingId.value = void 0;
|
|
88
|
+
overColumn.value = void 0;
|
|
89
|
+
}
|
|
90
|
+
function move(record, targetColumnId) {
|
|
91
|
+
const plan = planKanbanMove(
|
|
92
|
+
record,
|
|
93
|
+
props.groupSource,
|
|
94
|
+
props.columns,
|
|
95
|
+
targetColumnId
|
|
96
|
+
);
|
|
97
|
+
if (!plan) return;
|
|
98
|
+
update.mutateAsync(plan).catch(() => {
|
|
99
|
+
notifications?.notify("chelone.notification.http_error", {
|
|
100
|
+
type: "error"
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const type = computed(
|
|
105
|
+
() => props.linkType ?? (definition.value.hasEdit ? "edit" : definition.value.hasShow ? "show" : false)
|
|
106
|
+
);
|
|
107
|
+
const linkTo = (record) => resource && type.value ? createPath({ resource, id: record.id, type: type.value }) : void 0;
|
|
108
|
+
const selectable = computed(
|
|
109
|
+
() => hasListener() || !!resource && type.value !== false
|
|
110
|
+
);
|
|
111
|
+
function select(record) {
|
|
112
|
+
if (!selectable.value) return;
|
|
113
|
+
if (hasListener()) return emit("select-card", record);
|
|
114
|
+
const to = linkTo(record);
|
|
115
|
+
if (to) navigate(to);
|
|
116
|
+
}
|
|
117
|
+
function onCardKeydown(event, record) {
|
|
118
|
+
if (event.target !== event.currentTarget) return;
|
|
119
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
select(record);
|
|
122
|
+
}
|
|
123
|
+
function onDragStart(event, record) {
|
|
124
|
+
if (!draggable.value || !event.dataTransfer) return;
|
|
125
|
+
event.dataTransfer.effectAllowed = "move";
|
|
126
|
+
event.dataTransfer.setData("text/plain", String(record.id));
|
|
127
|
+
grabbed.value = record;
|
|
128
|
+
draggingId.value = String(record.id);
|
|
129
|
+
}
|
|
130
|
+
function onDragOver(event, columnId) {
|
|
131
|
+
if (!grabbed.value) return;
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
|
|
134
|
+
overColumn.value = columnId;
|
|
135
|
+
}
|
|
136
|
+
function onDragLeave(event, columnId) {
|
|
137
|
+
const into = event.relatedTarget;
|
|
138
|
+
const area = event.currentTarget;
|
|
139
|
+
if (into instanceof Node && area?.contains(into)) return;
|
|
140
|
+
if (overColumn.value === columnId) overColumn.value = void 0;
|
|
141
|
+
}
|
|
142
|
+
function onDrop(event, columnId) {
|
|
143
|
+
const record = grabbed.value;
|
|
144
|
+
if (!record || !draggable.value) return;
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
clearDrag();
|
|
147
|
+
move(record, columnId);
|
|
148
|
+
}
|
|
149
|
+
const isEmpty = (value) => value == null || value === "";
|
|
150
|
+
const textOf = (record, source) => source ? getAtPath(record, source) : void 0;
|
|
151
|
+
const titleOf = (record) => {
|
|
152
|
+
const value = textOf(record, props.titleSource);
|
|
153
|
+
return value == null ? getRepresentation(record) : String(value);
|
|
154
|
+
};
|
|
155
|
+
const othersOf = (columnId) => props.columns.filter((other) => other.id !== columnId);
|
|
156
|
+
const moveLabel = (record) => translate("chelone.kanban_board.move", {
|
|
157
|
+
title: titleOf(record),
|
|
158
|
+
_: "Move {title}"
|
|
159
|
+
});
|
|
160
|
+
const emptyLabel = computed(
|
|
161
|
+
() => translate("chelone.kanban_board.empty", { _: "No items" })
|
|
162
|
+
);
|
|
163
|
+
return (_ctx, _cache) => {
|
|
164
|
+
return openBlock(), createElementBlock("div", {
|
|
165
|
+
"data-slot": "kanban-board",
|
|
166
|
+
class: normalizeClass(unref(cn)("flex items-start gap-4 overflow-x-auto pb-2", props.class))
|
|
167
|
+
}, [
|
|
168
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(buckets.value, ({ column, records }) => {
|
|
169
|
+
return openBlock(), createElementBlock("div", {
|
|
170
|
+
key: column.id,
|
|
171
|
+
role: "group",
|
|
172
|
+
"aria-label": column.label,
|
|
173
|
+
"data-slot": "kanban-column",
|
|
174
|
+
"data-column-id": column.id,
|
|
175
|
+
class: normalizeClass(
|
|
176
|
+
unref(cn)(
|
|
177
|
+
"flex w-72 shrink-0 flex-col gap-2 rounded-lg bg-muted/50 p-2",
|
|
178
|
+
column.className
|
|
179
|
+
)
|
|
180
|
+
)
|
|
181
|
+
}, [
|
|
182
|
+
createElementVNode("div", _hoisted_2, [
|
|
183
|
+
createElementVNode("span", null, toDisplayString(column.label), 1),
|
|
184
|
+
createElementVNode("span", _hoisted_3, toDisplayString(records.length), 1)
|
|
185
|
+
]),
|
|
186
|
+
createElementVNode("div", {
|
|
187
|
+
"data-slot": "kanban-column-cards",
|
|
188
|
+
"data-over": overColumn.value === column.id ? "" : void 0,
|
|
189
|
+
class: "flex min-h-16 flex-col gap-2 rounded-md data-[over]:bg-accent",
|
|
190
|
+
onDragover: ($event) => onDragOver($event, column.id),
|
|
191
|
+
onDragleave: ($event) => onDragLeave($event, column.id),
|
|
192
|
+
onDrop: ($event) => onDrop($event, column.id)
|
|
193
|
+
}, [
|
|
194
|
+
records.length === 0 ? (openBlock(), createElementBlock("p", _hoisted_5, toDisplayString(emptyLabel.value), 1)) : createCommentVNode("", true),
|
|
195
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(records, (record) => {
|
|
196
|
+
return openBlock(), createElementBlock("div", {
|
|
197
|
+
key: record.id,
|
|
198
|
+
role: "button",
|
|
199
|
+
tabindex: "0",
|
|
200
|
+
"data-slot": "kanban-card",
|
|
201
|
+
"data-record-id": String(record.id),
|
|
202
|
+
"data-dragging": draggingId.value === String(record.id) ? "" : void 0,
|
|
203
|
+
draggable: draggable.value,
|
|
204
|
+
class: "flex cursor-pointer items-start gap-2 rounded-md border bg-card p-3 text-sm shadow-xs data-[dragging]:opacity-50",
|
|
205
|
+
onClick: ($event) => select(record),
|
|
206
|
+
onKeydown: ($event) => onCardKeydown($event, record),
|
|
207
|
+
onDragstart: ($event) => onDragStart($event, record),
|
|
208
|
+
onDragend: clearDrag
|
|
209
|
+
}, [
|
|
210
|
+
createElementVNode("div", _hoisted_7, [
|
|
211
|
+
_ctx.$slots.card ? renderSlot(_ctx.$slots, "card", {
|
|
212
|
+
key: 0,
|
|
213
|
+
record
|
|
214
|
+
}) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
215
|
+
createElementVNode("span", _hoisted_8, toDisplayString(titleOf(record)), 1),
|
|
216
|
+
!isEmpty(textOf(record, props.descriptionSource)) ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(String(textOf(record, props.descriptionSource))), 1)) : createCommentVNode("", true)
|
|
217
|
+
], 64))
|
|
218
|
+
]),
|
|
219
|
+
draggable.value ? (openBlock(), createElementBlock("div", {
|
|
220
|
+
key: 0,
|
|
221
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
222
|
+
}, ["stop"]))
|
|
223
|
+
}, [
|
|
224
|
+
createVNode(unref(_sfc_main$1), null, {
|
|
225
|
+
default: withCtx(() => [
|
|
226
|
+
createVNode(unref(_sfc_main$2), null, {
|
|
227
|
+
default: withCtx(() => [
|
|
228
|
+
createVNode(_sfc_main$3, {
|
|
229
|
+
type: "button",
|
|
230
|
+
variant: "ghost",
|
|
231
|
+
size: "icon",
|
|
232
|
+
"data-slot": "kanban-card-move",
|
|
233
|
+
class: "size-6",
|
|
234
|
+
"aria-label": moveLabel(record)
|
|
235
|
+
}, {
|
|
236
|
+
default: withCtx(() => [
|
|
237
|
+
createVNode(unref(ArrowRightLeftIcon))
|
|
238
|
+
]),
|
|
239
|
+
_: 1
|
|
240
|
+
}, 8, ["aria-label"])
|
|
241
|
+
]),
|
|
242
|
+
_: 2
|
|
243
|
+
}, 1024),
|
|
244
|
+
createVNode(unref(_sfc_main$4), { align: "end" }, {
|
|
245
|
+
default: withCtx(() => [
|
|
246
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(othersOf(column.id), (other) => {
|
|
247
|
+
return openBlock(), createBlock(unref(_sfc_main$5), {
|
|
248
|
+
key: other.id,
|
|
249
|
+
onSelect: ($event) => move(record, other.id)
|
|
250
|
+
}, {
|
|
251
|
+
default: withCtx(() => [
|
|
252
|
+
createTextVNode(toDisplayString(other.label), 1)
|
|
253
|
+
]),
|
|
254
|
+
_: 2
|
|
255
|
+
}, 1032, ["onSelect"]);
|
|
256
|
+
}), 128))
|
|
257
|
+
]),
|
|
258
|
+
_: 2
|
|
259
|
+
}, 1024)
|
|
260
|
+
]),
|
|
261
|
+
_: 2
|
|
262
|
+
}, 1024)
|
|
263
|
+
])) : createCommentVNode("", true)
|
|
264
|
+
], 40, _hoisted_6);
|
|
265
|
+
}), 128))
|
|
266
|
+
], 40, _hoisted_4)
|
|
267
|
+
], 10, _hoisted_1);
|
|
268
|
+
}), 128))
|
|
269
|
+
], 2);
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
export {
|
|
274
|
+
_sfc_main as default
|
|
275
|
+
};
|
|
@@ -16,3 +16,5 @@ export declare const ChevronLeftIcon: FunctionalComponent;
|
|
|
16
16
|
export declare const ChevronRightIcon: FunctionalComponent;
|
|
17
17
|
/** Stacked up/down chevrons — the expand-all rows control. */
|
|
18
18
|
export declare const ChevronsUpDownIcon: FunctionalComponent;
|
|
19
|
+
/** Two opposing arrows — the kanban card "Move to" control. */
|
|
20
|
+
export declare const ArrowRightLeftIcon: FunctionalComponent;
|
|
@@ -35,7 +35,14 @@ const ChevronsUpDownIcon = icon(() => [
|
|
|
35
35
|
h("path", { d: "m7 15 5 5 5-5" }),
|
|
36
36
|
h("path", { d: "m7 9 5-5 5 5" })
|
|
37
37
|
]);
|
|
38
|
+
const ArrowRightLeftIcon = icon(() => [
|
|
39
|
+
h("path", { d: "m16 3 4 4-4 4" }),
|
|
40
|
+
h("path", { d: "M20 7H4" }),
|
|
41
|
+
h("path", { d: "m8 21-4-4 4-4" }),
|
|
42
|
+
h("path", { d: "M4 17h16" })
|
|
43
|
+
]);
|
|
38
44
|
export {
|
|
45
|
+
ArrowRightLeftIcon,
|
|
39
46
|
ChevronLeftIcon,
|
|
40
47
|
ChevronRightIcon,
|
|
41
48
|
ChevronsUpDownIcon,
|
|
@@ -15,15 +15,16 @@
|
|
|
15
15
|
* </List>
|
|
16
16
|
*/
|
|
17
17
|
import { type LooseRecord } from "@chelone/core";
|
|
18
|
+
import type { SourceProp } from "@chelone/core";
|
|
18
19
|
import type { Component } from "vue";
|
|
19
20
|
/** Props for {@link TreeList}. */
|
|
20
21
|
export interface TreeListProps {
|
|
21
|
-
/** The field holding the parent's id; a
|
|
22
|
-
parentSource:
|
|
22
|
+
/** The field holding the parent's id; a dot or bracket path reads a nested value. */
|
|
23
|
+
parentSource: SourceProp;
|
|
23
24
|
/** The string field shown as the row title; the record representation otherwise. */
|
|
24
|
-
titleSource?:
|
|
25
|
+
titleSource?: SourceProp;
|
|
25
26
|
/** The field whose value picks a component from `iconMap`. */
|
|
26
|
-
iconSource?:
|
|
27
|
+
iconSource?: SourceProp;
|
|
27
28
|
iconMap?: Record<string, Component>;
|
|
28
29
|
/** Whether branches start open. Default `false`. */
|
|
29
30
|
defaultExpanded?: boolean;
|
|
@@ -41,8 +42,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<TreeListPr
|
|
|
41
42
|
onSelect?: ((record: LooseRecord) => any) | undefined;
|
|
42
43
|
}>, {
|
|
43
44
|
linkType: "edit" | "show" | false;
|
|
44
|
-
titleSource:
|
|
45
|
-
iconSource:
|
|
45
|
+
titleSource: SourceProp;
|
|
46
|
+
iconSource: SourceProp;
|
|
46
47
|
iconMap: Record<string, Component>;
|
|
47
48
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
48
49
|
/** Rendered while the list is pending, in place of `SimpleListLoading`. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, getCurrentInstance, computed, ref, provide, unref, openBlock, createElementBlock, Fragment, renderSlot, createBlock, normalizeClass, renderList } from "vue";
|
|
2
|
-
import { buildRecordTree } from "@chelone/core";
|
|
2
|
+
import { buildRecordTree, getAtPath } from "@chelone/core";
|
|
3
3
|
import { useResourceDefinition } from "../../../admin/resource-registry.js";
|
|
4
4
|
import { useGetRecordRepresentation } from "../../../label/use-get-record-representation.js";
|
|
5
5
|
import { cn } from "../../../lib/utils.js";
|
|
@@ -58,22 +58,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
58
58
|
const linkTo = (record) => resource && type.value ? createPath({ resource, id: record.id, type: type.value }) : void 0;
|
|
59
59
|
function titleFor(record) {
|
|
60
60
|
if (props.titleSource) {
|
|
61
|
-
const value =
|
|
61
|
+
const value = getAtPath(record, props.titleSource);
|
|
62
62
|
if (typeof value === "string") return value;
|
|
63
63
|
}
|
|
64
64
|
return getRepresentation(record);
|
|
65
65
|
}
|
|
66
66
|
function iconFor(record) {
|
|
67
67
|
if (!props.iconSource || !props.iconMap) return void 0;
|
|
68
|
-
const value =
|
|
68
|
+
const value = getAtPath(record, props.iconSource);
|
|
69
69
|
return value == null ? void 0 : props.iconMap[String(value)];
|
|
70
70
|
}
|
|
71
|
-
function readPath(record, path) {
|
|
72
|
-
return path.split(".").reduce(
|
|
73
|
-
(value, key) => value == null ? void 0 : value[key],
|
|
74
|
-
record
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
71
|
provide(TreeListKey, {
|
|
78
72
|
isExpanded,
|
|
79
73
|
toggle(id) {
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
* is a native element, a `<Labeled>` or a `<RecordField>`, which label
|
|
11
11
|
* themselves.
|
|
12
12
|
*/
|
|
13
|
+
import type { SourceProp } from "@chelone/core";
|
|
13
14
|
import { type PropType, type VNode } from "vue";
|
|
14
15
|
/** Props for {@link Labeled}. */
|
|
15
16
|
export interface LabeledProps {
|
|
16
17
|
/** Overrides the child's `label`; `false` renders no label. */
|
|
17
18
|
label?: string | false;
|
|
18
19
|
/** Overrides the child's `source` when resolving the label. */
|
|
19
|
-
source?:
|
|
20
|
+
source?: SourceProp;
|
|
20
21
|
/** Overrides the child's `resource` when resolving the label. */
|
|
21
22
|
resource?: string;
|
|
22
23
|
isRequired?: boolean;
|
|
@@ -33,7 +34,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
33
34
|
default: undefined;
|
|
34
35
|
};
|
|
35
36
|
source: {
|
|
36
|
-
type:
|
|
37
|
+
type: PropType<SourceProp>;
|
|
37
38
|
default: undefined;
|
|
38
39
|
};
|
|
39
40
|
resource: {
|
|
@@ -68,7 +69,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
68
69
|
default: undefined;
|
|
69
70
|
};
|
|
70
71
|
source: {
|
|
71
|
-
type:
|
|
72
|
+
type: PropType<SourceProp>;
|
|
72
73
|
default: undefined;
|
|
73
74
|
};
|
|
74
75
|
resource: {
|
|
@@ -96,13 +97,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
96
97
|
default: undefined;
|
|
97
98
|
};
|
|
98
99
|
}>> & Readonly<{}>, {
|
|
99
|
-
source: string;
|
|
100
100
|
class: string;
|
|
101
101
|
label: string | false;
|
|
102
|
+
source: string;
|
|
102
103
|
resource: string;
|
|
103
|
-
as: string;
|
|
104
104
|
htmlFor: string;
|
|
105
105
|
isRequired: boolean;
|
|
106
106
|
fullWidth: boolean;
|
|
107
|
+
as: string;
|
|
107
108
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
108
109
|
export default _default;
|
|
@@ -23,7 +23,10 @@ const _sfc_main = defineComponent({
|
|
|
23
23
|
type: [String, Boolean],
|
|
24
24
|
default: void 0
|
|
25
25
|
},
|
|
26
|
-
source: {
|
|
26
|
+
source: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: void 0
|
|
29
|
+
},
|
|
27
30
|
resource: { type: String, default: void 0 },
|
|
28
31
|
isRequired: { type: Boolean, default: false },
|
|
29
32
|
htmlFor: { type: String, default: void 0 },
|
|
@@ -75,9 +75,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
75
75
|
default: undefined;
|
|
76
76
|
};
|
|
77
77
|
}>> & Readonly<{}>, {
|
|
78
|
-
count: number;
|
|
79
|
-
path: string;
|
|
80
78
|
icon: Component;
|
|
79
|
+
path: string;
|
|
80
|
+
count: number;
|
|
81
81
|
contentClass: string;
|
|
82
82
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
83
83
|
export default _default;
|
|
@@ -326,6 +326,8 @@ export type { FilterLiveSearchProps } from "./admin/list/filter-live-search.vue.
|
|
|
326
326
|
export { default as FilterLiveSearch } from "./admin/list/filter-live-search.vue.js";
|
|
327
327
|
export type { InfinitePaginationProps } from "./admin/list/infinite-pagination.vue.js";
|
|
328
328
|
export { default as InfinitePagination } from "./admin/list/infinite-pagination.vue.js";
|
|
329
|
+
export type { KanbanBoardProps } from "./admin/list/kanban-board.vue.js";
|
|
330
|
+
export { default as KanbanBoard } from "./admin/list/kanban-board.vue.js";
|
|
329
331
|
export type { ListActionsProps } from "./admin/list/list-actions.vue.js";
|
|
330
332
|
export { default as ListActions } from "./admin/list/list-actions.vue.js";
|
|
331
333
|
export type { ListNoResultsProps } from "./admin/list/list-no-results.vue.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { SourceProp } from "@chelone/core";
|
|
1
2
|
import type { GeoJsonViewProps } from "./geo-json-view.vue.js";
|
|
2
3
|
/** Props for {@link GeoJsonField}. */
|
|
3
4
|
export interface GeoJsonFieldProps extends Partial<Omit<GeoJsonViewProps, "data">> {
|
|
4
5
|
/** The record property holding the GeoJSON value. */
|
|
5
|
-
source:
|
|
6
|
+
source: SourceProp;
|
|
6
7
|
/** Defaults to the ambient record. */
|
|
7
8
|
record?: Record<string, unknown>;
|
|
8
9
|
/** Used when the property is `undefined`. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { MapStyleInput } from "@chelone/core";
|
|
1
|
+
import type { MapStyleInput, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link LatLngField}. */
|
|
3
3
|
export interface LatLngFieldProps {
|
|
4
4
|
/** The record property holding the latitude. */
|
|
5
|
-
latSource:
|
|
5
|
+
latSource: SourceProp;
|
|
6
6
|
/** The record property holding the longitude. */
|
|
7
|
-
lngSource:
|
|
7
|
+
lngSource: SourceProp;
|
|
8
8
|
/** Defaults to the ambient record. */
|
|
9
9
|
record?: Record<string, unknown>;
|
|
10
10
|
zoom?: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { MapStyleInput, Validator } from "@chelone/core";
|
|
1
|
+
import type { MapStyleInput, SourceProp, Validator } from "@chelone/core";
|
|
2
2
|
/** Props for {@link LatLngInput}. */
|
|
3
3
|
export interface LatLngInputProps {
|
|
4
4
|
/** The form field holding the latitude. */
|
|
5
|
-
latSource:
|
|
5
|
+
latSource: SourceProp;
|
|
6
6
|
/** The form field holding the longitude. */
|
|
7
|
-
lngSource:
|
|
7
|
+
lngSource: SourceProp;
|
|
8
8
|
/** The legend. A string is translated; `false` renders none. */
|
|
9
9
|
label?: string | false;
|
|
10
10
|
helperText?: string;
|
|
@@ -29,8 +29,8 @@ declare const _default: import("vue").DefineComponent<LatLngInputProps, {}, {},
|
|
|
29
29
|
}, string, import("vue").PublicProps, Readonly<LatLngInputProps> & Readonly<{
|
|
30
30
|
onPositionChange?: ((lat: number, lng: number) => any) | undefined;
|
|
31
31
|
}>, {
|
|
32
|
-
label: string | false;
|
|
33
32
|
disabled: boolean;
|
|
33
|
+
label: string | false;
|
|
34
34
|
height: number | string;
|
|
35
35
|
zoom: number;
|
|
36
36
|
defaultPosition: readonly [lat: number, lng: number];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type MapStyleInput, type ShapeStyle, type ShapeValue, type ShapeValueKind, type Validator } from "@chelone/core";
|
|
1
|
+
import { type MapStyleInput, type ShapeStyle, type ShapeValue, type ShapeValueKind, type SourceProp, type Validator } from "@chelone/core";
|
|
2
2
|
import { type DrawTool } from "./use-terra-draw.js";
|
|
3
3
|
type ToolbarTool = DrawTool | "delete";
|
|
4
4
|
/** Props for {@link ShapeInput}. */
|
|
5
5
|
export interface ShapeInputProps {
|
|
6
6
|
/** The form field holding the GeoJSON value. */
|
|
7
|
-
source:
|
|
7
|
+
source: SourceProp;
|
|
8
8
|
/** The kind of value the field holds, which decides what a drawing writes. */
|
|
9
9
|
kind: ShapeValueKind;
|
|
10
10
|
/** The legend. A string is translated; `false` renders none. */
|
|
@@ -62,11 +62,11 @@ declare const _default: import("vue").DefineComponent<ShapeInputProps, {}, {}, {
|
|
|
62
62
|
}, string, import("vue").PublicProps, Readonly<ShapeInputProps> & Readonly<{
|
|
63
63
|
onCommit?: ((value: ShapeValue | null) => any) | undefined;
|
|
64
64
|
}>, {
|
|
65
|
-
label: string | false;
|
|
66
65
|
disabled: boolean;
|
|
66
|
+
label: string | false;
|
|
67
67
|
height: number | string;
|
|
68
|
-
validate: Validator | readonly Validator[];
|
|
69
68
|
helperText: string | false;
|
|
69
|
+
validate: Validator | readonly Validator[];
|
|
70
70
|
mapStyle: MapStyleInput;
|
|
71
71
|
zoom: number;
|
|
72
72
|
tools: readonly ToolbarTool[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { MapStyleInput, ShapeStyle } from "@chelone/core";
|
|
1
|
+
import type { MapStyleInput, ShapeStyle, SourceProp } from "@chelone/core";
|
|
2
2
|
export type SimplifyQuality = "Default" | "High";
|
|
3
3
|
/** Props for {@link SimplifyInput}. */
|
|
4
4
|
export interface SimplifyInputProps {
|
|
5
5
|
/** The form field holding a Geometry, Feature or FeatureCollection. */
|
|
6
|
-
source:
|
|
6
|
+
source: SourceProp;
|
|
7
7
|
/** The legend. A string is translated; `false` renders none. */
|
|
8
8
|
label?: string | false;
|
|
9
9
|
helperText?: string | false;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { GeoBBox, GeocodingProvider } from "@chelone/core";
|
|
1
|
+
import type { GeoBBox, GeocodingProvider, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link GeocodingInput}. */
|
|
3
3
|
export interface GeocodingInputProps {
|
|
4
4
|
/** The form field holding the address text. */
|
|
5
|
-
source:
|
|
5
|
+
source: SourceProp;
|
|
6
6
|
/** Written with the picked result's latitude. Left alone when unset. */
|
|
7
|
-
latSource?:
|
|
7
|
+
latSource?: SourceProp;
|
|
8
8
|
/** Written with the picked result's longitude. Left alone when unset. */
|
|
9
|
-
lngSource?:
|
|
9
|
+
lngSource?: SourceProp;
|
|
10
10
|
/** Written with the picked result's `[west, south, east, north]`, when it has one. */
|
|
11
|
-
bboxSource?:
|
|
11
|
+
bboxSource?: SourceProp;
|
|
12
12
|
/** A string is translated; `false` renders none. Defaults to the label of `source`. */
|
|
13
13
|
label?: string | false;
|
|
14
14
|
/** Defaults to `chelone.map.search_placeholder`. */
|
|
@@ -26,8 +26,8 @@ export interface GeocodingInputProps {
|
|
|
26
26
|
class?: string;
|
|
27
27
|
}
|
|
28
28
|
declare const _default: import("vue").DefineComponent<GeocodingInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<GeocodingInputProps> & Readonly<{}>, {
|
|
29
|
-
label: string | false;
|
|
30
29
|
disabled: boolean;
|
|
30
|
+
label: string | false;
|
|
31
31
|
debounceMs: number;
|
|
32
32
|
minChars: number;
|
|
33
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { GeocodingProvider } from "@chelone/core";
|
|
1
|
+
import type { GeocodingProvider, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link MapWithSearch}. */
|
|
3
3
|
export interface MapWithSearchProps {
|
|
4
4
|
/** The form field holding the latitude. */
|
|
5
|
-
latSource:
|
|
5
|
+
latSource: SourceProp;
|
|
6
6
|
/** The form field holding the longitude. */
|
|
7
|
-
lngSource:
|
|
7
|
+
lngSource: SourceProp;
|
|
8
8
|
/** The form field holding the address text. */
|
|
9
|
-
addressSource:
|
|
9
|
+
addressSource: SourceProp;
|
|
10
10
|
/** In pixels, or any CSS length. Defaults to 400. */
|
|
11
11
|
height?: number | string;
|
|
12
12
|
/** Read once at mount. Defaults to 13. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { OsmPresetName, OsmTagInput, OverpassProvider } from "@chelone/core";
|
|
1
|
+
import type { OsmPresetName, OsmTagInput, OverpassProvider, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link OsmFeatureOperator}. */
|
|
3
3
|
export interface OsmFeatureOperatorProps {
|
|
4
4
|
/** The form field holding the Polygon or MultiPolygon. */
|
|
5
|
-
source:
|
|
5
|
+
source: SourceProp;
|
|
6
6
|
/** `subtract` removes the matching OSM areas from the polygon; `add` merges them in. */
|
|
7
7
|
mode: "subtract" | "add";
|
|
8
8
|
/** Named OSM feature sets to query, such as `water`. */
|
|
@@ -17,8 +17,8 @@ export interface OsmFeatureOperatorProps {
|
|
|
17
17
|
class?: string;
|
|
18
18
|
}
|
|
19
19
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<OsmFeatureOperatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OsmFeatureOperatorProps> & Readonly<{}>, {
|
|
20
|
-
label: string;
|
|
21
20
|
disabled: boolean;
|
|
21
|
+
label: string;
|
|
22
22
|
provider: OverpassProvider;
|
|
23
23
|
presets: readonly OsmPresetName[];
|
|
24
24
|
tags: readonly OsmTagInput[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { GeocodingProvider } from "@chelone/core";
|
|
1
|
+
import type { GeocodingProvider, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link ReverseGeocodeField}. */
|
|
3
3
|
export interface ReverseGeocodeFieldProps {
|
|
4
4
|
/** The record property holding the latitude. */
|
|
5
|
-
latSource:
|
|
5
|
+
latSource: SourceProp;
|
|
6
6
|
/** The record property holding the longitude. */
|
|
7
|
-
lngSource:
|
|
7
|
+
lngSource: SourceProp;
|
|
8
8
|
/** Defaults to the ambient record. */
|
|
9
9
|
record?: Record<string, unknown>;
|
|
10
10
|
/** `full` is the whole name, `street` its first part and `city` its first two. Defaults to `full`. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { LooseRecord } from "@chelone/core";
|
|
1
|
+
import type { LooseRecord, SourceProp } from "@chelone/core";
|
|
2
2
|
import type { CrepeEditorConfig } from "./internal/crepe-editor.vue.js";
|
|
3
3
|
/** Props for {@link MdxField}. */
|
|
4
4
|
export interface MdxFieldProps {
|
|
5
|
-
source:
|
|
5
|
+
source: SourceProp;
|
|
6
6
|
record?: LooseRecord;
|
|
7
7
|
/** Used when the record has no value at `source`. */
|
|
8
8
|
defaultValue?: unknown;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Validator } from "@chelone/core";
|
|
1
|
+
import type { SourceProp, Validator } from "@chelone/core";
|
|
2
2
|
import type { CrepeEditorConfig } from "./internal/crepe-editor.vue.js";
|
|
3
3
|
/** Props for {@link MdxInput}. */
|
|
4
4
|
export interface MdxInputProps {
|
|
5
|
-
source:
|
|
5
|
+
source: SourceProp;
|
|
6
6
|
label?: string | false;
|
|
7
7
|
/** Used when the record has no value at `source`. Defaults to `""`. */
|
|
8
8
|
defaultValue?: unknown;
|