RC-92 | Datamodel Defined Input Definition
This commit is contained in:
parent
94c89f72e1
commit
4b423a0729
5 changed files with 43 additions and 2 deletions
20
module/handlebarHelpers/inputs/formFields.mjs
Normal file
20
module/handlebarHelpers/inputs/formFields.mjs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
const inputTypes = {
|
||||
set: displayOnly,
|
||||
integer: displayOnly,
|
||||
bar: displayOnly,
|
||||
dropdown: displayOnly,
|
||||
boolean: displayOnly,
|
||||
};
|
||||
|
||||
function displayOnly(input) {
|
||||
return `<div data-input-type="${input.type}">${input.label}</div>`;
|
||||
};
|
||||
|
||||
export function formFields(inputs) {
|
||||
let htmlString = ``;
|
||||
for (const input of inputs) {
|
||||
if (inputTypes[input.type] == null) { continue };
|
||||
htmlString += inputTypes[input.type](input);
|
||||
};
|
||||
return htmlString;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue