RC-88 | String Set Input
This commit is contained in:
parent
d0374880bc
commit
000f490584
7 changed files with 95 additions and 6 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import { stringSet } from "./string-set.mjs";
|
||||
|
||||
const inputTypes = {
|
||||
set: displayOnly,
|
||||
"string-set": stringSet,
|
||||
integer: displayOnly,
|
||||
bar: displayOnly,
|
||||
dropdown: displayOnly,
|
||||
|
|
@ -10,11 +12,11 @@ function displayOnly(input) {
|
|||
return `<div data-input-type="${input.type}">${input.label}</div>`;
|
||||
};
|
||||
|
||||
export function formFields(inputs) {
|
||||
export function formFields(inputs, opts) {
|
||||
let htmlString = ``;
|
||||
for (const input of inputs) {
|
||||
if (inputTypes[input.type] == null) { continue };
|
||||
htmlString += inputTypes[input.type](input);
|
||||
htmlString += inputTypes[input.type](input, opts.data.root);
|
||||
};
|
||||
return htmlString;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue