@kodaris/krubble-components 1.0.47 → 1.0.49

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.
@@ -2558,17 +2558,21 @@ let KRTable = class KRTable extends i$2 {
2558
2558
  this._data.forEach((row, rowIndex) => {
2559
2559
  columns.forEach(col => {
2560
2560
  const result = col.render(row);
2561
- const content = typeof result === 'string' ? result : '';
2562
- if (content) {
2563
- const el = document.createElement('span');
2564
- el.slot = `cell-${rowIndex}-${col.id}`;
2565
- if (col.type === 'actions') {
2566
- el.style.display = 'flex';
2567
- el.style.gap = '8px';
2568
- }
2569
- el.innerHTML = content;
2570
- this.appendChild(el);
2561
+ if (!result)
2562
+ return;
2563
+ const el = document.createElement('span');
2564
+ el.slot = `cell-${rowIndex}-${col.id}`;
2565
+ if (col.type === 'actions') {
2566
+ el.style.display = 'flex';
2567
+ el.style.gap = '8px';
2568
+ }
2569
+ if (typeof result === 'string') {
2570
+ el.innerHTML = result;
2571
2571
  }
2572
+ else {
2573
+ D(result, el);
2574
+ }
2575
+ this.appendChild(el);
2572
2576
  });
2573
2577
  });
2574
2578
  }
@@ -3113,23 +3117,34 @@ let KRTable = class KRTable extends i$2 {
3113
3117
  ></div>` : A}</div>
3114
3118
  `)}
3115
3119
  </div>
3116
- ${this._data.map((row, rowIndex) => b `
3117
- <div
3118
- class=${e$1({ 'row': true, 'row--clickable': !!this._def.rowClickable })}
3119
- @mousedown=${() => this._handleRowMouseDown()}
3120
- @click=${() => this._handleRowClick(row, rowIndex)}
3121
- >
3122
- ${this.getDisplayedColumns().map((col, i) => b `
3123
- <div
3124
- class=${e$1(this._getCellClasses(col, i))}
3125
- style=${o$1(this._getCellStyle(col, i))}
3126
- data-column-id=${col.id}
3127
- >
3128
- ${this._renderCellContent(col, row, rowIndex)}
3129
- </div>
3130
- `)}
3131
- </div>
3132
- `)}
3120
+ ${this._data.map((row, rowIndex) => {
3121
+ const cells = this.getDisplayedColumns().map((col, i) => b `
3122
+ <div
3123
+ class=${e$1(this._getCellClasses(col, i))}
3124
+ style=${o$1(this._getCellStyle(col, i))}
3125
+ data-column-id=${col.id}
3126
+ >
3127
+ ${this._renderCellContent(col, row, rowIndex)}
3128
+ </div>
3129
+ `);
3130
+ if (this._def.rowHref) {
3131
+ return b `
3132
+ <a
3133
+ href=${this._def.rowHref(row)}
3134
+ class=${e$1({ 'row': true, 'row--clickable': true, 'row--link': true })}
3135
+ @mousedown=${() => this._handleRowMouseDown()}
3136
+ @click=${() => this._handleRowClick(row, rowIndex)}
3137
+ >${cells}</a>
3138
+ `;
3139
+ }
3140
+ return b `
3141
+ <div
3142
+ class=${e$1({ 'row': true, 'row--clickable': !!this._def.rowClickable })}
3143
+ @mousedown=${() => this._handleRowMouseDown()}
3144
+ @click=${() => this._handleRowClick(row, rowIndex)}
3145
+ >${cells}</div>
3146
+ `;
3147
+ })}
3133
3148
  </div>
3134
3149
  </div>
3135
3150
  </div>
@@ -3478,6 +3493,11 @@ KRTable.styles = [krBaseCSS, i$5 `
3478
3493
  cursor: pointer;
3479
3494
  }
3480
3495
 
3496
+ .row--link {
3497
+ color: inherit;
3498
+ text-decoration: none;
3499
+ }
3500
+
3481
3501
  .header-row {
3482
3502
  display: contents;
3483
3503
  }