@rozie-ui/data-table-lit 0.3.1 → 0.4.0

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/index.cjs CHANGED
@@ -24,6 +24,39 @@ const wrapAggregationFn = (fn) => {
24
24
  }
25
25
  };
26
26
  };
27
+ const collectNestedDefs = (list, out) => {
28
+ if (!Array.isArray(list)) return;
29
+ for (const d of list) {
30
+ if (!d || d.id == null) continue;
31
+ const id = String(d.id);
32
+ if (!(id in out)) out[id] = d;
33
+ if (Array.isArray(d.columns)) collectNestedDefs(d.columns, out);
34
+ }
35
+ };
36
+ const indexDefsById = (defs) => {
37
+ const out = Object.create(null);
38
+ if (!Array.isArray(defs)) return out;
39
+ for (const d of defs) {
40
+ if (!d || d.id == null) continue;
41
+ out[String(d.id)] = d;
42
+ }
43
+ for (const d of defs) if (d && Array.isArray(d.columns)) collectNestedDefs(d.columns, out);
44
+ return out;
45
+ };
46
+ const collectGroupableLeafDefs = (defs) => {
47
+ const out = [];
48
+ if (!Array.isArray(defs)) return out;
49
+ for (const d of defs) {
50
+ if (!d) continue;
51
+ if (Array.isArray(d.columns)) {
52
+ out.push(...collectGroupableLeafDefs(d.columns));
53
+ continue;
54
+ }
55
+ if (d.groupable === false) continue;
56
+ out.push(d);
57
+ }
58
+ return out;
59
+ };
27
60
  //#endregion
28
61
  //#region src/helpers/indexMath.ts
29
62
  const clamp = (v, lo, hi) => v < lo ? lo : v > hi ? hi : v;
@@ -367,12 +400,16 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
367
400
  this._hasSlotDefault = false;
368
401
  this._hasSlotGroupBar = false;
369
402
  this._hasSlotSelectAll = false;
403
+ this._hasSlotDynamicColHeader = false;
404
+ this._hasSlotDynamicFilter = false;
405
+ this._hasSlotSelectCell = false;
406
+ this._hasSlotDynamicCell = false;
407
+ this._hasSlotDynamicEditor = false;
408
+ this._hasSlotDetail = false;
370
409
  this._hasSlotColHeader = false;
371
410
  this._hasSlotFilter = false;
372
- this._hasSlotSelectCell = false;
373
411
  this._hasSlotCell = false;
374
412
  this._hasSlotEditor = false;
375
- this._hasSlotDetail = false;
376
413
  this._disconnectCleanups = [];
377
414
  this._rozieTornDown = false;
378
415
  this.table = null;
@@ -468,6 +505,7 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
468
505
  this.columnDefsCache = null;
469
506
  this.columnDefsCacheColumnsRef = void 0;
470
507
  this.columnDefsCacheColRegRef = void 0;
508
+ this.columnDefsIndexCache = null;
471
509
  this.columnDefs = () => {
472
510
  const cfg = this.columns || [];
473
511
  const reg = this._colReg.value || {};
@@ -511,8 +549,13 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
511
549
  this.columnDefsCache = out;
512
550
  this.columnDefsCacheColumnsRef = this.columns;
513
551
  this.columnDefsCacheColRegRef = this._colReg.value;
552
+ this.columnDefsIndexCache = indexDefsById(out);
514
553
  return out;
515
554
  };
555
+ this.defIndex = () => {
556
+ this.columnDefs();
557
+ return this.columnDefsIndexCache || Object.create(null);
558
+ };
516
559
  this.SELECT_COL_ID = "__rdt_select";
517
560
  this.EXPANDER_COL_ID = "__rdt_expander";
518
561
  this.selectionEnabled = () => this.selectionMode === "single" || this.selectionMode === "multiple";
@@ -1254,9 +1297,9 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
1254
1297
  return "";
1255
1298
  };
1256
1299
  this.defFor = (colId) => {
1257
- const defs = this.columnDefs();
1258
- for (const d of defs) if (d.id === colId) return d;
1259
- return null;
1300
+ if (colId == null) return null;
1301
+ const d = this.defIndex()[String(colId)];
1302
+ return d != null ? d : null;
1260
1303
  };
1261
1304
  this.visibleCellsFor = (row) => this._rowModelVer.value >= 0 ? row.getVisibleCells() : [];
1262
1305
  this.editMetaOf = (colId) => {
@@ -1275,8 +1318,6 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
1275
1318
  const m = this.editMetaOf(colId);
1276
1319
  return m && m.editorOptions != null ? m.editorOptions : [];
1277
1320
  };
1278
- this.hasEditorSlot = (colId) => this.editorTypeOf(colId) === "custom" && !!(this._hasSlotEditor || this.editor !== void 0);
1279
- this.hasFilterSlot = () => !!(this._hasSlotFilter || this.filter !== void 0);
1280
1321
  this.columnIsFilterable = (colId) => {
1281
1322
  const d = this.defFor(colId);
1282
1323
  return !!(d && d.filterable);
@@ -1285,11 +1326,9 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
1285
1326
  const d = this.defFor(colId);
1286
1327
  return d ? d.header : colId;
1287
1328
  };
1288
- this.headerWidth = (colId) => {
1289
- if (this.tick() < 0 || !this.table) return null;
1290
- const col = this.table.getColumn(colId);
1291
- if (!col) return null;
1292
- const w = col.getSize();
1329
+ this.headerWidth = (header) => {
1330
+ if (this.tick() < 0 || !header || typeof header.getSize !== "function") return null;
1331
+ const w = header.getSize();
1293
1332
  return w != null && w > 0 ? w + "px" : null;
1294
1333
  };
1295
1334
  this.onResizeStart = (colId, evt) => {
@@ -1358,11 +1397,11 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
1358
1397
  if (side === "right") return "position:sticky;right:" + (col.getAfter ? col.getAfter("right") : 0) + "px;z-index:" + zIndex + ";";
1359
1398
  return "";
1360
1399
  };
1361
- this.thStyle = (colId) => {
1400
+ this.thStyle = (header) => {
1362
1401
  let s = "";
1363
- const w = this.headerWidth(colId);
1402
+ const w = this.headerWidth(header);
1364
1403
  if (w) s += "width:" + w + ";";
1365
- s += this.pinStyle(colId, 2);
1404
+ s += this.pinStyle(header && header.column ? header.column.id : null, 2);
1366
1405
  return s;
1367
1406
  };
1368
1407
  this.onGlobalFilterInput = (evt) => {
@@ -1433,22 +1472,56 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
1433
1472
  return base;
1434
1473
  };
1435
1474
  this.rowIsGrouped = (row) => !!(this.tick() >= 0 && row && row.getIsGrouped && row.getIsGrouped());
1475
+ this.rowIndexIsGrouped = (rowIndex) => this.rowIsGrouped((this._rows.value || [])[rowIndex]);
1436
1476
  this.groupingActive = () => this.tick() >= 0 && (this.currentState().grouping || []).length > 0;
1437
1477
  this.cellIsGrouped = (cellCtx) => !!(this.tick() >= 0 && cellCtx && cellCtx.getIsGrouped && cellCtx.getIsGrouped());
1438
1478
  this.cellIsAggregated = (cellCtx) => !!(this.tick() >= 0 && cellCtx && cellCtx.getIsAggregated && cellCtx.getIsAggregated());
1439
1479
  this.cellIsPlaceholder = (cellCtx) => !!(this.tick() >= 0 && cellCtx && cellCtx.getIsPlaceholder && cellCtx.getIsPlaceholder());
1440
- this.groupSubRowCount = (row) => row && row.getLeafRows ? row.getLeafRows().length : row && row.subRows ? row.subRows.length : 0;
1480
+ this.groupSubRowCount = (row) => {
1481
+ if (row && row.getLeafRows) {
1482
+ const leaves = row.getLeafRows();
1483
+ let n = 0;
1484
+ for (let i = 0; i < leaves.length; i++) {
1485
+ const r = leaves[i];
1486
+ if (!(r && r.getIsGrouped && r.getIsGrouped())) n = n + 1;
1487
+ }
1488
+ return n;
1489
+ }
1490
+ return row && row.subRows ? row.subRows.length : 0;
1491
+ };
1492
+ this.groupRowDescriptorCache = null;
1493
+ this.groupRowDescriptorCacheVer = void 0;
1494
+ this.groupRowDescriptor = (row) => {
1495
+ const ver = this._rowModelVer.value;
1496
+ if (!this.groupRowDescriptorCache || this.groupRowDescriptorCacheVer !== ver) {
1497
+ this.groupRowDescriptorCache = Object.create(null);
1498
+ this.groupRowDescriptorCacheVer = ver;
1499
+ }
1500
+ const key = String(row.id);
1501
+ let d = this.groupRowDescriptorCache[key];
1502
+ if (!d) {
1503
+ const groupingColumnId = row.groupingColumnId != null ? row.groupingColumnId : "";
1504
+ const groupingValue = row.getGroupingValue ? row.getGroupingValue(groupingColumnId) : row.groupingValue;
1505
+ d = {
1506
+ isGroupRow: true,
1507
+ groupId: row.id,
1508
+ groupingColumnId,
1509
+ groupingValue,
1510
+ leafCount: this.groupSubRowCount(row)
1511
+ };
1512
+ this.groupRowDescriptorCache[key] = d;
1513
+ }
1514
+ return d;
1515
+ };
1516
+ this.cellSlotRow = (row) => this.rowIsGrouped(row) ? this.groupRowDescriptor(row) : row ? row.original : null;
1441
1517
  this.groupingKeys = () => this.currentState().grouping || [];
1442
1518
  this.groupableColumns = () => {
1443
1519
  const out = [];
1444
- const defs = this.columnDefs();
1445
- for (const d of defs) {
1446
- if (!d || d.groupable === false) continue;
1447
- out.push({
1448
- id: d.id,
1449
- label: d.header != null ? d.header : d.id
1450
- });
1451
- }
1520
+ const defs = collectGroupableLeafDefs(this.columnDefs());
1521
+ for (const d of defs) out.push({
1522
+ id: d.id,
1523
+ label: d.header != null ? d.header : d.id
1524
+ });
1452
1525
  return out;
1453
1526
  };
1454
1527
  this.stopEvent = (evt) => {
@@ -2446,11 +2519,13 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
2446
2519
  for (let gr = 0; gr < grid.length; gr++) {
2447
2520
  const r = originRow + gr;
2448
2521
  if (r > maxRow) break;
2522
+ const rowGrouped = this.rowIndexIsGrouped(r);
2449
2523
  const cols = grid[gr] || [];
2450
2524
  for (let gc = 0; gc < cols.length; gc++) {
2451
2525
  const c = originCol + gc;
2452
2526
  if (c > maxCol) break;
2453
2527
  total = total + 1;
2528
+ if (rowGrouped) continue;
2454
2529
  const colId = this.columnIdAt(r, c);
2455
2530
  if (colId == null || !this.columnEditable(colId)) continue;
2456
2531
  const rowObj = this.rowOriginalAt(r);
@@ -2632,8 +2707,9 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
2632
2707
  this.fillEdgeScrollRaf = null;
2633
2708
  }
2634
2709
  };
2635
- this.cellIndexFromPoint = (clientX, clientY) => {
2636
- if (typeof document === "undefined" || !document.elementFromPoint) return null;
2710
+ this.FILL_HITTEST_PROBE_RADIUS_PX = 8;
2711
+ this.FILL_HITTEST_PROBE_STEP_PX = 2;
2712
+ this.resolveCellAt = (clientX, clientY) => {
2637
2713
  let el = document.elementFromPoint(clientX, clientY);
2638
2714
  while (el && el.shadowRoot && el.shadowRoot.elementFromPoint) {
2639
2715
  const inner = el.shadowRoot.elementFromPoint(clientX, clientY);
@@ -2654,6 +2730,18 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
2654
2730
  c
2655
2731
  };
2656
2732
  };
2733
+ this.cellIndexFromPoint = (clientX, clientY) => {
2734
+ if (typeof document === "undefined" || !document.elementFromPoint) return null;
2735
+ const direct = this.resolveCellAt(clientX, clientY);
2736
+ if (direct) return direct;
2737
+ for (let d = this.FILL_HITTEST_PROBE_STEP_PX; d <= this.FILL_HITTEST_PROBE_RADIUS_PX; d += this.FILL_HITTEST_PROBE_STEP_PX) {
2738
+ const right = this.resolveCellAt(clientX + d, clientY);
2739
+ if (right) return right;
2740
+ const left = this.resolveCellAt(clientX - d, clientY);
2741
+ if (left) return left;
2742
+ }
2743
+ return null;
2744
+ };
2657
2745
  this.onFillHandlePointerDown = (e) => {
2658
2746
  if (!e) return;
2659
2747
  if (e.preventDefault) e.preventDefault();
@@ -2760,11 +2848,13 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
2760
2848
  return cell && cell.column ? cell.column.id : null;
2761
2849
  };
2762
2850
  this.isActiveCellEditable = () => {
2851
+ if (this.rowIndexIsGrouped(this._activeRow.value)) return false;
2763
2852
  const colId = this.activeCellColumnId();
2764
2853
  return colId != null && this.columnEditable(colId);
2765
2854
  };
2766
2855
  this.isEditing = (rowIndex, colIndex) => {
2767
2856
  if (this._editVer.value < 0) return false;
2857
+ if (this.rowIndexIsGrouped(rowIndex)) return false;
2768
2858
  if (this._editingRowIndex.value != null && this._editingRowIndex.value === rowIndex) {
2769
2859
  const colId = this.columnIdAt(rowIndex, colIndex);
2770
2860
  return colId != null && this.columnEditable(colId);
@@ -2822,12 +2912,24 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
2822
2912
  const row = (this._rows.value || [])[this._editingRow.value];
2823
2913
  return row ? row.id : null;
2824
2914
  };
2825
- this.focusEditorWhenReady = (selectAll = true) => {
2915
+ this.resolveEditFocusCellEl = (rowIndex, colIndex) => {
2916
+ if (rowIndex == null || colIndex == null || rowIndex < 0 || colIndex < 0) return null;
2917
+ return this.resolveCellEl(String(rowIndex), colIndex);
2918
+ };
2919
+ this.focusEditorWhenReady = (rowIndex, colIndex, selectAll = true) => {
2826
2920
  if (!this.gridRoot) return;
2827
- if (this._editFocusColId.value != null && this.hasEditorSlot(this._editFocusColId.value)) return;
2828
2921
  let attempts = 0;
2829
2922
  const tryFocus = () => {
2830
- const el = this.gridRoot ? this.gridRoot.querySelector("[data-editing-cell]") : null;
2923
+ const cellEl = this.resolveEditFocusCellEl(rowIndex, colIndex);
2924
+ const el = cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell][data-builtin-editor]") : null;
2925
+ if (!el) {
2926
+ if (cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell]") : null) return;
2927
+ attempts = attempts + 1;
2928
+ if (attempts >= 30) return;
2929
+ if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
2930
+ else setTimeout(tryFocus, 16);
2931
+ return;
2932
+ }
2831
2933
  const ae = this.gridRoot && this.gridRoot.getRootNode ? this.gridRoot.getRootNode().activeElement : null;
2832
2934
  if (ae && el && ae !== el && ae.closest && this.gridRoot.contains(ae) && ae.hasAttribute && ae.hasAttribute("data-editing-cell")) {
2833
2935
  const aeCell = ae.closest("[data-grid-cell]");
@@ -2836,17 +2938,10 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
2836
2938
  const elCol = elCell ? elCell.getAttribute("data-col-index") : null;
2837
2939
  if (aeCol != null && aeCol !== elCol) return;
2838
2940
  }
2839
- if (el) {
2840
- el.focus();
2841
- if (selectAll && el.select) try {
2842
- el.select();
2843
- } catch (e) {}
2844
- return;
2845
- }
2846
- attempts = attempts + 1;
2847
- if (attempts >= 30) return;
2848
- if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
2849
- else setTimeout(tryFocus, 16);
2941
+ el.focus();
2942
+ if (selectAll && el.select) try {
2943
+ el.select();
2944
+ } catch (e) {}
2850
2945
  };
2851
2946
  if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
2852
2947
  else setTimeout(tryFocus, 0);
@@ -2864,6 +2959,7 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
2864
2959
  return cell ? cell.getValue() : null;
2865
2960
  };
2866
2961
  this.beginEdit = (rowIndex, colIndex, seed) => {
2962
+ if (this.rowIndexIsGrouped(rowIndex)) return;
2867
2963
  const colId = this.columnIdAt(rowIndex, colIndex);
2868
2964
  if (colId == null || !this.columnEditable(colId)) return;
2869
2965
  this.committedThisSession = false;
@@ -2876,7 +2972,7 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
2876
2972
  this._activeInControl.value = true;
2877
2973
  this._editVer.value = this._editVer.value + 1;
2878
2974
  this._editFocusColId.value = colId;
2879
- this.focusEditorWhenReady(seed == null);
2975
+ this.focusEditorWhenReady(rowIndex, colIndex, seed == null);
2880
2976
  };
2881
2977
  this.focusCellWhenReady = (row, col) => {
2882
2978
  if (!this.gridRoot) return;
@@ -2945,7 +3041,7 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
2945
3041
  const err = this.runValidator(colId, newValue, rowOriginal);
2946
3042
  if (err !== true) {
2947
3043
  this.setInvalid(err);
2948
- this.focusEditorWhenReady();
3044
+ this.focusEditorWhenReady(this._editingRow.value, this._editingCol.value);
2949
3045
  return false;
2950
3046
  }
2951
3047
  this.setInvalid("");
@@ -2981,6 +3077,7 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
2981
3077
  return true;
2982
3078
  };
2983
3079
  this.toggleActiveBooleanCell = () => {
3080
+ if (this.rowIndexIsGrouped(this._activeRow.value)) return;
2984
3081
  const colId = this.columnIdAt(this._activeRow.value, this._activeColIndex.value);
2985
3082
  if (colId == null || !this.columnEditable(colId)) return;
2986
3083
  const row = (this._rows.value || [])[this._activeRow.value];
@@ -3046,12 +3143,10 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
3046
3143
  };
3047
3144
  this.focusRowEditorAt = (rowIndex, colIndex) => {
3048
3145
  if (!this.gridRoot) return;
3049
- const colId = this.columnIdAt(rowIndex, colIndex);
3050
- if (colId != null && this.hasEditorSlot(colId)) return;
3051
3146
  let attempts = 0;
3052
3147
  const tryFocus = () => {
3053
3148
  const cellEl = this.resolveCellEl(String(rowIndex), colIndex);
3054
- const ed = cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell]") : null;
3149
+ const ed = cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell][data-builtin-editor]") : null;
3055
3150
  if (ed) {
3056
3151
  ed.focus();
3057
3152
  if (ed.select) try {
@@ -3059,6 +3154,7 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
3059
3154
  } catch (e) {}
3060
3155
  return;
3061
3156
  }
3157
+ if (cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell]") : null) return;
3062
3158
  attempts = attempts + 1;
3063
3159
  if (attempts >= 30) return;
3064
3160
  if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
@@ -3070,6 +3166,7 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
3070
3166
  this.beginRowEdit = (row) => {
3071
3167
  const rowIndex = this.rowIndexOf(row);
3072
3168
  if (rowIndex < 0) return;
3169
+ if (this.rowIndexIsGrouped(rowIndex)) return;
3073
3170
  const editable = this.editableColumnsForRow(rowIndex);
3074
3171
  if (editable.length === 0) return;
3075
3172
  this.committedThisSession = false;
@@ -3089,7 +3186,7 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
3089
3186
  this._activeInControl.value = true;
3090
3187
  this._editVer.value = this._editVer.value + 1;
3091
3188
  this._editFocusColId.value = editable[0].colId;
3092
- this.focusEditorWhenReady();
3189
+ this.focusEditorWhenReady(rowIndex, editable[0].colIndex);
3093
3190
  };
3094
3191
  this.commitRow = () => {
3095
3192
  if (this._editingRowIndex.value == null) return false;
@@ -3874,10 +3971,10 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
3874
3971
  }
3875
3972
  }
3876
3973
  {
3877
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"colHeader\"]");
3974
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3878
3975
  if (slotEl !== null && slotEl !== void 0) {
3879
3976
  const update = () => {
3880
- this._hasSlotColHeader = this._slotColHeaderElements.length > 0;
3977
+ this._hasSlotDynamicColHeader = this._slotDynamicColHeaderElements.length > 0;
3881
3978
  };
3882
3979
  slotEl.addEventListener("slotchange", update);
3883
3980
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3885,10 +3982,10 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
3885
3982
  }
3886
3983
  }
3887
3984
  {
3888
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"filter\"]");
3985
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3889
3986
  if (slotEl !== null && slotEl !== void 0) {
3890
3987
  const update = () => {
3891
- this._hasSlotFilter = this._slotFilterElements.length > 0;
3988
+ this._hasSlotDynamicFilter = this._slotDynamicFilterElements.length > 0;
3892
3989
  };
3893
3990
  slotEl.addEventListener("slotchange", update);
3894
3991
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3907,10 +4004,10 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
3907
4004
  }
3908
4005
  }
3909
4006
  {
3910
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"cell\"]");
4007
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3911
4008
  if (slotEl !== null && slotEl !== void 0) {
3912
4009
  const update = () => {
3913
- this._hasSlotCell = this._slotCellElements.length > 0;
4010
+ this._hasSlotDynamicCell = this._slotDynamicCellElements.length > 0;
3914
4011
  };
3915
4012
  slotEl.addEventListener("slotchange", update);
3916
4013
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3918,10 +4015,10 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
3918
4015
  }
3919
4016
  }
3920
4017
  {
3921
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"editor\"]");
4018
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3922
4019
  if (slotEl !== null && slotEl !== void 0) {
3923
4020
  const update = () => {
3924
- this._hasSlotEditor = this._slotEditorElements.length > 0;
4021
+ this._hasSlotDynamicEditor = this._slotDynamicEditorElements.length > 0;
3925
4022
  };
3926
4023
  slotEl.addEventListener("slotchange", update);
3927
4024
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3939,17 +4036,65 @@ let DataTable = class DataTable extends (0, _lit_labs_preact_signals.SignalWatch
3939
4036
  update();
3940
4037
  }
3941
4038
  }
4039
+ {
4040
+ const slotEl = this.shadowRoot?.querySelector("slot[name=\"colHeader\"]");
4041
+ if (slotEl !== null && slotEl !== void 0) {
4042
+ const update = () => {
4043
+ this._hasSlotColHeader = this._slotColHeaderElements.length > 0;
4044
+ };
4045
+ slotEl.addEventListener("slotchange", update);
4046
+ this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
4047
+ update();
4048
+ }
4049
+ }
4050
+ {
4051
+ const slotEl = this.shadowRoot?.querySelector("slot[name=\"filter\"]");
4052
+ if (slotEl !== null && slotEl !== void 0) {
4053
+ const update = () => {
4054
+ this._hasSlotFilter = this._slotFilterElements.length > 0;
4055
+ };
4056
+ slotEl.addEventListener("slotchange", update);
4057
+ this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
4058
+ update();
4059
+ }
4060
+ }
4061
+ {
4062
+ const slotEl = this.shadowRoot?.querySelector("slot[name=\"cell\"]");
4063
+ if (slotEl !== null && slotEl !== void 0) {
4064
+ const update = () => {
4065
+ this._hasSlotCell = this._slotCellElements.length > 0;
4066
+ };
4067
+ slotEl.addEventListener("slotchange", update);
4068
+ this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
4069
+ update();
4070
+ }
4071
+ }
4072
+ {
4073
+ const slotEl = this.shadowRoot?.querySelector("slot[name=\"editor\"]");
4074
+ if (slotEl !== null && slotEl !== void 0) {
4075
+ const update = () => {
4076
+ this._hasSlotEditor = this._slotEditorElements.length > 0;
4077
+ };
4078
+ slotEl.addEventListener("slotchange", update);
4079
+ this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
4080
+ update();
4081
+ }
4082
+ }
3942
4083
  }
3943
4084
  connectedCallback() {
3944
4085
  this._hasSlotDefault = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
3945
4086
  this._hasSlotGroupBar = Array.from(this.children).some((el) => el.getAttribute("slot") === "groupBar");
3946
4087
  this._hasSlotSelectAll = Array.from(this.children).some((el) => el.getAttribute("slot") === "selectAll");
4088
+ this._hasSlotDynamicColHeader = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
4089
+ this._hasSlotDynamicFilter = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
4090
+ this._hasSlotSelectCell = Array.from(this.children).some((el) => el.getAttribute("slot") === "selectCell");
4091
+ this._hasSlotDynamicCell = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
4092
+ this._hasSlotDynamicEditor = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
4093
+ this._hasSlotDetail = Array.from(this.children).some((el) => el.getAttribute("slot") === "detail");
3947
4094
  this._hasSlotColHeader = Array.from(this.children).some((el) => el.getAttribute("slot") === "colHeader");
3948
4095
  this._hasSlotFilter = Array.from(this.children).some((el) => el.getAttribute("slot") === "filter");
3949
- this._hasSlotSelectCell = Array.from(this.children).some((el) => el.getAttribute("slot") === "selectCell");
3950
4096
  this._hasSlotCell = Array.from(this.children).some((el) => el.getAttribute("slot") === "cell");
3951
4097
  this._hasSlotEditor = Array.from(this.children).some((el) => el.getAttribute("slot") === "editor");
3952
- this._hasSlotDetail = Array.from(this.children).some((el) => el.getAttribute("slot") === "detail");
3953
4098
  super.connectedCallback();
3954
4099
  if (this.hasUpdated && this._rozieTornDown) {
3955
4100
  this._rozieTornDown = false;
@@ -4211,7 +4356,7 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4211
4356
  "rdt-expander-th": this.isExpanderColumn(wh.header.column.id),
4212
4357
  "rdt-th-resizing": this.columnIsResizing(wh.header.column.id),
4213
4358
  "rdt-cell-active": this.isActiveCell("__header", this.headerColIndexOf(hg, wh.header), hgLevel)
4214
- }).filter(([, v]) => v).map(([k]) => k).join(" ")}" role="columnheader" data-col=${(0, _rozie_runtime_lit.rozieAttr)(wh.header.column.id)} data-grid-cell="" data-row="__header" data-header-level=${(0, _rozie_runtime_lit.rozieAttr)(hgLevel)} colspan=${(0, _rozie_runtime_lit.rozieAttr)(wh.span > 1 ? wh.span : null)} data-col-index=${(0, _rozie_runtime_lit.rozieAttr)(this.headerColIndexOf(hg, wh.header))} tabindex=${(0, _rozie_runtime_lit.rozieAttr)(this.cellTabindex("__header", this.headerColIndexOf(hg, wh.header), hgLevel))} aria-sort=${(0, _rozie_runtime_lit.rozieAttr)(this.ariaSortFor(wh.header.column.id))} style=${(0, _rozie_runtime_lit.rozieStyle)(this.thStyle(wh.header.column.id))} data-rozie-s-d5dcab4c>
4359
+ }).filter(([, v]) => v).map(([k]) => k).join(" ")}" role="columnheader" data-col=${(0, _rozie_runtime_lit.rozieAttr)(wh.header.column.id)} data-grid-cell="" data-row="__header" data-header-level=${(0, _rozie_runtime_lit.rozieAttr)(hgLevel)} colspan=${(0, _rozie_runtime_lit.rozieAttr)(wh.span > 1 ? wh.span : null)} data-col-index=${(0, _rozie_runtime_lit.rozieAttr)(this.headerColIndexOf(hg, wh.header))} tabindex=${(0, _rozie_runtime_lit.rozieAttr)(this.cellTabindex("__header", this.headerColIndexOf(hg, wh.header), hgLevel))} aria-sort=${(0, _rozie_runtime_lit.rozieAttr)(this.ariaSortFor(wh.header.column.id))} style=${(0, _rozie_runtime_lit.rozieStyle)(this.thStyle(wh.header))} data-rozie-s-d5dcab4c>
4215
4360
  ${this.isSelectColumn(wh.header.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4216
4361
  ${this.selectAll !== void 0 ? this.selectAll({
4217
4362
  checked: this.isAllRowsSelected(),
@@ -4235,7 +4380,22 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4235
4380
  this.onHeaderSort(wh.header.column.id, $event);
4236
4381
  }} data-rozie-s-d5dcab4c>
4237
4382
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4238
- ${this.colHeader !== void 0 ? this.colHeader({
4383
+ ${this.rozieSlots?.[`colHeader-${wh.header.column.id}`] !== void 0 ? this.rozieSlots?.[`colHeader-${wh.header.column.id}`]({
4384
+ columnId: wh.header.column.id,
4385
+ column: wh.header.column,
4386
+ label: this.headerLabel(wh.header.column.id)
4387
+ }) : lit.html`<slot name="${`colHeader-${wh.header.column.id}`}" data-rozie-params=${(() => {
4388
+ try {
4389
+ return JSON.stringify({
4390
+ columnId: wh.header.column.id,
4391
+ column: wh.header.column,
4392
+ label: this.headerLabel(wh.header.column.id)
4393
+ });
4394
+ } catch {
4395
+ return "{}";
4396
+ }
4397
+ })()}>
4398
+ ${this.colHeader !== void 0 ? this.colHeader({
4239
4399
  columnId: wh.header.column.id,
4240
4400
  column: wh.header.column,
4241
4401
  label: this.headerLabel(wh.header.column.id)
@@ -4250,11 +4410,27 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4250
4410
  return "{}";
4251
4411
  }
4252
4412
  })()}>${(0, _rozie_runtime_lit.rozieDisplay)(this.headerLabel(wh.header.column.id))}</slot>`}
4413
+ </slot>`}
4253
4414
  </span>
4254
4415
  <span class="rdt-sort-ind" aria-hidden="true" data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)(this.sortIndicator(wh.header.column.id))}</span>
4255
4416
  </button>` : lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4256
4417
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4257
- ${this.colHeader !== void 0 ? this.colHeader({
4418
+ ${this.rozieSlots?.[`colHeader-${wh.header.column.id}`] !== void 0 ? this.rozieSlots?.[`colHeader-${wh.header.column.id}`]({
4419
+ columnId: wh.header.column.id,
4420
+ column: wh.header.column,
4421
+ label: this.headerLabel(wh.header.column.id)
4422
+ }) : lit.html`<slot name="${`colHeader-${wh.header.column.id}`}" data-rozie-params=${(() => {
4423
+ try {
4424
+ return JSON.stringify({
4425
+ columnId: wh.header.column.id,
4426
+ column: wh.header.column,
4427
+ label: this.headerLabel(wh.header.column.id)
4428
+ });
4429
+ } catch {
4430
+ return "{}";
4431
+ }
4432
+ })()}>
4433
+ ${this.colHeader !== void 0 ? this.colHeader({
4258
4434
  columnId: wh.header.column.id,
4259
4435
  column: wh.header.column,
4260
4436
  label: this.headerLabel(wh.header.column.id)
@@ -4269,6 +4445,7 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4269
4445
  return "{}";
4270
4446
  }
4271
4447
  })()}>${(0, _rozie_runtime_lit.rozieDisplay)(this.headerLabel(wh.header.column.id))}</slot>`}
4448
+ </slot>`}
4272
4449
  </span>
4273
4450
  </span>`}<rozie-popover trigger="click" placement="bottom-end" strategy="fixed" .offset=${4} data-rozie-s-d5dcab4c><button class="rdt-col-menu-trigger" type="button" aria-label=${(0, _rozie_runtime_lit.rozieAttr)("Column options for " + this.headerLabel(wh.header.column.id))} data-rozie-s-d5dcab4c slot="anchor">⋯</button><div class="rdt-col-menu" role="menu" data-rozie-s-d5dcab4c>
4274
4451
  <button class="rdt-col-menu-item" type="button" role="menuitem" aria-pressed=${this.columnPinSide(wh.header.column.id) === "left"} @click=${($event) => {
@@ -4297,12 +4474,26 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4297
4474
  ${this.hasAnyFilterableColumn() ? lit.html`<tr class="rdt-filter-row" data-rozie-s-d5dcab4c>
4298
4475
  ${this.colsWindowed() ? lit.html`<th class="rdt-col-spacer" aria-hidden="true" style=${(0, _rozie_runtime_lit.rozieStyle)("width:" + this.colPadLeft() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c></th>` : lit.nothing}${(0, lit_directives_repeat_js.repeat)(this.windowedHeadersFor(this._headerGroups.value[this._headerGroups.value.length - 1], this._headerGroups.value.length - 1), (wh, _idx) => wh.header.id, (wh, _idx) => lit.html`<th class="rdt-filter-cell" role="presentation" data-col=${(0, _rozie_runtime_lit.rozieAttr)(wh.header.column.id)} style=${(0, _rozie_runtime_lit.rozieStyle)(this.pinStyle(wh.header.column.id))} data-rozie-s-d5dcab4c>
4299
4476
  ${this.isSelectColumn(wh.header.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : this.isExpanderColumn(wh.header.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4300
- ${this.columnIsFilterable(wh.header.column.id) && !this.hasFilterSlot() ? lit.html`<input class="rdt-col-filter" type="text" aria-label=${(0, _rozie_runtime_lit.rozieAttr)("Filter " + this.headerLabel(wh.header.column.id))} .value=${this.columnFilterValue(wh.header.column.id)} @input=${($event) => {
4301
- this.onColumnFilterInput(wh.header.column.id, $event);
4302
- }} @click=${($event) => {
4303
- this.stopEvent($event);
4304
- }} data-rozie-s-d5dcab4c />` : lit.nothing}${this.columnIsFilterable(wh.header.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4305
- ${this.filter !== void 0 ? this.filter({
4477
+ ${this.columnIsFilterable(wh.header.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4478
+ ${this.rozieSlots?.[`filter-${wh.header.column.id}`] !== void 0 ? this.rozieSlots?.[`filter-${wh.header.column.id}`]({
4479
+ columnId: wh.header.column.id,
4480
+ value: this.columnFilterValue(wh.header.column.id),
4481
+ uniqueValues: this.getFacetedUniqueValues(wh.header.column.id),
4482
+ minMax: this.getFacetedMinMaxValues(wh.header.column.id),
4483
+ setFilter: this.setColumnFilter
4484
+ }) : lit.html`<slot name="${`filter-${wh.header.column.id}`}" data-rozie-params=${(() => {
4485
+ try {
4486
+ return JSON.stringify({
4487
+ columnId: wh.header.column.id,
4488
+ value: this.columnFilterValue(wh.header.column.id),
4489
+ uniqueValues: this.getFacetedUniqueValues(wh.header.column.id),
4490
+ minMax: this.getFacetedMinMaxValues(wh.header.column.id)
4491
+ });
4492
+ } catch {
4493
+ return "{}";
4494
+ }
4495
+ })()} @rozie-default-set-filter=${($event) => this.setColumnFilter($event.detail)}>
4496
+ ${this.filter !== void 0 ? this.filter({
4306
4497
  columnId: wh.header.column.id,
4307
4498
  value: this.columnFilterValue(wh.header.column.id),
4308
4499
  uniqueValues: this.getFacetedUniqueValues(wh.header.column.id),
@@ -4319,7 +4510,14 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4319
4510
  } catch {
4320
4511
  return "{}";
4321
4512
  }
4322
- })()} @rozie-filter-set-filter=${($event) => this.setColumnFilter($event.detail)}></slot>`}
4513
+ })()} @rozie-filter-set-filter=${($event) => this.setColumnFilter($event.detail)}>
4514
+ <input class="rdt-col-filter" type="text" aria-label=${(0, _rozie_runtime_lit.rozieAttr)("Filter " + this.headerLabel(wh.header.column.id))} .value=${this.columnFilterValue(wh.header.column.id)} @input=${($event) => {
4515
+ this.onColumnFilterInput(wh.header.column.id, $event);
4516
+ }} @click=${($event) => {
4517
+ this.stopEvent($event);
4518
+ }} data-rozie-s-d5dcab4c />
4519
+ </slot>`}
4520
+ </slot>`}
4323
4521
  </span>` : lit.nothing}</span>`}</th>`)}
4324
4522
  ${this.colsWindowed() ? lit.html`<th class="rdt-col-spacer" aria-hidden="true" style=${(0, _rozie_runtime_lit.rozieStyle)("width:" + this.colPadRight() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c></th>` : lit.nothing}</tr>` : lit.nothing}</thead>
4325
4523
 
@@ -4349,13 +4547,13 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4349
4547
  this.onToggleExpand(wr.row, $event);
4350
4548
  }} data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)(this.rowIsExpanded(wr.row) ? "▾" : "▸")}</button>` : lit.nothing}</span>` : this.isSelectColumn(cell.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4351
4549
  ${this.selectCell !== void 0 ? this.selectCell({
4352
- row: wr.row.original,
4550
+ row: this.cellSlotRow(wr.row),
4353
4551
  checked: this.rowIsSelected(wr.row),
4354
4552
  toggle: (e) => this.onToggleRow(wr.row, e)
4355
4553
  }) : lit.html`<slot name="selectCell" data-rozie-params=${(() => {
4356
4554
  try {
4357
4555
  return JSON.stringify({
4358
- row: wr.row.original,
4556
+ row: this.cellSlotRow(wr.row),
4359
4557
  checked: this.rowIsSelected(wr.row)
4360
4558
  });
4361
4559
  } catch {
@@ -4371,31 +4569,92 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4371
4569
  this.onToggleExpand(wr.row, $event);
4372
4570
  }} data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)(this.rowIsExpanded(wr.row) ? "▾" : "▸")}</button>
4373
4571
  <span class="rdt-group-value" data-rozie-s-d5dcab4c>
4374
- ${this.cell !== void 0 ? this.cell({
4572
+ ${this.rozieSlots?.[`cell-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`cell-${cell.column.id}`]({
4375
4573
  columnId: cell.column.id,
4376
4574
  column: cell.column,
4377
- row: wr.row.original,
4575
+ row: this.cellSlotRow(wr.row),
4576
+ value: cell.getValue()
4577
+ }) : lit.html`<slot name="${`cell-${cell.column.id}`}" data-rozie-params=${(() => {
4578
+ try {
4579
+ return JSON.stringify({
4580
+ columnId: cell.column.id,
4581
+ column: cell.column,
4582
+ row: this.cellSlotRow(wr.row),
4583
+ value: cell.getValue()
4584
+ });
4585
+ } catch {
4586
+ return "{}";
4587
+ }
4588
+ })()}>
4589
+ ${this.cell !== void 0 ? this.cell({
4590
+ columnId: cell.column.id,
4591
+ column: cell.column,
4592
+ row: this.cellSlotRow(wr.row),
4378
4593
  value: cell.getValue()
4379
4594
  }) : lit.html`<slot name="cell" data-rozie-params=${(() => {
4380
4595
  try {
4381
4596
  return JSON.stringify({
4382
4597
  columnId: cell.column.id,
4383
4598
  column: cell.column,
4384
- row: wr.row.original,
4599
+ row: this.cellSlotRow(wr.row),
4385
4600
  value: cell.getValue()
4386
4601
  });
4387
4602
  } catch {
4388
4603
  return "{}";
4389
4604
  }
4390
4605
  })()}>${(0, _rozie_runtime_lit.rozieDisplay)(cell.getValue())}</slot>`}
4606
+ </slot>`}
4391
4607
  </span>
4392
4608
  <span class="rdt-group-count" data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)("(" + this.groupSubRowCount(wr.row) + ")")}</span>
4393
4609
  </span>` : this.isEditing(wr.vi.index, this.colIndexOf(wr.row, cell)) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4394
- ${this.hasEditorSlot(cell.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4395
- ${this.editor !== void 0 ? this.editor({
4610
+ ${this.editorTypeOf(cell.column.id) === "number" ? lit.html`<input class="rdt-cell-editor" type="number" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4611
+ this.onCellEditorInput(cell.column.id, $event);
4612
+ }} @keydown=${($event) => {
4613
+ this.onEditorKeyDown($event);
4614
+ }} @blur=${($event) => {
4615
+ this.onEditorBlur($event);
4616
+ }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "select" ? lit.html`<select class="rdt-cell-editor" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @change=${($event) => {
4617
+ this.onCellEditorInput(cell.column.id, $event);
4618
+ }} @keydown=${($event) => {
4619
+ this.onEditorKeyDown($event);
4620
+ }} @blur=${($event) => {
4621
+ this.onEditorBlur($event);
4622
+ }} data-rozie-s-d5dcab4c>
4623
+ ${(0, lit_directives_repeat_js.repeat)(this.editorOptionsOf(cell.column.id), (opt, _idx) => opt.value, (opt, _idx) => lit.html`<option value=${(0, _rozie_runtime_lit.rozieAttr)(opt.value)} data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)(opt.label)}</option>`)}
4624
+ </select>` : this.editorTypeOf(cell.column.id) === "checkbox" ? lit.html`<input class="rdt-cell-editor" type="checkbox" data-editing-cell="" data-builtin-editor="" ?checked=${this.editorCheckedFor(cell.column.id)} @change=${($event) => {
4625
+ this.onCellEditorCheckbox(cell.column.id, $event);
4626
+ }} @keydown=${($event) => {
4627
+ this.onEditorKeyDown($event);
4628
+ }} @blur=${($event) => {
4629
+ this.onEditorBlur($event);
4630
+ }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "custom" ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4631
+ ${this.rozieSlots?.[`editor-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`editor-${cell.column.id}`]({
4632
+ columnId: cell.column.id,
4633
+ column: cell.column,
4634
+ row: this.cellSlotRow(wr.row),
4635
+ value: this.editorValueFor(cell.column.id),
4636
+ commit: this.editorCommitFor(cell.column.id),
4637
+ cancel: this.editorCancelFor(),
4638
+ autofocus: this.editorAutofocusFor(cell.column.id, wr.vi.index)
4639
+ }) : lit.html`<slot name="${`editor-${cell.column.id}`}" data-rozie-params=${(() => {
4640
+ try {
4641
+ return JSON.stringify({
4642
+ columnId: cell.column.id,
4643
+ column: cell.column,
4644
+ row: this.cellSlotRow(wr.row),
4645
+ value: this.editorValueFor(cell.column.id),
4646
+ commit: this.editorCommitFor(cell.column.id),
4647
+ cancel: this.editorCancelFor(),
4648
+ autofocus: this.editorAutofocusFor(cell.column.id, wr.vi.index)
4649
+ });
4650
+ } catch {
4651
+ return "{}";
4652
+ }
4653
+ })()}>
4654
+ ${this.editor !== void 0 ? this.editor({
4396
4655
  columnId: cell.column.id,
4397
4656
  column: cell.column,
4398
- row: wr.row.original,
4657
+ row: this.cellSlotRow(wr.row),
4399
4658
  value: this.editorValueFor(cell.column.id),
4400
4659
  commit: this.editorCommitFor(cell.column.id),
4401
4660
  cancel: this.editorCancelFor(),
@@ -4405,7 +4664,7 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4405
4664
  return JSON.stringify({
4406
4665
  columnId: cell.column.id,
4407
4666
  column: cell.column,
4408
- row: wr.row.original,
4667
+ row: this.cellSlotRow(wr.row),
4409
4668
  value: this.editorValueFor(cell.column.id),
4410
4669
  commit: this.editorCommitFor(cell.column.id),
4411
4670
  cancel: this.editorCancelFor(),
@@ -4414,51 +4673,58 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4414
4673
  } catch {
4415
4674
  return "{}";
4416
4675
  }
4417
- })()}></slot>`}
4418
- </span>` : this.editorTypeOf(cell.column.id) === "number" ? lit.html`<input class="rdt-cell-editor" type="number" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4419
- this.onCellEditorInput(cell.column.id, $event);
4420
- }} @keydown=${($event) => {
4421
- this.onEditorKeyDown($event);
4422
- }} @blur=${($event) => {
4423
- this.onEditorBlur($event);
4424
- }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "select" ? lit.html`<select class="rdt-cell-editor" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @change=${($event) => {
4676
+ })()}>
4677
+ <input class="rdt-cell-editor" type="text" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4425
4678
  this.onCellEditorInput(cell.column.id, $event);
4426
4679
  }} @keydown=${($event) => {
4427
4680
  this.onEditorKeyDown($event);
4428
4681
  }} @blur=${($event) => {
4429
4682
  this.onEditorBlur($event);
4430
- }} data-rozie-s-d5dcab4c>
4431
- ${(0, lit_directives_repeat_js.repeat)(this.editorOptionsOf(cell.column.id), (opt, _idx) => opt.value, (opt, _idx) => lit.html`<option value=${(0, _rozie_runtime_lit.rozieAttr)(opt.value)} data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)(opt.label)}</option>`)}
4432
- </select>` : this.editorTypeOf(cell.column.id) === "checkbox" ? lit.html`<input class="rdt-cell-editor" type="checkbox" data-editing-cell="" ?checked=${this.editorCheckedFor(cell.column.id)} @change=${($event) => {
4433
- this.onCellEditorCheckbox(cell.column.id, $event);
4434
- }} @keydown=${($event) => {
4435
- this.onEditorKeyDown($event);
4436
- }} @blur=${($event) => {
4437
- this.onEditorBlur($event);
4438
- }} data-rozie-s-d5dcab4c />` : lit.html`<input class="rdt-cell-editor" type="text" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4683
+ }} data-rozie-s-d5dcab4c />
4684
+ </slot>`}
4685
+ </slot>`}
4686
+ </span>` : lit.html`<input class="rdt-cell-editor" type="text" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4439
4687
  this.onCellEditorInput(cell.column.id, $event);
4440
4688
  }} @keydown=${($event) => {
4441
4689
  this.onEditorKeyDown($event);
4442
4690
  }} @blur=${($event) => {
4443
4691
  this.onEditorBlur($event);
4444
4692
  }} data-rozie-s-d5dcab4c />`}</span>` : this.cellIsPlaceholder(cell) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : lit.html`<span class="rdt-cell-value" data-rozie-s-d5dcab4c>
4445
- ${this.cell !== void 0 ? this.cell({
4693
+ ${this.rozieSlots?.[`cell-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`cell-${cell.column.id}`]({
4446
4694
  columnId: cell.column.id,
4447
4695
  column: cell.column,
4448
- row: wr.row.original,
4696
+ row: this.cellSlotRow(wr.row),
4697
+ value: cell.getValue()
4698
+ }) : lit.html`<slot name="${`cell-${cell.column.id}`}" data-rozie-params=${(() => {
4699
+ try {
4700
+ return JSON.stringify({
4701
+ columnId: cell.column.id,
4702
+ column: cell.column,
4703
+ row: this.cellSlotRow(wr.row),
4704
+ value: cell.getValue()
4705
+ });
4706
+ } catch {
4707
+ return "{}";
4708
+ }
4709
+ })()}>
4710
+ ${this.cell !== void 0 ? this.cell({
4711
+ columnId: cell.column.id,
4712
+ column: cell.column,
4713
+ row: this.cellSlotRow(wr.row),
4449
4714
  value: cell.getValue()
4450
4715
  }) : lit.html`<slot name="cell" data-rozie-params=${(() => {
4451
4716
  try {
4452
4717
  return JSON.stringify({
4453
4718
  columnId: cell.column.id,
4454
4719
  column: cell.column,
4455
- row: wr.row.original,
4720
+ row: this.cellSlotRow(wr.row),
4456
4721
  value: cell.getValue()
4457
4722
  });
4458
4723
  } catch {
4459
4724
  return "{}";
4460
4725
  }
4461
4726
  })()}>${(0, _rozie_runtime_lit.rozieDisplay)(cell.getValue())}</slot>`}
4727
+ </slot>`}
4462
4728
  </span>`}${this.isFillHandleCell(wr.vi.index, this.colIndexOf(wr.row, cell)) ? lit.html`<span class="rdt-fill-handle" data-fill-handle="" data-testid="fill-handle" aria-hidden="true" @pointerdown=${($event) => {
4463
4729
  this.onFillHandlePointerDown($event);
4464
4730
  }} data-rozie-s-d5dcab4c></span>` : lit.nothing}</td>`)}
@@ -4506,7 +4772,7 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4506
4772
  "rdt-expander-th": this.isExpanderColumn(header.column.id),
4507
4773
  "rdt-th-resizing": this.columnIsResizing(header.column.id),
4508
4774
  "rdt-cell-active": this.isActiveCell("__header", this.headerColIndexOf(hg, header), hgLevel)
4509
- }).filter(([, v]) => v).map(([k]) => k).join(" ")}" role="columnheader" data-col=${(0, _rozie_runtime_lit.rozieAttr)(header.column.id)} data-grid-cell="" data-row="__header" data-header-level=${(0, _rozie_runtime_lit.rozieAttr)(hgLevel)} colspan=${(0, _rozie_runtime_lit.rozieAttr)(header.colSpan > 1 ? header.colSpan : null)} data-col-index=${(0, _rozie_runtime_lit.rozieAttr)(this.headerColIndexOf(hg, header))} tabindex=${(0, _rozie_runtime_lit.rozieAttr)(this.cellTabindex("__header", this.headerColIndexOf(hg, header), hgLevel))} aria-sort=${(0, _rozie_runtime_lit.rozieAttr)(this.ariaSortFor(header.column.id))} style=${(0, _rozie_runtime_lit.rozieStyle)(this.thStyle(header.column.id))} data-rozie-s-d5dcab4c>
4775
+ }).filter(([, v]) => v).map(([k]) => k).join(" ")}" role="columnheader" data-col=${(0, _rozie_runtime_lit.rozieAttr)(header.column.id)} data-grid-cell="" data-row="__header" data-header-level=${(0, _rozie_runtime_lit.rozieAttr)(hgLevel)} colspan=${(0, _rozie_runtime_lit.rozieAttr)(header.colSpan > 1 ? header.colSpan : null)} data-col-index=${(0, _rozie_runtime_lit.rozieAttr)(this.headerColIndexOf(hg, header))} tabindex=${(0, _rozie_runtime_lit.rozieAttr)(this.cellTabindex("__header", this.headerColIndexOf(hg, header), hgLevel))} aria-sort=${(0, _rozie_runtime_lit.rozieAttr)(this.ariaSortFor(header.column.id))} style=${(0, _rozie_runtime_lit.rozieStyle)(this.thStyle(header))} data-rozie-s-d5dcab4c>
4510
4776
 
4511
4777
 
4512
4778
  ${this.isSelectColumn(header.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
@@ -4535,7 +4801,22 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4535
4801
  }} data-rozie-s-d5dcab4c>
4536
4802
 
4537
4803
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4538
- ${this.colHeader !== void 0 ? this.colHeader({
4804
+ ${this.rozieSlots?.[`colHeader-${header.column.id}`] !== void 0 ? this.rozieSlots?.[`colHeader-${header.column.id}`]({
4805
+ columnId: header.column.id,
4806
+ column: header.column,
4807
+ label: this.headerLabel(header.column.id)
4808
+ }) : lit.html`<slot name="${`colHeader-${header.column.id}`}" data-rozie-params=${(() => {
4809
+ try {
4810
+ return JSON.stringify({
4811
+ columnId: header.column.id,
4812
+ column: header.column,
4813
+ label: this.headerLabel(header.column.id)
4814
+ });
4815
+ } catch {
4816
+ return "{}";
4817
+ }
4818
+ })()}>
4819
+ ${this.colHeader !== void 0 ? this.colHeader({
4539
4820
  columnId: header.column.id,
4540
4821
  column: header.column,
4541
4822
  label: this.headerLabel(header.column.id)
@@ -4550,11 +4831,27 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4550
4831
  return "{}";
4551
4832
  }
4552
4833
  })()}>${(0, _rozie_runtime_lit.rozieDisplay)(this.headerLabel(header.column.id))}</slot>`}
4834
+ </slot>`}
4553
4835
  </span>
4554
4836
  <span class="rdt-sort-ind" aria-hidden="true" data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)(this.sortIndicator(header.column.id))}</span>
4555
4837
  </button>` : lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4556
4838
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4557
- ${this.colHeader !== void 0 ? this.colHeader({
4839
+ ${this.rozieSlots?.[`colHeader-${header.column.id}`] !== void 0 ? this.rozieSlots?.[`colHeader-${header.column.id}`]({
4840
+ columnId: header.column.id,
4841
+ column: header.column,
4842
+ label: this.headerLabel(header.column.id)
4843
+ }) : lit.html`<slot name="${`colHeader-${header.column.id}`}" data-rozie-params=${(() => {
4844
+ try {
4845
+ return JSON.stringify({
4846
+ columnId: header.column.id,
4847
+ column: header.column,
4848
+ label: this.headerLabel(header.column.id)
4849
+ });
4850
+ } catch {
4851
+ return "{}";
4852
+ }
4853
+ })()}>
4854
+ ${this.colHeader !== void 0 ? this.colHeader({
4558
4855
  columnId: header.column.id,
4559
4856
  column: header.column,
4560
4857
  label: this.headerLabel(header.column.id)
@@ -4569,6 +4866,7 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4569
4866
  return "{}";
4570
4867
  }
4571
4868
  })()}>${(0, _rozie_runtime_lit.rozieDisplay)(this.headerLabel(header.column.id))}</slot>`}
4869
+ </slot>`}
4572
4870
  </span>
4573
4871
  </span>`}<rozie-popover trigger="click" placement="bottom-end" strategy="fixed" .offset=${4} data-rozie-s-d5dcab4c><button class="rdt-col-menu-trigger" type="button" aria-label=${(0, _rozie_runtime_lit.rozieAttr)("Column options for " + this.headerLabel(header.column.id))} data-rozie-s-d5dcab4c slot="anchor">⋯</button><div class="rdt-col-menu" role="menu" data-rozie-s-d5dcab4c>
4574
4872
  <button class="rdt-col-menu-item" type="button" role="menuitem" aria-pressed=${this.columnPinSide(header.column.id) === "left"} @click=${($event) => {
@@ -4597,12 +4895,26 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4597
4895
  ${this.hasAnyFilterableColumn() ? lit.html`<tr class="rdt-filter-row" data-rozie-s-d5dcab4c>
4598
4896
  ${(0, lit_directives_repeat_js.repeat)(this._headerGroups.value[this._headerGroups.value.length - 1].headers, (header, _idx) => header.id, (header, _idx) => lit.html`<th class="rdt-filter-cell" role="presentation" style=${(0, _rozie_runtime_lit.rozieStyle)(this.pinStyle(header.column.id))} data-rozie-s-d5dcab4c>
4599
4897
  ${this.isSelectColumn(header.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : this.isExpanderColumn(header.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4600
- ${this.columnIsFilterable(header.column.id) && !this.hasFilterSlot() ? lit.html`<input class="rdt-col-filter" type="text" aria-label=${(0, _rozie_runtime_lit.rozieAttr)("Filter " + this.headerLabel(header.column.id))} .value=${this.columnFilterValue(header.column.id)} @input=${($event) => {
4601
- this.onColumnFilterInput(header.column.id, $event);
4602
- }} @click=${($event) => {
4603
- this.stopEvent($event);
4604
- }} data-rozie-s-d5dcab4c />` : lit.nothing}${this.columnIsFilterable(header.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4605
- ${this.filter !== void 0 ? this.filter({
4898
+ ${this.columnIsFilterable(header.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4899
+ ${this.rozieSlots?.[`filter-${header.column.id}`] !== void 0 ? this.rozieSlots?.[`filter-${header.column.id}`]({
4900
+ columnId: header.column.id,
4901
+ value: this.columnFilterValue(header.column.id),
4902
+ uniqueValues: this.getFacetedUniqueValues(header.column.id),
4903
+ minMax: this.getFacetedMinMaxValues(header.column.id),
4904
+ setFilter: this.setColumnFilter
4905
+ }) : lit.html`<slot name="${`filter-${header.column.id}`}" data-rozie-params=${(() => {
4906
+ try {
4907
+ return JSON.stringify({
4908
+ columnId: header.column.id,
4909
+ value: this.columnFilterValue(header.column.id),
4910
+ uniqueValues: this.getFacetedUniqueValues(header.column.id),
4911
+ minMax: this.getFacetedMinMaxValues(header.column.id)
4912
+ });
4913
+ } catch {
4914
+ return "{}";
4915
+ }
4916
+ })()} @rozie-default-set-filter=${($event) => this.setColumnFilter($event.detail)}>
4917
+ ${this.filter !== void 0 ? this.filter({
4606
4918
  columnId: header.column.id,
4607
4919
  value: this.columnFilterValue(header.column.id),
4608
4920
  uniqueValues: this.getFacetedUniqueValues(header.column.id),
@@ -4619,7 +4931,14 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4619
4931
  } catch {
4620
4932
  return "{}";
4621
4933
  }
4622
- })()} @rozie-filter-set-filter=${($event) => this.setColumnFilter($event.detail)}></slot>`}
4934
+ })()} @rozie-filter-set-filter=${($event) => this.setColumnFilter($event.detail)}>
4935
+ <input class="rdt-col-filter" type="text" aria-label=${(0, _rozie_runtime_lit.rozieAttr)("Filter " + this.headerLabel(header.column.id))} .value=${this.columnFilterValue(header.column.id)} @input=${($event) => {
4936
+ this.onColumnFilterInput(header.column.id, $event);
4937
+ }} @click=${($event) => {
4938
+ this.stopEvent($event);
4939
+ }} data-rozie-s-d5dcab4c />
4940
+ </slot>`}
4941
+ </slot>`}
4623
4942
  </span>` : lit.nothing}</span>`}</th>`)}
4624
4943
  </tr>` : lit.nothing}</thead>
4625
4944
 
@@ -4643,13 +4962,13 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4643
4962
  this.onToggleExpand(row, $event);
4644
4963
  }} data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)(this.rowIsExpanded(row) ? "▾" : "▸")}</button>` : lit.nothing}</span>` : this.isSelectColumn(cell.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4645
4964
  ${this.selectCell !== void 0 ? this.selectCell({
4646
- row: row.original,
4965
+ row: this.cellSlotRow(row),
4647
4966
  checked: this.rowIsSelected(row),
4648
4967
  toggle: (e) => this.onToggleRow(row, e)
4649
4968
  }) : lit.html`<slot name="selectCell" data-rozie-params=${(() => {
4650
4969
  try {
4651
4970
  return JSON.stringify({
4652
- row: row.original,
4971
+ row: this.cellSlotRow(row),
4653
4972
  checked: this.rowIsSelected(row)
4654
4973
  });
4655
4974
  } catch {
@@ -4665,31 +4984,92 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4665
4984
  this.onToggleExpand(row, $event);
4666
4985
  }} data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)(this.rowIsExpanded(row) ? "▾" : "▸")}</button>
4667
4986
  <span class="rdt-group-value" data-rozie-s-d5dcab4c>
4668
- ${this.cell !== void 0 ? this.cell({
4987
+ ${this.rozieSlots?.[`cell-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`cell-${cell.column.id}`]({
4988
+ columnId: cell.column.id,
4989
+ column: cell.column,
4990
+ row: this.cellSlotRow(row),
4991
+ value: cell.getValue()
4992
+ }) : lit.html`<slot name="${`cell-${cell.column.id}`}" data-rozie-params=${(() => {
4993
+ try {
4994
+ return JSON.stringify({
4995
+ columnId: cell.column.id,
4996
+ column: cell.column,
4997
+ row: this.cellSlotRow(row),
4998
+ value: cell.getValue()
4999
+ });
5000
+ } catch {
5001
+ return "{}";
5002
+ }
5003
+ })()}>
5004
+ ${this.cell !== void 0 ? this.cell({
4669
5005
  columnId: cell.column.id,
4670
5006
  column: cell.column,
4671
- row: row.original,
5007
+ row: this.cellSlotRow(row),
4672
5008
  value: cell.getValue()
4673
5009
  }) : lit.html`<slot name="cell" data-rozie-params=${(() => {
4674
5010
  try {
4675
5011
  return JSON.stringify({
4676
5012
  columnId: cell.column.id,
4677
5013
  column: cell.column,
4678
- row: row.original,
5014
+ row: this.cellSlotRow(row),
4679
5015
  value: cell.getValue()
4680
5016
  });
4681
5017
  } catch {
4682
5018
  return "{}";
4683
5019
  }
4684
5020
  })()}>${(0, _rozie_runtime_lit.rozieDisplay)(cell.getValue())}</slot>`}
5021
+ </slot>`}
4685
5022
  </span>
4686
5023
  <span class="rdt-group-count" data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)("(" + this.groupSubRowCount(row) + ")")}</span>
4687
5024
  </span>` : this.isEditing(this.rowIndexOf(row), this.colIndexOf(row, cell)) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4688
- ${this.hasEditorSlot(cell.column.id) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
4689
- ${this.editor !== void 0 ? this.editor({
5025
+ ${this.editorTypeOf(cell.column.id) === "number" ? lit.html`<input class="rdt-cell-editor" type="number" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
5026
+ this.onCellEditorInput(cell.column.id, $event);
5027
+ }} @keydown=${($event) => {
5028
+ this.onEditorKeyDown($event);
5029
+ }} @blur=${($event) => {
5030
+ this.onEditorBlur($event);
5031
+ }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "select" ? lit.html`<select class="rdt-cell-editor" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @change=${($event) => {
5032
+ this.onCellEditorInput(cell.column.id, $event);
5033
+ }} @keydown=${($event) => {
5034
+ this.onEditorKeyDown($event);
5035
+ }} @blur=${($event) => {
5036
+ this.onEditorBlur($event);
5037
+ }} data-rozie-s-d5dcab4c>
5038
+ ${(0, lit_directives_repeat_js.repeat)(this.editorOptionsOf(cell.column.id), (opt, _idx) => opt.value, (opt, _idx) => lit.html`<option value=${(0, _rozie_runtime_lit.rozieAttr)(opt.value)} data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)(opt.label)}</option>`)}
5039
+ </select>` : this.editorTypeOf(cell.column.id) === "checkbox" ? lit.html`<input class="rdt-cell-editor" type="checkbox" data-editing-cell="" data-builtin-editor="" ?checked=${this.editorCheckedFor(cell.column.id)} @change=${($event) => {
5040
+ this.onCellEditorCheckbox(cell.column.id, $event);
5041
+ }} @keydown=${($event) => {
5042
+ this.onEditorKeyDown($event);
5043
+ }} @blur=${($event) => {
5044
+ this.onEditorBlur($event);
5045
+ }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "custom" ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c>
5046
+ ${this.rozieSlots?.[`editor-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`editor-${cell.column.id}`]({
4690
5047
  columnId: cell.column.id,
4691
5048
  column: cell.column,
4692
- row: row.original,
5049
+ row: this.cellSlotRow(row),
5050
+ value: this.editorValueFor(cell.column.id),
5051
+ commit: this.editorCommitFor(cell.column.id),
5052
+ cancel: this.editorCancelFor(),
5053
+ autofocus: this.editorAutofocusFor(cell.column.id, this.rowIndexOf(row))
5054
+ }) : lit.html`<slot name="${`editor-${cell.column.id}`}" data-rozie-params=${(() => {
5055
+ try {
5056
+ return JSON.stringify({
5057
+ columnId: cell.column.id,
5058
+ column: cell.column,
5059
+ row: this.cellSlotRow(row),
5060
+ value: this.editorValueFor(cell.column.id),
5061
+ commit: this.editorCommitFor(cell.column.id),
5062
+ cancel: this.editorCancelFor(),
5063
+ autofocus: this.editorAutofocusFor(cell.column.id, this.rowIndexOf(row))
5064
+ });
5065
+ } catch {
5066
+ return "{}";
5067
+ }
5068
+ })()}>
5069
+ ${this.editor !== void 0 ? this.editor({
5070
+ columnId: cell.column.id,
5071
+ column: cell.column,
5072
+ row: this.cellSlotRow(row),
4693
5073
  value: this.editorValueFor(cell.column.id),
4694
5074
  commit: this.editorCommitFor(cell.column.id),
4695
5075
  cancel: this.editorCancelFor(),
@@ -4699,7 +5079,7 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4699
5079
  return JSON.stringify({
4700
5080
  columnId: cell.column.id,
4701
5081
  column: cell.column,
4702
- row: row.original,
5082
+ row: this.cellSlotRow(row),
4703
5083
  value: this.editorValueFor(cell.column.id),
4704
5084
  commit: this.editorCommitFor(cell.column.id),
4705
5085
  cancel: this.editorCancelFor(),
@@ -4708,51 +5088,58 @@ ${this.groupable ? lit.html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4
4708
5088
  } catch {
4709
5089
  return "{}";
4710
5090
  }
4711
- })()}></slot>`}
4712
- </span>` : this.editorTypeOf(cell.column.id) === "number" ? lit.html`<input class="rdt-cell-editor" type="number" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4713
- this.onCellEditorInput(cell.column.id, $event);
4714
- }} @keydown=${($event) => {
4715
- this.onEditorKeyDown($event);
4716
- }} @blur=${($event) => {
4717
- this.onEditorBlur($event);
4718
- }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "select" ? lit.html`<select class="rdt-cell-editor" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @change=${($event) => {
5091
+ })()}>
5092
+ <input class="rdt-cell-editor" type="text" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4719
5093
  this.onCellEditorInput(cell.column.id, $event);
4720
5094
  }} @keydown=${($event) => {
4721
5095
  this.onEditorKeyDown($event);
4722
5096
  }} @blur=${($event) => {
4723
5097
  this.onEditorBlur($event);
4724
- }} data-rozie-s-d5dcab4c>
4725
- ${(0, lit_directives_repeat_js.repeat)(this.editorOptionsOf(cell.column.id), (opt, _idx) => opt.value, (opt, _idx) => lit.html`<option value=${(0, _rozie_runtime_lit.rozieAttr)(opt.value)} data-rozie-s-d5dcab4c>${(0, _rozie_runtime_lit.rozieDisplay)(opt.label)}</option>`)}
4726
- </select>` : this.editorTypeOf(cell.column.id) === "checkbox" ? lit.html`<input class="rdt-cell-editor" type="checkbox" data-editing-cell="" ?checked=${this.editorCheckedFor(cell.column.id)} @change=${($event) => {
4727
- this.onCellEditorCheckbox(cell.column.id, $event);
4728
- }} @keydown=${($event) => {
4729
- this.onEditorKeyDown($event);
4730
- }} @blur=${($event) => {
4731
- this.onEditorBlur($event);
4732
- }} data-rozie-s-d5dcab4c />` : lit.html`<input class="rdt-cell-editor" type="text" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
5098
+ }} data-rozie-s-d5dcab4c />
5099
+ </slot>`}
5100
+ </slot>`}
5101
+ </span>` : lit.html`<input class="rdt-cell-editor" type="text" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4733
5102
  this.onCellEditorInput(cell.column.id, $event);
4734
5103
  }} @keydown=${($event) => {
4735
5104
  this.onEditorKeyDown($event);
4736
5105
  }} @blur=${($event) => {
4737
5106
  this.onEditorBlur($event);
4738
5107
  }} data-rozie-s-d5dcab4c />`}</span>` : this.cellIsPlaceholder(cell) ? lit.html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : lit.html`<span class="rdt-cell-value" data-rozie-s-d5dcab4c>
4739
- ${this.cell !== void 0 ? this.cell({
5108
+ ${this.rozieSlots?.[`cell-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`cell-${cell.column.id}`]({
5109
+ columnId: cell.column.id,
5110
+ column: cell.column,
5111
+ row: this.cellSlotRow(row),
5112
+ value: cell.getValue()
5113
+ }) : lit.html`<slot name="${`cell-${cell.column.id}`}" data-rozie-params=${(() => {
5114
+ try {
5115
+ return JSON.stringify({
5116
+ columnId: cell.column.id,
5117
+ column: cell.column,
5118
+ row: this.cellSlotRow(row),
5119
+ value: cell.getValue()
5120
+ });
5121
+ } catch {
5122
+ return "{}";
5123
+ }
5124
+ })()}>
5125
+ ${this.cell !== void 0 ? this.cell({
4740
5126
  columnId: cell.column.id,
4741
5127
  column: cell.column,
4742
- row: row.original,
5128
+ row: this.cellSlotRow(row),
4743
5129
  value: cell.getValue()
4744
5130
  }) : lit.html`<slot name="cell" data-rozie-params=${(() => {
4745
5131
  try {
4746
5132
  return JSON.stringify({
4747
5133
  columnId: cell.column.id,
4748
5134
  column: cell.column,
4749
- row: row.original,
5135
+ row: this.cellSlotRow(row),
4750
5136
  value: cell.getValue()
4751
5137
  });
4752
5138
  } catch {
4753
5139
  return "{}";
4754
5140
  }
4755
5141
  })()}>${(0, _rozie_runtime_lit.rozieDisplay)(cell.getValue())}</slot>`}
5142
+ </slot>`}
4756
5143
  </span>`}${this.isFillHandleCell(this.rowIndexOf(row), this.colIndexOf(row, cell)) ? lit.html`<span class="rdt-fill-handle" data-fill-handle="" data-testid="fill-handle" aria-hidden="true" @pointerdown=${($event) => {
4757
5144
  this.onFillHandlePointerDown($event);
4758
5145
  }} data-rozie-s-d5dcab4c></span>` : lit.nothing}</td>`)}
@@ -4986,6 +5373,26 @@ __decorate([(0, lit_decorators_js.queryAssignedElements)({
4986
5373
  flatten: true
4987
5374
  })], DataTable.prototype, "_slotSelectAllElements", void 0);
4988
5375
  __decorate([(0, lit_decorators_js.property)({ attribute: false })], DataTable.prototype, "selectAll", void 0);
5376
+ __decorate([(0, lit_decorators_js.state)()], DataTable.prototype, "_hasSlotDynamicColHeader", void 0);
5377
+ __decorate([(0, lit_decorators_js.queryAssignedElements)({ flatten: true })], DataTable.prototype, "_slotDynamicColHeaderElements", void 0);
5378
+ __decorate([(0, lit_decorators_js.state)()], DataTable.prototype, "_hasSlotDynamicFilter", void 0);
5379
+ __decorate([(0, lit_decorators_js.queryAssignedElements)({ flatten: true })], DataTable.prototype, "_slotDynamicFilterElements", void 0);
5380
+ __decorate([(0, lit_decorators_js.state)()], DataTable.prototype, "_hasSlotSelectCell", void 0);
5381
+ __decorate([(0, lit_decorators_js.queryAssignedElements)({
5382
+ slot: "selectCell",
5383
+ flatten: true
5384
+ })], DataTable.prototype, "_slotSelectCellElements", void 0);
5385
+ __decorate([(0, lit_decorators_js.property)({ attribute: false })], DataTable.prototype, "selectCell", void 0);
5386
+ __decorate([(0, lit_decorators_js.state)()], DataTable.prototype, "_hasSlotDynamicCell", void 0);
5387
+ __decorate([(0, lit_decorators_js.queryAssignedElements)({ flatten: true })], DataTable.prototype, "_slotDynamicCellElements", void 0);
5388
+ __decorate([(0, lit_decorators_js.state)()], DataTable.prototype, "_hasSlotDynamicEditor", void 0);
5389
+ __decorate([(0, lit_decorators_js.queryAssignedElements)({ flatten: true })], DataTable.prototype, "_slotDynamicEditorElements", void 0);
5390
+ __decorate([(0, lit_decorators_js.state)()], DataTable.prototype, "_hasSlotDetail", void 0);
5391
+ __decorate([(0, lit_decorators_js.queryAssignedElements)({
5392
+ slot: "detail",
5393
+ flatten: true
5394
+ })], DataTable.prototype, "_slotDetailElements", void 0);
5395
+ __decorate([(0, lit_decorators_js.property)({ attribute: false })], DataTable.prototype, "detail", void 0);
4989
5396
  __decorate([(0, lit_decorators_js.state)()], DataTable.prototype, "_hasSlotColHeader", void 0);
4990
5397
  __decorate([(0, lit_decorators_js.queryAssignedElements)({
4991
5398
  slot: "colHeader",
@@ -4998,12 +5405,6 @@ __decorate([(0, lit_decorators_js.queryAssignedElements)({
4998
5405
  flatten: true
4999
5406
  })], DataTable.prototype, "_slotFilterElements", void 0);
5000
5407
  __decorate([(0, lit_decorators_js.property)({ attribute: false })], DataTable.prototype, "filter", void 0);
5001
- __decorate([(0, lit_decorators_js.state)()], DataTable.prototype, "_hasSlotSelectCell", void 0);
5002
- __decorate([(0, lit_decorators_js.queryAssignedElements)({
5003
- slot: "selectCell",
5004
- flatten: true
5005
- })], DataTable.prototype, "_slotSelectCellElements", void 0);
5006
- __decorate([(0, lit_decorators_js.property)({ attribute: false })], DataTable.prototype, "selectCell", void 0);
5007
5408
  __decorate([(0, lit_decorators_js.state)()], DataTable.prototype, "_hasSlotCell", void 0);
5008
5409
  __decorate([(0, lit_decorators_js.queryAssignedElements)({
5009
5410
  slot: "cell",
@@ -5016,12 +5417,6 @@ __decorate([(0, lit_decorators_js.queryAssignedElements)({
5016
5417
  flatten: true
5017
5418
  })], DataTable.prototype, "_slotEditorElements", void 0);
5018
5419
  __decorate([(0, lit_decorators_js.property)({ attribute: false })], DataTable.prototype, "editor", void 0);
5019
- __decorate([(0, lit_decorators_js.state)()], DataTable.prototype, "_hasSlotDetail", void 0);
5020
- __decorate([(0, lit_decorators_js.queryAssignedElements)({
5021
- slot: "detail",
5022
- flatten: true
5023
- })], DataTable.prototype, "_slotDetailElements", void 0);
5024
- __decorate([(0, lit_decorators_js.property)({ attribute: false })], DataTable.prototype, "detail", void 0);
5025
5420
  __decorate([(0, lit_decorators_js.property)({ attribute: false })], DataTable.prototype, "rozieSlots", void 0);
5026
5421
  DataTable = __decorate([(0, lit_decorators_js.customElement)("rozie-data-table")], DataTable);
5027
5422
  var DataTable_default = DataTable;