@kodaris/krubble-components 1.0.13 → 1.0.14
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/custom-elements.json +412 -400
- package/dist/krubble.bundled.js +29 -8
- package/dist/krubble.bundled.js.map +1 -1
- package/dist/krubble.bundled.min.js +15 -15
- package/dist/krubble.bundled.min.js.map +1 -1
- package/dist/krubble.umd.js +29 -8
- package/dist/krubble.umd.js.map +1 -1
- package/dist/krubble.umd.min.js +9 -9
- package/dist/krubble.umd.min.js.map +1 -1
- package/dist/table/table.d.ts +2 -0
- package/dist/table/table.d.ts.map +1 -1
- package/dist/table/table.js +29 -9
- package/dist/table/table.js.map +1 -1
- package/package.json +1 -1
package/dist/krubble.umd.js
CHANGED
|
@@ -2305,6 +2305,28 @@
|
|
|
2305
2305
|
}
|
|
2306
2306
|
updated(changedProperties) {
|
|
2307
2307
|
this._updateScrollFlags();
|
|
2308
|
+
this._syncSlottedContent();
|
|
2309
|
+
}
|
|
2310
|
+
/** Syncs light DOM content for cells with custom render functions */
|
|
2311
|
+
_syncSlottedContent() {
|
|
2312
|
+
const columns = this.getDisplayedColumns().filter(col => col.render);
|
|
2313
|
+
if (!columns.length)
|
|
2314
|
+
return;
|
|
2315
|
+
// Clear old slotted content
|
|
2316
|
+
this.querySelectorAll('[slot^="cell-"]').forEach(el => el.remove());
|
|
2317
|
+
// Create new slotted content
|
|
2318
|
+
this._data.forEach((row, rowIndex) => {
|
|
2319
|
+
columns.forEach(col => {
|
|
2320
|
+
const result = col.render(row);
|
|
2321
|
+
const content = typeof result === 'string' ? result : '';
|
|
2322
|
+
if (content) {
|
|
2323
|
+
const el = document.createElement('span');
|
|
2324
|
+
el.slot = `cell-${rowIndex}-${col.id}`;
|
|
2325
|
+
el.innerHTML = content;
|
|
2326
|
+
this.appendChild(el);
|
|
2327
|
+
}
|
|
2328
|
+
});
|
|
2329
|
+
});
|
|
2308
2330
|
}
|
|
2309
2331
|
// ----------------------------------------------------------------------------
|
|
2310
2332
|
// Public Interface
|
|
@@ -2547,12 +2569,11 @@
|
|
|
2547
2569
|
// ----------------------------------------------------------------------------
|
|
2548
2570
|
// Rendering
|
|
2549
2571
|
// ----------------------------------------------------------------------------
|
|
2550
|
-
_renderCellContent(column, row) {
|
|
2572
|
+
_renderCellContent(column, row, rowIndex) {
|
|
2551
2573
|
const value = row[column.id];
|
|
2552
2574
|
if (column.render) {
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
return typeof result === 'string' ? o$2(result) : result;
|
|
2575
|
+
// Use slot to project content from light DOM so external styles apply
|
|
2576
|
+
return b `<slot name="cell-${rowIndex}-${column.id}"></slot>`;
|
|
2556
2577
|
}
|
|
2557
2578
|
if (value === null || value === undefined) {
|
|
2558
2579
|
return '';
|
|
@@ -2780,7 +2801,7 @@
|
|
|
2780
2801
|
></div>` : A}</div>
|
|
2781
2802
|
`)}
|
|
2782
2803
|
</div>
|
|
2783
|
-
${this._data.map(row => b `
|
|
2804
|
+
${this._data.map((row, rowIndex) => b `
|
|
2784
2805
|
<div class="row">
|
|
2785
2806
|
${this.getDisplayedColumns().map((col, i) => b `
|
|
2786
2807
|
<div
|
|
@@ -2788,7 +2809,7 @@
|
|
|
2788
2809
|
style=${o$1(this._getCellStyle(col, i))}
|
|
2789
2810
|
data-column-id=${col.id}
|
|
2790
2811
|
>
|
|
2791
|
-
${this._renderCellContent(col, row)}
|
|
2812
|
+
${this._renderCellContent(col, row, rowIndex)}
|
|
2792
2813
|
</div>
|
|
2793
2814
|
`)}
|
|
2794
2815
|
</div>
|
|
@@ -2847,8 +2868,8 @@
|
|
|
2847
2868
|
}
|
|
2848
2869
|
|
|
2849
2870
|
.title {
|
|
2850
|
-
font-size:
|
|
2851
|
-
font-weight:
|
|
2871
|
+
font-size: 18px;
|
|
2872
|
+
font-weight: 600;
|
|
2852
2873
|
color: #000;
|
|
2853
2874
|
}
|
|
2854
2875
|
|