@rozie-ui/data-table-lit 0.3.2 → 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
@@ -396,12 +396,16 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
396
396
  this._hasSlotDefault = false;
397
397
  this._hasSlotGroupBar = false;
398
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;
399
405
  this._hasSlotColHeader = false;
400
406
  this._hasSlotFilter = false;
401
- this._hasSlotSelectCell = false;
402
407
  this._hasSlotCell = false;
403
408
  this._hasSlotEditor = false;
404
- this._hasSlotDetail = false;
405
409
  this._disconnectCleanups = [];
406
410
  this._rozieTornDown = false;
407
411
  this.table = null;
@@ -1310,8 +1314,6 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
1310
1314
  const m = this.editMetaOf(colId);
1311
1315
  return m && m.editorOptions != null ? m.editorOptions : [];
1312
1316
  };
1313
- this.hasEditorSlot = (colId) => this.editorTypeOf(colId) === "custom" && !!(this._hasSlotEditor || this.editor !== void 0);
1314
- this.hasFilterSlot = () => !!(this._hasSlotFilter || this.filter !== void 0);
1315
1317
  this.columnIsFilterable = (colId) => {
1316
1318
  const d = this.defFor(colId);
1317
1319
  return !!(d && d.filterable);
@@ -1320,11 +1322,9 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
1320
1322
  const d = this.defFor(colId);
1321
1323
  return d ? d.header : colId;
1322
1324
  };
1323
- this.headerWidth = (colId) => {
1324
- if (this.tick() < 0 || !this.table) return null;
1325
- const col = this.table.getColumn(colId);
1326
- if (!col) return null;
1327
- 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();
1328
1328
  return w != null && w > 0 ? w + "px" : null;
1329
1329
  };
1330
1330
  this.onResizeStart = (colId, evt) => {
@@ -1393,11 +1393,11 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
1393
1393
  if (side === "right") return "position:sticky;right:" + (col.getAfter ? col.getAfter("right") : 0) + "px;z-index:" + zIndex + ";";
1394
1394
  return "";
1395
1395
  };
1396
- this.thStyle = (colId) => {
1396
+ this.thStyle = (header) => {
1397
1397
  let s = "";
1398
- const w = this.headerWidth(colId);
1398
+ const w = this.headerWidth(header);
1399
1399
  if (w) s += "width:" + w + ";";
1400
- s += this.pinStyle(colId, 2);
1400
+ s += this.pinStyle(header && header.column ? header.column.id : null, 2);
1401
1401
  return s;
1402
1402
  };
1403
1403
  this.onGlobalFilterInput = (evt) => {
@@ -2703,8 +2703,9 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2703
2703
  this.fillEdgeScrollRaf = null;
2704
2704
  }
2705
2705
  };
2706
- this.cellIndexFromPoint = (clientX, clientY) => {
2707
- 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) => {
2708
2709
  let el = document.elementFromPoint(clientX, clientY);
2709
2710
  while (el && el.shadowRoot && el.shadowRoot.elementFromPoint) {
2710
2711
  const inner = el.shadowRoot.elementFromPoint(clientX, clientY);
@@ -2725,6 +2726,18 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2725
2726
  c
2726
2727
  };
2727
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
+ };
2728
2741
  this.onFillHandlePointerDown = (e) => {
2729
2742
  if (!e) return;
2730
2743
  if (e.preventDefault) e.preventDefault();
@@ -2895,12 +2908,24 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2895
2908
  const row = (this._rows.value || [])[this._editingRow.value];
2896
2909
  return row ? row.id : null;
2897
2910
  };
2898
- 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) => {
2899
2916
  if (!this.gridRoot) return;
2900
- if (this._editFocusColId.value != null && this.hasEditorSlot(this._editFocusColId.value)) return;
2901
2917
  let attempts = 0;
2902
2918
  const tryFocus = () => {
2903
- 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
+ }
2904
2929
  const ae = this.gridRoot && this.gridRoot.getRootNode ? this.gridRoot.getRootNode().activeElement : null;
2905
2930
  if (ae && el && ae !== el && ae.closest && this.gridRoot.contains(ae) && ae.hasAttribute && ae.hasAttribute("data-editing-cell")) {
2906
2931
  const aeCell = ae.closest("[data-grid-cell]");
@@ -2909,17 +2934,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2909
2934
  const elCol = elCell ? elCell.getAttribute("data-col-index") : null;
2910
2935
  if (aeCol != null && aeCol !== elCol) return;
2911
2936
  }
2912
- if (el) {
2913
- el.focus();
2914
- if (selectAll && el.select) try {
2915
- el.select();
2916
- } catch (e) {}
2917
- return;
2918
- }
2919
- attempts = attempts + 1;
2920
- if (attempts >= 30) return;
2921
- if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
2922
- else setTimeout(tryFocus, 16);
2937
+ el.focus();
2938
+ if (selectAll && el.select) try {
2939
+ el.select();
2940
+ } catch (e) {}
2923
2941
  };
2924
2942
  if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
2925
2943
  else setTimeout(tryFocus, 0);
@@ -2950,7 +2968,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
2950
2968
  this._activeInControl.value = true;
2951
2969
  this._editVer.value = this._editVer.value + 1;
2952
2970
  this._editFocusColId.value = colId;
2953
- this.focusEditorWhenReady(seed == null);
2971
+ this.focusEditorWhenReady(rowIndex, colIndex, seed == null);
2954
2972
  };
2955
2973
  this.focusCellWhenReady = (row, col) => {
2956
2974
  if (!this.gridRoot) return;
@@ -3019,7 +3037,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3019
3037
  const err = this.runValidator(colId, newValue, rowOriginal);
3020
3038
  if (err !== true) {
3021
3039
  this.setInvalid(err);
3022
- this.focusEditorWhenReady();
3040
+ this.focusEditorWhenReady(this._editingRow.value, this._editingCol.value);
3023
3041
  return false;
3024
3042
  }
3025
3043
  this.setInvalid("");
@@ -3121,12 +3139,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3121
3139
  };
3122
3140
  this.focusRowEditorAt = (rowIndex, colIndex) => {
3123
3141
  if (!this.gridRoot) return;
3124
- const colId = this.columnIdAt(rowIndex, colIndex);
3125
- if (colId != null && this.hasEditorSlot(colId)) return;
3126
3142
  let attempts = 0;
3127
3143
  const tryFocus = () => {
3128
3144
  const cellEl = this.resolveCellEl(String(rowIndex), colIndex);
3129
- 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;
3130
3146
  if (ed) {
3131
3147
  ed.focus();
3132
3148
  if (ed.select) try {
@@ -3134,6 +3150,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3134
3150
  } catch (e) {}
3135
3151
  return;
3136
3152
  }
3153
+ if (cellEl && cellEl.querySelector ? cellEl.querySelector("[data-editing-cell]") : null) return;
3137
3154
  attempts = attempts + 1;
3138
3155
  if (attempts >= 30) return;
3139
3156
  if (typeof requestAnimationFrame === "function") requestAnimationFrame(tryFocus);
@@ -3165,7 +3182,7 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3165
3182
  this._activeInControl.value = true;
3166
3183
  this._editVer.value = this._editVer.value + 1;
3167
3184
  this._editFocusColId.value = editable[0].colId;
3168
- this.focusEditorWhenReady();
3185
+ this.focusEditorWhenReady(rowIndex, editable[0].colIndex);
3169
3186
  };
3170
3187
  this.commitRow = () => {
3171
3188
  if (this._editingRowIndex.value == null) return false;
@@ -3950,10 +3967,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3950
3967
  }
3951
3968
  }
3952
3969
  {
3953
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"colHeader\"]");
3970
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3954
3971
  if (slotEl !== null && slotEl !== void 0) {
3955
3972
  const update = () => {
3956
- this._hasSlotColHeader = this._slotColHeaderElements.length > 0;
3973
+ this._hasSlotDynamicColHeader = this._slotDynamicColHeaderElements.length > 0;
3957
3974
  };
3958
3975
  slotEl.addEventListener("slotchange", update);
3959
3976
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3961,10 +3978,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3961
3978
  }
3962
3979
  }
3963
3980
  {
3964
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"filter\"]");
3981
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3965
3982
  if (slotEl !== null && slotEl !== void 0) {
3966
3983
  const update = () => {
3967
- this._hasSlotFilter = this._slotFilterElements.length > 0;
3984
+ this._hasSlotDynamicFilter = this._slotDynamicFilterElements.length > 0;
3968
3985
  };
3969
3986
  slotEl.addEventListener("slotchange", update);
3970
3987
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3983,10 +4000,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3983
4000
  }
3984
4001
  }
3985
4002
  {
3986
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"cell\"]");
4003
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3987
4004
  if (slotEl !== null && slotEl !== void 0) {
3988
4005
  const update = () => {
3989
- this._hasSlotCell = this._slotCellElements.length > 0;
4006
+ this._hasSlotDynamicCell = this._slotDynamicCellElements.length > 0;
3990
4007
  };
3991
4008
  slotEl.addEventListener("slotchange", update);
3992
4009
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -3994,10 +4011,10 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
3994
4011
  }
3995
4012
  }
3996
4013
  {
3997
- const slotEl = this.shadowRoot?.querySelector("slot[name=\"editor\"]");
4014
+ const slotEl = this.shadowRoot?.querySelector("slot:not([name])");
3998
4015
  if (slotEl !== null && slotEl !== void 0) {
3999
4016
  const update = () => {
4000
- this._hasSlotEditor = this._slotEditorElements.length > 0;
4017
+ this._hasSlotDynamicEditor = this._slotDynamicEditorElements.length > 0;
4001
4018
  };
4002
4019
  slotEl.addEventListener("slotchange", update);
4003
4020
  this._disconnectCleanups.push(() => slotEl.removeEventListener("slotchange", update));
@@ -4015,17 +4032,65 @@ let DataTable = class DataTable extends SignalWatcher(LitElement) {
4015
4032
  update();
4016
4033
  }
4017
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
+ }
4018
4079
  }
4019
4080
  connectedCallback() {
4020
4081
  this._hasSlotDefault = Array.from(this.children).some((el) => !el.hasAttribute("slot") && (el.nodeType !== 3 || (el.textContent?.trim().length ?? 0) > 0));
4021
4082
  this._hasSlotGroupBar = Array.from(this.children).some((el) => el.getAttribute("slot") === "groupBar");
4022
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");
4023
4090
  this._hasSlotColHeader = Array.from(this.children).some((el) => el.getAttribute("slot") === "colHeader");
4024
4091
  this._hasSlotFilter = Array.from(this.children).some((el) => el.getAttribute("slot") === "filter");
4025
- this._hasSlotSelectCell = Array.from(this.children).some((el) => el.getAttribute("slot") === "selectCell");
4026
4092
  this._hasSlotCell = Array.from(this.children).some((el) => el.getAttribute("slot") === "cell");
4027
4093
  this._hasSlotEditor = Array.from(this.children).some((el) => el.getAttribute("slot") === "editor");
4028
- this._hasSlotDetail = Array.from(this.children).some((el) => el.getAttribute("slot") === "detail");
4029
4094
  super.connectedCallback();
4030
4095
  if (this.hasUpdated && this._rozieTornDown) {
4031
4096
  this._rozieTornDown = false;
@@ -4287,7 +4352,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4287
4352
  "rdt-expander-th": this.isExpanderColumn(wh.header.column.id),
4288
4353
  "rdt-th-resizing": this.columnIsResizing(wh.header.column.id),
4289
4354
  "rdt-cell-active": this.isActiveCell("__header", this.headerColIndexOf(hg, wh.header), hgLevel)
4290
- }).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>
4291
4356
  ${this.isSelectColumn(wh.header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4292
4357
  ${this.selectAll !== void 0 ? this.selectAll({
4293
4358
  checked: this.isAllRowsSelected(),
@@ -4311,7 +4376,22 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4311
4376
  this.onHeaderSort(wh.header.column.id, $event);
4312
4377
  }} data-rozie-s-d5dcab4c>
4313
4378
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4314
- ${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({
4315
4395
  columnId: wh.header.column.id,
4316
4396
  column: wh.header.column,
4317
4397
  label: this.headerLabel(wh.header.column.id)
@@ -4326,11 +4406,27 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4326
4406
  return "{}";
4327
4407
  }
4328
4408
  })()}>${rozieDisplay(this.headerLabel(wh.header.column.id))}</slot>`}
4409
+ </slot>`}
4329
4410
  </span>
4330
4411
  <span class="rdt-sort-ind" aria-hidden="true" data-rozie-s-d5dcab4c>${rozieDisplay(this.sortIndicator(wh.header.column.id))}</span>
4331
4412
  </button>` : html`<span style="display:contents" data-rozie-s-d5dcab4c>
4332
4413
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4333
- ${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({
4334
4430
  columnId: wh.header.column.id,
4335
4431
  column: wh.header.column,
4336
4432
  label: this.headerLabel(wh.header.column.id)
@@ -4345,6 +4441,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4345
4441
  return "{}";
4346
4442
  }
4347
4443
  })()}>${rozieDisplay(this.headerLabel(wh.header.column.id))}</slot>`}
4444
+ </slot>`}
4348
4445
  </span>
4349
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>
4350
4447
  <button class="rdt-col-menu-item" type="button" role="menuitem" aria-pressed=${this.columnPinSide(wh.header.column.id) === "left"} @click=${($event) => {
@@ -4373,12 +4470,26 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4373
4470
  ${this.hasAnyFilterableColumn() ? html`<tr class="rdt-filter-row" data-rozie-s-d5dcab4c>
4374
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>
4375
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>
4376
- ${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) => {
4377
- this.onColumnFilterInput(wh.header.column.id, $event);
4378
- }} @click=${($event) => {
4379
- this.stopEvent($event);
4380
- }} data-rozie-s-d5dcab4c />` : nothing}${this.columnIsFilterable(wh.header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4381
- ${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({
4382
4493
  columnId: wh.header.column.id,
4383
4494
  value: this.columnFilterValue(wh.header.column.id),
4384
4495
  uniqueValues: this.getFacetedUniqueValues(wh.header.column.id),
@@ -4395,7 +4506,14 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4395
4506
  } catch {
4396
4507
  return "{}";
4397
4508
  }
4398
- })()} @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>`}
4399
4517
  </span>` : nothing}</span>`}</th>`)}
4400
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>
4401
4519
 
@@ -4447,7 +4565,24 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4447
4565
  this.onToggleExpand(wr.row, $event);
4448
4566
  }} data-rozie-s-d5dcab4c>${rozieDisplay(this.rowIsExpanded(wr.row) ? "▾" : "▸")}</button>
4449
4567
  <span class="rdt-group-value" data-rozie-s-d5dcab4c>
4450
- ${this.cell !== void 0 ? this.cell({
4568
+ ${this.rozieSlots?.[`cell-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`cell-${cell.column.id}`]({
4569
+ columnId: cell.column.id,
4570
+ column: cell.column,
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({
4451
4586
  columnId: cell.column.id,
4452
4587
  column: cell.column,
4453
4588
  row: this.cellSlotRow(wr.row),
@@ -4464,11 +4599,55 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4464
4599
  return "{}";
4465
4600
  }
4466
4601
  })()}>${rozieDisplay(cell.getValue())}</slot>`}
4602
+ </slot>`}
4467
4603
  </span>
4468
4604
  <span class="rdt-group-count" data-rozie-s-d5dcab4c>${rozieDisplay("(" + this.groupSubRowCount(wr.row) + ")")}</span>
4469
4605
  </span>` : this.isEditing(wr.vi.index, this.colIndexOf(wr.row, cell)) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4470
- ${this.hasEditorSlot(cell.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4471
- ${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({
4472
4651
  columnId: cell.column.id,
4473
4652
  column: cell.column,
4474
4653
  row: this.cellSlotRow(wr.row),
@@ -4490,35 +4669,41 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4490
4669
  } catch {
4491
4670
  return "{}";
4492
4671
  }
4493
- })()}></slot>`}
4494
- </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) => {
4495
- this.onCellEditorInput(cell.column.id, $event);
4496
- }} @keydown=${($event) => {
4497
- this.onEditorKeyDown($event);
4498
- }} @blur=${($event) => {
4499
- this.onEditorBlur($event);
4500
- }} 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) => {
4501
4674
  this.onCellEditorInput(cell.column.id, $event);
4502
4675
  }} @keydown=${($event) => {
4503
4676
  this.onEditorKeyDown($event);
4504
4677
  }} @blur=${($event) => {
4505
4678
  this.onEditorBlur($event);
4506
- }} data-rozie-s-d5dcab4c>
4507
- ${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>`)}
4508
- </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) => {
4509
- this.onCellEditorCheckbox(cell.column.id, $event);
4510
- }} @keydown=${($event) => {
4511
- this.onEditorKeyDown($event);
4512
- }} @blur=${($event) => {
4513
- this.onEditorBlur($event);
4514
- }} 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) => {
4515
4683
  this.onCellEditorInput(cell.column.id, $event);
4516
4684
  }} @keydown=${($event) => {
4517
4685
  this.onEditorKeyDown($event);
4518
4686
  }} @blur=${($event) => {
4519
4687
  this.onEditorBlur($event);
4520
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>
4521
- ${this.cell !== void 0 ? this.cell({
4689
+ ${this.rozieSlots?.[`cell-${cell.column.id}`] !== void 0 ? this.rozieSlots?.[`cell-${cell.column.id}`]({
4690
+ columnId: cell.column.id,
4691
+ column: cell.column,
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({
4522
4707
  columnId: cell.column.id,
4523
4708
  column: cell.column,
4524
4709
  row: this.cellSlotRow(wr.row),
@@ -4535,6 +4720,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4535
4720
  return "{}";
4536
4721
  }
4537
4722
  })()}>${rozieDisplay(cell.getValue())}</slot>`}
4723
+ </slot>`}
4538
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) => {
4539
4725
  this.onFillHandlePointerDown($event);
4540
4726
  }} data-rozie-s-d5dcab4c></span>` : nothing}</td>`)}
@@ -4582,7 +4768,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4582
4768
  "rdt-expander-th": this.isExpanderColumn(header.column.id),
4583
4769
  "rdt-th-resizing": this.columnIsResizing(header.column.id),
4584
4770
  "rdt-cell-active": this.isActiveCell("__header", this.headerColIndexOf(hg, header), hgLevel)
4585
- }).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>
4586
4772
 
4587
4773
 
4588
4774
  ${this.isSelectColumn(header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
@@ -4611,7 +4797,22 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4611
4797
  }} data-rozie-s-d5dcab4c>
4612
4798
 
4613
4799
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4614
- ${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({
4615
4816
  columnId: header.column.id,
4616
4817
  column: header.column,
4617
4818
  label: this.headerLabel(header.column.id)
@@ -4626,11 +4827,27 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4626
4827
  return "{}";
4627
4828
  }
4628
4829
  })()}>${rozieDisplay(this.headerLabel(header.column.id))}</slot>`}
4830
+ </slot>`}
4629
4831
  </span>
4630
4832
  <span class="rdt-sort-ind" aria-hidden="true" data-rozie-s-d5dcab4c>${rozieDisplay(this.sortIndicator(header.column.id))}</span>
4631
4833
  </button>` : html`<span style="display:contents" data-rozie-s-d5dcab4c>
4632
4834
  <span class="rdt-header-label" data-rozie-s-d5dcab4c>
4633
- ${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({
4634
4851
  columnId: header.column.id,
4635
4852
  column: header.column,
4636
4853
  label: this.headerLabel(header.column.id)
@@ -4645,6 +4862,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4645
4862
  return "{}";
4646
4863
  }
4647
4864
  })()}>${rozieDisplay(this.headerLabel(header.column.id))}</slot>`}
4865
+ </slot>`}
4648
4866
  </span>
4649
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>
4650
4868
  <button class="rdt-col-menu-item" type="button" role="menuitem" aria-pressed=${this.columnPinSide(header.column.id) === "left"} @click=${($event) => {
@@ -4673,12 +4891,26 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4673
4891
  ${this.hasAnyFilterableColumn() ? html`<tr class="rdt-filter-row" data-rozie-s-d5dcab4c>
4674
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>
4675
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>
4676
- ${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) => {
4677
- this.onColumnFilterInput(header.column.id, $event);
4678
- }} @click=${($event) => {
4679
- this.stopEvent($event);
4680
- }} data-rozie-s-d5dcab4c />` : nothing}${this.columnIsFilterable(header.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4681
- ${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({
4682
4914
  columnId: header.column.id,
4683
4915
  value: this.columnFilterValue(header.column.id),
4684
4916
  uniqueValues: this.getFacetedUniqueValues(header.column.id),
@@ -4695,7 +4927,14 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4695
4927
  } catch {
4696
4928
  return "{}";
4697
4929
  }
4698
- })()} @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>`}
4699
4938
  </span>` : nothing}</span>`}</th>`)}
4700
4939
  </tr>` : nothing}</thead>
4701
4940
 
@@ -4741,7 +4980,24 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4741
4980
  this.onToggleExpand(row, $event);
4742
4981
  }} data-rozie-s-d5dcab4c>${rozieDisplay(this.rowIsExpanded(row) ? "▾" : "▸")}</button>
4743
4982
  <span class="rdt-group-value" data-rozie-s-d5dcab4c>
4744
- ${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({
4745
5001
  columnId: cell.column.id,
4746
5002
  column: cell.column,
4747
5003
  row: this.cellSlotRow(row),
@@ -4758,11 +5014,55 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4758
5014
  return "{}";
4759
5015
  }
4760
5016
  })()}>${rozieDisplay(cell.getValue())}</slot>`}
5017
+ </slot>`}
4761
5018
  </span>
4762
5019
  <span class="rdt-group-count" data-rozie-s-d5dcab4c>${rozieDisplay("(" + this.groupSubRowCount(row) + ")")}</span>
4763
5020
  </span>` : this.isEditing(this.rowIndexOf(row), this.colIndexOf(row, cell)) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4764
- ${this.hasEditorSlot(cell.column.id) ? html`<span style="display:contents" data-rozie-s-d5dcab4c>
4765
- ${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}`]({
5043
+ columnId: cell.column.id,
5044
+ column: cell.column,
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({
4766
5066
  columnId: cell.column.id,
4767
5067
  column: cell.column,
4768
5068
  row: this.cellSlotRow(row),
@@ -4784,35 +5084,41 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4784
5084
  } catch {
4785
5085
  return "{}";
4786
5086
  }
4787
- })()}></slot>`}
4788
- </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) => {
5087
+ })()}>
5088
+ <input class="rdt-cell-editor" type="text" data-editing-cell="" data-builtin-editor="" .value=${this.editorValueFor(cell.column.id)} @input=${($event) => {
4789
5089
  this.onCellEditorInput(cell.column.id, $event);
4790
5090
  }} @keydown=${($event) => {
4791
5091
  this.onEditorKeyDown($event);
4792
5092
  }} @blur=${($event) => {
4793
5093
  this.onEditorBlur($event);
4794
- }} 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) => {
4795
- this.onCellEditorInput(cell.column.id, $event);
4796
- }} @keydown=${($event) => {
4797
- this.onEditorKeyDown($event);
4798
- }} @blur=${($event) => {
4799
- this.onEditorBlur($event);
4800
- }} data-rozie-s-d5dcab4c>
4801
- ${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>`)}
4802
- </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) => {
4803
- this.onCellEditorCheckbox(cell.column.id, $event);
4804
- }} @keydown=${($event) => {
4805
- this.onEditorKeyDown($event);
4806
- }} @blur=${($event) => {
4807
- this.onEditorBlur($event);
4808
- }} 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) => {
4809
5098
  this.onCellEditorInput(cell.column.id, $event);
4810
5099
  }} @keydown=${($event) => {
4811
5100
  this.onEditorKeyDown($event);
4812
5101
  }} @blur=${($event) => {
4813
5102
  this.onEditorBlur($event);
4814
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>
4815
- ${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({
4816
5122
  columnId: cell.column.id,
4817
5123
  column: cell.column,
4818
5124
  row: this.cellSlotRow(row),
@@ -4829,6 +5135,7 @@ ${this.groupable ? html`<div class="rdt-group-bar-host" data-rozie-s-d5dcab4c>
4829
5135
  return "{}";
4830
5136
  }
4831
5137
  })()}>${rozieDisplay(cell.getValue())}</slot>`}
5138
+ </slot>`}
4832
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) => {
4833
5140
  this.onFillHandlePointerDown($event);
4834
5141
  }} data-rozie-s-d5dcab4c></span>` : nothing}</td>`)}
@@ -5062,6 +5369,26 @@ __decorate([queryAssignedElements({
5062
5369
  flatten: true
5063
5370
  })], DataTable.prototype, "_slotSelectAllElements", void 0);
5064
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);
5065
5392
  __decorate([state()], DataTable.prototype, "_hasSlotColHeader", void 0);
5066
5393
  __decorate([queryAssignedElements({
5067
5394
  slot: "colHeader",
@@ -5074,12 +5401,6 @@ __decorate([queryAssignedElements({
5074
5401
  flatten: true
5075
5402
  })], DataTable.prototype, "_slotFilterElements", void 0);
5076
5403
  __decorate([property({ attribute: false })], DataTable.prototype, "filter", void 0);
5077
- __decorate([state()], DataTable.prototype, "_hasSlotSelectCell", void 0);
5078
- __decorate([queryAssignedElements({
5079
- slot: "selectCell",
5080
- flatten: true
5081
- })], DataTable.prototype, "_slotSelectCellElements", void 0);
5082
- __decorate([property({ attribute: false })], DataTable.prototype, "selectCell", void 0);
5083
5404
  __decorate([state()], DataTable.prototype, "_hasSlotCell", void 0);
5084
5405
  __decorate([queryAssignedElements({
5085
5406
  slot: "cell",
@@ -5092,12 +5413,6 @@ __decorate([queryAssignedElements({
5092
5413
  flatten: true
5093
5414
  })], DataTable.prototype, "_slotEditorElements", void 0);
5094
5415
  __decorate([property({ attribute: false })], DataTable.prototype, "editor", void 0);
5095
- __decorate([state()], DataTable.prototype, "_hasSlotDetail", void 0);
5096
- __decorate([queryAssignedElements({
5097
- slot: "detail",
5098
- flatten: true
5099
- })], DataTable.prototype, "_slotDetailElements", void 0);
5100
- __decorate([property({ attribute: false })], DataTable.prototype, "detail", void 0);
5101
5416
  __decorate([property({ attribute: false })], DataTable.prototype, "rozieSlots", void 0);
5102
5417
  DataTable = __decorate([customElement("rozie-data-table")], DataTable);
5103
5418
  var DataTable_default = DataTable;