You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
3.2 KiB
JavaScript
68 lines
3.2 KiB
JavaScript
// Copyright (C) 2024 Robert J.A. Wagner; Am Kiefernwald 49b; D-64297 Darmstadt - All Rights Reserved
|
|
|
|
import toParent from "./oFormElem_10_base.js";
|
|
|
|
|
|
export default class toFormElem_html extends toParent {
|
|
constructor() {
|
|
super();
|
|
}
|
|
setThisFE() {
|
|
this.setFE({
|
|
// GenericArray: { FE_Title: "Array", FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
// GenericButton: { FE_Title: "Button", FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' }, ynSkipSave: 'Y', ynReadOnly: 'Y', ynSkipOnSummary: 'Y' },
|
|
// GenericCheck: { FE_Title: "Check", FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' }, defaultValue: 'N' },
|
|
// GenericDate: { FE_Title: "Datum", FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
// GenericEMail: { FE_Title: "EMail", FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
// GenericTime: { FE_Title: 'Uhrzeit', FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
// GenericFloat: { FE_Title: "Fliesskommazahl", FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
// GenericInteger: { FE_Title: "Ganzzahl", FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
// GenericJSON: { FE_Title: "JSON", FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
Image: { elem: { FE_Title: "Bild" }, FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
Render: { elem: { FE_Title: "Render" }, FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
HTML: { elem: { FE_Title: "HTML" }, FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
// GenericText: { FE_Title: "Text", FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
// GenericDataList: { FE_Title: 'Art', select: ['A', 'B', 'C'], FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },
|
|
// GenericFixSelect: { FE_Title: 'Auswahl', select: ['A', 'B', 'C'], FE_Data: { ynExport: 'Y', ynGenerateView: 'Y' } },);
|
|
});
|
|
}
|
|
//------------------------------
|
|
// render-functions
|
|
//------------------------------
|
|
render_ojsonElemForm(next, form, control, item, cell, arg, FGM_Key) {
|
|
let ojson = { tag: 'DIV' };
|
|
if (item.FE_Type == "HTML") {
|
|
ojson.html = item.html;
|
|
} else if (item.FE_Type == "Image") {
|
|
ojson.tag = 'IMG';
|
|
ojson._width = "100%";
|
|
ojson._alt = arg.fileName || "Image";
|
|
ojson._src = "./supply/img/avatar.png";
|
|
if (arg) {
|
|
if (arg.fileName) ojson._alt;
|
|
if (arg.src) ojson._src = arg.src;
|
|
}
|
|
}
|
|
if (item.id) {
|
|
ojson._id = item.id;
|
|
}
|
|
if (cell.ijson) {
|
|
console.log(cell.ijson);
|
|
if (cell.ijson.uri) ojson.inner = cell.ijson.uri;
|
|
|
|
}
|
|
if (cell.item.classInner) {
|
|
ojson._class = (ojson._class)
|
|
? ojson._class + " " + cell.item.classInner
|
|
: cell.item.classInner;
|
|
}
|
|
next.push(ojson);
|
|
}
|
|
renderCellText(next, form, control, item, cell, arg, FGM_Key) {
|
|
let ojson = { tag: 'DIV', inner: cell.txt };
|
|
next.push(ojson);
|
|
}
|
|
}
|
|
|
|
new toFormElem_html();
|