RC-93 | Group Input

This commit is contained in:
Oliver-Akins 2025-01-29 21:46:56 -07:00
parent f39c1b7721
commit e2297daa5d
6 changed files with 87 additions and 2 deletions

View file

@ -1,8 +1,10 @@
import { barInput } from "./barInput.mjs";
import { booleanInput } from "./booleanInput.mjs";
import { dropdownInput } from "./dropdownInput.mjs";
import { groupInput } from "./groupInput.mjs";
import { numberInput } from "./numberInput.mjs";
import { stringSet } from "./stringSet.mjs";
import { textInput } from "./textInput.mjs";
const { getType } = foundry.utils;
@ -12,6 +14,8 @@ const inputTypes = {
bar: barInput,
dropdown: dropdownInput,
boolean: booleanInput,
group: groupInput,
text: textInput,
};
const typesToSanitize = new Set([ `string`, `number` ]);
@ -21,7 +25,9 @@ export function formFields(inputs, opts) {
for (const input of inputs) {
if (inputTypes[input.type] == null) { continue };
input.limited ??= true;
if (input.type !== `group`) {
input.limited ??= true;
};
if (typesToSanitize.has(getType(input.value))) {
input.value = Handlebars.escapeExpression(input.value);