RC-93 | Group Input
This commit is contained in:
parent
f39c1b7721
commit
e2297daa5d
6 changed files with 87 additions and 2 deletions
27
module/handlebarHelpers/inputs/textInput.mjs
Normal file
27
module/handlebarHelpers/inputs/textInput.mjs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { localizer } from "../../utils/Localizer.mjs";
|
||||
|
||||
export function textInput(input, data) {
|
||||
const label = localizer(input.label);
|
||||
const id = `${data.meta.idp}-${input.id}`;
|
||||
|
||||
if (!data.meta.editable) {
|
||||
return `<div data-input-type="integer">
|
||||
<span class="label">${label}</span>
|
||||
<span class="value">${data.meta.limited && input.limited ? `???` : input.value}</span>
|
||||
</div>`;
|
||||
};
|
||||
|
||||
return `<div data-input-type="text">
|
||||
<label
|
||||
for="${id}"
|
||||
>
|
||||
${label}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="${id}"
|
||||
value="${input.value}"
|
||||
name="${input.path}"
|
||||
/>
|
||||
</div>`;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue