@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.mjs CHANGED
@@ -20,6 +20,39 @@ const wrapAggregationFn = (fn) => {
20
20
  }
21
21
  };
22
22
  };
23
+ const collectNestedDefs = (list, out) => {
24
+ if (!Array.isArray(list)) return;
25
+ for (const d of list) {
26
+ if (!d || d.id == null) continue;
27
+ const id = String(d.id);
28
+ if (!(id in out)) out[id] = d;
29
+ if (Array.isArray(d.columns)) collectNestedDefs(d.columns, out);
30
+ }
31
+ };
32
+ const indexDefsById = (defs) => {
33
+ const out = Object.create(null);
34
+ if (!Array.isArray(defs)) return out;
35
+ for (const d of defs) {
36
+ if (!d || d.id == null) continue;
37
+ out[String(d.id)] = d;
38
+ }
39
+ for (const d of defs) if (d && Array.isArray(d.columns)) collectNestedDefs(d.columns, out);
40
+ return out;
41
+ };
42
+ const collectGroupableLeafDefs = (defs) => {
43
+ const out = [];
44
+ if (!Array.isArray(defs)) return out;
45
+ for (const d of defs) {
46
+ if (!d) continue;
47
+ if (Array.isArray(d.columns)) {
48
+ out.push(...collectGroupableLeafDefs(d.columns));
49
+ continue;
50
+ }
51
+ if (d.groupable === false) continue;
52
+ out.push(d);
53
+ }
54
+ return out;
55
+ };
23
56
  //#endregion
24
57
  //#region src/helpers/indexMath.ts
25
58
  const clamp = (v, lo, hi) => v < lo ? lo : v > hi ? hi : v;
@@ -363,12 +396,16 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
363
396
  this._hasSlotDefault = false;
364
397
  this._hasSlotGroupBar = false;
365
398
  this._hasSlotSelectAll = false;
399
+ this._hasSlotDynamicColHeader = false;
400
+ this._hasSlotDynamicFilter = false;
401
+ this._hasSlotSelectCell = false;
402
+ this._hasSlotDynamicCell = false;
403
+ this._hasSlotDynamicEditor = false;
404
+ this._hasSlotDetail = false;
366
405
  this._hasSlotColHeader = false;
367
406
  this._hasSlotFilter = false;
368
- this._hasSlotSelectCell = false;
369
407
  this._hasSlotCell = false;
370
408
  this._hasSlotEditor = false;
371
- this._hasSlotDetail = false;
372
409
  this._disconnectCleanups = [];
373
410
  this._rozieTornDown = false;
374
411
  this.table = null;
@@ -464,6 +501,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
464
501
  this.columnDefsCache = null;
465
502
  this.columnDefsCacheColumnsRef = void 0;
466
503
  this.columnDefsCacheColRegRef = void 0;
504
+ this.columnDefsIndexCache = null;
467
505
  this.columnDefs = () => {
468
506
  const cfg = this.columns || [];
469
507
  const reg = this._colReg.value || {};
@@ -507,8 +545,13 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
507
545
  this.columnDefsCache = out;
508
546
  this.columnDefsCacheColumnsRef = this.columns;
509
547
  this.columnDefsCacheColRegRef = this._colReg.value;
548
+ this.columnDefsIndexCache = indexDefsById(out);
510
549
  return out;
511
550
  };
551
+ this.defIndex = () => {
552
+ this.columnDefs();
553
+ return this.columnDefsIndexCache || Object.create(null);
554
+ };
512
555
  this.SELECT_COL_ID = "__rdt_select";
513
556
  this.EXPANDER_COL_ID = "__rdt_expander";
514
557
  this.selectionEnabled = () => this.selectionMode === "single" || this.selectionMode === "multiple";
@@ -1250,9 +1293,9 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
1250
1293
  return "";
1251
1294
  };
1252
1295
  this.defFor = (colId) => {
1253
- const defs = this.columnDefs();
1254
- for (const d of defs) if (d.id === colId) return d;
1255
- return null;
1296
+ if (colId == null) return null;
1297
+ const d = this.defIndex()[String(colId)];
1298
+ return d != null ? d : null;
1256
1299
  };
1257
1300
  this.visibleCellsFor = (row) => this._rowModelVer.value >= 0 ? row.getVisibleCells() : [];
1258
1301
  this.editMetaOf = (colId) => {
@@ -1271,8 +1314,6 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
1271
1314
  const m = this.editMetaOf(colId);
1272
1315
  return m && m.editorOptions != null ? m.editorOptions : [];
1273
1316
  };
1274
- this.hasEditorSlot = (colId) => this.editorTypeOf(colId) === "custom" && !!(this._hasSlotEditor || this.editor !== void 0);
1275
- this.hasFilterSlot = () => !!(this._hasSlotFilter || this.filter !== void 0);
1276
1317
  this.columnIsFilterable = (colId) => {
1277
1318
  const d = this.defFor(colId);
1278
1319
  return !!(d && d.filterable);
@@ -1281,11 +1322,9 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
1281
1322
  const d = this.defFor(colId);
1282
1323
  return d ? d.header : colId;
1283
1324
  };
1284
- this.headerWidth = (colId) => {
1285
- if (this.tick() < 0 || !this.table) return null;
1286
- const col = this.table.getColumn(colId);
1287
- if (!col) return null;
1288
- const w = col.getSize();
1325
+ this.headerWidth = (header) => {
1326
+ if (this.tick() < 0 || !header || typeof header.getSize !== "function") return null;
1327
+ const w = header.getSize();
1289
1328
  return w != null && w > 0 ? w + "px" : null;
1290
1329
  };
1291
1330
  this.onResizeStart = (colId, evt) => {
@@ -1354,11 +1393,11 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
1354
1393
  if (side === "right") return "position:sticky;right:" + (col.getAfter ? col.getAfter("right") : 0) + "px;z-index:" + zIndex + ";";
1355
1394
  return "";
1356
1395
  };
1357
- this.thStyle = (colId) => {
1396
+ this.thStyle = (header) => {
1358
1397
  let s = "";
1359
- const w = this.headerWidth(colId);
1398
+ const w = this.headerWidth(header);
1360
1399
  if (w) s += "width:" + w + ";";
1361
- s += this.pinStyle(colId, 2);
1400
+ s += this.pinStyle(header && header.column ? header.column.id : null, 2);
1362
1401
  return s;
1363
1402
  };
1364
1403
  this.onGlobalFilterInput = (evt) => {
@@ -1429,22 +1468,56 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
1429
1468
  return base;
1430
1469
  };
1431
1470
  this.rowIsGrouped = (row) => !!(this.tick() >= 0 && row && row.getIsGrouped && row.getIsGrouped());
1471
+ this.rowIndexIsGrouped = (rowIndex) => this.rowIsGrouped((this._rows.value || [])[rowIndex]);
1432
1472
  this.groupingActive = () => this.tick() >= 0 && (this.currentState().grouping || []).length > 0;
1433
1473
  this.cellIsGrouped = (cellCtx) => !!(this.tick() >= 0 && cellCtx && cellCtx.getIsGrouped && cellCtx.getIsGrouped());
1434
1474
  this.cellIsAggregated = (cellCtx) => !!(this.tick() >= 0 && cellCtx && cellCtx.getIsAggregated && cellCtx.getIsAggregated());
1435
1475
  this.cellIsPlaceholder = (cellCtx) => !!(this.tick() >= 0 && cellCtx && cellCtx.getIsPlaceholder && cellCtx.getIsPlaceholder());
1436
- this.groupSubRowCount = (row) => row && row.getLeafRows ? row.getLeafRows().length : row && row.subRows ? row.subRows.length : 0;
1476
+ this.groupSubRowCount = (row) => {
1477
+ if (row && row.getLeafRows) {
1478
+ const leaves = row.getLeafRows();
1479
+ let n = 0;
1480
+ for (let i = 0; i < leaves.length; i++) {
1481
+ const r = leaves[i];
1482
+ if (!(r && r.getIsGrouped && r.getIsGrouped())) n = n + 1;
1483
+ }
1484
+ return n;
1485
+ }
1486
+ return row && row.subRows ? row.subRows.length : 0;
1487
+ };
1488
+ this.groupRowDescriptorCache = null;
1489
+ this.groupRowDescriptorCacheVer = void 0;
1490
+ this.groupRowDescriptor = (row) => {
1491
+ const ver = this._rowModelVer.value;
1492
+ if (!this.groupRowDescriptorCache || this.groupRowDescriptorCacheVer !== ver) {
1493
+ this.groupRowDescriptorCache = Object.create(null);
1494
+ this.groupRowDescriptorCacheVer = ver;
1495
+ }
1496
+ const key = String(row.id);
1497
+ let d = this.groupRowDescriptorCache[key];
1498
+ if (!d) {
1499
+ const groupingColumnId = row.groupingColumnId != null ? row.groupingColumnId : "";
1500
+ const groupingValue = row.getGroupingValue ? row.getGroupingValue(groupingColumnId) : row.groupingValue;
1501
+ d = {
1502
+ isGroupRow: true,
1503
+ groupId: row.id,
1504
+ groupingColumnId,
1505
+ groupingValue,
1506
+ leafCount: this.groupSubRowCount(row)
1507
+ };
1508
+ this.groupRowDescriptorCache[key] = d;
1509
+ }
1510
+ return d;
1511
+ };
1512
+ this.cellSlotRow = (row) => this.rowIsGrouped(row) ? this.groupRowDescriptor(row) : row ? row.original : null;
1437
1513
  this.groupingKeys = () => this.currentState().grouping || [];
1438
1514
  this.groupableColumns = () => {
1439
1515
  const out = [];
1440
- const defs = this.columnDefs();
1441
- for (const d of defs) {
1442
- if (!d || d.groupable === false) continue;
1443
- out.push({
1444
- id: d.id,
1445
- label: d.header != null ? d.header : d.id
1446
- });
1447
- }
1516
+ const defs = collectGroupableLeafDefs(this.columnDefs());
1517
+ for (const d of defs) out.push({
1518
+ id: d.id,
1519
+ label: d.header != null ? d.header : d.id
1520
+ });
1448
1521
  return out;
1449
1522
  };
1450
1523
  this.stopEvent = (evt) => {
@@ -2442,11 +2515,13 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2442
2515
  for (let gr = 0; gr < grid.length; gr++) {
2443
2516
  const r = originRow + gr;
2444
2517
  if (r > maxRow) break;
2518
+ const rowGrouped = this.rowIndexIsGrouped(r);
2445
2519
  const cols = grid[gr] || [];
2446
2520
  for (let gc = 0; gc < cols.length; gc++) {
2447
2521
  const c = originCol + gc;
2448
2522
  if (c > maxCol) break;
2449
2523
  total = total + 1;
2524
+ if (rowGrouped) continue;
2450
2525
  const colId = this.columnIdAt(r, c);
2451
2526
  if (colId == null || !this.columnEditable(colId)) continue;
2452
2527
  const rowObj = this.rowOriginalAt(r);
@@ -2628,8 +2703,9 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2628
2703
  this.fillEdgeScrollRaf = null;
2629
2704
  }
2630
2705
  };
2631
- this.cellIndexFromPoint = (clientX, clientY) => {
2632
- if (typeof document === "undefined" || !document.elementFromPoint) return null;
2706
+ this.FILL_HITTEST_PROBE_RADIUS_PX = 8;
2707
+ this.FILL_HITTEST_PROBE_STEP_PX = 2;
2708
+ this.resolveCellAt = (clientX, clientY) => {
2633
2709
  let el = document.elementFromPoint(clientX, clientY);
2634
2710
  while (el && el.shadowRoot && el.shadowRoot.elementFromPoint) {
2635
2711
  const inner = el.shadowRoot.elementFromPoint(clientX, clientY);
@@ -2650,6 +2726,18 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2650
2726
  c
2651
2727
  };
2652
2728
  };
2729
+ this.cellIndexFromPoint = (clientX, clientY) => {
2730
+ if (typeof document === "undefined" || !document.elementFromPoint) return null;
2731
+ const direct = this.resolveCellAt(clientX, clientY);
2732
+ if (direct) return direct;
2733
+ for (let d = this.FILL_HITTEST_PROBE_STEP_PX; d <= this.FILL_HITTEST_PROBE_RADIUS_PX; d += this.FILL_HITTEST_PROBE_STEP_PX) {
2734
+ const right = this.resolveCellAt(clientX + d, clientY);
2735
+ if (right) return right;
2736
+ const left = this.resolveCellAt(clientX - d, clientY);
2737
+ if (left) return left;
2738
+ }
2739
+ return null;
2740
+ };
2653
2741
  this.onFillHandlePointerDown = (e) => {
2654
2742
  if (!e) return;
2655
2743
  if (e.preventDefault) e.preventDefault();
@@ -2756,11 +2844,13 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2756
2844
  return cell && cell.column ? cell.column.id : null;
2757
2845
  };
2758
2846
  this.isActiveCellEditable = () => {
2847
+ if (this.rowIndexIsGrouped(this._activeRow.value)) return false;
2759
2848
  const colId = this.activeCellColumnId();
2760
2849
  return colId != null && this.columnEditable(colId);
2761
2850
  };
2762
2851
  this.isEditing = (rowIndex, colIndex) => {
2763
2852
  if (this._editVer.value < 0) return false;
2853
+ if (this.rowIndexIsGrouped(rowIndex)) return false;
2764
2854
  if (this._editingRowIndex.value != null && this._editingRowIndex.value === rowIndex) {
2765
2855
  const colId = this.columnIdAt(rowIndex, colIndex);
2766
2856
  return colId != null && this.columnEditable(colId);
@@ -2818,12 +2908,24 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2818
2908
  const row = (this._rows.value || [])[this._editingRow.value];
2819
2909
  return row ? row.id : null;
2820
2910
  };
2821
- this.focusEditorWhenReady = (selectAll = true) => {
2911
+ this.resolveEditFocusCellEl = (rowIndex, colIndex) => {
2912
+ if (rowIndex == null || colIndex == null || rowIndex < 0 || colIndex < 0) return null;
2913
+ return this.resolveCellEl(String(rowIndex), colIndex);
2914
+ };
2915
+ this.focusEditorWhenReady = (rowIndex, colIndex, selectAll = true) => {
2822
2916
  if (!this.gridRoot) return;
2823
- if (this._editFocusColId.value != null && this.hasEditorSlot(this._editFocusColId.value)) return;
2824
2917
  let attempts = 0;
2825
2918
  const tryFocus = () => {
2826
- const el = this.gridRoot ? this.gridRoot.querySelector("[data-editing-cell]") : null;
2919
+ const cellEl = this.resolveEditFocusCellEl(rowIndex, colIndex);
2920
+ const el = cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell][data-builtin-editor]") : null;
2921
+ if (!el) {
2922
+ if (cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell]") : null) return;
2923
+ attempts = attempts + 1;
2924
+ if (attempts >= 30) return;
2925
+ if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
2926
+ else setTimeout(tryFocus, 16);
2927
+ return;
2928
+ }
2827
2929
  const ae = this.gridRoot && this.gridRoot.getRootNode ? this.gridRoot.getRootNode().activeElement : null;
2828
2930
  if (ae && el && ae !== el && ae.closest && this.gridRoot.contains(ae) && ae.hasAttribute && ae.hasAttribute("data-editing-cell")) {
2829
2931
  const aeCell = ae.closest("[data-grid-cell]");
@@ -2832,17 +2934,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2832
2934
  const elCol = elCell ? elCell.getAttribute("data-col-index") : null;
2833
2935
  if (aeCol != null && aeCol !== elCol) return;
2834
2936
  }
2835
- if (el) {
2836
- el.focus();
2837
- if (selectAll && el.select) try {
2838
- el.select();
2839
- } catch (e) {}
2840
- return;
2841
- }
2842
- attempts = attempts + 1;
2843
- if (attempts >= 30) return;
2844
- if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
2845
- else setTimeout(tryFocus, 16);
2937
+ el.focus();
2938
+ if (selectAll && el.select) try {
2939
+ el.select();
2940
+ } catch (e) {}
2846
2941
  };
2847
2942
  if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
2848
2943
  else setTimeout(tryFocus, 0);
@@ -2860,6 +2955,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2860
2955
  return cell ? cell.getValue() : null;
2861
2956
  };
2862
2957
  this.beginEdit = (rowIndex, colIndex, seed) => {
2958
+ if (this.rowIndexIsGrouped(rowIndex)) return;
2863
2959
  const colId = this.columnIdAt(rowIndex, colIndex);
2864
2960
  if (colId == null || !this.columnEditable(colId)) return;
2865
2961
  this.committedThisSession = false;
@@ -2872,7 +2968,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2872
2968
  this._activeInControl.value = true;
2873
2969
  this._editVer.value = this._editVer.value + 1;
2874
2970
  this._editFocusColId.value = colId;
2875
- this.focusEditorWhenReady(seed == null);
2971
+ this.focusEditorWhenReady(rowIndex, colIndex, seed == null);
2876
2972
  };
2877
2973
  this.focusCellWhenReady = (row, col) => {
2878
2974
  if (!this.gridRoot) return;
@@ -2941,7 +3037,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2941
3037
  const err = this.runValidator(colId, newValue, rowOriginal);
2942
3038
  if (err !== true) {
2943
3039
  this.setInvalid(err);
2944
- this.focusEditorWhenReady();
3040
+ this.focusEditorWhenReady(this._editingRow.value, this._editingCol.value);
2945
3041
  return false;
2946
3042
  }
2947
3043
  this.setInvalid("");
@@ -2977,6 +3073,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2977
3073
  return true;
2978
3074
  };
2979
3075
  this.toggleActiveBooleanCell = () => {
3076
+ if (this.rowIndexIsGrouped(this._activeRow.value)) return;
2980
3077
  const colId = this.columnIdAt(this._activeRow.value, this._activeColIndex.value);
2981
3078
  if (colId == null || !this.columnEditable(colId)) return;
2982
3079
  const row = (this._rows.value || [])[this._activeRow.value];
@@ -3042,12 +3139,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3042
3139
  };
3043
3140
  this.focusRowEditorAt = (rowIndex, colIndex) => {
3044
3141
  if (!this.gridRoot) return;
3045
- const colId = this.columnIdAt(rowIndex, colIndex);
3046
- if (colId != null && this.hasEditorSlot(colId)) return;
3047
3142
  let attempts = 0;
3048
3143
  const tryFocus = () => {
3049
3144
  const cellEl = this.resolveCellEl(String(rowIndex), colIndex);
3050
- const ed = cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell]") : null;
3145
+ const ed = cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell][data-builtin-editor]") : null;
3051
3146
  if (ed) {
3052
3147
  ed.focus();
3053
3148
  if (ed.select) try {
@@ -3055,6 +3150,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3055
3150
  } catch (e) {}
3056
3151
  return;
3057
3152
  }
3153
+ if (cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell]") : null) return;
3058
3154
  attempts = attempts + 1;
3059
3155
  if (attempts >= 30) return;
3060
3156
  if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
@@ -3066,6 +3162,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3066
3162
  this.beginRowEdit = (row) => {
3067
3163
  const rowIndex = this.rowIndexOf(row);
3068
3164
  if (rowIndex < 0) return;
3165
+ if (this.rowIndexIsGrouped(rowIndex)) return;
3069
3166
  const editable = this.editableColumnsForRow(rowIndex);
3070
3167
  if (editable.length === 0) return;
3071
3168
  this.committedThisSession = false;
@@ -3085,7 +3182,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3085
3182
  this._activeInControl.value = true;
3086
3183
  this._editVer.value = this._editVer.value + 1;
3087
3184
  this._editFocusColId.value = editable[0].colId;
3088
- this.focusEditorWhenReady();
3185
+ this.focusEditorWhenReady(rowIndex, editable[0].colIndex);
3089
3186
  };
3090
3187
  this.commitRow = () => {
3091
3188
  if (this._editingRowIndex.value == null) return false;
@@ -3870,10 +3967,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3870
3967
  }
3871
3968
  }
3872
3969
  {
3873
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"colHeader\"]");
3970
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3874
3971
  if (slotEl !== null && slotEl !== void 0) {
3875
3972
  const update = () => {
3876
- this._hasSlotColHeader = this._slotColHeaderElements.length > 0;
3973
+ this._hasSlotDynamicColHeader = this._slotDynamicColHeaderElements.length > 0;
3877
3974
  };
3878
3975
  slotEl.addEventListener("slotchange", update);
3879
3976
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3881,10 +3978,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3881
3978
  }
3882
3979
  }
3883
3980
  {
3884
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"filter\"]");
3981
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3885
3982
  if (slotEl !== null && slotEl !== void 0) {
3886
3983
  const update = () => {
3887
- this._hasSlotFilter = this._slotFilterElements.length > 0;
3984
+ this._hasSlotDynamicFilter = this._slotDynamicFilterElements.length > 0;
3888
3985
  };
3889
3986
  slotEl.addEventListener("slotchange", update);
3890
3987
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3903,10 +4000,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3903
4000
  }
3904
4001
  }
3905
4002
  {
3906
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"cell\"]");
4003
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3907
4004
  if (slotEl !== null && slotEl !== void 0) {
3908
4005
  const update = () => {
3909
- this._hasSlotCell = this._slotCellElements.length > 0;
4006
+ this._hasSlotDynamicCell = this._slotDynamicCellElements.length > 0;
3910
4007
  };
3911
4008
  slotEl.addEventListener("slotchange", update);
3912
4009
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3914,10 +4011,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3914
4011
  }
3915
4012
  }
3916
4013
  {
3917
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"editor\"]");
4014
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3918
4015
  if (slotEl !== null && slotEl !== void 0) {
3919
4016
  const update = () => {
3920
- this._hasSlotEditor = this._slotEditorElements.length > 0;
4017
+ this._hasSlotDynamicEditor = this._slotDynamicEditorElements.length > 0;
3921
4018
  };
3922
4019
  slotEl.addEventListener("slotchange", update);
3923
4020
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3935,17 +4032,65 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3935
4032
  update();
3936
4033
  }
3937
4034
  }
4035
+ {
4036
+ const slotEl = this.shadowRoot?.querySelector("slot[name=\"colHeader\"]");
4037
+ if (slotEl !== null && slotEl !== void 0) {
4038
+ const update = () => {
4039
+ this._hasSlotColHeader = this._slotColHeaderElements.length > 0;
4040
+ };
4041
+ slotEl.addEventListener("slotchange", update);
4042
+ this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
4043
+ update();
4044
+ }
4045
+ }
4046
+ {
4047
+ const slotEl = this.shadowRoot?.querySelector("slot[name=\"filter\"]");
4048
+ if (slotEl !== null && slotEl !== void 0) {
4049
+ const update = () => {
4050
+ this._hasSlotFilter = this._slotFilterElements.length > 0;
4051
+ };
4052
+ slotEl.addEventListener("slotchange", update);
4053
+ this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
4054
+ update();
4055
+ }
4056
+ }
4057
+ {
4058
+ const slotEl = this.shadowRoot?.querySelector("slot[name=\"cell\"]");
4059
+ if (slotEl !== null && slotEl !== void 0) {
4060
+ const update = () => {
4061
+ this._hasSlotCell = this._slotCellElements.length > 0;
4062
+ };
4063
+ slotEl.addEventListener("slotchange", update);
4064
+ this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
4065
+ update();
4066
+ }
4067
+ }
4068
+ {
4069
+ const slotEl = this.shadowRoot?.querySelector("slot[name=\"editor\"]");
4070
+ if (slotEl !== null && slotEl !== void 0) {
4071
+ const update = () => {
4072
+ this._hasSlotEditor = this._slotEditorElements.length > 0;
4073
+ };
4074
+ slotEl.addEventListener("slotchange", update);
4075
+ this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
4076
+ update();
4077
+ }
4078
+ }
3938
4079
  }
3939
4080
  connectedCallback() {
3940
4081
  this._hasSlotDefault = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
3941
4082
  this._hasSlotGroupBar = Array.from(this.children).some((el) => el.getAttribute("slot") === "groupBar");
3942
4083
  this._hasSlotSelectAll = Array.from(this.children).some((el) => el.getAttribute("slot") === "selectAll");
4084
+ this._hasSlotDynamicColHeader = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
4085
+ this._hasSlotDynamicFilter = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
4086
+ this._hasSlotSelectCell = Array.from(this.children).some((el) => el.getAttribute("slot") === "selectCell");
4087
+ this._hasSlotDynamicCell = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
4088
+ this._hasSlotDynamicEditor = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
4089
+ this._hasSlotDetail = Array.from(this.children).some((el) => el.getAttribute("slot") === "detail");
3943
4090
  this._hasSlotColHeader = Array.from(this.children).some((el) => el.getAttribute("slot") === "colHeader");
3944
4091
  this._hasSlotFilter = Array.from(this.children).some((el) => el.getAttribute("slot") === "filter");
3945
- this._hasSlotSelectCell = Array.from(this.children).some((el) => el.getAttribute("slot") === "selectCell");
3946
4092
  this._hasSlotCell = Array.from(this.children).some((el) => el.getAttribute("slot") === "cell");
3947
4093
  this._hasSlotEditor = Array.from(this.children).some((el) => el.getAttribute("slot") === "editor");
3948
- this._hasSlotDetail = Array.from(this.children).some((el) => el.getAttribute("slot") === "detail");
3949
4094
  super.connectedCallback();
3950
4095
  if (this.hasUpdated && this._rozieTornDown) {
3951
4096
  this._rozieTornDown = false;
@@ -4207,7 +4352,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4207
4352
  "rdt-expander-th": this.isExpanderColumn(wh.header.column.id),
4208
4353
  "rdt-th-resizing": this.columnIsResizing(wh.header.column.id),
4209
4354
  "rdt-cell-active": this.isActiveCell("__header", this.headerColIndexOf(hg, wh.header), hgLevel)
4210
- }).filter(([, v]) => v).map(([k]) => k).join(" ")}" role="columnheader" data-col=${rozieAttr(wh.header.column.id)} data-grid-cell="" data-row="__header" data-header-level=${rozieAttr(hgLevel)} colspan=${rozieAttr(wh.span > 1 ? wh.span : null)} data-col-index=${rozieAttr(this.headerColIndexOf(hg, wh.header))} tabindex=${rozieAttr(this.cellTabindex("__header", this.headerColIndexOf(hg, wh.header), hgLevel))} aria-sort=${rozieAttr(this.ariaSortFor(wh.header.column.id))} style=${rozieStyle(this.thStyle(wh.header.column.id))} data-rozie-s-d5dcab4c>
4355
+ }).filter(([, v]) => v).map(([k]) => k).join(" ")}" role="columnheader" data-col=${rozieAttr(wh.header.column.id)} data-grid-cell="" data-row="__header" data-header-level=${rozieAttr(hgLevel)} colspan=${rozieAttr(wh.span > 1 ? wh.span : null)} data-col-index=${rozieAttr(this.headerColIndexOf(hg, wh.header))} tabindex=${rozieAttr(this.cellTabindex("__header", this.headerColIndexOf(hg, wh.header), hgLevel))} aria-sort=${rozieAttr(this.ariaSortFor(wh.header.column.id))} style=${rozieStyle(this.thStyle(wh.header))} data-rozie-s-d5dcab4c>
4211
4356
  ${this.isSelectColumn(wh.header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4212
4357
  ${this.selectAll !== void 0 ? this.selectAll({
4213
4358
  checked: this.isAllRowsSelected(),
@@ -4231,7 +4376,22 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4231
4376
  this.onHeaderSort(wh.header.column.id, $event);
4232
4377
  }} data-rozie-s-d5dcab4c>
4233
4378
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4234
- ${this.colHeader !== void 0 ? this.colHeader({
4379
+ ${this.rozieSlots?.[`colHeader-${wh.header.column.id}`] !== void 0 ? this.rozieSlots?.[`colHeader-${wh.header.column.id}`]({
4380
+ columnId: wh.header.column.id,
4381
+ column: wh.header.column,
4382
+ label: this.headerLabel(wh.header.column.id)
4383
+ }) : html`<slot name="${`colHeader-${wh.header.column.id}`}" data-rozie-params=${(() => {
4384
+ try {
4385
+ return JSON.stringify({
4386
+ columnId: wh.header.column.id,
4387
+ column: wh.header.column,
4388
+ label: this.headerLabel(wh.header.column.id)
4389
+ });
4390
+ } catch {
4391
+ return "{}";
4392
+ }
4393
+ })()}>
4394
+ ${this.colHeader !== void 0 ? this.colHeader({
4235
4395
  columnId: wh.header.column.id,
4236
4396
  column: wh.header.column,
4237
4397
  label: this.headerLabel(wh.header.column.id)
@@ -4246,11 +4406,27 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4246
4406
  return "{}";
4247
4407
  }
4248
4408
  })()}>${rozieDisplay(this.headerLabel(wh.header.column.id))}</slot>`}
4409
+ </slot>`}
4249
4410
  </span>
4250
4411
  <span class="rdt-sort-ind" aria-hidden="true" data-rozie-s-d5dcab4c>${rozieDisplay(this.sortIndicator(wh.header.column.id))}</span>
4251
4412
  </button>` : html`<span style="display:contents" data-rozie-s-d5dcab4c>
4252
4413
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4253
- ${this.colHeader !== void 0 ? this.colHeader({
4414
+ ${this.rozieSlots?.[`colHeader-${wh.header.column.id}`] !== void 0 ? this.rozieSlots?.[`colHeader-${wh.header.column.id}`]({
4415
+ columnId: wh.header.column.id,
4416
+ column: wh.header.column,
4417
+ label: this.headerLabel(wh.header.column.id)
4418
+ }) : html`<slot name="${`colHeader-${wh.header.column.id}`}" data-rozie-params=${(() => {
4419
+ try {
4420
+ return JSON.stringify({
4421
+ columnId: wh.header.column.id,
4422
+ column: wh.header.column,
4423
+ label: this.headerLabel(wh.header.column.id)
4424
+ });
4425
+ } catch {
4426
+ return "{}";
4427
+ }
4428
+ })()}>
4429
+ ${this.colHeader !== void 0 ? this.colHeader({
4254
4430
  columnId: wh.header.column.id,
4255
4431
  column: wh.header.column,
4256
4432
  label: this.headerLabel(wh.header.column.id)
@@ -4265,6 +4441,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4265
4441
  return "{}";
4266
4442
  }
4267
4443
  })()}>${rozieDisplay(this.headerLabel(wh.header.column.id))}</slot>`}
4444
+ </slot>`}
4268
4445
  </span>
4269
4446
  </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=${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>
4270
4447
  <button class="rdt-col-menu-item" type="button" role="menuitem" aria-pressed=${this.columnPinSide(wh.header.column.id) === "left"} @click=${($event) => {
@@ -4293,12 +4470,26 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4293
4470
  ${this.hasAnyFilterableColumn() ? html`<tr class="rdt-filter-row" data-rozie-s-d5dcab4c>
4294
4471
  ${this.colsWindowed() ? html`<th class="rdt-col-spacer" aria-hidden="true" style=${rozieStyle("width:" + this.colPadLeft() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c></th>` : nothing}${repeat(this.windowedHeadersFor(this._headerGroups.value[this._headerGroups.value.length - 1], this._headerGroups.value.length - 1), (wh, _idx) => wh.header.id, (wh, _idx) => html`<th class="rdt-filter-cell" role="presentation" data-col=${rozieAttr(wh.header.column.id)} style=${rozieStyle(this.pinStyle(wh.header.column.id))} data-rozie-s-d5dcab4c>
4295
4472
  ${this.isSelectColumn(wh.header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : this.isExpanderColumn(wh.header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : html`<span style="display:contents" data-rozie-s-d5dcab4c>
4296
- ${this.columnIsFilterable(wh.header.column.id) && !this.hasFilterSlot() ? html`<input class="rdt-col-filter" type="text" aria-label=${rozieAttr("Filter " + this.headerLabel(wh.header.column.id))} .value=${this.columnFilterValue(wh.header.column.id)} @input=${($event) => {
4297
- this.onColumnFilterInput(wh.header.column.id, $event);
4298
- }} @click=${($event) => {
4299
- this.stopEvent($event);
4300
- }} data-rozie-s-d5dcab4c />` : nothing}${this.columnIsFilterable(wh.header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4301
- ${this.filter !== void 0 ? this.filter({
4473
+ ${this.columnIsFilterable(wh.header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4474
+ ${this.rozieSlots?.[`filter-${wh.header.column.id}`] !== void 0 ? this.rozieSlots?.[`filter-${wh.header.column.id}`]({
4475
+ columnId: wh.header.column.id,
4476
+ value: this.columnFilterValue(wh.header.column.id),
4477
+ uniqueValues: this.getFacetedUniqueValues(wh.header.column.id),
4478
+ minMax: this.getFacetedMinMaxValues(wh.header.column.id),
4479
+ setFilter: this.setColumnFilter
4480
+ }) : html`<slot name="${`filter-${wh.header.column.id}`}" data-rozie-params=${(() => {
4481
+ try {
4482
+ return JSON.stringify({
4483
+ columnId: wh.header.column.id,
4484
+ value: this.columnFilterValue(wh.header.column.id),
4485
+ uniqueValues: this.getFacetedUniqueValues(wh.header.column.id),
4486
+ minMax: this.getFacetedMinMaxValues(wh.header.column.id)
4487
+ });
4488
+ } catch {
4489
+ return "{}";
4490
+ }
4491
+ })()} @rozie-default-set-filter=${($event) => this.setColumnFilter($event.detail)}>
4492
+ ${this.filter !== void 0 ? this.filter({
4302
4493
  columnId: wh.header.column.id,
4303
4494
  value: this.columnFilterValue(wh.header.column.id),
4304
4495
  uniqueValues: this.getFacetedUniqueValues(wh.header.column.id),
@@ -4315,7 +4506,14 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4315
4506
  } catch {
4316
4507
  return "{}";
4317
4508
  }
4318
- })()} @rozie-filter-set-filter=${($event) => this.setColumnFilter($event.detail)}></slot>`}
4509
+ })()} @rozie-filter-set-filter=${($event) => this.setColumnFilter($event.detail)}>
4510
+ <input class="rdt-col-filter" type="text" aria-label=${rozieAttr("Filter " + this.headerLabel(wh.header.column.id))} .value=${this.columnFilterValue(wh.header.column.id)} @input=${($event) => {
4511
+ this.onColumnFilterInput(wh.header.column.id, $event);
4512
+ }} @click=${($event) => {
4513
+ this.stopEvent($event);
4514
+ }} data-rozie-s-d5dcab4c />
4515
+ </slot>`}
4516
+ </slot>`}
4319
4517
  </span>` : nothing}</span>`}</th>`)}
4320
4518
  ${this.colsWindowed() ? html`<th class="rdt-col-spacer" aria-hidden="true" style=${rozieStyle("width:" + this.colPadRight() + "px;padding:0;border:0")} data-rozie-s-d5dcab4c></th>` : nothing}</tr>` : nothing}</thead>
4321
4519
 
@@ -4345,13 +4543,13 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4345
4543
  this.onToggleExpand(wr.row, $event);
4346
4544
  }} data-rozie-s-d5dcab4c>${rozieDisplay(this.rowIsExpanded(wr.row) ? "▾" : "▸")}</button>` : nothing}</span>` : this.isSelectColumn(cell.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4347
4545
  ${this.selectCell !== void 0 ? this.selectCell({
4348
- row: wr.row.original,
4546
+ row: this.cellSlotRow(wr.row),
4349
4547
  checked: this.rowIsSelected(wr.row),
4350
4548
  toggle: (e) => this.onToggleRow(wr.row, e)
4351
4549
  }) : html`<slot name="selectCell" data-rozie-params=${(() => {
4352
4550
  try {
4353
4551
  return JSON.stringify({
4354
- row: wr.row.original,
4552
+ row: this.cellSlotRow(wr.row),
4355
4553
  checked: this.rowIsSelected(wr.row)
4356
4554
  });
4357
4555
  } catch {
@@ -4367,31 +4565,92 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4367
4565
  this.onToggleExpand(wr.row, $event);
4368
4566
  }} data-rozie-s-d5dcab4c>${rozieDisplay(this.rowIsExpanded(wr.row) ? "▾" : "▸")}</button>
4369
4567
  <span class="rdt-group-value" data-rozie-s-d5dcab4c>
4370
- ${this.cell !== void 0 ? this.cell({
4568
+ ${this.rozieSlots?.[`cell-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`cell-${cell.column.id}`]({
4371
4569
  columnId: cell.column.id,
4372
4570
  column: cell.column,
4373
- row: wr.row.original,
4571
+ row: this.cellSlotRow(wr.row),
4572
+ value: cell.getValue()
4573
+ }) : html`<slot name="${`cell-${cell.column.id}`}" data-rozie-params=${(() => {
4574
+ try {
4575
+ return JSON.stringify({
4576
+ columnId: cell.column.id,
4577
+ column: cell.column,
4578
+ row: this.cellSlotRow(wr.row),
4579
+ value: cell.getValue()
4580
+ });
4581
+ } catch {
4582
+ return "{}";
4583
+ }
4584
+ })()}>
4585
+ ${this.cell !== void 0 ? this.cell({
4586
+ columnId: cell.column.id,
4587
+ column: cell.column,
4588
+ row: this.cellSlotRow(wr.row),
4374
4589
  value: cell.getValue()
4375
4590
  }) : html`<slot name="cell" data-rozie-params=${(() => {
4376
4591
  try {
4377
4592
  return JSON.stringify({
4378
4593
  columnId: cell.column.id,
4379
4594
  column: cell.column,
4380
- row: wr.row.original,
4595
+ row: this.cellSlotRow(wr.row),
4381
4596
  value: cell.getValue()
4382
4597
  });
4383
4598
  } catch {
4384
4599
  return "{}";
4385
4600
  }
4386
4601
  })()}>${rozieDisplay(cell.getValue())}</slot>`}
4602
+ </slot>`}
4387
4603
  </span>
4388
4604
  <span class="rdt-group-count" data-rozie-s-d5dcab4c>${rozieDisplay("(" + this.groupSubRowCount(wr.row) + ")")}</span>
4389
4605
  </span>` : this.isEditing(wr.vi.index, this.colIndexOf(wr.row, cell)) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4390
- ${this.hasEditorSlot(cell.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4391
- ${this.editor !== void 0 ? this.editor({
4606
+ ${this.editorTypeOf(cell.column.id) === "number" ? html`<input class="rdt-cell-editor" type="number" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4607
+ this.onCellEditorInput(cell.column.id, $event);
4608
+ }} @keydown=${($event) => {
4609
+ this.onEditorKeyDown($event);
4610
+ }} @blur=${($event) => {
4611
+ this.onEditorBlur($event);
4612
+ }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "select" ? html`<select class="rdt-cell-editor" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @change=${($event) => {
4613
+ this.onCellEditorInput(cell.column.id, $event);
4614
+ }} @keydown=${($event) => {
4615
+ this.onEditorKeyDown($event);
4616
+ }} @blur=${($event) => {
4617
+ this.onEditorBlur($event);
4618
+ }} data-rozie-s-d5dcab4c>
4619
+ ${repeat(this.editorOptionsOf(cell.column.id), (opt, _idx) => opt.value, (opt, _idx) => html`<option value=${rozieAttr(opt.value)} data-rozie-s-d5dcab4c>${rozieDisplay(opt.label)}</option>`)}
4620
+ </select>` : this.editorTypeOf(cell.column.id) === "checkbox" ? html`<input class="rdt-cell-editor" type="checkbox" data-editing-cell="" data-builtin-editor="" ?checked=${this.editorCheckedFor(cell.column.id)} @change=${($event) => {
4621
+ this.onCellEditorCheckbox(cell.column.id, $event);
4622
+ }} @keydown=${($event) => {
4623
+ this.onEditorKeyDown($event);
4624
+ }} @blur=${($event) => {
4625
+ this.onEditorBlur($event);
4626
+ }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "custom" ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4627
+ ${this.rozieSlots?.[`editor-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`editor-${cell.column.id}`]({
4628
+ columnId: cell.column.id,
4629
+ column: cell.column,
4630
+ row: this.cellSlotRow(wr.row),
4631
+ value: this.editorValueFor(cell.column.id),
4632
+ commit: this.editorCommitFor(cell.column.id),
4633
+ cancel: this.editorCancelFor(),
4634
+ autofocus: this.editorAutofocusFor(cell.column.id, wr.vi.index)
4635
+ }) : html`<slot name="${`editor-${cell.column.id}`}" data-rozie-params=${(() => {
4636
+ try {
4637
+ return JSON.stringify({
4638
+ columnId: cell.column.id,
4639
+ column: cell.column,
4640
+ row: this.cellSlotRow(wr.row),
4641
+ value: this.editorValueFor(cell.column.id),
4642
+ commit: this.editorCommitFor(cell.column.id),
4643
+ cancel: this.editorCancelFor(),
4644
+ autofocus: this.editorAutofocusFor(cell.column.id, wr.vi.index)
4645
+ });
4646
+ } catch {
4647
+ return "{}";
4648
+ }
4649
+ })()}>
4650
+ ${this.editor !== void 0 ? this.editor({
4392
4651
  columnId: cell.column.id,
4393
4652
  column: cell.column,
4394
- row: wr.row.original,
4653
+ row: this.cellSlotRow(wr.row),
4395
4654
  value: this.editorValueFor(cell.column.id),
4396
4655
  commit: this.editorCommitFor(cell.column.id),
4397
4656
  cancel: this.editorCancelFor(),
@@ -4401,7 +4660,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4401
4660
  return JSON.stringify({
4402
4661
  columnId: cell.column.id,
4403
4662
  column: cell.column,
4404
- row: wr.row.original,
4663
+ row: this.cellSlotRow(wr.row),
4405
4664
  value: this.editorValueFor(cell.column.id),
4406
4665
  commit: this.editorCommitFor(cell.column.id),
4407
4666
  cancel: this.editorCancelFor(),
@@ -4410,51 +4669,58 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4410
4669
  } catch {
4411
4670
  return "{}";
4412
4671
  }
4413
- })()}></slot>`}
4414
- </span>` : this.editorTypeOf(cell.column.id) === "number" ? html`<input class="rdt-cell-editor" type="number" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4415
- this.onCellEditorInput(cell.column.id, $event);
4416
- }} @keydown=${($event) => {
4417
- this.onEditorKeyDown($event);
4418
- }} @blur=${($event) => {
4419
- this.onEditorBlur($event);
4420
- }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "select" ? html`<select class="rdt-cell-editor" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @change=${($event) => {
4672
+ })()}>
4673
+ <input class="rdt-cell-editor" type="text" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4421
4674
  this.onCellEditorInput(cell.column.id, $event);
4422
4675
  }} @keydown=${($event) => {
4423
4676
  this.onEditorKeyDown($event);
4424
4677
  }} @blur=${($event) => {
4425
4678
  this.onEditorBlur($event);
4426
- }} data-rozie-s-d5dcab4c>
4427
- ${repeat(this.editorOptionsOf(cell.column.id), (opt, _idx) => opt.value, (opt, _idx) => html`<option value=${rozieAttr(opt.value)} data-rozie-s-d5dcab4c>${rozieDisplay(opt.label)}</option>`)}
4428
- </select>` : this.editorTypeOf(cell.column.id) === "checkbox" ? html`<input class="rdt-cell-editor" type="checkbox" data-editing-cell="" ?checked=${this.editorCheckedFor(cell.column.id)} @change=${($event) => {
4429
- this.onCellEditorCheckbox(cell.column.id, $event);
4430
- }} @keydown=${($event) => {
4431
- this.onEditorKeyDown($event);
4432
- }} @blur=${($event) => {
4433
- this.onEditorBlur($event);
4434
- }} data-rozie-s-d5dcab4c />` : html`<input class="rdt-cell-editor" type="text" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4679
+ }} data-rozie-s-d5dcab4c />
4680
+ </slot>`}
4681
+ </slot>`}
4682
+ </span>` : html`<input class="rdt-cell-editor" type="text" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4435
4683
  this.onCellEditorInput(cell.column.id, $event);
4436
4684
  }} @keydown=${($event) => {
4437
4685
  this.onEditorKeyDown($event);
4438
4686
  }} @blur=${($event) => {
4439
4687
  this.onEditorBlur($event);
4440
4688
  }} data-rozie-s-d5dcab4c />`}</span>` : this.cellIsPlaceholder(cell) ? html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : html`<span class="rdt-cell-value" data-rozie-s-d5dcab4c>
4441
- ${this.cell !== void 0 ? this.cell({
4689
+ ${this.rozieSlots?.[`cell-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`cell-${cell.column.id}`]({
4442
4690
  columnId: cell.column.id,
4443
4691
  column: cell.column,
4444
- row: wr.row.original,
4692
+ row: this.cellSlotRow(wr.row),
4693
+ value: cell.getValue()
4694
+ }) : html`<slot name="${`cell-${cell.column.id}`}" data-rozie-params=${(() => {
4695
+ try {
4696
+ return JSON.stringify({
4697
+ columnId: cell.column.id,
4698
+ column: cell.column,
4699
+ row: this.cellSlotRow(wr.row),
4700
+ value: cell.getValue()
4701
+ });
4702
+ } catch {
4703
+ return "{}";
4704
+ }
4705
+ })()}>
4706
+ ${this.cell !== void 0 ? this.cell({
4707
+ columnId: cell.column.id,
4708
+ column: cell.column,
4709
+ row: this.cellSlotRow(wr.row),
4445
4710
  value: cell.getValue()
4446
4711
  }) : html`<slot name="cell" data-rozie-params=${(() => {
4447
4712
  try {
4448
4713
  return JSON.stringify({
4449
4714
  columnId: cell.column.id,
4450
4715
  column: cell.column,
4451
- row: wr.row.original,
4716
+ row: this.cellSlotRow(wr.row),
4452
4717
  value: cell.getValue()
4453
4718
  });
4454
4719
  } catch {
4455
4720
  return "{}";
4456
4721
  }
4457
4722
  })()}>${rozieDisplay(cell.getValue())}</slot>`}
4723
+ </slot>`}
4458
4724
  </span>`}${this.isFillHandleCell(wr.vi.index, this.colIndexOf(wr.row, cell)) ? html`<span class="rdt-fill-handle" data-fill-handle="" data-testid="fill-handle" aria-hidden="true" @pointerdown=${($event) => {
4459
4725
  this.onFillHandlePointerDown($event);
4460
4726
  }} data-rozie-s-d5dcab4c></span>` : nothing}</td>`)}
@@ -4502,7 +4768,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4502
4768
  "rdt-expander-th": this.isExpanderColumn(header.column.id),
4503
4769
  "rdt-th-resizing": this.columnIsResizing(header.column.id),
4504
4770
  "rdt-cell-active": this.isActiveCell("__header", this.headerColIndexOf(hg, header), hgLevel)
4505
- }).filter(([, v]) => v).map(([k]) => k).join(" ")}" role="columnheader" data-col=${rozieAttr(header.column.id)} data-grid-cell="" data-row="__header" data-header-level=${rozieAttr(hgLevel)} colspan=${rozieAttr(header.colSpan > 1 ? header.colSpan : null)} data-col-index=${rozieAttr(this.headerColIndexOf(hg, header))} tabindex=${rozieAttr(this.cellTabindex("__header", this.headerColIndexOf(hg, header), hgLevel))} aria-sort=${rozieAttr(this.ariaSortFor(header.column.id))} style=${rozieStyle(this.thStyle(header.column.id))} data-rozie-s-d5dcab4c>
4771
+ }).filter(([, v]) => v).map(([k]) => k).join(" ")}" role="columnheader" data-col=${rozieAttr(header.column.id)} data-grid-cell="" data-row="__header" data-header-level=${rozieAttr(hgLevel)} colspan=${rozieAttr(header.colSpan > 1 ? header.colSpan : null)} data-col-index=${rozieAttr(this.headerColIndexOf(hg, header))} tabindex=${rozieAttr(this.cellTabindex("__header", this.headerColIndexOf(hg, header), hgLevel))} aria-sort=${rozieAttr(this.ariaSortFor(header.column.id))} style=${rozieStyle(this.thStyle(header))} data-rozie-s-d5dcab4c>
4506
4772
 
4507
4773
 
4508
4774
  ${this.isSelectColumn(header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
@@ -4531,7 +4797,22 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4531
4797
  }} data-rozie-s-d5dcab4c>
4532
4798
 
4533
4799
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4534
- ${this.colHeader !== void 0 ? this.colHeader({
4800
+ ${this.rozieSlots?.[`colHeader-${header.column.id}`] !== void 0 ? this.rozieSlots?.[`colHeader-${header.column.id}`]({
4801
+ columnId: header.column.id,
4802
+ column: header.column,
4803
+ label: this.headerLabel(header.column.id)
4804
+ }) : html`<slot name="${`colHeader-${header.column.id}`}" data-rozie-params=${(() => {
4805
+ try {
4806
+ return JSON.stringify({
4807
+ columnId: header.column.id,
4808
+ column: header.column,
4809
+ label: this.headerLabel(header.column.id)
4810
+ });
4811
+ } catch {
4812
+ return "{}";
4813
+ }
4814
+ })()}>
4815
+ ${this.colHeader !== void 0 ? this.colHeader({
4535
4816
  columnId: header.column.id,
4536
4817
  column: header.column,
4537
4818
  label: this.headerLabel(header.column.id)
@@ -4546,11 +4827,27 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4546
4827
  return "{}";
4547
4828
  }
4548
4829
  })()}>${rozieDisplay(this.headerLabel(header.column.id))}</slot>`}
4830
+ </slot>`}
4549
4831
  </span>
4550
4832
  <span class="rdt-sort-ind" aria-hidden="true" data-rozie-s-d5dcab4c>${rozieDisplay(this.sortIndicator(header.column.id))}</span>
4551
4833
  </button>` : html`<span style="display:contents" data-rozie-s-d5dcab4c>
4552
4834
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4553
- ${this.colHeader !== void 0 ? this.colHeader({
4835
+ ${this.rozieSlots?.[`colHeader-${header.column.id}`] !== void 0 ? this.rozieSlots?.[`colHeader-${header.column.id}`]({
4836
+ columnId: header.column.id,
4837
+ column: header.column,
4838
+ label: this.headerLabel(header.column.id)
4839
+ }) : html`<slot name="${`colHeader-${header.column.id}`}" data-rozie-params=${(() => {
4840
+ try {
4841
+ return JSON.stringify({
4842
+ columnId: header.column.id,
4843
+ column: header.column,
4844
+ label: this.headerLabel(header.column.id)
4845
+ });
4846
+ } catch {
4847
+ return "{}";
4848
+ }
4849
+ })()}>
4850
+ ${this.colHeader !== void 0 ? this.colHeader({
4554
4851
  columnId: header.column.id,
4555
4852
  column: header.column,
4556
4853
  label: this.headerLabel(header.column.id)
@@ -4565,6 +4862,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4565
4862
  return "{}";
4566
4863
  }
4567
4864
  })()}>${rozieDisplay(this.headerLabel(header.column.id))}</slot>`}
4865
+ </slot>`}
4568
4866
  </span>
4569
4867
  </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=${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>
4570
4868
  <button class="rdt-col-menu-item" type="button" role="menuitem" aria-pressed=${this.columnPinSide(header.column.id) === "left"} @click=${($event) => {
@@ -4593,12 +4891,26 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4593
4891
  ${this.hasAnyFilterableColumn() ? html`<tr class="rdt-filter-row" data-rozie-s-d5dcab4c>
4594
4892
  ${repeat(this._headerGroups.value[this._headerGroups.value.length - 1].headers, (header, _idx) => header.id, (header, _idx) => html`<th class="rdt-filter-cell" role="presentation" style=${rozieStyle(this.pinStyle(header.column.id))} data-rozie-s-d5dcab4c>
4595
4893
  ${this.isSelectColumn(header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : this.isExpanderColumn(header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : html`<span style="display:contents" data-rozie-s-d5dcab4c>
4596
- ${this.columnIsFilterable(header.column.id) && !this.hasFilterSlot() ? html`<input class="rdt-col-filter" type="text" aria-label=${rozieAttr("Filter " + this.headerLabel(header.column.id))} .value=${this.columnFilterValue(header.column.id)} @input=${($event) => {
4597
- this.onColumnFilterInput(header.column.id, $event);
4598
- }} @click=${($event) => {
4599
- this.stopEvent($event);
4600
- }} data-rozie-s-d5dcab4c />` : nothing}${this.columnIsFilterable(header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4601
- ${this.filter !== void 0 ? this.filter({
4894
+ ${this.columnIsFilterable(header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4895
+ ${this.rozieSlots?.[`filter-${header.column.id}`] !== void 0 ? this.rozieSlots?.[`filter-${header.column.id}`]({
4896
+ columnId: header.column.id,
4897
+ value: this.columnFilterValue(header.column.id),
4898
+ uniqueValues: this.getFacetedUniqueValues(header.column.id),
4899
+ minMax: this.getFacetedMinMaxValues(header.column.id),
4900
+ setFilter: this.setColumnFilter
4901
+ }) : html`<slot name="${`filter-${header.column.id}`}" data-rozie-params=${(() => {
4902
+ try {
4903
+ return JSON.stringify({
4904
+ columnId: header.column.id,
4905
+ value: this.columnFilterValue(header.column.id),
4906
+ uniqueValues: this.getFacetedUniqueValues(header.column.id),
4907
+ minMax: this.getFacetedMinMaxValues(header.column.id)
4908
+ });
4909
+ } catch {
4910
+ return "{}";
4911
+ }
4912
+ })()} @rozie-default-set-filter=${($event) => this.setColumnFilter($event.detail)}>
4913
+ ${this.filter !== void 0 ? this.filter({
4602
4914
  columnId: header.column.id,
4603
4915
  value: this.columnFilterValue(header.column.id),
4604
4916
  uniqueValues: this.getFacetedUniqueValues(header.column.id),
@@ -4615,7 +4927,14 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4615
4927
  } catch {
4616
4928
  return "{}";
4617
4929
  }
4618
- })()} @rozie-filter-set-filter=${($event) => this.setColumnFilter($event.detail)}></slot>`}
4930
+ })()} @rozie-filter-set-filter=${($event) => this.setColumnFilter($event.detail)}>
4931
+ <input class="rdt-col-filter" type="text" aria-label=${rozieAttr("Filter " + this.headerLabel(header.column.id))} .value=${this.columnFilterValue(header.column.id)} @input=${($event) => {
4932
+ this.onColumnFilterInput(header.column.id, $event);
4933
+ }} @click=${($event) => {
4934
+ this.stopEvent($event);
4935
+ }} data-rozie-s-d5dcab4c />
4936
+ </slot>`}
4937
+ </slot>`}
4619
4938
  </span>` : nothing}</span>`}</th>`)}
4620
4939
  </tr>` : nothing}</thead>
4621
4940
 
@@ -4639,13 +4958,13 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4639
4958
  this.onToggleExpand(row, $event);
4640
4959
  }} data-rozie-s-d5dcab4c>${rozieDisplay(this.rowIsExpanded(row) ? "▾" : "▸")}</button>` : nothing}</span>` : this.isSelectColumn(cell.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4641
4960
  ${this.selectCell !== void 0 ? this.selectCell({
4642
- row: row.original,
4961
+ row: this.cellSlotRow(row),
4643
4962
  checked: this.rowIsSelected(row),
4644
4963
  toggle: (e) => this.onToggleRow(row, e)
4645
4964
  }) : html`<slot name="selectCell" data-rozie-params=${(() => {
4646
4965
  try {
4647
4966
  return JSON.stringify({
4648
- row: row.original,
4967
+ row: this.cellSlotRow(row),
4649
4968
  checked: this.rowIsSelected(row)
4650
4969
  });
4651
4970
  } catch {
@@ -4661,31 +4980,92 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4661
4980
  this.onToggleExpand(row, $event);
4662
4981
  }} data-rozie-s-d5dcab4c>${rozieDisplay(this.rowIsExpanded(row) ? "▾" : "▸")}</button>
4663
4982
  <span class="rdt-group-value" data-rozie-s-d5dcab4c>
4664
- ${this.cell !== void 0 ? this.cell({
4983
+ ${this.rozieSlots?.[`cell-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`cell-${cell.column.id}`]({
4984
+ columnId: cell.column.id,
4985
+ column: cell.column,
4986
+ row: this.cellSlotRow(row),
4987
+ value: cell.getValue()
4988
+ }) : html`<slot name="${`cell-${cell.column.id}`}" data-rozie-params=${(() => {
4989
+ try {
4990
+ return JSON.stringify({
4991
+ columnId: cell.column.id,
4992
+ column: cell.column,
4993
+ row: this.cellSlotRow(row),
4994
+ value: cell.getValue()
4995
+ });
4996
+ } catch {
4997
+ return "{}";
4998
+ }
4999
+ })()}>
5000
+ ${this.cell !== void 0 ? this.cell({
4665
5001
  columnId: cell.column.id,
4666
5002
  column: cell.column,
4667
- row: row.original,
5003
+ row: this.cellSlotRow(row),
4668
5004
  value: cell.getValue()
4669
5005
  }) : html`<slot name="cell" data-rozie-params=${(() => {
4670
5006
  try {
4671
5007
  return JSON.stringify({
4672
5008
  columnId: cell.column.id,
4673
5009
  column: cell.column,
4674
- row: row.original,
5010
+ row: this.cellSlotRow(row),
4675
5011
  value: cell.getValue()
4676
5012
  });
4677
5013
  } catch {
4678
5014
  return "{}";
4679
5015
  }
4680
5016
  })()}>${rozieDisplay(cell.getValue())}</slot>`}
5017
+ </slot>`}
4681
5018
  </span>
4682
5019
  <span class="rdt-group-count" data-rozie-s-d5dcab4c>${rozieDisplay("(" + this.groupSubRowCount(row) + ")")}</span>
4683
5020
  </span>` : this.isEditing(this.rowIndexOf(row), this.colIndexOf(row, cell)) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4684
- ${this.hasEditorSlot(cell.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4685
- ${this.editor !== void 0 ? this.editor({
5021
+ ${this.editorTypeOf(cell.column.id) === "number" ? html`<input class="rdt-cell-editor" type="number" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
5022
+ this.onCellEditorInput(cell.column.id, $event);
5023
+ }} @keydown=${($event) => {
5024
+ this.onEditorKeyDown($event);
5025
+ }} @blur=${($event) => {
5026
+ this.onEditorBlur($event);
5027
+ }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "select" ? html`<select class="rdt-cell-editor" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @change=${($event) => {
5028
+ this.onCellEditorInput(cell.column.id, $event);
5029
+ }} @keydown=${($event) => {
5030
+ this.onEditorKeyDown($event);
5031
+ }} @blur=${($event) => {
5032
+ this.onEditorBlur($event);
5033
+ }} data-rozie-s-d5dcab4c>
5034
+ ${repeat(this.editorOptionsOf(cell.column.id), (opt, _idx) => opt.value, (opt, _idx) => html`<option value=${rozieAttr(opt.value)} data-rozie-s-d5dcab4c>${rozieDisplay(opt.label)}</option>`)}
5035
+ </select>` : this.editorTypeOf(cell.column.id) === "checkbox" ? html`<input class="rdt-cell-editor" type="checkbox" data-editing-cell="" data-builtin-editor="" ?checked=${this.editorCheckedFor(cell.column.id)} @change=${($event) => {
5036
+ this.onCellEditorCheckbox(cell.column.id, $event);
5037
+ }} @keydown=${($event) => {
5038
+ this.onEditorKeyDown($event);
5039
+ }} @blur=${($event) => {
5040
+ this.onEditorBlur($event);
5041
+ }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "custom" ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
5042
+ ${this.rozieSlots?.[`editor-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`editor-${cell.column.id}`]({
4686
5043
  columnId: cell.column.id,
4687
5044
  column: cell.column,
4688
- row: row.original,
5045
+ row: this.cellSlotRow(row),
5046
+ value: this.editorValueFor(cell.column.id),
5047
+ commit: this.editorCommitFor(cell.column.id),
5048
+ cancel: this.editorCancelFor(),
5049
+ autofocus: this.editorAutofocusFor(cell.column.id, this.rowIndexOf(row))
5050
+ }) : html`<slot name="${`editor-${cell.column.id}`}" data-rozie-params=${(() => {
5051
+ try {
5052
+ return JSON.stringify({
5053
+ columnId: cell.column.id,
5054
+ column: cell.column,
5055
+ row: this.cellSlotRow(row),
5056
+ value: this.editorValueFor(cell.column.id),
5057
+ commit: this.editorCommitFor(cell.column.id),
5058
+ cancel: this.editorCancelFor(),
5059
+ autofocus: this.editorAutofocusFor(cell.column.id, this.rowIndexOf(row))
5060
+ });
5061
+ } catch {
5062
+ return "{}";
5063
+ }
5064
+ })()}>
5065
+ ${this.editor !== void 0 ? this.editor({
5066
+ columnId: cell.column.id,
5067
+ column: cell.column,
5068
+ row: this.cellSlotRow(row),
4689
5069
  value: this.editorValueFor(cell.column.id),
4690
5070
  commit: this.editorCommitFor(cell.column.id),
4691
5071
  cancel: this.editorCancelFor(),
@@ -4695,7 +5075,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4695
5075
  return JSON.stringify({
4696
5076
  columnId: cell.column.id,
4697
5077
  column: cell.column,
4698
- row: row.original,
5078
+ row: this.cellSlotRow(row),
4699
5079
  value: this.editorValueFor(cell.column.id),
4700
5080
  commit: this.editorCommitFor(cell.column.id),
4701
5081
  cancel: this.editorCancelFor(),
@@ -4704,51 +5084,58 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4704
5084
  } catch {
4705
5085
  return "{}";
4706
5086
  }
4707
- })()}></slot>`}
4708
- </span>` : this.editorTypeOf(cell.column.id) === "number" ? html`<input class="rdt-cell-editor" type="number" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4709
- this.onCellEditorInput(cell.column.id, $event);
4710
- }} @keydown=${($event) => {
4711
- this.onEditorKeyDown($event);
4712
- }} @blur=${($event) => {
4713
- this.onEditorBlur($event);
4714
- }} data-rozie-s-d5dcab4c />` : this.editorTypeOf(cell.column.id) === "select" ? html`<select class="rdt-cell-editor" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @change=${($event) => {
5087
+ })()}>
5088
+ <input class="rdt-cell-editor" type="text" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4715
5089
  this.onCellEditorInput(cell.column.id, $event);
4716
5090
  }} @keydown=${($event) => {
4717
5091
  this.onEditorKeyDown($event);
4718
5092
  }} @blur=${($event) => {
4719
5093
  this.onEditorBlur($event);
4720
- }} data-rozie-s-d5dcab4c>
4721
- ${repeat(this.editorOptionsOf(cell.column.id), (opt, _idx) => opt.value, (opt, _idx) => html`<option value=${rozieAttr(opt.value)} data-rozie-s-d5dcab4c>${rozieDisplay(opt.label)}</option>`)}
4722
- </select>` : this.editorTypeOf(cell.column.id) === "checkbox" ? html`<input class="rdt-cell-editor" type="checkbox" data-editing-cell="" ?checked=${this.editorCheckedFor(cell.column.id)} @change=${($event) => {
4723
- this.onCellEditorCheckbox(cell.column.id, $event);
4724
- }} @keydown=${($event) => {
4725
- this.onEditorKeyDown($event);
4726
- }} @blur=${($event) => {
4727
- this.onEditorBlur($event);
4728
- }} data-rozie-s-d5dcab4c />` : html`<input class="rdt-cell-editor" type="text" data-editing-cell="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
5094
+ }} data-rozie-s-d5dcab4c />
5095
+ </slot>`}
5096
+ </slot>`}
5097
+ </span>` : html`<input class="rdt-cell-editor" type="text" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4729
5098
  this.onCellEditorInput(cell.column.id, $event);
4730
5099
  }} @keydown=${($event) => {
4731
5100
  this.onEditorKeyDown($event);
4732
5101
  }} @blur=${($event) => {
4733
5102
  this.onEditorBlur($event);
4734
5103
  }} data-rozie-s-d5dcab4c />`}</span>` : this.cellIsPlaceholder(cell) ? html`<span style="display:contents" data-rozie-s-d5dcab4c></span>` : html`<span class="rdt-cell-value" data-rozie-s-d5dcab4c>
4735
- ${this.cell !== void 0 ? this.cell({
5104
+ ${this.rozieSlots?.[`cell-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`cell-${cell.column.id}`]({
5105
+ columnId: cell.column.id,
5106
+ column: cell.column,
5107
+ row: this.cellSlotRow(row),
5108
+ value: cell.getValue()
5109
+ }) : html`<slot name="${`cell-${cell.column.id}`}" data-rozie-params=${(() => {
5110
+ try {
5111
+ return JSON.stringify({
5112
+ columnId: cell.column.id,
5113
+ column: cell.column,
5114
+ row: this.cellSlotRow(row),
5115
+ value: cell.getValue()
5116
+ });
5117
+ } catch {
5118
+ return "{}";
5119
+ }
5120
+ })()}>
5121
+ ${this.cell !== void 0 ? this.cell({
4736
5122
  columnId: cell.column.id,
4737
5123
  column: cell.column,
4738
- row: row.original,
5124
+ row: this.cellSlotRow(row),
4739
5125
  value: cell.getValue()
4740
5126
  }) : html`<slot name="cell" data-rozie-params=${(() => {
4741
5127
  try {
4742
5128
  return JSON.stringify({
4743
5129
  columnId: cell.column.id,
4744
5130
  column: cell.column,
4745
- row: row.original,
5131
+ row: this.cellSlotRow(row),
4746
5132
  value: cell.getValue()
4747
5133
  });
4748
5134
  } catch {
4749
5135
  return "{}";
4750
5136
  }
4751
5137
  })()}>${rozieDisplay(cell.getValue())}</slot>`}
5138
+ </slot>`}
4752
5139
  </span>`}${this.isFillHandleCell(this.rowIndexOf(row), this.colIndexOf(row, cell)) ? html`<span class="rdt-fill-handle" data-fill-handle="" data-testid="fill-handle" aria-hidden="true" @pointerdown=${($event) => {
4753
5140
  this.onFillHandlePointerDown($event);
4754
5141
  }} data-rozie-s-d5dcab4c></span>` : nothing}</td>`)}
@@ -4982,6 +5369,26 @@ __decorate([queryAssignedElements({
4982
5369
  flatten: true
4983
5370
  })], DataTable.prototype, "_slotSelectAllElements", void 0);
4984
5371
  __decorate([property({ attribute: false })], DataTable.prototype, "selectAll", void 0);
5372
+ __decorate([state()], DataTable.prototype, "_hasSlotDynamicColHeader", void 0);
5373
+ __decorate([queryAssignedElements({ flatten: true })], DataTable.prototype, "_slotDynamicColHeaderElements", void 0);
5374
+ __decorate([state()], DataTable.prototype, "_hasSlotDynamicFilter", void 0);
5375
+ __decorate([queryAssignedElements({ flatten: true })], DataTable.prototype, "_slotDynamicFilterElements", void 0);
5376
+ __decorate([state()], DataTable.prototype, "_hasSlotSelectCell", void 0);
5377
+ __decorate([queryAssignedElements({
5378
+ slot: "selectCell",
5379
+ flatten: true
5380
+ })], DataTable.prototype, "_slotSelectCellElements", void 0);
5381
+ __decorate([property({ attribute: false })], DataTable.prototype, "selectCell", void 0);
5382
+ __decorate([state()], DataTable.prototype, "_hasSlotDynamicCell", void 0);
5383
+ __decorate([queryAssignedElements({ flatten: true })], DataTable.prototype, "_slotDynamicCellElements", void 0);
5384
+ __decorate([state()], DataTable.prototype, "_hasSlotDynamicEditor", void 0);
5385
+ __decorate([queryAssignedElements({ flatten: true })], DataTable.prototype, "_slotDynamicEditorElements", void 0);
5386
+ __decorate([state()], DataTable.prototype, "_hasSlotDetail", void 0);
5387
+ __decorate([queryAssignedElements({
5388
+ slot: "detail",
5389
+ flatten: true
5390
+ })], DataTable.prototype, "_slotDetailElements", void 0);
5391
+ __decorate([property({ attribute: false })], DataTable.prototype, "detail", void 0);
4985
5392
  __decorate([state()], DataTable.prototype, "_hasSlotColHeader", void 0);
4986
5393
  __decorate([queryAssignedElements({
4987
5394
  slot: "colHeader",
@@ -4994,12 +5401,6 @@ __decorate([queryAssignedElements({
4994
5401
  flatten: true
4995
5402
  })], DataTable.prototype, "_slotFilterElements", void 0);
4996
5403
  __decorate([property({ attribute: false })], DataTable.prototype, "filter", void 0);
4997
- __decorate([state()], DataTable.prototype, "_hasSlotSelectCell", void 0);
4998
- __decorate([queryAssignedElements({
4999
- slot: "selectCell",
5000
- flatten: true
5001
- })], DataTable.prototype, "_slotSelectCellElements", void 0);
5002
- __decorate([property({ attribute: false })], DataTable.prototype, "selectCell", void 0);
5003
5404
  __decorate([state()], DataTable.prototype, "_hasSlotCell", void 0);
5004
5405
  __decorate([queryAssignedElements({
5005
5406
  slot: "cell",
@@ -5012,12 +5413,6 @@ __decorate([queryAssignedElements({
5012
5413
  flatten: true
5013
5414
  })], DataTable.prototype, "_slotEditorElements", void 0);
5014
5415
  __decorate([property({ attribute: false })], DataTable.prototype, "editor", void 0);
5015
- __decorate([state()], DataTable.prototype, "_hasSlotDetail", void 0);
5016
- __decorate([queryAssignedElements({
5017
- slot: "detail",
5018
- flatten: true
5019
- })], DataTable.prototype, "_slotDetailElements", void 0);
5020
- __decorate([property({ attribute: false })], DataTable.prototype, "detail", void 0);
5021
5416
  __decorate([property({ attribute: false })], DataTable.prototype, "rozieSlots", void 0);
5022
5417
  DataTable = __decorate([customElement("rozie-data-table")], DataTable);
5023
5418
  var DataTable_default = DataTable;