@toolbox-web/grid 1.1.2 → 1.3.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.
Files changed (84) hide show
  1. package/README.md +80 -22
  2. package/all.d.ts +1 -0
  3. package/all.d.ts.map +1 -1
  4. package/all.js +557 -365
  5. package/all.js.map +1 -1
  6. package/index.d.ts +1 -1
  7. package/index.d.ts.map +1 -1
  8. package/index.js +903 -769
  9. package/index.js.map +1 -1
  10. package/lib/core/grid.d.ts +102 -3
  11. package/lib/core/grid.d.ts.map +1 -1
  12. package/lib/core/internal/row-animation.d.ts +37 -0
  13. package/lib/core/internal/row-animation.d.ts.map +1 -0
  14. package/lib/core/internal/rows.d.ts.map +1 -1
  15. package/lib/core/internal/shell.d.ts.map +1 -1
  16. package/lib/core/plugin/base-plugin.d.ts +65 -3
  17. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  18. package/lib/core/plugin/index.d.ts +1 -1
  19. package/lib/core/plugin/index.d.ts.map +1 -1
  20. package/lib/core/plugin/plugin-manager.d.ts +25 -1
  21. package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
  22. package/lib/core/plugin/types.d.ts +62 -0
  23. package/lib/core/plugin/types.d.ts.map +1 -1
  24. package/lib/core/types.d.ts +64 -1
  25. package/lib/core/types.d.ts.map +1 -1
  26. package/lib/plugins/clipboard/index.js +73 -69
  27. package/lib/plugins/clipboard/index.js.map +1 -1
  28. package/lib/plugins/clipboard/types.d.ts +1 -0
  29. package/lib/plugins/clipboard/types.d.ts.map +1 -1
  30. package/lib/plugins/column-virtualization/index.js.map +1 -1
  31. package/lib/plugins/context-menu/index.js.map +1 -1
  32. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  33. package/lib/plugins/editing/index.js +69 -40
  34. package/lib/plugins/editing/index.js.map +1 -1
  35. package/lib/plugins/export/index.js.map +1 -1
  36. package/lib/plugins/filtering/index.js.map +1 -1
  37. package/lib/plugins/grouping-columns/index.js.map +1 -1
  38. package/lib/plugins/grouping-rows/index.js.map +1 -1
  39. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts.map +1 -1
  40. package/lib/plugins/master-detail/index.js +14 -12
  41. package/lib/plugins/master-detail/index.js.map +1 -1
  42. package/lib/plugins/multi-sort/index.js.map +1 -1
  43. package/lib/plugins/pinned-columns/index.js.map +1 -1
  44. package/lib/plugins/pinned-rows/index.js.map +1 -1
  45. package/lib/plugins/pivot/index.js.map +1 -1
  46. package/lib/plugins/reorder/index.js.map +1 -1
  47. package/lib/plugins/responsive/index.js.map +1 -1
  48. package/lib/plugins/row-reorder/RowReorderPlugin.d.ts +155 -0
  49. package/lib/plugins/row-reorder/RowReorderPlugin.d.ts.map +1 -0
  50. package/lib/plugins/row-reorder/index.d.ts +9 -0
  51. package/lib/plugins/row-reorder/index.d.ts.map +1 -0
  52. package/lib/plugins/row-reorder/index.js +597 -0
  53. package/lib/plugins/row-reorder/index.js.map +1 -0
  54. package/lib/plugins/row-reorder/types.d.ts +80 -0
  55. package/lib/plugins/row-reorder/types.d.ts.map +1 -0
  56. package/lib/plugins/selection/SelectionPlugin.d.ts +13 -0
  57. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  58. package/lib/plugins/selection/index.d.ts +1 -1
  59. package/lib/plugins/selection/index.d.ts.map +1 -1
  60. package/lib/plugins/selection/index.js +95 -64
  61. package/lib/plugins/selection/index.js.map +1 -1
  62. package/lib/plugins/selection/types.d.ts +50 -6
  63. package/lib/plugins/selection/types.d.ts.map +1 -1
  64. package/lib/plugins/server-side/index.js.map +1 -1
  65. package/lib/plugins/tree/index.js.map +1 -1
  66. package/lib/plugins/undo-redo/index.js.map +1 -1
  67. package/lib/plugins/visibility/index.js.map +1 -1
  68. package/package.json +21 -4
  69. package/public.d.ts +15 -2
  70. package/public.d.ts.map +1 -1
  71. package/umd/grid.all.umd.js +23 -23
  72. package/umd/grid.all.umd.js.map +1 -1
  73. package/umd/grid.umd.js +15 -15
  74. package/umd/grid.umd.js.map +1 -1
  75. package/umd/plugins/clipboard.umd.js +5 -5
  76. package/umd/plugins/clipboard.umd.js.map +1 -1
  77. package/umd/plugins/editing.umd.js +1 -1
  78. package/umd/plugins/editing.umd.js.map +1 -1
  79. package/umd/plugins/master-detail.umd.js +1 -1
  80. package/umd/plugins/master-detail.umd.js.map +1 -1
  81. package/umd/plugins/row-reorder.umd.js +2 -0
  82. package/umd/plugins/row-reorder.umd.js.map +1 -0
  83. package/umd/plugins/selection.umd.js +2 -2
  84. package/umd/plugins/selection.umd.js.map +1 -1
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
- const ae = '@layer tbw-base,tbw-plugins,tbw-theme;@layer tbw-base{:root{color-scheme:light dark}tbw-grid{--tbw-base-icon-size: 1em;--tbw-base-radius: .25em;--tbw-font-size: 1em;--tbw-font-size-sm: .9285em;--tbw-font-size-xs: .7857em;--tbw-font-size-2xs: .7142em;--tbw-spacing-xs: .25em;--tbw-spacing-sm: .375em;--tbw-spacing-md: .5em;--tbw-spacing-lg: .75em;--tbw-spacing-xl: 1em;--tbw-icon-size: var(--tbw-base-icon-size);--tbw-icon-size-sm: .875em;--tbw-checkbox-size: var(--tbw-base-icon-size);--tbw-toggle-size: 1.25em;--tbw-border-radius: var(--tbw-base-radius);--tbw-color-bg: transparent;--tbw-color-panel-bg: light-dark(#eeeeee, #222222);--tbw-color-fg: light-dark(#222222, #eeeeee);--tbw-color-fg-muted: light-dark(#555555, #aaaaaa);--tbw-color-accent: light-dark(#3b82f6, #3b82f6);--tbw-color-accent-fg: light-dark(#ffffff, #000000);--tbw-color-success: light-dark(hsl(122, 39%, 40%), hsl(122, 39%, 49%));--tbw-color-error: light-dark(hsl(0, 65%, 51%), hsl(0, 65%, 55%));--tbw-color-selection: light-dark(#fff7d6, #333333);--tbw-color-row-alt: var(--tbw-color-bg);--tbw-color-row-hover: light-dark(#f0f6ff, #1c1c1c);--tbw-color-header-bg: color-mix(in hsl, var(--tbw-color-panel-bg) 85%, var(--tbw-color-fg));--tbw-color-header-fg: color-mix(in hsl, var(--tbw-color-fg) 75%, var(--tbw-color-panel-bg));--tbw-color-border: light-dark(#d0d0d4, #454545);--tbw-color-border-strong: light-dark(#777777, #666666);--tbw-color-border-cell: var(--tbw-color-border);--tbw-color-border-header: var(--tbw-color-border);--tbw-color-shadow: light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3));--tbw-font-family: inherit;--tbw-font-size-header: var(--tbw-font-size);--tbw-font-weight-header: bold;--tbw-cell-padding-header: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding-input: var(--tbw-spacing-xs) var(--tbw-spacing-sm);--tbw-row-height: 1.75em;--tbw-header-height: 1.875em;--tbw-cell-white-space: nowrap;--tbw-border-input: 1px solid var(--tbw-color-border-strong);--tbw-border-header: 1px solid var(--tbw-color-border-header);--tbw-row-divider: 1px solid var(--tbw-color-border-cell);--tbw-row-hover-outline: 0;--tbw-color-active-row-bg: var(--tbw-color-selection);--tbw-active-row-outline: 0;--tbw-focus-outline: 2px solid var(--tbw-color-accent);--tbw-focus-outline-offset: -2px;--tbw-focus-background: rgba(from var(--tbw-color-accent) r g b / 12%);--tbw-range-border-color: var(--tbw-color-accent);--tbw-range-selection-bg: rgba(from var(--tbw-range-border-color) r g b / 12%);--tbw-resize-handle-width: var(--tbw-spacing-sm);--tbw-resize-handle-color: transparent;--tbw-resize-handle-color-hover: var(--tbw-color-accent);--tbw-resize-handle-border-radius: 0;--tbw-resize-indicator-width: 2px;--tbw-resize-indicator-color: var(--tbw-color-accent);--tbw-resize-indicator-opacity: .6;--tbw-scrollbar-thumb: var(--tbw-color-border-strong);--tbw-scrollbar-track: var(--tbw-color-bg);--tbw-transition-duration: .12s;--tbw-transition-ease: ease;--tbw-animation-duration: .2s;--tbw-animation-easing: ease-out;--tbw-animation-enabled: 1;--tbw-sort-indicator-color: var(--tbw-color-fg-muted);--tbw-sort-indicator-active-color: var(--tbw-color-accent);--tbw-header-text-transform: none;--tbw-header-letter-spacing: normal;--tbw-color-header-separator: var(--tbw-color-border-cell);--tbw-density-scale: 1;--tbw-shell-header-height: 2.75em;--tbw-shell-header-bg: var(--tbw-color-panel-bg);--tbw-shell-header-border: var(--tbw-color-border);--tbw-shell-title-font-size: var(--tbw-font-size);--tbw-shell-title-font-weight: 600;--tbw-tool-panel-width: 17.5em;--tbw-tool-panel-bg: var(--tbw-color-panel-bg);--tbw-tool-panel-border: var(--tbw-color-border);--tbw-tool-panel-header-height: 2.5em;--tbw-tool-panel-transition: var(--tbw-animation-duration) var(--tbw-animation-easing);--tbw-toolbar-button-size: 2em;--tbw-toolbar-button-gap: var(--tbw-spacing-xs);--tbw-panel-padding: var(--tbw-spacing-lg);--tbw-panel-gap: var(--tbw-spacing-md);--tbw-menu-item-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-menu-item-gap: var(--tbw-spacing-md);--tbw-menu-min-width: 10rem;--tbw-button-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-button-padding-sm: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-input-height: var(--tbw-row-height);--tbw-input-padding: 0 var(--tbw-spacing-md);--tbw-detail-padding: var(--tbw-spacing-xl);--tbw-detail-max-height: 31.25rem;--tbw-indicator-size: var(--tbw-spacing-sm);position:relative;display:block;width:100%;height:100%;min-height:0;contain:content;font-family:var(--tbw-font-family);font-size:var(--tbw-font-size);background:var(--tbw-color-bg);color:var(--tbw-color-fg);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);overflow:clip;outline:none;&,*{box-sizing:border-box}.header{display:block;flex-shrink:0;z-index:var(--tbw-z-layer-header, 30);background:var(--tbw-color-header-bg);overflow:visible}.header-group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-color-header-bg);z-index:var(--tbw-z-layer-header, 30)}.header-group-cell{display:flex;align-items:center;justify-content:flex-start;padding:var(--tbw-cell-padding-header, 2px 8px);color:var(--tbw-color-header-group-fg, var(--tbw-color-header-fg));font-weight:var(--tbw-font-weight-header-group, var(--tbw-font-weight-header));justify-content:var(--tbw-align-header-group, var(--tbw-align-header, flex-start));&:not(:last-child){border-right:2px solid var(--tbw-color-border)}}.header-row{display:grid;grid-template-columns:var(--tbw-column-template);color:var(--tbw-color-header-fg);font-size:var(--tbw-font-size-header);min-height:var(--tbw-header-height);border-bottom:var(--tbw-border-header);z-index:var(--tbw-z-layer-header, 30);>.cell{display:flex;align-items:center;gap:4px;padding:var(--tbw-cell-padding-header, 2px 8px);background-color:var(--tbw-color-header-bg);font-weight:var(--tbw-font-weight-header);border-right:1px solid var(--tbw-color-border-cell);overflow:visible;min-width:0;>span:first-child{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}>span[part~=sort-indicator]{flex-shrink:0;opacity:.6}&:last-child{border-right:0}&.grouped.group-end:not(:last-child){border-right:2px solid var(--tbw-color-border)}&.resizable{position:relative}&.sticky-left,&.sticky-right{background:var(--tbw-color-header-bg);z-index:35}}}.tbw-grid-root{display:flex;flex-direction:column;height:100%;&.has-shell{display:flex;flex-direction:column;height:100%}}.rows-body-wrapper{flex:1;min-height:0;display:flex;flex-direction:row;width:100%;min-width:fit-content}.rows-body{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:visible}.rows-container{display:flex;flex-direction:row;flex:1;min-height:0;overflow:visible}.rows-viewport{flex:1;min-width:0;position:relative;display:block;overflow:clip;.rows{position:absolute;top:0;left:0;min-width:100%;will-change:transform;z-index:var(--tbw-z-layer-rows, 1)}}.faux-vscroll{position:sticky;inset-inline-end:0;flex-shrink:0;width:auto;overflow-y:auto;overflow-x:hidden;z-index:var(--tbw-z-layer-header, 30)}.faux-vscroll-spacer{width:1px}.data-grid-row{display:grid;grid-template-columns:var(--tbw-column-template);contain:layout style;content-visibility:auto;contain-intrinsic-size:auto var(--tbw-row-height);&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}>.cell{display:block;padding:var(--tbw-cell-padding, 2px 8px);border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height);line-height:calc(var(--tbw-row-height) - 5px);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0;white-space:var(--tbw-cell-white-space, nowrap);text-overflow:ellipsis;>*{overflow:hidden;text-overflow:ellipsis;white-space:inherit;min-width:0}&:last-child{border-right:0}&[data-type=boolean]{text-align:center;input[type=checkbox]{margin:0;width:var(--tbw-checkbox-size);height:var(--tbw-checkbox-size);vertical-align:middle}}&.selected:focus-visible,&:focus-visible:not(.cell-focus){outline:none}&.sticky-left,&.sticky-right{background:var(--tbw-color-panel-bg)}}}.selecting .data-grid-row>.cell{user-select:none}.sortable{cursor:pointer;user-select:none}.resize-handle{position:absolute;top:0;right:calc(var(--tbw-resize-handle-width) / -2);width:var(--tbw-resize-handle-width);height:100%;cursor:e-resize;user-select:none;touch-action:none;z-index:20;background:var(--tbw-resize-handle-color);transition:background .12s ease;border-radius:var(--tbw-resize-handle-border-radius);&:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:var(--tbw-resize-indicator-width, 2px);height:0;background:var(--tbw-resize-indicator-color, var(--tbw-color-accent));opacity:0;pointer-events:none;transition:opacity .12s ease,height 0s .12s;z-index:1000}&:hover{background:var(--tbw-resize-handle-color-hover);&:after{height:100vh;opacity:var(--tbw-resize-indicator-opacity, .6);transition:opacity .12s ease,height 0s}}}&[data-has-focus]{.cell-focus,.row-focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}}.sticky-left,.sticky-right{position:sticky;z-index:25}.sticky-left{box-shadow:1px 0 0 var(--tbw-color-border)}.sticky-right{box-shadow:-1px 0 0 var(--tbw-color-border)}.tbw-shell-header{display:flex;align-items:center;gap:8px;min-height:var(--tbw-shell-header-height);padding:0 8px;background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0}.tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-shell-content{flex:1;display:flex;align-items:center;gap:12px;min-width:0;overflow:hidden}.tbw-shell-toolbar{display:flex;align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0}.tbw-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);padding:0;border:1px solid transparent;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg);cursor:pointer;font-size:16px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease),border-color var(--tbw-transition-duration) var(--tbw-transition-ease);&:hover{background:var(--tbw-color-row-hover)}&:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}&.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}&:disabled{opacity:.5;cursor:not-allowed}}.tbw-toolbar-separator{width:1px;height:20px;background:var(--tbw-color-border);margin:0 4px}.tbw-shell-body{position:relative;display:flex;flex:1;min-height:0;overflow:visible}.tbw-grid-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:row;overflow:hidden}.tbw-scroll-area{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow-x:auto;overflow-y:hidden;overflow-anchor:none}.tbw-tool-panel{position:absolute;top:0;bottom:0;right:0;width:0;overflow:hidden;background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);transition:width var(--tbw-tool-panel-transition);display:flex;flex-direction:column;z-index:30;box-shadow:-2px 0 8px var(--tbw-color-shadow);&[data-position=left]{right:auto;left:0;border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow)}&.open{width:var(--tbw-tool-panel-width)}}.tbw-tool-panel-resize{position:absolute;top:0;bottom:0;width:6px;cursor:col-resize;background:transparent;z-index:10;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);&[data-handle-position=left]{left:0}&[data-handle-position=right]{right:0}&:hover,&.resizing{background:var(--tbw-color-accent)}}.tbw-tool-panel-header{display:flex;align-items:center;justify-content:space-between;min-height:var(--tbw-tool-panel-header-height);padding:0 12px;border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0}.tbw-tool-panel-title{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-tool-panel-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg-muted);cursor:pointer;font-size:14px;&:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}}.tbw-tool-panel-content{flex:1;overflow:auto}.tbw-accordion{display:flex;flex-direction:column;gap:0}.tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border);&:last-child{border-bottom:none}&.single .tbw-accordion-header{cursor:default;&:hover{background:transparent}}&.expanded{.tbw-accordion-chevron{transform:rotate(90deg)}.tbw-accordion-content{display:block}}}.tbw-accordion-header{display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--tbw-color-fg);font-size:13px;font-weight:600;text-align:left;cursor:pointer;user-select:none;&:hover{background:var(--tbw-color-row-hover)}}.tbw-accordion-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:10px;color:var(--tbw-color-fg-muted);transition:transform .15s ease;flex-shrink:0}.tbw-accordion-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:14px;flex-shrink:0}.tbw-accordion-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tbw-accordion-content{display:none}.tbw-expanding{animation:tbw-expand var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}.tbw-collapsing{animation:tbw-collapse var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}&[data-animation-mode=off]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms}}@media(forced-colors:active){tbw-grid{--tbw-color-border: CanvasText;--tbw-color-border-strong: CanvasText;--tbw-color-border-cell: CanvasText;--tbw-color-border-header: CanvasText;--tbw-color-fg: CanvasText;--tbw-color-bg: Canvas;--tbw-color-panel-bg: Canvas;--tbw-color-header-bg: Canvas;--tbw-color-header-fg: CanvasText;--tbw-color-accent: Highlight;--tbw-color-accent-fg: HighlightText;--tbw-color-selection: Highlight;--tbw-color-row-hover: Highlight;--tbw-focus-outline: 2px solid Highlight;--tbw-range-border-color: Highlight;.cell:focus,.cell.active-cell{outline:2px solid Highlight!important;outline-offset:-2px}.data-grid-row[aria-selected=true]{background:Highlight!important;color:HighlightText!important}}}@media(prefers-reduced-motion:reduce){tbw-grid[data-animation-mode=reduced-motion]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms}}@keyframes tbw-expand{0%{opacity:0;max-height:0;transform:translateY(-8px)}to{opacity:1;max-height:500px;transform:translateY(0)}}@keyframes tbw-collapse{0%{opacity:1;max-height:500px;transform:translateY(0)}to{opacity:0;max-height:0;transform:translateY(-8px)}}}', V = {
1
+ const he = '@layer tbw-base,tbw-plugins,tbw-theme;@layer tbw-base{:root{color-scheme:light dark}tbw-grid{--tbw-base-icon-size: 1em;--tbw-base-radius: .25em;--tbw-font-size: 1em;--tbw-font-size-sm: .9285em;--tbw-font-size-xs: .7857em;--tbw-font-size-2xs: .7142em;--tbw-spacing-xs: .25em;--tbw-spacing-sm: .375em;--tbw-spacing-md: .5em;--tbw-spacing-lg: .75em;--tbw-spacing-xl: 1em;--tbw-icon-size: var(--tbw-base-icon-size);--tbw-icon-size-sm: .875em;--tbw-checkbox-size: var(--tbw-base-icon-size);--tbw-toggle-size: 1.25em;--tbw-border-radius: var(--tbw-base-radius);--tbw-color-bg: transparent;--tbw-color-panel-bg: light-dark(#eeeeee, #222222);--tbw-color-fg: light-dark(#222222, #eeeeee);--tbw-color-fg-muted: light-dark(#555555, #aaaaaa);--tbw-color-accent: light-dark(#3b82f6, #3b82f6);--tbw-color-accent-fg: light-dark(#ffffff, #000000);--tbw-color-success: light-dark(hsl(122, 39%, 40%), hsl(122, 39%, 49%));--tbw-color-error: light-dark(hsl(0, 65%, 51%), hsl(0, 65%, 55%));--tbw-color-selection: light-dark(#fff7d6, #333333);--tbw-color-row-alt: var(--tbw-color-bg);--tbw-color-row-hover: light-dark(#f0f6ff, #1c1c1c);--tbw-color-header-bg: color-mix(in hsl, var(--tbw-color-panel-bg) 85%, var(--tbw-color-fg));--tbw-color-header-fg: color-mix(in hsl, var(--tbw-color-fg) 75%, var(--tbw-color-panel-bg));--tbw-color-border: light-dark(#d0d0d4, #454545);--tbw-color-border-strong: light-dark(#777777, #666666);--tbw-color-border-cell: var(--tbw-color-border);--tbw-color-border-header: var(--tbw-color-border);--tbw-color-shadow: light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3));--tbw-font-family: inherit;--tbw-font-size-header: var(--tbw-font-size);--tbw-font-weight-header: bold;--tbw-cell-padding-header: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding-input: var(--tbw-spacing-xs) var(--tbw-spacing-sm);--tbw-row-height: 1.75em;--tbw-header-height: 1.875em;--tbw-cell-white-space: nowrap;--tbw-border-input: 1px solid var(--tbw-color-border-strong);--tbw-border-header: 1px solid var(--tbw-color-border-header);--tbw-row-divider: 1px solid var(--tbw-color-border-cell);--tbw-row-hover-outline: 0;--tbw-color-active-row-bg: var(--tbw-color-selection);--tbw-active-row-outline: 0;--tbw-focus-outline: 2px solid var(--tbw-color-accent);--tbw-focus-outline-offset: -2px;--tbw-focus-background: rgba(from var(--tbw-color-accent) r g b / 12%);--tbw-range-border-color: var(--tbw-color-accent);--tbw-range-selection-bg: rgba(from var(--tbw-range-border-color) r g b / 12%);--tbw-resize-handle-width: var(--tbw-spacing-sm);--tbw-resize-handle-color: transparent;--tbw-resize-handle-color-hover: var(--tbw-color-accent);--tbw-resize-handle-border-radius: 0;--tbw-resize-indicator-width: 2px;--tbw-resize-indicator-color: var(--tbw-color-accent);--tbw-resize-indicator-opacity: .6;--tbw-scrollbar-thumb: var(--tbw-color-border-strong);--tbw-scrollbar-track: var(--tbw-color-bg);--tbw-transition-duration: .12s;--tbw-transition-ease: ease;--tbw-animation-duration: .2s;--tbw-animation-easing: ease-out;--tbw-animation-enabled: 1;--tbw-row-change-duration: .5s;--tbw-row-insert-duration: .3s;--tbw-row-remove-duration: .2s;--tbw-row-change-color: rgba(from var(--tbw-color-accent) r g b / 25%);--tbw-sort-indicator-color: var(--tbw-color-fg-muted);--tbw-sort-indicator-active-color: var(--tbw-color-accent);--tbw-header-text-transform: none;--tbw-header-letter-spacing: normal;--tbw-color-header-separator: var(--tbw-color-border-cell);--tbw-density-scale: 1;--tbw-shell-header-height: 2.75em;--tbw-shell-header-bg: var(--tbw-color-panel-bg);--tbw-shell-header-border: var(--tbw-color-border);--tbw-shell-title-font-size: var(--tbw-font-size);--tbw-shell-title-font-weight: 600;--tbw-tool-panel-width: 17.5em;--tbw-tool-panel-bg: var(--tbw-color-panel-bg);--tbw-tool-panel-border: var(--tbw-color-border);--tbw-tool-panel-header-height: 2.5em;--tbw-tool-panel-transition: var(--tbw-animation-duration) var(--tbw-animation-easing);--tbw-toolbar-button-size: 2em;--tbw-toolbar-button-gap: var(--tbw-spacing-xs);--tbw-panel-padding: var(--tbw-spacing-lg);--tbw-panel-gap: var(--tbw-spacing-md);--tbw-menu-item-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-menu-item-gap: var(--tbw-spacing-md);--tbw-menu-min-width: 10rem;--tbw-button-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-button-padding-sm: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-input-height: var(--tbw-row-height);--tbw-input-padding: 0 var(--tbw-spacing-md);--tbw-detail-padding: var(--tbw-spacing-xl);--tbw-detail-max-height: 31.25rem;--tbw-indicator-size: var(--tbw-spacing-sm);position:relative;display:block;width:100%;height:100%;min-height:0;contain:content;font-family:var(--tbw-font-family);font-size:var(--tbw-font-size);background:var(--tbw-color-bg);color:var(--tbw-color-fg);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);overflow:clip;outline:none;&,*{box-sizing:border-box}.header{display:block;flex-shrink:0;z-index:var(--tbw-z-layer-header, 30);background:var(--tbw-color-header-bg);overflow:visible}.header-group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-color-header-bg);z-index:var(--tbw-z-layer-header, 30)}.header-group-cell{display:flex;align-items:center;justify-content:flex-start;padding:var(--tbw-cell-padding-header, 2px 8px);color:var(--tbw-color-header-group-fg, var(--tbw-color-header-fg));font-weight:var(--tbw-font-weight-header-group, var(--tbw-font-weight-header));justify-content:var(--tbw-align-header-group, var(--tbw-align-header, flex-start));&:not(:last-child){border-right:2px solid var(--tbw-color-border)}}.header-row{display:grid;grid-template-columns:var(--tbw-column-template);color:var(--tbw-color-header-fg);font-size:var(--tbw-font-size-header);min-height:var(--tbw-header-height);border-bottom:var(--tbw-border-header);z-index:var(--tbw-z-layer-header, 30);>.cell{display:flex;align-items:center;gap:4px;padding:var(--tbw-cell-padding-header, 2px 8px);background-color:var(--tbw-color-header-bg);font-weight:var(--tbw-font-weight-header);border-right:1px solid var(--tbw-color-border-cell);overflow:visible;min-width:0;>span:first-child{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}>span[part~=sort-indicator]{flex-shrink:0;opacity:.6}&:last-child{border-right:0}&.grouped.group-end:not(:last-child){border-right:2px solid var(--tbw-color-border)}&.resizable{position:relative}&.sticky-left,&.sticky-right{background:var(--tbw-color-header-bg);z-index:35}}}.tbw-grid-root{display:flex;flex-direction:column;height:100%;&.has-shell{display:flex;flex-direction:column;height:100%}}.rows-body-wrapper{flex:1;min-height:0;display:flex;flex-direction:row;width:100%;min-width:fit-content}.rows-body{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:visible}.rows-container{display:flex;flex-direction:row;flex:1;min-height:0;overflow:visible}.rows-viewport{flex:1;min-width:0;position:relative;display:block;overflow:clip;.rows{position:absolute;top:0;left:0;min-width:100%;will-change:transform;z-index:var(--tbw-z-layer-rows, 1)}}.faux-vscroll{position:sticky;inset-inline-end:0;flex-shrink:0;width:auto;overflow-y:auto;overflow-x:hidden;z-index:var(--tbw-z-layer-header, 30)}.faux-vscroll-spacer{width:1px}.data-grid-row{display:grid;grid-template-columns:var(--tbw-column-template);contain:layout style;content-visibility:auto;contain-intrinsic-size:auto var(--tbw-row-height);&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}>.cell{display:block;padding:var(--tbw-cell-padding, 2px 8px);border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height);line-height:calc(var(--tbw-row-height) - 5px);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0;white-space:var(--tbw-cell-white-space, nowrap);text-overflow:ellipsis;>*{overflow:hidden;text-overflow:ellipsis;white-space:inherit;min-width:0}&:last-child{border-right:0}&[data-type=boolean]{text-align:center;input[type=checkbox]{margin:0;width:var(--tbw-checkbox-size);height:var(--tbw-checkbox-size);vertical-align:middle}}&.selected:focus-visible,&:focus-visible:not(.cell-focus){outline:none}&.sticky-left,&.sticky-right{background:var(--tbw-color-panel-bg)}}}.selecting .data-grid-row>.cell{user-select:none}.sortable{cursor:pointer;user-select:none}.resize-handle{position:absolute;top:0;right:calc(var(--tbw-resize-handle-width) / -2);width:var(--tbw-resize-handle-width);height:100%;cursor:e-resize;user-select:none;touch-action:none;z-index:20;background:var(--tbw-resize-handle-color);transition:background .12s ease;border-radius:var(--tbw-resize-handle-border-radius);&:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:var(--tbw-resize-indicator-width, 2px);height:0;background:var(--tbw-resize-indicator-color, var(--tbw-color-accent));opacity:0;pointer-events:none;transition:opacity .12s ease,height 0s .12s;z-index:1000}&:hover{background:var(--tbw-resize-handle-color-hover);&:after{height:100vh;opacity:var(--tbw-resize-indicator-opacity, .6);transition:opacity .12s ease,height 0s}}}&[data-has-focus]{.cell-focus,.row-focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}}.sticky-left,.sticky-right{position:sticky;z-index:25}.sticky-left{box-shadow:1px 0 0 var(--tbw-color-border)}.sticky-right{box-shadow:-1px 0 0 var(--tbw-color-border)}.tbw-shell-header{display:flex;align-items:center;gap:8px;min-height:var(--tbw-shell-header-height);padding:0 8px;background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0}.tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-shell-content{flex:1;display:flex;align-items:center;gap:12px;min-width:0;overflow:hidden}.tbw-shell-toolbar{display:flex;align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0}.tbw-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);padding:0;border:1px solid transparent;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg);cursor:pointer;font-size:16px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease),border-color var(--tbw-transition-duration) var(--tbw-transition-ease);&:hover{background:var(--tbw-color-row-hover)}&:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}&.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}&:disabled{opacity:.5;cursor:not-allowed}}.tbw-toolbar-separator{width:1px;height:20px;background:var(--tbw-color-border);margin:0 4px}.tbw-shell-body{position:relative;display:flex;flex:1;min-height:0;overflow:visible}.tbw-grid-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:row;overflow:hidden}.tbw-scroll-area{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow-x:auto;overflow-y:hidden;overflow-anchor:none}.tbw-tool-panel{position:absolute;top:0;bottom:0;right:0;width:0;overflow:hidden;background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);transition:width var(--tbw-tool-panel-transition);display:flex;flex-direction:column;z-index:30;box-shadow:-2px 0 8px var(--tbw-color-shadow);&[data-position=left]{right:auto;left:0;border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow)}&.open{width:var(--tbw-tool-panel-width)}}.tbw-tool-panel-resize{position:absolute;top:0;bottom:0;width:6px;cursor:col-resize;background:transparent;z-index:10;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);&[data-handle-position=left]{left:0}&[data-handle-position=right]{right:0}&:hover,&.resizing{background:var(--tbw-color-accent)}}.tbw-tool-panel-header{display:flex;align-items:center;justify-content:space-between;min-height:var(--tbw-tool-panel-header-height);padding:0 12px;border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0}.tbw-tool-panel-title{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-tool-panel-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg-muted);cursor:pointer;font-size:14px;&:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}}.tbw-tool-panel-content{flex:1;overflow:auto}.tbw-accordion{display:flex;flex-direction:column;gap:0}.tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border);&:last-child{border-bottom:none}&.single .tbw-accordion-header{cursor:default;&:hover{background:transparent}}&.expanded{.tbw-accordion-chevron{transform:rotate(90deg)}.tbw-accordion-content{display:block}}}.tbw-accordion-header{display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--tbw-color-fg);font-size:13px;font-weight:600;text-align:left;cursor:pointer;user-select:none;&:hover{background:var(--tbw-color-row-hover)}}.tbw-accordion-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:10px;color:var(--tbw-color-fg-muted);transition:transform .15s ease;flex-shrink:0}.tbw-accordion-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:14px;flex-shrink:0}.tbw-accordion-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tbw-accordion-content{display:none}.tbw-expanding{animation:tbw-expand var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}.tbw-collapsing{animation:tbw-collapse var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}&[data-animation-mode=off]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}@media(forced-colors:active){tbw-grid{--tbw-color-border: CanvasText;--tbw-color-border-strong: CanvasText;--tbw-color-border-cell: CanvasText;--tbw-color-border-header: CanvasText;--tbw-color-fg: CanvasText;--tbw-color-bg: Canvas;--tbw-color-panel-bg: Canvas;--tbw-color-header-bg: Canvas;--tbw-color-header-fg: CanvasText;--tbw-color-accent: Highlight;--tbw-color-accent-fg: HighlightText;--tbw-color-selection: Highlight;--tbw-color-row-hover: Highlight;--tbw-focus-outline: 2px solid Highlight;--tbw-range-border-color: Highlight;.cell:focus,.cell.active-cell{outline:2px solid Highlight!important;outline-offset:-2px}.data-grid-row[aria-selected=true]{background:Highlight!important;color:HighlightText!important}}}@media(prefers-reduced-motion:reduce){tbw-grid[data-animation-mode=reduced-motion]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}@keyframes tbw-expand{0%{opacity:0;max-height:0;transform:translateY(-8px)}to{opacity:1;max-height:500px;transform:translateY(0)}}@keyframes tbw-collapse{0%{opacity:1;max-height:500px;transform:translateY(0)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-row-change{0%{background-color:transparent}20%{background-color:var(--tbw-row-change-color)}to{background-color:transparent}}@keyframes tbw-row-insert{0%{opacity:0;max-height:0;overflow:hidden}to{opacity:1;max-height:var(--tbw-row-height, 28px);overflow:hidden}}@keyframes tbw-row-remove{0%{opacity:1;transform:translateY(0);max-height:var(--tbw-row-height, 28px)}to{opacity:0;max-height:0;transform:translateY(-8px)}}tbw-grid .data-grid-row[data-animating=change]{animation:tbw-row-change var(--tbw-row-change-duration) ease-out}tbw-grid .data-grid-row[data-animating=insert]{animation:tbw-row-insert var(--tbw-row-insert-duration) ease-out;will-change:max-height,opacity}tbw-grid .data-grid-row[data-animating=remove]{animation:tbw-row-remove var(--tbw-row-remove-duration) ease-out forwards;will-change:max-height,opacity,transform;pointer-events:none}}', B = {
2
2
  STRETCH: "stretch",
3
3
  FIXED: "fixed"
4
- }, Fe = {
4
+ }, Be = {
5
5
  mode: "reduced-motion",
6
6
  duration: 200,
7
7
  easing: "ease-out"
8
- }, M = {
8
+ }, z = {
9
9
  expand: "▶",
10
10
  collapse: "▼",
11
11
  sortAsc: "▲",
@@ -15,44 +15,44 @@ const ae = '@layer tbw-base,tbw-plugins,tbw-theme;@layer tbw-base{:root{color-sc
15
15
  dragHandle: "⋮⋮",
16
16
  toolPanel: "☰"
17
17
  };
18
- function Ue(t) {
18
+ function Ge(t) {
19
19
  return Array.from(t.querySelectorAll("tbw-grid-column")).map((o) => {
20
20
  const n = o.getAttribute("field") || "";
21
21
  if (!n) return null;
22
- const i = o.getAttribute("type") || void 0, s = i && (/* @__PURE__ */ new Set(["number", "string", "date", "boolean", "select"])).has(i) ? i : void 0, l = o.getAttribute("header") || void 0, c = o.hasAttribute("sortable"), a = o.hasAttribute("editable"), h = { field: n, type: s, header: l, sortable: c, editable: a }, d = o.getAttribute("width");
23
- if (d) {
24
- const _ = parseFloat(d);
25
- !isNaN(_) && /^\d+(\.\d+)?$/.test(d.trim()) ? h.width = _ : h.width = d;
22
+ const i = o.getAttribute("type") || void 0, s = i && (/* @__PURE__ */ new Set(["number", "string", "date", "boolean", "select"])).has(i) ? i : void 0, l = o.getAttribute("header") || void 0, c = o.hasAttribute("sortable"), a = o.hasAttribute("editable"), h = { field: n, type: s, header: l, sortable: c, editable: a }, u = o.getAttribute("width");
23
+ if (u) {
24
+ const _ = parseFloat(u);
25
+ !isNaN(_) && /^\d+(\.\d+)?$/.test(u.trim()) ? h.width = _ : h.width = u;
26
26
  }
27
- const f = o.getAttribute("minWidth") || o.getAttribute("min-width");
28
- if (f) {
29
- const _ = parseFloat(f);
27
+ const p = o.getAttribute("minWidth") || o.getAttribute("min-width");
28
+ if (p) {
29
+ const _ = parseFloat(p);
30
30
  isNaN(_) || (h.minWidth = _);
31
31
  }
32
32
  o.hasAttribute("resizable") && (h.resizable = !0), o.hasAttribute("sizable") && (h.resizable = !0);
33
- const p = o.getAttribute("editor"), u = o.getAttribute("renderer");
34
- p && (h.__editorName = p), u && (h.__rendererName = u);
35
- const g = o.getAttribute("options");
36
- g && (h.options = g.split(",").map((_) => {
37
- const [E, T] = _.includes(":") ? _.split(":") : [_.trim(), _.trim()];
38
- return { value: E.trim(), label: T?.trim() || E.trim() };
33
+ const f = o.getAttribute("editor"), g = o.getAttribute("renderer");
34
+ f && (h.__editorName = f), g && (h.__rendererName = g);
35
+ const d = o.getAttribute("options");
36
+ d && (h.options = d.split(",").map((_) => {
37
+ const [N, S] = _.includes(":") ? _.split(":") : [_.trim(), _.trim()];
38
+ return { value: N.trim(), label: S?.trim() || N.trim() };
39
39
  }));
40
- const m = o.querySelector("tbw-grid-column-view"), y = o.querySelector("tbw-grid-column-editor"), R = o.querySelector("tbw-grid-column-header");
41
- m && (h.__viewTemplate = m), y && (h.__editorTemplate = y), R && (h.__headerTemplate = R);
42
- const w = globalThis.DataGridElement?.getAdapters?.() ?? [], v = m ?? o, S = w.find((_) => _.canHandle(v));
43
- if (S) {
44
- const _ = S.createRenderer(v);
40
+ const w = o.querySelector("tbw-grid-column-view"), m = o.querySelector("tbw-grid-column-editor"), R = o.querySelector("tbw-grid-column-header");
41
+ w && (h.__viewTemplate = w), m && (h.__editorTemplate = m), R && (h.__headerTemplate = R);
42
+ const T = globalThis.DataGridElement?.getAdapters?.() ?? [], b = w ?? o, y = T.find((_) => _.canHandle(b));
43
+ if (y) {
44
+ const _ = y.createRenderer(b);
45
45
  _ && (h.viewRenderer = _);
46
46
  }
47
- const b = y ?? o, z = w.find((_) => _.canHandle(b));
48
- if (z) {
49
- const _ = z.createEditor(b);
47
+ const E = m ?? o, C = T.find((_) => _.canHandle(E));
48
+ if (C) {
49
+ const _ = C.createEditor(E);
50
50
  _ && (h.editor = _);
51
51
  }
52
52
  return h;
53
53
  }).filter((o) => !!o);
54
54
  }
55
- function ce(t, e) {
55
+ function ue(t, e) {
56
56
  if ((!t || !t.length) && (!e || !e.length)) return [];
57
57
  if (!t || !t.length) return e || [];
58
58
  if (!e || !e.length) return t;
@@ -76,7 +76,7 @@ function ce(t, e) {
76
76
  });
77
77
  return Object.keys(o).forEach((i) => n.push(o[i])), n;
78
78
  }
79
- function de(t, e) {
79
+ function fe(t, e) {
80
80
  try {
81
81
  t.part?.add?.(e);
82
82
  } catch {
@@ -84,9 +84,9 @@ function de(t, e) {
84
84
  const o = t.getAttribute("part");
85
85
  o ? o.split(/\s+/).includes(e) || t.setAttribute("part", o + " " + e) : t.setAttribute("part", e);
86
86
  }
87
- function he(t) {
88
- const e = t.effectiveConfig?.fitMode || t.fitMode || V.STRETCH;
89
- if (e !== V.STRETCH && e !== V.FIXED || t.__didInitialAutoSize || !t.isConnected) return;
87
+ function pe(t) {
88
+ const e = t.effectiveConfig?.fitMode || t.fitMode || B.STRETCH;
89
+ if (e !== B.STRETCH && e !== B.FIXED || t.__didInitialAutoSize || !t.isConnected) return;
90
90
  const o = Array.from(t._headerRowEl?.children || []);
91
91
  if (!o.length) return;
92
92
  let n = !1;
@@ -102,32 +102,32 @@ function he(t) {
102
102
  }
103
103
  }
104
104
  l > 0 && (i.width = l + 2, i.__autoSized = !0, n = !0);
105
- }), n && F(t), t.__didInitialAutoSize = !0;
105
+ }), n && U(t), t.__didInitialAutoSize = !0;
106
106
  }
107
- function F(t) {
108
- (t.effectiveConfig?.fitMode || t.fitMode || V.STRETCH) === V.STRETCH ? t._gridTemplate = t._visibleColumns.map((o) => {
107
+ function U(t) {
108
+ (t.effectiveConfig?.fitMode || t.fitMode || B.STRETCH) === B.STRETCH ? t._gridTemplate = t._visibleColumns.map((o) => {
109
109
  if (o.width) return `${o.width}px`;
110
110
  const n = o.minWidth;
111
111
  return n != null ? `minmax(${n}px, 1fr)` : "1fr";
112
112
  }).join(" ").trim() : t._gridTemplate = t._visibleColumns.map((o) => o.width ? `${o.width}px` : "max-content").join(" "), t.style.setProperty("--tbw-column-template", t._gridTemplate);
113
113
  }
114
- function Ve(t) {
114
+ function Xe(t) {
115
115
  return t == null ? "string" : typeof t == "number" ? "number" : typeof t == "boolean" ? "boolean" : t instanceof Date || typeof t == "string" && /\d{4}-\d{2}-\d{2}/.test(t) && !isNaN(Date.parse(t)) ? "date" : "string";
116
116
  }
117
- function Be(t, e) {
117
+ function Ye(t, e) {
118
118
  const o = t[0] || {}, n = Object.keys(o).map((r) => {
119
- const s = o[r], l = Ve(s);
119
+ const s = o[r], l = Xe(s);
120
120
  return { field: r, header: r.charAt(0).toUpperCase() + r.slice(1), type: l };
121
121
  }), i = {};
122
122
  return n.forEach((r) => {
123
123
  i[r.field] = r.type || "string";
124
124
  }), { columns: n, typeMap: i };
125
125
  }
126
- const Ge = /{{\s*([^}]+)\s*}}/g, H = "__DG_EMPTY__", Xe = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, Ye = /__(proto|defineGetter|defineSetter)|constructor|window|globalThis|global|process|Function|import|eval|Reflect|Proxy|Error|arguments|document|location|cookie|localStorage|sessionStorage|indexedDB|fetch|XMLHttpRequest|WebSocket|Worker|SharedWorker|ServiceWorker|opener|parent|top|frames|self|this\b/;
127
- function je(t) {
126
+ const je = /{{\s*([^}]+)\s*}}/g, O = "__DG_EMPTY__", Ke = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, Ze = /__(proto|defineGetter|defineSetter)|constructor|window|globalThis|global|process|Function|import|eval|Reflect|Proxy|Error|arguments|document|location|cookie|localStorage|sessionStorage|indexedDB|fetch|XMLHttpRequest|WebSocket|Worker|SharedWorker|ServiceWorker|opener|parent|top|frames|self|this\b/;
127
+ function Je(t) {
128
128
  return !t || typeof t != "string" ? "" : t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
129
129
  }
130
- const Ke = /* @__PURE__ */ new Set([
130
+ const Qe = /* @__PURE__ */ new Set([
131
131
  "script",
132
132
  "iframe",
133
133
  "object",
@@ -152,23 +152,23 @@ const Ke = /* @__PURE__ */ new Set([
152
152
  "plaintext",
153
153
  "xmp",
154
154
  "listing"
155
- ]), ue = /^on\w+$/i, Ze = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), Je = /^\s*(javascript|vbscript|data|blob):/i;
156
- function j(t) {
155
+ ]), ge = /^on\w+$/i, et = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), tt = /^\s*(javascript|vbscript|data|blob):/i;
156
+ function K(t) {
157
157
  if (!t || typeof t != "string") return "";
158
158
  if (t.indexOf("<") === -1) return t;
159
159
  const e = document.createElement("template");
160
- return e.innerHTML = t, Qe(e.content), e.innerHTML;
160
+ return e.innerHTML = t, ot(e.content), e.innerHTML;
161
161
  }
162
- function Qe(t) {
162
+ function ot(t) {
163
163
  const e = [], o = t.querySelectorAll("*");
164
164
  for (const n of o) {
165
165
  const i = n.tagName.toLowerCase();
166
- if (Ke.has(i)) {
166
+ if (Qe.has(i)) {
167
167
  e.push(n);
168
168
  continue;
169
169
  }
170
170
  if ((i === "svg" || n.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(n.attributes).some(
171
- (l) => ue.test(l.name) || l.name === "href" || l.name === "xlink:href"
171
+ (l) => ge.test(l.name) || l.name === "href" || l.name === "xlink:href"
172
172
  )) {
173
173
  e.push(n);
174
174
  continue;
@@ -176,11 +176,11 @@ function Qe(t) {
176
176
  const r = [];
177
177
  for (const s of n.attributes) {
178
178
  const l = s.name.toLowerCase();
179
- if (ue.test(l)) {
179
+ if (ge.test(l)) {
180
180
  r.push(s.name);
181
181
  continue;
182
182
  }
183
- if (Ze.has(l) && Je.test(s.value)) {
183
+ if (et.has(l) && tt.test(s.value)) {
184
184
  r.push(s.name);
185
185
  continue;
186
186
  }
@@ -193,35 +193,35 @@ function Qe(t) {
193
193
  }
194
194
  e.forEach((n) => n.remove());
195
195
  }
196
- function xe(t, e) {
196
+ function Le(t, e) {
197
197
  if (!t || t.indexOf("{{") === -1) return t;
198
- const o = [], n = t.replace(Ge, (l, c) => {
199
- const a = et(c, e);
198
+ const o = [], n = t.replace(je, (l, c) => {
199
+ const a = nt(c, e);
200
200
  return o.push({ expr: c.trim(), result: a }), a;
201
- }), i = tt(n), r = o.length && o.every((l) => l.result === "" || l.result === H);
201
+ }), i = it(n), r = o.length && o.every((l) => l.result === "" || l.result === O);
202
202
  return /Reflect\.|\bProxy\b|ownKeys\(/.test(t) || r ? "" : i;
203
203
  }
204
- function et(t, e) {
205
- if (t = (t || "").trim(), !t || /\b(Reflect|Proxy|ownKeys)\b/.test(t)) return H;
206
- if (t === "value") return e.value == null ? H : String(e.value);
204
+ function nt(t, e) {
205
+ if (t = (t || "").trim(), !t || /\b(Reflect|Proxy|ownKeys)\b/.test(t)) return O;
206
+ if (t === "value") return e.value == null ? O : String(e.value);
207
207
  if (t.startsWith("row.") && !/[()?]/.test(t) && !t.includes(":")) {
208
208
  const n = t.slice(4), i = e.row ? e.row[n] : void 0;
209
- return i == null ? H : String(i);
209
+ return i == null ? O : String(i);
210
210
  }
211
- if (t.length > 80 || !Xe.test(t) || Ye.test(t)) return H;
211
+ if (t.length > 80 || !Ke.test(t) || Ze.test(t)) return O;
212
212
  const o = t.match(/\./g);
213
- if (o && o.length > 1) return H;
213
+ if (o && o.length > 1) return O;
214
214
  try {
215
215
  const i = new Function("value", "row", `return (${t});`)(e.value, e.row), r = i == null ? "" : String(i);
216
- return /Reflect|Proxy|ownKeys/.test(r) ? H : r || H;
216
+ return /Reflect|Proxy|ownKeys/.test(r) ? O : r || O;
217
217
  } catch {
218
- return H;
218
+ return O;
219
219
  }
220
220
  }
221
- function tt(t) {
222
- return t && t.replace(new RegExp(H, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
221
+ function it(t) {
222
+ return t && t.replace(new RegExp(O, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
223
223
  }
224
- function ot(t) {
224
+ function rt(t) {
225
225
  if (/Reflect|Proxy|ownKeys/.test(t.textContent || "")) {
226
226
  if (Array.from(t.childNodes).forEach((e) => {
227
227
  e.nodeType === Node.TEXT_NODE && /Reflect|Proxy|ownKeys/.test(e.textContent || "") && (e.textContent = "");
@@ -233,18 +233,18 @@ function ot(t) {
233
233
  (t.textContent || "").trim().length === 0 && (t.textContent = "");
234
234
  }
235
235
  }
236
- function fe(t) {
237
- const e = /Reflect\.|\bProxy\b|ownKeys\(/.test(t), o = ((n) => e ? "" : xe(t, n));
236
+ function we(t) {
237
+ const e = /Reflect\.|\bProxy\b|ownKeys\(/.test(t), o = ((n) => e ? "" : Le(t, n));
238
238
  return o.__blocked = e, o;
239
239
  }
240
- const nt = 100;
241
- class it {
242
- #o;
240
+ const st = 100;
241
+ class lt {
242
+ #n;
243
243
  #c;
244
244
  #f;
245
245
  #d;
246
246
  #s;
247
- #n = {};
247
+ #i = {};
248
248
  #h = {};
249
249
  #u = !0;
250
250
  #m = [];
@@ -257,7 +257,7 @@ class it {
257
257
  this.#r = e;
258
258
  }
259
259
  get original() {
260
- return this.#n;
260
+ return this.#i;
261
261
  }
262
262
  get effective() {
263
263
  return this.#h;
@@ -299,10 +299,10 @@ class it {
299
299
  this.#u = !0;
300
300
  }
301
301
  setGridConfig(e) {
302
- this.#o = e, this.#u = !0, this.#d = void 0;
302
+ this.#n = e, this.#u = !0, this.#d = void 0;
303
303
  }
304
304
  getGridConfig() {
305
- return this.#o;
305
+ return this.#n;
306
306
  }
307
307
  setColumns(e) {
308
308
  this.#c = e, this.#u = !0;
@@ -320,8 +320,8 @@ class it {
320
320
  const e = (this.#h.columns?.length ?? 0) > 0;
321
321
  if (!this.#u && e)
322
322
  return;
323
- const o = this.#v();
324
- this.#u = !1, this.#n = o, Object.freeze(this.#n), this.#n.columns && Object.freeze(this.#n.columns), this.#h = this.#A(this.#n), this.#p();
323
+ const o = this.#C();
324
+ this.#u = !1, this.#i = o, Object.freeze(this.#i), this.#i.columns && Object.freeze(this.#i.columns), this.#h = this.#A(this.#i), this.#p();
325
325
  }
326
326
  #A(e) {
327
327
  const o = { ...e };
@@ -339,23 +339,23 @@ class it {
339
339
  n.width == null && (n.width = 80);
340
340
  }), this.#r.applyAnimationConfig(e);
341
341
  }
342
- #v() {
343
- const e = this.#o ? { ...this.#o } : {}, o = Array.isArray(e.columns) ? [...e.columns] : [], n = (this.#d ?? []).map((s) => ({
342
+ #C() {
343
+ const e = this.#n ? { ...this.#n } : {}, o = Array.isArray(e.columns) ? [...e.columns] : [], n = (this.#d ?? []).map((s) => ({
344
344
  ...s
345
345
  }));
346
- let i = ce(
346
+ let i = ue(
347
347
  o,
348
348
  n
349
349
  );
350
- this.#c && this.#c.length && (i = ce(
350
+ this.#c && this.#c.length && (i = ue(
351
351
  this.#c,
352
352
  n
353
353
  ));
354
354
  const r = this.#r.getRows();
355
- return i.length === 0 && r.length && (i = Be(r).columns), i.length && (i.forEach((s) => {
355
+ return i.length === 0 && r.length && (i = Ye(r).columns), i.length && (i.forEach((s) => {
356
356
  s.sortable === void 0 && (s.sortable = !0), s.resizable === void 0 && (s.resizable = !0), s.__originalWidth === void 0 && typeof s.width == "number" && (s.__originalWidth = s.width);
357
357
  }), i.forEach((s) => {
358
- s.__viewTemplate && !s.__compiledView && (s.__compiledView = fe(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = fe(s.__editorTemplate.innerHTML));
358
+ s.__viewTemplate && !s.__compiledView && (s.__compiledView = we(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = we(s.__editorTemplate.innerHTML));
359
359
  }), e.columns = i), this.#f && (e.fitMode = this.#f), e.fitMode || (e.fitMode = "stretch"), this.#y(e), e.columnState && !this.#w && (this.#w = e.columnState), e;
360
360
  }
361
361
  #y(e) {
@@ -366,21 +366,21 @@ class it {
366
366
  n?.length > 0 && (e.shell.header.lightDomContent = n), this.#r.getShellHasToolButtonsContainer() && (e.shell.header.hasToolButtonsContainer = !0);
367
367
  const i = this.#r.getShellToolPanels();
368
368
  if (i.size > 0) {
369
- const d = Array.from(i.values());
370
- d.sort((f, p) => (f.order ?? 100) - (p.order ?? 100)), e.shell.toolPanels = d;
369
+ const u = Array.from(i.values());
370
+ u.sort((p, f) => (p.order ?? 100) - (f.order ?? 100)), e.shell.toolPanels = u;
371
371
  }
372
372
  const r = this.#r.getShellHeaderContents();
373
373
  if (r.size > 0) {
374
- const d = Array.from(r.values());
375
- d.sort((f, p) => (f.order ?? 100) - (p.order ?? 100)), e.shell.headerContents = d;
374
+ const u = Array.from(r.values());
375
+ u.sort((p, f) => (p.order ?? 100) - (f.order ?? 100)), e.shell.headerContents = u;
376
376
  }
377
- const s = this.#r.getShellToolbarContents(), l = Array.from(s.values()), c = this.#o?.shell?.header?.toolbarContents ?? [], a = new Set(c.map((d) => d.id)), h = [...c];
378
- for (const d of l)
379
- a.has(d.id) || h.push(d);
380
- h.sort((d, f) => (d.order ?? 0) - (f.order ?? 0)), e.shell.header.toolbarContents = h;
377
+ const s = this.#r.getShellToolbarContents(), l = Array.from(s.values()), c = this.#n?.shell?.header?.toolbarContents ?? [], a = new Set(c.map((u) => u.id)), h = [...c];
378
+ for (const u of l)
379
+ a.has(u.id) || h.push(u);
380
+ h.sort((u, p) => (u.order ?? 0) - (p.order ?? 0)), e.shell.header.toolbarContents = h;
381
381
  }
382
382
  collectState(e) {
383
- const o = this.columns, n = this.#C();
383
+ const o = this.columns, n = this.#v();
384
384
  return {
385
385
  columns: o.map((i, r) => {
386
386
  const s = {
@@ -427,7 +427,7 @@ class it {
427
427
  l.applyColumnState(c.field, c);
428
428
  }
429
429
  resetState(e) {
430
- this.#w = void 0, this.#r.setSortState(null), this.#h = this.#A(this.#n), this.#p();
430
+ this.#w = void 0, this.#r.setSortState(null), this.#h = this.#A(this.#i), this.#p();
431
431
  for (const o of e)
432
432
  if (o.applyColumnState)
433
433
  for (const n of this.columns)
@@ -438,7 +438,7 @@ class it {
438
438
  });
439
439
  this.requestStateChange(e);
440
440
  }
441
- #C() {
441
+ #v() {
442
442
  const e = /* @__PURE__ */ new Map(), o = this.#r.getSortState();
443
443
  return o && e.set(o.field, {
444
444
  direction: o.direction === 1 ? "asc" : "desc",
@@ -450,7 +450,7 @@ class it {
450
450
  this.#g = void 0;
451
451
  const o = this.collectState(e);
452
452
  this.#r.emit("column-state-change", o);
453
- }, nt);
453
+ }, st);
454
454
  }
455
455
  setColumnVisible(e, o) {
456
456
  const n = this.columns, i = n.find((s) => s.field === e);
@@ -498,7 +498,7 @@ class it {
498
498
  this.columns = n, this.#r.renderHeader(), this.#r.updateTemplate(), this.#r.refreshVirtualWindow();
499
499
  }
500
500
  parseLightDomColumns(e) {
501
- this.#d || (this.#s = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#s.length ? Ue(e) : []);
501
+ this.#d || (this.#s = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#s.length ? Ge(e) : []);
502
502
  }
503
503
  clearLightDomCache() {
504
504
  this.#d = void 0;
@@ -551,10 +551,10 @@ class it {
551
551
  this.#l?.disconnect(), this.#m = [], this.#g && clearTimeout(this.#g);
552
552
  }
553
553
  }
554
- function Ae(t) {
554
+ function He(t) {
555
555
  return `<span role="checkbox" aria-checked="${t}" aria-label="${t}">${t ? "&#x1F5F9;" : "&#9744;"}</span>`;
556
556
  }
557
- function Pe(t) {
557
+ function Oe(t) {
558
558
  if (t == null || t === "") return "";
559
559
  if (t instanceof Date)
560
560
  return isNaN(t.getTime()) ? "" : t.toLocaleDateString();
@@ -564,7 +564,7 @@ function Pe(t) {
564
564
  }
565
565
  return "";
566
566
  }
567
- function Le(t) {
567
+ function De(t) {
568
568
  if (!t) return -1;
569
569
  const e = t.getAttribute("data-row");
570
570
  if (e) return parseInt(e, 10);
@@ -577,15 +577,15 @@ function Le(t) {
577
577
  if (i[r] === o) return r;
578
578
  return -1;
579
579
  }
580
- function rt(t) {
580
+ function at(t) {
581
581
  if (!t) return -1;
582
582
  const e = t.getAttribute("data-col");
583
583
  return e ? parseInt(e, 10) : -1;
584
584
  }
585
- function se(t) {
585
+ function ae(t) {
586
586
  t && t.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
587
587
  }
588
- function He(t, e) {
588
+ function Me(t, e) {
589
589
  const o = e.renderer || e.viewRenderer;
590
590
  if (o) return o;
591
591
  if (!e.type) return;
@@ -599,194 +599,229 @@ function He(t, e) {
599
599
  return r.renderer;
600
600
  }
601
601
  }
602
- const Oe = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
603
- function Q(t) {
602
+ const ze = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
603
+ function ee(t) {
604
604
  return (t.__editingCellCount ?? 0) > 0;
605
605
  }
606
- function ee(t) {
606
+ function te(t) {
607
607
  t.__editingCellCount = 0, t.removeAttribute("data-has-editing"), t.querySelectorAll(".cell.editing").forEach((o) => o.classList.remove("editing"));
608
608
  }
609
- const De = document.createElement("template");
610
- De.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
611
- const Me = document.createElement("template");
612
- Me.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
613
- function st() {
614
- return De.content.firstElementChild.cloneNode(!0);
609
+ const Ne = document.createElement("template");
610
+ Ne.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
611
+ const ke = document.createElement("template");
612
+ ke.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
613
+ function ct() {
614
+ return Ne.content.firstElementChild.cloneNode(!0);
615
615
  }
616
- function lt() {
617
- return Me.content.firstElementChild.cloneNode(!0);
616
+ function dt() {
617
+ return ke.content.firstElementChild.cloneNode(!0);
618
618
  }
619
- function G(t) {
619
+ function X(t) {
620
620
  t.__cellDisplayCache = void 0, t.__cellCacheEpoch = void 0, t.__hasSpecialColumns = void 0;
621
621
  }
622
- function at(t, e, o, n, i) {
622
+ function ht(t, e, o, n, i) {
623
623
  const r = Math.max(0, o - e), s = t._bodyEl, l = t._visibleColumns, c = l.length;
624
624
  let a = t.__cachedHeaderRowCount;
625
625
  for (a === void 0 && (a = t.querySelector(".header-group-row") ? 2 : 1, t.__cachedHeaderRowCount = a); t._rowPool.length < r; ) {
626
- const d = lt();
627
- t._rowPool.push(d);
626
+ const p = dt();
627
+ t._rowPool.push(p);
628
628
  }
629
629
  if (t._rowPool.length > r) {
630
- for (let d = r; d < t._rowPool.length; d++) {
631
- const f = t._rowPool[d];
630
+ for (let p = r; p < t._rowPool.length; p++) {
631
+ const f = t._rowPool[p];
632
632
  f.parentNode === s && f.remove();
633
633
  }
634
634
  t._rowPool.length = r;
635
635
  }
636
- const h = i && t.__hasRenderRowPlugins !== !1;
637
- for (let d = 0; d < r; d++) {
638
- const f = e + d, p = t._rows[f], u = t._rowPool[d];
639
- if (u.setAttribute("aria-rowindex", String(f + a + 1)), h && i(p, u, f)) {
640
- u.__epoch = n, u.__rowDataRef = p, u.parentNode !== s && s.appendChild(u);
636
+ const h = i && t.__hasRenderRowPlugins !== !1, u = t._hasAfterRowRenderHook?.() ?? !1;
637
+ for (let p = 0; p < r; p++) {
638
+ const f = e + p, g = t._rows[f], d = t._rowPool[p];
639
+ if (d.setAttribute("aria-rowindex", String(f + a + 1)), h && i(g, d, f)) {
640
+ d.__epoch = n, d.__rowDataRef = g, d.parentNode !== s && s.appendChild(d);
641
641
  continue;
642
642
  }
643
- const g = u.__epoch, m = u.__rowDataRef, y = u.children.length, C = g === n && y === c, w = m !== p;
644
- let v = !1;
645
- if (C && w) {
646
- for (let E = 0; E < c; E++)
647
- if (l[E].externalView && !u.querySelector(`.cell[data-col="${E}"] [data-external-view]`)) {
648
- v = !0;
643
+ const w = d.__epoch, m = d.__rowDataRef, R = d.children.length, T = w === n && R === c, b = m !== g;
644
+ let y = !1;
645
+ if (T && b) {
646
+ for (let S = 0; S < c; S++)
647
+ if (l[S].externalView && !d.querySelector(`.cell[data-col="${S}"] [data-external-view]`)) {
648
+ y = !0;
649
649
  break;
650
650
  }
651
651
  }
652
- if (!C || v) {
653
- const E = Q(u), T = t._activeEditRows === f;
654
- E && !T ? (u.__isCustomRow && (u.className = "data-grid-row", u.setAttribute("role", "row"), u.__isCustomRow = !1), ee(u), U(t, u, p, f), u.__epoch = n, u.__rowDataRef = p) : E && T ? (te(t, u, p, f), u.__rowDataRef = p) : (u.__isCustomRow && (u.className = "data-grid-row", u.setAttribute("role", "row"), u.__isCustomRow = !1), U(t, u, p, f), u.__epoch = n, u.__rowDataRef = p);
655
- } else if (w) {
656
- const E = Q(u), T = t._activeEditRows === f;
657
- E && !T ? (ee(u), U(t, u, p, f), u.__epoch = n, u.__rowDataRef = p) : (te(t, u, p, f), u.__rowDataRef = p);
652
+ if (!T || y) {
653
+ const S = ee(d), P = t._activeEditRows === f;
654
+ S && !P ? (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1), te(d), V(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : S && P ? (oe(t, d, g, f), d.__rowDataRef = g) : (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1), V(t, d, g, f), d.__epoch = n, d.__rowDataRef = g);
655
+ } else if (b) {
656
+ const S = ee(d), P = t._activeEditRows === f;
657
+ S && !P ? (te(d), V(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : (oe(t, d, g, f), d.__rowDataRef = g);
658
658
  } else {
659
- const E = Q(u), T = t._activeEditRows === f;
660
- E && !T ? (ee(u), U(t, u, p, f), u.__epoch = n, u.__rowDataRef = p) : te(t, u, p, f);
659
+ const S = ee(d), P = t._activeEditRows === f;
660
+ S && !P ? (te(d), V(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : oe(t, d, g, f);
661
661
  }
662
- let S = !1;
663
- const b = t.changedRowIds;
664
- if (b && b.length > 0)
662
+ let E = !1;
663
+ const C = t.changedRowIds;
664
+ if (C && C.length > 0)
665
665
  try {
666
- const E = t.getRowId?.(p);
667
- E && (S = b.includes(E));
666
+ const S = t.getRowId?.(g);
667
+ S && (E = C.includes(S));
668
668
  } catch {
669
669
  }
670
- const z = u.classList.contains("changed");
671
- S !== z && u.classList.toggle("changed", S);
672
- const _ = t.effectiveConfig?.rowClass;
673
- if (_) {
674
- const E = u.getAttribute("data-dynamic-classes");
675
- E && E.split(" ").forEach((T) => T && u.classList.remove(T));
670
+ const _ = d.classList.contains("changed");
671
+ E !== _ && d.classList.toggle("changed", E);
672
+ const N = t.effectiveConfig?.rowClass;
673
+ if (N) {
674
+ const S = d.getAttribute("data-dynamic-classes");
675
+ S && S.split(" ").forEach((P) => P && d.classList.remove(P));
676
676
  try {
677
- const T = _(p);
678
- if (T && T.length > 0) {
679
- const J = T.filter((B) => B && typeof B == "string");
680
- J.forEach((B) => u.classList.add(B)), u.setAttribute("data-dynamic-classes", J.join(" "));
677
+ const P = N(g);
678
+ if (P && P.length > 0) {
679
+ const Q = P.filter((G) => G && typeof G == "string");
680
+ Q.forEach((G) => d.classList.add(G)), d.setAttribute("data-dynamic-classes", Q.join(" "));
681
681
  } else
682
- u.removeAttribute("data-dynamic-classes");
683
- } catch (T) {
684
- console.warn("[tbw-grid] rowClass callback error:", T), u.removeAttribute("data-dynamic-classes");
682
+ d.removeAttribute("data-dynamic-classes");
683
+ } catch (P) {
684
+ console.warn("[tbw-grid] rowClass callback error:", P), d.removeAttribute("data-dynamic-classes");
685
685
  }
686
686
  }
687
- u.parentNode !== s && s.appendChild(u);
688
- }
689
- }
690
- function te(t, e, o, n) {
691
- const i = e.children, r = t._visibleColumns, s = r.length, l = i.length, c = s < l ? s : l, a = t._focusRow, h = t._focusCol;
692
- let d = t.__hasSpecialColumns;
693
- if (d === void 0) {
694
- d = !1;
695
- const p = t.effectiveConfig?.typeDefaults, u = t.__frameworkAdapter;
696
- for (let g = 0; g < s; g++) {
697
- const m = r[g];
698
- if (m.__viewTemplate || m.__compiledView || m.renderer || m.viewRenderer || m.externalView || m.format || m.type === "date" || m.type === "boolean" || m.type && p?.[m.type]?.renderer || m.type && u?.getTypeDefault?.(m.type)?.renderer) {
699
- d = !0;
687
+ u && t._afterRowRender?.({
688
+ row: g,
689
+ rowIndex: f,
690
+ rowElement: d
691
+ }), d.parentNode !== s && s.appendChild(d);
692
+ }
693
+ }
694
+ function oe(t, e, o, n) {
695
+ const i = e.children, r = t._visibleColumns, s = r.length, l = i.length, c = s < l ? s : l, a = t._focusRow, h = t._focusCol, u = t._hasAfterCellRenderHook?.() ?? !1;
696
+ let p = t.__hasSpecialColumns;
697
+ if (p === void 0) {
698
+ p = !1;
699
+ const g = t.effectiveConfig?.typeDefaults, d = t.__frameworkAdapter;
700
+ for (let w = 0; w < s; w++) {
701
+ const m = r[w];
702
+ if (m.__viewTemplate || m.__compiledView || m.renderer || m.viewRenderer || m.externalView || m.format || m.type === "date" || m.type === "boolean" || m.type && g?.[m.type]?.renderer || m.type && d?.getTypeDefault?.(m.type)?.renderer) {
703
+ p = !0;
700
704
  break;
701
705
  }
702
706
  }
703
- t.__hasSpecialColumns = d;
707
+ t.__hasSpecialColumns = p;
704
708
  }
705
709
  const f = String(n);
706
- if (!d) {
707
- for (let p = 0; p < c; p++) {
708
- const u = i[p];
709
- if (u.classList.contains("editing")) continue;
710
- const g = o[r[p].field];
711
- u.textContent = g == null ? "" : String(g), u.getAttribute("data-row") !== f && u.setAttribute("data-row", f);
712
- const m = a === n && h === p, y = u.classList.contains("cell-focus");
713
- m !== y && (u.classList.toggle("cell-focus", m), u.setAttribute("aria-selected", String(m)));
710
+ if (!p) {
711
+ for (let g = 0; g < c; g++) {
712
+ const d = i[g];
713
+ if (d.classList.contains("editing")) continue;
714
+ const w = r[g], m = o[w.field];
715
+ d.textContent = m == null ? "" : String(m), d.getAttribute("data-row") !== f && d.setAttribute("data-row", f);
716
+ const R = a === n && h === g, v = d.classList.contains("cell-focus");
717
+ R !== v && (d.classList.toggle("cell-focus", R), d.setAttribute("aria-selected", String(R))), u && t._afterCellRender?.({
718
+ row: o,
719
+ rowIndex: n,
720
+ column: w,
721
+ colIndex: g,
722
+ value: m,
723
+ cellElement: d,
724
+ rowElement: e
725
+ });
714
726
  }
715
727
  return;
716
728
  }
717
- for (let p = 0; p < c; p++)
718
- if (r[p].externalView && !i[p].querySelector("[data-external-view]")) {
719
- U(t, e, o, n);
729
+ for (let g = 0; g < c; g++)
730
+ if (r[g].externalView && !i[g].querySelector("[data-external-view]")) {
731
+ V(t, e, o, n);
720
732
  return;
721
733
  }
722
- for (let p = 0; p < c; p++) {
723
- const u = r[p], g = i[p];
724
- g.getAttribute("data-row") !== f && g.setAttribute("data-row", f);
725
- const m = a === n && h === p, y = g.classList.contains("cell-focus");
726
- m !== y && (g.classList.toggle("cell-focus", m), g.setAttribute("aria-selected", String(m)));
727
- const R = u.cellClass;
728
- if (R) {
729
- const S = g.getAttribute("data-dynamic-classes");
730
- S && S.split(" ").forEach((b) => b && g.classList.remove(b));
734
+ for (let g = 0; g < c; g++) {
735
+ const d = r[g], w = i[g];
736
+ w.getAttribute("data-row") !== f && w.setAttribute("data-row", f);
737
+ const m = a === n && h === g, R = w.classList.contains("cell-focus");
738
+ m !== R && (w.classList.toggle("cell-focus", m), w.setAttribute("aria-selected", String(m)));
739
+ const v = d.cellClass;
740
+ if (v) {
741
+ const E = w.getAttribute("data-dynamic-classes");
742
+ E && E.split(" ").forEach((C) => C && w.classList.remove(C));
731
743
  try {
732
- const b = o[u.field], z = R(b, o, u);
733
- if (z && z.length > 0) {
734
- const _ = z.filter((E) => E && typeof E == "string");
735
- _.forEach((E) => g.classList.add(E)), g.setAttribute("data-dynamic-classes", _.join(" "));
744
+ const C = o[d.field], _ = v(C, o, d);
745
+ if (_ && _.length > 0) {
746
+ const N = _.filter((S) => S && typeof S == "string");
747
+ N.forEach((S) => w.classList.add(S)), w.setAttribute("data-dynamic-classes", N.join(" "));
736
748
  } else
737
- g.removeAttribute("data-dynamic-classes");
738
- } catch (b) {
739
- console.warn(`[tbw-grid] cellClass callback error for column '${u.field}':`, b), g.removeAttribute("data-dynamic-classes");
749
+ w.removeAttribute("data-dynamic-classes");
750
+ } catch (C) {
751
+ console.warn(`[tbw-grid] cellClass callback error for column '${d.field}':`, C), w.removeAttribute("data-dynamic-classes");
740
752
  }
741
753
  }
742
- if (g.classList.contains("editing")) continue;
743
- const C = He(t, u);
744
- if (C) {
745
- const S = o[u.field], b = C({ row: o, value: S, field: u.field, column: u, cellEl: g });
746
- typeof b == "string" ? g.innerHTML = j(b) : b instanceof Node ? b.parentElement !== g && (g.innerHTML = "", g.appendChild(b)) : b == null && (g.textContent = S == null ? "" : String(S));
754
+ if (w.classList.contains("editing")) continue;
755
+ const T = Me(t, d);
756
+ if (T) {
757
+ const E = o[d.field], C = T({
758
+ row: o,
759
+ value: E,
760
+ field: d.field,
761
+ column: d,
762
+ cellEl: w
763
+ });
764
+ typeof C == "string" ? w.innerHTML = K(C) : C instanceof Node ? C.parentElement !== w && (w.innerHTML = "", w.appendChild(C)) : C == null && (w.textContent = E == null ? "" : String(E)), u && t._afterCellRender?.({
765
+ row: o,
766
+ rowIndex: n,
767
+ column: d,
768
+ colIndex: g,
769
+ value: E,
770
+ cellElement: w,
771
+ rowElement: e
772
+ });
747
773
  continue;
748
774
  }
749
- if (u.__viewTemplate || u.__compiledView || u.externalView)
775
+ if (d.__viewTemplate || d.__compiledView || d.externalView)
750
776
  continue;
751
- const w = o[u.field];
752
- let v;
753
- if (u.format)
777
+ const b = o[d.field];
778
+ let y;
779
+ if (d.format)
754
780
  try {
755
- const S = u.format(w, o);
756
- v = S == null ? "" : String(S);
757
- } catch (S) {
758
- console.warn(`[tbw-grid] Format error in column '${u.field}':`, S), v = w == null ? "" : String(w);
781
+ const E = d.format(b, o);
782
+ y = E == null ? "" : String(E);
783
+ } catch (E) {
784
+ console.warn(`[tbw-grid] Format error in column '${d.field}':`, E), y = b == null ? "" : String(b);
759
785
  }
760
- else u.type === "date" ? (v = Pe(w), g.textContent = v) : u.type === "boolean" ? g.innerHTML = Ae(!!w) : (v = w == null ? "" : String(w), g.textContent = v);
786
+ else d.type === "date" ? (y = Oe(b), w.textContent = y) : d.type === "boolean" ? w.innerHTML = He(!!b) : (y = b == null ? "" : String(b), w.textContent = y);
787
+ u && t._afterCellRender?.({
788
+ row: o,
789
+ rowIndex: n,
790
+ column: d,
791
+ colIndex: g,
792
+ value: b,
793
+ cellElement: w,
794
+ rowElement: e
795
+ });
761
796
  }
762
797
  }
763
- function U(t, e, o, n) {
798
+ function V(t, e, o, n) {
764
799
  e.innerHTML = "";
765
- const i = t._visibleColumns, r = i.length, s = t._focusRow, l = t._focusCol, c = t, a = document.createDocumentFragment();
766
- for (let h = 0; h < r; h++) {
767
- const d = i[h], f = st();
768
- f.setAttribute("aria-colindex", String(h + 1)), f.setAttribute("data-col", String(h)), f.setAttribute("data-row", String(n)), f.setAttribute("data-field", d.field), f.setAttribute("data-header", d.header ?? d.field), d.type && f.setAttribute("data-type", d.type);
769
- let p = o[d.field];
770
- if (d.format)
800
+ const i = t._visibleColumns, r = i.length, s = t._focusRow, l = t._focusCol, c = t, a = t._hasAfterCellRenderHook?.() ?? !1, h = document.createDocumentFragment();
801
+ for (let u = 0; u < r; u++) {
802
+ const p = i[u], f = ct();
803
+ f.setAttribute("aria-colindex", String(u + 1)), f.setAttribute("data-col", String(u)), f.setAttribute("data-row", String(n)), f.setAttribute("data-field", p.field), f.setAttribute("data-header", p.header ?? p.field), p.type && f.setAttribute("data-type", p.type);
804
+ let g = o[p.field];
805
+ if (p.format)
771
806
  try {
772
- p = d.format(p, o);
773
- } catch (w) {
774
- console.warn(`[tbw-grid] Format error in column '${d.field}':`, w);
807
+ g = p.format(g, o);
808
+ } catch (b) {
809
+ console.warn(`[tbw-grid] Format error in column '${p.field}':`, b);
775
810
  }
776
- const u = d.__compiledView, g = d.__viewTemplate, m = He(t, d), y = d.externalView;
777
- let R = !1;
811
+ const d = p.__compiledView, w = p.__viewTemplate, m = Me(t, p), R = p.externalView;
812
+ let v = !1;
778
813
  if (m) {
779
- const w = m({ row: o, value: p, field: d.field, column: d, cellEl: f });
780
- typeof w == "string" ? (f.innerHTML = j(w), R = !0) : w instanceof Node ? w.parentElement !== f && (f.textContent = "", f.appendChild(w)) : w == null && (f.textContent = p == null ? "" : String(p));
781
- } else if (y) {
782
- const w = y, v = document.createElement("div");
783
- v.setAttribute("data-external-view", ""), v.setAttribute("data-field", d.field), f.appendChild(v);
784
- const S = { row: o, value: p, field: d.field, column: d };
785
- if (w.mount)
814
+ const b = m({ row: o, value: g, field: p.field, column: p, cellEl: f });
815
+ typeof b == "string" ? (f.innerHTML = K(b), v = !0) : b instanceof Node ? b.parentElement !== f && (f.textContent = "", f.appendChild(b)) : b == null && (f.textContent = g == null ? "" : String(g));
816
+ } else if (R) {
817
+ const b = R, y = document.createElement("div");
818
+ y.setAttribute("data-external-view", ""), y.setAttribute("data-field", p.field), f.appendChild(y);
819
+ const E = { row: o, value: g, field: p.field, column: p };
820
+ if (b.mount)
786
821
  try {
787
- w.mount({ placeholder: v, context: S, spec: w });
788
- } catch (b) {
789
- console.warn(`[tbw-grid] External view mount error for column '${d.field}':`, b);
822
+ b.mount({ placeholder: y, context: E, spec: b });
823
+ } catch (C) {
824
+ console.warn(`[tbw-grid] External view mount error for column '${p.field}':`, C);
790
825
  }
791
826
  else
792
827
  queueMicrotask(() => {
@@ -795,46 +830,54 @@ function U(t, e, o, n) {
795
830
  new CustomEvent("mount-external-view", {
796
831
  bubbles: !0,
797
832
  composed: !0,
798
- detail: { placeholder: v, spec: w, context: S }
833
+ detail: { placeholder: y, spec: b, context: E }
799
834
  })
800
835
  );
801
- } catch (b) {
802
- console.warn(`[tbw-grid] External view event dispatch error for column '${d.field}':`, b);
836
+ } catch (C) {
837
+ console.warn(`[tbw-grid] External view event dispatch error for column '${p.field}':`, C);
803
838
  }
804
839
  });
805
- v.setAttribute("data-mounted", "");
806
- } else if (u) {
807
- const w = u({ row: o, value: p, field: d.field, column: d }), v = u.__blocked;
808
- f.innerHTML = v ? "" : j(w), R = !0, v && (f.textContent = "", f.setAttribute("data-blocked-template", ""));
809
- } else if (g) {
810
- const w = g.innerHTML;
811
- /Reflect\.|\bProxy\b|ownKeys\(/.test(w) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = j(xe(w, { row: o, value: p })), R = !0);
840
+ y.setAttribute("data-mounted", "");
841
+ } else if (d) {
842
+ const b = d({ row: o, value: g, field: p.field, column: p }), y = d.__blocked;
843
+ f.innerHTML = y ? "" : K(b), v = !0, y && (f.textContent = "", f.setAttribute("data-blocked-template", ""));
844
+ } else if (w) {
845
+ const b = w.innerHTML;
846
+ /Reflect\.|\bProxy\b|ownKeys\(/.test(b) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = K(Le(b, { row: o, value: g })), v = !0);
812
847
  } else
813
- d.type === "date" ? f.textContent = Pe(p) : d.type === "boolean" ? f.innerHTML = Ae(!!p) : f.textContent = p == null ? "" : String(p);
814
- if (R) {
815
- ot(f);
816
- const w = f.textContent || "";
817
- /Proxy|Reflect\.ownKeys/.test(w) && (f.textContent = w.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(f.textContent || "") && (f.textContent = ""));
818
- }
819
- f.hasAttribute("data-blocked-template") && (f.textContent || "").trim().length && (f.textContent = ""), d.editable ? f.tabIndex = 0 : d.type === "boolean" && (f.hasAttribute("tabindex") || (f.tabIndex = 0)), s === n && l === h ? (f.classList.add("cell-focus"), f.setAttribute("aria-selected", "true")) : f.setAttribute("aria-selected", "false");
820
- const C = d.cellClass;
821
- if (C)
848
+ p.type === "date" ? f.textContent = Oe(g) : p.type === "boolean" ? f.innerHTML = He(!!g) : f.textContent = g == null ? "" : String(g);
849
+ if (v) {
850
+ rt(f);
851
+ const b = f.textContent || "";
852
+ /Proxy|Reflect\.ownKeys/.test(b) && (f.textContent = b.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(f.textContent || "") && (f.textContent = ""));
853
+ }
854
+ f.hasAttribute("data-blocked-template") && (f.textContent || "").trim().length && (f.textContent = ""), p.editable ? f.tabIndex = 0 : p.type === "boolean" && (f.hasAttribute("tabindex") || (f.tabIndex = 0)), s === n && l === u ? (f.classList.add("cell-focus"), f.setAttribute("aria-selected", "true")) : f.setAttribute("aria-selected", "false");
855
+ const T = p.cellClass;
856
+ if (T)
822
857
  try {
823
- const w = o[d.field], v = C(w, o, d);
824
- if (v && v.length > 0) {
825
- const S = v.filter((b) => b && typeof b == "string");
826
- S.forEach((b) => f.classList.add(b)), f.setAttribute("data-dynamic-classes", S.join(" "));
858
+ const b = o[p.field], y = T(b, o, p);
859
+ if (y && y.length > 0) {
860
+ const E = y.filter((C) => C && typeof C == "string");
861
+ E.forEach((C) => f.classList.add(C)), f.setAttribute("data-dynamic-classes", E.join(" "));
827
862
  }
828
- } catch (w) {
829
- console.warn(`[tbw-grid] cellClass callback error for column '${d.field}':`, w);
863
+ } catch (b) {
864
+ console.warn(`[tbw-grid] cellClass callback error for column '${p.field}':`, b);
830
865
  }
831
- a.appendChild(f);
832
- }
833
- e.appendChild(a);
866
+ a && t._afterCellRender?.({
867
+ row: o,
868
+ rowIndex: n,
869
+ column: p,
870
+ colIndex: u,
871
+ value: g,
872
+ cellElement: f,
873
+ rowElement: e
874
+ }), h.appendChild(f);
875
+ }
876
+ e.appendChild(h);
834
877
  }
835
- function pe(t, e, o) {
878
+ function me(t, e, o) {
836
879
  if (e.target?.closest(".resize-handle")) return;
837
- const n = o.querySelector(".cell[data-row]"), i = Le(n);
880
+ const n = o.querySelector(".cell[data-row]"), i = De(n);
838
881
  if (i < 0) return;
839
882
  const r = t._rows[i];
840
883
  if (!r || t._dispatchRowClick?.(e, i, r, o))
@@ -847,30 +890,30 @@ function pe(t, e, o) {
847
890
  return;
848
891
  const c = t._focusRow !== i || t._focusCol !== l;
849
892
  if (t._focusRow = i, t._focusCol = l, s.classList.contains("editing")) {
850
- c && (se(t._bodyEl ?? t), s.classList.add("cell-focus"));
851
- const a = s.querySelector(Oe);
893
+ c && (ae(t._bodyEl ?? t), s.classList.add("cell-focus"));
894
+ const a = s.querySelector(ze);
852
895
  try {
853
896
  a?.focus({ preventScroll: !0 });
854
897
  } catch {
855
898
  }
856
899
  return;
857
900
  }
858
- W(t);
901
+ $(t);
859
902
  }
860
903
  }
861
904
  }
862
- function ct(t, e) {
905
+ function ut(t, e) {
863
906
  if (t._dispatchKeyDown?.(e))
864
907
  return;
865
908
  const o = t._rows.length - 1, n = t._visibleColumns.length - 1, i = t._activeEditRows !== void 0 && t._activeEditRows !== -1, s = t._visibleColumns[t._focusCol]?.type, l = e.composedPath?.() ?? [], c = l.length ? l[0] : e.target, a = (h) => {
866
909
  if (!h) return !1;
867
- const d = h.tagName;
868
- return !!(d === "INPUT" || d === "SELECT" || d === "TEXTAREA" || h.isContentEditable);
910
+ const u = h.tagName;
911
+ return !!(u === "INPUT" || u === "SELECT" || u === "TEXTAREA" || h.isContentEditable);
869
912
  };
870
913
  if (!(a(c) && (e.key === "Home" || e.key === "End")) && !(a(c) && (e.key === "ArrowUp" || e.key === "ArrowDown") && c.tagName === "INPUT" && c.type === "number") && !(a(c) && (e.key === "ArrowLeft" || e.key === "ArrowRight")) && !(a(c) && (e.key === "Enter" || e.key === "Escape")) && !(i && s === "select" && (e.key === "ArrowDown" || e.key === "ArrowUp"))) {
871
914
  switch (e.key) {
872
915
  case "Tab": {
873
- e.preventDefault(), !e.shiftKey ? t._focusCol < n ? t._focusCol += 1 : (typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow < o && (t._focusRow += 1, t._focusCol = 0)) : t._focusCol > 0 ? t._focusCol -= 1 : t._focusRow > 0 && (typeof t.commitActiveRowEdit == "function" && t._activeEditRows === t._focusRow && t.commitActiveRowEdit(), t._focusRow -= 1, t._focusCol = n), W(t);
916
+ e.preventDefault(), !e.shiftKey ? t._focusCol < n ? t._focusCol += 1 : (typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow < o && (t._focusRow += 1, t._focusCol = 0)) : t._focusCol > 0 ? t._focusCol -= 1 : t._focusRow > 0 && (typeof t.commitActiveRowEdit == "function" && t._activeEditRows === t._focusRow && t.commitActiveRowEdit(), t._focusRow -= 1, t._focusCol = n), $(t);
874
917
  return;
875
918
  }
876
919
  case "ArrowDown":
@@ -886,10 +929,10 @@ function ct(t, e) {
886
929
  t._focusCol = Math.max(0, t._focusCol - 1), e.preventDefault();
887
930
  break;
888
931
  case "Home":
889
- (e.ctrlKey || e.metaKey) && (i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(), W(t, { forceScrollLeft: !0 });
932
+ (e.ctrlKey || e.metaKey) && (i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(), $(t, { forceScrollLeft: !0 });
890
933
  return;
891
934
  case "End":
892
- (e.ctrlKey || e.metaKey) && (i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = o), t._focusCol = n, e.preventDefault(), W(t, { forceScrollRight: !0 });
935
+ (e.ctrlKey || e.metaKey) && (i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = o), t._focusCol = n, e.preventDefault(), $(t, { forceScrollRight: !0 });
893
936
  return;
894
937
  case "PageDown":
895
938
  t._focusRow = Math.min(o, t._focusRow + 20), e.preventDefault();
@@ -898,27 +941,27 @@ function ct(t, e) {
898
941
  t._focusRow = Math.max(0, t._focusRow - 20), e.preventDefault();
899
942
  break;
900
943
  case "Enter": {
901
- const h = t._focusRow, d = t._focusCol, f = t._visibleColumns[d], p = t._rows[h], u = f?.field ?? "", g = u && p ? p[u] : void 0, m = t.querySelector(
902
- `[data-row="${h}"][data-col="${d}"]`
903
- ), y = {
944
+ const h = t._focusRow, u = t._focusCol, p = t._visibleColumns[u], f = t._rows[h], g = p?.field ?? "", d = g && f ? f[g] : void 0, w = t.querySelector(
945
+ `[data-row="${h}"][data-col="${u}"]`
946
+ ), m = {
904
947
  rowIndex: h,
905
- colIndex: d,
906
- field: u,
907
- value: g,
908
- row: p,
909
- cellEl: m,
948
+ colIndex: u,
949
+ field: g,
950
+ value: d,
951
+ row: f,
952
+ cellEl: w,
910
953
  trigger: "keyboard",
911
954
  originalEvent: e
912
955
  }, R = new CustomEvent("cell-activate", {
913
956
  cancelable: !0,
914
- detail: y
957
+ detail: m
915
958
  });
916
959
  t.dispatchEvent(R);
917
- const C = new CustomEvent("activate-cell", {
960
+ const v = new CustomEvent("activate-cell", {
918
961
  cancelable: !0,
919
- detail: { row: h, col: d }
962
+ detail: { row: h, col: u }
920
963
  });
921
- if (t.dispatchEvent(C), R.defaultPrevented || C.defaultPrevented) {
964
+ if (t.dispatchEvent(v), R.defaultPrevented || v.defaultPrevented) {
922
965
  e.preventDefault();
923
966
  return;
924
967
  }
@@ -927,19 +970,19 @@ function ct(t, e) {
927
970
  default:
928
971
  return;
929
972
  }
930
- W(t);
973
+ $(t);
931
974
  }
932
975
  }
933
- function W(t, e) {
976
+ function $(t, e) {
934
977
  if (t._virtualization?.enabled) {
935
978
  const { rowHeight: s, container: l, viewportEl: c } = t._virtualization, a = l, h = c?.clientHeight ?? a?.clientHeight ?? 0;
936
979
  if (a && h > 0) {
937
- const d = t._focusRow * s;
938
- d < a.scrollTop ? a.scrollTop = d : d + s > a.scrollTop + h && (a.scrollTop = d - h + s);
980
+ const u = t._focusRow * s;
981
+ u < a.scrollTop ? a.scrollTop = u : u + s > a.scrollTop + h && (a.scrollTop = u - h + s);
939
982
  }
940
983
  }
941
984
  const o = t._activeEditRows !== void 0 && t._activeEditRows !== -1;
942
- o || t.refreshVirtualWindow(!1), se(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
985
+ o || t.refreshVirtualWindow(!1), ae(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
943
986
  s.setAttribute("aria-selected", "false");
944
987
  });
945
988
  const n = t._focusRow, i = t._virtualization.start ?? 0, r = t._virtualization.end ?? t._rows.length;
@@ -957,12 +1000,12 @@ function W(t, e) {
957
1000
  else {
958
1001
  const a = t._getHorizontalScrollOffsets?.(s ?? void 0, l) ?? { left: 0, right: 0 };
959
1002
  if (!a.skipScroll) {
960
- const h = l.getBoundingClientRect(), d = c.getBoundingClientRect(), f = h.left - d.left + c.scrollLeft, p = f + h.width, u = c.scrollLeft + a.left, g = c.scrollLeft + c.clientWidth - a.right;
961
- f < u ? c.scrollLeft = f - a.left : p > g && (c.scrollLeft = p - c.clientWidth + a.right);
1003
+ const h = l.getBoundingClientRect(), u = c.getBoundingClientRect(), p = h.left - u.left + c.scrollLeft, f = p + h.width, g = c.scrollLeft + a.left, d = c.scrollLeft + c.clientWidth - a.right;
1004
+ p < g ? c.scrollLeft = p - a.left : f > d && (c.scrollLeft = f - c.clientWidth + a.right);
962
1005
  }
963
1006
  }
964
1007
  if (t._activeEditRows !== void 0 && t._activeEditRows !== -1 && l.classList.contains("editing")) {
965
- const a = l.querySelector(Oe);
1008
+ const a = l.querySelector(ze);
966
1009
  if (a && document.activeElement !== a)
967
1010
  try {
968
1011
  a.focus({ preventScroll: !0 });
@@ -978,28 +1021,28 @@ function W(t, e) {
978
1021
  }
979
1022
  }
980
1023
  }
981
- const K = /* @__PURE__ */ new WeakMap();
982
- function dt(t, e) {
983
- const o = Le(e), n = rt(e);
984
- o < 0 || n < 0 || (t._focusRow = o, t._focusCol = n, se(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
1024
+ const Z = /* @__PURE__ */ new WeakMap();
1025
+ function ft(t, e) {
1026
+ const o = De(e), n = at(e);
1027
+ o < 0 || n < 0 || (t._focusRow = o, t._focusCol = n, ae(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
985
1028
  }
986
- function le(t, e, o, n) {
1029
+ function ce(t, e, o, n) {
987
1030
  let i = null;
988
1031
  const r = o.composedPath?.();
989
1032
  if (r && r.length > 0 ? i = r[0] : i = o.target, i && !e.contains(i)) {
990
- const g = document.elementFromPoint(o.clientX, o.clientY);
991
- g && (i = g);
1033
+ const d = document.elementFromPoint(o.clientX, o.clientY);
1034
+ d && (i = d);
992
1035
  }
993
1036
  const s = i?.closest?.("[data-col]"), l = i?.closest?.(".data-grid-row"), c = i?.closest?.(".header-row");
994
- let a, h, d, f, p, u;
995
- return s && (a = parseInt(s.getAttribute("data-row") ?? "-1", 10), h = parseInt(s.getAttribute("data-col") ?? "-1", 10), a >= 0 && h >= 0 && (d = t._rows[a], u = t._columns[h], f = u?.field, p = d && f ? d[f] : void 0)), {
1037
+ let a, h, u, p, f, g;
1038
+ return s && (a = parseInt(s.getAttribute("data-row") ?? "-1", 10), h = parseInt(s.getAttribute("data-col") ?? "-1", 10), a >= 0 && h >= 0 && (u = t._rows[a], g = t._columns[h], p = g?.field, f = u && p ? u[p] : void 0)), {
996
1039
  type: n,
997
- row: d,
1040
+ row: u,
998
1041
  rowIndex: a !== void 0 && a >= 0 ? a : void 0,
999
1042
  colIndex: h !== void 0 && h >= 0 ? h : void 0,
1000
- field: f,
1001
- value: p,
1002
- column: u,
1043
+ field: p,
1044
+ value: f,
1045
+ column: g,
1003
1046
  originalEvent: o,
1004
1047
  cellElement: s ?? void 0,
1005
1048
  rowElement: l ?? void 0,
@@ -1007,82 +1050,82 @@ function le(t, e, o, n) {
1007
1050
  cell: a !== void 0 && h !== void 0 && a >= 0 && h >= 0 ? { row: a, col: h } : void 0
1008
1051
  };
1009
1052
  }
1010
- function ht(t, e, o) {
1011
- const n = le(t, e, o, "mousedown");
1012
- (t._dispatchCellMouseDown?.(n) ?? !1) && K.set(t, !0);
1053
+ function pt(t, e, o) {
1054
+ const n = ce(t, e, o, "mousedown");
1055
+ (t._dispatchCellMouseDown?.(n) ?? !1) && Z.set(t, !0);
1013
1056
  }
1014
- function ut(t, e, o) {
1015
- if (!K.get(t)) return;
1016
- const n = le(t, e, o, "mousemove");
1057
+ function gt(t, e, o) {
1058
+ if (!Z.get(t)) return;
1059
+ const n = ce(t, e, o, "mousemove");
1017
1060
  t._dispatchCellMouseMove?.(n);
1018
1061
  }
1019
- function ft(t, e, o) {
1020
- if (!K.get(t)) return;
1021
- const n = le(t, e, o, "mouseup");
1022
- t._dispatchCellMouseUp?.(n), K.set(t, !1);
1062
+ function wt(t, e, o) {
1063
+ if (!Z.get(t)) return;
1064
+ const n = ce(t, e, o, "mouseup");
1065
+ t._dispatchCellMouseUp?.(n), Z.set(t, !1);
1023
1066
  }
1024
- function pt(t, e, o) {
1067
+ function mt(t, e, o) {
1025
1068
  e.addEventListener(
1026
1069
  "mousedown",
1027
1070
  (n) => {
1028
1071
  const i = n.target.closest(".cell[data-col]");
1029
- i && (i.classList.contains("editing") || dt(t, i));
1072
+ i && (i.classList.contains("editing") || ft(t, i));
1030
1073
  },
1031
1074
  { signal: o }
1032
1075
  ), e.addEventListener(
1033
1076
  "click",
1034
1077
  (n) => {
1035
1078
  const i = n.target.closest(".data-grid-row");
1036
- i && pe(t, n, i);
1079
+ i && me(t, n, i);
1037
1080
  },
1038
1081
  { signal: o }
1039
1082
  ), e.addEventListener(
1040
1083
  "dblclick",
1041
1084
  (n) => {
1042
1085
  const i = n.target.closest(".data-grid-row");
1043
- i && pe(t, n, i);
1086
+ i && me(t, n, i);
1044
1087
  },
1045
1088
  { signal: o }
1046
1089
  );
1047
1090
  }
1048
- function gt(t, e, o, n) {
1049
- e.addEventListener("keydown", (i) => ct(t, i), { signal: n }), o.addEventListener("mousedown", (i) => ht(t, o, i), { signal: n }), document.addEventListener("mousemove", (i) => ut(t, o, i), { signal: n }), document.addEventListener("mouseup", (i) => ft(t, o, i), { signal: n });
1091
+ function bt(t, e, o, n) {
1092
+ e.addEventListener("keydown", (i) => ut(t, i), { signal: n }), o.addEventListener("mousedown", (i) => pt(t, o, i), { signal: n }), document.addEventListener("mousemove", (i) => gt(t, o, i), { signal: n }), document.addEventListener("mouseup", (i) => wt(t, o, i), { signal: n });
1050
1093
  }
1051
- function wt(t, e) {
1094
+ function vt(t, e) {
1052
1095
  return t == null && e == null ? 0 : t == null ? -1 : e == null || t > e ? 1 : t < e ? -1 : 0;
1053
1096
  }
1054
- function mt(t, e, o) {
1055
- const i = o.find((l) => l.field === e.field)?.sortComparator ?? wt, { field: r, direction: s } = e;
1097
+ function Ct(t, e, o) {
1098
+ const i = o.find((l) => l.field === e.field)?.sortComparator ?? vt, { field: r, direction: s } = e;
1056
1099
  return [...t].sort((l, c) => i(l[r], c[r], l, c) * s);
1057
1100
  }
1058
- function ge(t, e, o, n) {
1059
- t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((i) => i.__epoch = -1), Z(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
1101
+ function be(t, e, o, n) {
1102
+ t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((i) => i.__epoch = -1), J(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
1060
1103
  new CustomEvent("sort-change", { detail: { field: o.field, direction: n } })
1061
1104
  ), t.requestStateChange?.();
1062
1105
  }
1063
- function we(t, e) {
1064
- !t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), me(t, e, 1)) : t._sortState.direction === 1 ? me(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), t._rows = t.__originalOrder.slice(), Z(t), t._headerRowEl?.querySelectorAll('[role="columnheader"].sortable')?.forEach((n) => {
1106
+ function ve(t, e) {
1107
+ !t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), Ce(t, e, 1)) : t._sortState.direction === 1 ? Ce(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), t._rows = t.__originalOrder.slice(), J(t), t._headerRowEl?.querySelectorAll('[role="columnheader"].sortable')?.forEach((n) => {
1065
1108
  n.getAttribute("aria-sort") ? (n.getAttribute("aria-sort") === "ascending" || n.getAttribute("aria-sort") === "descending") && (t._sortState || n.setAttribute("aria-sort", "none")) : n.setAttribute("aria-sort", "none");
1066
1109
  }), t.refreshVirtualWindow(!0), t.dispatchEvent(
1067
1110
  new CustomEvent("sort-change", { detail: { field: e.field, direction: 0 } })
1068
1111
  ), t.requestStateChange?.());
1069
1112
  }
1070
- function me(t, e, o) {
1113
+ function Ce(t, e, o) {
1071
1114
  t._sortState = { field: e.field, direction: o };
1072
- const n = { field: e.field, direction: o }, i = t._columns, s = (t.effectiveConfig?.sortHandler ?? mt)(t._rows, n, i);
1115
+ const n = { field: e.field, direction: o }, i = t._columns, s = (t.effectiveConfig?.sortHandler ?? Ct)(t._rows, n, i);
1073
1116
  s && typeof s.then == "function" ? s.then((l) => {
1074
- ge(t, l, e, o);
1075
- }) : ge(t, s, e, o);
1117
+ be(t, l, e, o);
1118
+ }) : be(t, s, e, o);
1076
1119
  }
1077
- function bt(t, e) {
1120
+ function yt(t, e) {
1078
1121
  typeof e == "string" ? t.textContent = e : e instanceof HTMLElement && (t.innerHTML = "", t.appendChild(e.cloneNode(!0)));
1079
1122
  }
1080
- function Z(t) {
1123
+ function J(t) {
1081
1124
  t._headerRowEl = t.findHeaderRow();
1082
1125
  const e = t._headerRowEl;
1083
1126
  e && (e.innerHTML = "", t._visibleColumns.forEach((o, n) => {
1084
1127
  const i = document.createElement("div");
1085
- i.className = "cell", de(i, "header-cell"), i.setAttribute("role", "columnheader"), i.setAttribute("aria-colindex", String(n + 1)), i.setAttribute("data-field", o.field), i.setAttribute("data-col", String(n));
1128
+ i.className = "cell", fe(i, "header-cell"), i.setAttribute("role", "columnheader"), i.setAttribute("aria-colindex", String(n + 1)), i.setAttribute("data-field", o.field), i.setAttribute("data-col", String(n));
1086
1129
  const r = o.__headerTemplate;
1087
1130
  if (r) Array.from(r.childNodes).forEach((s) => i.appendChild(s.cloneNode(!0)));
1088
1131
  else {
@@ -1092,14 +1135,14 @@ function Z(t) {
1092
1135
  if (o.sortable) {
1093
1136
  i.classList.add("sortable"), i.tabIndex = 0;
1094
1137
  const s = document.createElement("span");
1095
- de(s, "sort-indicator");
1096
- const l = t._sortState?.field === o.field ? t._sortState.direction : 0, c = { ...M, ...t.icons }, a = l === 1 ? c.sortAsc : l === -1 ? c.sortDesc : c.sortNone;
1097
- bt(s, a), i.appendChild(s), i.setAttribute("aria-sort", l === 0 ? "none" : l === 1 ? "ascending" : "descending"), i.addEventListener("click", (h) => {
1098
- t._resizeController?.isResizing || t._dispatchHeaderClick?.(h, n, i) || we(t, o);
1138
+ fe(s, "sort-indicator");
1139
+ const l = t._sortState?.field === o.field ? t._sortState.direction : 0, c = { ...z, ...t.icons }, a = l === 1 ? c.sortAsc : l === -1 ? c.sortDesc : c.sortNone;
1140
+ yt(s, a), i.appendChild(s), i.setAttribute("aria-sort", l === 0 ? "none" : l === 1 ? "ascending" : "descending"), i.addEventListener("click", (h) => {
1141
+ t._resizeController?.isResizing || t._dispatchHeaderClick?.(h, n, i) || ve(t, o);
1099
1142
  }), i.addEventListener("keydown", (h) => {
1100
1143
  if (h.key === "Enter" || h.key === " ") {
1101
1144
  if (h.preventDefault(), t._dispatchHeaderClick?.(h, n, i)) return;
1102
- we(t, o);
1145
+ ve(t, o);
1103
1146
  }
1104
1147
  });
1105
1148
  }
@@ -1117,9 +1160,9 @@ function Z(t) {
1117
1160
  o.getAttribute("aria-sort") || o.setAttribute("aria-sort", "none");
1118
1161
  }), e.children.length > 0 ? (e.setAttribute("role", "row"), e.setAttribute("aria-rowindex", "1")) : (e.removeAttribute("role"), e.removeAttribute("aria-rowindex")));
1119
1162
  }
1120
- const ze = typeof requestIdleCallback == "function";
1121
- function Ct(t, e) {
1122
- return ze ? requestIdleCallback(t, e) : window.setTimeout(() => {
1163
+ const Ie = typeof requestIdleCallback == "function";
1164
+ function _t(t, e) {
1165
+ return Ie ? requestIdleCallback(t, e) : window.setTimeout(() => {
1123
1166
  const o = Date.now();
1124
1167
  t({
1125
1168
  didTimeout: !1,
@@ -1127,20 +1170,20 @@ function Ct(t, e) {
1127
1170
  });
1128
1171
  }, 1);
1129
1172
  }
1130
- function be(t) {
1131
- ze ? cancelIdleCallback(t) : clearTimeout(t);
1173
+ function ye(t) {
1174
+ Ie ? cancelIdleCallback(t) : clearTimeout(t);
1132
1175
  }
1133
1176
  var x = ((t) => (t[t.STYLE = 1] = "STYLE", t[t.VIRTUALIZATION = 2] = "VIRTUALIZATION", t[t.HEADER = 3] = "HEADER", t[t.ROWS = 4] = "ROWS", t[t.COLUMNS = 5] = "COLUMNS", t[t.FULL = 6] = "FULL", t))(x || {});
1134
- class vt {
1135
- #o;
1177
+ class Et {
1178
+ #n;
1136
1179
  #c = 0;
1137
1180
  #f = 0;
1138
1181
  #d = null;
1139
1182
  #s = null;
1140
- #n = null;
1183
+ #i = null;
1141
1184
  #h = !1;
1142
1185
  constructor(e) {
1143
- this.#o = e;
1186
+ this.#n = e;
1144
1187
  }
1145
1188
  requestPhase(e, o) {
1146
1189
  e > this.#c && (this.#c = e), this.#f === 0 && (this.#u(), this.#f = requestAnimationFrame(() => this.#m()));
@@ -1149,7 +1192,7 @@ class vt {
1149
1192
  return this.#d ? this.#d : Promise.resolve();
1150
1193
  }
1151
1194
  setInitialReadyResolver(e) {
1152
- this.#n = e;
1195
+ this.#i = e;
1153
1196
  }
1154
1197
  cancel() {
1155
1198
  this.#f !== 0 && (cancelAnimationFrame(this.#f), this.#f = 0), this.#c = 0, this.#s && (this.#s(), this.#s = null, this.#d = null);
@@ -1166,23 +1209,23 @@ class vt {
1166
1209
  }));
1167
1210
  }
1168
1211
  #m() {
1169
- if (this.#f = 0, !this.#o.isConnected()) {
1212
+ if (this.#f = 0, !this.#n.isConnected()) {
1170
1213
  this.#c = 0, this.#s && (this.#s(), this.#s = null, this.#d = null);
1171
1214
  return;
1172
1215
  }
1173
1216
  const e = this.#c;
1174
- this.#c = 0, e >= 5 && this.#o.mergeConfig(), e >= 4 && this.#o.processRows(), e >= 5 && (this.#o.processColumns(), this.#o.updateTemplate()), e >= 3 && this.#o.renderHeader(), e >= 2 && this.#o.renderVirtualWindow(), e >= 1 && this.#o.afterRender(), !this.#h && this.#n && (this.#h = !0, this.#n()), this.#s && (this.#s(), this.#s = null, this.#d = null);
1217
+ this.#c = 0, e >= 5 && this.#n.mergeConfig(), e >= 4 && this.#n.processRows(), e >= 5 && (this.#n.processColumns(), this.#n.updateTemplate()), e >= 3 && this.#n.renderHeader(), e >= 2 && this.#n.renderVirtualWindow(), e >= 1 && this.#n.afterRender(), !this.#h && this.#i && (this.#h = !0, this.#i()), this.#s && (this.#s(), this.#s = null, this.#d = null);
1175
1218
  }
1176
1219
  }
1177
- function Ce(t) {
1220
+ function _e(t) {
1178
1221
  let e = null, o = null, n = null, i = null;
1179
1222
  const r = (c) => {
1180
1223
  if (!e) return;
1181
- const a = c.clientX - e.startX, h = Math.max(40, e.startWidth + a), d = t._visibleColumns[e.colIndex];
1182
- d.width = h, d.__userResized = !0, d.__renderedWidth = h, o == null && (o = requestAnimationFrame(() => {
1224
+ const a = c.clientX - e.startX, h = Math.max(40, e.startWidth + a), u = t._visibleColumns[e.colIndex];
1225
+ u.width = h, u.__userResized = !0, u.__renderedWidth = h, o == null && (o = requestAnimationFrame(() => {
1183
1226
  o = null, t.updateTemplate?.();
1184
1227
  })), t.dispatchEvent(
1185
- new CustomEvent("column-resize", { detail: { field: d.field, width: h } })
1228
+ new CustomEvent("column-resize", { detail: { field: u.field, width: h } })
1186
1229
  );
1187
1230
  };
1188
1231
  let s = !1;
@@ -1198,8 +1241,8 @@ function Ce(t) {
1198
1241
  },
1199
1242
  start(c, a, h) {
1200
1243
  c.preventDefault();
1201
- const d = t._visibleColumns[a], f = typeof d?.width == "number" ? d.width : void 0, p = d?.__renderedWidth ?? f ?? h.getBoundingClientRect().width;
1202
- e = { startX: c.clientX, colIndex: a, startWidth: p }, window.addEventListener("mousemove", r), window.addEventListener("mouseup", l), n === null && (n = document.documentElement.style.cursor), document.documentElement.style.cursor = "e-resize", i === null && (i = document.body.style.userSelect), document.body.style.userSelect = "none";
1244
+ const u = t._visibleColumns[a], p = typeof u?.width == "number" ? u.width : void 0, f = u?.__renderedWidth ?? p ?? h.getBoundingClientRect().width;
1245
+ e = { startX: c.clientX, colIndex: a, startWidth: f }, window.addEventListener("mousemove", r), window.addEventListener("mouseup", l), n === null && (n = document.documentElement.style.cursor), document.documentElement.style.cursor = "e-resize", i === null && (i = document.body.style.userSelect), document.body.style.userSelect = "none";
1203
1246
  },
1204
1247
  resetColumn(c) {
1205
1248
  const a = t._visibleColumns[c];
@@ -1212,7 +1255,55 @@ function Ce(t) {
1212
1255
  }
1213
1256
  };
1214
1257
  }
1215
- function X(t, e, o) {
1258
+ const ne = "data-animating", St = {
1259
+ change: "--tbw-row-change-duration",
1260
+ insert: "--tbw-row-insert-duration",
1261
+ remove: "--tbw-row-remove-duration"
1262
+ }, Rt = {
1263
+ change: 500,
1264
+ insert: 300,
1265
+ remove: 200
1266
+ };
1267
+ function Tt(t) {
1268
+ const e = t.trim().toLowerCase();
1269
+ return e.endsWith("ms") ? parseFloat(e) : e.endsWith("s") ? parseFloat(e) * 1e3 : parseFloat(e);
1270
+ }
1271
+ function xt(t, e) {
1272
+ const o = St[e], n = getComputedStyle(t).getPropertyValue(o);
1273
+ if (n) {
1274
+ const i = Tt(n);
1275
+ if (!isNaN(i) && i > 0)
1276
+ return i;
1277
+ }
1278
+ return Rt[e];
1279
+ }
1280
+ function At(t, e, o) {
1281
+ t.removeAttribute(ne), t.offsetWidth, t.setAttribute(ne, e);
1282
+ const n = xt(t, e);
1283
+ setTimeout(() => {
1284
+ e !== "remove" && t.removeAttribute(ne);
1285
+ }, n);
1286
+ }
1287
+ function de(t, e, o) {
1288
+ if (e < 0)
1289
+ return !1;
1290
+ const n = t.findRenderedRowElement?.(e);
1291
+ return n ? (At(n, o), !0) : !1;
1292
+ }
1293
+ function Pt(t, e, o) {
1294
+ let n = 0;
1295
+ for (const i of e)
1296
+ de(t, i, o) && n++;
1297
+ return n;
1298
+ }
1299
+ function Lt(t, e, o) {
1300
+ const n = t._rows ?? [], i = t.getRowId;
1301
+ if (!i)
1302
+ return !1;
1303
+ const r = n.findIndex((s) => i(s) === e);
1304
+ return r < 0 ? !1 : de(t, r, o);
1305
+ }
1306
+ function Y(t, e, o) {
1216
1307
  const n = document.createElement(t);
1217
1308
  if (e)
1218
1309
  for (const i in e) {
@@ -1221,7 +1312,7 @@ function X(t, e, o) {
1221
1312
  }
1222
1313
  return n;
1223
1314
  }
1224
- function P(t, e) {
1315
+ function L(t, e) {
1225
1316
  const o = document.createElement("div");
1226
1317
  if (t && (o.className = t), e)
1227
1318
  for (const n in e) {
@@ -1230,7 +1321,7 @@ function P(t, e) {
1230
1321
  }
1231
1322
  return o;
1232
1323
  }
1233
- function Ne(t, e, o) {
1324
+ function qe(t, e, o) {
1234
1325
  const n = document.createElement("button");
1235
1326
  if (t && (n.className = t), e)
1236
1327
  for (const i in e) {
@@ -1239,8 +1330,8 @@ function Ne(t, e, o) {
1239
1330
  }
1240
1331
  return n;
1241
1332
  }
1242
- const Ie = document.createElement("template");
1243
- Ie.innerHTML = `
1333
+ const We = document.createElement("template");
1334
+ We.innerHTML = `
1244
1335
  <div class="tbw-scroll-area">
1245
1336
  <div class="rows-body-wrapper">
1246
1337
  <div class="rows-body" role="grid">
@@ -1259,38 +1350,38 @@ Ie.innerHTML = `
1259
1350
  <div class="faux-vscroll-spacer"></div>
1260
1351
  </div>
1261
1352
  `;
1262
- function ke() {
1263
- return Ie.content.cloneNode(!0);
1353
+ function $e() {
1354
+ return We.content.cloneNode(!0);
1264
1355
  }
1265
- function ve(t) {
1266
- const e = document.createDocumentFragment(), o = P(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
1356
+ function Ee(t) {
1357
+ const e = document.createDocumentFragment(), o = L(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
1267
1358
  if (t.hasShell && t.shellHeader && t.shellBody)
1268
1359
  o.appendChild(t.shellHeader), o.appendChild(t.shellBody);
1269
1360
  else {
1270
- const n = P("tbw-grid-content");
1271
- n.appendChild(ke()), o.appendChild(n);
1361
+ const n = L("tbw-grid-content");
1362
+ n.appendChild($e()), o.appendChild(n);
1272
1363
  }
1273
1364
  return e.appendChild(o), e;
1274
1365
  }
1275
- function yt(t) {
1276
- const e = P("tbw-shell-header", { part: "shell-header", role: "presentation" });
1366
+ function Ht(t) {
1367
+ const e = L("tbw-shell-header", { part: "shell-header", role: "presentation" });
1277
1368
  if (t.title) {
1278
- const r = P("tbw-shell-title");
1369
+ const r = L("tbw-shell-title");
1279
1370
  r.textContent = t.title, e.appendChild(r);
1280
1371
  }
1281
- const o = P("tbw-shell-content", {
1372
+ const o = L("tbw-shell-content", {
1282
1373
  part: "shell-content",
1283
1374
  role: "presentation",
1284
1375
  "data-light-dom-header-content": ""
1285
1376
  });
1286
1377
  e.appendChild(o);
1287
- const n = P("tbw-shell-toolbar", { part: "shell-toolbar", role: "presentation" });
1378
+ const n = L("tbw-shell-toolbar", { part: "shell-toolbar", role: "presentation" });
1288
1379
  for (const r of t.configButtons)
1289
- r.hasRender && n.appendChild(P("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1380
+ r.hasRender && n.appendChild(L("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1290
1381
  for (const r of t.apiButtons)
1291
- r.hasRender && n.appendChild(P("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1292
- if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && n.appendChild(P("tbw-toolbar-separator")), t.hasPanels) {
1293
- const r = Ne(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
1382
+ r.hasRender && n.appendChild(L("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1383
+ if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && n.appendChild(L("tbw-toolbar-separator")), t.hasPanels) {
1384
+ const r = qe(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
1294
1385
  "data-panel-toggle": "",
1295
1386
  title: "Settings",
1296
1387
  "aria-label": "Toggle settings panel",
@@ -1301,12 +1392,12 @@ function yt(t) {
1301
1392
  }
1302
1393
  return e.appendChild(n), e;
1303
1394
  }
1304
- function _t(t) {
1305
- const e = P("tbw-shell-body"), o = t.panels.length > 0, n = t.panels.length === 1, i = P("tbw-grid-content");
1306
- i.appendChild(ke());
1395
+ function Ot(t) {
1396
+ const e = L("tbw-shell-body"), o = t.panels.length > 0, n = t.panels.length === 1, i = L("tbw-grid-content");
1397
+ i.appendChild($e());
1307
1398
  let r = null;
1308
1399
  if (o) {
1309
- r = X("aside", {
1400
+ r = Y("aside", {
1310
1401
  class: t.isPanelOpen ? "tbw-tool-panel open" : "tbw-tool-panel",
1311
1402
  part: "tool-panel",
1312
1403
  "data-position": t.position,
@@ -1315,42 +1406,42 @@ function _t(t) {
1315
1406
  });
1316
1407
  const s = t.position === "left" ? "right" : "left";
1317
1408
  r.appendChild(
1318
- P("tbw-tool-panel-resize", {
1409
+ L("tbw-tool-panel-resize", {
1319
1410
  "data-resize-handle": "",
1320
1411
  "data-handle-position": s,
1321
1412
  "aria-hidden": "true"
1322
1413
  })
1323
1414
  );
1324
- const l = P("tbw-tool-panel-content", { role: "presentation" }), c = P("tbw-accordion");
1415
+ const l = L("tbw-tool-panel-content", { role: "presentation" }), c = L("tbw-accordion");
1325
1416
  for (const a of t.panels) {
1326
- const h = `tbw-accordion-section${a.isExpanded ? " expanded" : ""}${n ? " single" : ""}`, d = P(h, { "data-section": a.id }), f = Ne("tbw-accordion-header", {
1417
+ const h = `tbw-accordion-section${a.isExpanded ? " expanded" : ""}${n ? " single" : ""}`, u = L(h, { "data-section": a.id }), p = qe("tbw-accordion-header", {
1327
1418
  "aria-expanded": String(a.isExpanded),
1328
1419
  "aria-controls": `tbw-section-${a.id}`
1329
1420
  });
1330
- if (n && f.setAttribute("aria-disabled", "true"), a.icon) {
1331
- const u = X("span", { class: "tbw-accordion-icon" });
1332
- u.innerHTML = a.icon, f.appendChild(u);
1421
+ if (n && p.setAttribute("aria-disabled", "true"), a.icon) {
1422
+ const g = Y("span", { class: "tbw-accordion-icon" });
1423
+ g.innerHTML = a.icon, p.appendChild(g);
1333
1424
  }
1334
- const p = X("span", { class: "tbw-accordion-title" });
1335
- if (p.textContent = a.title, f.appendChild(p), !n) {
1336
- const u = X("span", { class: "tbw-accordion-chevron" });
1337
- u.innerHTML = a.isExpanded ? t.collapseIcon : t.expandIcon, f.appendChild(u);
1425
+ const f = Y("span", { class: "tbw-accordion-title" });
1426
+ if (f.textContent = a.title, p.appendChild(f), !n) {
1427
+ const g = Y("span", { class: "tbw-accordion-chevron" });
1428
+ g.innerHTML = a.isExpanded ? t.collapseIcon : t.expandIcon, p.appendChild(g);
1338
1429
  }
1339
- d.appendChild(f), d.appendChild(
1340
- P("tbw-accordion-content", {
1430
+ u.appendChild(p), u.appendChild(
1431
+ L("tbw-accordion-content", {
1341
1432
  id: `tbw-section-${a.id}`,
1342
1433
  role: "presentation"
1343
1434
  })
1344
- ), c.appendChild(d);
1435
+ ), c.appendChild(u);
1345
1436
  }
1346
1437
  l.appendChild(c), r.appendChild(l);
1347
1438
  }
1348
1439
  return t.position === "left" && r ? (e.appendChild(r), e.appendChild(i)) : (e.appendChild(i), r && e.appendChild(r)), e;
1349
1440
  }
1350
- function N(t) {
1441
+ function k(t) {
1351
1442
  return t ? typeof t == "string" ? t : t.outerHTML : "";
1352
1443
  }
1353
- function Et() {
1444
+ function Dt() {
1354
1445
  return {
1355
1446
  toolPanels: /* @__PURE__ */ new Map(),
1356
1447
  headerContents: /* @__PURE__ */ new Map(),
@@ -1369,27 +1460,27 @@ function Et() {
1369
1460
  lightDomContentMoved: !1
1370
1461
  };
1371
1462
  }
1372
- function qe(t) {
1463
+ function Fe(t) {
1373
1464
  return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
1374
1465
  }
1375
- function ye(t, e, o = "☰") {
1376
- const n = t?.header?.title ?? e.lightDomTitle ?? "", i = !!n, r = N(o), s = t?.header?.toolbarContents ?? [], l = [...e.toolbarContents.values()], c = new Set(s.map((g) => g.id)), a = [...s];
1377
- for (const g of l)
1378
- c.has(g.id) || a.push(g);
1379
- const h = a.length > 0, d = e.toolPanels.size > 0, f = h && d, p = [...a].sort((g, m) => (g.order ?? 0) - (m.order ?? 0));
1380
- let u = "";
1381
- for (const g of p)
1382
- u += `<div class="tbw-toolbar-content-slot" data-toolbar-content="${g.id}"></div>`;
1383
- if (f && (u += '<div class="tbw-toolbar-separator"></div>'), d) {
1384
- const g = e.isPanelOpen;
1385
- u += `<button class="${g ? "tbw-toolbar-btn active" : "tbw-toolbar-btn"}" data-panel-toggle title="Settings" aria-label="Toggle settings panel" aria-pressed="${g}" aria-controls="tbw-tool-panel">${r}</button>`;
1466
+ function Se(t, e, o = "☰") {
1467
+ const n = t?.header?.title ?? e.lightDomTitle ?? "", i = !!n, r = k(o), s = t?.header?.toolbarContents ?? [], l = [...e.toolbarContents.values()], c = new Set(s.map((d) => d.id)), a = [...s];
1468
+ for (const d of l)
1469
+ c.has(d.id) || a.push(d);
1470
+ const h = a.length > 0, u = e.toolPanels.size > 0, p = h && u, f = [...a].sort((d, w) => (d.order ?? 0) - (w.order ?? 0));
1471
+ let g = "";
1472
+ for (const d of f)
1473
+ g += `<div class="tbw-toolbar-content-slot" data-toolbar-content="${d.id}"></div>`;
1474
+ if (p && (g += '<div class="tbw-toolbar-separator"></div>'), u) {
1475
+ const d = e.isPanelOpen;
1476
+ g += `<button class="${d ? "tbw-toolbar-btn active" : "tbw-toolbar-btn"}" data-panel-toggle title="Settings" aria-label="Toggle settings panel" aria-pressed="${d}" aria-controls="tbw-tool-panel">${r}</button>`;
1386
1477
  }
1387
1478
  return `
1388
1479
  <div class="tbw-shell-header" part="shell-header" role="presentation">
1389
- ${i ? `<div class="tbw-shell-title">${je(n)}</div>` : ""}
1480
+ ${i ? `<div class="tbw-shell-title">${Je(n)}</div>` : ""}
1390
1481
  <div class="tbw-shell-content" part="shell-content" role="presentation" data-light-dom-header-content></div>
1391
1482
  <div class="tbw-shell-toolbar" part="shell-toolbar" role="presentation">
1392
- ${u}
1483
+ ${g}
1393
1484
  </div>
1394
1485
  </div>
1395
1486
  `;
@@ -1404,7 +1495,7 @@ function I(t, e) {
1404
1495
  const n = o.querySelectorAll("tbw-grid-header-content");
1405
1496
  n.length > 0 && e.lightDomHeaderContent.length === 0 && (e.lightDomHeaderContent = Array.from(n)), o.style.display = "none";
1406
1497
  }
1407
- function k(t, e, o) {
1498
+ function q(t, e, o) {
1408
1499
  const n = t.querySelector(":scope > tbw-grid-tool-buttons");
1409
1500
  if (!n) return;
1410
1501
  e.hasToolButtonsContainer = !0;
@@ -1420,7 +1511,7 @@ function k(t, e, o) {
1420
1511
  };
1421
1512
  e.toolbarContents.set(i, r), e.lightDomToolbarContentIds.add(i), n.style.display = "none";
1422
1513
  }
1423
- function q(t, e, o) {
1514
+ function W(t, e, o) {
1424
1515
  t.querySelectorAll(":scope > tbw-grid-tool-panel").forEach((i) => {
1425
1516
  const r = i, s = r.getAttribute("id"), l = r.getAttribute("title");
1426
1517
  if (!s || !l) {
@@ -1430,38 +1521,38 @@ function q(t, e, o) {
1430
1521
  return;
1431
1522
  }
1432
1523
  const c = r.getAttribute("icon") ?? void 0, a = r.getAttribute("tooltip") ?? void 0, h = parseInt(r.getAttribute("order") ?? "100", 10);
1433
- let d;
1434
- const f = o?.(r);
1435
- if (f)
1436
- d = f;
1524
+ let u;
1525
+ const p = o?.(r);
1526
+ if (p)
1527
+ u = p;
1437
1528
  else {
1438
- const g = r.innerHTML.trim();
1439
- d = (m) => {
1440
- const y = document.createElement("div");
1441
- return y.innerHTML = g, m.appendChild(y), () => y.remove();
1529
+ const d = r.innerHTML.trim();
1530
+ u = (w) => {
1531
+ const m = document.createElement("div");
1532
+ return m.innerHTML = d, w.appendChild(m), () => m.remove();
1442
1533
  };
1443
1534
  }
1444
- const p = e.toolPanels.get(s);
1445
- if (p) {
1446
- if (f) {
1447
- p.render = d, p.order = h, p.icon = c, p.tooltip = a;
1448
- const g = e.panelCleanups.get(s);
1449
- g && (g(), e.panelCleanups.delete(s));
1535
+ const f = e.toolPanels.get(s);
1536
+ if (f) {
1537
+ if (p) {
1538
+ f.render = u, f.order = h, f.icon = c, f.tooltip = a;
1539
+ const d = e.panelCleanups.get(s);
1540
+ d && (d(), e.panelCleanups.delete(s));
1450
1541
  }
1451
1542
  return;
1452
1543
  }
1453
- const u = {
1544
+ const g = {
1454
1545
  id: s,
1455
1546
  title: l,
1456
1547
  icon: c,
1457
1548
  tooltip: a,
1458
1549
  order: h,
1459
- render: d
1550
+ render: u
1460
1551
  };
1461
- e.toolPanels.set(s, u), e.lightDomToolPanelIds.add(s), r.style.display = "none";
1552
+ e.toolPanels.set(s, g), e.lightDomToolPanelIds.add(s), r.style.display = "none";
1462
1553
  });
1463
1554
  }
1464
- function St(t, e, o, n) {
1555
+ function Mt(t, e, o, n) {
1465
1556
  const i = t.querySelector(".tbw-shell-toolbar");
1466
1557
  i && i.addEventListener("click", (s) => {
1467
1558
  if (s.target.closest("[data-panel-toggle]")) {
@@ -1478,31 +1569,31 @@ function St(t, e, o, n) {
1478
1569
  }
1479
1570
  });
1480
1571
  }
1481
- function Rt(t, e, o) {
1572
+ function zt(t, e, o) {
1482
1573
  const n = t.querySelector(".tbw-tool-panel"), i = t.querySelector("[data-resize-handle]"), r = t.querySelector(".tbw-shell-body");
1483
1574
  if (!n || !i || !r)
1484
1575
  return () => {
1485
1576
  };
1486
1577
  const s = e?.toolPanel?.position ?? "right", l = 200;
1487
- let c = 0, a = 0, h = 0, d = !1;
1488
- const f = (g) => {
1489
- if (!d) return;
1490
- g.preventDefault();
1491
- const m = s === "left" ? g.clientX - c : c - g.clientX, y = Math.min(h, Math.max(l, a + m));
1492
- n.style.width = `${y}px`;
1493
- }, p = () => {
1494
- if (!d) return;
1495
- d = !1, i.classList.remove("resizing"), n.style.transition = "", document.body.style.cursor = "", document.body.style.userSelect = "";
1496
- const g = n.getBoundingClientRect().width;
1497
- o(g), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", p);
1498
- }, u = (g) => {
1499
- g.preventDefault(), d = !0, c = g.clientX, a = n.getBoundingClientRect().width, h = r.getBoundingClientRect().width - 20, i.classList.add("resizing"), n.style.transition = "none", document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", f), document.addEventListener("mouseup", p);
1578
+ let c = 0, a = 0, h = 0, u = !1;
1579
+ const p = (d) => {
1580
+ if (!u) return;
1581
+ d.preventDefault();
1582
+ const w = s === "left" ? d.clientX - c : c - d.clientX, m = Math.min(h, Math.max(l, a + w));
1583
+ n.style.width = `${m}px`;
1584
+ }, f = () => {
1585
+ if (!u) return;
1586
+ u = !1, i.classList.remove("resizing"), n.style.transition = "", document.body.style.cursor = "", document.body.style.userSelect = "";
1587
+ const d = n.getBoundingClientRect().width;
1588
+ o(d), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", f);
1589
+ }, g = (d) => {
1590
+ d.preventDefault(), u = !0, c = d.clientX, a = n.getBoundingClientRect().width, h = r.getBoundingClientRect().width - 20, i.classList.add("resizing"), n.style.transition = "none", document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", p), document.addEventListener("mouseup", f);
1500
1591
  };
1501
- return i.addEventListener("mousedown", u), () => {
1502
- i.removeEventListener("mousedown", u), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", p);
1592
+ return i.addEventListener("mousedown", g), () => {
1593
+ i.removeEventListener("mousedown", g), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", f);
1503
1594
  };
1504
1595
  }
1505
- function _e(t, e, o) {
1596
+ function Re(t, e, o) {
1506
1597
  const n = e?.header?.toolbarContents ?? [], i = [...o.toolbarContents.values()], r = new Set(n.map((l) => l.id)), s = [...n];
1507
1598
  for (const l of i)
1508
1599
  r.has(l.id) || s.push(l);
@@ -1514,7 +1605,7 @@ function _e(t, e, o) {
1514
1605
  a && o.toolbarContentCleanups.set(l.id, a);
1515
1606
  }
1516
1607
  }
1517
- function ie(t, e) {
1608
+ function se(t, e) {
1518
1609
  const o = e.lightDomHeaderContent.length > 0 && !e.lightDomContentMoved, n = e.headerContents.size > 0;
1519
1610
  if (!o && !n) return;
1520
1611
  const i = t.querySelector(".tbw-shell-content");
@@ -1534,36 +1625,36 @@ function ie(t, e) {
1534
1625
  a && e.headerContentCleanups.set(s.id, a);
1535
1626
  }
1536
1627
  }
1537
- function Tt(t, e, o) {
1628
+ function Nt(t, e, o) {
1538
1629
  if (!e.isPanelOpen) return;
1539
- const n = N(o?.expand ?? M.expand), i = N(o?.collapse ?? M.collapse);
1630
+ const n = k(o?.expand ?? z.expand), i = k(o?.collapse ?? z.collapse);
1540
1631
  for (const [r, s] of e.toolPanels) {
1541
1632
  const l = e.expandedSections.has(r), c = t.querySelector(`[data-section="${r}"]`), a = c?.querySelector(".tbw-accordion-content");
1542
1633
  if (!c || !a) continue;
1543
1634
  c.classList.toggle("expanded", l);
1544
1635
  const h = c.querySelector(".tbw-accordion-header");
1545
1636
  h && h.setAttribute("aria-expanded", String(l));
1546
- const d = c.querySelector(".tbw-accordion-chevron");
1547
- if (d && (d.innerHTML = l ? i : n), l) {
1637
+ const u = c.querySelector(".tbw-accordion-chevron");
1638
+ if (u && (u.innerHTML = l ? i : n), l) {
1548
1639
  if (a.children.length === 0) {
1549
- const f = s.render(a);
1550
- f && e.panelCleanups.set(r, f);
1640
+ const p = s.render(a);
1641
+ p && e.panelCleanups.set(r, p);
1551
1642
  }
1552
1643
  } else {
1553
- const f = e.panelCleanups.get(r);
1554
- f && (f(), e.panelCleanups.delete(r)), a.innerHTML = "";
1644
+ const p = e.panelCleanups.get(r);
1645
+ p && (p(), e.panelCleanups.delete(r)), a.innerHTML = "";
1555
1646
  }
1556
1647
  }
1557
1648
  }
1558
- function Ee(t, e) {
1649
+ function Te(t, e) {
1559
1650
  const o = t.querySelector("[data-panel-toggle]");
1560
1651
  o && (o.classList.toggle("active", e.isPanelOpen), o.setAttribute("aria-pressed", String(e.isPanelOpen)));
1561
1652
  }
1562
- function Se(t, e) {
1653
+ function xe(t, e) {
1563
1654
  const o = t.querySelector(".tbw-tool-panel");
1564
1655
  o && (o.classList.toggle("open", e.isPanelOpen), e.isPanelOpen || (o.style.width = ""));
1565
1656
  }
1566
- function xt(t) {
1657
+ function kt(t) {
1567
1658
  for (const e of t.headerContentCleanups.values())
1568
1659
  e();
1569
1660
  t.headerContentCleanups.clear();
@@ -1580,7 +1671,7 @@ function xt(t) {
1580
1671
  t.toolPanels.get(e)?.onClose?.();
1581
1672
  t.isPanelOpen = !1, t.expandedSections.clear(), t.toolPanels.clear(), t.headerContents.clear(), t.toolbarContents.clear(), t.lightDomHeaderContent = [], t.lightDomToolPanelIds.clear(), t.lightDomToolbarContentIds.clear(), t.lightDomContentMoved = !1;
1582
1673
  }
1583
- function At(t, e) {
1674
+ function It(t, e) {
1584
1675
  let o = !1;
1585
1676
  const n = {
1586
1677
  get isInitialized() {
@@ -1609,7 +1700,7 @@ function At(t, e) {
1609
1700
  s && t.expandedSections.add(s.id);
1610
1701
  }
1611
1702
  const i = e.getShadow();
1612
- Ee(i, t), Se(i, t), Tt(i, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: n.expandedSections });
1703
+ Te(i, t), xe(i, t), Nt(i, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: n.expandedSections });
1613
1704
  },
1614
1705
  closeToolPanel() {
1615
1706
  if (!t.isPanelOpen) return;
@@ -1620,7 +1711,7 @@ function At(t, e) {
1620
1711
  r.onClose?.();
1621
1712
  t.isPanelOpen = !1;
1622
1713
  const i = e.getShadow();
1623
- Ee(i, t), Se(i, t), e.emit("tool-panel-close", {});
1714
+ Te(i, t), xe(i, t), e.emit("tool-panel-close", {});
1624
1715
  },
1625
1716
  toggleToolPanel() {
1626
1717
  t.isPanelOpen ? n.closeToolPanel() : n.openToolPanel();
@@ -1636,16 +1727,16 @@ function At(t, e) {
1636
1727
  const s = e.getShadow(), l = t.expandedSections.has(i);
1637
1728
  if (l) {
1638
1729
  const c = t.panelCleanups.get(i);
1639
- c && (c(), t.panelCleanups.delete(i)), r.onClose?.(), t.expandedSections.delete(i), oe(s, i, !1);
1730
+ c && (c(), t.panelCleanups.delete(i)), r.onClose?.(), t.expandedSections.delete(i), ie(s, i, !1);
1640
1731
  } else {
1641
1732
  for (const [c, a] of t.toolPanels)
1642
1733
  if (c !== i && t.expandedSections.has(c)) {
1643
1734
  const h = t.panelCleanups.get(c);
1644
- h && (h(), t.panelCleanups.delete(c)), a.onClose?.(), t.expandedSections.delete(c), oe(s, c, !1);
1645
- const d = s.querySelector(`[data-section="${c}"] .tbw-accordion-content`);
1646
- d && (d.innerHTML = "");
1735
+ h && (h(), t.panelCleanups.delete(c)), a.onClose?.(), t.expandedSections.delete(c), ie(s, c, !1);
1736
+ const u = s.querySelector(`[data-section="${c}"] .tbw-accordion-content`);
1737
+ u && (u.innerHTML = "");
1647
1738
  }
1648
- t.expandedSections.add(i), oe(s, i, !0), Pt(s, t, i);
1739
+ t.expandedSections.add(i), ie(s, i, !0), qt(s, t, i);
1649
1740
  }
1650
1741
  e.emit("tool-panel-section-toggle", { id: i, expanded: !l });
1651
1742
  },
@@ -1674,7 +1765,7 @@ function At(t, e) {
1674
1765
  console.warn(`[tbw-grid] Header content "${i.id}" already registered`);
1675
1766
  return;
1676
1767
  }
1677
- t.headerContents.set(i.id, i), o && ie(e.getShadow(), t);
1768
+ t.headerContents.set(i.id, i), o && se(e.getShadow(), t);
1678
1769
  },
1679
1770
  unregisterHeaderContent(i) {
1680
1771
  const r = t.headerContentCleanups.get(i);
@@ -1699,11 +1790,11 @@ function At(t, e) {
1699
1790
  };
1700
1791
  return n;
1701
1792
  }
1702
- function oe(t, e, o) {
1793
+ function ie(t, e, o) {
1703
1794
  const n = t.querySelector(`[data-section="${e}"]`);
1704
1795
  n && n.classList.toggle("expanded", o);
1705
1796
  }
1706
- function Pt(t, e, o) {
1797
+ function qt(t, e, o) {
1707
1798
  const n = e.toolPanels.get(o);
1708
1799
  if (!n?.render) return;
1709
1800
  const i = t.querySelector(`[data-section="${o}"] .tbw-accordion-content`);
@@ -1711,49 +1802,56 @@ function Pt(t, e, o) {
1711
1802
  const r = n.render(i);
1712
1803
  r && e.panelCleanups.set(o, r);
1713
1804
  }
1714
- function Lt(t, e, o, n) {
1715
- const i = qe(e), r = [], s = ["tbw-grid-header", "tbw-grid-tool-buttons", "tbw-grid-tool-panel", "tbw-grid-column"];
1805
+ function Wt(t, e, o, n) {
1806
+ const i = Fe(e), r = [], s = [
1807
+ "tbw-grid-header",
1808
+ "tbw-grid-tool-buttons",
1809
+ "tbw-grid-tool-panel",
1810
+ "tbw-grid-column",
1811
+ "tbw-grid-detail",
1812
+ "tbw-grid-responsive-card"
1813
+ ];
1716
1814
  for (const l of s)
1717
1815
  t.querySelectorAll(`:scope > ${l}`).forEach((a) => r.push(a));
1718
1816
  t.replaceChildren();
1719
1817
  for (const l of r)
1720
1818
  t.appendChild(l);
1721
1819
  if (i) {
1722
- const l = N(n?.toolPanel ?? M.toolPanel), c = N(n?.expand ?? M.expand), a = N(n?.collapse ?? M.collapse), d = [...e?.header?.toolbarContents ?? []].sort((C, w) => (C.order ?? 0) - (w.order ?? 0)), p = [...e?.toolPanels ?? []].sort((C, w) => (C.order ?? 100) - (w.order ?? 100)), u = {
1820
+ const l = k(n?.toolPanel ?? z.toolPanel), c = k(n?.expand ?? z.expand), a = k(n?.collapse ?? z.collapse), u = [...e?.header?.toolbarContents ?? []].sort((v, T) => (v.order ?? 0) - (T.order ?? 0)), f = [...e?.toolPanels ?? []].sort((v, T) => (v.order ?? 100) - (T.order ?? 100)), g = {
1723
1821
  title: e?.header?.title ?? void 0,
1724
- hasPanels: p.length > 0,
1822
+ hasPanels: f.length > 0,
1725
1823
  isPanelOpen: o.isPanelOpen,
1726
1824
  toolPanelIcon: l,
1727
- configButtons: d.map((C) => ({
1728
- id: C.id,
1825
+ configButtons: u.map((v) => ({
1826
+ id: v.id,
1729
1827
  hasElement: !1,
1730
- hasRender: !!C.render
1828
+ hasRender: !!v.render
1731
1829
  })),
1732
1830
  apiButtons: []
1733
- }, g = {
1831
+ }, d = {
1734
1832
  position: e?.toolPanel?.position ?? "right",
1735
1833
  isPanelOpen: o.isPanelOpen,
1736
1834
  expandIcon: c,
1737
1835
  collapseIcon: a,
1738
- panels: p.map((C) => ({
1739
- id: C.id,
1740
- title: C.title,
1741
- icon: N(C.icon),
1742
- isExpanded: o.expandedSections.has(C.id)
1836
+ panels: f.map((v) => ({
1837
+ id: v.id,
1838
+ title: v.title,
1839
+ icon: k(v.icon),
1840
+ isExpanded: o.expandedSections.has(v.id)
1743
1841
  }))
1744
- }, m = yt(u), y = _t(g), R = ve({
1842
+ }, w = Ht(g), m = Ot(d), R = Ee({
1745
1843
  hasShell: !0,
1746
- shellHeader: m,
1747
- shellBody: y
1844
+ shellHeader: w,
1845
+ shellBody: m
1748
1846
  });
1749
1847
  t.appendChild(R);
1750
1848
  } else {
1751
- const l = ve({ hasShell: !1 });
1849
+ const l = Ee({ hasShell: !1 });
1752
1850
  t.appendChild(l);
1753
1851
  }
1754
1852
  return i;
1755
1853
  }
1756
- function Ht() {
1854
+ function $t() {
1757
1855
  return {
1758
1856
  startY: null,
1759
1857
  startX: null,
@@ -1767,39 +1865,39 @@ function Ht() {
1767
1865
  momentumRaf: 0
1768
1866
  };
1769
1867
  }
1770
- function Ot(t) {
1868
+ function Ft(t) {
1771
1869
  t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
1772
1870
  }
1773
- function We(t) {
1871
+ function Ue(t) {
1774
1872
  t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
1775
1873
  }
1776
- function Dt(t, e, o) {
1874
+ function Ut(t, e, o) {
1777
1875
  if (t.touches.length !== 1) return;
1778
- We(e);
1876
+ Ue(e);
1779
1877
  const n = t.touches[0];
1780
1878
  e.startY = n.clientY, e.startX = n.clientX, e.lastY = n.clientY, e.lastX = n.clientX, e.lastTime = performance.now(), e.scrollTop = o.fauxScrollbar.scrollTop, e.scrollLeft = o.scrollArea?.scrollLeft ?? 0, e.velocityY = 0, e.velocityX = 0;
1781
1879
  }
1782
- function Mt(t, e, o) {
1880
+ function Vt(t, e, o) {
1783
1881
  if (t.touches.length !== 1 || e.startY === null || e.startX === null || e.scrollTop === null || e.scrollLeft === null)
1784
1882
  return !1;
1785
1883
  const n = t.touches[0], i = n.clientY, r = n.clientX, s = performance.now(), l = e.startY - i, c = e.startX - r;
1786
1884
  if (e.lastTime !== null && e.lastY !== null && e.lastX !== null) {
1787
- const g = s - e.lastTime;
1788
- g > 0 && (e.velocityY = (e.lastY - i) / g, e.velocityX = (e.lastX - r) / g);
1885
+ const d = s - e.lastTime;
1886
+ d > 0 && (e.velocityY = (e.lastY - i) / d, e.velocityX = (e.lastX - r) / d);
1789
1887
  }
1790
1888
  e.lastY = i, e.lastX = r, e.lastTime = s;
1791
- const { scrollTop: a, scrollHeight: h, clientHeight: d } = o.fauxScrollbar, f = h - d, p = l > 0 && a < f || l < 0 && a > 0;
1792
- let u = !1;
1889
+ const { scrollTop: a, scrollHeight: h, clientHeight: u } = o.fauxScrollbar, p = h - u, f = l > 0 && a < p || l < 0 && a > 0;
1890
+ let g = !1;
1793
1891
  if (o.scrollArea) {
1794
- const { scrollLeft: g, scrollWidth: m, clientWidth: y } = o.scrollArea, R = m - y;
1795
- u = c > 0 && g < R || c < 0 && g > 0;
1892
+ const { scrollLeft: d, scrollWidth: w, clientWidth: m } = o.scrollArea, R = w - m;
1893
+ g = c > 0 && d < R || c < 0 && d > 0;
1796
1894
  }
1797
- return p && (o.fauxScrollbar.scrollTop = e.scrollTop + l), u && o.scrollArea && (o.scrollArea.scrollLeft = e.scrollLeft + c), p || u;
1895
+ return f && (o.fauxScrollbar.scrollTop = e.scrollTop + l), g && o.scrollArea && (o.scrollArea.scrollLeft = e.scrollLeft + c), f || g;
1798
1896
  }
1799
- function zt(t, e) {
1800
- (Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Nt(t, e), Ot(t);
1897
+ function Bt(t, e) {
1898
+ (Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Gt(t, e), Ft(t);
1801
1899
  }
1802
- function Nt(t, e) {
1900
+ function Gt(t, e) {
1803
1901
  const i = () => {
1804
1902
  t.velocityY *= 0.95, t.velocityX *= 0.95;
1805
1903
  const r = t.velocityY * 16, s = t.velocityX * 16;
@@ -1807,19 +1905,19 @@ function Nt(t, e) {
1807
1905
  };
1808
1906
  t.momentumRaf = requestAnimationFrame(i);
1809
1907
  }
1810
- function It(t, e, o, n) {
1811
- t.addEventListener("touchstart", (i) => Dt(i, e, o), {
1908
+ function Xt(t, e, o, n) {
1909
+ t.addEventListener("touchstart", (i) => Ut(i, e, o), {
1812
1910
  passive: !0,
1813
1911
  signal: n
1814
1912
  }), t.addEventListener(
1815
1913
  "touchmove",
1816
1914
  (i) => {
1817
- Mt(i, e, o) && i.preventDefault();
1915
+ Vt(i, e, o) && i.preventDefault();
1818
1916
  },
1819
1917
  { passive: !1, signal: n }
1820
- ), t.addEventListener("touchend", () => zt(e, o), { passive: !0, signal: n });
1918
+ ), t.addEventListener("touchend", () => Bt(e, o), { passive: !0, signal: n });
1821
1919
  }
1822
- const kt = [
1920
+ const Yt = [
1823
1921
  {
1824
1922
  property: "editable",
1825
1923
  pluginName: "editing",
@@ -1857,7 +1955,7 @@ const kt = [
1857
1955
  importHint: "import { PinnedColumnsPlugin } from '@toolbox-web/grid/plugins/pinned-columns';",
1858
1956
  isUsed: (t) => t === "left" || t === "right"
1859
1957
  }
1860
- ], qt = [
1958
+ ], jt = [
1861
1959
  {
1862
1960
  property: "columnGroups",
1863
1961
  pluginName: "groupingColumns",
@@ -1866,7 +1964,7 @@ const kt = [
1866
1964
  importHint: "import { GroupingColumnsPlugin } from '@toolbox-web/grid/plugins/grouping-columns';",
1867
1965
  isUsed: (t) => Array.isArray(t) && t.length > 0
1868
1966
  }
1869
- ], Wt = {
1967
+ ], Kt = {
1870
1968
  editing: "import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';",
1871
1969
  selection: "import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';",
1872
1970
  reorder: "import { ReorderPlugin } from '@toolbox-web/grid/plugins/reorder';",
@@ -1887,10 +1985,10 @@ const kt = [
1887
1985
  serverSide: "import { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';",
1888
1986
  columnVirtualization: "import { ColumnVirtualizationPlugin } from '@toolbox-web/grid/plugins/column-virtualization';"
1889
1987
  };
1890
- function re(t) {
1891
- return Wt[t] ?? `import { ${O(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
1988
+ function le(t) {
1989
+ return Kt[t] ?? `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
1892
1990
  }
1893
- function $e() {
1991
+ function Ve() {
1894
1992
  if (typeof window < "u" && window.location) {
1895
1993
  const t = window.location.hostname;
1896
1994
  if (t === "localhost" || t === "127.0.0.1" || t === "::1")
@@ -1898,37 +1996,37 @@ function $e() {
1898
1996
  }
1899
1997
  return typeof process < "u" && process.env?.NODE_ENV !== "production";
1900
1998
  }
1901
- function O(t) {
1999
+ function D(t) {
1902
2000
  return t.charAt(0).toUpperCase() + t.slice(1);
1903
2001
  }
1904
- function Re(t, e) {
2002
+ function Ae(t, e) {
1905
2003
  return t.some((o) => o.name === e);
1906
2004
  }
1907
- function $t(t, e) {
1908
- const o = kt, n = qt, i = /* @__PURE__ */ new Map();
1909
- function r(l, c, a, h, d = !1) {
1910
- i.has(l) || i.set(l, { description: c, importHint: a, fields: [], isConfigProperty: d });
1911
- const f = i.get(l);
1912
- f.fields.includes(h) || f.fields.push(h);
2005
+ function Zt(t, e) {
2006
+ const o = Yt, n = jt, i = /* @__PURE__ */ new Map();
2007
+ function r(l, c, a, h, u = !1) {
2008
+ i.has(l) || i.set(l, { description: c, importHint: a, fields: [], isConfigProperty: u });
2009
+ const p = i.get(l);
2010
+ p.fields.includes(h) || p.fields.push(h);
1913
2011
  }
1914
2012
  for (const l of n) {
1915
2013
  const c = t[l.property];
1916
- (l.isUsed ? l.isUsed(c) : c !== void 0) && !Re(e, l.pluginName) && r(l.pluginName, l.description, l.importHint ?? re(l.pluginName), l.property, !0);
2014
+ (l.isUsed ? l.isUsed(c) : c !== void 0) && !Ae(e, l.pluginName) && r(l.pluginName, l.description, l.importHint ?? le(l.pluginName), l.property, !0);
1917
2015
  }
1918
2016
  const s = t.columns;
1919
2017
  if (s && s.length > 0)
1920
2018
  for (const l of s)
1921
2019
  for (const c of o) {
1922
2020
  const a = l[c.property];
1923
- if ((c.isUsed ? c.isUsed(a) : a !== void 0) && !Re(e, c.pluginName)) {
1924
- const d = l.field || "<unknown>";
1925
- r(c.pluginName, c.description, c.importHint ?? re(c.pluginName), d);
2021
+ if ((c.isUsed ? c.isUsed(a) : a !== void 0) && !Ae(e, c.pluginName)) {
2022
+ const u = l.field || "<unknown>";
2023
+ r(c.pluginName, c.description, c.importHint ?? le(c.pluginName), u);
1926
2024
  }
1927
2025
  }
1928
2026
  if (i.size > 0) {
1929
2027
  const l = [];
1930
- for (const [c, { description: a, importHint: h, fields: d, isConfigProperty: f }] of i)
1931
- if (f)
2028
+ for (const [c, { description: a, importHint: h, fields: u, isConfigProperty: p }] of i)
2029
+ if (p)
1932
2030
  l.push(
1933
2031
  `Config uses ${a}, but the required plugin is not loaded.
1934
2032
  → Add the plugin to your gridConfig.plugins array:
@@ -1936,9 +2034,9 @@ function $t(t, e) {
1936
2034
  plugins: [new ${c.charAt(0).toUpperCase() + c.slice(1)}Plugin(), ...]`
1937
2035
  );
1938
2036
  else {
1939
- const p = d.slice(0, 3).join(", ") + (d.length > 3 ? `, ... (${d.length} total)` : "");
2037
+ const f = u.slice(0, 3).join(", ") + (u.length > 3 ? `, ... (${u.length} total)` : "");
1940
2038
  l.push(
1941
- `Column(s) [${p}] use ${a}, but the required plugin is not loaded.
2039
+ `Column(s) [${f}] use ${a}, but the required plugin is not loaded.
1942
2040
  → Add the plugin to your gridConfig.plugins array:
1943
2041
  ${h}
1944
2042
  plugins: [new ${c.charAt(0).toUpperCase() + c.slice(1)}Plugin(), ...]`
@@ -1955,7 +2053,7 @@ This validation helps catch misconfigurations early. The properties listed above
1955
2053
  );
1956
2054
  }
1957
2055
  }
1958
- function Ft(t) {
2056
+ function Jt(t) {
1959
2057
  const e = [], o = [];
1960
2058
  for (const n of t) {
1961
2059
  const r = n.constructor.manifest;
@@ -1963,12 +2061,12 @@ function Ft(t) {
1963
2061
  for (const s of r.configRules) {
1964
2062
  const l = n.config;
1965
2063
  if (s.check(l)) {
1966
- const a = `${`[tbw-grid:${O(n.name)}Plugin]`} Configuration warning: ${s.message}`;
2064
+ const a = `${`[tbw-grid:${D(n.name)}Plugin]`} Configuration warning: ${s.message}`;
1967
2065
  s.severity === "error" ? e.push(a) : o.push(a);
1968
2066
  }
1969
2067
  }
1970
2068
  }
1971
- if (o.length > 0 && $e())
2069
+ if (o.length > 0 && Ve())
1972
2070
  for (const n of o)
1973
2071
  console.warn(n);
1974
2072
  if (e.length > 0)
@@ -1978,30 +2076,30 @@ ${e.join(`
1978
2076
 
1979
2077
  `)}`);
1980
2078
  }
1981
- function Ut(t, e) {
2079
+ function Qt(t, e) {
1982
2080
  const o = t.name, i = t.constructor.dependencies ?? [];
1983
2081
  for (const r of i) {
1984
2082
  const s = r.name, l = r.required ?? !0, c = r.reason;
1985
2083
  if (!e.some((h) => h.name === s)) {
1986
- const h = c ?? `${O(o)}Plugin requires ${O(s)}Plugin`, d = re(s);
2084
+ const h = c ?? `${D(o)}Plugin requires ${D(s)}Plugin`, u = le(s);
1987
2085
  if (l)
1988
2086
  throw new Error(
1989
2087
  `[tbw-grid] Plugin dependency error:
1990
2088
 
1991
2089
  ${h}.
1992
2090
 
1993
- → Add the plugin to your gridConfig.plugins array BEFORE ${O(o)}Plugin:
1994
- ${d}
1995
- plugins: [new ${O(s)}Plugin(), new ${O(o)}Plugin()]`
2091
+ → Add the plugin to your gridConfig.plugins array BEFORE ${D(o)}Plugin:
2092
+ ${u}
2093
+ plugins: [new ${D(s)}Plugin(), new ${D(o)}Plugin()]`
1996
2094
  );
1997
2095
  console.info(
1998
- `[tbw-grid] ${O(o)}Plugin: Optional "${s}" plugin not found. Some features may be unavailable.`
2096
+ `[tbw-grid] ${D(o)}Plugin: Optional "${s}" plugin not found. Some features may be unavailable.`
1999
2097
  );
2000
2098
  }
2001
2099
  }
2002
2100
  }
2003
- function Vt(t) {
2004
- if (!$e()) return;
2101
+ function eo(t) {
2102
+ if (!Ve()) return;
2005
2103
  const e = new Set(t.map((n) => n.name)), o = /* @__PURE__ */ new Set();
2006
2104
  for (const n of t) {
2007
2105
  const r = n.constructor.manifest;
@@ -2013,7 +2111,7 @@ function Vt(t) {
2013
2111
  o.add(l), console.warn(
2014
2112
  `[tbw-grid] Plugin incompatibility warning:
2015
2113
 
2016
- ${O(n.name)}Plugin and ${O(s.name)}Plugin are both loaded, but they are currently incompatible.
2114
+ ${D(n.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currently incompatible.
2017
2115
 
2018
2116
  → ${s.reason}
2019
2117
 
@@ -2023,7 +2121,7 @@ ${O(n.name)}Plugin and ${O(s.name)}Plugin are both loaded, but they are currentl
2023
2121
  }
2024
2122
  }
2025
2123
  }
2026
- class Bt {
2124
+ class to {
2027
2125
  constructor(e) {
2028
2126
  this.grid = e;
2029
2127
  }
@@ -2040,7 +2138,7 @@ class Bt {
2040
2138
  this.attach(o);
2041
2139
  }
2042
2140
  attach(e) {
2043
- if (Ut(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
2141
+ if (Qt(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
2044
2142
  for (const [o, n] of Object.entries(e.cellRenderers))
2045
2143
  this.cellRenderers.set(o, n);
2046
2144
  if (e.headerRenderers)
@@ -2108,6 +2206,20 @@ class Bt {
2108
2206
  for (const e of this.plugins)
2109
2207
  e.afterRender?.();
2110
2208
  }
2209
+ afterCellRender(e) {
2210
+ for (const o of this.plugins)
2211
+ o.afterCellRender?.(e);
2212
+ }
2213
+ hasAfterCellRenderHook() {
2214
+ return this.plugins.some((e) => typeof e.afterCellRender == "function");
2215
+ }
2216
+ afterRowRender(e) {
2217
+ for (const o of this.plugins)
2218
+ o.afterRowRender?.(e);
2219
+ }
2220
+ hasAfterRowRenderHook() {
2221
+ return this.plugins.some((e) => typeof e.afterRowRender == "function");
2222
+ }
2111
2223
  onScrollRender() {
2112
2224
  for (const e of this.plugins)
2113
2225
  e.onScrollRender?.();
@@ -2224,9 +2336,9 @@ class Bt {
2224
2336
  return e.sort((o, n) => (o.content.order ?? 0) - (n.content.order ?? 0));
2225
2337
  }
2226
2338
  }
2227
- class L extends HTMLElement {
2339
+ class H extends HTMLElement {
2228
2340
  static tagName = "tbw-grid";
2229
- static version = "1.1.2";
2341
+ static version = "1.3.0";
2230
2342
  static adapters = [];
2231
2343
  static registerAdapter(e) {
2232
2344
  this.adapters.push(e);
@@ -2240,14 +2352,14 @@ class L extends HTMLElement {
2240
2352
  static get observedAttributes() {
2241
2353
  return ["rows", "columns", "grid-config", "fit-mode"];
2242
2354
  }
2243
- get #o() {
2355
+ get #n() {
2244
2356
  return this;
2245
2357
  }
2246
2358
  #c = !1;
2247
2359
  #f;
2248
2360
  #d;
2249
2361
  #s = [];
2250
- get #n() {
2362
+ get #i() {
2251
2363
  return this.#t?.effective ?? {};
2252
2364
  }
2253
2365
  #h = !1;
@@ -2263,11 +2375,11 @@ class L extends HTMLElement {
2263
2375
  #w = null;
2264
2376
  #r = !1;
2265
2377
  #b;
2266
- #A = Ht();
2378
+ #A = $t();
2267
2379
  #p;
2268
- #v;
2269
- #y;
2270
2380
  #C;
2381
+ #y;
2382
+ #v;
2271
2383
  #E = {
2272
2384
  scrollTop: 0,
2273
2385
  scrollLeft: 0,
@@ -2276,23 +2388,23 @@ class L extends HTMLElement {
2276
2388
  clientHeight: 0,
2277
2389
  clientWidth: 0
2278
2390
  };
2279
- #i;
2391
+ #o;
2280
2392
  #_;
2281
2393
  #O = !1;
2282
2394
  #P;
2283
2395
  #L;
2284
2396
  #t;
2285
- #e = Et();
2397
+ #e = Dt();
2286
2398
  #a;
2287
2399
  #D;
2288
2400
  #H = /* @__PURE__ */ new Map();
2289
2401
  _rows = [];
2290
- #k = [];
2402
+ #I = [];
2291
2403
  get _columns() {
2292
- return this.#n.columns ?? [];
2404
+ return this.#i.columns ?? [];
2293
2405
  }
2294
2406
  set _columns(e) {
2295
- this.#n.columns = e;
2407
+ this.#i.columns = e;
2296
2408
  }
2297
2409
  get _visibleColumns() {
2298
2410
  return this._columns.filter((e) => !e.hidden);
@@ -2338,7 +2450,7 @@ class L extends HTMLElement {
2338
2450
  }
2339
2451
  set rows(e) {
2340
2452
  const o = this.#s;
2341
- this.#s = e, o !== e && this.#I("rows");
2453
+ this.#s = e, o !== e && this.#k("rows");
2342
2454
  }
2343
2455
  get sourceRows() {
2344
2456
  return this.#s;
@@ -2348,52 +2460,52 @@ class L extends HTMLElement {
2348
2460
  }
2349
2461
  set columns(e) {
2350
2462
  const o = this.#t?.getColumns();
2351
- this.#t?.setColumns(e), o !== e && this.#I("columns");
2463
+ this.#t?.setColumns(e), o !== e && this.#k("columns");
2352
2464
  }
2353
2465
  get gridConfig() {
2354
- return this.#n;
2466
+ return this.#i;
2355
2467
  }
2356
2468
  set gridConfig(e) {
2357
2469
  const o = this.#t?.getGridConfig();
2358
- this.#t?.setGridConfig(e), o !== e && (this.#t.clearLightDomCache(), this.#I("gridConfig"));
2470
+ this.#t?.setGridConfig(e), o !== e && (this.#t.clearLightDomCache(), this.#k("gridConfig"));
2359
2471
  }
2360
2472
  get fitMode() {
2361
- return this.#n.fitMode ?? "stretch";
2473
+ return this.#i.fitMode ?? "stretch";
2362
2474
  }
2363
2475
  set fitMode(e) {
2364
2476
  const o = this.#t?.getFitMode();
2365
- this.#t?.setFitMode(e), o !== e && this.#I("fitMode");
2477
+ this.#t?.setFitMode(e), o !== e && this.#k("fitMode");
2366
2478
  }
2367
2479
  get effectiveConfig() {
2368
- return this.#n;
2480
+ return this.#i;
2369
2481
  }
2370
2482
  get disconnectSignal() {
2371
2483
  return this.#p || (this.#p = new AbortController()), this.#p.signal;
2372
2484
  }
2373
2485
  constructor() {
2374
- super(), this.#le(), this.#f = new Promise((e) => this.#d = e), this.#l = new vt({
2486
+ super(), this.#le(), this.#f = new Promise((e) => this.#d = e), this.#l = new Et({
2375
2487
  mergeConfig: () => {
2376
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#K(), $t(this.#n, this.#i?.getPlugins() ?? []), Ft(this.#i?.getPlugins() ?? []), Vt(this.#i?.getPlugins() ?? []), this.#k = [...this._columns];
2488
+ this.#t.parseLightDomColumns(this), this.#t.merge(), this.#K(), Zt(this.#i, this.#o?.getPlugins() ?? []), Jt(this.#o?.getPlugins() ?? []), eo(this.#o?.getPlugins() ?? []), this.#I = [...this._columns];
2377
2489
  },
2378
2490
  processColumns: () => this.#me(),
2379
2491
  processRows: () => this.#be(),
2380
- renderHeader: () => Z(this),
2381
- updateTemplate: () => F(this),
2492
+ renderHeader: () => J(this),
2493
+ updateTemplate: () => U(this),
2382
2494
  renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
2383
2495
  afterRender: () => {
2384
- this.#i?.afterRender(), this.#n.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, he(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, W(this)), this._virtualization.enabled && !this.#N && this.#ce();
2496
+ this.#o?.afterRender(), this.#i.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, pe(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#N && this.#ce();
2385
2497
  },
2386
2498
  isConnected: () => this.isConnected && this.#h
2387
- }), this.#l.setInitialReadyResolver(() => this.#d?.()), this.#a = At(this.#e, {
2388
- getShadow: () => this.#o,
2389
- getShellConfig: () => this.#n?.shell,
2499
+ }), this.#l.setInitialReadyResolver(() => this.#d?.()), this.#a = It(this.#e, {
2500
+ getShadow: () => this.#n,
2501
+ getShellConfig: () => this.#i?.shell,
2390
2502
  getAccordionIcons: () => ({
2391
- expand: this.#n?.icons?.expand ?? M.expand,
2392
- collapse: this.#n?.icons?.collapse ?? M.collapse
2503
+ expand: this.#i?.icons?.expand ?? z.expand,
2504
+ collapse: this.#i?.icons?.collapse ?? z.collapse
2393
2505
  }),
2394
2506
  emit: (e, o) => this.#T(e, o),
2395
2507
  refreshShellHeader: () => this.refreshShellHeader()
2396
- }), this.#t = new it({
2508
+ }), this.#t = new lt({
2397
2509
  getRows: () => this.#s,
2398
2510
  getSortState: () => this._sortState,
2399
2511
  setSortState: (e) => {
@@ -2407,14 +2519,14 @@ class L extends HTMLElement {
2407
2519
  this._rowPool.length = 0, this._bodyEl && (this._bodyEl.innerHTML = ""), this.__rowRenderEpoch++;
2408
2520
  },
2409
2521
  setup: () => this.#x(),
2410
- renderHeader: () => Z(this),
2411
- updateTemplate: () => F(this),
2522
+ renderHeader: () => J(this),
2523
+ updateTemplate: () => U(this),
2412
2524
  refreshVirtualWindow: () => this.#l.requestPhase(x.VIRTUALIZATION, "configManager"),
2413
2525
  getVirtualization: () => this._virtualization,
2414
2526
  setRowHeight: (e) => {
2415
2527
  this._virtualization.rowHeight = e;
2416
2528
  },
2417
- applyAnimationConfig: (e) => this.#Ce(e),
2529
+ applyAnimationConfig: (e) => this.#ve(e),
2418
2530
  getShellLightDomTitle: () => this.#e.lightDomTitle,
2419
2531
  getShellToolPanels: () => this.#e.toolPanels,
2420
2532
  getShellHeaderContents: () => this.#e.headerContents,
@@ -2439,9 +2551,9 @@ class L extends HTMLElement {
2439
2551
  ${o}`;
2440
2552
  }
2441
2553
  async #le() {
2442
- if (!L.#M) {
2443
- if (ae.length > 0) {
2444
- L.#M = ae, L.#W();
2554
+ if (!H.#M) {
2555
+ if (he.length > 0) {
2556
+ H.#M = he, H.#W();
2445
2557
  return;
2446
2558
  }
2447
2559
  await new Promise((e) => setTimeout(e, 50));
@@ -2458,7 +2570,7 @@ ${o}`;
2458
2570
  } catch {
2459
2571
  continue;
2460
2572
  }
2461
- e ? (L.#M = e, L.#W()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2573
+ e ? (H.#M = e, H.#W()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2462
2574
  "[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
2463
2575
  "Available stylesheets:",
2464
2576
  Array.from(document.styleSheets).map((o) => o.href || "(inline)")
@@ -2469,10 +2581,10 @@ ${o}`;
2469
2581
  }
2470
2582
  }
2471
2583
  getPlugin(e) {
2472
- return this.#i?.getPlugin(e);
2584
+ return this.#o?.getPlugin(e);
2473
2585
  }
2474
2586
  getPluginByName(e) {
2475
- return this.#i?.getPluginByName(e);
2587
+ return this.#o?.getPluginByName(e);
2476
2588
  }
2477
2589
  requestRender() {
2478
2590
  this.#l.requestPhase(x.ROWS, "plugin:requestRender");
@@ -2481,31 +2593,31 @@ ${o}`;
2481
2593
  this._restoreFocusAfterRender = !0, this.#l.requestPhase(x.ROWS, "plugin:requestRenderWithFocus");
2482
2594
  }
2483
2595
  updateTemplate() {
2484
- F(this);
2596
+ U(this);
2485
2597
  }
2486
2598
  requestAfterRender() {
2487
2599
  this.#l.requestPhase(x.STYLE, "plugin:requestAfterRender");
2488
2600
  }
2489
2601
  #j() {
2490
- this.#i = new Bt(this);
2491
- const e = this.#n?.plugins, o = Array.isArray(e) ? e : [];
2492
- this.#i.attachAll(o);
2602
+ this.#o = new to(this);
2603
+ const e = this.#i?.plugins, o = Array.isArray(e) ? e : [];
2604
+ this.#o.attachAll(o);
2493
2605
  }
2494
2606
  #z() {
2495
- const e = this.#i?.getPluginStyles() ?? [];
2607
+ const e = this.#o?.getPluginStyles() ?? [];
2496
2608
  let o = !1;
2497
2609
  for (const { name: n, styles: i } of e)
2498
- L.#q.has(n) || (L.#q.set(n, i), o = !0);
2499
- o && L.#W();
2610
+ H.#q.has(n) || (H.#q.set(n, i), o = !0);
2611
+ o && H.#W();
2500
2612
  }
2501
2613
  #K() {
2502
- const e = this.#n?.plugins, o = Array.isArray(e) ? e : [];
2614
+ const e = this.#i?.plugins, o = Array.isArray(e) ? e : [];
2503
2615
  if (this.#_ !== o) {
2504
2616
  if (this.#_ && this.#_.length === o.length && this.#_.every((n, i) => n === o[i])) {
2505
2617
  this.#_ = o;
2506
2618
  return;
2507
2619
  }
2508
- this.#i && this.#i.detachAll();
2620
+ this.#o && this.#o.detachAll();
2509
2621
  for (const n of this.#e.toolPanels.keys()) {
2510
2622
  const i = this.#e.lightDomToolPanelIds.has(n), r = this.#e.apiToolPanelIds.has(n);
2511
2623
  if (!i && !r) {
@@ -2517,23 +2629,23 @@ ${o}`;
2517
2629
  const i = this.#e.headerContentCleanups.get(n);
2518
2630
  i && (i(), this.#e.headerContentCleanups.delete(n)), this.#e.headerContents.delete(n);
2519
2631
  }
2520
- this.#j(), this.#z(), this.#_ = o, this.#Z(), this.#r = this.#i?.getAll().some((n) => n.onScroll) ?? !1;
2632
+ this.#j(), this.#z(), this.#_ = o, this.#Z(), this.#r = this.#o?.getAll().some((n) => n.onScroll) ?? !1;
2521
2633
  }
2522
2634
  }
2523
2635
  #ae() {
2524
- this.#i?.detachAll();
2636
+ this.#o?.detachAll();
2525
2637
  }
2526
2638
  #Z() {
2527
- if (!this.#i) return;
2528
- const e = this.#i.getToolPanels();
2639
+ if (!this.#o) return;
2640
+ const e = this.#o.getToolPanels();
2529
2641
  for (const { panel: n } of e)
2530
2642
  this.#e.toolPanels.has(n.id) || this.#e.toolPanels.set(n.id, n);
2531
- const o = this.#i.getHeaderContents();
2643
+ const o = this.#o.getHeaderContents();
2532
2644
  for (const { content: n } of o)
2533
2645
  this.#e.headerContents.has(n.id) || this.#e.headerContents.set(n.id, n);
2534
2646
  }
2535
2647
  #R() {
2536
- const e = L.getAdapters();
2648
+ const e = H.getAdapters();
2537
2649
  if (e.length === 0 && !this.__frameworkAdapter) return;
2538
2650
  const o = this.__frameworkAdapter;
2539
2651
  return (n) => {
@@ -2549,9 +2661,9 @@ ${o}`;
2549
2661
  };
2550
2662
  }
2551
2663
  connectedCallback() {
2552
- this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", L.version), this._rows = Array.isArray(this.#s) ? [...this.#s] : [], this.#p && (this.#p.abort(), this.#O = !1), this.#p = new AbortController(), this.#C && (be(this.#C), this.#C = void 0), I(this, this.#e), k(this, this.#e), q(this, this.#e, this.#R()), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#j();
2553
- const e = this.#n?.plugins;
2554
- this.#_ = Array.isArray(e) ? e : [], this.#Z(), this.#c || (this.#G(), this.#z(), this.#c = !0), this.#J(), this.#C = Ct(
2664
+ this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", H.version), this._rows = Array.isArray(this.#s) ? [...this.#s] : [], this.#p && (this.#p.abort(), this.#O = !1), this.#p = new AbortController(), this.#v && (ye(this.#v), this.#v = void 0), I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R()), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#j();
2665
+ const e = this.#i?.plugins;
2666
+ this.#_ = Array.isArray(e) ? e : [], this.#Z(), this.#c || (this.#G(), this.#z(), this.#c = !0), this.#J(), this.#v = _t(
2555
2667
  () => {
2556
2668
  this.#Ee();
2557
2669
  },
@@ -2559,7 +2671,7 @@ ${o}`;
2559
2671
  );
2560
2672
  }
2561
2673
  disconnectedCallback() {
2562
- this.#C && (be(this.#C), this.#C = void 0), this.#ae(), xt(this.#e), this.#a.setInitialized(!1), this.#D?.(), this.#D = void 0, We(this.#A), this.#p && (this.#p.abort(), this.#p = void 0), this.#P?.abort(), this.#P = void 0, this.#O = !1, this._resizeController && this._resizeController.dispose(), this.#v && (this.#v.disconnect(), this.#v = void 0), this.#y && (this.#y.disconnect(), this.#y = void 0, this.#N = !1), G(this), this.#S.clear(), this.#_ = void 0;
2674
+ this.#v && (ye(this.#v), this.#v = void 0), this.#ae(), kt(this.#e), this.#a.setInitialized(!1), this.#D?.(), this.#D = void 0, Ue(this.#A), this.#p && (this.#p.abort(), this.#p = void 0), this.#P?.abort(), this.#P = void 0, this.#O = !1, this._resizeController && this._resizeController.dispose(), this.#C && (this.#C.disconnect(), this.#C = void 0), this.#y && (this.#y.disconnect(), this.#y = void 0, this.#N = !1), X(this), this.#S.clear(), this.#_ = void 0;
2563
2675
  for (const e of this._rowPool)
2564
2676
  e.remove();
2565
2677
  this._rowPool.length = 0, this.__rowsBodyEl = null, this.#h = !1;
@@ -2576,22 +2688,22 @@ ${o}`;
2576
2688
  else e === "fit-mode" && (this.fitMode = n);
2577
2689
  }
2578
2690
  #J() {
2579
- const o = this.#o.querySelector(".tbw-grid-content") ?? this.#o.querySelector(".tbw-grid-root");
2691
+ const o = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
2580
2692
  if (this._headerRowEl = o?.querySelector(".header-row"), this._virtualization.totalHeightEl = o?.querySelector(".faux-vscroll-spacer"), this._virtualization.viewportEl = o?.querySelector(".rows-viewport"), this._bodyEl = o?.querySelector(".rows"), this.__rowsBodyEl = o?.querySelector(".rows-body"), this.#a.isInitialized) {
2581
- ie(this.#o, this.#e), _e(this.#o, this.#n?.shell, this.#e);
2582
- const r = this.#n?.shell?.toolPanel?.defaultOpen;
2693
+ se(this.#n, this.#e), Re(this.#n, this.#i?.shell, this.#e);
2694
+ const r = this.#i?.shell?.toolPanel?.defaultOpen;
2583
2695
  r && this.#e.toolPanels.has(r) && (this.openToolPanel(), this.#e.expandedSections.add(r));
2584
2696
  }
2585
- if (this.setAttribute("data-upgraded", ""), this.#h = !0, this._resizeController = Ce(this), this.#x(), this.#ee(o), this.#O)
2697
+ if (this.setAttribute("data-upgraded", ""), this.#h = !0, this._resizeController = _e(this), this.#x(), this.#ee(o), this.#O)
2586
2698
  return;
2587
2699
  this.#O = !0;
2588
2700
  const n = this.disconnectSignal;
2589
- gt(this, this, this.#o, n);
2590
- const i = this.#n.rowHeight;
2701
+ bt(this, this, this.#n, n);
2702
+ const i = this.#i.rowHeight;
2591
2703
  i && i > 0 ? this._virtualization.rowHeight = i : requestAnimationFrame(() => this.#Q()), queueMicrotask(() => this.#de()), this.#l.requestPhase(x.FULL, "afterConnect");
2592
2704
  }
2593
2705
  #Q() {
2594
- if (this.#i.hasExtraHeight())
2706
+ if (this.#o.hasExtraHeight())
2595
2707
  return;
2596
2708
  const e = this._bodyEl?.querySelector(".data-grid-row");
2597
2709
  if (!e) return;
@@ -2607,7 +2719,7 @@ ${o}`;
2607
2719
  #ee(e) {
2608
2720
  this.#P?.abort(), this.#P = new AbortController();
2609
2721
  const o = this.#P.signal, n = e?.querySelector(".faux-vscroll"), i = e?.querySelector(".rows");
2610
- if (this._virtualization.container = n ?? this, this.#r = this.#i?.getAll().some((r) => r.onScroll) ?? !1, n && i) {
2722
+ if (this._virtualization.container = n ?? this, this.#r = this.#o?.getAll().some((r) => r.onScroll) ?? !1, n && i) {
2611
2723
  n.addEventListener(
2612
2724
  "scroll",
2613
2725
  () => {
@@ -2616,44 +2728,44 @@ ${o}`;
2616
2728
  if (this._rows.length <= this._virtualization.bypassThreshold)
2617
2729
  i.style.transform = `translateY(${-l}px)`;
2618
2730
  else {
2619
- const a = Math.floor(l / c), h = a - a % 2, d = -(l - h * c);
2620
- i.style.transform = `translateY(${d}px)`;
2731
+ const a = Math.floor(l / c), h = a - a % 2, u = -(l - h * c);
2732
+ i.style.transform = `translateY(${u}px)`;
2621
2733
  }
2622
2734
  this.#w = l, this.#g || (this.#g = requestAnimationFrame(() => {
2623
- this.#g = 0, this.#w !== null && (this.#ve(this.#w), this.#w = null);
2735
+ this.#g = 0, this.#w !== null && (this.#Ce(this.#w), this.#w = null);
2624
2736
  }));
2625
2737
  },
2626
2738
  { passive: !0, signal: o }
2627
2739
  );
2628
- const r = this.#o.querySelector(".tbw-grid-content"), s = this.#o.querySelector(".tbw-scroll-area");
2740
+ const r = this.#n.querySelector(".tbw-grid-content"), s = this.#n.querySelector(".tbw-scroll-area");
2629
2741
  r && (r.addEventListener(
2630
2742
  "wheel",
2631
2743
  (l) => {
2632
2744
  const c = l.shiftKey || Math.abs(l.deltaX) > Math.abs(l.deltaY);
2633
2745
  if (c && s) {
2634
- const a = l.shiftKey ? l.deltaY : l.deltaX, { scrollLeft: h, scrollWidth: d, clientWidth: f } = s;
2635
- (a > 0 && h < d - f || a < 0 && h > 0) && (l.preventDefault(), s.scrollLeft += a);
2746
+ const a = l.shiftKey ? l.deltaY : l.deltaX, { scrollLeft: h, scrollWidth: u, clientWidth: p } = s;
2747
+ (a > 0 && h < u - p || a < 0 && h > 0) && (l.preventDefault(), s.scrollLeft += a);
2636
2748
  } else if (!c) {
2637
- const { scrollTop: a, scrollHeight: h, clientHeight: d } = n;
2638
- (l.deltaY > 0 && a < h - d || l.deltaY < 0 && a > 0) && (l.preventDefault(), n.scrollTop += l.deltaY);
2749
+ const { scrollTop: a, scrollHeight: h, clientHeight: u } = n;
2750
+ (l.deltaY > 0 && a < h - u || l.deltaY < 0 && a > 0) && (l.preventDefault(), n.scrollTop += l.deltaY);
2639
2751
  }
2640
2752
  },
2641
2753
  { passive: !1, signal: o }
2642
- ), It(r, this.#A, { fauxScrollbar: n, scrollArea: s }, o));
2754
+ ), Xt(r, this.#A, { fauxScrollbar: n, scrollArea: s }, o));
2643
2755
  }
2644
- this._bodyEl && pt(this, this._bodyEl, o), this.#v?.disconnect(), this._virtualization.viewportEl && (this.#v = new ResizeObserver(() => {
2756
+ this._bodyEl && mt(this, this._bodyEl, o), this.#C?.disconnect(), this._virtualization.viewportEl && (this.#C = new ResizeObserver(() => {
2645
2757
  this.#l.requestPhase(x.VIRTUALIZATION, "resize-observer");
2646
- }), this.#v.observe(this._virtualization.viewportEl)), this.#o.addEventListener(
2758
+ }), this.#C.observe(this._virtualization.viewportEl)), this.#n.addEventListener(
2647
2759
  "focusin",
2648
2760
  () => {
2649
2761
  this.dataset.hasFocus = "";
2650
2762
  },
2651
2763
  { signal: o }
2652
- ), this.#o.addEventListener(
2764
+ ), this.#n.addEventListener(
2653
2765
  "focusout",
2654
2766
  (r) => {
2655
2767
  const s = r.relatedTarget;
2656
- (!s || !this.#o.contains(s)) && delete this.dataset.hasFocus;
2768
+ (!s || !this.#n.contains(s)) && delete this.dataset.hasFocus;
2657
2769
  },
2658
2770
  { signal: o }
2659
2771
  );
@@ -2677,7 +2789,7 @@ ${o}`;
2677
2789
  });
2678
2790
  });
2679
2791
  }
2680
- #I(e) {
2792
+ #k(e) {
2681
2793
  this.#m[e] = !0, !this.#u && (this.#u = !0, queueMicrotask(() => this.#he()));
2682
2794
  }
2683
2795
  #he() {
@@ -2702,7 +2814,7 @@ ${o}`;
2702
2814
  }
2703
2815
  #$() {
2704
2816
  this.#H.clear();
2705
- const e = this.#n.getRowId;
2817
+ const e = this.#i.getRowId;
2706
2818
  this._rows.forEach((o, n) => {
2707
2819
  const i = this.#oe(o, e);
2708
2820
  i !== void 0 && this.#H.set(i, { row: o, index: n });
@@ -2724,18 +2836,18 @@ ${o}`;
2724
2836
  return n;
2725
2837
  }
2726
2838
  #fe() {
2727
- G(this), this.#t.merge(), this.#x();
2839
+ X(this), this.#t.merge(), this.#x();
2728
2840
  }
2729
2841
  #pe() {
2730
- this.#t.merge(), this.#n.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, he(this)) : (this._columns.forEach((o) => {
2842
+ this.#t.merge(), this.#i.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, pe(this)) : (this._columns.forEach((o) => {
2731
2843
  !o.__userResized && o.__autoSized && delete o.width;
2732
- }), F(this));
2844
+ }), U(this));
2733
2845
  }
2734
2846
  #ge() {
2735
- I(this, this.#e), k(this, this.#e);
2736
- const e = !!this.#o.querySelector(".has-shell"), o = !!this.#o.querySelector(".tbw-tool-panel"), n = this.#o.querySelectorAll(".tbw-accordion-section").length;
2737
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#K(), q(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge();
2738
- const i = qe(this.#n?.shell), r = (this.#n?.shell?.toolPanels?.length ?? 0) > 0, s = (this.#n?.shell?.toolPanels?.length ?? 0) !== n;
2847
+ I(this, this.#e), q(this, this.#e);
2848
+ const e = !!this.#n.querySelector(".has-shell"), o = !!this.#n.querySelector(".tbw-tool-panel"), n = this.#n.querySelectorAll(".tbw-accordion-section").length;
2849
+ this.#t.parseLightDomColumns(this), this.#t.merge(), this.#K(), W(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge();
2850
+ const i = Fe(this.#i?.shell), r = (this.#i?.shell?.toolPanels?.length ?? 0) > 0, s = (this.#i?.shell?.toolPanels?.length ?? 0) !== n;
2739
2851
  if (e !== i || !e && i || !o && r || o && s) {
2740
2852
  this.#G(), this.#z(), this.#J(), this.#$();
2741
2853
  return;
@@ -2743,15 +2855,15 @@ ${o}`;
2743
2855
  e && this.#we(), this.#$(), this.#l.requestPhase(x.COLUMNS, "applyGridConfigUpdate");
2744
2856
  }
2745
2857
  #we() {
2746
- const e = this.#o.querySelector(".tbw-shell-header");
2858
+ const e = this.#n.querySelector(".tbw-shell-header");
2747
2859
  if (!e) return;
2748
- const o = this.#n.shell?.header?.title ?? this.#e.lightDomTitle;
2860
+ const o = this.#i.shell?.header?.title ?? this.#e.lightDomTitle;
2749
2861
  let n = e.querySelector(".tbw-shell-title");
2750
2862
  o ? (n || (n = document.createElement("h2"), n.className = "tbw-shell-title", n.setAttribute("part", "shell-title"), e.insertBefore(n, e.firstChild)), n.textContent = o) : n && n.remove();
2751
2863
  }
2752
2864
  #me() {
2753
- if (this.#i) {
2754
- const e = this.#k.length > 0 ? this.#k : this._columns, o = e.filter((r) => !r.hidden), n = e.filter((r) => r.hidden), i = this.#i.processColumns([...o]);
2865
+ if (this.#o) {
2866
+ const e = this.#I.length > 0 ? this.#I : this._columns, o = e.filter((r) => !r.hidden), n = e.filter((r) => r.hidden), i = this.#o.processColumns([...o]);
2755
2867
  if (i !== o) {
2756
2868
  new Set(o.map((l) => l.field));
2757
2869
  const r = new Set(i.map((l) => l.field));
@@ -2761,20 +2873,20 @@ ${o}`;
2761
2873
  }
2762
2874
  }
2763
2875
  #be() {
2764
- G(this);
2765
- const e = Array.isArray(this.#s) ? [...this.#s] : [], o = this.#i?.processRows(e) ?? e;
2876
+ X(this);
2877
+ const e = Array.isArray(this.#s) ? [...this.#s] : [], o = this.#o?.processRows(e) ?? e;
2766
2878
  this._rows = o;
2767
2879
  }
2768
- #Ce(e) {
2880
+ #ve(e) {
2769
2881
  const o = {
2770
- ...Fe,
2882
+ ...Be,
2771
2883
  ...e.animation
2772
2884
  }, n = o.mode ?? "reduced-motion";
2773
2885
  let i = 1;
2774
2886
  n === !1 || n === "off" ? i = 0 : (n === !0 || n === "on") && (i = 1), this.style.setProperty("--tbw-animation-duration", `${o.duration}ms`), this.style.setProperty("--tbw-animation-easing", o.easing ?? "ease-out"), this.style.setProperty("--tbw-animation-enabled", String(i)), this.dataset.animationMode = typeof n == "boolean" ? n ? "on" : "off" : n;
2775
2887
  }
2776
2888
  #F(e, o, n = this.__rowRenderEpoch) {
2777
- this.#b || (this.#b = (i, r, s) => this.#i?.renderRow(i, r, s) ?? !1), at(this, e, o, n, this.#b);
2889
+ this.#b || (this.#b = (i, r, s) => this.#o?.renderRow(i, r, s) ?? !1), ht(this, e, o, n, this.#b);
2778
2890
  }
2779
2891
  #U = -1;
2780
2892
  #ne = -1;
@@ -2789,20 +2901,20 @@ ${o}`;
2789
2901
  if (this.#t.parseLightDomColumns(this), this.#L) {
2790
2902
  const e = this.#L;
2791
2903
  this.#L = void 0, this.#t.merge();
2792
- const o = this.#i?.getAll() ?? [];
2904
+ const o = this.#o?.getAll() ?? [];
2793
2905
  this.#t.applyState(e, o);
2794
2906
  }
2795
2907
  this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#l.requestPhase(x.FULL, "setup");
2796
2908
  }
2797
2909
  }
2798
- #ve(e) {
2799
- if (this.refreshVirtualWindow(!1), this.#i?.onScrollRender(), this.#r) {
2910
+ #Ce(e) {
2911
+ if (this.refreshVirtualWindow(!1), this.#o?.onScrollRender(), this.#r) {
2800
2912
  const o = this._virtualization.container, n = this.#E;
2801
- n.scrollTop = e, n.scrollLeft = o?.scrollLeft ?? 0, n.scrollHeight = o?.scrollHeight ?? 0, n.scrollWidth = o?.scrollWidth ?? 0, n.clientHeight = o?.clientHeight ?? 0, n.clientWidth = o?.clientWidth ?? 0, this.#i?.onScroll(n);
2913
+ n.scrollTop = e, n.scrollLeft = o?.scrollLeft ?? 0, n.scrollHeight = o?.scrollHeight ?? 0, n.scrollWidth = o?.scrollWidth ?? 0, n.clientHeight = o?.clientHeight ?? 0, n.clientWidth = o?.clientWidth ?? 0, this.#o?.onScroll(n);
2802
2914
  }
2803
2915
  }
2804
2916
  findHeaderRow() {
2805
- return this.#o.querySelector(".header-row");
2917
+ return this.#n.querySelector(".header-row");
2806
2918
  }
2807
2919
  findRenderedRowElement(e) {
2808
2920
  return Array.from(this._bodyEl.querySelectorAll(".data-grid-row")).find((o) => {
@@ -2838,8 +2950,8 @@ ${o}`;
2838
2950
  value: c,
2839
2951
  cellEl: i,
2840
2952
  originalEvent: e
2841
- }, d = this.#i?.onCellClick(h) ?? !1;
2842
- return this.#T("cell-click", h), d;
2953
+ }, u = this.#o?.onCellClick(h) ?? !1;
2954
+ return this.#T("cell-click", h), u;
2843
2955
  }
2844
2956
  _dispatchRowClick(e, o, n, i) {
2845
2957
  if (!n) return !1;
@@ -2848,7 +2960,7 @@ ${o}`;
2848
2960
  row: n,
2849
2961
  rowEl: i,
2850
2962
  originalEvent: e
2851
- }, s = this.#i?.onRowClick(r) ?? !1;
2963
+ }, s = this.#o?.onRowClick(r) ?? !1;
2852
2964
  return this.#T("row-click", r), s;
2853
2965
  }
2854
2966
  _dispatchHeaderClick(e, o, n) {
@@ -2861,25 +2973,37 @@ ${o}`;
2861
2973
  headerEl: n,
2862
2974
  originalEvent: e
2863
2975
  };
2864
- return this.#i?.onHeaderClick(r) ?? !1;
2976
+ return this.#o?.onHeaderClick(r) ?? !1;
2865
2977
  }
2866
2978
  _dispatchKeyDown(e) {
2867
- return this.#i?.onKeyDown(e) ?? !1;
2979
+ return this.#o?.onKeyDown(e) ?? !1;
2868
2980
  }
2869
2981
  _getHorizontalScrollOffsets(e, o) {
2870
- return this.#i?.getHorizontalScrollOffsets(e, o) ?? { left: 0, right: 0 };
2982
+ return this.#o?.getHorizontalScrollOffsets(e, o) ?? { left: 0, right: 0 };
2871
2983
  }
2872
2984
  queryPlugins(e) {
2873
- return this.#i?.queryPlugins(e) ?? [];
2985
+ return this.#o?.queryPlugins(e) ?? [];
2874
2986
  }
2875
2987
  _dispatchCellMouseDown(e) {
2876
- return this.#i?.onCellMouseDown(e) ?? !1;
2988
+ return this.#o?.onCellMouseDown(e) ?? !1;
2877
2989
  }
2878
2990
  _dispatchCellMouseMove(e) {
2879
- this.#i?.onCellMouseMove(e);
2991
+ this.#o?.onCellMouseMove(e);
2880
2992
  }
2881
2993
  _dispatchCellMouseUp(e) {
2882
- this.#i?.onCellMouseUp(e);
2994
+ this.#o?.onCellMouseUp(e);
2995
+ }
2996
+ _afterCellRender(e) {
2997
+ this.#o?.afterCellRender(e);
2998
+ }
2999
+ _hasAfterCellRenderHook() {
3000
+ return this.#o?.hasAfterCellRenderHook() ?? !1;
3001
+ }
3002
+ _afterRowRender(e) {
3003
+ this.#o?.afterRowRender(e);
3004
+ }
3005
+ _hasAfterRowRenderHook() {
3006
+ return this.#o?.hasAfterRowRenderHook() ?? !1;
2883
3007
  }
2884
3008
  async ready() {
2885
3009
  return this.#f;
@@ -2888,10 +3012,10 @@ ${o}`;
2888
3012
  return this.#l.requestPhase(x.FULL, "forceLayout"), this.#l.whenReady();
2889
3013
  }
2890
3014
  async getConfig() {
2891
- return Object.freeze({ ...this.#n || {} });
3015
+ return Object.freeze({ ...this.#i || {} });
2892
3016
  }
2893
3017
  getRowId(e) {
2894
- return this.#ue(e, this.#n.getRowId);
3018
+ return this.#ue(e, this.#i.getRowId);
2895
3019
  }
2896
3020
  getRow(e) {
2897
3021
  return this.#H.get(e)?.row;
@@ -2930,13 +3054,13 @@ ${o}`;
2930
3054
  );
2931
3055
  const { row: l, index: c } = s;
2932
3056
  for (const [a, h] of Object.entries(r)) {
2933
- const d = l[a];
2934
- d !== h && (n = !0, l[a] = h, this.#T("cell-change", {
3057
+ const u = l[a];
3058
+ u !== h && (n = !0, l[a] = h, this.#T("cell-change", {
2935
3059
  row: l,
2936
3060
  rowId: i,
2937
3061
  rowIndex: c,
2938
3062
  field: a,
2939
- oldValue: d,
3063
+ oldValue: u,
2940
3064
  newValue: h,
2941
3065
  changes: r,
2942
3066
  source: o
@@ -2945,6 +3069,15 @@ ${o}`;
2945
3069
  }
2946
3070
  n && this.#l.requestPhase(x.ROWS, "updateRows");
2947
3071
  }
3072
+ animateRow(e, o) {
3073
+ de(this, e, o);
3074
+ }
3075
+ animateRows(e, o) {
3076
+ Pt(this, e, o);
3077
+ }
3078
+ animateRowById(e, o) {
3079
+ return Lt(this, e, o);
3080
+ }
2948
3081
  setColumnVisible(e, o) {
2949
3082
  const n = this.#t.setColumnVisible(e, o);
2950
3083
  return n && this.requestStateChange(), n;
@@ -2969,7 +3102,7 @@ ${o}`;
2969
3102
  return this.#t.getColumnOrder();
2970
3103
  }
2971
3104
  getColumnState() {
2972
- const e = this.#i?.getAll() ?? [];
3105
+ const e = this.#o?.getAll() ?? [];
2973
3106
  return this.#t.collectState(e);
2974
3107
  }
2975
3108
  set columnState(e) {
@@ -2979,16 +3112,16 @@ ${o}`;
2979
3112
  return this.getColumnState();
2980
3113
  }
2981
3114
  #ye(e) {
2982
- const o = this.#i?.getAll() ?? [];
3115
+ const o = this.#o?.getAll() ?? [];
2983
3116
  this.#t.applyState(e, o), this.#x();
2984
3117
  }
2985
3118
  requestStateChange() {
2986
- const e = this.#i?.getAll() ?? [];
3119
+ const e = this.#o?.getAll() ?? [];
2987
3120
  this.#t.requestStateChange(e);
2988
3121
  }
2989
3122
  resetColumnState() {
2990
3123
  this.#L = void 0, this.__originalOrder = [];
2991
- const e = this.#i?.getAll() ?? [];
3124
+ const e = this.#o?.getAll() ?? [];
2992
3125
  this.#t.resetState(e), this.#t.merge(), this.#x();
2993
3126
  }
2994
3127
  get isToolPanelOpen() {
@@ -3039,17 +3172,17 @@ ${o}`;
3039
3172
  #V = !1;
3040
3173
  refreshShellHeader() {
3041
3174
  this.#V || (this.#V = !0, queueMicrotask(() => {
3042
- this.#V = !1, this.isConnected && (I(this, this.#e), k(this, this.#e), q(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge(), this.#G(), this.#z(), this.#_e());
3175
+ this.#V = !1, this.isConnected && (I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge(), this.#G(), this.#z(), this.#_e());
3043
3176
  }));
3044
3177
  }
3045
3178
  #_e() {
3046
- const o = this.#o.querySelector(".tbw-grid-content") ?? this.#o.querySelector(".tbw-grid-root");
3179
+ const o = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
3047
3180
  if (this._headerRowEl = o?.querySelector(".header-row"), this._virtualization.totalHeightEl = o?.querySelector(".faux-vscroll-spacer"), this._virtualization.viewportEl = o?.querySelector(".rows-viewport"), this._bodyEl = o?.querySelector(".rows"), this.__rowsBodyEl = o?.querySelector(".rows-body"), this.#a.isInitialized) {
3048
- ie(this.#o, this.#e), _e(this.#o, this.#n?.shell, this.#e);
3049
- const n = this.#n?.shell?.toolPanel?.defaultOpen;
3181
+ se(this.#n, this.#e), Re(this.#n, this.#i?.shell, this.#e);
3182
+ const n = this.#i?.shell?.toolPanel?.defaultOpen;
3050
3183
  n && this.#e.toolPanels.has(n) && (this.openToolPanel(), this.#e.expandedSections.add(n));
3051
3184
  }
3052
- this._resizeController = Ce(this), this.#ee(o), this.#l.requestPhase(x.VIRTUALIZATION, "shellRefresh");
3185
+ this._resizeController = _e(this), this.#ee(o), this.#l.requestPhase(x.COLUMNS, "shellRefresh");
3053
3186
  }
3054
3187
  #S = /* @__PURE__ */ new Map();
3055
3188
  registerStyles(e, o) {
@@ -3071,16 +3204,16 @@ ${o}`;
3071
3204
  #Ee() {
3072
3205
  const e = () => {
3073
3206
  const n = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
3074
- I(this, this.#e), k(this, this.#e), q(this, this.#e, this.#R());
3207
+ I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R());
3075
3208
  const r = this.#e.lightDomTitle, s = this.#e.hasToolButtonsContainer;
3076
3209
  if (r && !n || s && !i) {
3077
3210
  this.#t.markSourcesChanged(), this.#t.merge();
3078
- const l = this.#o.querySelector(".tbw-shell-header");
3211
+ const l = this.#n.querySelector(".tbw-shell-header");
3079
3212
  if (l) {
3080
- const c = ye(
3081
- this.#n.shell,
3213
+ const c = Se(
3214
+ this.#i.shell,
3082
3215
  this.#e,
3083
- this.#n.icons?.toolPanel
3216
+ this.#i.icons?.toolPanel
3084
3217
  ), a = document.createElement("div");
3085
3218
  a.innerHTML = c;
3086
3219
  const h = a.firstElementChild;
@@ -3093,18 +3226,18 @@ ${o}`;
3093
3226
  this.#t.registerLightDomHandler("tbw-grid-header", e), this.#t.registerLightDomHandler("tbw-grid-tool-buttons", e), this.#t.registerLightDomHandler("tbw-grid-tool-panel", e), this.#t.registerLightDomHandler("tbw-grid-column", o), this.#t.registerLightDomHandler("tbw-grid-detail", o), this.#t.observeLightDOM(this);
3094
3227
  }
3095
3228
  refreshColumns() {
3096
- this.__lightDomColumnsCache = void 0, G(this), this.#t.parseLightDomColumns(this);
3229
+ this.__lightDomColumnsCache = void 0, X(this), this.#t.parseLightDomColumns(this);
3097
3230
  const e = this.#e.lightDomTitle, o = this.#e.hasToolButtonsContainer;
3098
- I(this, this.#e), k(this, this.#e), q(this, this.#e, this.#R());
3231
+ I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R());
3099
3232
  const n = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
3100
3233
  if (n && !e || i && !o) {
3101
3234
  this.#t.markSourcesChanged(), this.#t.merge();
3102
- const s = this.#o.querySelector(".tbw-shell-header");
3235
+ const s = this.#n.querySelector(".tbw-shell-header");
3103
3236
  if (s) {
3104
- const l = ye(
3105
- this.#n.shell,
3237
+ const l = Se(
3238
+ this.#i.shell,
3106
3239
  this.#e,
3107
- this.#n.icons?.toolPanel
3240
+ this.#i.icons?.toolPanel
3108
3241
  ), c = document.createElement("div");
3109
3242
  c.innerHTML = l;
3110
3243
  const a = c.firstElementChild;
@@ -3114,76 +3247,76 @@ ${o}`;
3114
3247
  this.#l.requestPhase(x.COLUMNS, "refreshColumns");
3115
3248
  }
3116
3249
  #B(e) {
3117
- const o = this._virtualization.rowHeight, n = this._virtualization.container ?? this, i = this._virtualization.viewportEl ?? n, r = n.clientHeight, s = i.clientHeight, c = this.shadowRoot?.querySelector(".tbw-scroll-area"), a = c ? c.clientHeight : r, d = a - s, f = this.#i?.getExtraHeight() ?? 0, p = Math.max(0, r - a);
3118
- return e * o + d + f + p;
3250
+ const o = this._virtualization.rowHeight, n = this._virtualization.container ?? this, i = this._virtualization.viewportEl ?? n, r = n.clientHeight, s = i.clientHeight, c = this.shadowRoot?.querySelector(".tbw-scroll-area"), a = c ? c.clientHeight : r, u = a - s, p = this.#o?.getExtraHeight() ?? 0, f = Math.max(0, r - a);
3251
+ return e * o + u + p + f;
3119
3252
  }
3120
3253
  refreshVirtualWindow(e = !1, o = !1) {
3121
3254
  if (!this._bodyEl) return;
3122
3255
  const n = this._rows.length;
3123
3256
  if (!this._virtualization.enabled) {
3124
- this.#F(0, n), o || this.#i?.afterRender();
3257
+ this.#F(0, n), o || this.#o?.afterRender();
3125
3258
  return;
3126
3259
  }
3127
3260
  if (this._rows.length <= this._virtualization.bypassThreshold) {
3128
- this._virtualization.start = 0, this._virtualization.end = n, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#F(0, n, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#B(n)}px`), this.#ie(n, this._visibleColumns.length), o || this.#i?.afterRender();
3261
+ this._virtualization.start = 0, this._virtualization.end = n, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#F(0, n, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#B(n)}px`), this.#ie(n, this._visibleColumns.length), o || this.#o?.afterRender();
3129
3262
  return;
3130
3263
  }
3131
3264
  const i = this._virtualization.container ?? this, r = this._virtualization.viewportEl ?? i, s = r.clientHeight, l = this._virtualization.rowHeight, c = i.scrollTop;
3132
3265
  let a = Math.floor(c / l), h = 0;
3133
- const d = 10;
3134
- for (; h < d; ) {
3135
- const C = this.#i?.getExtraHeightBefore?.(a) ?? 0, w = Math.floor((c - C) / l);
3136
- if (w >= a || w < 0) break;
3137
- a = w, h++;
3266
+ const u = 10;
3267
+ for (; h < u; ) {
3268
+ const v = this.#o?.getExtraHeightBefore?.(a) ?? 0, T = Math.floor((c - v) / l);
3269
+ if (T >= a || T < 0) break;
3270
+ a = T, h++;
3138
3271
  }
3139
3272
  a = a - a % 2, a < 0 && (a = 0);
3140
- const f = this.#i?.adjustVirtualStart(a, c, l);
3141
- f !== void 0 && f < a && (a = f, a = a - a % 2, a < 0 && (a = 0));
3142
- const p = Math.ceil(s / l) + 3;
3143
- let u = a + p;
3144
- if (u > n && (u = n), this._virtualization.start = a, this._virtualization.end = u, i.clientHeight === 0 && s > 0) {
3273
+ const p = this.#o?.adjustVirtualStart(a, c, l);
3274
+ p !== void 0 && p < a && (a = p, a = a - a % 2, a < 0 && (a = 0));
3275
+ const f = Math.ceil(s / l) + 3;
3276
+ let g = a + f;
3277
+ if (g > n && (g = n), this._virtualization.start = a, this._virtualization.end = g, i.clientHeight === 0 && s > 0) {
3145
3278
  this.#l.requestPhase(x.VIRTUALIZATION, "stale-refs-retry");
3146
3279
  return;
3147
3280
  }
3148
- const m = this.#B(n);
3149
- this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${m}px`);
3150
- const y = this.#i?.getExtraHeightBefore?.(a) ?? 0, R = -(c - a * l - y);
3151
- this._bodyEl.style.transform = `translateY(${R}px)`, this.#F(a, u, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this.#ie(n, this._visibleColumns.length), e && !o && (this.#i?.afterRender(), queueMicrotask(() => {
3152
- const C = i.clientHeight, w = r.clientHeight;
3153
- if (C === 0 && w > 0) return;
3154
- const v = this.#B(n);
3155
- this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${v}px`);
3281
+ const w = this.#B(n);
3282
+ this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${w}px`);
3283
+ const m = this.#o?.getExtraHeightBefore?.(a) ?? 0, R = -(c - a * l - m);
3284
+ this._bodyEl.style.transform = `translateY(${R}px)`, this.#F(a, g, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this.#ie(n, this._visibleColumns.length), e && !o && (this.#o?.afterRender(), queueMicrotask(() => {
3285
+ const v = i.clientHeight, T = r.clientHeight;
3286
+ if (v === 0 && T > 0) return;
3287
+ const b = this.#B(n);
3288
+ this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${b}px`);
3156
3289
  }));
3157
3290
  }
3158
3291
  #G() {
3159
- I(this, this.#e), k(this, this.#e), q(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge();
3160
- const e = this.#n?.shell;
3161
- Lt(
3162
- this.#o,
3292
+ I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge();
3293
+ const e = this.#i?.shell;
3294
+ Wt(
3295
+ this.#n,
3163
3296
  e,
3164
3297
  { isPanelOpen: this.#e.isPanelOpen, expandedSections: this.#e.expandedSections },
3165
- this.#n?.icons
3298
+ this.#i?.icons
3166
3299
  ) && (this.#X(), this.#a.setInitialized(!0));
3167
3300
  }
3168
3301
  #X() {
3169
- St(this.#o, this.#n?.shell, this.#e, {
3302
+ Mt(this.#n, this.#i?.shell, this.#e, {
3170
3303
  onPanelToggle: () => this.toggleToolPanel(),
3171
3304
  onSectionToggle: (e) => this.toggleToolPanelSection(e)
3172
- }), this.#D?.(), this.#D = Rt(this.#o, this.#n?.shell, (e) => {
3305
+ }), this.#D?.(), this.#D = zt(this.#n, this.#i?.shell, (e) => {
3173
3306
  this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
3174
3307
  });
3175
3308
  }
3176
3309
  }
3177
- customElements.get(L.tagName) || customElements.define(L.tagName, L);
3178
- globalThis.DataGridElement = L;
3179
- const Xt = {
3310
+ customElements.get(H.tagName) || customElements.define(H.tagName, H);
3311
+ globalThis.DataGridElement = H;
3312
+ const no = {
3180
3313
  CAN_MOVE_COLUMN: "canMoveColumn",
3181
3314
  GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
3182
3315
  };
3183
- class Yt {
3316
+ class io {
3184
3317
  static dependencies;
3185
3318
  static manifest;
3186
- version = "1.1.2";
3319
+ version = "1.3.0";
3187
3320
  styles;
3188
3321
  cellRenderers;
3189
3322
  headerRenderers;
@@ -3191,7 +3324,7 @@ class Yt {
3191
3324
  grid;
3192
3325
  config;
3193
3326
  userConfig;
3194
- #o;
3327
+ #n;
3195
3328
  get defaultConfig() {
3196
3329
  return {};
3197
3330
  }
@@ -3199,10 +3332,10 @@ class Yt {
3199
3332
  this.userConfig = e;
3200
3333
  }
3201
3334
  attach(e) {
3202
- this.#o?.abort(), this.#o = new AbortController(), this.grid = e, this.config = { ...this.defaultConfig, ...this.userConfig };
3335
+ this.#n?.abort(), this.#n = new AbortController(), this.grid = e, this.config = { ...this.defaultConfig, ...this.userConfig };
3203
3336
  }
3204
3337
  detach() {
3205
- this.#o?.abort(), this.#o = void 0;
3338
+ this.#n?.abort(), this.#n = void 0;
3206
3339
  }
3207
3340
  getPlugin(e) {
3208
3341
  return this.grid?.getPlugin(e);
@@ -3239,11 +3372,11 @@ class Yt {
3239
3372
  return this.grid;
3240
3373
  }
3241
3374
  get disconnectSignal() {
3242
- return this.#o?.signal ?? this.grid?.disconnectSignal;
3375
+ return this.#n?.signal ?? this.grid?.disconnectSignal;
3243
3376
  }
3244
3377
  get gridIcons() {
3245
3378
  const e = this.grid?.gridConfig?.icons ?? {};
3246
- return { ...M, ...e };
3379
+ return { ...z, ...e };
3247
3380
  }
3248
3381
  get isAnimationEnabled() {
3249
3382
  const e = this.grid?.effectiveConfig?.animation?.mode ?? "reduced-motion";
@@ -3303,14 +3436,14 @@ const A = {
3303
3436
  GROUP_COUNT: "group-count",
3304
3437
  RANGE_SELECTION: "range-selection",
3305
3438
  SELECTION_OVERLAY: "selection-overlay"
3306
- }, Y = {
3439
+ }, j = {
3307
3440
  ROW_INDEX: "data-row-index",
3308
3441
  COL_INDEX: "data-col-index",
3309
3442
  FIELD: "data-field",
3310
3443
  GROUP_KEY: "data-group-key",
3311
3444
  TREE_LEVEL: "data-tree-level",
3312
3445
  STICKY: "data-sticky"
3313
- }, jt = {
3446
+ }, ro = {
3314
3447
  ROOT: `.${A.ROOT}`,
3315
3448
  HEADER: `.${A.HEADER}`,
3316
3449
  HEADER_ROW: `.${A.HEADER_ROW}`,
@@ -3320,12 +3453,12 @@ const A = {
3320
3453
  DATA_ROW: `.${A.DATA_ROW}`,
3321
3454
  DATA_CELL: `.${A.DATA_CELL}`,
3322
3455
  GROUP_ROW: `.${A.GROUP_ROW}`,
3323
- ROW_BY_INDEX: (t) => `.${A.DATA_ROW}[${Y.ROW_INDEX}="${t}"]`,
3324
- CELL_BY_FIELD: (t) => `.${A.DATA_CELL}[${Y.FIELD}="${t}"]`,
3325
- CELL_AT: (t, e) => `.${A.DATA_ROW}[${Y.ROW_INDEX}="${t}"] .${A.DATA_CELL}[${Y.COL_INDEX}="${e}"]`,
3456
+ ROW_BY_INDEX: (t) => `.${A.DATA_ROW}[${j.ROW_INDEX}="${t}"]`,
3457
+ CELL_BY_FIELD: (t) => `.${A.DATA_CELL}[${j.FIELD}="${t}"]`,
3458
+ CELL_AT: (t, e) => `.${A.DATA_ROW}[${j.ROW_INDEX}="${t}"] .${A.DATA_CELL}[${j.COL_INDEX}="${e}"]`,
3326
3459
  SELECTED_ROWS: `.${A.DATA_ROW}.${A.SELECTED}`,
3327
3460
  EDITING_CELL: `.${A.DATA_CELL}.${A.EDITING}`
3328
- }, Kt = {
3461
+ }, so = {
3329
3462
  COLOR_BG: "--tbw-color-bg",
3330
3463
  COLOR_FG: "--tbw-color-fg",
3331
3464
  COLOR_FG_MUTED: "--tbw-color-fg-muted",
@@ -3344,14 +3477,14 @@ const A = {
3344
3477
  BORDER_RADIUS: "--tbw-border-radius",
3345
3478
  FOCUS_OUTLINE: "--tbw-focus-outline"
3346
3479
  };
3347
- function Zt(t) {
3480
+ function lo(t) {
3348
3481
  const e = document.createElement("tbw-grid");
3349
3482
  return t && (e.gridConfig = t), e;
3350
3483
  }
3351
- function Jt(t, e = document) {
3484
+ function ao(t, e = document) {
3352
3485
  return e.querySelector(t);
3353
3486
  }
3354
- const Qt = {
3487
+ const co = {
3355
3488
  CELL_CHANGE: "cell-change",
3356
3489
  CELL_COMMIT: "cell-commit",
3357
3490
  ROW_COMMIT: "row-commit",
@@ -3364,7 +3497,7 @@ const Qt = {
3364
3497
  CELL_ACTIVATE: "cell-activate",
3365
3498
  GROUP_TOGGLE: "group-toggle",
3366
3499
  COLUMN_STATE_CHANGE: "column-state-change"
3367
- }, eo = {
3500
+ }, ho = {
3368
3501
  SELECTION_CHANGE: "selection-change",
3369
3502
  TREE_EXPAND: "tree-expand",
3370
3503
  FILTER_CHANGE: "filter-change",
@@ -3382,7 +3515,7 @@ const Qt = {
3382
3515
  COLUMN_REORDER: "column-reorder",
3383
3516
  DETAIL_EXPAND: "detail-expand",
3384
3517
  GROUP_EXPAND: "group-expand"
3385
- }, ne = {
3518
+ }, re = {
3386
3519
  sum: (t, e) => t.reduce((o, n) => o + (Number(n[e]) || 0), 0),
3387
3520
  avg: (t, e) => {
3388
3521
  const o = t.reduce((n, i) => n + (Number(i[e]) || 0), 0);
@@ -3393,28 +3526,28 @@ const Qt = {
3393
3526
  max: (t, e) => Math.max(...t.map((o) => Number(o[e]) || -1 / 0)),
3394
3527
  first: (t, e) => t[0]?.[e],
3395
3528
  last: (t, e) => t[t.length - 1]?.[e]
3396
- }, $ = /* @__PURE__ */ new Map(), D = {
3529
+ }, F = /* @__PURE__ */ new Map(), M = {
3397
3530
  register(t, e) {
3398
- $.set(t, e);
3531
+ F.set(t, e);
3399
3532
  },
3400
3533
  unregister(t) {
3401
- $.delete(t);
3534
+ F.delete(t);
3402
3535
  },
3403
3536
  get(t) {
3404
3537
  if (t !== void 0)
3405
- return typeof t == "function" ? t : $.get(t) ?? ne[t];
3538
+ return typeof t == "function" ? t : F.get(t) ?? re[t];
3406
3539
  },
3407
3540
  run(t, e, o, n) {
3408
3541
  const i = this.get(t);
3409
3542
  return i ? i(e, o, n) : void 0;
3410
3543
  },
3411
3544
  has(t) {
3412
- return $.has(t) || t in ne;
3545
+ return F.has(t) || t in re;
3413
3546
  },
3414
3547
  list() {
3415
- return [...Object.keys(ne), ...$.keys()];
3548
+ return [...Object.keys(re), ...F.keys()];
3416
3549
  }
3417
- }, Te = {
3550
+ }, Pe = {
3418
3551
  sum: (t) => t.reduce((e, o) => e + o, 0),
3419
3552
  avg: (t) => t.length ? t.reduce((e, o) => e + o, 0) / t.length : 0,
3420
3553
  count: (t) => t.length,
@@ -3423,45 +3556,46 @@ const Qt = {
3423
3556
  first: (t) => t[0] ?? 0,
3424
3557
  last: (t) => t[t.length - 1] ?? 0
3425
3558
  };
3426
- function Gt(t) {
3427
- return Te[t] ?? Te.sum;
3559
+ function oo(t) {
3560
+ return Pe[t] ?? Pe.sum;
3428
3561
  }
3429
- function to(t, e) {
3430
- return Gt(t)(e);
3562
+ function uo(t, e) {
3563
+ return oo(t)(e);
3431
3564
  }
3432
- const oo = D.register.bind(D), no = D.unregister.bind(D), io = D.get.bind(D), ro = D.run.bind(D), so = D.list.bind(D);
3565
+ const fo = M.register.bind(M), po = M.unregister.bind(M), go = M.get.bind(M), wo = M.run.bind(M), mo = M.list.bind(M);
3433
3566
  export {
3434
- Yt as BaseGridPlugin,
3435
- Fe as DEFAULT_ANIMATION_CONFIG,
3436
- M as DEFAULT_GRID_ICONS,
3437
- Qt as DGEvents,
3438
- L as DataGridElement,
3439
- V as FitModeEnum,
3440
- Kt as GridCSSVars,
3567
+ io as BaseGridPlugin,
3568
+ Be as DEFAULT_ANIMATION_CONFIG,
3569
+ z as DEFAULT_GRID_ICONS,
3570
+ co as DGEvents,
3571
+ H as DataGridElement,
3572
+ B as FitModeEnum,
3573
+ so as GridCSSVars,
3441
3574
  A as GridClasses,
3442
- Y as GridDataAttrs,
3443
- L as GridElement,
3444
- jt as GridSelectors,
3445
- Xt as PLUGIN_QUERIES,
3446
- eo as PluginEvents,
3447
- Bt as PluginManager,
3575
+ j as GridDataAttrs,
3576
+ H as GridElement,
3577
+ ro as GridSelectors,
3578
+ no as PLUGIN_QUERIES,
3579
+ ho as PluginEvents,
3580
+ to as PluginManager,
3448
3581
  x as RenderPhase,
3449
- W as a,
3450
- D as aggregatorRegistry,
3451
- mt as builtInSort,
3452
- se as c,
3453
- Zt as createGrid,
3454
- wt as defaultComparator,
3455
- xe as e,
3456
- Le as g,
3457
- io as getAggregator,
3458
- Gt as getValueAggregator,
3459
- so as listAggregators,
3460
- Jt as queryGrid,
3461
- oo as registerAggregator,
3462
- ro as runAggregator,
3463
- to as runValueAggregator,
3464
- j as s,
3465
- no as unregisterAggregator
3582
+ At as a,
3583
+ M as aggregatorRegistry,
3584
+ $ as b,
3585
+ Ct as builtInSort,
3586
+ ae as c,
3587
+ lo as createGrid,
3588
+ vt as defaultComparator,
3589
+ Le as e,
3590
+ De as g,
3591
+ go as getAggregator,
3592
+ oo as getValueAggregator,
3593
+ mo as listAggregators,
3594
+ ao as queryGrid,
3595
+ fo as registerAggregator,
3596
+ wo as runAggregator,
3597
+ uo as runValueAggregator,
3598
+ K as s,
3599
+ po as unregisterAggregator
3466
3600
  };
3467
3601
  //# sourceMappingURL=index.js.map