@easydata/crud 1.4.5-rc02 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4181,7 +4181,7 @@ var CellRendererType;
4181
4181
  })(CellRendererType || (CellRendererType = {}));
4182
4182
  var StringCellRendererDefault = function (value, column, cellValueElement, rowElement) {
4183
4183
  var text = value ? value.toString().replace(/\n/g, '\u21B5 ') : '';
4184
- cellValueElement.innerHTML = text;
4184
+ cellValueElement.innerText = text;
4185
4185
  cellValueElement.title = text;
4186
4186
  if (column.align == GridColumnAlign.NONE) {
4187
4187
  cellValueElement.classList.add(cssPrefix + "-cell-value-align-left");
@@ -4200,7 +4200,7 @@ var NumberCellRendererDefault = function (value, column, cellValueElement, rowEl
4200
4200
  strValue = value.toLocaleString();
4201
4201
  }
4202
4202
  }
4203
- cellValueElement.innerHTML = strValue;
4203
+ cellValueElement.innerText = strValue;
4204
4204
  cellValueElement.title = strValue;
4205
4205
  if (column.align == GridColumnAlign.NONE) {
4206
4206
  cellValueElement.classList.add(cssPrefix + "-cell-value-align-right");
@@ -4232,7 +4232,7 @@ var DateTimeCellRendererDefault = function (value, column, cellValueElement, row
4232
4232
  }
4233
4233
  }
4234
4234
  }
4235
- cellValueElement.innerHTML = strValue;
4235
+ cellValueElement.innerText = strValue;
4236
4236
  cellValueElement.title = strValue;
4237
4237
  if (column.align == GridColumnAlign.NONE) {
4238
4238
  cellValueElement.classList.add(cssPrefix + "-cell-value-align-right");
@@ -7169,7 +7169,12 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
7169
7169
  else {
7170
7170
  value = value.toLocaleString();
7171
7171
  }
7172
- value = this.highlightText(value.toString());
7172
+ var result = this.highlightText(value.toString());
7173
+ if (result instanceof HTMLElement) {
7174
+ cellElement.title = value;
7175
+ cellElement.appendChild(result);
7176
+ return;
7177
+ }
7173
7178
  }
7174
7179
  }
7175
7180
  defaultRenderer(value, column, cellElement, rowElement);
@@ -7178,8 +7183,6 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
7178
7183
  var normalizedContent = content.toLowerCase();
7179
7184
  var filterValue = this.filter.getValue().toString();
7180
7185
  if (filterValue && filterValue.length > 0 && content && content.length > 0) {
7181
- var insertValue1 = "<span style='background-color: yellow'>";
7182
- var insertValue2 = "</span>";
7183
7186
  var indexInMas = [];
7184
7187
  var words = filterValue.split('||').map(function (w) { return w.trim().toLowerCase(); });
7185
7188
  for (var i = 0; i < words.length; i++) {
@@ -7188,7 +7191,10 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
7188
7191
  if (!lowerWord.length)
7189
7192
  continue;
7190
7193
  if (lowerWord === normalizedContent) {
7191
- return insertValue1 + content + insertValue2;
7194
+ var highlightSpan = document.createElement('span');
7195
+ highlightSpan.style.backgroundColor = 'yellow';
7196
+ highlightSpan.innerText = content;
7197
+ return highlightSpan;
7192
7198
  }
7193
7199
  while (pos < content.length - 1) {
7194
7200
  var index = normalizedContent.indexOf(lowerWord, pos);
@@ -7228,24 +7234,24 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
7228
7234
  i++;
7229
7235
  }
7230
7236
  }
7231
- var result = '';
7237
+ var div = document.createElement('div');
7232
7238
  for (var i = 0; i < indexInMas.length; i++) {
7233
7239
  if (i === 0) {
7234
- result += content.substring(0, indexInMas[i].index);
7235
- }
7236
- result += insertValue1
7237
- + content.substring(indexInMas[i].index, indexInMas[i].index + indexInMas[i].length)
7238
- + insertValue2;
7239
- if (i < indexInMas.length - 1) {
7240
- result += content.substring(indexInMas[i].index
7241
- + indexInMas[i].length, indexInMas[i + 1].index);
7242
- }
7243
- else {
7244
- result += content.substring(indexInMas[i].index
7245
- + indexInMas[i].length);
7240
+ var text_1 = document.createTextNode(content.substring(0, indexInMas[i].index));
7241
+ div.appendChild(text_1);
7246
7242
  }
7243
+ var highlightSpan = document.createElement('span');
7244
+ highlightSpan.style.backgroundColor = 'yellow';
7245
+ highlightSpan.innerText = content.substring(indexInMas[i].index, indexInMas[i].index + indexInMas[i].length);
7246
+ div.appendChild(highlightSpan);
7247
+ var text = (i < indexInMas.length - 1)
7248
+ ? document.createTextNode(content.substring(indexInMas[i].index
7249
+ + indexInMas[i].length, indexInMas[i + 1].index))
7250
+ : document.createTextNode(content.substring(indexInMas[i].index
7251
+ + indexInMas[i].length));
7252
+ div.appendChild(text);
7247
7253
  }
7248
- content = result;
7254
+ return div;
7249
7255
  }
7250
7256
  }
7251
7257
  return content;