30 lines
816 B
TypeScript
30 lines
816 B
TypeScript
import { ZeroEditorField, ZeroSchema, ZeroEditorDisplay } from "zero/schemas";
|
|
import { ZeroEditorCanvas } from "./editor-canvas";
|
|
|
|
export class ZeroEditor extends ZeroEditorCanvas implements ZeroSchema
|
|
{
|
|
alias: string;
|
|
|
|
resourcePrefix?: string;
|
|
|
|
system: boolean = false;
|
|
|
|
display: ZeroEditorDisplay = 'tabs';
|
|
|
|
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(alias: string)
|
|
{
|
|
super();
|
|
this.alias = alias;
|
|
}
|
|
} |