"));
}
-
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 = '';
@@ -6931,100 +6837,77 @@
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
-
+ }
+ // 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
+ }
+ // 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];
-
+ for (var _i12 = 0, _Object$entries11 = Object.entries(cellStyle.css); _i12 < _Object$entries11.length; _i12++) {
+ var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
+ _key3 = _Object$entries11$_i[0],
+ _value2 = _Object$entries11$_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;
@@ -7035,25 +6918,20 @@
// 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];
-
+ for (var _i13 = 0, _Object$entries12 = Object.entries(item["_".concat(field, "_data")]); _i13 < _Object$entries12.length; _i13++) {
+ var _Object$entries12$_i = _slicedToArray(_Object$entries12[_i13], 2),
+ _k = _Object$entries12$_i[0],
+ _v = _Object$entries12$_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;
@@ -7065,25 +6943,20 @@
} 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('