@modufolio/panel 0.1.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/LICENSE +21 -0
- package/README.md +165 -0
- package/dist/Builder/ImageNodeView.d.ts +33 -0
- package/dist/Builder/document.d.ts +17 -0
- package/dist/Builder/dragHandle.d.ts +13 -0
- package/dist/Builder/editing.d.ts +53 -0
- package/dist/Builder/plugins.d.ts +27 -0
- package/dist/Builder/schema.d.ts +20 -0
- package/dist/Components/Actions/Action.vue.d.ts +116 -0
- package/dist/Components/Actions/ActionGroup.vue.d.ts +25 -0
- package/dist/Components/Actions/ActionGroupItem.vue.d.ts +48 -0
- package/dist/Components/Auth/ForgotPassword.vue.d.ts +17 -0
- package/dist/Components/Auth/Login.vue.d.ts +33 -0
- package/dist/Components/Auth/ResetPassword.vue.d.ts +27 -0
- package/dist/Components/Auth/TwoFactor.vue.d.ts +32 -0
- package/dist/Components/Auth/TwoFactorVerify.vue.d.ts +31 -0
- package/dist/Components/Columns/BadgeColumn.vue.d.ts +34 -0
- package/dist/Components/Columns/BooleanColumn.vue.d.ts +78 -0
- package/dist/Components/Columns/CellActions.vue.d.ts +34 -0
- package/dist/Components/Columns/ColorColumn.vue.d.ts +84 -0
- package/dist/Components/Columns/CopyButton.vue.d.ts +15 -0
- package/dist/Components/Columns/DateColumn.vue.d.ts +60 -0
- package/dist/Components/Columns/IconColumn.vue.d.ts +56 -0
- package/dist/Components/Columns/ImageColumn.vue.d.ts +46 -0
- package/dist/Components/Columns/SelectColumn.vue.d.ts +71 -0
- package/dist/Components/Columns/TextColumn.vue.d.ts +69 -0
- package/dist/Components/Columns/TextInputColumn.vue.d.ts +75 -0
- package/dist/Components/Columns/ToggleColumn.vue.d.ts +91 -0
- package/dist/Components/Columns/TreeColumn.vue.d.ts +60 -0
- package/dist/Components/Columns/columnRegistry.d.ts +6 -0
- package/dist/Components/Composables/useInlineEdit.d.ts +27 -0
- package/dist/Components/Composables/useRelationship.d.ts +38 -0
- package/dist/Components/Core/Badge.vue.d.ts +47 -0
- package/dist/Components/Core/Button.vue.d.ts +131 -0
- package/dist/Components/Core/Dropdown.vue.d.ts +24 -0
- package/dist/Components/Core/Empty.vue.d.ts +54 -0
- package/dist/Components/Core/ErrorBoundary.vue.d.ts +24 -0
- package/dist/Components/Core/FlashMessages.vue.d.ts +7 -0
- package/dist/Components/Core/Icon.vue.d.ts +23 -0
- package/dist/Components/Core/Icons/DocumentLinesIcon.vue.d.ts +3 -0
- package/dist/Components/Core/Icons/SitemapIcon.vue.d.ts +3 -0
- package/dist/Components/Core/Label.vue.d.ts +52 -0
- package/dist/Components/Core/LoadingButton.vue.d.ts +18 -0
- package/dist/Components/Core/Modal.vue.d.ts +26 -0
- package/dist/Components/Core/Pagination.vue.d.ts +10 -0
- package/dist/Components/Core/SelectInput.vue.d.ts +26 -0
- package/dist/Components/Core/Tag.vue.d.ts +65 -0
- package/dist/Components/Core/TextInput.vue.d.ts +25 -0
- package/dist/Components/Core/iconRegistry.d.ts +3 -0
- package/dist/Components/Dialogs/ConfirmDialog.vue.d.ts +16 -0
- package/dist/Components/Dialogs/DeleteConfirmDialog.vue.d.ts +30 -0
- package/dist/Components/Dialogs/Dialog.vue.d.ts +81 -0
- package/dist/Components/Drawer/Drawer.vue.d.ts +130 -0
- package/dist/Components/Drawer/DrawerFieldGrid.vue.d.ts +39 -0
- package/dist/Components/Drawer/DrawerLink.vue.d.ts +96 -0
- package/dist/Components/Drawer/DrawerRelationList.vue.d.ts +81 -0
- package/dist/Components/Drawer/DrawerStack.vue.d.ts +93 -0
- package/dist/Components/Drawer/DrawerTabs.vue.d.ts +42 -0
- package/dist/Components/Drawer/NestedDrawerForm.vue.d.ts +55 -0
- package/dist/Components/Drawer/drawerFieldGrid.d.ts +25 -0
- package/dist/Components/Drawer/drawerTabs.d.ts +16 -0
- package/dist/Components/Drawer/useDrawerPage.d.ts +34 -0
- package/dist/Components/Drawer/useDrawerStack.d.ts +93 -0
- package/dist/Components/Drawer/useFocusedStackRow.d.ts +22 -0
- package/dist/Components/Drawer/useIsDrawer.d.ts +66 -0
- package/dist/Components/Drawer/visitDrawer.d.ts +48 -0
- package/dist/Components/Fields/BelongsToSelect.vue.d.ts +247 -0
- package/dist/Components/Fields/BlueprintForm.vue.d.ts +96 -0
- package/dist/Components/Fields/Calendar/CalendarPanel.vue.d.ts +63 -0
- package/dist/Components/Fields/Calendar/MonthGrid.vue.d.ts +82 -0
- package/dist/Components/Fields/CheckboxField.vue.d.ts +92 -0
- package/dist/Components/Fields/ColorPickerField.vue.d.ts +105 -0
- package/dist/Components/Fields/DatePickerField.vue.d.ts +102 -0
- package/dist/Components/Fields/DateRangePickerField.vue.d.ts +138 -0
- package/dist/Components/Fields/DateTimePickerField.vue.d.ts +134 -0
- package/dist/Components/Fields/FieldGrid.vue.d.ts +13 -0
- package/dist/Components/Fields/FileUploadField.vue.d.ts +117 -0
- package/dist/Components/Fields/MultiSelectField.vue.d.ts +129 -0
- package/dist/Components/Fields/ProseMirrorBuilderField.vue.d.ts +71 -0
- package/dist/Components/Fields/RangeField.vue.d.ts +122 -0
- package/dist/Components/Fields/RepeaterField.vue.d.ts +174 -0
- package/dist/Components/Fields/RichTextEditorField.vue.d.ts +118 -0
- package/dist/Components/Fields/SelectField.vue.d.ts +102 -0
- package/dist/Components/Fields/TagsField.vue.d.ts +102 -0
- package/dist/Components/Fields/TextField.vue.d.ts +138 -0
- package/dist/Components/Fields/TextareaField.vue.d.ts +111 -0
- package/dist/Components/Fields/TimePickerField.vue.d.ts +115 -0
- package/dist/Components/Fields/ToggleButtonsField.vue.d.ts +93 -0
- package/dist/Components/Fields/ToggleField.vue.d.ts +95 -0
- package/dist/Components/Fields/fieldRegistry.d.ts +25 -0
- package/dist/Components/Fields/fieldsFromSpec.d.ts +10 -0
- package/dist/Components/Fields/useBlueprint.d.ts +94 -0
- package/dist/Components/Fields/useFieldWidth.d.ts +10 -0
- package/dist/Components/Fields/validation.d.ts +43 -0
- package/dist/Components/Filters/DateRangeFilter.vue.d.ts +92 -0
- package/dist/Components/Filters/FacetedFilter.vue.d.ts +41 -0
- package/dist/Components/Filters/FilterIndicators.vue.d.ts +40 -0
- package/dist/Components/Filters/FilterPopover.vue.d.ts +38 -0
- package/dist/Components/Filters/MultiSelectFilter.vue.d.ts +51 -0
- package/dist/Components/Filters/NumberFilter.vue.d.ts +61 -0
- package/dist/Components/Filters/QueryBuilder.vue.d.ts +32 -0
- package/dist/Components/Filters/SelectFilter.vue.d.ts +61 -0
- package/dist/Components/Filters/TernaryFilter.vue.d.ts +73 -0
- package/dist/Components/Layout/AppLayout.vue.d.ts +137 -0
- package/dist/Components/Layout/Breadcrumbs.vue.d.ts +44 -0
- package/dist/Components/Layout/Cluster.vue.d.ts +88 -0
- package/dist/Components/Layout/Container.vue.d.ts +69 -0
- package/dist/Components/Layout/Grid.vue.d.ts +110 -0
- package/dist/Components/Layout/PageHeader.vue.d.ts +62 -0
- package/dist/Components/Layout/Sidebar.vue.d.ts +59 -0
- package/dist/Components/Layout/Stack.vue.d.ts +69 -0
- package/dist/Components/Layout/TopNavigation.vue.d.ts +124 -0
- package/dist/Components/Media/MediaPickerDialog.vue.d.ts +20 -0
- package/dist/Components/Media/mediaEndpoints.d.ts +18 -0
- package/dist/Components/Notifications/Toast.vue.d.ts +17 -0
- package/dist/Components/Notifications/useToast.d.ts +43 -0
- package/dist/Components/Relations/RelationManager.vue.d.ts +232 -0
- package/dist/Components/Sections/FieldsSection.vue.d.ts +56 -0
- package/dist/Components/Sections/FilesSection.vue.d.ts +120 -0
- package/dist/Components/Sections/FormSection.vue.d.ts +111 -0
- package/dist/Components/Sections/InfoSection.vue.d.ts +77 -0
- package/dist/Components/Sections/Section.vue.d.ts +67 -0
- package/dist/Components/Table/ColumnToggle.vue.d.ts +42 -0
- package/dist/Components/Table/ExportButton.vue.d.ts +93 -0
- package/dist/Components/Table/SchemaCell.d.ts +50 -0
- package/dist/Components/Table/SchemaFilterPanel.vue.d.ts +64 -0
- package/dist/Components/Table/SchemaTable.vue.d.ts +255 -0
- package/dist/Components/Table/Table.vue.d.ts +232 -0
- package/dist/Components/Table/TableEmptyState.vue.d.ts +24 -0
- package/dist/Components/Table/TablePagination.vue.d.ts +71 -0
- package/dist/Components/Table/TableSkeletonRows.vue.d.ts +52 -0
- package/dist/Components/Table/TableSortButton.vue.d.ts +38 -0
- package/dist/Components/Table/TableToolbar.vue.d.ts +62 -0
- package/dist/Components/Table/schemaLinks.d.ts +16 -0
- package/dist/Components/Table/tableSchema.d.ts +243 -0
- package/dist/Components/Table/tableTypes.d.ts +13 -0
- package/dist/Components/Table/useSchemaActions.d.ts +82 -0
- package/dist/Components/Table/useSchemaFilters.d.ts +28 -0
- package/dist/Components/Table/useTableExport.d.ts +16 -0
- package/dist/Components/Table/useTableGrouping.d.ts +9 -0
- package/dist/Components/Table/useTableRowFocus.d.ts +27 -0
- package/dist/Components/Table/useTableSelection.d.ts +15 -0
- package/dist/Components/Table/useTableTree.d.ts +23 -0
- package/dist/Components/Widgets/StatCard.vue.d.ts +81 -0
- package/dist/Components/Widgets/StatsWidget.vue.d.ts +27 -0
- package/dist/Components/Wizard/Wizard.vue.d.ts +99 -0
- package/dist/Composables/useAsyncData.d.ts +48 -0
- package/dist/Composables/useDeleteConfirmation.d.ts +86 -0
- package/dist/Composables/useDragReorder.d.ts +12 -0
- package/dist/Composables/useFieldSaver.d.ts +15 -0
- package/dist/Composables/useFocusTrap.d.ts +5 -0
- package/dist/Composables/useLocalStoragePersistence.d.ts +18 -0
- package/dist/Composables/useNestedDrawerForm.d.ts +58 -0
- package/dist/Composables/usePagination.d.ts +23 -0
- package/dist/Composables/usePendingKeys.d.ts +30 -0
- package/dist/Composables/useQuery.d.ts +61 -0
- package/dist/Composables/useReconciled.d.ts +22 -0
- package/dist/Composables/useUnsavedChangesWarning.d.ts +16 -0
- package/dist/Primitives/hideOthers.d.ts +12 -0
- package/dist/Primitives/teleportTarget.d.ts +2 -0
- package/dist/Primitives/useAnchoredPosition.d.ts +32 -0
- package/dist/Primitives/useArrowNavigation.d.ts +30 -0
- package/dist/Primitives/useBodyScrollLock.d.ts +9 -0
- package/dist/Primitives/useDismissableLayer.d.ts +46 -0
- package/dist/Primitives/useId.d.ts +13 -0
- package/dist/Primitives/useTypeahead.d.ts +11 -0
- package/dist/Utils/apiFetch.d.ts +28 -0
- package/dist/Utils/csrf.d.ts +2 -0
- package/dist/Utils/dates.d.ts +50 -0
- package/dist/Utils/moduleSingleton.d.ts +21 -0
- package/dist/Utils/optimistic.d.ts +33 -0
- package/dist/Utils/reconcile.d.ts +17 -0
- package/dist/Utils/tagsChanged.d.ts +16 -0
- package/dist/Utils/url.d.ts +40 -0
- package/dist/Utils/writeGate.d.ts +82 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +157 -0
- package/dist/index.js +27193 -0
- package/dist/index.js.map +1 -0
- package/dist/injectionKeys.d.ts +10 -0
- package/dist/plugin.d.ts +36 -0
- package/dist/types/menu.d.ts +11 -0
- package/docs/async-writes.md +159 -0
- package/docs/custom-fields.md +71 -0
- package/docs/drawer-protocol.md +130 -0
- package/docs/overlays.md +106 -0
- package/docs/relation-fields.md +112 -0
- package/docs/roadmap.md +38 -0
- package/docs/table-schema.md +371 -0
- package/package.json +150 -0
- package/styles/buttons.css +31 -0
- package/styles/form.css +74 -0
- package/styles/index.css +15 -0
- package/styles/tokens.css +79 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
id: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: () => string;
|
|
9
|
+
};
|
|
10
|
+
label: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
placeholder: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
help: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
error: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
rows: {
|
|
27
|
+
type: NumberConstructor;
|
|
28
|
+
default: number;
|
|
29
|
+
};
|
|
30
|
+
disabled: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
readonly: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
required: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
width: {
|
|
43
|
+
readonly type: StringConstructor;
|
|
44
|
+
readonly default: "full";
|
|
45
|
+
readonly validator: (v: string) => boolean;
|
|
46
|
+
};
|
|
47
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
48
|
+
"update:modelValue": (...args: any[]) => void;
|
|
49
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
50
|
+
modelValue: {
|
|
51
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
id: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: () => string;
|
|
57
|
+
};
|
|
58
|
+
label: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
placeholder: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
help: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
default: string;
|
|
69
|
+
};
|
|
70
|
+
error: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
rows: {
|
|
75
|
+
type: NumberConstructor;
|
|
76
|
+
default: number;
|
|
77
|
+
};
|
|
78
|
+
disabled: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
82
|
+
readonly: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
86
|
+
required: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: boolean;
|
|
89
|
+
};
|
|
90
|
+
width: {
|
|
91
|
+
readonly type: StringConstructor;
|
|
92
|
+
readonly default: "full";
|
|
93
|
+
readonly validator: (v: string) => boolean;
|
|
94
|
+
};
|
|
95
|
+
}>> & Readonly<{
|
|
96
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
97
|
+
}>, {
|
|
98
|
+
required: boolean;
|
|
99
|
+
modelValue: string | number;
|
|
100
|
+
id: string;
|
|
101
|
+
label: string;
|
|
102
|
+
placeholder: string;
|
|
103
|
+
help: string;
|
|
104
|
+
error: string;
|
|
105
|
+
disabled: boolean;
|
|
106
|
+
readonly: boolean;
|
|
107
|
+
width: string;
|
|
108
|
+
rows: number;
|
|
109
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
110
|
+
declare const _default: typeof __VLS_export;
|
|
111
|
+
export default _default;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
/** `HH:mm` in 24-hour form, whatever the viewer's locale displays. */
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
id: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: () => string;
|
|
10
|
+
};
|
|
11
|
+
label: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
help: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
error: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
min: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
max: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
/** Seconds between selectable values; 60 keeps the control at whole minutes. */
|
|
32
|
+
step: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
disabled: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
required: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
width: {
|
|
45
|
+
readonly type: StringConstructor;
|
|
46
|
+
readonly default: "full";
|
|
47
|
+
readonly validator: (v: string) => boolean;
|
|
48
|
+
};
|
|
49
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
50
|
+
"update:modelValue": (...args: any[]) => void;
|
|
51
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
52
|
+
/** `HH:mm` in 24-hour form, whatever the viewer's locale displays. */
|
|
53
|
+
modelValue: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
id: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
default: () => string;
|
|
60
|
+
};
|
|
61
|
+
label: {
|
|
62
|
+
type: StringConstructor;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
help: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
default: string;
|
|
68
|
+
};
|
|
69
|
+
error: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
default: string;
|
|
72
|
+
};
|
|
73
|
+
min: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
max: {
|
|
78
|
+
type: StringConstructor;
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
/** Seconds between selectable values; 60 keeps the control at whole minutes. */
|
|
82
|
+
step: {
|
|
83
|
+
type: NumberConstructor;
|
|
84
|
+
default: number;
|
|
85
|
+
};
|
|
86
|
+
disabled: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: boolean;
|
|
89
|
+
};
|
|
90
|
+
required: {
|
|
91
|
+
type: BooleanConstructor;
|
|
92
|
+
default: boolean;
|
|
93
|
+
};
|
|
94
|
+
width: {
|
|
95
|
+
readonly type: StringConstructor;
|
|
96
|
+
readonly default: "full";
|
|
97
|
+
readonly validator: (v: string) => boolean;
|
|
98
|
+
};
|
|
99
|
+
}>> & Readonly<{
|
|
100
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
101
|
+
}>, {
|
|
102
|
+
required: boolean;
|
|
103
|
+
min: string;
|
|
104
|
+
max: string;
|
|
105
|
+
modelValue: string;
|
|
106
|
+
id: string;
|
|
107
|
+
label: string;
|
|
108
|
+
help: string;
|
|
109
|
+
error: string;
|
|
110
|
+
disabled: boolean;
|
|
111
|
+
width: string;
|
|
112
|
+
step: number;
|
|
113
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
114
|
+
declare const _default: typeof __VLS_export;
|
|
115
|
+
export default _default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: (StringConstructor | NumberConstructor | BooleanConstructor)[];
|
|
5
|
+
default: null;
|
|
6
|
+
};
|
|
7
|
+
label: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
options: {
|
|
12
|
+
type: PropType<any[]>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
help: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
error: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
disabled: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
required: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
colors: {
|
|
32
|
+
type: PropType<Record<string, string>>;
|
|
33
|
+
default: () => {};
|
|
34
|
+
};
|
|
35
|
+
width: {
|
|
36
|
+
readonly type: StringConstructor;
|
|
37
|
+
readonly default: "full";
|
|
38
|
+
readonly validator: (v: string) => boolean;
|
|
39
|
+
};
|
|
40
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
41
|
+
"update:modelValue": (...args: any[]) => void;
|
|
42
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: (StringConstructor | NumberConstructor | BooleanConstructor)[];
|
|
45
|
+
default: null;
|
|
46
|
+
};
|
|
47
|
+
label: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
options: {
|
|
52
|
+
type: PropType<any[]>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
help: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
error: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
disabled: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
67
|
+
required: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
default: boolean;
|
|
70
|
+
};
|
|
71
|
+
colors: {
|
|
72
|
+
type: PropType<Record<string, string>>;
|
|
73
|
+
default: () => {};
|
|
74
|
+
};
|
|
75
|
+
width: {
|
|
76
|
+
readonly type: StringConstructor;
|
|
77
|
+
readonly default: "full";
|
|
78
|
+
readonly validator: (v: string) => boolean;
|
|
79
|
+
};
|
|
80
|
+
}>> & Readonly<{
|
|
81
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
82
|
+
}>, {
|
|
83
|
+
required: boolean;
|
|
84
|
+
modelValue: string | number | boolean;
|
|
85
|
+
label: string;
|
|
86
|
+
help: string;
|
|
87
|
+
error: string;
|
|
88
|
+
disabled: boolean;
|
|
89
|
+
width: string;
|
|
90
|
+
colors: Record<string, string>;
|
|
91
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
92
|
+
declare const _default: typeof __VLS_export;
|
|
93
|
+
export default _default;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
id: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: () => string;
|
|
9
|
+
};
|
|
10
|
+
label: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
description: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
help: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
error: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
disabled: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
color: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
validator: (value: unknown) => boolean;
|
|
34
|
+
};
|
|
35
|
+
width: {
|
|
36
|
+
readonly type: StringConstructor;
|
|
37
|
+
readonly default: "full";
|
|
38
|
+
readonly validator: (v: string) => boolean;
|
|
39
|
+
};
|
|
40
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
41
|
+
"update:modelValue": (...args: any[]) => void;
|
|
42
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
id: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: () => string;
|
|
50
|
+
};
|
|
51
|
+
label: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
description: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
help: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
error: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
disabled: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
default: boolean;
|
|
70
|
+
};
|
|
71
|
+
color: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
default: string;
|
|
74
|
+
validator: (value: unknown) => boolean;
|
|
75
|
+
};
|
|
76
|
+
width: {
|
|
77
|
+
readonly type: StringConstructor;
|
|
78
|
+
readonly default: "full";
|
|
79
|
+
readonly validator: (v: string) => boolean;
|
|
80
|
+
};
|
|
81
|
+
}>> & Readonly<{
|
|
82
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
83
|
+
}>, {
|
|
84
|
+
modelValue: boolean;
|
|
85
|
+
id: string;
|
|
86
|
+
label: string;
|
|
87
|
+
help: string;
|
|
88
|
+
error: string;
|
|
89
|
+
disabled: boolean;
|
|
90
|
+
width: string;
|
|
91
|
+
color: string;
|
|
92
|
+
description: string;
|
|
93
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
94
|
+
declare const _default: typeof __VLS_export;
|
|
95
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* The field-type → component registry, in a module of its own.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from useBlueprint.ts so the arrows point one way: the registry
|
|
6
|
+
* lazily imports RepeaterField, and RepeaterField needs
|
|
7
|
+
* `resolveFieldComponent` for its sub-fields — while both lived in
|
|
8
|
+
* useBlueprint, the two files imported each other. The cycle was tolerable
|
|
9
|
+
* at runtime (one edge dynamic, one type-only), but a composable and a
|
|
10
|
+
* component depending on each other is the kind of knot that only ever
|
|
11
|
+
* tightens; now field components import this module, never the composable.
|
|
12
|
+
*/
|
|
13
|
+
type FieldLoader = () => Promise<Component | {
|
|
14
|
+
default: Component;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Register (or override) a field type. This is the application's extension
|
|
18
|
+
* seam: field components with app-specific dependencies (writer, rich-text,
|
|
19
|
+
* block-editor, ...) are registered at boot instead of living in the panel.
|
|
20
|
+
*
|
|
21
|
+
* registerFieldType('writer', () => import('@/Components/Fields/WriterField.vue'))
|
|
22
|
+
*/
|
|
23
|
+
export declare function registerFieldType(type: string, loader: FieldLoader): void;
|
|
24
|
+
export declare function resolveFieldComponent(type: string): Promise<Component>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FieldDef } from './useBlueprint';
|
|
2
|
+
export declare function fieldsFromSpec(fields: any[]): FieldDef[];
|
|
3
|
+
/**
|
|
4
|
+
* Starting values for a set of declared fields.
|
|
5
|
+
*
|
|
6
|
+
* Collection-valued fields start as `[]`: their components iterate the model
|
|
7
|
+
* (`[...modelValue]`, `v-for`), and an explicit null overrides a prop default,
|
|
8
|
+
* so null does not degrade gracefully — it throws.
|
|
9
|
+
*/
|
|
10
|
+
export declare function initialValues(fields: any[], record?: Record<string, any> | null): Record<string, unknown>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { FieldWidth } from './useFieldWidth';
|
|
3
|
+
import { ValidationRule } from './validation';
|
|
4
|
+
import { resolveFieldComponent } from './fieldRegistry';
|
|
5
|
+
/** A value, or a function returning it — so callers can pass reactive sources. */
|
|
6
|
+
export type MaybeGetter<T> = T | (() => T);
|
|
7
|
+
/** Field types shipped with the panel. */
|
|
8
|
+
export type BuiltinFieldType = 'text' | 'textarea' | 'select' | 'multiselect' | 'toggle' | 'checkbox' | 'range' | 'date' | 'datetime' | 'time' | 'date-range' | 'file' | 'color' | 'belongs-to' | 'repeater' | 'toggle-buttons';
|
|
9
|
+
/**
|
|
10
|
+
* Built-ins plus anything an application registers via registerFieldType()
|
|
11
|
+
* (e.g. 'writer', 'rich-text', 'block-editor'). The `string & {}` keeps
|
|
12
|
+
* autocomplete for built-ins while accepting custom types.
|
|
13
|
+
*/
|
|
14
|
+
export type FieldType = BuiltinFieldType | (string & {});
|
|
15
|
+
export interface OptionItem {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string | number | boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface FieldDef {
|
|
21
|
+
/** Field type — maps to a field component */
|
|
22
|
+
type: FieldType;
|
|
23
|
+
/** Form key — used for v-model binding */
|
|
24
|
+
key: string;
|
|
25
|
+
/** Display label */
|
|
26
|
+
label: string;
|
|
27
|
+
/** Grid column width (default: 'full') */
|
|
28
|
+
width?: FieldWidth;
|
|
29
|
+
/** Mark field as required */
|
|
30
|
+
required?: boolean;
|
|
31
|
+
/** Help text shown below the field */
|
|
32
|
+
help?: string;
|
|
33
|
+
/** Placeholder text */
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
/** Options for select / multiselect / toggle-buttons */
|
|
36
|
+
options?: OptionItem[];
|
|
37
|
+
/** Extra props passed directly to the field component */
|
|
38
|
+
props?: Record<string, unknown>;
|
|
39
|
+
/** Conditional visibility — the field is hidden when this evaluates false */
|
|
40
|
+
when?: Condition;
|
|
41
|
+
/** Client-side validation, evaluated in order; the first failure is shown */
|
|
42
|
+
rules?: ValidationRule[];
|
|
43
|
+
/** Sub-field declarations, for container types such as `repeater` */
|
|
44
|
+
fields?: FieldDef[];
|
|
45
|
+
}
|
|
46
|
+
export type ConditionOperator = '==' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | 'not_in' | 'contains' | 'empty' | 'not_empty';
|
|
47
|
+
/**
|
|
48
|
+
* A single comparison against another field's value.
|
|
49
|
+
*
|
|
50
|
+
* ['status', 'published'] // implicit '=='
|
|
51
|
+
* ['status', '!=', 'draft']
|
|
52
|
+
* ['cover', 'not_empty']
|
|
53
|
+
*/
|
|
54
|
+
export type ConditionTuple = [key: string, operator: 'empty' | 'not_empty'] | [key: string, operator: ConditionOperator, value: unknown] | [key: string, value: unknown];
|
|
55
|
+
/**
|
|
56
|
+
* Conditions compose explicitly through `all` / `any` rather than by array
|
|
57
|
+
* nesting depth. Depth-as-grammar reads compactly but is invisible to
|
|
58
|
+
* TypeScript and easy to misread; naming the combinator costs a few characters
|
|
59
|
+
* and keeps the shape checkable.
|
|
60
|
+
*/
|
|
61
|
+
export type Condition = ((form: Record<string, unknown>) => boolean) | ConditionTuple | {
|
|
62
|
+
all: Condition[];
|
|
63
|
+
} | {
|
|
64
|
+
any: Condition[];
|
|
65
|
+
};
|
|
66
|
+
/** Evaluate a condition against the current form values. */
|
|
67
|
+
export declare function evaluateCondition(condition: Condition, form: Record<string, unknown>): boolean;
|
|
68
|
+
export { registerFieldType, resolveFieldComponent } from './fieldRegistry';
|
|
69
|
+
/**
|
|
70
|
+
* Converts a FieldDef array into reactive field state for use with BlueprintForm.
|
|
71
|
+
*
|
|
72
|
+
* @param fields - Array of field definitions
|
|
73
|
+
* @param form - Reactive form object (e.g. from useForm())
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const { visibleFields, fieldProps } = useBlueprint(fields, form)
|
|
77
|
+
*/
|
|
78
|
+
export declare function useBlueprint(fields: MaybeGetter<FieldDef[]>, form: MaybeGetter<Record<string, unknown>>): {
|
|
79
|
+
visibleFields: ComputedRef<FieldDef[]>;
|
|
80
|
+
visibleData: ComputedRef<Record<string, unknown>>;
|
|
81
|
+
clientErrors: ComputedRef<Record<string, string>>;
|
|
82
|
+
isValid: ComputedRef<boolean>;
|
|
83
|
+
fieldProps: (field: FieldDef, errors?: Record<string, string>) => Record<string, unknown>;
|
|
84
|
+
resolveFieldComponent: typeof resolveFieldComponent;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Type-safe helper for defining a blueprint field array.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* const fields = defineBlueprint([
|
|
91
|
+
* { type: 'text', key: 'name', label: 'Name', width: '1/2' },
|
|
92
|
+
* ])
|
|
93
|
+
*/
|
|
94
|
+
export declare function defineBlueprint(fields: FieldDef[]): FieldDef[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
export type FieldWidth = '1/4' | '1/3' | '1/2' | '2/3' | '3/4' | 'full';
|
|
3
|
+
export declare function useFieldWidth(getWidth: () => string): ComputedRef<string>;
|
|
4
|
+
export declare const fieldWidthProp: {
|
|
5
|
+
readonly width: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly default: "full";
|
|
8
|
+
readonly validator: (v: string) => boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field validation for blueprint forms.
|
|
3
|
+
*
|
|
4
|
+
* Rules are plain functions returning `true` or a message. There is no string
|
|
5
|
+
* mini-language ('min:3|max:5'): in TypeScript a parsed string throws away
|
|
6
|
+
* every bit of inference, while `min(3)` is checked at the call site and
|
|
7
|
+
* autocompletes.
|
|
8
|
+
*
|
|
9
|
+
* A rule never throws and never mutates — given a value and the surrounding
|
|
10
|
+
* form it answers one question, so rules stay trivially testable and can be
|
|
11
|
+
* evaluated in any order.
|
|
12
|
+
*/
|
|
13
|
+
export type ValidationRule = (value: unknown, form: Record<string, unknown>) => string | true;
|
|
14
|
+
export declare const required: (message?: string) => ValidationRule;
|
|
15
|
+
export declare const min: (limit: number, message?: string) => ValidationRule;
|
|
16
|
+
export declare const max: (limit: number, message?: string) => ValidationRule;
|
|
17
|
+
export declare const email: (message?: string) => ValidationRule;
|
|
18
|
+
export declare const url: (message?: string) => ValidationRule;
|
|
19
|
+
export declare const pattern: (regex: RegExp, message?: string) => ValidationRule;
|
|
20
|
+
export declare const integer: (message?: string) => ValidationRule;
|
|
21
|
+
/** Matches another field — confirm-password and the like. */
|
|
22
|
+
export declare const same: (otherKey: string, message?: string) => ValidationRule;
|
|
23
|
+
/**
|
|
24
|
+
* Build rules from a serialised spec, as a server-side blueprint declares them:
|
|
25
|
+
*
|
|
26
|
+
* ['required' => true, 'max' => 300, 'email' => true]
|
|
27
|
+
*
|
|
28
|
+
* This is what lets a field be described once, on the server, and still be
|
|
29
|
+
* checked before a round trip. The server remains the authority — this only
|
|
30
|
+
* spares the user a submit to learn something already knowable.
|
|
31
|
+
*
|
|
32
|
+
* Unknown rule names are ignored rather than throwing: the server may know
|
|
33
|
+
* rules this client build does not, and refusing to render a form over one
|
|
34
|
+
* unrecognised key would be a much worse failure than skipping it.
|
|
35
|
+
*/
|
|
36
|
+
export declare function rulesFromSpec(spec: Record<string, unknown> | undefined): ValidationRule[];
|
|
37
|
+
/**
|
|
38
|
+
* First failing message for a value, or null.
|
|
39
|
+
*
|
|
40
|
+
* Only the first is returned: a field shows one message at a time, and running
|
|
41
|
+
* on would report "too short" about a value the user has not finished typing.
|
|
42
|
+
*/
|
|
43
|
+
export declare function firstError(rules: ValidationRule[] | undefined, value: unknown, form: Record<string, unknown>): string | null;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
interface DatePreset {
|
|
3
|
+
label: string;
|
|
4
|
+
days?: number;
|
|
5
|
+
type?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: ObjectConstructor;
|
|
10
|
+
default: () => {
|
|
11
|
+
start: null;
|
|
12
|
+
end: null;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
label: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
min: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
max: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
showPresets: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
presets: {
|
|
32
|
+
type: PropType<DatePreset[]>;
|
|
33
|
+
default: () => ({
|
|
34
|
+
label: string;
|
|
35
|
+
days: number;
|
|
36
|
+
type?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
label: string;
|
|
39
|
+
type: string;
|
|
40
|
+
days?: undefined;
|
|
41
|
+
})[];
|
|
42
|
+
};
|
|
43
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
44
|
+
"update:modelValue": (...args: any[]) => void;
|
|
45
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
46
|
+
modelValue: {
|
|
47
|
+
type: ObjectConstructor;
|
|
48
|
+
default: () => {
|
|
49
|
+
start: null;
|
|
50
|
+
end: null;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
label: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
min: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
max: {
|
|
62
|
+
type: StringConstructor;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
showPresets: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
default: boolean;
|
|
68
|
+
};
|
|
69
|
+
presets: {
|
|
70
|
+
type: PropType<DatePreset[]>;
|
|
71
|
+
default: () => ({
|
|
72
|
+
label: string;
|
|
73
|
+
days: number;
|
|
74
|
+
type?: undefined;
|
|
75
|
+
} | {
|
|
76
|
+
label: string;
|
|
77
|
+
type: string;
|
|
78
|
+
days?: undefined;
|
|
79
|
+
})[];
|
|
80
|
+
};
|
|
81
|
+
}>> & Readonly<{
|
|
82
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
83
|
+
}>, {
|
|
84
|
+
min: string;
|
|
85
|
+
max: string;
|
|
86
|
+
modelValue: Record<string, any>;
|
|
87
|
+
label: string;
|
|
88
|
+
showPresets: boolean;
|
|
89
|
+
presets: DatePreset[];
|
|
90
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
91
|
+
declare const _default: typeof __VLS_export;
|
|
92
|
+
export default _default;
|