Add number inputs into the supported structures, and redesign the sheet to make it actually look good
This commit is contained in:
parent
5aee7e4a29
commit
fb52e1b58d
11 changed files with 161 additions and 48 deletions
|
|
@ -4,12 +4,34 @@ const { randomID } = foundry.utils;
|
|||
|
||||
export function stringSet(input, data) {
|
||||
const label = localizer(input.label);
|
||||
const placeholder = localizer(input.placeholder ?? ``);
|
||||
const id = `${data.meta.idp}-${randomID(10)}`;
|
||||
|
||||
if (!data.meta.editable) {
|
||||
const tagList = input.value
|
||||
.split(/,\s*/)
|
||||
.filter(t => t.length > 0)
|
||||
.map(t => {
|
||||
return `<div class="tag">${t.trim()}</div>`;
|
||||
});
|
||||
let tags = tagList.join(``);
|
||||
|
||||
if (tagList.length === 0) {
|
||||
tags = `---`;
|
||||
};
|
||||
|
||||
if (data.meta.limited) {
|
||||
tags = `???`;
|
||||
};
|
||||
|
||||
return `<div data-input-type="string-set">
|
||||
<span class="label">${label}</span>
|
||||
<span>${input.value}</span>
|
||||
<div
|
||||
class="input-element-tags tags ${tags.length == 0 ? `empty` : ``}"
|
||||
data-tag-count="${tagList.length}"
|
||||
>
|
||||
${tags}
|
||||
</div>
|
||||
</div>`;
|
||||
};
|
||||
|
||||
|
|
@ -21,6 +43,7 @@ export function stringSet(input, data) {
|
|||
</label>
|
||||
<string-tags
|
||||
id="${id}"
|
||||
placeholder="${placeholder}"
|
||||
value="${input.value}"
|
||||
name="${input.path}"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue