@keenthemes/ktui 1.1.3 → 1.1.4

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.
package/dist/ktui.js CHANGED
@@ -7521,9 +7521,13 @@ var KTDataTable = /** @class */ (function (_super) {
7521
7521
  var originalDataAttributes = [];
7522
7522
  this._storeOriginalClasses();
7523
7523
  var rows = this._tbodyElement.querySelectorAll('tr');
7524
- var ths = this._theadElement
7524
+ // Filter th elements to only include those with data-kt-datatable-column attribute
7525
+ var allThs = this._theadElement
7525
7526
  ? this._theadElement.querySelectorAll('th')
7526
7527
  : [];
7528
+ var ths = Array.from(allThs).filter(function (th) {
7529
+ return th.hasAttribute('data-kt-datatable-column');
7530
+ });
7527
7531
  rows.forEach(function (row) {
7528
7532
  var dataRow = {};
7529
7533
  var dataRowAttribute = {};
@@ -7551,9 +7555,13 @@ var KTDataTable = /** @class */ (function (_super) {
7551
7555
  */
7552
7556
  KTDataTable.prototype._localTableHeaderInvalidate = function () {
7553
7557
  var originalData = this.getState().originalData;
7554
- var currentTableHeaders = this._theadElement
7555
- ? this._theadElement.querySelectorAll('th').length
7556
- : 0;
7558
+ // Count only th elements with data-kt-datatable-column attribute
7559
+ var allThs = this._theadElement
7560
+ ? this._theadElement.querySelectorAll('th')
7561
+ : [];
7562
+ var currentTableHeaders = Array.from(allThs).filter(function (th) {
7563
+ return th.hasAttribute('data-kt-datatable-column');
7564
+ }).length;
7557
7565
  var totalColumns = originalData.length
7558
7566
  ? Object.keys(originalData[0]).length
7559
7567
  : 0;
@@ -7803,9 +7811,14 @@ var KTDataTable = /** @class */ (function (_super) {
7803
7811
  this._noticeOnTable(this._config.infoEmpty || '');
7804
7812
  return tbodyElement;
7805
7813
  }
7806
- var ths = this._theadElement
7814
+ // Filter th elements to only include those with data-kt-datatable-column attribute
7815
+ // This prevents creating blank td elements for merged header cells (colspan/rowspan)
7816
+ var allThs = this._theadElement
7807
7817
  ? this._theadElement.querySelectorAll('th')
7808
7818
  : [];
7819
+ var ths = Array.from(allThs).filter(function (th) {
7820
+ return th.hasAttribute('data-kt-datatable-column');
7821
+ });
7809
7822
  this._data.forEach(function (item, rowIndex) {
7810
7823
  var row = document.createElement('tr');
7811
7824
  // Apply original tr class if available
@@ -7816,7 +7829,7 @@ var KTDataTable = /** @class */ (function (_super) {
7816
7829
  var dataRowAttributes_1 = _this.getState().originalDataAttributes
7817
7830
  ? _this.getState().originalDataAttributes[rowIndex]
7818
7831
  : null;
7819
- // Use the order of <th> elements to render <td>s in the correct order
7832
+ // Use the order of <th> elements with data-kt-datatable-column to render <td>s in the correct order
7820
7833
  ths.forEach(function (th, colIndex) {
7821
7834
  var colName = th.getAttribute('data-kt-datatable-column');
7822
7835
  var td = document.createElement('td');
@@ -11018,14 +11031,17 @@ var KTSelect = /** @class */ (function (_super) {
11018
11031
  }
11019
11032
  else {
11020
11033
  // Tags are not enabled AND options are selected: render normal text display.
11021
- var content = '';
11034
+ // Wrap content in .kt-select-option-text so long text truncates in single-select (see Asana #1212821478465094).
11035
+ var wrapper = document.createElement('div');
11036
+ wrapper.className = 'kt-select-option-text';
11037
+ wrapper.setAttribute('data-kt-text-container', 'true');
11022
11038
  if (this._config.displayTemplate) {
11023
- content = this.renderDisplayTemplateForSelected(this.getSelectedOptions());
11039
+ wrapper.innerHTML = this.renderDisplayTemplateForSelected(this.getSelectedOptions());
11024
11040
  }
11025
11041
  else {
11026
- content = this.getSelectedOptionsText();
11042
+ wrapper.textContent = this.getSelectedOptionsText();
11027
11043
  }
11028
- valueDisplayEl.innerHTML = content;
11044
+ valueDisplayEl.replaceChildren(wrapper);
11029
11045
  }
11030
11046
  }
11031
11047
  }