Add number inputs into the supported structures, and redesign the sheet to make it actually look good

This commit is contained in:
Oliver-Akins 2025-01-11 17:35:17 -07:00
parent 5aee7e4a29
commit fb52e1b58d
11 changed files with 161 additions and 48 deletions

View file

@ -1,8 +1,9 @@
import { numberInput } from "./numberInput.mjs";
import { stringSet } from "./stringSet.mjs";
const inputTypes = {
"string-set": stringSet,
integer: displayOnly,
integer: numberInput,
bar: displayOnly,
dropdown: displayOnly,
boolean: displayOnly,
@ -13,10 +14,10 @@ function displayOnly(input) {
};
export function formFields(inputs, opts) {
let htmlString = ``;
const fields = [];
for (const input of inputs) {
if (inputTypes[input.type] == null) { continue };
htmlString += inputTypes[input.type](input, opts.data.root);
fields.push(inputTypes[input.type](input, opts.data.root));
};
return htmlString;
return fields.join(opts.hash?.joiner ?? `<hr />`);
};