@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.
@@ -4340,7 +4340,7 @@ var CellRendererType;
4340
4340
  })(CellRendererType || (CellRendererType = {}));
4341
4341
  var StringCellRendererDefault = function (value, column, cellValueElement, rowElement) {
4342
4342
  var text = value ? value.toString().replace(/\n/g, '\u21B5 ') : '';
4343
- cellValueElement.innerHTML = text;
4343
+ cellValueElement.innerText = text;
4344
4344
  cellValueElement.title = text;
4345
4345
  if (column.align == _easy_grid_columns__WEBPACK_IMPORTED_MODULE_1__[/* GridColumnAlign */ "b"].NONE) {
4346
4346
  cellValueElement.classList.add(cssPrefix + "-cell-value-align-left");
@@ -4359,7 +4359,7 @@ var NumberCellRendererDefault = function (value, column, cellValueElement, rowEl
4359
4359
  strValue = value.toLocaleString();
4360
4360
  }
4361
4361
  }
4362
- cellValueElement.innerHTML = strValue;
4362
+ cellValueElement.innerText = strValue;
4363
4363
  cellValueElement.title = strValue;
4364
4364
  if (column.align == _easy_grid_columns__WEBPACK_IMPORTED_MODULE_1__[/* GridColumnAlign */ "b"].NONE) {
4365
4365
  cellValueElement.classList.add(cssPrefix + "-cell-value-align-right");
@@ -4391,7 +4391,7 @@ var DateTimeCellRendererDefault = function (value, column, cellValueElement, row
4391
4391
  }
4392
4392
  }
4393
4393
  }
4394
- cellValueElement.innerHTML = strValue;
4394
+ cellValueElement.innerText = strValue;
4395
4395
  cellValueElement.title = strValue;
4396
4396
  if (column.align == _easy_grid_columns__WEBPACK_IMPORTED_MODULE_1__[/* GridColumnAlign */ "b"].NONE) {
4397
4397
  cellValueElement.classList.add(cssPrefix + "-cell-value-align-right");
@@ -11597,7 +11597,12 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
11597
11597
  else {
11598
11598
  value = value.toLocaleString();
11599
11599
  }
11600
- value = this.highlightText(value.toString());
11600
+ var result = this.highlightText(value.toString());
11601
+ if (result instanceof HTMLElement) {
11602
+ cellElement.title = value;
11603
+ cellElement.appendChild(result);
11604
+ return;
11605
+ }
11601
11606
  }
11602
11607
  }
11603
11608
  defaultRenderer(value, column, cellElement, rowElement);
@@ -11606,8 +11611,6 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
11606
11611
  var normalizedContent = content.toLowerCase();
11607
11612
  var filterValue = this.filter.getValue().toString();
11608
11613
  if (filterValue && filterValue.length > 0 && content && content.length > 0) {
11609
- var insertValue1 = "<span style='background-color: yellow'>";
11610
- var insertValue2 = "</span>";
11611
11614
  var indexInMas = [];
11612
11615
  var words = filterValue.split('||').map(function (w) { return w.trim().toLowerCase(); });
11613
11616
  for (var i = 0; i < words.length; i++) {
@@ -11616,7 +11619,10 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
11616
11619
  if (!lowerWord.length)
11617
11620
  continue;
11618
11621
  if (lowerWord === normalizedContent) {
11619
- return insertValue1 + content + insertValue2;
11622
+ var highlightSpan = document.createElement('span');
11623
+ highlightSpan.style.backgroundColor = 'yellow';
11624
+ highlightSpan.innerText = content;
11625
+ return highlightSpan;
11620
11626
  }
11621
11627
  while (pos < content.length - 1) {
11622
11628
  var index = normalizedContent.indexOf(lowerWord, pos);
@@ -11656,24 +11662,24 @@ var text_filter_widget_TextFilterWidget = /** @class */ (function () {
11656
11662
  i++;
11657
11663
  }
11658
11664
  }
11659
- var result = '';
11665
+ var div = document.createElement('div');
11660
11666
  for (var i = 0; i < indexInMas.length; i++) {
11661
11667
  if (i === 0) {
11662
- result += content.substring(0, indexInMas[i].index);
11663
- }
11664
- result += insertValue1
11665
- + content.substring(indexInMas[i].index, indexInMas[i].index + indexInMas[i].length)
11666
- + insertValue2;
11667
- if (i < indexInMas.length - 1) {
11668
- result += content.substring(indexInMas[i].index
11669
- + indexInMas[i].length, indexInMas[i + 1].index);
11670
- }
11671
- else {
11672
- result += content.substring(indexInMas[i].index
11673
- + indexInMas[i].length);
11668
+ var text_1 = document.createTextNode(content.substring(0, indexInMas[i].index));
11669
+ div.appendChild(text_1);
11674
11670
  }
11671
+ var highlightSpan = document.createElement('span');
11672
+ highlightSpan.style.backgroundColor = 'yellow';
11673
+ highlightSpan.innerText = content.substring(indexInMas[i].index, indexInMas[i].index + indexInMas[i].length);
11674
+ div.appendChild(highlightSpan);
11675
+ var text = (i < indexInMas.length - 1)
11676
+ ? document.createTextNode(content.substring(indexInMas[i].index
11677
+ + indexInMas[i].length, indexInMas[i + 1].index))
11678
+ : document.createTextNode(content.substring(indexInMas[i].index
11679
+ + indexInMas[i].length));
11680
+ div.appendChild(text);
11675
11681
  }
11676
- content = result;
11682
+ return div;
11677
11683
  }
11678
11684
  }
11679
11685
  return content;