{%- set static = static ?? false %} {%- set fullWidth = fullWidth ?? true %} {%- set cols = cols ?? [] %} {%- set rows = rows ?? [] %} {%- set initJs = not static and (initJs ?? true) -%} {%- set minRows = minRows ?? null %} {%- set maxRows = maxRows ?? null %} {%- set describedBy = describedBy ?? null %} {%- set totalRows = rows|length %} {%- set staticRows = static or (staticRows ?? false) or (minRows == 1 and maxRows == 1 and totalRows == 1) %} {%- set allowAdd = (allowAdd ?? false) and not staticRows %} {%- set allowReorder = (allowReorder ?? false) and not staticRows %} {%- set allowDelete = (allowDelete ?? false) and not staticRows %} {% if not static %} {{ hiddenInput(name, '') }} {% endif %} {% macro cellClass(fullWidth, col, class) %} {{- (class is iterable ? class : [class])|merge([ "#{col.type}-cell", col.type in [ 'autosuggest', 'color', 'date', 'email', 'multiline', 'number', 'singleline', 'template', 'time', 'url', ] ? 'textual' : null, fullWidth and (col.thin ?? false) ? 'thin' : null, col.info is defined ? 'has-info' : null, ]|filter)|join(' ') -}} {% endmacro %} {% set tableAttributes = { id: id, class: [ 'editable', fullWidth ? 'fullwidth', static ? 'static', totalRows == 0 ? 'hidden', ]|filter, } %} {%- if block('attr') is defined %} {%- set tableAttributes = tableAttributes|merge(('
{{ value }}
{% else %}
{% if value %}
{% endif %}
{{ tag('textarea', {
name: cellName,
rows: col.rows ?? 1,
placeholder: col.placeholder ?? false,
aria: {
labelledby: headingId,
describedby: describedBy,
},
html: value,
}) }}
{% endif %}
{%- endswitch -%}
{% endblock %}