89 lines
1.5 KiB
JavaScript
Raw Normal View History

2023-05-29 16:22:34 +02:00
import { DataObject } from "../props.js";
2023-05-11 06:44:30 +02:00
const EnableBoolean = {
2023-05-29 16:22:34 +02:00
name: "enable",
label: "Aktivieren",
widget: "boolean",
required: false,
};
const DisableBoolean = {
name: "disable",
label: "Deaktivieren",
widget: "boolean",
required: false,
2023-05-11 06:44:30 +02:00
};
const DraftBoolean = {
2023-05-29 16:22:34 +02:00
name: "draft",
label: "Entwurf",
widget: "boolean",
default: false,
required: false,
};
2023-05-11 06:44:30 +02:00
const Title = (optional = false) => ({
2023-05-29 16:22:34 +02:00
name: "title",
label: "Titel",
widget: "string",
required: !optional,
2023-05-11 06:44:30 +02:00
});
const DescriptionText = {
2023-05-29 16:22:34 +02:00
name: "description",
label: "Beschreibung",
widget: "text",
required: false,
};
const IconList = {
name: "icon",
label: "Symbol",
widget: "string",
required: false,
hint: "Liste unter https://assets.cantorgymnasium.de/fonts/mdi/v7/preview.html",
2023-05-11 06:44:30 +02:00
};
2023-05-29 16:22:34 +02:00
const PreviewNumber = {
name: "number",
label: "Anzahl",
hint: "Anzahl der Elemente, die auf der Startseite angezeigt werden sollen.",
widget: "number",
value_type: "int",
min: 0,
step: 1,
required: true,
};
const ButtonObject = {
name: "button",
label: "Button",
...DataObject,
fields: [
EnableBoolean,
{
name: "label",
label: "Aufschrift",
widget: "string",
required: false,
},
{
name: "link",
label: "Link",
widget: "string",
required: false,
},
],
};
export {
EnableBoolean,
DisableBoolean,
DraftBoolean,
Title,
DescriptionText,
IconList,
PreviewNumber,
ButtonObject,
};