@toolbox-web/grid 1.10.0 → 1.11.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 (65) hide show
  1. package/all.js +426 -377
  2. package/all.js.map +1 -1
  3. package/index.js +765 -718
  4. package/index.js.map +1 -1
  5. package/lib/core/grid.d.ts.map +1 -1
  6. package/lib/core/internal/columns.d.ts.map +1 -1
  7. package/lib/core/internal/config-manager.d.ts.map +1 -1
  8. package/lib/core/internal/dom-builder.d.ts.map +1 -1
  9. package/lib/core/internal/event-delegation.d.ts.map +1 -1
  10. package/lib/core/internal/header.d.ts.map +1 -1
  11. package/lib/core/internal/keyboard.d.ts +2 -0
  12. package/lib/core/internal/keyboard.d.ts.map +1 -1
  13. package/lib/core/internal/loading.d.ts +79 -0
  14. package/lib/core/internal/loading.d.ts.map +1 -0
  15. package/lib/core/internal/render-scheduler.d.ts.map +1 -1
  16. package/lib/core/internal/rows.d.ts +8 -6
  17. package/lib/core/internal/rows.d.ts.map +1 -1
  18. package/lib/core/internal/sanitize.d.ts.map +1 -1
  19. package/lib/core/internal/shell.d.ts.map +1 -1
  20. package/lib/core/internal/style-injector.d.ts +43 -0
  21. package/lib/core/internal/style-injector.d.ts.map +1 -0
  22. package/lib/core/internal/touch-scroll.d.ts.map +1 -1
  23. package/lib/core/internal/validate-config.d.ts.map +1 -1
  24. package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
  25. package/lib/core/plugin/types.d.ts.map +1 -1
  26. package/lib/core/styles/index.d.ts +32 -0
  27. package/lib/core/styles/index.d.ts.map +1 -0
  28. package/lib/core/types.d.ts +44 -1
  29. package/lib/core/types.d.ts.map +1 -1
  30. package/lib/plugins/clipboard/index.js.map +1 -1
  31. package/lib/plugins/column-virtualization/index.js.map +1 -1
  32. package/lib/plugins/context-menu/index.js.map +1 -1
  33. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  34. package/lib/plugins/editing/index.js +322 -213
  35. package/lib/plugins/editing/index.js.map +1 -1
  36. package/lib/plugins/editing/types.d.ts +44 -2
  37. package/lib/plugins/editing/types.d.ts.map +1 -1
  38. package/lib/plugins/export/index.js.map +1 -1
  39. package/lib/plugins/filtering/index.js.map +1 -1
  40. package/lib/plugins/grouping-columns/index.js.map +1 -1
  41. package/lib/plugins/grouping-rows/index.js.map +1 -1
  42. package/lib/plugins/master-detail/index.js.map +1 -1
  43. package/lib/plugins/multi-sort/index.js.map +1 -1
  44. package/lib/plugins/pinned-columns/index.js.map +1 -1
  45. package/lib/plugins/pinned-rows/index.js.map +1 -1
  46. package/lib/plugins/pivot/index.js.map +1 -1
  47. package/lib/plugins/print/index.js.map +1 -1
  48. package/lib/plugins/reorder/index.js +1 -1
  49. package/lib/plugins/reorder/index.js.map +1 -1
  50. package/lib/plugins/responsive/index.js +35 -35
  51. package/lib/plugins/responsive/index.js.map +1 -1
  52. package/lib/plugins/row-reorder/index.js +1 -1
  53. package/lib/plugins/row-reorder/index.js.map +1 -1
  54. package/lib/plugins/selection/index.js.map +1 -1
  55. package/lib/plugins/server-side/index.js.map +1 -1
  56. package/lib/plugins/tree/index.js.map +1 -1
  57. package/lib/plugins/undo-redo/index.js.map +1 -1
  58. package/lib/plugins/visibility/index.js.map +1 -1
  59. package/package.json +1 -1
  60. package/umd/grid.all.umd.js +53 -25
  61. package/umd/grid.all.umd.js.map +1 -1
  62. package/umd/grid.umd.js +40 -12
  63. package/umd/grid.umd.js.map +1 -1
  64. package/umd/plugins/editing.umd.js +1 -1
  65. package/umd/plugins/editing.umd.js.map +1 -1
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
- const we = '@layer tbw-base,tbw-plugins,tbw-theme;@layer tbw-base{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-warning: light-dark(hsl(38, 92%, 50%), hsl(38, 92%, 50%));--tbw-color-error: light-dark(hsl(0, 65%, 51%), hsl(0, 65%, 55%));--tbw-color-danger: var(--tbw-color-error);--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-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-sort-indicator-display: inline-flex;--tbw-sort-indicator-visibility: visible;--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);color-scheme:inherit;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);font-feature-settings:"tnum","lnum";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);text-transform:var(--tbw-header-text-transform);letter-spacing:var(--tbw-header-letter-spacing);>.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;font-weight:inherit}>span[part~=sort-indicator]{flex-shrink:0;opacity:.6;color:var(--tbw-sort-indicator-color);display:var(--tbw-sort-indicator-display, inline-flex);visibility:var(--tbw-sort-indicator-visibility, visible);transition:opacity .15s,visibility 0s,display 0s allow-discrete;transition-behavior:allow-discrete}&:hover>span[part~=sort-indicator]{display:inline-flex;visibility:visible}&[aria-sort=ascending]>span[part~=sort-indicator],&[aria-sort=descending]>span[part~=sort-indicator]{display:inline-flex;visibility:visible;opacity:1;color:var(--tbw-sort-indicator-active-color)}&:last-child{border-right:0;.resize-handle{right:0;width:calc(var(--tbw-resize-handle-width) / 2)}}&.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{position:relative;display:flex;flex-direction:column;height:100%;&.has-shell{display:flex;flex-direction:column;height:100%}&:has(.selected){user-select:none}}.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:start;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}@keyframes tbw-spin{to{transform:rotate(360deg)}}.tbw-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:1000;pointer-events:all;animation:tbw-fade-in .15s ease-out}@keyframes tbw-fade-in{0%{opacity:0}to{opacity:1}}.tbw-spinner{--tbw-spinner-size: 48px;--tbw-spinner-border-width: 3px;--tbw-spinner-color: var(--tbw-color-accent);--tbw-spinner-track-color: var(--tbw-color-border);width:var(--tbw-spinner-size);height:var(--tbw-spinner-size);border:var(--tbw-spinner-border-width) solid var(--tbw-spinner-track-color);border-top-color:var(--tbw-spinner-color);border-radius:50%;animation:tbw-spin .8s linear infinite}.tbw-spinner--large{--tbw-spinner-size: min(48px, calc(100% - 16px) )}.tbw-spinner--small{--tbw-spinner-size: calc(var(--tbw-row-height, 28px) * .6);--tbw-spinner-border-width: 2px}.data-grid-row.tbw-row-loading{position:relative;pointer-events:none;&:before{content:"";position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:10;animation:tbw-fade-in .15s ease-out}&:after{--_spinner-size: calc(var(--tbw-row-height, 28px) * .6);content:"";position:absolute;left:var(--tbw-spacing-md);top:0;bottom:0;margin:auto 0;width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite;z-index:11}}.cell.tbw-cell-loading{position:relative;pointer-events:none;&:before{content:"";position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:10;animation:tbw-fade-in .15s ease-out}&:after{--_spinner-size: calc(var(--tbw-row-height, 28px) * .5);content:"";position:absolute;left:var(--tbw-spacing-sm);top:0;bottom:0;margin:auto 0;width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite;z-index:11}}}', X = {
1
+ const X = {
2
2
  STRETCH: "stretch",
3
3
  FIXED: "fixed"
4
- }, Je = {
4
+ }, ot = {
5
5
  mode: "reduced-motion",
6
6
  duration: 200,
7
7
  easing: "ease-out"
8
- }, be = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', k = {
8
+ }, ve = '<svg viewBox="0 0 16 16" width="12" height="12"><path fill="currentColor" d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"/></svg>', M = {
9
9
  expand: "▶",
10
10
  collapse: "▼",
11
11
  sortAsc: "▲",
@@ -14,48 +14,48 @@ const we = '@layer tbw-base,tbw-plugins,tbw-theme;@layer tbw-base{tbw-grid{--tbw
14
14
  submenuArrow: "▶",
15
15
  dragHandle: "⋮⋮",
16
16
  toolPanel: "☰",
17
- filter: be,
18
- filterActive: be,
17
+ filter: ve,
18
+ filterActive: ve,
19
19
  print: "🖨️"
20
20
  };
21
- function et(t) {
21
+ function nt(t) {
22
22
  return Array.from(t.querySelectorAll("tbw-grid-column")).map((o) => {
23
23
  const n = o.getAttribute("field") || "";
24
24
  if (!n) return null;
25
25
  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, a = o.hasAttribute("sortable"), c = o.hasAttribute("editable"), d = { field: n, type: s, header: l, sortable: a, editable: c }, u = o.getAttribute("width");
26
26
  if (u) {
27
- const m = parseFloat(u);
28
- !isNaN(m) && /^\d+(\.\d+)?$/.test(u.trim()) ? d.width = m : d.width = u;
27
+ const b = parseFloat(u);
28
+ !isNaN(b) && /^\d+(\.\d+)?$/.test(u.trim()) ? d.width = b : d.width = u;
29
29
  }
30
30
  const p = o.getAttribute("minWidth") || o.getAttribute("min-width");
31
31
  if (p) {
32
- const m = parseFloat(p);
33
- isNaN(m) || (d.minWidth = m);
32
+ const b = parseFloat(p);
33
+ isNaN(b) || (d.minWidth = b);
34
34
  }
35
35
  o.hasAttribute("resizable") && (d.resizable = !0), o.hasAttribute("sizable") && (d.resizable = !0);
36
36
  const f = o.getAttribute("editor"), g = o.getAttribute("renderer");
37
37
  f && (d.__editorName = f), g && (d.__rendererName = g);
38
38
  const h = o.getAttribute("options");
39
- h && (d.options = h.split(",").map((m) => {
40
- const [z, R] = m.includes(":") ? m.split(":") : [m.trim(), m.trim()];
39
+ h && (d.options = h.split(",").map((b) => {
40
+ const [z, R] = b.includes(":") ? b.split(":") : [b.trim(), b.trim()];
41
41
  return { value: z.trim(), label: R?.trim() || z.trim() };
42
42
  }));
43
- const w = o.querySelector("tbw-grid-column-view"), b = o.querySelector("tbw-grid-column-editor"), S = o.querySelector("tbw-grid-column-header");
44
- w && (d.__viewTemplate = w), b && (d.__editorTemplate = b), S && (d.__headerTemplate = S);
45
- const _ = globalThis.DataGridElement?.getAdapters?.() ?? [], A = w ?? o, v = _.find((m) => m.canHandle(A));
46
- if (v) {
47
- const m = v.createRenderer(A);
48
- m && (d.viewRenderer = m);
49
- }
50
- const E = b ?? o, y = _.find((m) => m.canHandle(E));
43
+ const w = o.querySelector("tbw-grid-column-view"), v = o.querySelector("tbw-grid-column-editor"), S = o.querySelector("tbw-grid-column-header");
44
+ w && (d.__viewTemplate = w), v && (d.__editorTemplate = v), S && (d.__headerTemplate = S);
45
+ const _ = globalThis.DataGridElement?.getAdapters?.() ?? [], A = w ?? o, m = _.find((b) => b.canHandle(A));
46
+ if (m) {
47
+ const b = m.createRenderer(A);
48
+ b && (d.viewRenderer = b);
49
+ }
50
+ const E = v ?? o, y = _.find((b) => b.canHandle(E));
51
51
  if (y) {
52
- const m = y.createEditor(E);
53
- m && (d.editor = m);
52
+ const b = y.createEditor(E);
53
+ b && (d.editor = b);
54
54
  }
55
55
  return d;
56
56
  }).filter((o) => !!o);
57
57
  }
58
- function me(t, e) {
58
+ function Ce(t, e) {
59
59
  if ((!t || !t.length) && (!e || !e.length)) return [];
60
60
  if (!t || !t.length) return e || [];
61
61
  if (!e || !e.length) return t;
@@ -79,7 +79,7 @@ function me(t, e) {
79
79
  });
80
80
  return Object.keys(o).forEach((i) => n.push(o[i])), n;
81
81
  }
82
- function ke(t, e) {
82
+ function qe(t, e) {
83
83
  try {
84
84
  t.part?.add?.(e);
85
85
  } catch {
@@ -87,7 +87,7 @@ function ke(t, e) {
87
87
  const o = t.getAttribute("part");
88
88
  o ? o.split(/\s+/).includes(e) || t.setAttribute("part", o + " " + e) : t.setAttribute("part", e);
89
89
  }
90
- function ve(t) {
90
+ function ye(t) {
91
91
  const e = t.effectiveConfig?.fitMode || t.fitMode || X.STRETCH;
92
92
  if (e !== X.STRETCH && e !== X.FIXED || t.__didInitialAutoSize || !t.isConnected) return;
93
93
  const o = Array.from(t._headerRowEl?.children || []);
@@ -114,23 +114,23 @@ function B(t) {
114
114
  return n != null ? `minmax(${n}px, 1fr)` : "1fr";
115
115
  }).join(" ").trim() : t._gridTemplate = t._visibleColumns.map((o) => o.width ? `${o.width}px` : "max-content").join(" "), t.style.setProperty("--tbw-column-template", t._gridTemplate);
116
116
  }
117
- function tt(t) {
117
+ function it(t) {
118
118
  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";
119
119
  }
120
- function ot(t, e) {
120
+ function rt(t, e) {
121
121
  const o = t[0] || {}, n = Object.keys(o).map((r) => {
122
- const s = o[r], l = tt(s);
122
+ const s = o[r], l = it(s);
123
123
  return { field: r, header: r.charAt(0).toUpperCase() + r.slice(1), type: l };
124
124
  }), i = {};
125
125
  return n.forEach((r) => {
126
126
  i[r.field] = r.type || "string";
127
127
  }), { columns: n, typeMap: i };
128
128
  }
129
- const nt = /{{\s*([^}]+)\s*}}/g, D = "__DG_EMPTY__", it = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, rt = /__(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/;
130
- function st(t) {
129
+ const st = /{{\s*([^}]+)\s*}}/g, H = "__DG_EMPTY__", lt = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, at = /__(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/;
130
+ function ct(t) {
131
131
  return !t || typeof t != "string" ? "" : t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
132
132
  }
133
- const lt = /* @__PURE__ */ new Set([
133
+ const dt = /* @__PURE__ */ new Set([
134
134
  "script",
135
135
  "iframe",
136
136
  "object",
@@ -155,23 +155,23 @@ const lt = /* @__PURE__ */ new Set([
155
155
  "plaintext",
156
156
  "xmp",
157
157
  "listing"
158
- ]), Ce = /^on\w+$/i, at = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), ct = /^\s*(javascript|vbscript|data|blob):/i;
158
+ ]), _e = /^on\w+$/i, ht = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), ut = /^\s*(javascript|vbscript|data|blob):/i;
159
159
  function F(t) {
160
160
  if (!t || typeof t != "string") return "";
161
161
  if (t.indexOf("<") === -1) return t;
162
162
  const e = document.createElement("template");
163
- return e.innerHTML = t, dt(e.content), e.innerHTML;
163
+ return e.innerHTML = t, ft(e.content), e.innerHTML;
164
164
  }
165
- function dt(t) {
165
+ function ft(t) {
166
166
  const e = [], o = t.querySelectorAll("*");
167
167
  for (const n of o) {
168
168
  const i = n.tagName.toLowerCase();
169
- if (lt.has(i)) {
169
+ if (dt.has(i)) {
170
170
  e.push(n);
171
171
  continue;
172
172
  }
173
173
  if ((i === "svg" || n.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(n.attributes).some(
174
- (l) => Ce.test(l.name) || l.name === "href" || l.name === "xlink:href"
174
+ (l) => _e.test(l.name) || l.name === "href" || l.name === "xlink:href"
175
175
  )) {
176
176
  e.push(n);
177
177
  continue;
@@ -179,11 +179,11 @@ function dt(t) {
179
179
  const r = [];
180
180
  for (const s of n.attributes) {
181
181
  const l = s.name.toLowerCase();
182
- if (Ce.test(l)) {
182
+ if (_e.test(l)) {
183
183
  r.push(s.name);
184
184
  continue;
185
185
  }
186
- if (at.has(l) && ct.test(s.value)) {
186
+ if (ht.has(l) && ut.test(s.value)) {
187
187
  r.push(s.name);
188
188
  continue;
189
189
  }
@@ -196,35 +196,35 @@ function dt(t) {
196
196
  }
197
197
  e.forEach((n) => n.remove());
198
198
  }
199
- function Ne(t, e) {
199
+ function $e(t, e) {
200
200
  if (!t || t.indexOf("{{") === -1) return t;
201
- const o = [], n = t.replace(nt, (l, a) => {
202
- const c = ht(a, e);
201
+ const o = [], n = t.replace(st, (l, a) => {
202
+ const c = pt(a, e);
203
203
  return o.push({ expr: a.trim(), result: c }), c;
204
- }), i = ut(n), r = o.length && o.every((l) => l.result === "" || l.result === D);
204
+ }), i = gt(n), r = o.length && o.every((l) => l.result === "" || l.result === H);
205
205
  return /Reflect\.|\bProxy\b|ownKeys\(/.test(t) || r ? "" : i;
206
206
  }
207
- function ht(t, e) {
208
- if (t = (t || "").trim(), !t || /\b(Reflect|Proxy|ownKeys)\b/.test(t)) return D;
209
- if (t === "value") return e.value == null ? D : String(e.value);
207
+ function pt(t, e) {
208
+ if (t = (t || "").trim(), !t || /\b(Reflect|Proxy|ownKeys)\b/.test(t)) return H;
209
+ if (t === "value") return e.value == null ? H : String(e.value);
210
210
  if (t.startsWith("row.") && !/[()?]/.test(t) && !t.includes(":")) {
211
211
  const n = t.slice(4), i = e.row ? e.row[n] : void 0;
212
- return i == null ? D : String(i);
212
+ return i == null ? H : String(i);
213
213
  }
214
- if (t.length > 80 || !it.test(t) || rt.test(t)) return D;
214
+ if (t.length > 80 || !lt.test(t) || at.test(t)) return H;
215
215
  const o = t.match(/\./g);
216
- if (o && o.length > 1) return D;
216
+ if (o && o.length > 1) return H;
217
217
  try {
218
218
  const i = new Function("value", "row", `return (${t});`)(e.value, e.row), r = i == null ? "" : String(i);
219
- return /Reflect|Proxy|ownKeys/.test(r) ? D : r || D;
219
+ return /Reflect|Proxy|ownKeys/.test(r) ? H : r || H;
220
220
  } catch {
221
- return D;
221
+ return H;
222
222
  }
223
223
  }
224
- function ut(t) {
225
- return t && t.replace(new RegExp(D, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
224
+ function gt(t) {
225
+ return t && t.replace(new RegExp(H, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
226
226
  }
227
- function ft(t) {
227
+ function wt(t) {
228
228
  if (/Reflect|Proxy|ownKeys/.test(t.textContent || "")) {
229
229
  if (Array.from(t.childNodes).forEach((e) => {
230
230
  e.nodeType === Node.TEXT_NODE && /Reflect|Proxy|ownKeys/.test(e.textContent || "") && (e.textContent = "");
@@ -236,12 +236,12 @@ function ft(t) {
236
236
  (t.textContent || "").trim().length === 0 && (t.textContent = "");
237
237
  }
238
238
  }
239
- function ye(t) {
240
- const e = /Reflect\.|\bProxy\b|ownKeys\(/.test(t), o = ((n) => e ? "" : Ne(t, n));
239
+ function Ee(t) {
240
+ const e = /Reflect\.|\bProxy\b|ownKeys\(/.test(t), o = ((n) => e ? "" : $e(t, n));
241
241
  return o.__blocked = e, o;
242
242
  }
243
- const pt = 100;
244
- class gt {
243
+ const bt = 100;
244
+ class mt {
245
245
  #l;
246
246
  #i;
247
247
  #u;
@@ -250,12 +250,12 @@ class gt {
250
250
  #a = {};
251
251
  #n = {};
252
252
  #f = !0;
253
- #g = [];
254
- #m;
253
+ #p = [];
254
+ #b;
255
255
  #s;
256
- #v;
256
+ #m;
257
257
  #r;
258
- #w;
258
+ #g;
259
259
  constructor(e) {
260
260
  this.#r = e;
261
261
  }
@@ -284,16 +284,16 @@ class gt {
284
284
  this.#h = e;
285
285
  }
286
286
  get lightDomTitle() {
287
- return this.#w;
287
+ return this.#g;
288
288
  }
289
289
  set lightDomTitle(e) {
290
- this.#w = e;
290
+ this.#g = e;
291
291
  }
292
292
  get initialColumnState() {
293
- return this.#v;
293
+ return this.#m;
294
294
  }
295
295
  set initialColumnState(e) {
296
- this.#v = e;
296
+ this.#m = e;
297
297
  }
298
298
  get sourcesChanged() {
299
299
  return this.#f;
@@ -323,10 +323,10 @@ class gt {
323
323
  const e = (this.#n.columns?.length ?? 0) > 0;
324
324
  if (!this.#f && e)
325
325
  return;
326
- const o = this.#b();
327
- this.#f = !1, this.#a = o, Object.freeze(this.#a), this.#a.columns && Object.freeze(this.#a.columns), this.#n = this.#R(this.#a), this.#H();
326
+ const o = this.#C();
327
+ this.#f = !1, this.#a = o, Object.freeze(this.#a), this.#a.columns && Object.freeze(this.#a.columns), this.#n = this.#x(this.#a), this.#D();
328
328
  }
329
- #R(e) {
329
+ #x(e) {
330
330
  const o = { ...e };
331
331
  return e.columns && (o.columns = e.columns.map((n) => ({ ...n }))), e.shell && (o.shell = {
332
332
  ...e.shell,
@@ -336,35 +336,45 @@ class gt {
336
336
  headerContents: e.shell.headerContents?.map((n) => ({ ...n }))
337
337
  }), o;
338
338
  }
339
- #H() {
339
+ #D() {
340
340
  const e = this.#n;
341
- e.rowHeight && e.rowHeight > 0 && this.#r.setRowHeight(e.rowHeight), e.fitMode === "fixed" && this.columns.forEach((n) => {
341
+ this.#w(), e.rowHeight && e.rowHeight > 0 && this.#r.setRowHeight(e.rowHeight), e.fitMode === "fixed" && this.columns.forEach((n) => {
342
342
  n.width == null && (n.width = 80);
343
343
  }), this.#r.applyAnimationConfig(e);
344
344
  }
345
- #b() {
345
+ #w() {
346
+ const e = this.#n.typeDefaults;
347
+ if (!e) return;
348
+ const o = this.columns;
349
+ for (const n of o) {
350
+ if (!n.type) continue;
351
+ const i = e[n.type];
352
+ i && (!n.renderer && !n.viewRenderer && i.renderer && (n.renderer = i.renderer), !n.format && i.format && (n.format = i.format), !n.editor && i.editor && (n.editor = i.editor), !n.editorParams && i.editorParams && (n.editorParams = i.editorParams));
353
+ }
354
+ }
355
+ #C() {
346
356
  const e = this.#l ? { ...this.#l } : {}, o = Array.isArray(e.columns) ? [...e.columns] : [], n = (this.#d ?? []).map((s) => ({
347
357
  ...s
348
358
  }));
349
- let i = me(
359
+ let i = Ce(
350
360
  o,
351
361
  n
352
362
  );
353
- this.#i && this.#i.length && (i = me(
363
+ this.#i && this.#i.length && (i = Ce(
354
364
  this.#i,
355
365
  n
356
366
  ));
357
367
  const r = this.#r.getRows();
358
- return i.length === 0 && r.length && (i = ot(r).columns), i.length && (i.forEach((s) => {
368
+ return i.length === 0 && r.length && (i = rt(r).columns), i.length && (i.forEach((s) => {
359
369
  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);
360
370
  }), i.forEach((s) => {
361
- s.__viewTemplate && !s.__compiledView && (s.__compiledView = ye(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = ye(s.__editorTemplate.innerHTML));
362
- }), e.columns = i), this.#u && (e.fitMode = this.#u), e.fitMode || (e.fitMode = "stretch"), this.#C(e), e.columnState && !this.#v && (this.#v = e.columnState), e;
371
+ s.__viewTemplate && !s.__compiledView && (s.__compiledView = Ee(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = Ee(s.__editorTemplate.innerHTML));
372
+ }), e.columns = i), this.#u && (e.fitMode = this.#u), e.fitMode || (e.fitMode = "stretch"), this.#y(e), e.columnState && !this.#m && (this.#m = e.columnState), e;
363
373
  }
364
- #C(e) {
374
+ #y(e) {
365
375
  e.shell = e.shell ? { ...e.shell } : {}, e.shell.header = e.shell.header ? { ...e.shell.header } : {};
366
376
  const o = this.#r.getShellLightDomTitle();
367
- o && (this.#w = o), this.#w && !e.shell.header.title && (e.shell.header.title = this.#w);
377
+ o && (this.#g = o), this.#g && !e.shell.header.title && (e.shell.header.title = this.#g);
368
378
  const n = this.#r.getShellLightDomHeaderContent();
369
379
  n?.length > 0 && (e.shell.header.lightDomContent = n), this.#r.getShellHasToolButtonsContainer() && (e.shell.header.hasToolButtonsContainer = !0);
370
380
  const i = this.#r.getShellToolPanels();
@@ -383,7 +393,7 @@ class gt {
383
393
  d.sort((u, p) => (u.order ?? 0) - (p.order ?? 0)), e.shell.header.toolbarContents = d;
384
394
  }
385
395
  collectState(e) {
386
- const o = this.columns, n = this.#y();
396
+ const o = this.columns, n = this.#v();
387
397
  return {
388
398
  columns: o.map((i, r) => {
389
399
  const s = {
@@ -430,7 +440,7 @@ class gt {
430
440
  l.applyColumnState(a.field, a);
431
441
  }
432
442
  resetState(e) {
433
- this.#v = void 0, this.#r.setSortState(null), this.#n = this.#R(this.#a), this.#H();
443
+ this.#m = void 0, this.#r.setSortState(null), this.#n = this.#x(this.#a), this.#D();
434
444
  for (const o of e)
435
445
  if (o.applyColumnState)
436
446
  for (const n of this.columns)
@@ -441,7 +451,7 @@ class gt {
441
451
  });
442
452
  this.requestStateChange(e);
443
453
  }
444
- #y() {
454
+ #v() {
445
455
  const e = /* @__PURE__ */ new Map(), o = this.#r.getSortState();
446
456
  return o && e.set(o.field, {
447
457
  direction: o.direction === 1 ? "asc" : "desc",
@@ -453,7 +463,7 @@ class gt {
453
463
  this.#s = void 0;
454
464
  const o = this.collectState(e);
455
465
  this.#r.emit("column-state-change", o);
456
- }, pt);
466
+ }, bt);
457
467
  }
458
468
  setColumnVisible(e, o) {
459
469
  const n = this.columns, i = n.find((s) => s.field === e);
@@ -501,42 +511,42 @@ class gt {
501
511
  this.columns = n, this.#r.renderHeader(), this.#r.updateTemplate(), this.#r.refreshVirtualWindow();
502
512
  }
503
513
  parseLightDomColumns(e) {
504
- this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ? et(e) : []);
514
+ this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ? nt(e) : []);
505
515
  }
506
516
  clearLightDomCache() {
507
517
  this.#d = void 0;
508
518
  }
509
- #p = /* @__PURE__ */ new Map();
519
+ #_ = /* @__PURE__ */ new Map();
510
520
  registerLightDomHandler(e, o) {
511
- this.#p.set(e.toLowerCase(), o);
521
+ this.#_.set(e.toLowerCase(), o);
512
522
  }
513
523
  unregisterLightDomHandler(e) {
514
- this.#p.delete(e.toLowerCase());
524
+ this.#_.delete(e.toLowerCase());
515
525
  }
516
526
  observeLightDOM(e) {
517
- this.#m && this.#m.disconnect();
527
+ this.#b && this.#b.disconnect();
518
528
  const o = /* @__PURE__ */ new Set();
519
529
  let n = null;
520
530
  const i = () => {
521
531
  n = null;
522
532
  for (const r of o)
523
- this.#p.get(r)?.();
533
+ this.#_.get(r)?.();
524
534
  o.clear();
525
535
  };
526
- this.#m = new MutationObserver((r) => {
536
+ this.#b = new MutationObserver((r) => {
527
537
  for (const s of r) {
528
538
  for (const l of s.addedNodes) {
529
539
  if (l.nodeType !== Node.ELEMENT_NODE) continue;
530
540
  const c = l.tagName.toLowerCase();
531
- this.#p.has(c) && o.add(c);
541
+ this.#_.has(c) && o.add(c);
532
542
  }
533
543
  if (s.type === "attributes" && s.target.nodeType === Node.ELEMENT_NODE) {
534
544
  const a = s.target.tagName.toLowerCase();
535
- this.#p.has(a) && o.add(a);
545
+ this.#_.has(a) && o.add(a);
536
546
  }
537
547
  }
538
548
  o.size > 0 && !n && (n = setTimeout(i, 0));
539
- }), this.#m.observe(e, {
549
+ }), this.#b.observe(e, {
540
550
  childList: !0,
541
551
  subtree: !0,
542
552
  attributes: !0,
@@ -544,20 +554,20 @@ class gt {
544
554
  });
545
555
  }
546
556
  onChange(e) {
547
- this.#g.push(e);
557
+ this.#p.push(e);
548
558
  }
549
559
  notifyChange() {
550
- for (const e of this.#g)
560
+ for (const e of this.#p)
551
561
  e();
552
562
  }
553
563
  dispose() {
554
- this.#m?.disconnect(), this.#g = [], this.#s && clearTimeout(this.#s);
564
+ this.#b?.disconnect(), this.#p = [], this.#s && clearTimeout(this.#s);
555
565
  }
556
566
  }
557
- function Ie(t) {
567
+ function We(t) {
558
568
  return `<span role="checkbox" aria-checked="${t}" aria-label="${t}">${t ? "&#x1F5F9;" : "&#9744;"}</span>`;
559
569
  }
560
- function qe(t) {
570
+ function Fe(t) {
561
571
  if (t == null || t === "") return "";
562
572
  if (t instanceof Date)
563
573
  return isNaN(t.getTime()) ? "" : t.toLocaleDateString();
@@ -567,7 +577,7 @@ function qe(t) {
567
577
  }
568
578
  return "";
569
579
  }
570
- function We(t) {
580
+ function Ue(t) {
571
581
  if (!t) return -1;
572
582
  const e = t.getAttribute("data-row");
573
583
  if (e) return parseInt(e, 10);
@@ -580,15 +590,15 @@ function We(t) {
580
590
  if (i[r] === o) return r;
581
591
  return -1;
582
592
  }
583
- function wt(t) {
593
+ function vt(t) {
584
594
  if (!t) return -1;
585
595
  const e = t.getAttribute("data-col");
586
596
  return e ? parseInt(e, 10) : -1;
587
597
  }
588
- function fe(t) {
598
+ function we(t) {
589
599
  t && t.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
590
600
  }
591
- function bt(t) {
601
+ function Ct(t) {
592
602
  try {
593
603
  if (getComputedStyle(t).direction === "rtl") return "rtl";
594
604
  } catch {
@@ -599,64 +609,58 @@ function bt(t) {
599
609
  }
600
610
  return "ltr";
601
611
  }
602
- function _e(t) {
603
- return bt(t) === "rtl";
612
+ function Se(t) {
613
+ return Ct(t) === "rtl";
604
614
  }
605
- function po(t, e) {
615
+ function Io(t, e) {
606
616
  return t === "left" || t === "right" ? t : e === "rtl" ? t === "start" ? "right" : "left" : t === "start" ? "left" : "right";
607
617
  }
608
- function $e(t, e) {
618
+ function Ve(t, e) {
609
619
  const o = e.renderer || e.viewRenderer;
610
620
  if (o) return o;
611
621
  if (!e.type) return;
612
- const n = t.effectiveConfig?.typeDefaults;
613
- if (n?.[e.type]?.renderer)
614
- return n[e.type].renderer;
615
- const i = t.__frameworkAdapter;
616
- if (i?.getTypeDefault) {
617
- const r = i.getTypeDefault(e.type);
618
- if (r?.renderer)
619
- return r.renderer;
622
+ const n = t.__frameworkAdapter;
623
+ if (n?.getTypeDefault) {
624
+ const i = n.getTypeDefault(e.type);
625
+ if (i?.renderer)
626
+ return i.renderer;
620
627
  }
621
628
  }
622
- function Fe(t, e) {
629
+ function Be(t, e) {
623
630
  if (e.format) return e.format;
624
631
  if (!e.type) return;
625
- const o = t.effectiveConfig?.typeDefaults;
626
- if (o?.[e.type]?.format)
627
- return o[e.type].format;
628
- const n = t.__frameworkAdapter;
629
- if (n?.getTypeDefault) {
630
- const i = n.getTypeDefault(e.type);
631
- if (i?.format)
632
- return i.format;
632
+ const o = t.__frameworkAdapter;
633
+ if (o?.getTypeDefault) {
634
+ const n = o.getTypeDefault(e.type);
635
+ if (n?.format)
636
+ return n.format;
633
637
  }
634
638
  }
635
- const Ue = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
636
- function re(t) {
639
+ const Ge = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
640
+ function se(t) {
637
641
  return (t.__editingCellCount ?? 0) > 0;
638
642
  }
639
- function se(t) {
643
+ function le(t) {
640
644
  t.__editingCellCount = 0, t.removeAttribute("data-has-editing"), t.querySelectorAll(".cell.editing").forEach((o) => o.classList.remove("editing"));
641
645
  }
642
- const Ve = document.createElement("template");
643
- Ve.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
644
- const Be = document.createElement("template");
645
- Be.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
646
- function mt() {
647
- return Ve.content.firstElementChild.cloneNode(!0);
646
+ const Xe = document.createElement("template");
647
+ Xe.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
648
+ const Ye = document.createElement("template");
649
+ Ye.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
650
+ function yt() {
651
+ return Xe.content.firstElementChild.cloneNode(!0);
648
652
  }
649
- function vt() {
650
- return Be.content.firstElementChild.cloneNode(!0);
653
+ function _t() {
654
+ return Ye.content.firstElementChild.cloneNode(!0);
651
655
  }
652
656
  function j(t) {
653
657
  t.__cellDisplayCache = void 0, t.__cellCacheEpoch = void 0, t.__hasSpecialColumns = void 0;
654
658
  }
655
- function Ct(t, e, o, n, i) {
659
+ function Et(t, e, o, n, i) {
656
660
  const r = Math.max(0, o - e), s = t._bodyEl, l = t._visibleColumns, a = l.length;
657
661
  let c = t.__cachedHeaderRowCount;
658
662
  for (c === void 0 && (c = t.querySelector(".header-group-row") ? 2 : 1, t.__cachedHeaderRowCount = c); t._rowPool.length < r; ) {
659
- const p = vt();
663
+ const p = _t();
660
664
  t._rowPool.push(p);
661
665
  }
662
666
  if (t._rowPool.length > r) {
@@ -673,24 +677,24 @@ function Ct(t, e, o, n, i) {
673
677
  h.__epoch = n, h.__rowDataRef = g, h.parentNode !== s && s.appendChild(h);
674
678
  continue;
675
679
  }
676
- const w = h.__epoch, b = h.__rowDataRef, S = h.children.length, _ = w === n && S === a, A = b !== g;
677
- let v = !1;
680
+ const w = h.__epoch, v = h.__rowDataRef, S = h.children.length, _ = w === n && S === a, A = v !== g;
681
+ let m = !1;
678
682
  if (_ && A) {
679
683
  for (let R = 0; R < a; R++)
680
684
  if (l[R].externalView && !h.querySelector(`.cell[data-col="${R}"] [data-external-view]`)) {
681
- v = !0;
685
+ m = !0;
682
686
  break;
683
687
  }
684
688
  }
685
- if (!_ || v) {
686
- const R = re(h), x = t._activeEditRows === f;
687
- R && !x ? (h.__isCustomRow && (h.className = "data-grid-row", h.setAttribute("role", "row"), h.__isCustomRow = !1), se(h), G(t, h, g, f), h.__epoch = n, h.__rowDataRef = g) : R && x ? (le(t, h, g, f), h.__rowDataRef = g) : (h.__isCustomRow && (h.className = "data-grid-row", h.setAttribute("role", "row"), h.__isCustomRow = !1), G(t, h, g, f), h.__epoch = n, h.__rowDataRef = g);
689
+ if (!_ || m) {
690
+ const R = se(h), x = t._activeEditRows === f;
691
+ R && !x ? (h.__isCustomRow && (h.className = "data-grid-row", h.setAttribute("role", "row"), h.__isCustomRow = !1), le(h), G(t, h, g, f), h.__epoch = n, h.__rowDataRef = g) : R && x ? (ae(t, h, g, f), h.__rowDataRef = g) : (h.__isCustomRow && (h.className = "data-grid-row", h.setAttribute("role", "row"), h.__isCustomRow = !1), G(t, h, g, f), h.__epoch = n, h.__rowDataRef = g);
688
692
  } else if (A) {
689
- const R = re(h), x = t._activeEditRows === f;
690
- R && !x ? (se(h), G(t, h, g, f), h.__epoch = n, h.__rowDataRef = g) : (le(t, h, g, f), h.__rowDataRef = g);
693
+ const R = se(h), x = t._activeEditRows === f;
694
+ R && !x ? (le(h), G(t, h, g, f), h.__epoch = n, h.__rowDataRef = g) : (ae(t, h, g, f), h.__rowDataRef = g);
691
695
  } else {
692
- const R = re(h), x = t._activeEditRows === f;
693
- R && !x ? (se(h), G(t, h, g, f), h.__epoch = n, h.__rowDataRef = g) : le(t, h, g, f);
696
+ const R = se(h), x = t._activeEditRows === f;
697
+ R && !x ? (le(h), G(t, h, g, f), h.__epoch = n, h.__rowDataRef = g) : ae(t, h, g, f);
694
698
  }
695
699
  let E = !1;
696
700
  const y = t.changedRowIds;
@@ -700,8 +704,8 @@ function Ct(t, e, o, n, i) {
700
704
  R && (E = y.includes(R));
701
705
  } catch {
702
706
  }
703
- const m = h.classList.contains("changed");
704
- E !== m && h.classList.toggle("changed", E);
707
+ const b = h.classList.contains("changed");
708
+ E !== b && h.classList.toggle("changed", E);
705
709
  const z = t.effectiveConfig?.rowClass;
706
710
  if (z) {
707
711
  const R = h.getAttribute("data-dynamic-classes");
@@ -709,8 +713,8 @@ function Ct(t, e, o, n, i) {
709
713
  try {
710
714
  const x = z(g);
711
715
  if (x && x.length > 0) {
712
- const ie = x.filter((Y) => Y && typeof Y == "string");
713
- ie.forEach((Y) => h.classList.add(Y)), h.setAttribute("data-dynamic-classes", ie.join(" "));
716
+ const re = x.filter((Y) => Y && typeof Y == "string");
717
+ re.forEach((Y) => h.classList.add(Y)), h.setAttribute("data-dynamic-classes", re.join(" "));
714
718
  } else
715
719
  h.removeAttribute("data-dynamic-classes");
716
720
  } catch (x) {
@@ -724,15 +728,15 @@ function Ct(t, e, o, n, i) {
724
728
  }), h.parentNode !== s && s.appendChild(h);
725
729
  }
726
730
  }
727
- function le(t, e, o, n) {
731
+ function ae(t, e, o, n) {
728
732
  const i = e.children, r = t._visibleColumns, s = r.length, l = i.length, a = s < l ? s : l, c = t._focusRow, d = t._focusCol, u = t._hasAfterCellRenderHook?.() ?? !1;
729
733
  let p = t.__hasSpecialColumns;
730
734
  if (p === void 0) {
731
735
  p = !1;
732
- const g = t.effectiveConfig?.typeDefaults, h = t.__frameworkAdapter;
733
- for (let w = 0; w < s; w++) {
734
- const b = r[w];
735
- if (b.__viewTemplate || b.__compiledView || b.renderer || b.viewRenderer || b.externalView || b.format || b.type === "date" || b.type === "boolean" || b.type && g?.[b.type]?.renderer || b.type && g?.[b.type]?.format || b.type && h?.getTypeDefault?.(b.type)?.renderer || b.type && h?.getTypeDefault?.(b.type)?.format) {
736
+ const g = t.__frameworkAdapter;
737
+ for (let h = 0; h < s; h++) {
738
+ const w = r[h];
739
+ if (w.__viewTemplate || w.__compiledView || w.renderer || w.viewRenderer || w.externalView || w.format || w.type === "date" || w.type === "boolean" || w.type && g?.getTypeDefault?.(w.type)?.renderer || w.type && g?.getTypeDefault?.(w.type)?.format) {
736
740
  p = !0;
737
741
  break;
738
742
  }
@@ -744,15 +748,15 @@ function le(t, e, o, n) {
744
748
  for (let g = 0; g < a; g++) {
745
749
  const h = i[g];
746
750
  if (h.classList.contains("editing")) continue;
747
- const w = r[g], b = o[w.field];
748
- h.textContent = b == null ? "" : String(b), h.getAttribute("data-row") !== f && h.setAttribute("data-row", f);
751
+ const w = r[g], v = o[w.field];
752
+ h.textContent = v == null ? "" : String(v), h.getAttribute("data-row") !== f && h.setAttribute("data-row", f);
749
753
  const S = c === n && d === g, C = h.classList.contains("cell-focus");
750
754
  S !== C && (h.classList.toggle("cell-focus", S), h.setAttribute("aria-selected", String(S))), u && t._afterCellRender?.({
751
755
  row: o,
752
756
  rowIndex: n,
753
757
  column: w,
754
758
  colIndex: g,
755
- value: b,
759
+ value: v,
756
760
  cellElement: h,
757
761
  rowElement: e
758
762
  });
@@ -767,34 +771,34 @@ function le(t, e, o, n) {
767
771
  for (let g = 0; g < a; g++) {
768
772
  const h = r[g], w = i[g];
769
773
  w.getAttribute("data-row") !== f && w.setAttribute("data-row", f);
770
- const b = c === n && d === g, S = w.classList.contains("cell-focus");
771
- b !== S && (w.classList.toggle("cell-focus", b), w.setAttribute("aria-selected", String(b)));
774
+ const v = c === n && d === g, S = w.classList.contains("cell-focus");
775
+ v !== S && (w.classList.toggle("cell-focus", v), w.setAttribute("aria-selected", String(v)));
772
776
  const C = h.cellClass;
773
777
  if (C) {
774
778
  const y = w.getAttribute("data-dynamic-classes");
775
- y && y.split(" ").forEach((m) => m && w.classList.remove(m));
779
+ y && y.split(" ").forEach((b) => b && w.classList.remove(b));
776
780
  try {
777
- const m = o[h.field], z = C(m, o, h);
781
+ const b = o[h.field], z = C(b, o, h);
778
782
  if (z && z.length > 0) {
779
783
  const R = z.filter((x) => x && typeof x == "string");
780
784
  R.forEach((x) => w.classList.add(x)), w.setAttribute("data-dynamic-classes", R.join(" "));
781
785
  } else
782
786
  w.removeAttribute("data-dynamic-classes");
783
- } catch (m) {
784
- console.warn(`[tbw-grid] cellClass callback error for column '${h.field}':`, m), w.removeAttribute("data-dynamic-classes");
787
+ } catch (b) {
788
+ console.warn(`[tbw-grid] cellClass callback error for column '${h.field}':`, b), w.removeAttribute("data-dynamic-classes");
785
789
  }
786
790
  }
787
791
  if (w.classList.contains("editing")) continue;
788
- const _ = $e(t, h);
792
+ const _ = Ve(t, h);
789
793
  if (_) {
790
- const y = o[h.field], m = _({
794
+ const y = o[h.field], b = _({
791
795
  row: o,
792
796
  value: y,
793
797
  field: h.field,
794
798
  column: h,
795
799
  cellEl: w
796
800
  });
797
- typeof m == "string" ? w.innerHTML = F(m) : m instanceof Node ? m.parentElement !== w && (w.innerHTML = "", w.appendChild(m)) : m == null && (w.textContent = y == null ? "" : String(y)), u && t._afterCellRender?.({
801
+ typeof b == "string" ? w.innerHTML = F(b) : b instanceof Node ? b.parentElement !== w && (w.innerHTML = "", w.appendChild(b)) : b == null && (w.textContent = y == null ? "" : String(y)), u && t._afterCellRender?.({
798
802
  row: o,
799
803
  rowIndex: n,
800
804
  column: h,
@@ -808,17 +812,17 @@ function le(t, e, o, n) {
808
812
  if (h.__viewTemplate || h.__compiledView || h.externalView)
809
813
  continue;
810
814
  const A = o[h.field];
811
- let v;
812
- const E = Fe(t, h);
815
+ let m;
816
+ const E = Be(t, h);
813
817
  if (E) {
814
818
  try {
815
819
  const y = E(A, o);
816
- v = y == null ? "" : String(y);
820
+ m = y == null ? "" : String(y);
817
821
  } catch (y) {
818
- console.warn(`[tbw-grid] Format error in column '${h.field}':`, y), v = A == null ? "" : String(A);
822
+ console.warn(`[tbw-grid] Format error in column '${h.field}':`, y), m = A == null ? "" : String(A);
819
823
  }
820
- w.textContent = v;
821
- } else h.type === "date" ? (v = qe(A), w.textContent = v) : h.type === "boolean" ? w.innerHTML = Ie(!!A) : (v = A == null ? "" : String(A), w.textContent = v);
824
+ w.textContent = m;
825
+ } else h.type === "date" ? (m = Fe(A), w.textContent = m) : h.type === "boolean" ? w.innerHTML = We(!!A) : (m = A == null ? "" : String(A), w.textContent = m);
822
826
  u && t._afterCellRender?.({
823
827
  row: o,
824
828
  rowIndex: n,
@@ -834,30 +838,30 @@ function G(t, e, o, n) {
834
838
  e.innerHTML = "";
835
839
  const i = t._visibleColumns, r = i.length, s = t._focusRow, l = t._focusCol, a = t, c = t._hasAfterCellRenderHook?.() ?? !1, d = document.createDocumentFragment();
836
840
  for (let u = 0; u < r; u++) {
837
- const p = i[u], f = mt();
841
+ const p = i[u], f = yt();
838
842
  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);
839
843
  let g = o[p.field];
840
- const h = Fe(t, p);
844
+ const h = Be(t, p);
841
845
  if (h)
842
846
  try {
843
847
  g = h(g, o);
844
- } catch (v) {
845
- console.warn(`[tbw-grid] Format error in column '${p.field}':`, v);
848
+ } catch (m) {
849
+ console.warn(`[tbw-grid] Format error in column '${p.field}':`, m);
846
850
  }
847
- const w = p.__compiledView, b = p.__viewTemplate, S = $e(t, p), C = p.externalView;
851
+ const w = p.__compiledView, v = p.__viewTemplate, S = Ve(t, p), C = p.externalView;
848
852
  let _ = !1;
849
853
  if (S) {
850
- const v = S({ row: o, value: g, field: p.field, column: p, cellEl: f });
851
- typeof v == "string" ? (f.innerHTML = F(v), _ = !0) : v instanceof Node ? v.parentElement !== f && (f.textContent = "", f.appendChild(v)) : v == null && (f.textContent = g == null ? "" : String(g));
854
+ const m = S({ row: o, value: g, field: p.field, column: p, cellEl: f });
855
+ typeof m == "string" ? (f.innerHTML = F(m), _ = !0) : m instanceof Node ? m.parentElement !== f && (f.textContent = "", f.appendChild(m)) : m == null && (f.textContent = g == null ? "" : String(g));
852
856
  } else if (C) {
853
- const v = C, E = document.createElement("div");
857
+ const m = C, E = document.createElement("div");
854
858
  E.setAttribute("data-external-view", ""), E.setAttribute("data-field", p.field), f.appendChild(E);
855
859
  const y = { row: o, value: g, field: p.field, column: p };
856
- if (v.mount)
860
+ if (m.mount)
857
861
  try {
858
- v.mount({ placeholder: E, context: y, spec: v });
859
- } catch (m) {
860
- console.warn(`[tbw-grid] External view mount error for column '${p.field}':`, m);
862
+ m.mount({ placeholder: E, context: y, spec: m });
863
+ } catch (b) {
864
+ console.warn(`[tbw-grid] External view mount error for column '${p.field}':`, b);
861
865
  }
862
866
  else
863
867
  queueMicrotask(() => {
@@ -866,38 +870,38 @@ function G(t, e, o, n) {
866
870
  new CustomEvent("mount-external-view", {
867
871
  bubbles: !0,
868
872
  composed: !0,
869
- detail: { placeholder: E, spec: v, context: y }
873
+ detail: { placeholder: E, spec: m, context: y }
870
874
  })
871
875
  );
872
- } catch (m) {
873
- console.warn(`[tbw-grid] External view event dispatch error for column '${p.field}':`, m);
876
+ } catch (b) {
877
+ console.warn(`[tbw-grid] External view event dispatch error for column '${p.field}':`, b);
874
878
  }
875
879
  });
876
880
  E.setAttribute("data-mounted", "");
877
881
  } else if (w) {
878
- const v = w({ row: o, value: g, field: p.field, column: p }), E = w.__blocked;
879
- f.innerHTML = E ? "" : F(v), _ = !0, E && (f.textContent = "", f.setAttribute("data-blocked-template", ""));
880
- } else if (b) {
881
- const v = b.innerHTML;
882
- /Reflect\.|\bProxy\b|ownKeys\(/.test(v) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = F(Ne(v, { row: o, value: g })), _ = !0);
882
+ const m = w({ row: o, value: g, field: p.field, column: p }), E = w.__blocked;
883
+ f.innerHTML = E ? "" : F(m), _ = !0, E && (f.textContent = "", f.setAttribute("data-blocked-template", ""));
884
+ } else if (v) {
885
+ const m = v.innerHTML;
886
+ /Reflect\.|\bProxy\b|ownKeys\(/.test(m) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = F($e(m, { row: o, value: g })), _ = !0);
883
887
  } else
884
- h ? f.textContent = g == null ? "" : String(g) : p.type === "date" ? f.textContent = qe(g) : p.type === "boolean" ? f.innerHTML = Ie(!!g) : f.textContent = g == null ? "" : String(g);
888
+ h ? f.textContent = g == null ? "" : String(g) : p.type === "date" ? f.textContent = Fe(g) : p.type === "boolean" ? f.innerHTML = We(!!g) : f.textContent = g == null ? "" : String(g);
885
889
  if (_) {
886
- ft(f);
887
- const v = f.textContent || "";
888
- /Proxy|Reflect\.ownKeys/.test(v) && (f.textContent = v.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(f.textContent || "") && (f.textContent = ""));
890
+ wt(f);
891
+ const m = f.textContent || "";
892
+ /Proxy|Reflect\.ownKeys/.test(m) && (f.textContent = m.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(f.textContent || "") && (f.textContent = ""));
889
893
  }
890
894
  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");
891
895
  const A = p.cellClass;
892
896
  if (A)
893
897
  try {
894
- const v = o[p.field], E = A(v, o, p);
898
+ const m = o[p.field], E = A(m, o, p);
895
899
  if (E && E.length > 0) {
896
- const y = E.filter((m) => m && typeof m == "string");
897
- y.forEach((m) => f.classList.add(m)), f.setAttribute("data-dynamic-classes", y.join(" "));
900
+ const y = E.filter((b) => b && typeof b == "string");
901
+ y.forEach((b) => f.classList.add(b)), f.setAttribute("data-dynamic-classes", y.join(" "));
898
902
  }
899
- } catch (v) {
900
- console.warn(`[tbw-grid] cellClass callback error for column '${p.field}':`, v);
903
+ } catch (m) {
904
+ console.warn(`[tbw-grid] cellClass callback error for column '${p.field}':`, m);
901
905
  }
902
906
  c && t._afterCellRender?.({
903
907
  row: o,
@@ -911,9 +915,9 @@ function G(t, e, o, n) {
911
915
  }
912
916
  e.appendChild(d);
913
917
  }
914
- function Ee(t, e, o) {
918
+ function Re(t, e, o) {
915
919
  if (e.target?.closest(".resize-handle")) return;
916
- const n = o.querySelector(".cell[data-row]"), i = We(n);
920
+ const n = o.querySelector(".cell[data-row]"), i = Ue(n);
917
921
  if (i < 0) return;
918
922
  const r = t._rows[i];
919
923
  if (!r || t._dispatchRowClick?.(e, i, r, o))
@@ -926,19 +930,19 @@ function Ee(t, e, o) {
926
930
  return;
927
931
  const a = t._focusRow !== i || t._focusCol !== l;
928
932
  if (t._focusRow = i, t._focusCol = l, s.classList.contains("editing")) {
929
- a && (fe(t._bodyEl ?? t), s.classList.add("cell-focus"));
930
- const c = s.querySelector(Ue);
933
+ a && (we(t._bodyEl ?? t), s.classList.add("cell-focus"));
934
+ const c = s.querySelector(Ge);
931
935
  try {
932
936
  c?.focus({ preventScroll: !0 });
933
937
  } catch {
934
938
  }
935
939
  return;
936
940
  }
937
- $(t);
941
+ W(t);
938
942
  }
939
943
  }
940
944
  }
941
- function yt(t, e) {
945
+ function St(t, e) {
942
946
  if (t._dispatchKeyDown?.(e))
943
947
  return;
944
948
  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?.() ?? [], a = l.length ? l[0] : e.target, c = (d) => {
@@ -949,7 +953,7 @@ function yt(t, e) {
949
953
  if (!(c(a) && (e.key === "Home" || e.key === "End")) && !(c(a) && (e.key === "ArrowUp" || e.key === "ArrowDown") && a.tagName === "INPUT" && a.type === "number") && !(c(a) && (e.key === "ArrowLeft" || e.key === "ArrowRight")) && !(c(a) && (e.key === "Enter" || e.key === "Escape")) && !(i && s === "select" && (e.key === "ArrowDown" || e.key === "ArrowUp"))) {
950
954
  switch (e.key) {
951
955
  case "Tab": {
952
- 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);
956
+ 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);
953
957
  return;
954
958
  }
955
959
  case "ArrowDown":
@@ -959,18 +963,18 @@ function yt(t, e) {
959
963
  i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = Math.max(0, t._focusRow - 1), e.preventDefault();
960
964
  break;
961
965
  case "ArrowRight": {
962
- _e(t) ? t._focusCol = Math.max(0, t._focusCol - 1) : t._focusCol = Math.min(n, t._focusCol + 1), e.preventDefault();
966
+ Se(t) ? t._focusCol = Math.max(0, t._focusCol - 1) : t._focusCol = Math.min(n, t._focusCol + 1), e.preventDefault();
963
967
  break;
964
968
  }
965
969
  case "ArrowLeft": {
966
- _e(t) ? t._focusCol = Math.min(n, t._focusCol + 1) : t._focusCol = Math.max(0, t._focusCol - 1), e.preventDefault();
970
+ Se(t) ? t._focusCol = Math.min(n, t._focusCol + 1) : t._focusCol = Math.max(0, t._focusCol - 1), e.preventDefault();
967
971
  break;
968
972
  }
969
973
  case "Home":
970
- (e.ctrlKey || e.metaKey) && (i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(), $(t, { forceScrollLeft: !0 });
974
+ (e.ctrlKey || e.metaKey) && (i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(), W(t, { forceScrollLeft: !0 });
971
975
  return;
972
976
  case "End":
973
- (e.ctrlKey || e.metaKey) && (i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = o), t._focusCol = n, e.preventDefault(), $(t, { forceScrollRight: !0 });
977
+ (e.ctrlKey || e.metaKey) && (i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = o), t._focusCol = n, e.preventDefault(), W(t, { forceScrollRight: !0 });
974
978
  return;
975
979
  case "PageDown":
976
980
  t._focusRow = Math.min(o, t._focusRow + 20), e.preventDefault();
@@ -981,7 +985,7 @@ function yt(t, e) {
981
985
  case "Enter": {
982
986
  const d = t._focusRow, u = t._focusCol, p = t._visibleColumns[u], f = t._rows[d], g = p?.field ?? "", h = g && f ? f[g] : void 0, w = t.querySelector(
983
987
  `[data-row="${d}"][data-col="${u}"]`
984
- ), b = {
988
+ ), v = {
985
989
  rowIndex: d,
986
990
  colIndex: u,
987
991
  field: g,
@@ -992,7 +996,7 @@ function yt(t, e) {
992
996
  originalEvent: e
993
997
  }, S = new CustomEvent("cell-activate", {
994
998
  cancelable: !0,
995
- detail: b
999
+ detail: v
996
1000
  });
997
1001
  t.dispatchEvent(S);
998
1002
  const C = new CustomEvent("activate-cell", {
@@ -1008,10 +1012,10 @@ function yt(t, e) {
1008
1012
  default:
1009
1013
  return;
1010
1014
  }
1011
- $(t);
1015
+ W(t);
1012
1016
  }
1013
1017
  }
1014
- function $(t, e) {
1018
+ function W(t, e) {
1015
1019
  if (t._virtualization?.enabled) {
1016
1020
  const { rowHeight: s, container: l, viewportEl: a } = t._virtualization, c = l, d = a?.clientHeight ?? c?.clientHeight ?? 0;
1017
1021
  if (c && d > 0) {
@@ -1020,7 +1024,7 @@ function $(t, e) {
1020
1024
  }
1021
1025
  }
1022
1026
  const o = t._activeEditRows !== void 0 && t._activeEditRows !== -1;
1023
- o || t.refreshVirtualWindow(!1), fe(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
1027
+ o || t.refreshVirtualWindow(!1), we(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
1024
1028
  s.setAttribute("aria-selected", "false");
1025
1029
  });
1026
1030
  const n = t._focusRow, i = t._virtualization.start ?? 0, r = t._virtualization.end ?? t._rows.length;
@@ -1030,7 +1034,7 @@ function $(t, e) {
1030
1034
  if ((!l || !l.classList?.contains("cell")) && (l = s?.querySelector(`.cell[data-col="${t._focusCol}"]`) ?? s?.querySelector(".cell[data-col]")), l) {
1031
1035
  l.classList.add("cell-focus"), l.setAttribute("aria-selected", "true");
1032
1036
  const a = t.querySelector(".tbw-scroll-area");
1033
- if (a && l && !o)
1037
+ if (a && l && (!o || e?.forceHorizontalScroll))
1034
1038
  if (e?.forceScrollLeft)
1035
1039
  a.scrollLeft = 0;
1036
1040
  else if (e?.forceScrollRight)
@@ -1043,7 +1047,7 @@ function $(t, e) {
1043
1047
  }
1044
1048
  }
1045
1049
  if (t._activeEditRows !== void 0 && t._activeEditRows !== -1 && l.classList.contains("editing")) {
1046
- const c = l.querySelector(Ue);
1050
+ const c = l.querySelector(Ge);
1047
1051
  if (c && document.activeElement !== c)
1048
1052
  try {
1049
1053
  c.focus({ preventScroll: !0 });
@@ -1059,12 +1063,12 @@ function $(t, e) {
1059
1063
  }
1060
1064
  }
1061
1065
  }
1062
- const oe = /* @__PURE__ */ new WeakMap();
1063
- function _t(t, e) {
1064
- const o = We(e), n = wt(e);
1065
- o < 0 || n < 0 || (t._focusRow = o, t._focusCol = n, fe(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
1066
+ const ne = /* @__PURE__ */ new WeakMap();
1067
+ function Rt(t, e) {
1068
+ const o = Ue(e), n = vt(e);
1069
+ o < 0 || n < 0 || (t._focusRow = o, t._focusCol = n, we(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
1066
1070
  }
1067
- function pe(t, e, o, n) {
1071
+ function be(t, e, o, n) {
1068
1072
  let i = null;
1069
1073
  const r = o.composedPath?.();
1070
1074
  if (r && r.length > 0 ? i = r[0] : i = o.target, i && !e.contains(i)) {
@@ -1088,72 +1092,72 @@ function pe(t, e, o, n) {
1088
1092
  cell: c !== void 0 && d !== void 0 && c >= 0 && d >= 0 ? { row: c, col: d } : void 0
1089
1093
  };
1090
1094
  }
1091
- function Et(t, e, o) {
1092
- const n = pe(t, e, o, "mousedown");
1093
- (t._dispatchCellMouseDown?.(n) ?? !1) && oe.set(t, !0);
1095
+ function xt(t, e, o) {
1096
+ const n = be(t, e, o, "mousedown");
1097
+ (t._dispatchCellMouseDown?.(n) ?? !1) && ne.set(t, !0);
1094
1098
  }
1095
- function St(t, e, o) {
1096
- if (!oe.get(t)) return;
1097
- const n = pe(t, e, o, "mousemove");
1099
+ function At(t, e, o) {
1100
+ if (!ne.get(t)) return;
1101
+ const n = be(t, e, o, "mousemove");
1098
1102
  t._dispatchCellMouseMove?.(n);
1099
1103
  }
1100
- function Rt(t, e, o) {
1101
- if (!oe.get(t)) return;
1102
- const n = pe(t, e, o, "mouseup");
1103
- t._dispatchCellMouseUp?.(n), oe.set(t, !1);
1104
+ function Tt(t, e, o) {
1105
+ if (!ne.get(t)) return;
1106
+ const n = be(t, e, o, "mouseup");
1107
+ t._dispatchCellMouseUp?.(n), ne.set(t, !1);
1104
1108
  }
1105
- function xt(t, e, o) {
1109
+ function Pt(t, e, o) {
1106
1110
  e.addEventListener(
1107
1111
  "mousedown",
1108
1112
  (n) => {
1109
1113
  const i = n.target.closest(".cell[data-col]");
1110
- i && (i.classList.contains("editing") || _t(t, i));
1114
+ i && (i.classList.contains("editing") || Rt(t, i));
1111
1115
  },
1112
1116
  { signal: o }
1113
1117
  ), e.addEventListener(
1114
1118
  "click",
1115
1119
  (n) => {
1116
1120
  const i = n.target.closest(".data-grid-row");
1117
- i && Ee(t, n, i);
1121
+ i && Re(t, n, i);
1118
1122
  },
1119
1123
  { signal: o }
1120
1124
  ), e.addEventListener(
1121
1125
  "dblclick",
1122
1126
  (n) => {
1123
1127
  const i = n.target.closest(".data-grid-row");
1124
- i && Ee(t, n, i);
1128
+ i && Re(t, n, i);
1125
1129
  },
1126
1130
  { signal: o }
1127
1131
  );
1128
1132
  }
1129
- function At(t, e, o, n) {
1130
- e.addEventListener("keydown", (i) => yt(t, i), { signal: n }), o.addEventListener("mousedown", (i) => Et(t, o, i), { signal: n }), document.addEventListener("mousemove", (i) => St(t, o, i), { signal: n }), document.addEventListener("mouseup", (i) => Rt(t, o, i), { signal: n });
1133
+ function Lt(t, e, o, n) {
1134
+ e.addEventListener("keydown", (i) => St(t, i), { signal: n }), o.addEventListener("mousedown", (i) => xt(t, o, i), { signal: n }), document.addEventListener("mousemove", (i) => At(t, o, i), { signal: n }), document.addEventListener("mouseup", (i) => Tt(t, o, i), { signal: n });
1131
1135
  }
1132
- function Tt(t, e) {
1136
+ function Ht(t, e) {
1133
1137
  return t == null && e == null ? 0 : t == null ? -1 : e == null || t > e ? 1 : t < e ? -1 : 0;
1134
1138
  }
1135
- function Pt(t, e, o) {
1136
- const i = o.find((l) => l.field === e.field)?.sortComparator ?? Tt, { field: r, direction: s } = e;
1139
+ function Dt(t, e, o) {
1140
+ const i = o.find((l) => l.field === e.field)?.sortComparator ?? Ht, { field: r, direction: s } = e;
1137
1141
  return [...t].sort((l, a) => i(l[r], a[r], l, a) * s);
1138
1142
  }
1139
- function Se(t, e, o, n) {
1140
- t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((i) => i.__epoch = -1), ne(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
1143
+ function xe(t, e, o, n) {
1144
+ t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((i) => i.__epoch = -1), ie(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
1141
1145
  new CustomEvent("sort-change", { detail: { field: o.field, direction: n } })
1142
1146
  ), t.requestStateChange?.();
1143
1147
  }
1144
- function Re(t, e) {
1145
- !t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), xe(t, e, 1)) : t._sortState.direction === 1 ? xe(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), t._rows = t.__originalOrder.slice(), ne(t), t._headerRowEl?.querySelectorAll('[role="columnheader"].sortable')?.forEach((n) => {
1148
+ function Ae(t, e) {
1149
+ !t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), Te(t, e, 1)) : t._sortState.direction === 1 ? Te(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), t._rows = t.__originalOrder.slice(), ie(t), t._headerRowEl?.querySelectorAll('[role="columnheader"].sortable')?.forEach((n) => {
1146
1150
  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");
1147
1151
  }), t.refreshVirtualWindow(!0), t.dispatchEvent(
1148
1152
  new CustomEvent("sort-change", { detail: { field: e.field, direction: 0 } })
1149
1153
  ), t.requestStateChange?.());
1150
1154
  }
1151
- function xe(t, e, o) {
1155
+ function Te(t, e, o) {
1152
1156
  t._sortState = { field: e.field, direction: o };
1153
- const n = { field: e.field, direction: o }, i = t._columns, s = (t.effectiveConfig?.sortHandler ?? Pt)(t._rows, n, i);
1157
+ const n = { field: e.field, direction: o }, i = t._columns, s = (t.effectiveConfig?.sortHandler ?? Dt)(t._rows, n, i);
1154
1158
  s && typeof s.then == "function" ? s.then((l) => {
1155
- Se(t, l, e, o);
1156
- }) : Se(t, s, e, o);
1159
+ xe(t, l, e, o);
1160
+ }) : xe(t, s, e, o);
1157
1161
  }
1158
1162
  function U(t, e) {
1159
1163
  return t.effectiveConfig?.sortable !== !1 && e.sortable === !0;
@@ -1161,14 +1165,14 @@ function U(t, e) {
1161
1165
  function K(t, e) {
1162
1166
  return t.effectiveConfig?.resizable !== !1 && e.resizable !== !1;
1163
1167
  }
1164
- function Lt(t, e) {
1168
+ function Ot(t, e) {
1165
1169
  typeof e == "string" ? t.textContent = e : e instanceof HTMLElement && (t.innerHTML = "", t.appendChild(e.cloneNode(!0)));
1166
1170
  }
1167
1171
  function Q(t, e) {
1168
1172
  const o = document.createElement("span");
1169
- ke(o, "sort-indicator");
1170
- const n = t._sortState?.field === e.field ? t._sortState.direction : 0, i = { ...k, ...t.icons }, r = n === 1 ? i.sortAsc : n === -1 ? i.sortDesc : i.sortNone;
1171
- return Lt(o, r), o;
1173
+ qe(o, "sort-indicator");
1174
+ const n = t._sortState?.field === e.field ? t._sortState.direction : 0, i = { ...M, ...t.icons }, r = n === 1 ? i.sortAsc : n === -1 ? i.sortDesc : i.sortNone;
1175
+ return Ot(o, r), o;
1172
1176
  }
1173
1177
  function Z(t, e, o) {
1174
1178
  const n = document.createElement("div");
@@ -1182,15 +1186,15 @@ function J(t, e, o, n) {
1182
1186
  n.classList.add("sortable"), n.tabIndex = 0;
1183
1187
  const i = t._sortState?.field === e.field ? t._sortState.direction : 0;
1184
1188
  n.setAttribute("aria-sort", i === 0 ? "none" : i === 1 ? "ascending" : "descending"), n.addEventListener("click", (r) => {
1185
- t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, o, n) || Re(t, e);
1189
+ t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, o, n) || Ae(t, e);
1186
1190
  }), n.addEventListener("keydown", (r) => {
1187
1191
  if (r.key === "Enter" || r.key === " ") {
1188
1192
  if (r.preventDefault(), t._dispatchHeaderClick?.(r, o, n)) return;
1189
- Re(t, e);
1193
+ Ae(t, e);
1190
1194
  }
1191
1195
  });
1192
1196
  }
1193
- function Ht(t, e) {
1197
+ function zt(t, e) {
1194
1198
  if (e != null)
1195
1199
  if (typeof e == "string") {
1196
1200
  const o = document.createElement("span");
@@ -1198,12 +1202,12 @@ function Ht(t, e) {
1198
1202
  t.appendChild(o.firstChild);
1199
1203
  } else e instanceof Node && t.appendChild(e);
1200
1204
  }
1201
- function ne(t) {
1205
+ function ie(t) {
1202
1206
  t._headerRowEl = t.findHeaderRow();
1203
1207
  const e = t._headerRowEl;
1204
1208
  e && (e.innerHTML = "", t._visibleColumns.forEach((o, n) => {
1205
1209
  const i = document.createElement("div");
1206
- i.className = "cell", ke(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));
1210
+ i.className = "cell", qe(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));
1207
1211
  const r = o.header ?? o.field, s = t._sortState?.field === o.field ? t._sortState.direction : 0, l = s === 1 ? "asc" : s === -1 ? "desc" : null;
1208
1212
  if (o.headerRenderer) {
1209
1213
  const a = {
@@ -1215,7 +1219,7 @@ function ne(t) {
1215
1219
  renderSortIcon: () => U(t, o) ? Q(t, o) : null,
1216
1220
  renderFilterButton: () => null
1217
1221
  }, c = o.headerRenderer(a);
1218
- Ht(i, c), U(t, o) && J(t, o, n, i), K(t, o) && (i.classList.add("resizable"), i.appendChild(Z(t, n, i)));
1222
+ zt(i, c), U(t, o) && J(t, o, n, i), K(t, o) && (i.classList.add("resizable"), i.appendChild(Z(t, n, i)));
1219
1223
  } else if (o.headerLabelRenderer) {
1220
1224
  const a = {
1221
1225
  column: o,
@@ -1233,9 +1237,9 @@ function ne(t) {
1233
1237
  o.getAttribute("aria-sort") || o.setAttribute("aria-sort", "none");
1234
1238
  }), e.children.length > 0 ? (e.setAttribute("role", "row"), e.setAttribute("aria-rowindex", "1")) : (e.removeAttribute("role"), e.removeAttribute("aria-rowindex")));
1235
1239
  }
1236
- const Ge = typeof requestIdleCallback == "function";
1237
- function Dt(t, e) {
1238
- return Ge ? requestIdleCallback(t, e) : window.setTimeout(() => {
1240
+ const je = typeof requestIdleCallback == "function";
1241
+ function Mt(t, e) {
1242
+ return je ? requestIdleCallback(t, e) : window.setTimeout(() => {
1239
1243
  const o = Date.now();
1240
1244
  t({
1241
1245
  didTimeout: !1,
@@ -1243,11 +1247,42 @@ function Dt(t, e) {
1243
1247
  });
1244
1248
  }, 1);
1245
1249
  }
1246
- function Ae(t) {
1247
- Ge ? cancelIdleCallback(t) : clearTimeout(t);
1250
+ function Pe(t) {
1251
+ je ? cancelIdleCallback(t) : clearTimeout(t);
1252
+ }
1253
+ function kt(t) {
1254
+ const e = document.createElement("div");
1255
+ return e.className = `tbw-spinner tbw-spinner--${t}`, e.setAttribute("role", "progressbar"), e.setAttribute("aria-label", "Loading"), e;
1256
+ }
1257
+ function Nt(t, e) {
1258
+ if (e) {
1259
+ const n = e({ size: t });
1260
+ if (typeof n == "string") {
1261
+ const i = document.createElement("div");
1262
+ return i.innerHTML = n, i;
1263
+ }
1264
+ return n;
1265
+ }
1266
+ return kt(t);
1267
+ }
1268
+ function It(t) {
1269
+ const e = document.createElement("div");
1270
+ return e.className = "tbw-loading-overlay", e.setAttribute("role", "status"), e.setAttribute("aria-live", "polite"), e.appendChild(Nt("large", t)), e;
1271
+ }
1272
+ function qt(t, e) {
1273
+ t.appendChild(e);
1274
+ }
1275
+ function $t(t) {
1276
+ t?.remove();
1277
+ }
1278
+ function Wt(t, e) {
1279
+ e ? (t.classList.add("tbw-row-loading"), t.setAttribute("aria-busy", "true")) : (t.classList.remove("tbw-row-loading"), t.removeAttribute("aria-busy"));
1280
+ }
1281
+ function Ft(t, e) {
1282
+ e ? (t.classList.add("tbw-cell-loading"), t.setAttribute("aria-busy", "true")) : (t.classList.remove("tbw-cell-loading"), t.removeAttribute("aria-busy"));
1248
1283
  }
1249
1284
  var T = ((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))(T || {});
1250
- class Ot {
1285
+ class Ut {
1251
1286
  #l;
1252
1287
  #i = 0;
1253
1288
  #u = 0;
@@ -1259,7 +1294,7 @@ class Ot {
1259
1294
  this.#l = e;
1260
1295
  }
1261
1296
  requestPhase(e, o) {
1262
- e > this.#i && (this.#i = e), this.#u === 0 && (this.#f(), this.#u = requestAnimationFrame(() => this.#g()));
1297
+ e > this.#i && (this.#i = e), this.#u === 0 && (this.#f(), this.#u = requestAnimationFrame(() => this.#p()));
1263
1298
  }
1264
1299
  whenReady() {
1265
1300
  return this.#d ? this.#d : Promise.resolve();
@@ -1281,7 +1316,7 @@ class Ot {
1281
1316
  this.#h = e;
1282
1317
  }));
1283
1318
  }
1284
- #g() {
1319
+ #p() {
1285
1320
  if (this.#u = 0, !this.#l.isConnected()) {
1286
1321
  this.#i = 0, this.#h && (this.#h(), this.#h = null, this.#d = null);
1287
1322
  return;
@@ -1290,7 +1325,7 @@ class Ot {
1290
1325
  this.#i = 0, e >= 5 && this.#l.mergeConfig(), e >= 4 && this.#l.processRows(), e >= 5 && (this.#l.processColumns(), this.#l.updateTemplate()), e >= 3 && this.#l.renderHeader(), e >= 2 && this.#l.renderVirtualWindow(), e >= 1 && this.#l.afterRender(), !this.#n && this.#a && (this.#n = !0, this.#a()), this.#h && (this.#h(), this.#h = null, this.#d = null);
1291
1326
  }
1292
1327
  }
1293
- function Te(t) {
1328
+ function Le(t) {
1294
1329
  let e = null, o = null, n = null, i = null;
1295
1330
  const r = (a) => {
1296
1331
  if (!e) return;
@@ -1328,53 +1363,53 @@ function Te(t) {
1328
1363
  }
1329
1364
  };
1330
1365
  }
1331
- const ae = "data-animating", Mt = {
1366
+ const ce = "data-animating", Vt = {
1332
1367
  change: "--tbw-row-change-duration",
1333
1368
  insert: "--tbw-row-insert-duration",
1334
1369
  remove: "--tbw-row-remove-duration"
1335
- }, zt = {
1370
+ }, Bt = {
1336
1371
  change: 500,
1337
1372
  insert: 300,
1338
1373
  remove: 200
1339
1374
  };
1340
- function kt(t) {
1375
+ function Gt(t) {
1341
1376
  const e = t.trim().toLowerCase();
1342
1377
  return e.endsWith("ms") ? parseFloat(e) : e.endsWith("s") ? parseFloat(e) * 1e3 : parseFloat(e);
1343
1378
  }
1344
- function Nt(t, e) {
1345
- const o = Mt[e], n = getComputedStyle(t).getPropertyValue(o);
1379
+ function Xt(t, e) {
1380
+ const o = Vt[e], n = getComputedStyle(t).getPropertyValue(o);
1346
1381
  if (n) {
1347
- const i = kt(n);
1382
+ const i = Gt(n);
1348
1383
  if (!isNaN(i) && i > 0)
1349
1384
  return i;
1350
1385
  }
1351
- return zt[e];
1386
+ return Bt[e];
1352
1387
  }
1353
- function It(t, e, o) {
1354
- t.removeAttribute(ae), t.offsetWidth, t.setAttribute(ae, e);
1355
- const n = Nt(t, e);
1388
+ function Yt(t, e, o) {
1389
+ t.removeAttribute(ce), t.offsetWidth, t.setAttribute(ce, e);
1390
+ const n = Xt(t, e);
1356
1391
  setTimeout(() => {
1357
- e !== "remove" && t.removeAttribute(ae);
1392
+ e !== "remove" && t.removeAttribute(ce);
1358
1393
  }, n);
1359
1394
  }
1360
- function ge(t, e, o) {
1395
+ function me(t, e, o) {
1361
1396
  if (e < 0)
1362
1397
  return !1;
1363
1398
  const n = t.findRenderedRowElement?.(e);
1364
- return n ? (It(n, o), !0) : !1;
1399
+ return n ? (Yt(n, o), !0) : !1;
1365
1400
  }
1366
- function qt(t, e, o) {
1401
+ function jt(t, e, o) {
1367
1402
  let n = 0;
1368
1403
  for (const i of e)
1369
- ge(t, i, o) && n++;
1404
+ me(t, i, o) && n++;
1370
1405
  return n;
1371
1406
  }
1372
- function Wt(t, e, o) {
1407
+ function Kt(t, e, o) {
1373
1408
  const n = t._rows ?? [], i = t.getRowId;
1374
1409
  if (!i)
1375
1410
  return !1;
1376
1411
  const r = n.findIndex((s) => i(s) === e);
1377
- return r < 0 ? !1 : ge(t, r, o);
1412
+ return r < 0 ? !1 : me(t, r, o);
1378
1413
  }
1379
1414
  function ee(t, e, o) {
1380
1415
  const n = document.createElement(t);
@@ -1385,7 +1420,7 @@ function ee(t, e, o) {
1385
1420
  }
1386
1421
  return n;
1387
1422
  }
1388
- function H(t, e) {
1423
+ function L(t, e) {
1389
1424
  const o = document.createElement("div");
1390
1425
  if (t && (o.className = t), e)
1391
1426
  for (const n in e) {
@@ -1394,7 +1429,7 @@ function H(t, e) {
1394
1429
  }
1395
1430
  return o;
1396
1431
  }
1397
- function Xe(t, e, o) {
1432
+ function Ke(t, e, o) {
1398
1433
  const n = document.createElement("button");
1399
1434
  if (t && (n.className = t), e)
1400
1435
  for (const i in e) {
@@ -1403,8 +1438,8 @@ function Xe(t, e, o) {
1403
1438
  }
1404
1439
  return n;
1405
1440
  }
1406
- const Ye = document.createElement("template");
1407
- Ye.innerHTML = `
1441
+ const Qe = document.createElement("template");
1442
+ Qe.innerHTML = `
1408
1443
  <div class="tbw-scroll-area">
1409
1444
  <div class="rows-body-wrapper">
1410
1445
  <div class="rows-body" role="grid">
@@ -1423,38 +1458,38 @@ Ye.innerHTML = `
1423
1458
  <div class="faux-vscroll-spacer"></div>
1424
1459
  </div>
1425
1460
  `;
1426
- function je() {
1427
- return Ye.content.cloneNode(!0);
1461
+ function Ze() {
1462
+ return Qe.content.cloneNode(!0);
1428
1463
  }
1429
- function Pe(t) {
1430
- const e = document.createDocumentFragment(), o = H(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
1464
+ function He(t) {
1465
+ const e = document.createDocumentFragment(), o = L(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
1431
1466
  if (t.hasShell && t.shellHeader && t.shellBody)
1432
1467
  o.appendChild(t.shellHeader), o.appendChild(t.shellBody);
1433
1468
  else {
1434
- const n = H("tbw-grid-content");
1435
- n.appendChild(je()), o.appendChild(n);
1469
+ const n = L("tbw-grid-content");
1470
+ n.appendChild(Ze()), o.appendChild(n);
1436
1471
  }
1437
1472
  return e.appendChild(o), e;
1438
1473
  }
1439
- function $t(t) {
1440
- const e = H("tbw-shell-header", { part: "shell-header", role: "presentation" });
1474
+ function Qt(t) {
1475
+ const e = L("tbw-shell-header", { part: "shell-header", role: "presentation" });
1441
1476
  if (t.title) {
1442
- const r = H("tbw-shell-title");
1477
+ const r = L("tbw-shell-title");
1443
1478
  r.textContent = t.title, e.appendChild(r);
1444
1479
  }
1445
- const o = H("tbw-shell-content", {
1480
+ const o = L("tbw-shell-content", {
1446
1481
  part: "shell-content",
1447
1482
  role: "presentation",
1448
1483
  "data-light-dom-header-content": ""
1449
1484
  });
1450
1485
  e.appendChild(o);
1451
- const n = H("tbw-shell-toolbar", { part: "shell-toolbar", role: "presentation" });
1486
+ const n = L("tbw-shell-toolbar", { part: "shell-toolbar", role: "presentation" });
1452
1487
  for (const r of t.configButtons)
1453
- r.hasRender && n.appendChild(H("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1488
+ r.hasRender && n.appendChild(L("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1454
1489
  for (const r of t.apiButtons)
1455
- r.hasRender && n.appendChild(H("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1456
- if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && n.appendChild(H("tbw-toolbar-separator")), t.hasPanels) {
1457
- const r = Xe(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
1490
+ r.hasRender && n.appendChild(L("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1491
+ if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && n.appendChild(L("tbw-toolbar-separator")), t.hasPanels) {
1492
+ const r = Ke(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
1458
1493
  "data-panel-toggle": "",
1459
1494
  title: "Settings",
1460
1495
  "aria-label": "Toggle settings panel",
@@ -1465,9 +1500,9 @@ function $t(t) {
1465
1500
  }
1466
1501
  return e.appendChild(n), e;
1467
1502
  }
1468
- function Ft(t) {
1469
- const e = H("tbw-shell-body"), o = t.panels.length > 0, n = t.panels.length === 1, i = H("tbw-grid-content");
1470
- i.appendChild(je());
1503
+ function Zt(t) {
1504
+ const e = L("tbw-shell-body"), o = t.panels.length > 0, n = t.panels.length === 1, i = L("tbw-grid-content");
1505
+ i.appendChild(Ze());
1471
1506
  let r = null;
1472
1507
  if (o) {
1473
1508
  r = ee("aside", {
@@ -1479,15 +1514,15 @@ function Ft(t) {
1479
1514
  });
1480
1515
  const s = t.position === "left" ? "right" : "left";
1481
1516
  r.appendChild(
1482
- H("tbw-tool-panel-resize", {
1517
+ L("tbw-tool-panel-resize", {
1483
1518
  "data-resize-handle": "",
1484
1519
  "data-handle-position": s,
1485
1520
  "aria-hidden": "true"
1486
1521
  })
1487
1522
  );
1488
- const l = H("tbw-tool-panel-content", { role: "presentation" }), a = H("tbw-accordion");
1523
+ const l = L("tbw-tool-panel-content", { role: "presentation" }), a = L("tbw-accordion");
1489
1524
  for (const c of t.panels) {
1490
- const d = `tbw-accordion-section${c.isExpanded ? " expanded" : ""}${n ? " single" : ""}`, u = H(d, { "data-section": c.id }), p = Xe("tbw-accordion-header", {
1525
+ const d = `tbw-accordion-section${c.isExpanded ? " expanded" : ""}${n ? " single" : ""}`, u = L(d, { "data-section": c.id }), p = Ke("tbw-accordion-header", {
1491
1526
  "aria-expanded": String(c.isExpanded),
1492
1527
  "aria-controls": `tbw-section-${c.id}`
1493
1528
  });
@@ -1501,7 +1536,7 @@ function Ft(t) {
1501
1536
  g.innerHTML = c.isExpanded ? t.collapseIcon : t.expandIcon, p.appendChild(g);
1502
1537
  }
1503
1538
  u.appendChild(p), u.appendChild(
1504
- H("tbw-accordion-content", {
1539
+ L("tbw-accordion-content", {
1505
1540
  id: `tbw-section-${c.id}`,
1506
1541
  role: "presentation"
1507
1542
  })
@@ -1514,7 +1549,7 @@ function Ft(t) {
1514
1549
  function N(t) {
1515
1550
  return t ? typeof t == "string" ? t : t.outerHTML : "";
1516
1551
  }
1517
- function Ut() {
1552
+ function Jt() {
1518
1553
  return {
1519
1554
  toolPanels: /* @__PURE__ */ new Map(),
1520
1555
  headerContents: /* @__PURE__ */ new Map(),
@@ -1533,10 +1568,10 @@ function Ut() {
1533
1568
  lightDomContentMoved: !1
1534
1569
  };
1535
1570
  }
1536
- function Ke(t) {
1571
+ function Je(t) {
1537
1572
  return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
1538
1573
  }
1539
- function Le(t, e, o = "☰") {
1574
+ function De(t, e, o = "☰") {
1540
1575
  const n = t?.header?.title ?? e.lightDomTitle ?? "", i = !!n, r = N(o), s = t?.header?.toolbarContents ?? [], l = [...e.toolbarContents.values()], a = new Set(s.map((h) => h.id)), c = [...s];
1541
1576
  for (const h of l)
1542
1577
  a.has(h.id) || c.push(h);
@@ -1550,7 +1585,7 @@ function Le(t, e, o = "☰") {
1550
1585
  }
1551
1586
  return `
1552
1587
  <div class="tbw-shell-header" part="shell-header" role="presentation">
1553
- ${i ? `<div class="tbw-shell-title">${st(n)}</div>` : ""}
1588
+ ${i ? `<div class="tbw-shell-title">${ct(n)}</div>` : ""}
1554
1589
  <div class="tbw-shell-content" part="shell-content" role="presentation" data-light-dom-header-content></div>
1555
1590
  <div class="tbw-shell-toolbar" part="shell-toolbar" role="presentation">
1556
1591
  ${g}
@@ -1584,7 +1619,7 @@ function q(t, e, o) {
1584
1619
  };
1585
1620
  e.toolbarContents.set(i, r), e.lightDomToolbarContentIds.add(i), n.style.display = "none";
1586
1621
  }
1587
- function W(t, e, o) {
1622
+ function $(t, e, o) {
1588
1623
  t.querySelectorAll(":scope > tbw-grid-tool-panel").forEach((i) => {
1589
1624
  const r = i, s = r.getAttribute("id"), l = r.getAttribute("title");
1590
1625
  if (!s || !l) {
@@ -1601,8 +1636,8 @@ function W(t, e, o) {
1601
1636
  else {
1602
1637
  const h = r.innerHTML.trim();
1603
1638
  u = (w) => {
1604
- const b = document.createElement("div");
1605
- return b.innerHTML = h, w.appendChild(b), () => b.remove();
1639
+ const v = document.createElement("div");
1640
+ return v.innerHTML = h, w.appendChild(v), () => v.remove();
1606
1641
  };
1607
1642
  }
1608
1643
  const f = e.toolPanels.get(s);
@@ -1625,7 +1660,7 @@ function W(t, e, o) {
1625
1660
  e.toolPanels.set(s, g), e.lightDomToolPanelIds.add(s), r.style.display = "none";
1626
1661
  });
1627
1662
  }
1628
- function Vt(t, e, o, n) {
1663
+ function eo(t, e, o, n) {
1629
1664
  const i = t.querySelector(".tbw-shell-toolbar");
1630
1665
  i && i.addEventListener("click", (s) => {
1631
1666
  if (s.target.closest("[data-panel-toggle]")) {
@@ -1642,7 +1677,7 @@ function Vt(t, e, o, n) {
1642
1677
  }
1643
1678
  });
1644
1679
  }
1645
- function Bt(t, e, o) {
1680
+ function to(t, e, o) {
1646
1681
  const n = t.querySelector(".tbw-tool-panel"), i = t.querySelector("[data-resize-handle]"), r = t.querySelector(".tbw-shell-body");
1647
1682
  if (!n || !i || !r)
1648
1683
  return () => {
@@ -1652,8 +1687,8 @@ function Bt(t, e, o) {
1652
1687
  const p = (h) => {
1653
1688
  if (!u) return;
1654
1689
  h.preventDefault();
1655
- const w = s === "left" ? h.clientX - a : a - h.clientX, b = Math.min(d, Math.max(l, c + w));
1656
- n.style.width = `${b}px`;
1690
+ const w = s === "left" ? h.clientX - a : a - h.clientX, v = Math.min(d, Math.max(l, c + w));
1691
+ n.style.width = `${v}px`;
1657
1692
  }, f = () => {
1658
1693
  if (!u) return;
1659
1694
  u = !1, i.classList.remove("resizing"), n.style.transition = "", document.body.style.cursor = "", document.body.style.userSelect = "";
@@ -1666,7 +1701,7 @@ function Bt(t, e, o) {
1666
1701
  i.removeEventListener("mousedown", g), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", f);
1667
1702
  };
1668
1703
  }
1669
- function He(t, e, o) {
1704
+ function Oe(t, e, o) {
1670
1705
  const n = e?.header?.toolbarContents ?? [], i = [...o.toolbarContents.values()], r = new Set(n.map((l) => l.id)), s = [...n];
1671
1706
  for (const l of i)
1672
1707
  r.has(l.id) || s.push(l);
@@ -1678,7 +1713,7 @@ function He(t, e, o) {
1678
1713
  c && o.toolbarContentCleanups.set(l.id, c);
1679
1714
  }
1680
1715
  }
1681
- function he(t, e) {
1716
+ function ue(t, e) {
1682
1717
  const o = e.lightDomHeaderContent.length > 0 && !e.lightDomContentMoved, n = e.headerContents.size > 0;
1683
1718
  if (!o && !n) return;
1684
1719
  const i = t.querySelector(".tbw-shell-content");
@@ -1698,9 +1733,9 @@ function he(t, e) {
1698
1733
  c && e.headerContentCleanups.set(s.id, c);
1699
1734
  }
1700
1735
  }
1701
- function Gt(t, e, o) {
1736
+ function oo(t, e, o) {
1702
1737
  if (!e.isPanelOpen) return;
1703
- const n = N(o?.expand ?? k.expand), i = N(o?.collapse ?? k.collapse);
1738
+ const n = N(o?.expand ?? M.expand), i = N(o?.collapse ?? M.collapse);
1704
1739
  for (const [r, s] of e.toolPanels) {
1705
1740
  const l = e.expandedSections.has(r), a = t.querySelector(`[data-section="${r}"]`), c = a?.querySelector(".tbw-accordion-content");
1706
1741
  if (!a || !c) continue;
@@ -1719,15 +1754,15 @@ function Gt(t, e, o) {
1719
1754
  }
1720
1755
  }
1721
1756
  }
1722
- function De(t, e) {
1757
+ function ze(t, e) {
1723
1758
  const o = t.querySelector("[data-panel-toggle]");
1724
1759
  o && (o.classList.toggle("active", e.isPanelOpen), o.setAttribute("aria-pressed", String(e.isPanelOpen)));
1725
1760
  }
1726
- function Oe(t, e) {
1761
+ function Me(t, e) {
1727
1762
  const o = t.querySelector(".tbw-tool-panel");
1728
1763
  o && (o.classList.toggle("open", e.isPanelOpen), e.isPanelOpen || (o.style.width = ""));
1729
1764
  }
1730
- function Xt(t) {
1765
+ function no(t) {
1731
1766
  for (const e of t.headerContentCleanups.values())
1732
1767
  e();
1733
1768
  t.headerContentCleanups.clear();
@@ -1744,7 +1779,7 @@ function Xt(t) {
1744
1779
  t.toolPanels.get(e)?.onClose?.();
1745
1780
  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;
1746
1781
  }
1747
- function Yt(t, e) {
1782
+ function io(t, e) {
1748
1783
  let o = !1;
1749
1784
  const n = {
1750
1785
  get isInitialized() {
@@ -1773,7 +1808,7 @@ function Yt(t, e) {
1773
1808
  s && t.expandedSections.add(s.id);
1774
1809
  }
1775
1810
  const i = e.getShadow();
1776
- De(i, t), Oe(i, t), Gt(i, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: n.expandedSections });
1811
+ ze(i, t), Me(i, t), oo(i, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: n.expandedSections });
1777
1812
  },
1778
1813
  closeToolPanel() {
1779
1814
  if (!t.isPanelOpen) return;
@@ -1784,7 +1819,7 @@ function Yt(t, e) {
1784
1819
  r.onClose?.();
1785
1820
  t.isPanelOpen = !1;
1786
1821
  const i = e.getShadow();
1787
- De(i, t), Oe(i, t), e.emit("tool-panel-close", {});
1822
+ ze(i, t), Me(i, t), e.emit("tool-panel-close", {});
1788
1823
  },
1789
1824
  toggleToolPanel() {
1790
1825
  t.isPanelOpen ? n.closeToolPanel() : n.openToolPanel();
@@ -1800,16 +1835,16 @@ function Yt(t, e) {
1800
1835
  const s = e.getShadow(), l = t.expandedSections.has(i);
1801
1836
  if (l) {
1802
1837
  const a = t.panelCleanups.get(i);
1803
- a && (a(), t.panelCleanups.delete(i)), r.onClose?.(), t.expandedSections.delete(i), ce(s, i, !1);
1838
+ a && (a(), t.panelCleanups.delete(i)), r.onClose?.(), t.expandedSections.delete(i), de(s, i, !1);
1804
1839
  } else {
1805
1840
  for (const [a, c] of t.toolPanels)
1806
1841
  if (a !== i && t.expandedSections.has(a)) {
1807
1842
  const d = t.panelCleanups.get(a);
1808
- d && (d(), t.panelCleanups.delete(a)), c.onClose?.(), t.expandedSections.delete(a), ce(s, a, !1);
1843
+ d && (d(), t.panelCleanups.delete(a)), c.onClose?.(), t.expandedSections.delete(a), de(s, a, !1);
1809
1844
  const u = s.querySelector(`[data-section="${a}"] .tbw-accordion-content`);
1810
1845
  u && (u.innerHTML = "");
1811
1846
  }
1812
- t.expandedSections.add(i), ce(s, i, !0), jt(s, t, i);
1847
+ t.expandedSections.add(i), de(s, i, !0), ro(s, t, i);
1813
1848
  }
1814
1849
  e.emit("tool-panel-section-toggle", { id: i, expanded: !l });
1815
1850
  },
@@ -1838,7 +1873,7 @@ function Yt(t, e) {
1838
1873
  console.warn(`[tbw-grid] Header content "${i.id}" already registered`);
1839
1874
  return;
1840
1875
  }
1841
- t.headerContents.set(i.id, i), o && he(e.getShadow(), t);
1876
+ t.headerContents.set(i.id, i), o && ue(e.getShadow(), t);
1842
1877
  },
1843
1878
  unregisterHeaderContent(i) {
1844
1879
  const r = t.headerContentCleanups.get(i);
@@ -1863,11 +1898,11 @@ function Yt(t, e) {
1863
1898
  };
1864
1899
  return n;
1865
1900
  }
1866
- function ce(t, e, o) {
1901
+ function de(t, e, o) {
1867
1902
  const n = t.querySelector(`[data-section="${e}"]`);
1868
1903
  n && n.classList.toggle("expanded", o);
1869
1904
  }
1870
- function jt(t, e, o) {
1905
+ function ro(t, e, o) {
1871
1906
  const n = e.toolPanels.get(o);
1872
1907
  if (!n?.render) return;
1873
1908
  const i = t.querySelector(`[data-section="${o}"] .tbw-accordion-content`);
@@ -1875,8 +1910,8 @@ function jt(t, e, o) {
1875
1910
  const r = n.render(i);
1876
1911
  r && e.panelCleanups.set(o, r);
1877
1912
  }
1878
- function Kt(t, e, o, n) {
1879
- const i = Ke(e), r = [], s = [
1913
+ function so(t, e, o, n) {
1914
+ const i = Je(e), r = [], s = [
1880
1915
  "tbw-grid-header",
1881
1916
  "tbw-grid-tool-buttons",
1882
1917
  "tbw-grid-tool-panel",
@@ -1890,7 +1925,7 @@ function Kt(t, e, o, n) {
1890
1925
  for (const l of r)
1891
1926
  t.appendChild(l);
1892
1927
  if (i) {
1893
- const l = N(n?.toolPanel ?? k.toolPanel), a = N(n?.expand ?? k.expand), c = N(n?.collapse ?? k.collapse), u = [...e?.header?.toolbarContents ?? []].sort((C, _) => (C.order ?? 0) - (_.order ?? 0)), f = [...e?.toolPanels ?? []].sort((C, _) => (C.order ?? 100) - (_.order ?? 100)), g = {
1928
+ const l = N(n?.toolPanel ?? M.toolPanel), a = N(n?.expand ?? M.expand), c = N(n?.collapse ?? M.collapse), u = [...e?.header?.toolbarContents ?? []].sort((C, _) => (C.order ?? 0) - (_.order ?? 0)), f = [...e?.toolPanels ?? []].sort((C, _) => (C.order ?? 100) - (_.order ?? 100)), g = {
1894
1929
  title: e?.header?.title ?? void 0,
1895
1930
  hasPanels: f.length > 0,
1896
1931
  isPanelOpen: o.isPanelOpen,
@@ -1912,19 +1947,71 @@ function Kt(t, e, o, n) {
1912
1947
  icon: N(C.icon),
1913
1948
  isExpanded: o.expandedSections.has(C.id)
1914
1949
  }))
1915
- }, w = $t(g), b = Ft(h), S = Pe({
1950
+ }, w = Qt(g), v = Zt(h), S = He({
1916
1951
  hasShell: !0,
1917
1952
  shellHeader: w,
1918
- shellBody: b
1953
+ shellBody: v
1919
1954
  });
1920
1955
  t.appendChild(S);
1921
1956
  } else {
1922
- const l = Pe({ hasShell: !1 });
1957
+ const l = He({ hasShell: !1 });
1923
1958
  t.appendChild(l);
1924
1959
  }
1925
1960
  return i;
1926
1961
  }
1927
- function Qt() {
1962
+ const ke = "tbw-grid-styles";
1963
+ let oe = "";
1964
+ const fe = /* @__PURE__ */ new Map();
1965
+ function lo() {
1966
+ let t = document.getElementById(ke);
1967
+ return t || (t = document.createElement("style"), t.id = ke, t.setAttribute("data-tbw-grid", "true"), document.head.appendChild(t)), t;
1968
+ }
1969
+ function pe() {
1970
+ const t = lo(), e = Array.from(fe.values()).join(`
1971
+ `);
1972
+ t.textContent = `${oe}
1973
+
1974
+ /* Plugin Styles */
1975
+ ${e}`;
1976
+ }
1977
+ function ao(t) {
1978
+ let e = !1;
1979
+ for (const { name: o, styles: n } of t)
1980
+ fe.has(o) || (fe.set(o, n), e = !0);
1981
+ return e && pe(), e;
1982
+ }
1983
+ function co() {
1984
+ try {
1985
+ for (const t of Array.from(document.styleSheets))
1986
+ try {
1987
+ const o = Array.from(t.cssRules || []).map((n) => n.cssText).join(`
1988
+ `);
1989
+ if (o.includes(".tbw-grid-root") && o.includes("tbw-grid"))
1990
+ return o;
1991
+ } catch {
1992
+ continue;
1993
+ }
1994
+ } catch (t) {
1995
+ console.warn("[tbw-grid] Failed to extract grid.css from document stylesheets:", t);
1996
+ }
1997
+ return null;
1998
+ }
1999
+ async function ho(t) {
2000
+ if (oe)
2001
+ return;
2002
+ if (typeof t == "string" && t.length > 0) {
2003
+ oe = t, pe();
2004
+ return;
2005
+ }
2006
+ await new Promise((o) => setTimeout(o, 50));
2007
+ const e = co();
2008
+ e ? (oe = e, pe()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2009
+ "[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
2010
+ "Available stylesheets:",
2011
+ Array.from(document.styleSheets).map((o) => o.href || "(inline)")
2012
+ );
2013
+ }
2014
+ function uo() {
1928
2015
  return {
1929
2016
  startY: null,
1930
2017
  startX: null,
@@ -1938,19 +2025,19 @@ function Qt() {
1938
2025
  momentumRaf: 0
1939
2026
  };
1940
2027
  }
1941
- function Zt(t) {
2028
+ function fo(t) {
1942
2029
  t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
1943
2030
  }
1944
- function Qe(t) {
2031
+ function et(t) {
1945
2032
  t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
1946
2033
  }
1947
- function Jt(t, e, o) {
2034
+ function po(t, e, o) {
1948
2035
  if (t.touches.length !== 1) return;
1949
- Qe(e);
2036
+ et(e);
1950
2037
  const n = t.touches[0];
1951
2038
  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;
1952
2039
  }
1953
- function eo(t, e, o) {
2040
+ function go(t, e, o) {
1954
2041
  if (t.touches.length !== 1 || e.startY === null || e.startX === null || e.scrollTop === null || e.scrollLeft === null)
1955
2042
  return !1;
1956
2043
  const n = t.touches[0], i = n.clientY, r = n.clientX, s = performance.now(), l = e.startY - i, a = e.startX - r;
@@ -1962,15 +2049,15 @@ function eo(t, e, o) {
1962
2049
  const { scrollTop: c, scrollHeight: d, clientHeight: u } = o.fauxScrollbar, p = d - u, f = l > 0 && c < p || l < 0 && c > 0;
1963
2050
  let g = !1;
1964
2051
  if (o.scrollArea) {
1965
- const { scrollLeft: h, scrollWidth: w, clientWidth: b } = o.scrollArea, S = w - b;
2052
+ const { scrollLeft: h, scrollWidth: w, clientWidth: v } = o.scrollArea, S = w - v;
1966
2053
  g = a > 0 && h < S || a < 0 && h > 0;
1967
2054
  }
1968
2055
  return f && (o.fauxScrollbar.scrollTop = e.scrollTop + l), g && o.scrollArea && (o.scrollArea.scrollLeft = e.scrollLeft + a), f || g;
1969
2056
  }
1970
- function to(t, e) {
1971
- (Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && oo(t, e), Zt(t);
2057
+ function wo(t, e) {
2058
+ (Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && bo(t, e), fo(t);
1972
2059
  }
1973
- function oo(t, e) {
2060
+ function bo(t, e) {
1974
2061
  const i = () => {
1975
2062
  t.velocityY *= 0.95, t.velocityX *= 0.95;
1976
2063
  const r = t.velocityY * 16, s = t.velocityX * 16;
@@ -1978,19 +2065,19 @@ function oo(t, e) {
1978
2065
  };
1979
2066
  t.momentumRaf = requestAnimationFrame(i);
1980
2067
  }
1981
- function no(t, e, o, n) {
1982
- t.addEventListener("touchstart", (i) => Jt(i, e, o), {
2068
+ function mo(t, e, o, n) {
2069
+ t.addEventListener("touchstart", (i) => po(i, e, o), {
1983
2070
  passive: !0,
1984
2071
  signal: n
1985
2072
  }), t.addEventListener(
1986
2073
  "touchmove",
1987
2074
  (i) => {
1988
- eo(i, e, o) && i.preventDefault();
2075
+ go(i, e, o) && i.preventDefault();
1989
2076
  },
1990
2077
  { passive: !1, signal: n }
1991
- ), t.addEventListener("touchend", () => to(e, o), { passive: !0, signal: n });
2078
+ ), t.addEventListener("touchend", () => wo(e, o), { passive: !0, signal: n });
1992
2079
  }
1993
- const io = [
2080
+ const vo = [
1994
2081
  {
1995
2082
  property: "editable",
1996
2083
  pluginName: "editing",
@@ -2028,7 +2115,7 @@ const io = [
2028
2115
  importHint: "import { PinnedColumnsPlugin } from '@toolbox-web/grid/plugins/pinned-columns';",
2029
2116
  isUsed: (t) => t === "left" || t === "right" || t === "start" || t === "end"
2030
2117
  }
2031
- ], ro = [
2118
+ ], Co = [
2032
2119
  {
2033
2120
  property: "columnGroups",
2034
2121
  pluginName: "groupingColumns",
@@ -2037,7 +2124,7 @@ const io = [
2037
2124
  importHint: "import { GroupingColumnsPlugin } from '@toolbox-web/grid/plugins/grouping-columns';",
2038
2125
  isUsed: (t) => Array.isArray(t) && t.length > 0
2039
2126
  }
2040
- ], so = {
2127
+ ], yo = {
2041
2128
  editing: "import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';",
2042
2129
  selection: "import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';",
2043
2130
  reorder: "import { ReorderPlugin } from '@toolbox-web/grid/plugins/reorder';",
@@ -2058,10 +2145,10 @@ const io = [
2058
2145
  serverSide: "import { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';",
2059
2146
  columnVirtualization: "import { ColumnVirtualizationPlugin } from '@toolbox-web/grid/plugins/column-virtualization';"
2060
2147
  };
2061
- function ue(t) {
2062
- return so[t] ?? `import { ${O(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
2148
+ function ge(t) {
2149
+ return yo[t] ?? `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
2063
2150
  }
2064
- function Ze() {
2151
+ function tt() {
2065
2152
  if (typeof window < "u" && window.location) {
2066
2153
  const t = window.location.hostname;
2067
2154
  if (t === "localhost" || t === "127.0.0.1" || t === "::1")
@@ -2069,14 +2156,14 @@ function Ze() {
2069
2156
  }
2070
2157
  return typeof process < "u" && process.env?.NODE_ENV !== "production";
2071
2158
  }
2072
- function O(t) {
2159
+ function D(t) {
2073
2160
  return t.charAt(0).toUpperCase() + t.slice(1);
2074
2161
  }
2075
- function Me(t, e) {
2162
+ function Ne(t, e) {
2076
2163
  return t.some((o) => o.name === e);
2077
2164
  }
2078
- function lo(t, e) {
2079
- const o = io, n = ro, i = /* @__PURE__ */ new Map();
2165
+ function _o(t, e) {
2166
+ const o = vo, n = Co, i = /* @__PURE__ */ new Map();
2080
2167
  function r(l, a, c, d, u = !1) {
2081
2168
  i.has(l) || i.set(l, { description: a, importHint: c, fields: [], isConfigProperty: u });
2082
2169
  const p = i.get(l);
@@ -2084,16 +2171,16 @@ function lo(t, e) {
2084
2171
  }
2085
2172
  for (const l of n) {
2086
2173
  const a = t[l.property];
2087
- (l.isUsed ? l.isUsed(a) : a !== void 0) && !Me(e, l.pluginName) && r(l.pluginName, l.description, l.importHint ?? ue(l.pluginName), l.property, !0);
2174
+ (l.isUsed ? l.isUsed(a) : a !== void 0) && !Ne(e, l.pluginName) && r(l.pluginName, l.description, l.importHint ?? ge(l.pluginName), l.property, !0);
2088
2175
  }
2089
2176
  const s = t.columns;
2090
2177
  if (s && s.length > 0)
2091
2178
  for (const l of s)
2092
2179
  for (const a of o) {
2093
2180
  const c = l[a.property];
2094
- if ((a.isUsed ? a.isUsed(c) : c !== void 0) && !Me(e, a.pluginName)) {
2181
+ if ((a.isUsed ? a.isUsed(c) : c !== void 0) && !Ne(e, a.pluginName)) {
2095
2182
  const u = l.field || "<unknown>";
2096
- r(a.pluginName, a.description, a.importHint ?? ue(a.pluginName), u);
2183
+ r(a.pluginName, a.description, a.importHint ?? ge(a.pluginName), u);
2097
2184
  }
2098
2185
  }
2099
2186
  if (i.size > 0) {
@@ -2126,7 +2213,7 @@ This validation helps catch misconfigurations early. The properties listed above
2126
2213
  );
2127
2214
  }
2128
2215
  }
2129
- function ao(t) {
2216
+ function Eo(t) {
2130
2217
  const e = [], o = [];
2131
2218
  for (const n of t) {
2132
2219
  const r = n.constructor.manifest;
@@ -2134,12 +2221,12 @@ function ao(t) {
2134
2221
  for (const s of r.configRules) {
2135
2222
  const l = n.config;
2136
2223
  if (s.check(l)) {
2137
- const c = `${`[tbw-grid:${O(n.name)}Plugin]`} Configuration warning: ${s.message}`;
2224
+ const c = `${`[tbw-grid:${D(n.name)}Plugin]`} Configuration warning: ${s.message}`;
2138
2225
  s.severity === "error" ? e.push(c) : o.push(c);
2139
2226
  }
2140
2227
  }
2141
2228
  }
2142
- if (o.length > 0 && Ze())
2229
+ if (o.length > 0 && tt())
2143
2230
  for (const n of o)
2144
2231
  console.warn(n);
2145
2232
  if (e.length > 0)
@@ -2149,30 +2236,30 @@ ${e.join(`
2149
2236
 
2150
2237
  `)}`);
2151
2238
  }
2152
- function co(t, e) {
2239
+ function So(t, e) {
2153
2240
  const o = t.name, i = t.constructor.dependencies ?? [];
2154
2241
  for (const r of i) {
2155
2242
  const s = r.name, l = r.required ?? !0, a = r.reason;
2156
2243
  if (!e.some((d) => d.name === s)) {
2157
- const d = a ?? `${O(o)}Plugin requires ${O(s)}Plugin`, u = ue(s);
2244
+ const d = a ?? `${D(o)}Plugin requires ${D(s)}Plugin`, u = ge(s);
2158
2245
  if (l)
2159
2246
  throw new Error(
2160
2247
  `[tbw-grid] Plugin dependency error:
2161
2248
 
2162
2249
  ${d}.
2163
2250
 
2164
- → Add the plugin to your gridConfig.plugins array BEFORE ${O(o)}Plugin:
2251
+ → Add the plugin to your gridConfig.plugins array BEFORE ${D(o)}Plugin:
2165
2252
  ${u}
2166
- plugins: [new ${O(s)}Plugin(), new ${O(o)}Plugin()]`
2253
+ plugins: [new ${D(s)}Plugin(), new ${D(o)}Plugin()]`
2167
2254
  );
2168
2255
  console.info(
2169
- `[tbw-grid] ${O(o)}Plugin: Optional "${s}" plugin not found. Some features may be unavailable.`
2256
+ `[tbw-grid] ${D(o)}Plugin: Optional "${s}" plugin not found. Some features may be unavailable.`
2170
2257
  );
2171
2258
  }
2172
2259
  }
2173
2260
  }
2174
- function ho(t) {
2175
- if (!Ze()) return;
2261
+ function Ro(t) {
2262
+ if (!tt()) return;
2176
2263
  const e = new Set(t.map((n) => n.name)), o = /* @__PURE__ */ new Set();
2177
2264
  for (const n of t) {
2178
2265
  const r = n.constructor.manifest;
@@ -2184,7 +2271,7 @@ function ho(t) {
2184
2271
  o.add(l), console.warn(
2185
2272
  `[tbw-grid] Plugin incompatibility warning:
2186
2273
 
2187
- ${O(n.name)}Plugin and ${O(s.name)}Plugin are both loaded, but they are currently incompatible.
2274
+ ${D(n.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currently incompatible.
2188
2275
 
2189
2276
  → ${s.reason}
2190
2277
 
@@ -2194,7 +2281,7 @@ ${O(n.name)}Plugin and ${O(s.name)}Plugin are both loaded, but they are currentl
2194
2281
  }
2195
2282
  }
2196
2283
  }
2197
- class uo {
2284
+ class xo {
2198
2285
  constructor(e) {
2199
2286
  this.grid = e;
2200
2287
  }
@@ -2213,7 +2300,7 @@ class uo {
2213
2300
  this.attach(o);
2214
2301
  }
2215
2302
  attach(e) {
2216
- if (co(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
2303
+ if (So(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
2217
2304
  for (const [o, n] of Object.entries(e.cellRenderers))
2218
2305
  this.cellRenderers.set(o, n);
2219
2306
  if (e.headerRenderers)
@@ -2454,9 +2541,38 @@ class uo {
2454
2541
  return e.sort((o, n) => (o.content.order ?? 0) - (n.content.order ?? 0));
2455
2542
  }
2456
2543
  }
2457
- class L extends HTMLElement {
2544
+ const Ao = "@layer tbw-base{tbw-grid{.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}}}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}}@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)}}@keyframes tbw-spin{to{transform:rotate(360deg)}}@keyframes tbw-fade-in{0%{opacity:0}to{opacity:1}}", To = '@layer tbw-base{tbw-grid{color-scheme:inherit;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);font-feature-settings:"tnum","lnum";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}.tbw-grid-root{position:relative;display:flex;flex-direction:column;height:100%;&.has-shell{display:flex;flex-direction:column;height:100%}&:has(.selected){user-select:none}}.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-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)}}}', Po = '@layer tbw-base{tbw-grid{.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);text-transform:var(--tbw-header-text-transform);letter-spacing:var(--tbw-header-letter-spacing);>.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;font-weight:inherit}>span[part~=sort-indicator]{flex-shrink:0;opacity:.6;color:var(--tbw-sort-indicator-color);display:var(--tbw-sort-indicator-display, inline-flex);visibility:var(--tbw-sort-indicator-visibility, visible);transition:opacity .15s,visibility 0s,display 0s allow-discrete;transition-behavior:allow-discrete}&:hover>span[part~=sort-indicator]{display:inline-flex;visibility:visible}&[aria-sort=ascending]>span[part~=sort-indicator],&[aria-sort=descending]>span[part~=sort-indicator]{display:inline-flex;visibility:visible;opacity:1;color:var(--tbw-sort-indicator-active-color)}&:last-child{border-right:0;.resize-handle{right:0;width:calc(var(--tbw-resize-handle-width) / 2)}}&.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}}}.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}}}}}', Lo = '@layer tbw-base{.tbw-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:1000;pointer-events:all;animation:tbw-fade-in .15s ease-out}.tbw-spinner{--tbw-spinner-size: 48px;--tbw-spinner-border-width: 3px;--tbw-spinner-color: var(--tbw-color-accent);--tbw-spinner-track-color: var(--tbw-color-border);width:var(--tbw-spinner-size);height:var(--tbw-spinner-size);border:var(--tbw-spinner-border-width) solid var(--tbw-spinner-track-color);border-top-color:var(--tbw-spinner-color);border-radius:50%;animation:tbw-spin .8s linear infinite}.tbw-spinner--large{--tbw-spinner-size: min(48px, calc(100% - 16px) )}.tbw-spinner--small{--tbw-spinner-size: calc(var(--tbw-row-height, 28px) * .6);--tbw-spinner-border-width: 2px}.data-grid-row.tbw-row-loading{position:relative;pointer-events:none;&:before{content:"";position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:10;animation:tbw-fade-in .15s ease-out}&:after{--_spinner-size: calc(var(--tbw-row-height, 28px) * .6);content:"";position:absolute;left:var(--tbw-spacing-md);top:0;bottom:0;margin:auto 0;width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite;z-index:11}}.cell.tbw-cell-loading{position:relative;pointer-events:none;&:before{content:"";position:absolute;inset:0;background:light-dark(rgba(255,255,255,.7),rgba(0,0,0,.5));z-index:10;animation:tbw-fade-in .15s ease-out}&:after{--_spinner-size: calc(var(--tbw-row-height, 28px) * .5);content:"";position:absolute;left:var(--tbw-spacing-sm);top:0;bottom:0;margin:auto 0;width:var(--_spinner-size);height:var(--_spinner-size);border:2px solid var(--tbw-spinner-track-color, var(--tbw-color-border));border-top-color:var(--tbw-spinner-color, var(--tbw-color-accent));border-radius:50%;animation:tbw-spin .8s linear infinite;z-index:11}}}', Ho = "@layer tbw-base{@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}}}}", Do = "@layer tbw-base{tbw-grid{.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);align-content:center;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}}}", Oo = "@layer tbw-base{tbw-grid{.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}}}", zo = "@layer tbw-base{tbw-grid{.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:start;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}}}", Mo = "@layer tbw-base{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-warning: light-dark(hsl(38, 92%, 50%), hsl(38, 92%, 50%));--tbw-color-error: light-dark(hsl(0, 65%, 51%), hsl(0, 65%, 55%));--tbw-color-danger: var(--tbw-color-error);--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-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-sort-indicator-display: inline-flex;--tbw-sort-indicator-visibility: visible;--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)}}", ko = `/**
2545
+ * tbw-grid Light DOM Styles
2546
+ *
2547
+ * This stylesheet uses CSS nesting to scope all styles to the tbw-grid element.
2548
+ * All selectors are automatically prefixed with \`tbw-grid\` for encapsulation.
2549
+ *
2550
+ * CSS Cascade Layers are used to control style priority:
2551
+ * - tbw-base: Core grid styles (lowest priority)
2552
+ * - tbw-plugins: Plugin styles (override base)
2553
+ * - tbw-theme: Theme overrides (override plugins)
2554
+ * - Unlayered CSS: User customizations (highest priority - always wins)
2555
+ *
2556
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting
2557
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@layer
2558
+ */
2559
+
2560
+ /* Declare layer order - earlier layers have lower priority */
2561
+ @layer tbw-base, tbw-plugins, tbw-theme;
2562
+
2563
+ ${Mo}
2564
+ ${To}
2565
+ ${Po}
2566
+ ${Do}
2567
+ ${Oo}
2568
+ ${zo}
2569
+ ${Lo}
2570
+ ${Ao}
2571
+ ${Ho}
2572
+ `;
2573
+ class k extends HTMLElement {
2458
2574
  static tagName = "tbw-grid";
2459
- static version = "1.10.0";
2575
+ static version = "1.11.0";
2460
2576
  static #l = 0;
2461
2577
  static adapters = [];
2462
2578
  static registerAdapter(e) {
@@ -2482,24 +2598,24 @@ class L extends HTMLElement {
2482
2598
  return this.#t?.effective ?? {};
2483
2599
  }
2484
2600
  #f = !1;
2485
- #g = !1;
2486
- #m = {
2601
+ #p = !1;
2602
+ #b = {
2487
2603
  rows: !1,
2488
2604
  columns: !1,
2489
2605
  gridConfig: !1,
2490
2606
  fitMode: !1
2491
2607
  };
2492
2608
  #s;
2493
- #v = 0;
2609
+ #m = 0;
2494
2610
  #r = null;
2495
- #w = !1;
2496
- #R;
2497
- #H = Qt();
2498
- #b;
2611
+ #g = !1;
2612
+ #x;
2613
+ #D = uo();
2614
+ #w;
2499
2615
  #C;
2500
2616
  #y;
2501
- #p;
2502
- #J = {
2617
+ #v;
2618
+ #_ = {
2503
2619
  scrollTop: 0,
2504
2620
  scrollLeft: 0,
2505
2621
  scrollHeight: 0,
@@ -2508,20 +2624,20 @@ class L extends HTMLElement {
2508
2624
  clientWidth: 0
2509
2625
  };
2510
2626
  #o;
2511
- #_;
2627
+ #E;
2512
2628
  #M = !1;
2513
- #D;
2514
- #F;
2515
2629
  #O;
2630
+ #F;
2631
+ #z;
2516
2632
  #t;
2517
- #e = Ut();
2633
+ #e = Jt();
2518
2634
  #c;
2519
- #z;
2520
- #k = !1;
2521
- #x = /* @__PURE__ */ new Set();
2522
- #A = /* @__PURE__ */ new Map();
2523
- #N;
2524
- #E = /* @__PURE__ */ new Map();
2635
+ #k;
2636
+ #N = !1;
2637
+ #A = /* @__PURE__ */ new Set();
2638
+ #T = /* @__PURE__ */ new Map();
2639
+ #I;
2640
+ #S = /* @__PURE__ */ new Map();
2525
2641
  _rows = [];
2526
2642
  #U = [];
2527
2643
  get _columns() {
@@ -2574,7 +2690,7 @@ class L extends HTMLElement {
2574
2690
  }
2575
2691
  set rows(e) {
2576
2692
  const o = this.#a;
2577
- this.#a = e, o !== e && this.#$("rows");
2693
+ this.#a = e, o !== e && this.#W("rows");
2578
2694
  }
2579
2695
  get sourceRows() {
2580
2696
  return this.#a;
@@ -2584,84 +2700,84 @@ class L extends HTMLElement {
2584
2700
  }
2585
2701
  set columns(e) {
2586
2702
  const o = this.#t?.getColumns();
2587
- this.#t?.setColumns(e), o !== e && this.#$("columns");
2703
+ this.#t?.setColumns(e), o !== e && this.#W("columns");
2588
2704
  }
2589
2705
  get gridConfig() {
2590
2706
  return this.#n;
2591
2707
  }
2592
2708
  set gridConfig(e) {
2593
2709
  const o = this.#t?.getGridConfig();
2594
- this.#t?.setGridConfig(e), o !== e && (this.#t.clearLightDomCache(), this.#$("gridConfig"));
2710
+ this.#t?.setGridConfig(e), o !== e && (this.#t.clearLightDomCache(), this.#W("gridConfig"));
2595
2711
  }
2596
2712
  get fitMode() {
2597
2713
  return this.#n.fitMode ?? "stretch";
2598
2714
  }
2599
2715
  set fitMode(e) {
2600
2716
  const o = this.#t?.getFitMode();
2601
- this.#t?.setFitMode(e), o !== e && this.#$("fitMode");
2717
+ this.#t?.setFitMode(e), o !== e && this.#W("fitMode");
2602
2718
  }
2603
2719
  get loading() {
2604
- return this.#k;
2720
+ return this.#N;
2605
2721
  }
2606
2722
  set loading(e) {
2607
- const o = this.#k;
2608
- this.#k = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), o !== e && this.#Oe();
2723
+ const o = this.#N;
2724
+ this.#N = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), o !== e && this.#xe();
2609
2725
  }
2610
2726
  setRowLoading(e, o) {
2611
- const n = this.#x.has(e);
2612
- o ? this.#x.add(e) : this.#x.delete(e), n !== o && this.#fe(e, o);
2727
+ const n = this.#A.has(e);
2728
+ o ? this.#A.add(e) : this.#A.delete(e), n !== o && this.#ce(e, o);
2613
2729
  }
2614
2730
  setCellLoading(e, o, n) {
2615
- let i = this.#A.get(e);
2731
+ let i = this.#T.get(e);
2616
2732
  const r = i?.has(o) ?? !1;
2617
- n ? (i || (i = /* @__PURE__ */ new Set(), this.#A.set(e, i)), i.add(o)) : (i?.delete(o), i?.size === 0 && this.#A.delete(e)), r !== n && this.#pe(e, o, n);
2733
+ n ? (i || (i = /* @__PURE__ */ new Set(), this.#T.set(e, i)), i.add(o)) : (i?.delete(o), i?.size === 0 && this.#T.delete(e)), r !== n && this.#de(e, o, n);
2618
2734
  }
2619
2735
  isRowLoading(e) {
2620
- return this.#x.has(e);
2736
+ return this.#A.has(e);
2621
2737
  }
2622
2738
  isCellLoading(e, o) {
2623
- return this.#A.get(e)?.has(o) ?? !1;
2739
+ return this.#T.get(e)?.has(o) ?? !1;
2624
2740
  }
2625
2741
  clearAllLoading() {
2626
2742
  this.loading = !1;
2627
- for (const e of this.#x)
2628
- this.#fe(e, !1);
2629
- this.#x.clear();
2630
- for (const [e, o] of this.#A)
2631
- for (const n of o)
2632
- this.#pe(e, n, !1);
2743
+ for (const e of this.#A)
2744
+ this.#ce(e, !1);
2633
2745
  this.#A.clear();
2746
+ for (const [e, o] of this.#T)
2747
+ for (const n of o)
2748
+ this.#de(e, n, !1);
2749
+ this.#T.clear();
2634
2750
  }
2635
2751
  get effectiveConfig() {
2636
2752
  return this.#n;
2637
2753
  }
2638
2754
  get disconnectSignal() {
2639
- return this.#b || (this.#b = new AbortController()), this.#b.signal;
2755
+ return this.#w || (this.#w = new AbortController()), this.#w.signal;
2640
2756
  }
2641
2757
  constructor() {
2642
- super(), this.#be(), this.#d = new Promise((e) => this.#h = e), this.#s = new Ot({
2758
+ super(), this.#ue(), this.#d = new Promise((e) => this.#h = e), this.#s = new Ut({
2643
2759
  mergeConfig: () => {
2644
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#oe(), lo(this.#n, this.#o?.getPlugins() ?? []), ao(this.#o?.getPlugins() ?? []), ho(this.#o?.getPlugins() ?? []), this.#Le(), this.#U = [...this._columns];
2760
+ this.#t.parseLightDomColumns(this), this.#t.merge(), this.#Z(), _o(this.#n, this.#o?.getPlugins() ?? []), Eo(this.#o?.getPlugins() ?? []), Ro(this.#o?.getPlugins() ?? []), this.#Re(), this.#U = [...this._columns];
2645
2761
  },
2646
- processColumns: () => this.#Ae(),
2647
- processRows: () => this.#Te(),
2648
- renderHeader: () => ne(this),
2762
+ processColumns: () => this.#_e(),
2763
+ processRows: () => this.#Ee(),
2764
+ renderHeader: () => ie(this),
2649
2765
  updateTemplate: () => B(this),
2650
2766
  renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
2651
2767
  afterRender: () => {
2652
- this.#o?.afterRender(), this.#n.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, ve(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#W && this.#ve();
2768
+ this.#o?.afterRender(), this.#n.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, ye(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, W(this)), this._virtualization.enabled && !this.#$ && this.#pe();
2653
2769
  },
2654
2770
  isConnected: () => this.isConnected && this.#f
2655
- }), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = Yt(this.#e, {
2771
+ }), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = io(this.#e, {
2656
2772
  getShadow: () => this.#i,
2657
2773
  getShellConfig: () => this.#n?.shell,
2658
2774
  getAccordionIcons: () => ({
2659
- expand: this.#n?.icons?.expand ?? k.expand,
2660
- collapse: this.#n?.icons?.collapse ?? k.collapse
2775
+ expand: this.#n?.icons?.expand ?? M.expand,
2776
+ collapse: this.#n?.icons?.collapse ?? M.collapse
2661
2777
  }),
2662
- emit: (e, o) => this.#P(e, o),
2778
+ emit: (e, o) => this.#L(e, o),
2663
2779
  refreshShellHeader: () => this.refreshShellHeader()
2664
- }), this.#t = new gt({
2780
+ }), this.#t = new mt({
2665
2781
  getRows: () => this.#a,
2666
2782
  getSortState: () => this._sortState,
2667
2783
  setSortState: (e) => {
@@ -2670,19 +2786,19 @@ class L extends HTMLElement {
2670
2786
  onConfigChange: () => {
2671
2787
  this.#s.requestPhase(T.FULL, "configChange");
2672
2788
  },
2673
- emit: (e, o) => this.#P(e, o),
2789
+ emit: (e, o) => this.#L(e, o),
2674
2790
  clearRowPool: () => {
2675
2791
  this._rowPool.length = 0, this._bodyEl && (this._bodyEl.innerHTML = ""), this.__rowRenderEpoch++;
2676
2792
  },
2677
- setup: () => this.#L(),
2678
- renderHeader: () => ne(this),
2793
+ setup: () => this.#H(),
2794
+ renderHeader: () => ie(this),
2679
2795
  updateTemplate: () => B(this),
2680
2796
  refreshVirtualWindow: () => this.#s.requestPhase(T.VIRTUALIZATION, "configManager"),
2681
2797
  getVirtualization: () => this._virtualization,
2682
2798
  setRowHeight: (e) => {
2683
2799
  this._virtualization.rowHeight = e;
2684
2800
  },
2685
- applyAnimationConfig: (e) => this.#Pe(e),
2801
+ applyAnimationConfig: (e) => this.#Se(e),
2686
2802
  getShellLightDomTitle: () => this.#e.lightDomTitle,
2687
2803
  getShellToolPanels: () => this.#e.toolPanels,
2688
2804
  getShellHeaderContents: () => this.#e.headerContents,
@@ -2691,50 +2807,8 @@ class L extends HTMLElement {
2691
2807
  getShellHasToolButtonsContainer: () => this.#e.hasToolButtonsContainer
2692
2808
  });
2693
2809
  }
2694
- static #ee = "tbw-grid-styles";
2695
- static #I = "";
2696
- static #V = /* @__PURE__ */ new Map();
2697
- static #we() {
2698
- let e = document.getElementById(this.#ee);
2699
- return e || (e = document.createElement("style"), e.id = this.#ee, e.setAttribute("data-tbw-grid", "true"), document.head.appendChild(e)), e;
2700
- }
2701
- static #B() {
2702
- const e = this.#we(), o = Array.from(this.#V.values()).join(`
2703
- `);
2704
- e.textContent = `${this.#I}
2705
-
2706
- /* Plugin Styles */
2707
- ${o}`;
2708
- }
2709
- async #be() {
2710
- if (!L.#I) {
2711
- if (we.length > 0) {
2712
- L.#I = we, L.#B();
2713
- return;
2714
- }
2715
- await new Promise((e) => setTimeout(e, 50));
2716
- try {
2717
- let e = "";
2718
- for (const o of Array.from(document.styleSheets))
2719
- try {
2720
- const i = Array.from(o.cssRules || []).map((r) => r.cssText).join(`
2721
- `);
2722
- if (i.includes(".tbw-grid-root") && i.includes("tbw-grid")) {
2723
- e = i;
2724
- break;
2725
- }
2726
- } catch {
2727
- continue;
2728
- }
2729
- e ? (L.#I = e, L.#B()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
2730
- "[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
2731
- "Available stylesheets:",
2732
- Array.from(document.styleSheets).map((o) => o.href || "(inline)")
2733
- );
2734
- } catch (e) {
2735
- console.warn("[tbw-grid] Failed to extract grid.css from document stylesheets:", e);
2736
- }
2737
- }
2810
+ async #ue() {
2811
+ await ho(ko);
2738
2812
  }
2739
2813
  getPlugin(e) {
2740
2814
  return this.#o?.getPlugin(e);
@@ -2757,23 +2831,20 @@ ${o}`;
2757
2831
  requestAfterRender() {
2758
2832
  this.#s.requestPhase(T.STYLE, "plugin:requestAfterRender");
2759
2833
  }
2760
- #te() {
2761
- this.#o = new uo(this);
2834
+ #Q() {
2835
+ this.#o = new xo(this);
2762
2836
  const e = this.#n?.plugins, o = Array.isArray(e) ? e : [];
2763
2837
  this.#o.attachAll(o);
2764
2838
  }
2765
2839
  #q() {
2766
2840
  const e = this.#o?.getPluginStyles() ?? [];
2767
- let o = !1;
2768
- for (const { name: n, styles: i } of e)
2769
- L.#V.has(n) || (L.#V.set(n, i), o = !0);
2770
- o && L.#B();
2841
+ ao(e);
2771
2842
  }
2772
- #oe() {
2843
+ #Z() {
2773
2844
  const e = this.#n?.plugins, o = Array.isArray(e) ? e : [];
2774
- if (this.#_ !== o) {
2775
- if (this.#_ && this.#_.length === o.length && this.#_.every((n, i) => n === o[i])) {
2776
- this.#_ = o;
2845
+ if (this.#E !== o) {
2846
+ if (this.#E && this.#E.length === o.length && this.#E.every((n, i) => n === o[i])) {
2847
+ this.#E = o;
2777
2848
  return;
2778
2849
  }
2779
2850
  this.#o && this.#o.detachAll();
@@ -2788,13 +2859,13 @@ ${o}`;
2788
2859
  const i = this.#e.headerContentCleanups.get(n);
2789
2860
  i && (i(), this.#e.headerContentCleanups.delete(n)), this.#e.headerContents.delete(n);
2790
2861
  }
2791
- this.#te(), this.#q(), this.#_ = o, this.#ne(), this.#w = this.#o?.getAll().some((n) => n.onScroll) ?? !1;
2862
+ this.#Q(), this.#q(), this.#E = o, this.#J(), this.#g = this.#o?.getAll().some((n) => n.onScroll) ?? !1;
2792
2863
  }
2793
2864
  }
2794
- #me() {
2865
+ #fe() {
2795
2866
  this.#o?.detachAll();
2796
2867
  }
2797
- #ne() {
2868
+ #J() {
2798
2869
  if (!this.#o) return;
2799
2870
  const e = this.#o.getToolPanels();
2800
2871
  for (const { panel: n } of e)
@@ -2803,8 +2874,8 @@ ${o}`;
2803
2874
  for (const { content: n } of o)
2804
2875
  this.#e.headerContents.has(n.id) || this.#e.headerContents.set(n.id, n);
2805
2876
  }
2806
- #T() {
2807
- const e = L.getAdapters();
2877
+ #P() {
2878
+ const e = k.getAdapters();
2808
2879
  if (e.length === 0 && !this.__frameworkAdapter) return;
2809
2880
  const o = this.__frameworkAdapter;
2810
2881
  return (n) => {
@@ -2820,17 +2891,17 @@ ${o}`;
2820
2891
  };
2821
2892
  }
2822
2893
  connectedCallback() {
2823
- this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", L.version), this.id || (this.id = `tbw-grid-${++L.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#b && (this.#b.abort(), this.#M = !1), this.#b = new AbortController(), this.#p && (Ae(this.#p), this.#p = void 0), I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T()), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#te();
2894
+ this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", k.version), this.id || (this.id = `tbw-grid-${++k.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#w && (this.#w.abort(), this.#M = !1), this.#w = new AbortController(), this.#v && (Pe(this.#v), this.#v = void 0), I(this, this.#e), q(this, this.#e), $(this, this.#e, this.#P()), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#Q();
2824
2895
  const e = this.#n?.plugins;
2825
- this.#_ = Array.isArray(e) ? e : [], this.#ne(), this.#u || (this.#Q(), this.#q(), this.#u = !0), this.#ie(), this.#p = Dt(
2896
+ this.#E = Array.isArray(e) ? e : [], this.#J(), this.#u || (this.#j(), this.#q(), this.#u = !0), this.#ee(), this.#v = Mt(
2826
2897
  () => {
2827
- this.#Ne();
2898
+ this.#Le();
2828
2899
  },
2829
2900
  { timeout: 100 }
2830
2901
  );
2831
2902
  }
2832
2903
  disconnectedCallback() {
2833
- this.#p && (Ae(this.#p), this.#p = void 0), this.#me(), Xt(this.#e), this.#c.setInitialized(!1), this.#z?.(), this.#z = void 0, Qe(this.#H), this.#b && (this.#b.abort(), this.#b = void 0), this.#D?.abort(), this.#D = void 0, this.#M = !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.#W = !1), j(this), this.#S.clear(), this.#_ = void 0;
2904
+ this.#v && (Pe(this.#v), this.#v = void 0), this.#fe(), no(this.#e), this.#c.setInitialized(!1), this.#k?.(), this.#k = void 0, et(this.#D), this.#w && (this.#w.abort(), this.#w = void 0), this.#O?.abort(), this.#O = void 0, this.#M = !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.#$ = !1), j(this), this.#R.clear(), this.#E = void 0;
2834
2905
  for (const e of this._rowPool)
2835
2906
  e.remove();
2836
2907
  this._rowPool.length = 0, this.__rowsBodyEl = null, this.#f = !1;
@@ -2851,22 +2922,22 @@ ${o}`;
2851
2922
  }
2852
2923
  else e === "fit-mode" && (this.fitMode = n);
2853
2924
  }
2854
- #ie() {
2925
+ #ee() {
2855
2926
  const o = this.#i.querySelector(".tbw-grid-content") ?? this.#i.querySelector(".tbw-grid-root");
2856
2927
  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.#c.isInitialized) {
2857
- he(this.#i, this.#e), He(this.#i, this.#n?.shell, this.#e);
2928
+ ue(this.#i, this.#e), Oe(this.#i, this.#n?.shell, this.#e);
2858
2929
  const r = this.#n?.shell?.toolPanel?.defaultOpen;
2859
2930
  r && this.#e.toolPanels.has(r) && (this.openToolPanel(), this.#e.expandedSections.add(r));
2860
2931
  }
2861
- if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Te(this), this.#L(), this.#se(o), this.#M)
2932
+ if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Le(this), this.#H(), this.#oe(o), this.#M)
2862
2933
  return;
2863
2934
  this.#M = !0;
2864
2935
  const n = this.disconnectSignal;
2865
- At(this, this, this.#i, n);
2936
+ Lt(this, this, this.#i, n);
2866
2937
  const i = this.#n.rowHeight;
2867
- i && i > 0 ? this._virtualization.rowHeight = i : requestAnimationFrame(() => this.#re()), queueMicrotask(() => this.#Ce()), this.#s.requestPhase(T.FULL, "afterConnect");
2938
+ i && i > 0 ? this._virtualization.rowHeight = i : requestAnimationFrame(() => this.#te()), queueMicrotask(() => this.#ge()), this.#s.requestPhase(T.FULL, "afterConnect");
2868
2939
  }
2869
- #re() {
2940
+ #te() {
2870
2941
  if (this.#o.hasExtraHeight())
2871
2942
  return;
2872
2943
  const e = this._bodyEl?.querySelector(".data-grid-row");
@@ -2880,14 +2951,14 @@ ${o}`;
2880
2951
  const i = e.getBoundingClientRect(), r = Math.max(i.height, n);
2881
2952
  r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(T.VIRTUALIZATION, "measureRowHeight"));
2882
2953
  }
2883
- #se(e) {
2884
- this.#D?.abort(), this.#D = new AbortController();
2885
- const o = this.#D.signal, n = e?.querySelector(".faux-vscroll"), i = e?.querySelector(".rows");
2886
- if (this._virtualization.container = n ?? this, this.#w = this.#o?.getAll().some((r) => r.onScroll) ?? !1, n && i) {
2954
+ #oe(e) {
2955
+ this.#O?.abort(), this.#O = new AbortController();
2956
+ const o = this.#O.signal, n = e?.querySelector(".faux-vscroll"), i = e?.querySelector(".rows");
2957
+ if (this._virtualization.container = n ?? this, this.#g = this.#o?.getAll().some((r) => r.onScroll) ?? !1, n && i) {
2887
2958
  n.addEventListener(
2888
2959
  "scroll",
2889
2960
  () => {
2890
- if (!this._virtualization.enabled && !this.#w) return;
2961
+ if (!this._virtualization.enabled && !this.#g) return;
2891
2962
  const a = n.scrollTop, c = this._virtualization.rowHeight;
2892
2963
  if (this._rows.length <= this._virtualization.bypassThreshold)
2893
2964
  i.style.transform = `translateY(${-a}px)`;
@@ -2895,17 +2966,17 @@ ${o}`;
2895
2966
  const d = Math.floor(a / c), u = d - d % 2, p = -(a - u * c);
2896
2967
  i.style.transform = `translateY(${p}px)`;
2897
2968
  }
2898
- this.#r = a, this.#v || (this.#v = requestAnimationFrame(() => {
2899
- this.#v = 0, this.#r !== null && (this.#Me(this.#r), this.#r = null);
2969
+ this.#r = a, this.#m || (this.#m = requestAnimationFrame(() => {
2970
+ this.#m = 0, this.#r !== null && (this.#Ae(this.#r), this.#r = null);
2900
2971
  }));
2901
2972
  },
2902
2973
  { passive: !0, signal: o }
2903
2974
  );
2904
2975
  const r = this.#i.querySelector(".tbw-scroll-area");
2905
- this.#F = r, r && this.#w && r.addEventListener(
2976
+ this.#F = r, r && this.#g && r.addEventListener(
2906
2977
  "scroll",
2907
2978
  () => {
2908
- const a = this.#J;
2979
+ const a = this.#_;
2909
2980
  a.scrollTop = n.scrollTop, a.scrollLeft = r.scrollLeft, a.scrollHeight = n.scrollHeight, a.scrollWidth = r.scrollWidth, a.clientHeight = n.clientHeight, a.clientWidth = r.clientWidth, this.#o?.onScroll(a);
2910
2981
  },
2911
2982
  { passive: !0, signal: o }
@@ -2924,14 +2995,14 @@ ${o}`;
2924
2995
  }
2925
2996
  },
2926
2997
  { passive: !1, signal: o }
2927
- ), no(
2998
+ ), mo(
2928
2999
  s,
2929
- this.#H,
3000
+ this.#D,
2930
3001
  { fauxScrollbar: n, scrollArea: l },
2931
3002
  o
2932
3003
  ));
2933
3004
  }
2934
- this._bodyEl && xt(this, this._bodyEl, o), this.#C?.disconnect(), this._virtualization.viewportEl && (this.#C = new ResizeObserver(() => {
3005
+ this._bodyEl && Pt(this, this._bodyEl, o), this.#C?.disconnect(), this._virtualization.viewportEl && (this.#C = new ResizeObserver(() => {
2935
3006
  this.#s.requestPhase(T.VIRTUALIZATION, "resize-observer");
2936
3007
  }), this.#C.observe(this._virtualization.viewportEl)), this.#i.addEventListener(
2937
3008
  "focusin",
@@ -2948,12 +3019,12 @@ ${o}`;
2948
3019
  { signal: o }
2949
3020
  );
2950
3021
  }
2951
- #W = !1;
2952
- #ve() {
2953
- if (this.#W) return;
3022
+ #$ = !1;
3023
+ #pe() {
3024
+ if (this.#$) return;
2954
3025
  const e = this._bodyEl?.querySelector(".data-grid-row");
2955
- e && (this.#W = !0, this.#y?.disconnect(), this.#y = new ResizeObserver(() => {
2956
- this.#re();
3026
+ e && (this.#$ = !0, this.#y?.disconnect(), this.#y = new ResizeObserver(() => {
3027
+ this.#te();
2957
3028
  }), this.#y.observe(e));
2958
3029
  }
2959
3030
  addEventListener(e, o, n) {
@@ -2962,10 +3033,10 @@ ${o}`;
2962
3033
  removeEventListener(e, o, n) {
2963
3034
  super.removeEventListener(e, o, n);
2964
3035
  }
2965
- #P(e, o) {
3036
+ #L(e, o) {
2966
3037
  this.dispatchEvent(new CustomEvent(e, { detail: o, bubbles: !0, composed: !0 }));
2967
3038
  }
2968
- #Ce() {
3039
+ #ge() {
2969
3040
  this._bodyEl?.querySelectorAll(".data-grid-row")?.forEach((o, n) => {
2970
3041
  const i = n === this._focusRow;
2971
3042
  o.setAttribute("aria-selected", String(i)), o.querySelectorAll(".cell").forEach((r, s) => {
@@ -2973,79 +3044,79 @@ ${o}`;
2973
3044
  });
2974
3045
  });
2975
3046
  }
2976
- #$(e) {
2977
- this.#m[e] = !0, !this.#g && (this.#g = !0, queueMicrotask(() => this.#ye()));
3047
+ #W(e) {
3048
+ this.#b[e] = !0, !this.#p && (this.#p = !0, queueMicrotask(() => this.#we()));
2978
3049
  }
2979
- #ye() {
2980
- if (!this.#g || !this.#f) {
2981
- this.#g = !1;
3050
+ #we() {
3051
+ if (!this.#p || !this.#f) {
3052
+ this.#p = !1;
2982
3053
  return;
2983
3054
  }
2984
- const e = this.#m;
2985
- if (this.#g = !1, this.#m = {
3055
+ const e = this.#b;
3056
+ if (this.#p = !1, this.#b = {
2986
3057
  rows: !1,
2987
3058
  columns: !1,
2988
3059
  gridConfig: !1,
2989
3060
  fitMode: !1
2990
3061
  }, e.gridConfig) {
2991
- this.#Re(), e.rows && this.#le();
3062
+ this.#Ce(), e.rows && this.#ne();
2992
3063
  return;
2993
3064
  }
2994
- e.columns && this.#Ee(), e.rows && this.#le(), e.fitMode && this.#Se();
3065
+ e.columns && this.#me(), e.rows && this.#ne(), e.fitMode && this.#ve();
2995
3066
  }
2996
- #le() {
2997
- this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#G(), this.#s.requestPhase(T.ROWS, "applyRowsUpdate");
3067
+ #ne() {
3068
+ this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#V(), this.#s.requestPhase(T.ROWS, "applyRowsUpdate");
2998
3069
  }
2999
- #G() {
3000
- this.#E.clear();
3070
+ #V() {
3071
+ this.#S.clear();
3001
3072
  const e = this.#n.getRowId;
3002
3073
  this._rows.forEach((o, n) => {
3003
- const i = this.#ae(o, e);
3004
- i !== void 0 && this.#E.set(i, { row: o, index: n });
3074
+ const i = this.#ie(o, e);
3075
+ i !== void 0 && this.#S.set(i, { row: o, index: n });
3005
3076
  });
3006
3077
  }
3007
- #ae(e, o) {
3078
+ #ie(e, o) {
3008
3079
  if (o)
3009
3080
  return o(e);
3010
3081
  const n = e;
3011
3082
  if ("id" in n && n.id != null) return String(n.id);
3012
3083
  if ("_id" in n && n._id != null) return String(n._id);
3013
3084
  }
3014
- #_e(e, o) {
3015
- const n = this.#ae(e, o);
3085
+ #be(e, o) {
3086
+ const n = this.#ie(e, o);
3016
3087
  if (n === void 0)
3017
3088
  throw new Error(
3018
3089
  '[tbw-grid] Cannot determine row ID. Configure getRowId in gridConfig or ensure rows have an "id" property.'
3019
3090
  );
3020
3091
  return n;
3021
3092
  }
3022
- #Ee() {
3023
- j(this), this.#t.merge(), this.#L();
3093
+ #me() {
3094
+ j(this), this.#t.merge(), this.#H();
3024
3095
  }
3025
- #Se() {
3026
- this.#t.merge(), this.#n.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, ve(this)) : (this._columns.forEach((o) => {
3096
+ #ve() {
3097
+ this.#t.merge(), this.#n.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, ye(this)) : (this._columns.forEach((o) => {
3027
3098
  !o.__userResized && o.__autoSized && delete o.width;
3028
3099
  }), B(this));
3029
3100
  }
3030
- #Re() {
3101
+ #Ce() {
3031
3102
  I(this, this.#e), q(this, this.#e);
3032
3103
  const e = !!this.#i.querySelector(".has-shell"), o = !!this.#i.querySelector(".tbw-tool-panel"), n = this.#i.querySelectorAll(".tbw-accordion-section").length;
3033
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#oe(), W(this, this.#e, this.#T()), this.#t.markSourcesChanged(), this.#t.merge();
3034
- const i = Ke(this.#n?.shell), r = (this.#n?.shell?.toolPanels?.length ?? 0) > 0, s = (this.#n?.shell?.toolPanels?.length ?? 0) !== n;
3104
+ this.#t.parseLightDomColumns(this), this.#t.merge(), this.#Z(), $(this, this.#e, this.#P()), this.#t.markSourcesChanged(), this.#t.merge();
3105
+ const i = Je(this.#n?.shell), r = (this.#n?.shell?.toolPanels?.length ?? 0) > 0, s = (this.#n?.shell?.toolPanels?.length ?? 0) !== n;
3035
3106
  if (e !== i || !e && i || !o && r || o && s) {
3036
- this.#Q(), this.#q(), this.#ie(), this.#G();
3107
+ this.#j(), this.#q(), this.#ee(), this.#V();
3037
3108
  return;
3038
3109
  }
3039
- e && this.#xe(), this.#G(), this.#s.requestPhase(T.COLUMNS, "applyGridConfigUpdate");
3110
+ e && this.#ye(), this.#V(), this.#s.requestPhase(T.COLUMNS, "applyGridConfigUpdate");
3040
3111
  }
3041
- #xe() {
3112
+ #ye() {
3042
3113
  const e = this.#i.querySelector(".tbw-shell-header");
3043
3114
  if (!e) return;
3044
3115
  const o = this.#n.shell?.header?.title ?? this.#e.lightDomTitle;
3045
3116
  let n = e.querySelector(".tbw-shell-title");
3046
3117
  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();
3047
3118
  }
3048
- #Ae() {
3119
+ #_e() {
3049
3120
  if (this.#o) {
3050
3121
  const e = this.#U.length > 0 ? this.#U : this._columns, o = e.filter((r) => !r.hidden), n = e.filter((r) => r.hidden), i = this.#o.processColumns([...o]);
3051
3122
  if (i !== o) {
@@ -3056,97 +3127,73 @@ ${o}`;
3056
3127
  this._columns = [...e];
3057
3128
  }
3058
3129
  }
3059
- #Te() {
3130
+ #Ee() {
3060
3131
  j(this);
3061
3132
  const e = Array.isArray(this.#a) ? [...this.#a] : [], o = this.#o?.processRows(e) ?? e;
3062
3133
  this._rows = o;
3063
3134
  }
3064
- #Pe(e) {
3135
+ #Se(e) {
3065
3136
  const o = {
3066
- ...Je,
3137
+ ...ot,
3067
3138
  ...e.animation
3068
3139
  }, n = o.mode ?? "reduced-motion";
3069
3140
  let i = 1;
3070
3141
  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;
3071
3142
  }
3072
- #X(e, o, n = this.__rowRenderEpoch) {
3073
- this.#R || (this.#R = (i, r, s) => this.#o?.renderRow(i, r, s) ?? !1), Ct(this, e, o, n, this.#R);
3143
+ #B(e, o, n = this.__rowRenderEpoch) {
3144
+ this.#x || (this.#x = (i, r, s) => this.#o?.renderRow(i, r, s) ?? !1), Et(this, e, o, n, this.#x);
3074
3145
  }
3075
- #Y = -1;
3076
- #ce = -1;
3077
- #de(e, o) {
3078
- if (e === this.#Y && o === this.#ce)
3146
+ #G = -1;
3147
+ #re = -1;
3148
+ #se(e, o) {
3149
+ if (e === this.#G && o === this.#re)
3079
3150
  return;
3080
- const n = this.#Y;
3081
- this.#Y = e, this.#ce = o, this.__rowsBodyEl && (this.__rowsBodyEl.setAttribute("aria-rowcount", String(e)), this.__rowsBodyEl.setAttribute("aria-colcount", String(o))), e !== n && this._bodyEl && (e > 0 ? this._bodyEl.setAttribute("role", "rowgroup") : this._bodyEl.removeAttribute("role"));
3151
+ const n = this.#G;
3152
+ this.#G = e, this.#re = o, this.__rowsBodyEl && (this.__rowsBodyEl.setAttribute("aria-rowcount", String(e)), this.__rowsBodyEl.setAttribute("aria-colcount", String(o))), e !== n && this._bodyEl && (e > 0 ? this._bodyEl.setAttribute("role", "rowgroup") : this._bodyEl.removeAttribute("role"));
3082
3153
  }
3083
- #he;
3084
- #ue;
3085
- #Le() {
3154
+ #le;
3155
+ #ae;
3156
+ #Re() {
3086
3157
  if (!this.__rowsBodyEl) return;
3087
3158
  const e = this.#n.gridAriaLabel, o = this.#n.shell?.header?.title ?? this.#e?.lightDomTitle ?? void 0, n = e ?? o;
3088
- n !== this.#he && (this.#he = n, n ? this.__rowsBodyEl.setAttribute("aria-label", n) : this.__rowsBodyEl.removeAttribute("aria-label"));
3159
+ n !== this.#le && (this.#le = n, n ? this.__rowsBodyEl.setAttribute("aria-label", n) : this.__rowsBodyEl.removeAttribute("aria-label"));
3089
3160
  const i = this.#n.gridAriaDescribedBy;
3090
- i !== this.#ue && (this.#ue = i, i ? this.__rowsBodyEl.setAttribute("aria-describedby", i) : this.__rowsBodyEl.removeAttribute("aria-describedby"));
3091
- }
3092
- #He(e) {
3093
- const o = document.createElement("div");
3094
- return o.className = `tbw-spinner tbw-spinner--${e}`, o.setAttribute("role", "progressbar"), o.setAttribute("aria-label", "Loading"), o;
3095
- }
3096
- #De(e) {
3097
- const o = this.#n?.loadingRenderer;
3098
- if (o) {
3099
- const n = o({ size: e });
3100
- if (typeof n == "string") {
3101
- const i = document.createElement("div");
3102
- return i.innerHTML = n, i;
3103
- }
3104
- return n;
3105
- }
3106
- return this.#He(e);
3161
+ i !== this.#ae && (this.#ae = i, i ? this.__rowsBodyEl.setAttribute("aria-describedby", i) : this.__rowsBodyEl.removeAttribute("aria-describedby"));
3107
3162
  }
3108
- #Oe() {
3163
+ #xe() {
3109
3164
  const e = this.querySelector(".tbw-grid-root");
3110
- if (e)
3111
- if (this.#k) {
3112
- if (!this.#N) {
3113
- const o = document.createElement("div");
3114
- o.className = "tbw-loading-overlay", o.setAttribute("role", "status"), o.setAttribute("aria-live", "polite"), o.appendChild(this.#De("large")), this.#N = o;
3115
- }
3116
- e.appendChild(this.#N);
3117
- } else
3118
- this.#N?.remove();
3165
+ e && (this.#N ? (this.#I || (this.#I = It(this.#n?.loadingRenderer)), qt(e, this.#I)) : $t(this.#I));
3119
3166
  }
3120
- #fe(e, o) {
3121
- const n = this.#E.get(e);
3167
+ #ce(e, o) {
3168
+ const n = this.#S.get(e);
3122
3169
  if (!n) return;
3123
3170
  const i = this.findRenderedRowElement?.(n.index);
3124
- i && (o ? (i.classList.add("tbw-row-loading"), i.setAttribute("aria-busy", "true")) : (i.classList.remove("tbw-row-loading"), i.removeAttribute("aria-busy")));
3171
+ i && Wt(i, o);
3125
3172
  }
3126
- #pe(e, o, n) {
3127
- const i = this.#E.get(e);
3173
+ #de(e, o, n) {
3174
+ const i = this.#S.get(e);
3128
3175
  if (!i) return;
3129
3176
  const r = this.findRenderedRowElement?.(i.index);
3130
3177
  if (!r) return;
3131
3178
  const s = this._visibleColumns.findIndex((a) => a.field === o);
3132
3179
  if (s < 0) return;
3133
3180
  const l = r.children[s];
3134
- l && (n ? (l.classList.add("tbw-cell-loading"), l.setAttribute("aria-busy", "true")) : (l.classList.remove("tbw-cell-loading"), l.removeAttribute("aria-busy")));
3181
+ l && Ft(l, n);
3135
3182
  }
3136
- #L() {
3183
+ #H() {
3137
3184
  if (this.isConnected && !(!this._headerRowEl || !this._bodyEl)) {
3138
- if (this.#t.parseLightDomColumns(this), this.#O) {
3139
- const e = this.#O;
3140
- this.#O = void 0, this.#t.merge();
3185
+ if (this.#t.parseLightDomColumns(this), this.#z) {
3186
+ const e = this.#z;
3187
+ this.#z = void 0, this.#t.merge();
3141
3188
  const o = this.#o?.getAll() ?? [];
3142
3189
  this.#t.applyState(e, o);
3143
3190
  }
3144
3191
  this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(T.FULL, "setup");
3145
3192
  }
3146
3193
  }
3147
- #Me(e) {
3148
- if (this.refreshVirtualWindow(!1), this.#o?.onScrollRender(), this.#w) {
3149
- const o = this._virtualization.container, n = this.#F, i = this.#J;
3194
+ #Ae(e) {
3195
+ if (this.refreshVirtualWindow(!1), this.#o?.onScrollRender(), this.#g) {
3196
+ const o = this._virtualization.container, n = this.#F, i = this.#_;
3150
3197
  i.scrollTop = e, i.scrollLeft = n?.scrollLeft ?? 0, i.scrollHeight = o?.scrollHeight ?? 0, i.scrollWidth = n?.scrollWidth ?? 0, i.clientHeight = o?.clientHeight ?? 0, i.clientWidth = n?.clientWidth ?? 0, this.#o?.onScroll(i);
3151
3198
  }
3152
3199
  }
@@ -3188,7 +3235,7 @@ ${o}`;
3188
3235
  cellEl: i,
3189
3236
  originalEvent: e
3190
3237
  }, u = this.#o?.onCellClick(d) ?? !1;
3191
- return this.#P("cell-click", d), u;
3238
+ return this.#L("cell-click", d), u;
3192
3239
  }
3193
3240
  _dispatchRowClick(e, o, n, i) {
3194
3241
  if (!n) return !1;
@@ -3198,7 +3245,7 @@ ${o}`;
3198
3245
  rowEl: i,
3199
3246
  originalEvent: e
3200
3247
  }, s = this.#o?.onRowClick(r) ?? !1;
3201
- return this.#P("row-click", r), s;
3248
+ return this.#L("row-click", r), s;
3202
3249
  }
3203
3250
  _dispatchHeaderClick(e, o, n) {
3204
3251
  const i = this._columns[o];
@@ -3255,13 +3302,13 @@ ${o}`;
3255
3302
  return Object.freeze({ ...this.#n || {} });
3256
3303
  }
3257
3304
  getRowId(e) {
3258
- return this.#_e(e, this.#n.getRowId);
3305
+ return this.#be(e, this.#n.getRowId);
3259
3306
  }
3260
3307
  getRow(e) {
3261
- return this.#E.get(e)?.row;
3308
+ return this.#S.get(e)?.row;
3262
3309
  }
3263
3310
  updateRow(e, o, n = "api") {
3264
- const i = this.#E.get(e);
3311
+ const i = this.#S.get(e);
3265
3312
  if (!i)
3266
3313
  throw new Error(
3267
3314
  `[tbw-grid] Row with ID "${e}" not found. Ensure the row exists and getRowId is correctly configured.`
@@ -3272,7 +3319,7 @@ ${o}`;
3272
3319
  d !== c && (l.push({ field: a, oldValue: d, newValue: c }), r[a] = c);
3273
3320
  }
3274
3321
  for (const { field: a, oldValue: c, newValue: d } of l)
3275
- this.#P("cell-change", {
3322
+ this.#L("cell-change", {
3276
3323
  row: r,
3277
3324
  rowId: e,
3278
3325
  rowIndex: s,
@@ -3287,7 +3334,7 @@ ${o}`;
3287
3334
  updateRows(e, o = "api") {
3288
3335
  let n = !1;
3289
3336
  for (const { id: i, changes: r } of e) {
3290
- const s = this.#E.get(i);
3337
+ const s = this.#S.get(i);
3291
3338
  if (!s)
3292
3339
  throw new Error(
3293
3340
  `[tbw-grid] Row with ID "${i}" not found. Ensure the row exists and getRowId is correctly configured.`
@@ -3295,7 +3342,7 @@ ${o}`;
3295
3342
  const { row: l, index: a } = s;
3296
3343
  for (const [c, d] of Object.entries(r)) {
3297
3344
  const u = l[c];
3298
- u !== d && (n = !0, l[c] = d, this.#P("cell-change", {
3345
+ u !== d && (n = !0, l[c] = d, this.#L("cell-change", {
3299
3346
  row: l,
3300
3347
  rowId: i,
3301
3348
  rowIndex: a,
@@ -3310,13 +3357,13 @@ ${o}`;
3310
3357
  n && this.#s.requestPhase(T.ROWS, "updateRows");
3311
3358
  }
3312
3359
  animateRow(e, o) {
3313
- ge(this, e, o);
3360
+ me(this, e, o);
3314
3361
  }
3315
3362
  animateRows(e, o) {
3316
- qt(this, e, o);
3363
+ jt(this, e, o);
3317
3364
  }
3318
3365
  animateRowById(e, o) {
3319
- return Wt(this, e, o);
3366
+ return Kt(this, e, o);
3320
3367
  }
3321
3368
  setColumnVisible(e, o) {
3322
3369
  const n = this.#t.setColumnVisible(e, o);
@@ -3346,23 +3393,23 @@ ${o}`;
3346
3393
  return this.#t.collectState(e);
3347
3394
  }
3348
3395
  set columnState(e) {
3349
- e && (this.#O = e, this.#t.initialColumnState = e, this.#u && this.#ze(e));
3396
+ e && (this.#z = e, this.#t.initialColumnState = e, this.#u && this.#Te(e));
3350
3397
  }
3351
3398
  get columnState() {
3352
3399
  return this.getColumnState();
3353
3400
  }
3354
- #ze(e) {
3401
+ #Te(e) {
3355
3402
  const o = this.#o?.getAll() ?? [];
3356
- this.#t.applyState(e, o), this.#L();
3403
+ this.#t.applyState(e, o), this.#H();
3357
3404
  }
3358
3405
  requestStateChange() {
3359
3406
  const e = this.#o?.getAll() ?? [];
3360
3407
  this.#t.requestStateChange(e);
3361
3408
  }
3362
3409
  resetColumnState() {
3363
- this.#O = void 0, this.__originalOrder = [];
3410
+ this.#z = void 0, this.__originalOrder = [];
3364
3411
  const e = this.#o?.getAll() ?? [];
3365
- this.#t.resetState(e), this.#t.merge(), this.#L();
3412
+ this.#t.resetState(e), this.#t.merge(), this.#H();
3366
3413
  }
3367
3414
  get isToolPanelOpen() {
3368
3415
  return this.#c.isPanelOpen;
@@ -3409,84 +3456,84 @@ ${o}`;
3409
3456
  unregisterToolbarContent(e) {
3410
3457
  this.#c.unregisterToolbarContent(e);
3411
3458
  }
3412
- #j = !1;
3459
+ #X = !1;
3413
3460
  refreshShellHeader() {
3414
- this.#j || (this.#j = !0, queueMicrotask(() => {
3415
- this.#j = !1, this.isConnected && (I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T()), this.#t.markSourcesChanged(), this.#t.merge(), this.#Q(), this.#q(), this.#ke());
3461
+ this.#X || (this.#X = !0, queueMicrotask(() => {
3462
+ this.#X = !1, this.isConnected && (I(this, this.#e), q(this, this.#e), $(this, this.#e, this.#P()), this.#t.markSourcesChanged(), this.#t.merge(), this.#j(), this.#q(), this.#Pe());
3416
3463
  }));
3417
3464
  }
3418
- #ke() {
3465
+ #Pe() {
3419
3466
  const o = this.#i.querySelector(".tbw-grid-content") ?? this.#i.querySelector(".tbw-grid-root");
3420
3467
  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.#c.isInitialized) {
3421
- he(this.#i, this.#e), He(this.#i, this.#n?.shell, this.#e);
3468
+ ue(this.#i, this.#e), Oe(this.#i, this.#n?.shell, this.#e);
3422
3469
  const n = this.#n?.shell?.toolPanel?.defaultOpen;
3423
3470
  n && this.#e.toolPanels.has(n) && (this.openToolPanel(), this.#e.expandedSections.add(n));
3424
3471
  }
3425
- this._resizeController = Te(this), this.#se(o), this.#s.requestPhase(T.COLUMNS, "shellRefresh");
3472
+ this._resizeController = Le(this), this.#oe(o), this.#s.requestPhase(T.COLUMNS, "shellRefresh");
3426
3473
  }
3427
- #S = /* @__PURE__ */ new Map();
3474
+ #R = /* @__PURE__ */ new Map();
3428
3475
  registerStyles(e, o) {
3429
- let n = this.#S.get(e);
3430
- n || (n = new CSSStyleSheet(), this.#S.set(e, n)), n.replaceSync(o), this.#ge();
3476
+ let n = this.#R.get(e);
3477
+ n || (n = new CSSStyleSheet(), this.#R.set(e, n)), n.replaceSync(o), this.#he();
3431
3478
  }
3432
3479
  unregisterStyles(e) {
3433
- this.#S.delete(e) && this.#ge();
3480
+ this.#R.delete(e) && this.#he();
3434
3481
  }
3435
3482
  getRegisteredStyles() {
3436
- return Array.from(this.#S.keys());
3483
+ return Array.from(this.#R.keys());
3437
3484
  }
3438
- #ge() {
3439
- const e = Array.from(this.#S.values()), o = document.adoptedStyleSheets.filter(
3440
- (n) => !Array.from(this.#S.values()).includes(n)
3485
+ #he() {
3486
+ const e = Array.from(this.#R.values()), o = document.adoptedStyleSheets.filter(
3487
+ (n) => !Array.from(this.#R.values()).includes(n)
3441
3488
  );
3442
3489
  document.adoptedStyleSheets = [...o, ...e];
3443
3490
  }
3444
- #Ne() {
3491
+ #Le() {
3445
3492
  const e = () => {
3446
3493
  const n = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
3447
- I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T());
3494
+ I(this, this.#e), q(this, this.#e), $(this, this.#e, this.#P());
3448
3495
  const r = this.#e.lightDomTitle, s = this.#e.hasToolButtonsContainer;
3449
3496
  if (r && !n || s && !i) {
3450
3497
  this.#t.markSourcesChanged(), this.#t.merge();
3451
3498
  const l = this.#i.querySelector(".tbw-shell-header");
3452
3499
  if (l) {
3453
- const a = Le(
3500
+ const a = De(
3454
3501
  this.#n.shell,
3455
3502
  this.#e,
3456
3503
  this.#n.icons?.toolPanel
3457
3504
  ), c = document.createElement("div");
3458
3505
  c.innerHTML = a;
3459
3506
  const d = c.firstElementChild;
3460
- d && (l.replaceWith(d), this.#Z());
3507
+ d && (l.replaceWith(d), this.#K());
3461
3508
  }
3462
3509
  }
3463
3510
  }, o = () => {
3464
- this.__lightDomColumnsCache = void 0, this.#L();
3511
+ this.__lightDomColumnsCache = void 0, this.#H();
3465
3512
  };
3466
3513
  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);
3467
3514
  }
3468
3515
  refreshColumns() {
3469
3516
  this.__lightDomColumnsCache = void 0, j(this), this.#t.parseLightDomColumns(this);
3470
3517
  const e = this.#e.lightDomTitle, o = this.#e.hasToolButtonsContainer;
3471
- I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T());
3518
+ I(this, this.#e), q(this, this.#e), $(this, this.#e, this.#P());
3472
3519
  const n = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
3473
3520
  if (n && !e || i && !o) {
3474
3521
  this.#t.markSourcesChanged(), this.#t.merge();
3475
3522
  const s = this.#i.querySelector(".tbw-shell-header");
3476
3523
  if (s) {
3477
- const l = Le(
3524
+ const l = De(
3478
3525
  this.#n.shell,
3479
3526
  this.#e,
3480
3527
  this.#n.icons?.toolPanel
3481
3528
  ), a = document.createElement("div");
3482
3529
  a.innerHTML = l;
3483
3530
  const c = a.firstElementChild;
3484
- c && (s.replaceWith(c), this.#Z());
3531
+ c && (s.replaceWith(c), this.#K());
3485
3532
  }
3486
3533
  }
3487
3534
  this.#s.requestPhase(T.COLUMNS, "refreshColumns");
3488
3535
  }
3489
- #K(e) {
3536
+ #Y(e) {
3490
3537
  const o = this._virtualization.rowHeight, n = this._virtualization.container ?? this, i = this._virtualization.viewportEl ?? n, r = n.clientHeight, s = i.clientHeight, a = this.shadowRoot?.querySelector(".tbw-scroll-area"), c = a ? a.clientHeight : r, u = c - s, p = this.#o?.getExtraHeight() ?? 0, f = Math.max(0, r - c);
3491
3538
  return e * o + u + p + f;
3492
3539
  }
@@ -3494,11 +3541,11 @@ ${o}`;
3494
3541
  if (!this._bodyEl) return;
3495
3542
  const n = this._rows.length;
3496
3543
  if (!this._virtualization.enabled) {
3497
- this.#X(0, n), o || this.#o?.afterRender();
3544
+ this.#B(0, n), o || this.#o?.afterRender();
3498
3545
  return;
3499
3546
  }
3500
3547
  if (this._rows.length <= this._virtualization.bypassThreshold) {
3501
- this._virtualization.start = 0, this._virtualization.end = n, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#X(0, n, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#K(n)}px`), this.#de(n, this._visibleColumns.length), o || this.#o?.afterRender();
3548
+ this._virtualization.start = 0, this._virtualization.end = n, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#B(0, n, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#Y(n)}px`), this.#se(n, this._visibleColumns.length), o || this.#o?.afterRender();
3502
3549
  return;
3503
3550
  }
3504
3551
  const i = this._virtualization.container ?? this, r = this._virtualization.viewportEl ?? i, s = r.clientHeight, l = this._virtualization.rowHeight, a = i.scrollTop;
@@ -3518,45 +3565,45 @@ ${o}`;
3518
3565
  this.#s.requestPhase(T.VIRTUALIZATION, "stale-refs-retry");
3519
3566
  return;
3520
3567
  }
3521
- const w = this.#K(n);
3568
+ const w = this.#Y(n);
3522
3569
  this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${w}px`);
3523
- const b = this.#o?.getExtraHeightBefore?.(c) ?? 0, S = -(a - c * l - b);
3524
- this._bodyEl.style.transform = `translateY(${S}px)`, this.#X(c, g, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this.#de(n, this._visibleColumns.length), e && !o && (this.#o?.afterRender(), queueMicrotask(() => {
3570
+ const v = this.#o?.getExtraHeightBefore?.(c) ?? 0, S = -(a - c * l - v);
3571
+ this._bodyEl.style.transform = `translateY(${S}px)`, this.#B(c, g, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this.#se(n, this._visibleColumns.length), e && !o && (this.#o?.afterRender(), queueMicrotask(() => {
3525
3572
  const C = i.clientHeight, _ = r.clientHeight;
3526
3573
  if (C === 0 && _ > 0) return;
3527
- const A = this.#K(n);
3574
+ const A = this.#Y(n);
3528
3575
  this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${A}px`);
3529
3576
  }));
3530
3577
  }
3531
- #Q() {
3532
- I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T()), this.#t.markSourcesChanged(), this.#t.merge();
3578
+ #j() {
3579
+ I(this, this.#e), q(this, this.#e), $(this, this.#e, this.#P()), this.#t.markSourcesChanged(), this.#t.merge();
3533
3580
  const e = this.#n?.shell;
3534
- Kt(
3581
+ so(
3535
3582
  this.#i,
3536
3583
  e,
3537
3584
  { isPanelOpen: this.#e.isPanelOpen, expandedSections: this.#e.expandedSections },
3538
3585
  this.#n?.icons
3539
- ) && (this.#Z(), this.#c.setInitialized(!0));
3586
+ ) && (this.#K(), this.#c.setInitialized(!0));
3540
3587
  }
3541
- #Z() {
3542
- Vt(this.#i, this.#n?.shell, this.#e, {
3588
+ #K() {
3589
+ eo(this.#i, this.#n?.shell, this.#e, {
3543
3590
  onPanelToggle: () => this.toggleToolPanel(),
3544
3591
  onSectionToggle: (e) => this.toggleToolPanelSection(e)
3545
- }), this.#z?.(), this.#z = Bt(this.#i, this.#n?.shell, (e) => {
3592
+ }), this.#k?.(), this.#k = to(this.#i, this.#n?.shell, (e) => {
3546
3593
  this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
3547
3594
  });
3548
3595
  }
3549
3596
  }
3550
- customElements.get(L.tagName) || customElements.define(L.tagName, L);
3551
- globalThis.DataGridElement = L;
3552
- const go = {
3597
+ customElements.get(k.tagName) || customElements.define(k.tagName, k);
3598
+ globalThis.DataGridElement = k;
3599
+ const qo = {
3553
3600
  CAN_MOVE_COLUMN: "canMoveColumn",
3554
3601
  GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
3555
3602
  };
3556
- class wo {
3603
+ class $o {
3557
3604
  static dependencies;
3558
3605
  static manifest;
3559
- version = "1.10.0";
3606
+ version = "1.11.0";
3560
3607
  styles;
3561
3608
  cellRenderers;
3562
3609
  headerRenderers;
@@ -3628,7 +3675,7 @@ class wo {
3628
3675
  }
3629
3676
  get gridIcons() {
3630
3677
  const e = this.grid?.gridConfig?.icons ?? {};
3631
- return { ...k, ...e };
3678
+ return { ...M, ...e };
3632
3679
  }
3633
3680
  get isAnimationEnabled() {
3634
3681
  const e = this.grid?.effectiveConfig?.animation?.mode ?? "reduced-motion";
@@ -3695,7 +3742,7 @@ const P = {
3695
3742
  GROUP_KEY: "data-group-key",
3696
3743
  TREE_LEVEL: "data-tree-level",
3697
3744
  STICKY: "data-sticky"
3698
- }, bo = {
3745
+ }, Wo = {
3699
3746
  ROOT: `.${P.ROOT}`,
3700
3747
  HEADER: `.${P.HEADER}`,
3701
3748
  HEADER_ROW: `.${P.HEADER_ROW}`,
@@ -3710,7 +3757,7 @@ const P = {
3710
3757
  CELL_AT: (t, e) => `.${P.DATA_ROW}[${te.ROW_INDEX}="${t}"] .${P.DATA_CELL}[${te.COL_INDEX}="${e}"]`,
3711
3758
  SELECTED_ROWS: `.${P.DATA_ROW}.${P.SELECTED}`,
3712
3759
  EDITING_CELL: `.${P.DATA_CELL}.${P.EDITING}`
3713
- }, mo = {
3760
+ }, Fo = {
3714
3761
  COLOR_BG: "--tbw-color-bg",
3715
3762
  COLOR_FG: "--tbw-color-fg",
3716
3763
  COLOR_FG_MUTED: "--tbw-color-fg-muted",
@@ -3729,14 +3776,14 @@ const P = {
3729
3776
  BORDER_RADIUS: "--tbw-border-radius",
3730
3777
  FOCUS_OUTLINE: "--tbw-focus-outline"
3731
3778
  };
3732
- function vo(t) {
3779
+ function Uo(t) {
3733
3780
  const e = document.createElement("tbw-grid");
3734
3781
  return t && (e.gridConfig = t), e;
3735
3782
  }
3736
- function Co(t, e = document) {
3783
+ function Vo(t, e = document) {
3737
3784
  return e.querySelector(t);
3738
3785
  }
3739
- const yo = {
3786
+ const Bo = {
3740
3787
  CELL_CHANGE: "cell-change",
3741
3788
  CELL_COMMIT: "cell-commit",
3742
3789
  ROW_COMMIT: "row-commit",
@@ -3749,7 +3796,7 @@ const yo = {
3749
3796
  CELL_ACTIVATE: "cell-activate",
3750
3797
  GROUP_TOGGLE: "group-toggle",
3751
3798
  COLUMN_STATE_CHANGE: "column-state-change"
3752
- }, _o = {
3799
+ }, Go = {
3753
3800
  SELECTION_CHANGE: "selection-change",
3754
3801
  TREE_EXPAND: "tree-expand",
3755
3802
  FILTER_CHANGE: "filter-change",
@@ -3767,7 +3814,7 @@ const yo = {
3767
3814
  COLUMN_REORDER: "column-reorder",
3768
3815
  DETAIL_EXPAND: "detail-expand",
3769
3816
  GROUP_EXPAND: "group-expand"
3770
- }, de = {
3817
+ }, he = {
3771
3818
  sum: (t, e) => t.reduce((o, n) => o + (Number(n[e]) || 0), 0),
3772
3819
  avg: (t, e) => {
3773
3820
  const o = t.reduce((n, i) => n + (Number(i[e]) || 0), 0);
@@ -3778,7 +3825,7 @@ const yo = {
3778
3825
  max: (t, e) => Math.max(...t.map((o) => Number(o[e]) || -1 / 0)),
3779
3826
  first: (t, e) => t[0]?.[e],
3780
3827
  last: (t, e) => t[t.length - 1]?.[e]
3781
- }, V = /* @__PURE__ */ new Map(), M = {
3828
+ }, V = /* @__PURE__ */ new Map(), O = {
3782
3829
  register(t, e) {
3783
3830
  V.set(t, e);
3784
3831
  },
@@ -3787,19 +3834,19 @@ const yo = {
3787
3834
  },
3788
3835
  get(t) {
3789
3836
  if (t !== void 0)
3790
- return typeof t == "function" ? t : V.get(t) ?? de[t];
3837
+ return typeof t == "function" ? t : V.get(t) ?? he[t];
3791
3838
  },
3792
3839
  run(t, e, o, n) {
3793
3840
  const i = this.get(t);
3794
3841
  return i ? i(e, o, n) : void 0;
3795
3842
  },
3796
3843
  has(t) {
3797
- return V.has(t) || t in de;
3844
+ return V.has(t) || t in he;
3798
3845
  },
3799
3846
  list() {
3800
- return [...Object.keys(de), ...V.keys()];
3847
+ return [...Object.keys(he), ...V.keys()];
3801
3848
  }
3802
- }, ze = {
3849
+ }, Ie = {
3803
3850
  sum: (t) => t.reduce((e, o) => e + o, 0),
3804
3851
  avg: (t) => t.length ? t.reduce((e, o) => e + o, 0) / t.length : 0,
3805
3852
  count: (t) => t.length,
@@ -3808,47 +3855,47 @@ const yo = {
3808
3855
  first: (t) => t[0] ?? 0,
3809
3856
  last: (t) => t[t.length - 1] ?? 0
3810
3857
  };
3811
- function fo(t) {
3812
- return ze[t] ?? ze.sum;
3858
+ function No(t) {
3859
+ return Ie[t] ?? Ie.sum;
3813
3860
  }
3814
- function Eo(t, e) {
3815
- return fo(t)(e);
3861
+ function Xo(t, e) {
3862
+ return No(t)(e);
3816
3863
  }
3817
- const So = M.register.bind(M), Ro = M.unregister.bind(M), xo = M.get.bind(M), Ao = M.run.bind(M), To = M.list.bind(M);
3864
+ const Yo = O.register.bind(O), jo = O.unregister.bind(O), Ko = O.get.bind(O), Qo = O.run.bind(O), Zo = O.list.bind(O);
3818
3865
  export {
3819
- wo as BaseGridPlugin,
3820
- Je as DEFAULT_ANIMATION_CONFIG,
3821
- k as DEFAULT_GRID_ICONS,
3822
- yo as DGEvents,
3823
- L as DataGridElement,
3866
+ $o as BaseGridPlugin,
3867
+ ot as DEFAULT_ANIMATION_CONFIG,
3868
+ M as DEFAULT_GRID_ICONS,
3869
+ Bo as DGEvents,
3870
+ k as DataGridElement,
3824
3871
  X as FitModeEnum,
3825
- mo as GridCSSVars,
3872
+ Fo as GridCSSVars,
3826
3873
  P as GridClasses,
3827
3874
  te as GridDataAttrs,
3828
- L as GridElement,
3829
- bo as GridSelectors,
3830
- go as PLUGIN_QUERIES,
3831
- _o as PluginEvents,
3832
- uo as PluginManager,
3875
+ k as GridElement,
3876
+ Wo as GridSelectors,
3877
+ qo as PLUGIN_QUERIES,
3878
+ Go as PluginEvents,
3879
+ xo as PluginManager,
3833
3880
  T as RenderPhase,
3834
- $ as a,
3835
- M as aggregatorRegistry,
3836
- We as b,
3837
- Pt as builtInSort,
3838
- fe as c,
3839
- vo as createGrid,
3840
- Tt as defaultComparator,
3841
- Ne as e,
3842
- bt as g,
3843
- xo as getAggregator,
3844
- fo as getValueAggregator,
3845
- To as listAggregators,
3846
- Co as queryGrid,
3847
- po as r,
3848
- So as registerAggregator,
3849
- Ao as runAggregator,
3850
- Eo as runValueAggregator,
3881
+ $e as a,
3882
+ O as aggregatorRegistry,
3883
+ Ue as b,
3884
+ Dt as builtInSort,
3885
+ we as c,
3886
+ Uo as createGrid,
3887
+ Ht as defaultComparator,
3888
+ W as e,
3889
+ Ct as g,
3890
+ Ko as getAggregator,
3891
+ No as getValueAggregator,
3892
+ Zo as listAggregators,
3893
+ Vo as queryGrid,
3894
+ Io as r,
3895
+ Yo as registerAggregator,
3896
+ Qo as runAggregator,
3897
+ Xo as runValueAggregator,
3851
3898
  F as s,
3852
- Ro as unregisterAggregator
3899
+ jo as unregisterAggregator
3853
3900
  };
3854
3901
  //# sourceMappingURL=index.js.map