Files
mixtape/zero.Backoffice.UI/app/editor/editor.ts
T
2021-12-21 13:58:48 +01:00

24 lines
710 B
TypeScript

import { Component, ComponentPropsOptions } from "vue";
import { EditorSchema, ZeroEditorField } from "zero/schemas";
import { ZeroEditorCanvas } from "./editor-canvas";
export class ZeroEditor extends ZeroEditorCanvas
{
resourcePrefix?: string;
onLabelCreate = (field: ZeroEditorField): string =>
{
return field.configuration.label || (this.resourcePrefix ? this.resourcePrefix + field.path : '@nolabel[' + field.path + ']');
};
onDescriptionCreate = (field: ZeroEditorField): string | null =>
{
return field.configuration.description || (this.resourcePrefix ? this.resourcePrefix + field.path + '_text' : '@nodesc[' + field.path + ']');
};
constructor()
{
super();
}
}