{% from '_includes/forms' import text %} {%- set id = id ?? field.getInputId() %} {%- set descriptionId = descriptionId ?? "#{id}-desc" %} {%- set prefix = field.prefix ?? false %} {%- set suffix = field.suffix ?? false %} {%- set hasPrefix = prefix is not same as(false) %} {%- set hasSuffix = suffix is not same as(false) %} {% if formatNumber %} {{ hiddenInput("#{field.handle}[locale]", craft.app.formattingLocale.id) }} {% endif %} {% if hasPrefix or hasSuffix %} {{ tag('span', { id: descriptionId, class: 'visually-hidden', text: [ hasPrefix ? 'Value prefixed by “{prefix}”.'|t('app', {prefix: prefix}), hasSuffix ? 'Value suffixed by “{suffix}”.'|t('app', {suffix: suffix}), ]|filter|join(' '), }) }} {% endif %}
{% if hasPrefix %} {% endif %}
{{ text({ id: id, name: formatNumber ? "#{field.handle}[value]" : field.handle, value: value, inputmode: field.decimals ? 'decimal' : 'numeric', size: field.size, describedBy: [describedBy ?? null, hasPrefix or hasSuffix ? descriptionId : null]|filter|join(' ') ?: false, }) }}
{% if hasSuffix %} {% endif %}