{% macro cell(cell, rowIndex, cellIndex, tag, context) %} {% set searchByHidden = context.table.settings.searching.searchByHiddenField %} {% if cell.hiddenCell != true or cell.hiddenCell == true and searchByHidden == 'on' %} {% set data = cell.data %} {% set cellY = rowIndex %} {% set cellDbIndex = rowIndex %} {% if context.isSSP == true or context.isDB == true %} {% set cellY = cell.y | default(rowIndex) %} {% endif %} {% if context.isSSP == true and context.isDB == true %} {% set cellDbIndex = cell.dbIndex | default(rowIndex) %} {% endif %} {% if context.table.settings.styling.paragraphMode %} {% set data = data | raw | nl2br %} {% endif %} <{{tag}} data-cell-id="{{ context.cols[context.countIter] ~ context.cols[context.cellIter] ~ cellY }}" data-x="{{ cellIndex }}" data-y="{{ cellY }}" data-db-index="{{ cellDbIndex }}" class="{{ cell.meta | join(' ') | trim }}" {% if 'invisibleCell' in cell.meta %} data-hidden-cell="true" {% endif %} {% if cell.comment is defined and cell.comment.value is defined %} title="{{ cell.comment.value }}" {% endif %} {% if cell.type is not empty %} data-cell-type="{{ cell.type }}" {% endif %} {% if 'invisibleCell' in cell.meta %} style="display:none; visibility:hidden; font-size:0px; color:transparent; text-indent: -99999999px;" {% endif %} {% if cell.formatType is not empty %} data-cell-format-type="{{ cell.formatType }}" {% endif %} {% if cell.format is not empty %} data-cell-format="{{ cell.format }}" {% endif %} {% if cell.reformat is not empty %} data-cell-reformat="{{ cell.reformat }}" {% endif %} {% if cell.data[:1] == '=' %} data-formula="{{ cell.data | slice(1) }}" {% set data = cell.calculatedValue %} {% elseif cell.data[:2] == '`=' %} {% set data = cell.data | slice(1) %} {% endif %} data-original-value="{{ data | e }}" {% if cell.source is iterable %} data-source="{{ cell.source | json_encode | e }}" {% endif %} {% if cell.dateOrder is defined %} data-order="{{ cell.dateOrder }}" {% else %} data-order="{{ data | e }}" {% endif %} {% if 'auto_width' not in context.table.settings.features | keys and (context.table.settings.styling.compact is not defined or (context.table.settings.styling.compact is defined and context.table.settings.tableWidthType != 'auto')) and (rowIndex == '1' or context.widthForAll) %} {% if context.table.meta.columnsFixedWidth is defined and context.table.meta.columnsFixedWidth[cellIndex] is defined and context.table.meta.columnsFixedWidth[cellIndex] is not empty %} style="min-width: {{ context.table.meta.columnsFixedWidth[cellIndex] }}; width: {{ context.table.meta.columnsFixedWidth[cellIndex] }};" {% elseif context.table.meta.columnsWidth is defined and context.table.meta.columnsWidth[cellIndex] is defined and context.table.meta.columnsWidth[cellIndex] is not empty %} {#style="min-width: {{ context.table.meta.columnsWidth[cellIndex] }}%; width: {{ context.table.meta.columnsWidth[cellIndex] }}%;"#} {% if context.table.settings.responsiveMode == 2 %} style="min-width: {{ context.table.meta.columnsWidth[cellIndex] }}%; width: {{ context.table.meta.columnsWidth[cellIndex] }}%;" {% else %} style="min-width: {{ context.table.meta.columnsWidth[cellIndex] }}%; " {% endif %} {% else %} style="width: {{ cell.width }}px" {% endif %} {% endif %} {# cell.hidden is true if this cell was merged with another cell #} {% if cell.hidden == true %} {% set display = false %} {% set colspan = 1 %} {% set rowspan = 1 %} {% for mergedCell in context.table.meta.mergedCells %} {% if mergedCell.row == cellY - 1 and mergedCell.col == cellIndex %} {% set display = true %} {% set colspan = mergedCell.colspan %} {% if tag != 'th' %} {% set rowspan = mergedCell.rowspan %} {% else %} {% set resthead = context.table.settings.headerRowsCount - cellY + 1 %} {% if resthead >= mergedCell.rowspan %} {% set rowspan = mergedCell.rowspan %} {% else %} {% set rowspan = resthead %} {% endif %} {% endif %} {% endif %} {% endfor %} {% if cell.rewrite.rowspan is defined %} {% set rowspan = cell.rewrite.rowspan %} {% endif %} {% if cell.rewrite.colspan is defined %} {% set colspan = cell.rewrite.colspan %} {% endif %} {% if cell.rewrite.display is defined %} {% set display = cell.rewrite.display %} {% endif %} {% if display == false and context.isPageRows == false %} data-hide="true" {% else %} data-colspan="{{ colspan }}" data-rowspan="{{ rowspan }}" {% endif %} {% endif %} > {{ data | raw }} {% endif %} {% endmacro %} {% spaceless %} {% import _self as m %} {% set cols = 'A'..'Z' %} {% set countIter = -1 %} {% set cellIter = 0 %} {% set isSSP = table.isSSP | default(false) %} {% set isPageRows = table.isPageRows | default(false) %} {% set isDB = table.isDB | default(false) %} {% set settingsKeys = table.settings | keys %} {% set isCaption = table.settings.elements.caption is defined or (table.settings.elements.description is defined and table.settings.elements.descriptionText is defined) %} {% set fixedRowsCols = 'fixedFooter' in settingsKeys or 'fixedHeader' in settingsKeys or 'fixedColumns' in settingsKeys %} {% set widthForAll = false %} {% if isPageRows == false %} {% if 'auto_width' not in table.settings.features | keys %} {% if table.settings.tableWidthType == 'auto' %} {% set tableWidth = 'auto' %} {% else %} {% set tableWidth = table.settings.tableWidth|default('100') ~ table.settings.tableWidthType|default('%') %} {% endif %} {% endif %} {% if is_feed == false and table.settings.tableLoader.disable is not defined %} {% set loaderClass = 'supsystic-table-loader' %} {% if table.settings.tableLoader.iconName | default('default') == 'default' %}
{% else %}
{% for i in 1..table.settings.tableLoader.iconItems %}
{% endfor %}
{% endif %} {% endif %} {% endif %} {% endspaceless %}