"));
+ }
+
+ var detailViewTemplate = '';
+
+ if (Utils.hasDetailViewIcon(this.options)) {
+ detailViewTemplate = '
';
+
+ if (Utils.calculateObjectValue(null, this.options.detailFilter, [i, item])) {
+ detailViewTemplate += "\n \n ".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen), "\n \n ");
+ }
+
+ detailViewTemplate += ' | ';
+ }
+
+ if (detailViewTemplate && this.options.detailViewAlign !== 'right') {
+ html.push(detailViewTemplate);
+ }
+
+ this.header.fields.forEach(function (field, j) {
+ var column = _this7.columns[j];
+ var text = '';
+ var value_ = Utils.getItemField(item, field, _this7.options.escape, column.escape);
+ var value = '';
+ var type = '';
+ var cellStyle = {};
+ var id_ = '';
+ var class_ = _this7.header.classes[j];
+ var style_ = '';
+ var styleToAdd_ = '';
+ var data_ = '';
+ var rowspan_ = '';
+ var colspan_ = '';
+ var title_ = '';
+
+ if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
+ if (!column.checkbox && !column.radio) {
+ return;
+ }
+ }
+
+ if (!column.visible) {
+ return;
+ }
+
+ if (_this7.options.cardView && !column.cardVisible) {
+ return;
+ } // Style concat
+
+
+ if (csses.concat([_this7.header.styles[j]]).length) {
+ styleToAdd_ += "".concat(csses.concat([_this7.header.styles[j]]).join('; '));
+ }
+
+ if (item["_".concat(field, "_style")]) {
+ styleToAdd_ += "".concat(item["_".concat(field, "_style")]);
+ }
+
+ if (styleToAdd_) {
+ style_ = " style=\"".concat(styleToAdd_, "\"");
+ } // Style concat
+ // handle id and class of td
+
+
+ if (item["_".concat(field, "_id")]) {
+ id_ = Utils.sprintf(' id="%s"', item["_".concat(field, "_id")]);
+ }
+
+ if (item["_".concat(field, "_class")]) {
+ class_ = Utils.sprintf(' class="%s"', item["_".concat(field, "_class")]);
+ }
+
+ if (item["_".concat(field, "_rowspan")]) {
+ rowspan_ = Utils.sprintf(' rowspan="%s"', item["_".concat(field, "_rowspan")]);
+ }
+
+ if (item["_".concat(field, "_colspan")]) {
+ colspan_ = Utils.sprintf(' colspan="%s"', item["_".concat(field, "_colspan")]);
+ }
+
+ if (item["_".concat(field, "_title")]) {
+ title_ = Utils.sprintf(' title="%s"', item["_".concat(field, "_title")]);
+ }
+
+ cellStyle = Utils.calculateObjectValue(_this7.header, _this7.header.cellStyles[j], [value_, item, i, field], cellStyle);
+
+ if (cellStyle.classes) {
+ class_ = " class=\"".concat(cellStyle.classes, "\"");
+ }
+
+ if (cellStyle.css) {
+ var csses_ = [];
+
+ for (var _i11 = 0, _Object$entries10 = Object.entries(cellStyle.css); _i11 < _Object$entries10.length; _i11++) {
+ var _Object$entries10$_i = _slicedToArray(_Object$entries10[_i11], 2),
+ _key3 = _Object$entries10$_i[0],
+ _value2 = _Object$entries10$_i[1];
+
+ csses_.push("".concat(_key3, ": ").concat(_value2));
+ }
+
+ style_ = " style=\"".concat(csses_.concat(_this7.header.styles[j]).join('; '), "\"");
+ }
+
+ value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
+
+ if (!(column.checkbox || column.radio)) {
+ value = typeof value === 'undefined' || value === null ? _this7.options.undefinedText : value;
+ }
+
+ if (column.searchable && _this7.searchText && _this7.options.searchHighlight && !(column.checkbox || column.radio)) {
+ var defValue = '';
+
+ var searchText = _this7.searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+
+ if (_this7.options.searchAccentNeutralise) {
+ var indexRegex = new RegExp("".concat(Utils.normalizeAccent(searchText)), 'gmi');
+ var match = indexRegex.exec(Utils.normalizeAccent(value));
+
+ if (match) {
+ searchText = value.substring(match.index, match.index + searchText.length);
+ }
+ }
+
+ var regExp = new RegExp("(".concat(searchText, ")"), 'gim');
+ var marker = '
$1';
+ var isHTML = value && /<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(value);
+
+ if (isHTML) {
+ // value can contains a HTML tags
+ var textContent = new DOMParser().parseFromString(value.toString(), 'text/html').documentElement.textContent;
+ var textReplaced = textContent.replace(regExp, marker);
+ textContent = textContent.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ defValue = value.replace(new RegExp("(>\\s*)(".concat(textContent, ")(\\s*)"), 'gm'), "$1".concat(textReplaced, "$3"));
+ } else {
+ // but usually not
+ defValue = value.toString().replace(regExp, marker);
+ }
+
+ value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], defValue);
+ }
+
+ if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
+ for (var _i12 = 0, _Object$entries11 = Object.entries(item["_".concat(field, "_data")]); _i12 < _Object$entries11.length; _i12++) {
+ var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
+ _k = _Object$entries11$_i[0],
+ _v = _Object$entries11$_i[1];
+
+ // ignore data-index
+ if (_k === 'index') {
+ return;
+ }
+
+ data_ += " data-".concat(_k, "=\"").concat(_v, "\"");
+ }
+ }
+
+ if (column.checkbox || column.radio) {
+ type = column.checkbox ? 'checkbox' : type;
+ type = column.radio ? 'radio' : type;
+ var c = column['class'] || '';
+ var isChecked = Utils.isObject(value) && value.hasOwnProperty('checked') ? value.checked : (value === true || value_) && value !== false;
+ var isDisabled = !column.checkboxEnabled || value && value.disabled;
+ text = [_this7.options.cardView ? "
") : "
"), ""), _this7.header.formatters[j] && typeof value === 'string' ? value : '', _this7.options.cardView ? '' : ' | '].join('');
+ item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
+ } else if (_this7.options.cardView) {
+ var cardTitle = _this7.options.showHeader ? "
").concat(Utils.getFieldTitle(_this7.columns, field), "") : '';
+ text = "
".concat(cardTitle, "").concat(value, "
");
+
+ if (_this7.options.smartDisplay && value === '') {
+ text = '
';
+ }
+ } else {
+ text = "
").concat(value, " | ");
+ }
+
+ html.push(text);
+ });
+
+ if (detailViewTemplate && this.options.detailViewAlign === 'right') {
+ html.push(detailViewTemplate);
+ }
+
+ if (this.options.cardView) {
+ html.push('