@toolbox-web/grid 1.7.0 → 1.9.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 (118) hide show
  1. package/README.md +51 -15
  2. package/all.js +717 -574
  3. package/all.js.map +1 -1
  4. package/index.js +586 -505
  5. package/index.js.map +1 -1
  6. package/lib/core/grid.d.ts +22 -1
  7. package/lib/core/grid.d.ts.map +1 -1
  8. package/lib/core/internal/header.d.ts.map +1 -1
  9. package/lib/core/internal/keyboard.d.ts.map +1 -1
  10. package/lib/core/internal/rows.d.ts.map +1 -1
  11. package/lib/core/internal/utils.d.ts +46 -0
  12. package/lib/core/internal/utils.d.ts.map +1 -1
  13. package/lib/core/plugin/base-plugin.d.ts +182 -1
  14. package/lib/core/plugin/base-plugin.d.ts.map +1 -1
  15. package/lib/core/plugin/index.d.ts +1 -1
  16. package/lib/core/plugin/index.d.ts.map +1 -1
  17. package/lib/core/plugin/plugin-manager.d.ts +56 -1
  18. package/lib/core/plugin/plugin-manager.d.ts.map +1 -1
  19. package/lib/core/plugin/types.d.ts +36 -0
  20. package/lib/core/plugin/types.d.ts.map +1 -1
  21. package/lib/core/types.d.ts +1232 -28
  22. package/lib/core/types.d.ts.map +1 -1
  23. package/lib/plugins/clipboard/ClipboardPlugin.d.ts.map +1 -1
  24. package/lib/plugins/clipboard/index.js +140 -87
  25. package/lib/plugins/clipboard/index.js.map +1 -1
  26. package/lib/plugins/column-virtualization/index.js +64 -7
  27. package/lib/plugins/column-virtualization/index.js.map +1 -1
  28. package/lib/plugins/context-menu/index.js +101 -44
  29. package/lib/plugins/context-menu/index.js.map +1 -1
  30. package/lib/plugins/editing/EditingPlugin.d.ts +6 -1
  31. package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
  32. package/lib/plugins/editing/index.js +95 -13
  33. package/lib/plugins/editing/index.js.map +1 -1
  34. package/lib/plugins/export/index.js +91 -34
  35. package/lib/plugins/export/index.js.map +1 -1
  36. package/lib/plugins/filtering/FilteringPlugin.d.ts +6 -1
  37. package/lib/plugins/filtering/FilteringPlugin.d.ts.map +1 -1
  38. package/lib/plugins/filtering/index.js +192 -123
  39. package/lib/plugins/filtering/index.js.map +1 -1
  40. package/lib/plugins/grouping-columns/index.js +57 -0
  41. package/lib/plugins/grouping-columns/index.js.map +1 -1
  42. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts +7 -2
  43. package/lib/plugins/grouping-rows/GroupingRowsPlugin.d.ts.map +1 -1
  44. package/lib/plugins/grouping-rows/index.js +139 -60
  45. package/lib/plugins/grouping-rows/index.js.map +1 -1
  46. package/lib/plugins/master-detail/index.js +69 -12
  47. package/lib/plugins/master-detail/index.js.map +1 -1
  48. package/lib/plugins/multi-sort/index.js +70 -13
  49. package/lib/plugins/multi-sort/index.js.map +1 -1
  50. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts +16 -9
  51. package/lib/plugins/pinned-columns/PinnedColumnsPlugin.d.ts.map +1 -1
  52. package/lib/plugins/pinned-columns/index.js +158 -61
  53. package/lib/plugins/pinned-columns/index.js.map +1 -1
  54. package/lib/plugins/pinned-columns/pinned-columns.d.ts +24 -7
  55. package/lib/plugins/pinned-columns/pinned-columns.d.ts.map +1 -1
  56. package/lib/plugins/pinned-columns/types.d.ts +51 -2
  57. package/lib/plugins/pinned-columns/types.d.ts.map +1 -1
  58. package/lib/plugins/pinned-rows/index.js +57 -0
  59. package/lib/plugins/pinned-rows/index.js.map +1 -1
  60. package/lib/plugins/pivot/index.js +57 -0
  61. package/lib/plugins/pivot/index.js.map +1 -1
  62. package/lib/plugins/print/index.js +58 -1
  63. package/lib/plugins/print/index.js.map +1 -1
  64. package/lib/plugins/reorder/ReorderPlugin.d.ts.map +1 -1
  65. package/lib/plugins/reorder/column-drag.d.ts +2 -2
  66. package/lib/plugins/reorder/index.js +68 -17
  67. package/lib/plugins/reorder/index.js.map +1 -1
  68. package/lib/plugins/responsive/ResponsivePlugin.d.ts +6 -1
  69. package/lib/plugins/responsive/ResponsivePlugin.d.ts.map +1 -1
  70. package/lib/plugins/responsive/index.js +299 -85
  71. package/lib/plugins/responsive/index.js.map +1 -1
  72. package/lib/plugins/row-reorder/index.js +169 -112
  73. package/lib/plugins/row-reorder/index.js.map +1 -1
  74. package/lib/plugins/selection/SelectionPlugin.d.ts +14 -2
  75. package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
  76. package/lib/plugins/selection/index.js +84 -7
  77. package/lib/plugins/selection/index.js.map +1 -1
  78. package/lib/plugins/server-side/index.js +79 -22
  79. package/lib/plugins/server-side/index.js.map +1 -1
  80. package/lib/plugins/tree/TreePlugin.d.ts +7 -1
  81. package/lib/plugins/tree/TreePlugin.d.ts.map +1 -1
  82. package/lib/plugins/tree/index.js +143 -61
  83. package/lib/plugins/tree/index.js.map +1 -1
  84. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts +6 -1
  85. package/lib/plugins/undo-redo/UndoRedoPlugin.d.ts.map +1 -1
  86. package/lib/plugins/undo-redo/index.js +79 -10
  87. package/lib/plugins/undo-redo/index.js.map +1 -1
  88. package/lib/plugins/visibility/index.js +57 -0
  89. package/lib/plugins/visibility/index.js.map +1 -1
  90. package/package.json +1 -1
  91. package/public.d.ts +79 -1
  92. package/public.d.ts.map +1 -1
  93. package/umd/grid.all.umd.js +25 -25
  94. package/umd/grid.all.umd.js.map +1 -1
  95. package/umd/grid.umd.js +11 -11
  96. package/umd/grid.umd.js.map +1 -1
  97. package/umd/plugins/clipboard.umd.js +5 -5
  98. package/umd/plugins/clipboard.umd.js.map +1 -1
  99. package/umd/plugins/editing.umd.js +1 -1
  100. package/umd/plugins/editing.umd.js.map +1 -1
  101. package/umd/plugins/filtering.umd.js +1 -1
  102. package/umd/plugins/filtering.umd.js.map +1 -1
  103. package/umd/plugins/grouping-rows.umd.js +2 -2
  104. package/umd/plugins/grouping-rows.umd.js.map +1 -1
  105. package/umd/plugins/pinned-columns.umd.js +1 -1
  106. package/umd/plugins/pinned-columns.umd.js.map +1 -1
  107. package/umd/plugins/print.umd.js +1 -1
  108. package/umd/plugins/print.umd.js.map +1 -1
  109. package/umd/plugins/reorder.umd.js +1 -1
  110. package/umd/plugins/reorder.umd.js.map +1 -1
  111. package/umd/plugins/responsive.umd.js +1 -1
  112. package/umd/plugins/responsive.umd.js.map +1 -1
  113. package/umd/plugins/selection.umd.js +2 -2
  114. package/umd/plugins/selection.umd.js.map +1 -1
  115. package/umd/plugins/tree.umd.js +1 -1
  116. package/umd/plugins/tree.umd.js.map +1 -1
  117. package/umd/plugins/undo-redo.umd.js +1 -1
  118. package/umd/plugins/undo-redo.umd.js.map +1 -1
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
- const ge = '@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:light dark;position:relative;display:block;width:100%;height:100%;min-height:0;contain:content;font-family:var(--tbw-font-family);font-size:var(--tbw-font-size);background:var(--tbw-color-bg);color:var(--tbw-color-fg);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);overflow:clip;outline:none;&,*{box-sizing:border-box}.header{display:block;flex-shrink:0;z-index:var(--tbw-z-layer-header, 30);background:var(--tbw-color-header-bg);overflow:visible}.header-group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-color-header-bg);z-index:var(--tbw-z-layer-header, 30)}.header-group-cell{display:flex;align-items:center;justify-content:flex-start;padding:var(--tbw-cell-padding-header, 2px 8px);color:var(--tbw-color-header-group-fg, var(--tbw-color-header-fg));font-weight:var(--tbw-font-weight-header-group, var(--tbw-font-weight-header));justify-content:var(--tbw-align-header-group, var(--tbw-align-header, flex-start));&:not(:last-child){border-right:2px solid var(--tbw-color-border)}}.header-row{display:grid;grid-template-columns:var(--tbw-column-template);color:var(--tbw-color-header-fg);font-size:var(--tbw-font-size-header);min-height:var(--tbw-header-height);border-bottom:var(--tbw-border-header);z-index:var(--tbw-z-layer-header, 30);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}&.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%}}.rows-body-wrapper{flex:1;min-height:0;display:flex;flex-direction:row;width:100%;min-width:fit-content}.rows-body{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:visible}.rows-container{display:flex;flex-direction:row;flex:1;min-height:0;overflow:visible}.rows-viewport{flex:1;min-width:0;position:relative;display:block;overflow:clip;.rows{position:absolute;top:0;left:0;min-width:100%;will-change:transform;z-index:var(--tbw-z-layer-rows, 1)}}.faux-vscroll{position:sticky;inset-inline-end:0;flex-shrink:0;width:auto;overflow-y:auto;overflow-x:hidden;z-index:var(--tbw-z-layer-header, 30)}.faux-vscroll-spacer{width:1px}.data-grid-row{display:grid;grid-template-columns:var(--tbw-column-template);contain:layout style;content-visibility:auto;contain-intrinsic-size:auto var(--tbw-row-height);&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}>.cell{display:block;padding:var(--tbw-cell-padding, 2px 8px);border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height);line-height:calc(var(--tbw-row-height) - 5px);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0;white-space:var(--tbw-cell-white-space, nowrap);text-overflow:ellipsis;>*{overflow:hidden;text-overflow:ellipsis;white-space:inherit;min-width:0}&:last-child{border-right:0}&[data-type=boolean]{text-align:center;input[type=checkbox]{margin:0;width:var(--tbw-checkbox-size);height:var(--tbw-checkbox-size);vertical-align:middle}}&.selected:focus-visible,&:focus-visible:not(.cell-focus){outline:none}&.sticky-left,&.sticky-right{background:var(--tbw-color-panel-bg)}}}.selecting .data-grid-row>.cell{user-select:none}.sortable{cursor:pointer;user-select:none}.resize-handle{position:absolute;top:0;right:calc(var(--tbw-resize-handle-width) / -2);width:var(--tbw-resize-handle-width);height:100%;cursor:e-resize;user-select:none;touch-action:none;z-index:20;background:var(--tbw-resize-handle-color);transition:background .12s ease;border-radius:var(--tbw-resize-handle-border-radius);&:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:var(--tbw-resize-indicator-width, 2px);height:0;background:var(--tbw-resize-indicator-color, var(--tbw-color-accent));opacity:0;pointer-events:none;transition:opacity .12s ease,height 0s .12s;z-index:1000}&:hover{background:var(--tbw-resize-handle-color-hover);&:after{height:100vh;opacity:var(--tbw-resize-indicator-opacity, .6);transition:opacity .12s ease,height 0s}}}&[data-has-focus]{.cell-focus,.row-focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}}.sticky-left,.sticky-right{position:sticky;z-index:25}.sticky-left{box-shadow:1px 0 0 var(--tbw-color-border)}.sticky-right{box-shadow:-1px 0 0 var(--tbw-color-border)}.tbw-shell-header{display:flex;align-items:center;gap:8px;min-height:var(--tbw-shell-header-height);padding:0 8px;background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0}.tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-shell-content{flex:1;display:flex;align-items:center;gap:12px;min-width:0;overflow:hidden}.tbw-shell-toolbar{display:flex;align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0}.tbw-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);padding:0;border:1px solid transparent;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg);cursor:pointer;font-size:16px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease),border-color var(--tbw-transition-duration) var(--tbw-transition-ease);&:hover{background:var(--tbw-color-row-hover)}&:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}&.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}&:disabled{opacity:.5;cursor:not-allowed}}.tbw-toolbar-separator{width:1px;height:20px;background:var(--tbw-color-border);margin:0 4px}.tbw-shell-body{position:relative;display:flex;flex:1;min-height:0;overflow:visible}.tbw-grid-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:row;overflow:hidden}.tbw-scroll-area{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow-x:auto;overflow-y:hidden;overflow-anchor:none}.tbw-tool-panel{position:absolute;top:0;bottom:0;right:0;width:0;overflow:hidden;background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);transition:width var(--tbw-tool-panel-transition);display:flex;flex-direction:column;z-index:30;box-shadow:-2px 0 8px var(--tbw-color-shadow);&[data-position=left]{right:auto;left:0;border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow)}&.open{width:var(--tbw-tool-panel-width)}}.tbw-tool-panel-resize{position:absolute;top:0;bottom:0;width:6px;cursor:col-resize;background:transparent;z-index:10;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);&[data-handle-position=left]{left:0}&[data-handle-position=right]{right:0}&:hover,&.resizing{background:var(--tbw-color-accent)}}.tbw-tool-panel-header{display:flex;align-items:center;justify-content:space-between;min-height:var(--tbw-tool-panel-header-height);padding:0 12px;border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0}.tbw-tool-panel-title{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-tool-panel-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg-muted);cursor:pointer;font-size:14px;&:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}}.tbw-tool-panel-content{flex:1;overflow:auto}.tbw-accordion{display:flex;flex-direction:column;gap:0}.tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border);&:last-child{border-bottom:none}&.single .tbw-accordion-header{cursor:default;&:hover{background:transparent}}&.expanded{.tbw-accordion-chevron{transform:rotate(90deg)}.tbw-accordion-content{display:block}}}.tbw-accordion-header{display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--tbw-color-fg);font-size:13px;font-weight:600;text-align:left;cursor:pointer;user-select:none;&:hover{background:var(--tbw-color-row-hover)}}.tbw-accordion-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:10px;color:var(--tbw-color-fg-muted);transition:transform .15s ease;flex-shrink:0}.tbw-accordion-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:14px;flex-shrink:0}.tbw-accordion-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tbw-accordion-content{display:none}.tbw-expanding{animation:tbw-expand var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}.tbw-collapsing{animation:tbw-collapse var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}&[data-animation-mode=off]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}@media(forced-colors:active){tbw-grid{--tbw-color-border: CanvasText;--tbw-color-border-strong: CanvasText;--tbw-color-border-cell: CanvasText;--tbw-color-border-header: CanvasText;--tbw-color-fg: CanvasText;--tbw-color-bg: Canvas;--tbw-color-panel-bg: Canvas;--tbw-color-header-bg: Canvas;--tbw-color-header-fg: CanvasText;--tbw-color-accent: Highlight;--tbw-color-accent-fg: HighlightText;--tbw-color-selection: Highlight;--tbw-color-row-hover: Highlight;--tbw-focus-outline: 2px solid Highlight;--tbw-range-border-color: Highlight;.cell:focus,.cell.active-cell{outline:2px solid Highlight!important;outline-offset:-2px}.data-grid-row[aria-selected=true]{background:Highlight!important;color:HighlightText!important}}}@media(prefers-reduced-motion:reduce){tbw-grid[data-animation-mode=reduced-motion]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}@keyframes tbw-expand{0%{opacity:0;max-height:0;transform:translateY(-8px)}to{opacity:1;max-height:500px;transform:translateY(0)}}@keyframes tbw-collapse{0%{opacity:1;max-height:500px;transform:translateY(0)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-row-change{0%{background-color:transparent}20%{background-color:var(--tbw-row-change-color)}to{background-color:transparent}}@keyframes tbw-row-insert{0%{opacity:0;max-height:0;overflow:hidden}to{opacity:1;max-height:var(--tbw-row-height, 28px);overflow:hidden}}@keyframes tbw-row-remove{0%{opacity:1;transform:translateY(0);max-height:var(--tbw-row-height, 28px)}to{opacity:0;max-height:0;transform:translateY(-8px)}}tbw-grid .data-grid-row[data-animating=change]{animation:tbw-row-change var(--tbw-row-change-duration) ease-out}tbw-grid .data-grid-row[data-animating=insert]{animation:tbw-row-insert var(--tbw-row-insert-duration) ease-out;will-change:max-height,opacity}tbw-grid .data-grid-row[data-animating=remove]{animation:tbw-row-remove var(--tbw-row-remove-duration) ease-out forwards;will-change:max-height,opacity,transform;pointer-events:none}@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 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:light dark;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}&.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%}}.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 = {
2
2
  STRETCH: "stretch",
3
3
  FIXED: "fixed"
4
- }, Ze = {
4
+ }, Je = {
5
5
  mode: "reduced-motion",
6
6
  duration: 200,
7
7
  easing: "ease-out"
8
- }, we = '<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
+ }, 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 = {
9
9
  expand: "▶",
10
10
  collapse: "▼",
11
11
  sortAsc: "▲",
@@ -14,11 +14,11 @@ const ge = '@layer tbw-base,tbw-plugins,tbw-theme;@layer tbw-base{tbw-grid{--tbw
14
14
  submenuArrow: "▶",
15
15
  dragHandle: "⋮⋮",
16
16
  toolPanel: "☰",
17
- filter: we,
18
- filterActive: we,
17
+ filter: be,
18
+ filterActive: be,
19
19
  print: "🖨️"
20
20
  };
21
- function Je(t) {
21
+ function et(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;
@@ -37,14 +37,14 @@ function Je(t) {
37
37
  f && (h.__editorName = f), g && (h.__rendererName = g);
38
38
  const d = o.getAttribute("options");
39
39
  d && (h.options = d.split(",").map((m) => {
40
- const [M, R] = m.includes(":") ? m.split(":") : [m.trim(), m.trim()];
41
- return { value: M.trim(), label: R?.trim() || M.trim() };
40
+ const [z, R] = m.includes(":") ? m.split(":") : [m.trim(), m.trim()];
41
+ return { value: z.trim(), label: R?.trim() || z.trim() };
42
42
  }));
43
43
  const w = o.querySelector("tbw-grid-column-view"), b = o.querySelector("tbw-grid-column-editor"), S = o.querySelector("tbw-grid-column-header");
44
44
  w && (h.__viewTemplate = w), b && (h.__editorTemplate = b), S && (h.__headerTemplate = S);
45
- const _ = globalThis.DataGridElement?.getAdapters?.() ?? [], T = w ?? o, v = _.find((m) => m.canHandle(T));
45
+ const _ = globalThis.DataGridElement?.getAdapters?.() ?? [], A = w ?? o, v = _.find((m) => m.canHandle(A));
46
46
  if (v) {
47
- const m = v.createRenderer(T);
47
+ const m = v.createRenderer(A);
48
48
  m && (h.viewRenderer = m);
49
49
  }
50
50
  const E = b ?? o, y = _.find((m) => m.canHandle(E));
@@ -55,7 +55,7 @@ function Je(t) {
55
55
  return h;
56
56
  }).filter((o) => !!o);
57
57
  }
58
- function be(t, e) {
58
+ function me(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 be(t, e) {
79
79
  });
80
80
  return Object.keys(o).forEach((i) => n.push(o[i])), n;
81
81
  }
82
- function ze(t, e) {
82
+ function ke(t, e) {
83
83
  try {
84
84
  t.part?.add?.(e);
85
85
  } catch {
@@ -87,7 +87,7 @@ function ze(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 me(t) {
90
+ function ve(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 Qe(t) {
117
+ function tt(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 et(t, e) {
120
+ function ot(t, e) {
121
121
  const o = t[0] || {}, n = Object.keys(o).map((r) => {
122
- const s = o[r], l = Qe(s);
122
+ const s = o[r], l = tt(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 tt = /{{\s*([^}]+)\s*}}/g, O = "__DG_EMPTY__", ot = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, nt = /__(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 it(t) {
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) {
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 rt = /* @__PURE__ */ new Set([
133
+ const lt = /* @__PURE__ */ new Set([
134
134
  "script",
135
135
  "iframe",
136
136
  "object",
@@ -155,23 +155,23 @@ const rt = /* @__PURE__ */ new Set([
155
155
  "plaintext",
156
156
  "xmp",
157
157
  "listing"
158
- ]), ve = /^on\w+$/i, st = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), lt = /^\s*(javascript|vbscript|data|blob):/i;
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;
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, at(e.content), e.innerHTML;
163
+ return e.innerHTML = t, dt(e.content), e.innerHTML;
164
164
  }
165
- function at(t) {
165
+ function dt(t) {
166
166
  const e = [], o = t.querySelectorAll("*");
167
167
  for (const n of o) {
168
168
  const i = n.tagName.toLowerCase();
169
- if (rt.has(i)) {
169
+ if (lt.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) => ve.test(l.name) || l.name === "href" || l.name === "xlink:href"
174
+ (l) => Ce.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 at(t) {
179
179
  const r = [];
180
180
  for (const s of n.attributes) {
181
181
  const l = s.name.toLowerCase();
182
- if (ve.test(l)) {
182
+ if (Ce.test(l)) {
183
183
  r.push(s.name);
184
184
  continue;
185
185
  }
186
- if (st.has(l) && lt.test(s.value)) {
186
+ if (at.has(l) && ct.test(s.value)) {
187
187
  r.push(s.name);
188
188
  continue;
189
189
  }
@@ -196,35 +196,35 @@ function at(t) {
196
196
  }
197
197
  e.forEach((n) => n.remove());
198
198
  }
199
- function Me(t, e) {
199
+ function Ne(t, e) {
200
200
  if (!t || t.indexOf("{{") === -1) return t;
201
- const o = [], n = t.replace(tt, (l, a) => {
202
- const c = ct(a, e);
201
+ const o = [], n = t.replace(nt, (l, a) => {
202
+ const c = ht(a, e);
203
203
  return o.push({ expr: a.trim(), result: c }), c;
204
- }), i = dt(n), r = o.length && o.every((l) => l.result === "" || l.result === O);
204
+ }), i = ut(n), r = o.length && o.every((l) => l.result === "" || l.result === D);
205
205
  return /Reflect\.|\bProxy\b|ownKeys\(/.test(t) || r ? "" : i;
206
206
  }
207
- function ct(t, e) {
208
- if (t = (t || "").trim(), !t || /\b(Reflect|Proxy|ownKeys)\b/.test(t)) return O;
209
- if (t === "value") return e.value == null ? O : String(e.value);
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);
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 ? O : String(i);
212
+ return i == null ? D : String(i);
213
213
  }
214
- if (t.length > 80 || !ot.test(t) || nt.test(t)) return O;
214
+ if (t.length > 80 || !it.test(t) || rt.test(t)) return D;
215
215
  const o = t.match(/\./g);
216
- if (o && o.length > 1) return O;
216
+ if (o && o.length > 1) return D;
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) ? O : r || O;
219
+ return /Reflect|Proxy|ownKeys/.test(r) ? D : r || D;
220
220
  } catch {
221
- return O;
221
+ return D;
222
222
  }
223
223
  }
224
- function dt(t) {
225
- return t && t.replace(new RegExp(O, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
224
+ function ut(t) {
225
+ return t && t.replace(new RegExp(D, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
226
226
  }
227
- function ht(t) {
227
+ function ft(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,19 +236,19 @@ function ht(t) {
236
236
  (t.textContent || "").trim().length === 0 && (t.textContent = "");
237
237
  }
238
238
  }
239
- function Ce(t) {
240
- const e = /Reflect\.|\bProxy\b|ownKeys\(/.test(t), o = ((n) => e ? "" : Me(t, n));
239
+ function ye(t) {
240
+ const e = /Reflect\.|\bProxy\b|ownKeys\(/.test(t), o = ((n) => e ? "" : Ne(t, n));
241
241
  return o.__blocked = e, o;
242
242
  }
243
- const ut = 100;
244
- class ft {
243
+ const pt = 100;
244
+ class gt {
245
245
  #l;
246
246
  #i;
247
247
  #u;
248
248
  #d;
249
249
  #h;
250
250
  #a = {};
251
- #o = {};
251
+ #n = {};
252
252
  #f = !0;
253
253
  #g = [];
254
254
  #m;
@@ -263,13 +263,13 @@ class ft {
263
263
  return this.#a;
264
264
  }
265
265
  get effective() {
266
- return this.#o;
266
+ return this.#n;
267
267
  }
268
268
  get columns() {
269
- return this.#o.columns ?? [];
269
+ return this.#n.columns ?? [];
270
270
  }
271
271
  set columns(e) {
272
- this.#o.columns = e;
272
+ this.#n.columns = e;
273
273
  }
274
274
  get lightDomColumnsCache() {
275
275
  return this.#d;
@@ -320,11 +320,11 @@ class ft {
320
320
  return this.#u;
321
321
  }
322
322
  merge() {
323
- const e = (this.#o.columns?.length ?? 0) > 0;
323
+ const e = (this.#n.columns?.length ?? 0) > 0;
324
324
  if (!this.#f && e)
325
325
  return;
326
326
  const o = this.#w();
327
- this.#f = !1, this.#a = o, Object.freeze(this.#a), this.#a.columns && Object.freeze(this.#a.columns), this.#o = this.#R(this.#a), this.#H();
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();
328
328
  }
329
329
  #R(e) {
330
330
  const o = { ...e };
@@ -337,7 +337,7 @@ class ft {
337
337
  }), o;
338
338
  }
339
339
  #H() {
340
- const e = this.#o;
340
+ const e = this.#n;
341
341
  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);
@@ -346,19 +346,19 @@ class ft {
346
346
  const e = this.#l ? { ...this.#l } : {}, o = Array.isArray(e.columns) ? [...e.columns] : [], n = (this.#d ?? []).map((s) => ({
347
347
  ...s
348
348
  }));
349
- let i = be(
349
+ let i = me(
350
350
  o,
351
351
  n
352
352
  );
353
- this.#i && this.#i.length && (i = be(
353
+ this.#i && this.#i.length && (i = me(
354
354
  this.#i,
355
355
  n
356
356
  ));
357
357
  const r = this.#r.getRows();
358
- return i.length === 0 && r.length && (i = et(r).columns), i.length && (i.forEach((s) => {
358
+ return i.length === 0 && r.length && (i = ot(r).columns), i.length && (i.forEach((s) => {
359
359
  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
360
  }), i.forEach((s) => {
361
- s.__viewTemplate && !s.__compiledView && (s.__compiledView = Ce(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = Ce(s.__editorTemplate.innerHTML));
361
+ s.__viewTemplate && !s.__compiledView && (s.__compiledView = ye(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = ye(s.__editorTemplate.innerHTML));
362
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;
363
363
  }
364
364
  #C(e) {
@@ -430,7 +430,7 @@ class ft {
430
430
  l.applyColumnState(a.field, a);
431
431
  }
432
432
  resetState(e) {
433
- this.#v = void 0, this.#r.setSortState(null), this.#o = this.#R(this.#a), this.#H();
433
+ this.#v = void 0, this.#r.setSortState(null), this.#n = this.#R(this.#a), this.#H();
434
434
  for (const o of e)
435
435
  if (o.applyColumnState)
436
436
  for (const n of this.columns)
@@ -453,7 +453,7 @@ class ft {
453
453
  this.#s = void 0;
454
454
  const o = this.collectState(e);
455
455
  this.#r.emit("column-state-change", o);
456
- }, ut);
456
+ }, pt);
457
457
  }
458
458
  setColumnVisible(e, o) {
459
459
  const n = this.columns, i = n.find((s) => s.field === e);
@@ -501,7 +501,7 @@ class ft {
501
501
  this.columns = n, this.#r.renderHeader(), this.#r.updateTemplate(), this.#r.refreshVirtualWindow();
502
502
  }
503
503
  parseLightDomColumns(e) {
504
- this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ? Je(e) : []);
504
+ this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ? et(e) : []);
505
505
  }
506
506
  clearLightDomCache() {
507
507
  this.#d = void 0;
@@ -554,10 +554,10 @@ class ft {
554
554
  this.#m?.disconnect(), this.#g = [], this.#s && clearTimeout(this.#s);
555
555
  }
556
556
  }
557
- function ke(t) {
557
+ function Ie(t) {
558
558
  return `<span role="checkbox" aria-checked="${t}" aria-label="${t}">${t ? "&#x1F5F9;" : "&#9744;"}</span>`;
559
559
  }
560
- function Ne(t) {
560
+ function qe(t) {
561
561
  if (t == null || t === "") return "";
562
562
  if (t instanceof Date)
563
563
  return isNaN(t.getTime()) ? "" : t.toLocaleDateString();
@@ -567,7 +567,7 @@ function Ne(t) {
567
567
  }
568
568
  return "";
569
569
  }
570
- function Ie(t) {
570
+ function We(t) {
571
571
  if (!t) return -1;
572
572
  const e = t.getAttribute("data-row");
573
573
  if (e) return parseInt(e, 10);
@@ -580,15 +580,32 @@ function Ie(t) {
580
580
  if (i[r] === o) return r;
581
581
  return -1;
582
582
  }
583
- function pt(t) {
583
+ function wt(t) {
584
584
  if (!t) return -1;
585
585
  const e = t.getAttribute("data-col");
586
586
  return e ? parseInt(e, 10) : -1;
587
587
  }
588
- function ue(t) {
588
+ function fe(t) {
589
589
  t && t.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
590
590
  }
591
- function qe(t, e) {
591
+ function bt(t) {
592
+ try {
593
+ if (getComputedStyle(t).direction === "rtl") return "rtl";
594
+ } catch {
595
+ }
596
+ try {
597
+ if (t.closest?.("[dir]")?.getAttribute("dir") === "rtl") return "rtl";
598
+ } catch {
599
+ }
600
+ return "ltr";
601
+ }
602
+ function _e(t) {
603
+ return bt(t) === "rtl";
604
+ }
605
+ function po(t, e) {
606
+ return t === "left" || t === "right" ? t : e === "rtl" ? t === "start" ? "right" : "left" : t === "start" ? "left" : "right";
607
+ }
608
+ function $e(t, e) {
592
609
  const o = e.renderer || e.viewRenderer;
593
610
  if (o) return o;
594
611
  if (!e.type) return;
@@ -602,7 +619,7 @@ function qe(t, e) {
602
619
  return r.renderer;
603
620
  }
604
621
  }
605
- function We(t, e) {
622
+ function Fe(t, e) {
606
623
  if (e.format) return e.format;
607
624
  if (!e.type) return;
608
625
  const o = t.effectiveConfig?.typeDefaults;
@@ -615,31 +632,31 @@ function We(t, e) {
615
632
  return i.format;
616
633
  }
617
634
  }
618
- const $e = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
619
- function ie(t) {
635
+ const Ue = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
636
+ function re(t) {
620
637
  return (t.__editingCellCount ?? 0) > 0;
621
638
  }
622
- function re(t) {
639
+ function se(t) {
623
640
  t.__editingCellCount = 0, t.removeAttribute("data-has-editing"), t.querySelectorAll(".cell.editing").forEach((o) => o.classList.remove("editing"));
624
641
  }
625
- const Fe = document.createElement("template");
626
- Fe.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
627
- const Ue = document.createElement("template");
628
- Ue.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
629
- function gt() {
630
- return Fe.content.firstElementChild.cloneNode(!0);
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);
631
648
  }
632
- function wt() {
633
- return Ue.content.firstElementChild.cloneNode(!0);
649
+ function vt() {
650
+ return Be.content.firstElementChild.cloneNode(!0);
634
651
  }
635
652
  function j(t) {
636
653
  t.__cellDisplayCache = void 0, t.__cellCacheEpoch = void 0, t.__hasSpecialColumns = void 0;
637
654
  }
638
- function bt(t, e, o, n, i) {
655
+ function Ct(t, e, o, n, i) {
639
656
  const r = Math.max(0, o - e), s = t._bodyEl, l = t._visibleColumns, a = l.length;
640
657
  let c = t.__cachedHeaderRowCount;
641
658
  for (c === void 0 && (c = t.querySelector(".header-group-row") ? 2 : 1, t.__cachedHeaderRowCount = c); t._rowPool.length < r; ) {
642
- const p = wt();
659
+ const p = vt();
643
660
  t._rowPool.push(p);
644
661
  }
645
662
  if (t._rowPool.length > r) {
@@ -656,9 +673,9 @@ function bt(t, e, o, n, i) {
656
673
  d.__epoch = n, d.__rowDataRef = g, d.parentNode !== s && s.appendChild(d);
657
674
  continue;
658
675
  }
659
- const w = d.__epoch, b = d.__rowDataRef, S = d.children.length, _ = w === n && S === a, T = b !== g;
676
+ const w = d.__epoch, b = d.__rowDataRef, S = d.children.length, _ = w === n && S === a, A = b !== g;
660
677
  let v = !1;
661
- if (_ && T) {
678
+ if (_ && A) {
662
679
  for (let R = 0; R < a; R++)
663
680
  if (l[R].externalView && !d.querySelector(`.cell[data-col="${R}"] [data-external-view]`)) {
664
681
  v = !0;
@@ -666,14 +683,14 @@ function bt(t, e, o, n, i) {
666
683
  }
667
684
  }
668
685
  if (!_ || v) {
669
- const R = ie(d), x = t._activeEditRows === f;
670
- R && !x ? (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1), re(d), G(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : R && x ? (se(t, d, g, f), d.__rowDataRef = g) : (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1), G(t, d, g, f), d.__epoch = n, d.__rowDataRef = g);
671
- } else if (T) {
672
- const R = ie(d), x = t._activeEditRows === f;
673
- R && !x ? (re(d), G(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : (se(t, d, g, f), d.__rowDataRef = g);
686
+ const R = re(d), x = t._activeEditRows === f;
687
+ R && !x ? (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1), se(d), G(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : R && x ? (le(t, d, g, f), d.__rowDataRef = g) : (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1), G(t, d, g, f), d.__epoch = n, d.__rowDataRef = g);
688
+ } else if (A) {
689
+ const R = re(d), x = t._activeEditRows === f;
690
+ R && !x ? (se(d), G(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : (le(t, d, g, f), d.__rowDataRef = g);
674
691
  } else {
675
- const R = ie(d), x = t._activeEditRows === f;
676
- R && !x ? (re(d), G(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : se(t, d, g, f);
692
+ const R = re(d), x = t._activeEditRows === f;
693
+ R && !x ? (se(d), G(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : le(t, d, g, f);
677
694
  }
678
695
  let E = !1;
679
696
  const y = t.changedRowIds;
@@ -685,15 +702,15 @@ function bt(t, e, o, n, i) {
685
702
  }
686
703
  const m = d.classList.contains("changed");
687
704
  E !== m && d.classList.toggle("changed", E);
688
- const M = t.effectiveConfig?.rowClass;
689
- if (M) {
705
+ const z = t.effectiveConfig?.rowClass;
706
+ if (z) {
690
707
  const R = d.getAttribute("data-dynamic-classes");
691
708
  R && R.split(" ").forEach((x) => x && d.classList.remove(x));
692
709
  try {
693
- const x = M(g);
710
+ const x = z(g);
694
711
  if (x && x.length > 0) {
695
- const ne = x.filter((Y) => Y && typeof Y == "string");
696
- ne.forEach((Y) => d.classList.add(Y)), d.setAttribute("data-dynamic-classes", ne.join(" "));
712
+ const ie = x.filter((Y) => Y && typeof Y == "string");
713
+ ie.forEach((Y) => d.classList.add(Y)), d.setAttribute("data-dynamic-classes", ie.join(" "));
697
714
  } else
698
715
  d.removeAttribute("data-dynamic-classes");
699
716
  } catch (x) {
@@ -707,7 +724,7 @@ function bt(t, e, o, n, i) {
707
724
  }), d.parentNode !== s && s.appendChild(d);
708
725
  }
709
726
  }
710
- function se(t, e, o, n) {
727
+ function le(t, e, o, n) {
711
728
  const i = e.children, r = t._visibleColumns, s = r.length, l = i.length, a = s < l ? s : l, c = t._focusRow, h = t._focusCol, u = t._hasAfterCellRenderHook?.() ?? !1;
712
729
  let p = t.__hasSpecialColumns;
713
730
  if (p === void 0) {
@@ -757,9 +774,9 @@ function se(t, e, o, n) {
757
774
  const y = w.getAttribute("data-dynamic-classes");
758
775
  y && y.split(" ").forEach((m) => m && w.classList.remove(m));
759
776
  try {
760
- const m = o[d.field], M = C(m, o, d);
761
- if (M && M.length > 0) {
762
- const R = M.filter((x) => x && typeof x == "string");
777
+ const m = o[d.field], z = C(m, o, d);
778
+ if (z && z.length > 0) {
779
+ const R = z.filter((x) => x && typeof x == "string");
763
780
  R.forEach((x) => w.classList.add(x)), w.setAttribute("data-dynamic-classes", R.join(" "));
764
781
  } else
765
782
  w.removeAttribute("data-dynamic-classes");
@@ -768,7 +785,7 @@ function se(t, e, o, n) {
768
785
  }
769
786
  }
770
787
  if (w.classList.contains("editing")) continue;
771
- const _ = qe(t, d);
788
+ const _ = $e(t, d);
772
789
  if (_) {
773
790
  const y = o[d.field], m = _({
774
791
  row: o,
@@ -790,23 +807,24 @@ function se(t, e, o, n) {
790
807
  }
791
808
  if (d.__viewTemplate || d.__compiledView || d.externalView)
792
809
  continue;
793
- const T = o[d.field];
810
+ const A = o[d.field];
794
811
  let v;
795
- const E = We(t, d);
796
- if (E)
812
+ const E = Fe(t, d);
813
+ if (E) {
797
814
  try {
798
- const y = E(T, o);
815
+ const y = E(A, o);
799
816
  v = y == null ? "" : String(y);
800
817
  } catch (y) {
801
- console.warn(`[tbw-grid] Format error in column '${d.field}':`, y), v = T == null ? "" : String(T);
818
+ console.warn(`[tbw-grid] Format error in column '${d.field}':`, y), v = A == null ? "" : String(A);
802
819
  }
803
- else d.type === "date" ? (v = Ne(T), w.textContent = v) : d.type === "boolean" ? w.innerHTML = ke(!!T) : (v = T == null ? "" : String(T), w.textContent = v);
820
+ w.textContent = v;
821
+ } else d.type === "date" ? (v = qe(A), w.textContent = v) : d.type === "boolean" ? w.innerHTML = Ie(!!A) : (v = A == null ? "" : String(A), w.textContent = v);
804
822
  u && t._afterCellRender?.({
805
823
  row: o,
806
824
  rowIndex: n,
807
825
  column: d,
808
826
  colIndex: g,
809
- value: T,
827
+ value: A,
810
828
  cellElement: w,
811
829
  rowElement: e
812
830
  });
@@ -816,17 +834,17 @@ function G(t, e, o, n) {
816
834
  e.innerHTML = "";
817
835
  const i = t._visibleColumns, r = i.length, s = t._focusRow, l = t._focusCol, a = t, c = t._hasAfterCellRenderHook?.() ?? !1, h = document.createDocumentFragment();
818
836
  for (let u = 0; u < r; u++) {
819
- const p = i[u], f = gt();
837
+ const p = i[u], f = mt();
820
838
  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);
821
839
  let g = o[p.field];
822
- const d = We(t, p);
840
+ const d = Fe(t, p);
823
841
  if (d)
824
842
  try {
825
843
  g = d(g, o);
826
844
  } catch (v) {
827
845
  console.warn(`[tbw-grid] Format error in column '${p.field}':`, v);
828
846
  }
829
- const w = p.__compiledView, b = p.__viewTemplate, S = qe(t, p), C = p.externalView;
847
+ const w = p.__compiledView, b = p.__viewTemplate, S = $e(t, p), C = p.externalView;
830
848
  let _ = !1;
831
849
  if (S) {
832
850
  const v = S({ row: o, value: g, field: p.field, column: p, cellEl: f });
@@ -861,19 +879,19 @@ function G(t, e, o, n) {
861
879
  f.innerHTML = E ? "" : F(v), _ = !0, E && (f.textContent = "", f.setAttribute("data-blocked-template", ""));
862
880
  } else if (b) {
863
881
  const v = b.innerHTML;
864
- /Reflect\.|\bProxy\b|ownKeys\(/.test(v) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = F(Me(v, { row: o, value: g })), _ = !0);
882
+ /Reflect\.|\bProxy\b|ownKeys\(/.test(v) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = F(Ne(v, { row: o, value: g })), _ = !0);
865
883
  } else
866
- p.type === "date" ? f.textContent = Ne(g) : p.type === "boolean" ? f.innerHTML = ke(!!g) : f.textContent = g == null ? "" : String(g);
884
+ d ? 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);
867
885
  if (_) {
868
- ht(f);
886
+ ft(f);
869
887
  const v = f.textContent || "";
870
888
  /Proxy|Reflect\.ownKeys/.test(v) && (f.textContent = v.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(f.textContent || "") && (f.textContent = ""));
871
889
  }
872
890
  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");
873
- const T = p.cellClass;
874
- if (T)
891
+ const A = p.cellClass;
892
+ if (A)
875
893
  try {
876
- const v = o[p.field], E = T(v, o, p);
894
+ const v = o[p.field], E = A(v, o, p);
877
895
  if (E && E.length > 0) {
878
896
  const y = E.filter((m) => m && typeof m == "string");
879
897
  y.forEach((m) => f.classList.add(m)), f.setAttribute("data-dynamic-classes", y.join(" "));
@@ -893,9 +911,9 @@ function G(t, e, o, n) {
893
911
  }
894
912
  e.appendChild(h);
895
913
  }
896
- function ye(t, e, o) {
914
+ function Ee(t, e, o) {
897
915
  if (e.target?.closest(".resize-handle")) return;
898
- const n = o.querySelector(".cell[data-row]"), i = Ie(n);
916
+ const n = o.querySelector(".cell[data-row]"), i = We(n);
899
917
  if (i < 0) return;
900
918
  const r = t._rows[i];
901
919
  if (!r || t._dispatchRowClick?.(e, i, r, o))
@@ -908,8 +926,8 @@ function ye(t, e, o) {
908
926
  return;
909
927
  const a = t._focusRow !== i || t._focusCol !== l;
910
928
  if (t._focusRow = i, t._focusCol = l, s.classList.contains("editing")) {
911
- a && (ue(t._bodyEl ?? t), s.classList.add("cell-focus"));
912
- const c = s.querySelector($e);
929
+ a && (fe(t._bodyEl ?? t), s.classList.add("cell-focus"));
930
+ const c = s.querySelector(Ue);
913
931
  try {
914
932
  c?.focus({ preventScroll: !0 });
915
933
  } catch {
@@ -920,7 +938,7 @@ function ye(t, e, o) {
920
938
  }
921
939
  }
922
940
  }
923
- function mt(t, e) {
941
+ function yt(t, e) {
924
942
  if (t._dispatchKeyDown?.(e))
925
943
  return;
926
944
  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 = (h) => {
@@ -940,12 +958,14 @@ function mt(t, e) {
940
958
  case "ArrowUp":
941
959
  i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = Math.max(0, t._focusRow - 1), e.preventDefault();
942
960
  break;
943
- case "ArrowRight":
944
- t._focusCol = Math.min(n, t._focusCol + 1), e.preventDefault();
961
+ case "ArrowRight": {
962
+ _e(t) ? t._focusCol = Math.max(0, t._focusCol - 1) : t._focusCol = Math.min(n, t._focusCol + 1), e.preventDefault();
945
963
  break;
946
- case "ArrowLeft":
947
- t._focusCol = Math.max(0, t._focusCol - 1), e.preventDefault();
964
+ }
965
+ case "ArrowLeft": {
966
+ _e(t) ? t._focusCol = Math.min(n, t._focusCol + 1) : t._focusCol = Math.max(0, t._focusCol - 1), e.preventDefault();
948
967
  break;
968
+ }
949
969
  case "Home":
950
970
  (e.ctrlKey || e.metaKey) && (i && typeof t.commitActiveRowEdit == "function" && t.commitActiveRowEdit(), t._focusRow = 0), t._focusCol = 0, e.preventDefault(), $(t, { forceScrollLeft: !0 });
951
971
  return;
@@ -1000,7 +1020,7 @@ function $(t, e) {
1000
1020
  }
1001
1021
  }
1002
1022
  const o = t._activeEditRows !== void 0 && t._activeEditRows !== -1;
1003
- o || t.refreshVirtualWindow(!1), ue(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
1023
+ o || t.refreshVirtualWindow(!1), fe(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
1004
1024
  s.setAttribute("aria-selected", "false");
1005
1025
  });
1006
1026
  const n = t._focusRow, i = t._virtualization.start ?? 0, r = t._virtualization.end ?? t._rows.length;
@@ -1023,7 +1043,7 @@ function $(t, e) {
1023
1043
  }
1024
1044
  }
1025
1045
  if (t._activeEditRows !== void 0 && t._activeEditRows !== -1 && l.classList.contains("editing")) {
1026
- const c = l.querySelector($e);
1046
+ const c = l.querySelector(Ue);
1027
1047
  if (c && document.activeElement !== c)
1028
1048
  try {
1029
1049
  c.focus({ preventScroll: !0 });
@@ -1039,12 +1059,12 @@ function $(t, e) {
1039
1059
  }
1040
1060
  }
1041
1061
  }
1042
- const te = /* @__PURE__ */ new WeakMap();
1043
- function vt(t, e) {
1044
- const o = Ie(e), n = pt(e);
1045
- o < 0 || n < 0 || (t._focusRow = o, t._focusCol = n, ue(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
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"));
1046
1066
  }
1047
- function fe(t, e, o, n) {
1067
+ function pe(t, e, o, n) {
1048
1068
  let i = null;
1049
1069
  const r = o.composedPath?.();
1050
1070
  if (r && r.length > 0 ? i = r[0] : i = o.target, i && !e.contains(i)) {
@@ -1068,84 +1088,87 @@ function fe(t, e, o, n) {
1068
1088
  cell: c !== void 0 && h !== void 0 && c >= 0 && h >= 0 ? { row: c, col: h } : void 0
1069
1089
  };
1070
1090
  }
1071
- function Ct(t, e, o) {
1072
- const n = fe(t, e, o, "mousedown");
1073
- (t._dispatchCellMouseDown?.(n) ?? !1) && te.set(t, !0);
1091
+ function Et(t, e, o) {
1092
+ const n = pe(t, e, o, "mousedown");
1093
+ (t._dispatchCellMouseDown?.(n) ?? !1) && oe.set(t, !0);
1074
1094
  }
1075
- function yt(t, e, o) {
1076
- if (!te.get(t)) return;
1077
- const n = fe(t, e, o, "mousemove");
1095
+ function St(t, e, o) {
1096
+ if (!oe.get(t)) return;
1097
+ const n = pe(t, e, o, "mousemove");
1078
1098
  t._dispatchCellMouseMove?.(n);
1079
1099
  }
1080
- function _t(t, e, o) {
1081
- if (!te.get(t)) return;
1082
- const n = fe(t, e, o, "mouseup");
1083
- t._dispatchCellMouseUp?.(n), te.set(t, !1);
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);
1084
1104
  }
1085
- function Et(t, e, o) {
1105
+ function xt(t, e, o) {
1086
1106
  e.addEventListener(
1087
1107
  "mousedown",
1088
1108
  (n) => {
1089
1109
  const i = n.target.closest(".cell[data-col]");
1090
- i && (i.classList.contains("editing") || vt(t, i));
1110
+ i && (i.classList.contains("editing") || _t(t, i));
1091
1111
  },
1092
1112
  { signal: o }
1093
1113
  ), e.addEventListener(
1094
1114
  "click",
1095
1115
  (n) => {
1096
1116
  const i = n.target.closest(".data-grid-row");
1097
- i && ye(t, n, i);
1117
+ i && Ee(t, n, i);
1098
1118
  },
1099
1119
  { signal: o }
1100
1120
  ), e.addEventListener(
1101
1121
  "dblclick",
1102
1122
  (n) => {
1103
1123
  const i = n.target.closest(".data-grid-row");
1104
- i && ye(t, n, i);
1124
+ i && Ee(t, n, i);
1105
1125
  },
1106
1126
  { signal: o }
1107
1127
  );
1108
1128
  }
1109
- function St(t, e, o, n) {
1110
- e.addEventListener("keydown", (i) => mt(t, i), { signal: n }), o.addEventListener("mousedown", (i) => Ct(t, o, i), { signal: n }), document.addEventListener("mousemove", (i) => yt(t, o, i), { signal: n }), document.addEventListener("mouseup", (i) => _t(t, o, i), { signal: n });
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 });
1111
1131
  }
1112
- function Rt(t, e) {
1132
+ function Tt(t, e) {
1113
1133
  return t == null && e == null ? 0 : t == null ? -1 : e == null || t > e ? 1 : t < e ? -1 : 0;
1114
1134
  }
1115
- function xt(t, e, o) {
1116
- const i = o.find((l) => l.field === e.field)?.sortComparator ?? Rt, { field: r, direction: s } = e;
1135
+ function Pt(t, e, o) {
1136
+ const i = o.find((l) => l.field === e.field)?.sortComparator ?? Tt, { field: r, direction: s } = e;
1117
1137
  return [...t].sort((l, a) => i(l[r], a[r], l, a) * s);
1118
1138
  }
1119
- function _e(t, e, o, n) {
1120
- t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((i) => i.__epoch = -1), oe(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
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(
1121
1141
  new CustomEvent("sort-change", { detail: { field: o.field, direction: n } })
1122
1142
  ), t.requestStateChange?.();
1123
1143
  }
1124
- function Ee(t, e) {
1125
- !t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), Se(t, e, 1)) : t._sortState.direction === 1 ? Se(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), t._rows = t.__originalOrder.slice(), oe(t), t._headerRowEl?.querySelectorAll('[role="columnheader"].sortable')?.forEach((n) => {
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) => {
1126
1146
  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");
1127
1147
  }), t.refreshVirtualWindow(!0), t.dispatchEvent(
1128
1148
  new CustomEvent("sort-change", { detail: { field: e.field, direction: 0 } })
1129
1149
  ), t.requestStateChange?.());
1130
1150
  }
1131
- function Se(t, e, o) {
1151
+ function xe(t, e, o) {
1132
1152
  t._sortState = { field: e.field, direction: o };
1133
- const n = { field: e.field, direction: o }, i = t._columns, s = (t.effectiveConfig?.sortHandler ?? xt)(t._rows, n, i);
1153
+ const n = { field: e.field, direction: o }, i = t._columns, s = (t.effectiveConfig?.sortHandler ?? Pt)(t._rows, n, i);
1134
1154
  s && typeof s.then == "function" ? s.then((l) => {
1135
- _e(t, l, e, o);
1136
- }) : _e(t, s, e, o);
1155
+ Se(t, l, e, o);
1156
+ }) : Se(t, s, e, o);
1137
1157
  }
1138
1158
  function U(t, e) {
1139
1159
  return t.effectiveConfig?.sortable !== !1 && e.sortable === !0;
1140
1160
  }
1141
- function Tt(t, e) {
1161
+ function K(t, e) {
1162
+ return t.effectiveConfig?.resizable !== !1 && e.resizable !== !1;
1163
+ }
1164
+ function Lt(t, e) {
1142
1165
  typeof e == "string" ? t.textContent = e : e instanceof HTMLElement && (t.innerHTML = "", t.appendChild(e.cloneNode(!0)));
1143
1166
  }
1144
- function K(t, e) {
1167
+ function Q(t, e) {
1145
1168
  const o = document.createElement("span");
1146
- ze(o, "sort-indicator");
1169
+ ke(o, "sort-indicator");
1147
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;
1148
- return Tt(o, r), o;
1171
+ return Lt(o, r), o;
1149
1172
  }
1150
1173
  function Z(t, e, o) {
1151
1174
  const n = document.createElement("div");
@@ -1159,15 +1182,15 @@ function J(t, e, o, n) {
1159
1182
  n.classList.add("sortable"), n.tabIndex = 0;
1160
1183
  const i = t._sortState?.field === e.field ? t._sortState.direction : 0;
1161
1184
  n.setAttribute("aria-sort", i === 0 ? "none" : i === 1 ? "ascending" : "descending"), n.addEventListener("click", (r) => {
1162
- t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, o, n) || Ee(t, e);
1185
+ t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, o, n) || Re(t, e);
1163
1186
  }), n.addEventListener("keydown", (r) => {
1164
1187
  if (r.key === "Enter" || r.key === " ") {
1165
1188
  if (r.preventDefault(), t._dispatchHeaderClick?.(r, o, n)) return;
1166
- Ee(t, e);
1189
+ Re(t, e);
1167
1190
  }
1168
1191
  });
1169
1192
  }
1170
- function At(t, e) {
1193
+ function Ht(t, e) {
1171
1194
  if (e != null)
1172
1195
  if (typeof e == "string") {
1173
1196
  const o = document.createElement("span");
@@ -1175,12 +1198,12 @@ function At(t, e) {
1175
1198
  t.appendChild(o.firstChild);
1176
1199
  } else e instanceof Node && t.appendChild(e);
1177
1200
  }
1178
- function oe(t) {
1201
+ function ne(t) {
1179
1202
  t._headerRowEl = t.findHeaderRow();
1180
1203
  const e = t._headerRowEl;
1181
1204
  e && (e.innerHTML = "", t._visibleColumns.forEach((o, n) => {
1182
1205
  const i = document.createElement("div");
1183
- i.className = "cell", ze(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));
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));
1184
1207
  const r = o.header ?? o.field, s = t._sortState?.field === o.field ? t._sortState.direction : 0, l = s === 1 ? "asc" : s === -1 ? "desc" : null;
1185
1208
  if (o.headerRenderer) {
1186
1209
  const a = {
@@ -1189,31 +1212,30 @@ function oe(t) {
1189
1212
  sortState: l,
1190
1213
  filterActive: !1,
1191
1214
  cellEl: i,
1192
- renderSortIcon: () => U(t, o) ? K(t, o) : null,
1193
- renderFilterButton: () => null,
1194
- renderResizeHandle: () => Z(t, n, i)
1215
+ renderSortIcon: () => U(t, o) ? Q(t, o) : null,
1216
+ renderFilterButton: () => null
1195
1217
  }, c = o.headerRenderer(a);
1196
- At(i, c), U(t, o) && J(t, o, n, i), o.resizable && i.classList.add("resizable");
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)));
1197
1219
  } else if (o.headerLabelRenderer) {
1198
1220
  const a = {
1199
1221
  column: o,
1200
1222
  value: r
1201
1223
  }, c = o.headerLabelRenderer(a), h = document.createElement("span");
1202
- c == null ? h.textContent = r : typeof c == "string" ? h.innerHTML = F(c) : c instanceof Node && h.appendChild(c), i.appendChild(h), U(t, o) && (J(t, o, n, i), i.appendChild(K(t, o))), o.resizable && (i.classList.add("resizable"), i.appendChild(Z(t, n, i)));
1224
+ c == null ? h.textContent = r : typeof c == "string" ? h.innerHTML = F(c) : c instanceof Node && h.appendChild(c), i.appendChild(h), U(t, o) && (J(t, o, n, i), i.appendChild(Q(t, o))), K(t, o) && (i.classList.add("resizable"), i.appendChild(Z(t, n, i)));
1203
1225
  } else if (o.__headerTemplate)
1204
- Array.from(o.__headerTemplate.childNodes).forEach((a) => i.appendChild(a.cloneNode(!0))), U(t, o) && (J(t, o, n, i), i.appendChild(K(t, o))), o.resizable && (i.classList.add("resizable"), i.appendChild(Z(t, n, i)));
1226
+ Array.from(o.__headerTemplate.childNodes).forEach((a) => i.appendChild(a.cloneNode(!0))), U(t, o) && (J(t, o, n, i), i.appendChild(Q(t, o))), K(t, o) && (i.classList.add("resizable"), i.appendChild(Z(t, n, i)));
1205
1227
  else {
1206
1228
  const a = document.createElement("span");
1207
- a.textContent = r, i.appendChild(a), U(t, o) && (J(t, o, n, i), i.appendChild(K(t, o))), o.resizable && (i.classList.add("resizable"), i.appendChild(Z(t, n, i)));
1229
+ a.textContent = r, i.appendChild(a), U(t, o) && (J(t, o, n, i), i.appendChild(Q(t, o))), K(t, o) && (i.classList.add("resizable"), i.appendChild(Z(t, n, i)));
1208
1230
  }
1209
1231
  e.appendChild(i);
1210
1232
  }), e.querySelectorAll(".cell.sortable").forEach((o) => {
1211
1233
  o.getAttribute("aria-sort") || o.setAttribute("aria-sort", "none");
1212
1234
  }), e.children.length > 0 ? (e.setAttribute("role", "row"), e.setAttribute("aria-rowindex", "1")) : (e.removeAttribute("role"), e.removeAttribute("aria-rowindex")));
1213
1235
  }
1214
- const Ve = typeof requestIdleCallback == "function";
1215
- function Pt(t, e) {
1216
- return Ve ? requestIdleCallback(t, e) : window.setTimeout(() => {
1236
+ const Ge = typeof requestIdleCallback == "function";
1237
+ function Dt(t, e) {
1238
+ return Ge ? requestIdleCallback(t, e) : window.setTimeout(() => {
1217
1239
  const o = Date.now();
1218
1240
  t({
1219
1241
  didTimeout: !1,
@@ -1221,18 +1243,18 @@ function Pt(t, e) {
1221
1243
  });
1222
1244
  }, 1);
1223
1245
  }
1224
- function Re(t) {
1225
- Ve ? cancelIdleCallback(t) : clearTimeout(t);
1246
+ function Ae(t) {
1247
+ Ge ? cancelIdleCallback(t) : clearTimeout(t);
1226
1248
  }
1227
- var A = ((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))(A || {});
1228
- class Lt {
1249
+ 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 {
1229
1251
  #l;
1230
1252
  #i = 0;
1231
1253
  #u = 0;
1232
1254
  #d = null;
1233
1255
  #h = null;
1234
1256
  #a = null;
1235
- #o = !1;
1257
+ #n = !1;
1236
1258
  constructor(e) {
1237
1259
  this.#l = e;
1238
1260
  }
@@ -1265,10 +1287,10 @@ class Lt {
1265
1287
  return;
1266
1288
  }
1267
1289
  const e = this.#i;
1268
- 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.#o && this.#a && (this.#o = !0, this.#a()), this.#h && (this.#h(), this.#h = null, this.#d = null);
1290
+ 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);
1269
1291
  }
1270
1292
  }
1271
- function xe(t) {
1293
+ function Te(t) {
1272
1294
  let e = null, o = null, n = null, i = null;
1273
1295
  const r = (a) => {
1274
1296
  if (!e) return;
@@ -1306,55 +1328,55 @@ function xe(t) {
1306
1328
  }
1307
1329
  };
1308
1330
  }
1309
- const le = "data-animating", Ht = {
1331
+ const ae = "data-animating", Mt = {
1310
1332
  change: "--tbw-row-change-duration",
1311
1333
  insert: "--tbw-row-insert-duration",
1312
1334
  remove: "--tbw-row-remove-duration"
1313
- }, Ot = {
1335
+ }, zt = {
1314
1336
  change: 500,
1315
1337
  insert: 300,
1316
1338
  remove: 200
1317
1339
  };
1318
- function Dt(t) {
1340
+ function kt(t) {
1319
1341
  const e = t.trim().toLowerCase();
1320
1342
  return e.endsWith("ms") ? parseFloat(e) : e.endsWith("s") ? parseFloat(e) * 1e3 : parseFloat(e);
1321
1343
  }
1322
- function zt(t, e) {
1323
- const o = Ht[e], n = getComputedStyle(t).getPropertyValue(o);
1344
+ function Nt(t, e) {
1345
+ const o = Mt[e], n = getComputedStyle(t).getPropertyValue(o);
1324
1346
  if (n) {
1325
- const i = Dt(n);
1347
+ const i = kt(n);
1326
1348
  if (!isNaN(i) && i > 0)
1327
1349
  return i;
1328
1350
  }
1329
- return Ot[e];
1351
+ return zt[e];
1330
1352
  }
1331
- function Mt(t, e, o) {
1332
- t.removeAttribute(le), t.offsetWidth, t.setAttribute(le, e);
1333
- const n = zt(t, e);
1353
+ function It(t, e, o) {
1354
+ t.removeAttribute(ae), t.offsetWidth, t.setAttribute(ae, e);
1355
+ const n = Nt(t, e);
1334
1356
  setTimeout(() => {
1335
- e !== "remove" && t.removeAttribute(le);
1357
+ e !== "remove" && t.removeAttribute(ae);
1336
1358
  }, n);
1337
1359
  }
1338
- function pe(t, e, o) {
1360
+ function ge(t, e, o) {
1339
1361
  if (e < 0)
1340
1362
  return !1;
1341
1363
  const n = t.findRenderedRowElement?.(e);
1342
- return n ? (Mt(n, o), !0) : !1;
1364
+ return n ? (It(n, o), !0) : !1;
1343
1365
  }
1344
- function kt(t, e, o) {
1366
+ function qt(t, e, o) {
1345
1367
  let n = 0;
1346
1368
  for (const i of e)
1347
- pe(t, i, o) && n++;
1369
+ ge(t, i, o) && n++;
1348
1370
  return n;
1349
1371
  }
1350
- function Nt(t, e, o) {
1372
+ function Wt(t, e, o) {
1351
1373
  const n = t._rows ?? [], i = t.getRowId;
1352
1374
  if (!i)
1353
1375
  return !1;
1354
1376
  const r = n.findIndex((s) => i(s) === e);
1355
- return r < 0 ? !1 : pe(t, r, o);
1377
+ return r < 0 ? !1 : ge(t, r, o);
1356
1378
  }
1357
- function Q(t, e, o) {
1379
+ function ee(t, e, o) {
1358
1380
  const n = document.createElement(t);
1359
1381
  if (e)
1360
1382
  for (const i in e) {
@@ -1372,7 +1394,7 @@ function H(t, e) {
1372
1394
  }
1373
1395
  return o;
1374
1396
  }
1375
- function Be(t, e, o) {
1397
+ function Xe(t, e, o) {
1376
1398
  const n = document.createElement("button");
1377
1399
  if (t && (n.className = t), e)
1378
1400
  for (const i in e) {
@@ -1381,8 +1403,8 @@ function Be(t, e, o) {
1381
1403
  }
1382
1404
  return n;
1383
1405
  }
1384
- const Ge = document.createElement("template");
1385
- Ge.innerHTML = `
1406
+ const Ye = document.createElement("template");
1407
+ Ye.innerHTML = `
1386
1408
  <div class="tbw-scroll-area">
1387
1409
  <div class="rows-body-wrapper">
1388
1410
  <div class="rows-body" role="grid">
@@ -1401,20 +1423,20 @@ Ge.innerHTML = `
1401
1423
  <div class="faux-vscroll-spacer"></div>
1402
1424
  </div>
1403
1425
  `;
1404
- function Xe() {
1405
- return Ge.content.cloneNode(!0);
1426
+ function je() {
1427
+ return Ye.content.cloneNode(!0);
1406
1428
  }
1407
- function Te(t) {
1429
+ function Pe(t) {
1408
1430
  const e = document.createDocumentFragment(), o = H(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
1409
1431
  if (t.hasShell && t.shellHeader && t.shellBody)
1410
1432
  o.appendChild(t.shellHeader), o.appendChild(t.shellBody);
1411
1433
  else {
1412
1434
  const n = H("tbw-grid-content");
1413
- n.appendChild(Xe()), o.appendChild(n);
1435
+ n.appendChild(je()), o.appendChild(n);
1414
1436
  }
1415
1437
  return e.appendChild(o), e;
1416
1438
  }
1417
- function It(t) {
1439
+ function $t(t) {
1418
1440
  const e = H("tbw-shell-header", { part: "shell-header", role: "presentation" });
1419
1441
  if (t.title) {
1420
1442
  const r = H("tbw-shell-title");
@@ -1432,7 +1454,7 @@ function It(t) {
1432
1454
  for (const r of t.apiButtons)
1433
1455
  r.hasRender && n.appendChild(H("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
1434
1456
  if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && n.appendChild(H("tbw-toolbar-separator")), t.hasPanels) {
1435
- const r = Be(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
1457
+ const r = Xe(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
1436
1458
  "data-panel-toggle": "",
1437
1459
  title: "Settings",
1438
1460
  "aria-label": "Toggle settings panel",
@@ -1443,12 +1465,12 @@ function It(t) {
1443
1465
  }
1444
1466
  return e.appendChild(n), e;
1445
1467
  }
1446
- function qt(t) {
1468
+ function Ft(t) {
1447
1469
  const e = H("tbw-shell-body"), o = t.panels.length > 0, n = t.panels.length === 1, i = H("tbw-grid-content");
1448
- i.appendChild(Xe());
1470
+ i.appendChild(je());
1449
1471
  let r = null;
1450
1472
  if (o) {
1451
- r = Q("aside", {
1473
+ r = ee("aside", {
1452
1474
  class: t.isPanelOpen ? "tbw-tool-panel open" : "tbw-tool-panel",
1453
1475
  part: "tool-panel",
1454
1476
  "data-position": t.position,
@@ -1465,17 +1487,17 @@ function qt(t) {
1465
1487
  );
1466
1488
  const l = H("tbw-tool-panel-content", { role: "presentation" }), a = H("tbw-accordion");
1467
1489
  for (const c of t.panels) {
1468
- const h = `tbw-accordion-section${c.isExpanded ? " expanded" : ""}${n ? " single" : ""}`, u = H(h, { "data-section": c.id }), p = Be("tbw-accordion-header", {
1490
+ const h = `tbw-accordion-section${c.isExpanded ? " expanded" : ""}${n ? " single" : ""}`, u = H(h, { "data-section": c.id }), p = Xe("tbw-accordion-header", {
1469
1491
  "aria-expanded": String(c.isExpanded),
1470
1492
  "aria-controls": `tbw-section-${c.id}`
1471
1493
  });
1472
1494
  if (n && p.setAttribute("aria-disabled", "true"), c.icon) {
1473
- const g = Q("span", { class: "tbw-accordion-icon" });
1495
+ const g = ee("span", { class: "tbw-accordion-icon" });
1474
1496
  g.innerHTML = c.icon, p.appendChild(g);
1475
1497
  }
1476
- const f = Q("span", { class: "tbw-accordion-title" });
1498
+ const f = ee("span", { class: "tbw-accordion-title" });
1477
1499
  if (f.textContent = c.title, p.appendChild(f), !n) {
1478
- const g = Q("span", { class: "tbw-accordion-chevron" });
1500
+ const g = ee("span", { class: "tbw-accordion-chevron" });
1479
1501
  g.innerHTML = c.isExpanded ? t.collapseIcon : t.expandIcon, p.appendChild(g);
1480
1502
  }
1481
1503
  u.appendChild(p), u.appendChild(
@@ -1492,7 +1514,7 @@ function qt(t) {
1492
1514
  function N(t) {
1493
1515
  return t ? typeof t == "string" ? t : t.outerHTML : "";
1494
1516
  }
1495
- function Wt() {
1517
+ function Ut() {
1496
1518
  return {
1497
1519
  toolPanels: /* @__PURE__ */ new Map(),
1498
1520
  headerContents: /* @__PURE__ */ new Map(),
@@ -1511,10 +1533,10 @@ function Wt() {
1511
1533
  lightDomContentMoved: !1
1512
1534
  };
1513
1535
  }
1514
- function Ye(t) {
1536
+ function Ke(t) {
1515
1537
  return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
1516
1538
  }
1517
- function Ae(t, e, o = "☰") {
1539
+ function Le(t, e, o = "☰") {
1518
1540
  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((d) => d.id)), c = [...s];
1519
1541
  for (const d of l)
1520
1542
  a.has(d.id) || c.push(d);
@@ -1528,7 +1550,7 @@ function Ae(t, e, o = "☰") {
1528
1550
  }
1529
1551
  return `
1530
1552
  <div class="tbw-shell-header" part="shell-header" role="presentation">
1531
- ${i ? `<div class="tbw-shell-title">${it(n)}</div>` : ""}
1553
+ ${i ? `<div class="tbw-shell-title">${st(n)}</div>` : ""}
1532
1554
  <div class="tbw-shell-content" part="shell-content" role="presentation" data-light-dom-header-content></div>
1533
1555
  <div class="tbw-shell-toolbar" part="shell-toolbar" role="presentation">
1534
1556
  ${g}
@@ -1603,7 +1625,7 @@ function W(t, e, o) {
1603
1625
  e.toolPanels.set(s, g), e.lightDomToolPanelIds.add(s), r.style.display = "none";
1604
1626
  });
1605
1627
  }
1606
- function $t(t, e, o, n) {
1628
+ function Vt(t, e, o, n) {
1607
1629
  const i = t.querySelector(".tbw-shell-toolbar");
1608
1630
  i && i.addEventListener("click", (s) => {
1609
1631
  if (s.target.closest("[data-panel-toggle]")) {
@@ -1620,7 +1642,7 @@ function $t(t, e, o, n) {
1620
1642
  }
1621
1643
  });
1622
1644
  }
1623
- function Ft(t, e, o) {
1645
+ function Bt(t, e, o) {
1624
1646
  const n = t.querySelector(".tbw-tool-panel"), i = t.querySelector("[data-resize-handle]"), r = t.querySelector(".tbw-shell-body");
1625
1647
  if (!n || !i || !r)
1626
1648
  return () => {
@@ -1644,7 +1666,7 @@ function Ft(t, e, o) {
1644
1666
  i.removeEventListener("mousedown", g), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", f);
1645
1667
  };
1646
1668
  }
1647
- function Pe(t, e, o) {
1669
+ function He(t, e, o) {
1648
1670
  const n = e?.header?.toolbarContents ?? [], i = [...o.toolbarContents.values()], r = new Set(n.map((l) => l.id)), s = [...n];
1649
1671
  for (const l of i)
1650
1672
  r.has(l.id) || s.push(l);
@@ -1656,7 +1678,7 @@ function Pe(t, e, o) {
1656
1678
  c && o.toolbarContentCleanups.set(l.id, c);
1657
1679
  }
1658
1680
  }
1659
- function de(t, e) {
1681
+ function he(t, e) {
1660
1682
  const o = e.lightDomHeaderContent.length > 0 && !e.lightDomContentMoved, n = e.headerContents.size > 0;
1661
1683
  if (!o && !n) return;
1662
1684
  const i = t.querySelector(".tbw-shell-content");
@@ -1676,7 +1698,7 @@ function de(t, e) {
1676
1698
  c && e.headerContentCleanups.set(s.id, c);
1677
1699
  }
1678
1700
  }
1679
- function Ut(t, e, o) {
1701
+ function Gt(t, e, o) {
1680
1702
  if (!e.isPanelOpen) return;
1681
1703
  const n = N(o?.expand ?? k.expand), i = N(o?.collapse ?? k.collapse);
1682
1704
  for (const [r, s] of e.toolPanels) {
@@ -1697,15 +1719,15 @@ function Ut(t, e, o) {
1697
1719
  }
1698
1720
  }
1699
1721
  }
1700
- function Le(t, e) {
1722
+ function De(t, e) {
1701
1723
  const o = t.querySelector("[data-panel-toggle]");
1702
1724
  o && (o.classList.toggle("active", e.isPanelOpen), o.setAttribute("aria-pressed", String(e.isPanelOpen)));
1703
1725
  }
1704
- function He(t, e) {
1726
+ function Oe(t, e) {
1705
1727
  const o = t.querySelector(".tbw-tool-panel");
1706
1728
  o && (o.classList.toggle("open", e.isPanelOpen), e.isPanelOpen || (o.style.width = ""));
1707
1729
  }
1708
- function Vt(t) {
1730
+ function Xt(t) {
1709
1731
  for (const e of t.headerContentCleanups.values())
1710
1732
  e();
1711
1733
  t.headerContentCleanups.clear();
@@ -1722,7 +1744,7 @@ function Vt(t) {
1722
1744
  t.toolPanels.get(e)?.onClose?.();
1723
1745
  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;
1724
1746
  }
1725
- function Bt(t, e) {
1747
+ function Yt(t, e) {
1726
1748
  let o = !1;
1727
1749
  const n = {
1728
1750
  get isInitialized() {
@@ -1751,7 +1773,7 @@ function Bt(t, e) {
1751
1773
  s && t.expandedSections.add(s.id);
1752
1774
  }
1753
1775
  const i = e.getShadow();
1754
- Le(i, t), He(i, t), Ut(i, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: n.expandedSections });
1776
+ De(i, t), Oe(i, t), Gt(i, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: n.expandedSections });
1755
1777
  },
1756
1778
  closeToolPanel() {
1757
1779
  if (!t.isPanelOpen) return;
@@ -1762,7 +1784,7 @@ function Bt(t, e) {
1762
1784
  r.onClose?.();
1763
1785
  t.isPanelOpen = !1;
1764
1786
  const i = e.getShadow();
1765
- Le(i, t), He(i, t), e.emit("tool-panel-close", {});
1787
+ De(i, t), Oe(i, t), e.emit("tool-panel-close", {});
1766
1788
  },
1767
1789
  toggleToolPanel() {
1768
1790
  t.isPanelOpen ? n.closeToolPanel() : n.openToolPanel();
@@ -1778,16 +1800,16 @@ function Bt(t, e) {
1778
1800
  const s = e.getShadow(), l = t.expandedSections.has(i);
1779
1801
  if (l) {
1780
1802
  const a = t.panelCleanups.get(i);
1781
- a && (a(), t.panelCleanups.delete(i)), r.onClose?.(), t.expandedSections.delete(i), ae(s, i, !1);
1803
+ a && (a(), t.panelCleanups.delete(i)), r.onClose?.(), t.expandedSections.delete(i), ce(s, i, !1);
1782
1804
  } else {
1783
1805
  for (const [a, c] of t.toolPanels)
1784
1806
  if (a !== i && t.expandedSections.has(a)) {
1785
1807
  const h = t.panelCleanups.get(a);
1786
- h && (h(), t.panelCleanups.delete(a)), c.onClose?.(), t.expandedSections.delete(a), ae(s, a, !1);
1808
+ h && (h(), t.panelCleanups.delete(a)), c.onClose?.(), t.expandedSections.delete(a), ce(s, a, !1);
1787
1809
  const u = s.querySelector(`[data-section="${a}"] .tbw-accordion-content`);
1788
1810
  u && (u.innerHTML = "");
1789
1811
  }
1790
- t.expandedSections.add(i), ae(s, i, !0), Gt(s, t, i);
1812
+ t.expandedSections.add(i), ce(s, i, !0), jt(s, t, i);
1791
1813
  }
1792
1814
  e.emit("tool-panel-section-toggle", { id: i, expanded: !l });
1793
1815
  },
@@ -1816,7 +1838,7 @@ function Bt(t, e) {
1816
1838
  console.warn(`[tbw-grid] Header content "${i.id}" already registered`);
1817
1839
  return;
1818
1840
  }
1819
- t.headerContents.set(i.id, i), o && de(e.getShadow(), t);
1841
+ t.headerContents.set(i.id, i), o && he(e.getShadow(), t);
1820
1842
  },
1821
1843
  unregisterHeaderContent(i) {
1822
1844
  const r = t.headerContentCleanups.get(i);
@@ -1841,11 +1863,11 @@ function Bt(t, e) {
1841
1863
  };
1842
1864
  return n;
1843
1865
  }
1844
- function ae(t, e, o) {
1866
+ function ce(t, e, o) {
1845
1867
  const n = t.querySelector(`[data-section="${e}"]`);
1846
1868
  n && n.classList.toggle("expanded", o);
1847
1869
  }
1848
- function Gt(t, e, o) {
1870
+ function jt(t, e, o) {
1849
1871
  const n = e.toolPanels.get(o);
1850
1872
  if (!n?.render) return;
1851
1873
  const i = t.querySelector(`[data-section="${o}"] .tbw-accordion-content`);
@@ -1853,8 +1875,8 @@ function Gt(t, e, o) {
1853
1875
  const r = n.render(i);
1854
1876
  r && e.panelCleanups.set(o, r);
1855
1877
  }
1856
- function Xt(t, e, o, n) {
1857
- const i = Ye(e), r = [], s = [
1878
+ function Kt(t, e, o, n) {
1879
+ const i = Ke(e), r = [], s = [
1858
1880
  "tbw-grid-header",
1859
1881
  "tbw-grid-tool-buttons",
1860
1882
  "tbw-grid-tool-panel",
@@ -1890,19 +1912,19 @@ function Xt(t, e, o, n) {
1890
1912
  icon: N(C.icon),
1891
1913
  isExpanded: o.expandedSections.has(C.id)
1892
1914
  }))
1893
- }, w = It(g), b = qt(d), S = Te({
1915
+ }, w = $t(g), b = Ft(d), S = Pe({
1894
1916
  hasShell: !0,
1895
1917
  shellHeader: w,
1896
1918
  shellBody: b
1897
1919
  });
1898
1920
  t.appendChild(S);
1899
1921
  } else {
1900
- const l = Te({ hasShell: !1 });
1922
+ const l = Pe({ hasShell: !1 });
1901
1923
  t.appendChild(l);
1902
1924
  }
1903
1925
  return i;
1904
1926
  }
1905
- function Yt() {
1927
+ function Qt() {
1906
1928
  return {
1907
1929
  startY: null,
1908
1930
  startX: null,
@@ -1916,19 +1938,19 @@ function Yt() {
1916
1938
  momentumRaf: 0
1917
1939
  };
1918
1940
  }
1919
- function jt(t) {
1941
+ function Zt(t) {
1920
1942
  t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
1921
1943
  }
1922
- function je(t) {
1944
+ function Qe(t) {
1923
1945
  t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
1924
1946
  }
1925
- function Kt(t, e, o) {
1947
+ function Jt(t, e, o) {
1926
1948
  if (t.touches.length !== 1) return;
1927
- je(e);
1949
+ Qe(e);
1928
1950
  const n = t.touches[0];
1929
1951
  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;
1930
1952
  }
1931
- function Zt(t, e, o) {
1953
+ function eo(t, e, o) {
1932
1954
  if (t.touches.length !== 1 || e.startY === null || e.startX === null || e.scrollTop === null || e.scrollLeft === null)
1933
1955
  return !1;
1934
1956
  const n = t.touches[0], i = n.clientY, r = n.clientX, s = performance.now(), l = e.startY - i, a = e.startX - r;
@@ -1945,10 +1967,10 @@ function Zt(t, e, o) {
1945
1967
  }
1946
1968
  return f && (o.fauxScrollbar.scrollTop = e.scrollTop + l), g && o.scrollArea && (o.scrollArea.scrollLeft = e.scrollLeft + a), f || g;
1947
1969
  }
1948
- function Jt(t, e) {
1949
- (Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Qt(t, e), jt(t);
1970
+ function to(t, e) {
1971
+ (Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && oo(t, e), Zt(t);
1950
1972
  }
1951
- function Qt(t, e) {
1973
+ function oo(t, e) {
1952
1974
  const i = () => {
1953
1975
  t.velocityY *= 0.95, t.velocityX *= 0.95;
1954
1976
  const r = t.velocityY * 16, s = t.velocityX * 16;
@@ -1956,19 +1978,19 @@ function Qt(t, e) {
1956
1978
  };
1957
1979
  t.momentumRaf = requestAnimationFrame(i);
1958
1980
  }
1959
- function eo(t, e, o, n) {
1960
- t.addEventListener("touchstart", (i) => Kt(i, e, o), {
1981
+ function no(t, e, o, n) {
1982
+ t.addEventListener("touchstart", (i) => Jt(i, e, o), {
1961
1983
  passive: !0,
1962
1984
  signal: n
1963
1985
  }), t.addEventListener(
1964
1986
  "touchmove",
1965
1987
  (i) => {
1966
- Zt(i, e, o) && i.preventDefault();
1988
+ eo(i, e, o) && i.preventDefault();
1967
1989
  },
1968
1990
  { passive: !1, signal: n }
1969
- ), t.addEventListener("touchend", () => Jt(e, o), { passive: !0, signal: n });
1991
+ ), t.addEventListener("touchend", () => to(e, o), { passive: !0, signal: n });
1970
1992
  }
1971
- const to = [
1993
+ const io = [
1972
1994
  {
1973
1995
  property: "editable",
1974
1996
  pluginName: "editing",
@@ -2004,9 +2026,9 @@ const to = [
2004
2026
  level: "column",
2005
2027
  description: 'the "sticky" column property',
2006
2028
  importHint: "import { PinnedColumnsPlugin } from '@toolbox-web/grid/plugins/pinned-columns';",
2007
- isUsed: (t) => t === "left" || t === "right"
2029
+ isUsed: (t) => t === "left" || t === "right" || t === "start" || t === "end"
2008
2030
  }
2009
- ], oo = [
2031
+ ], ro = [
2010
2032
  {
2011
2033
  property: "columnGroups",
2012
2034
  pluginName: "groupingColumns",
@@ -2015,7 +2037,7 @@ const to = [
2015
2037
  importHint: "import { GroupingColumnsPlugin } from '@toolbox-web/grid/plugins/grouping-columns';",
2016
2038
  isUsed: (t) => Array.isArray(t) && t.length > 0
2017
2039
  }
2018
- ], no = {
2040
+ ], so = {
2019
2041
  editing: "import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';",
2020
2042
  selection: "import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';",
2021
2043
  reorder: "import { ReorderPlugin } from '@toolbox-web/grid/plugins/reorder';",
@@ -2036,10 +2058,10 @@ const to = [
2036
2058
  serverSide: "import { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';",
2037
2059
  columnVirtualization: "import { ColumnVirtualizationPlugin } from '@toolbox-web/grid/plugins/column-virtualization';"
2038
2060
  };
2039
- function he(t) {
2040
- return no[t] ?? `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
2061
+ function ue(t) {
2062
+ return so[t] ?? `import { ${O(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
2041
2063
  }
2042
- function Ke() {
2064
+ function Ze() {
2043
2065
  if (typeof window < "u" && window.location) {
2044
2066
  const t = window.location.hostname;
2045
2067
  if (t === "localhost" || t === "127.0.0.1" || t === "::1")
@@ -2047,14 +2069,14 @@ function Ke() {
2047
2069
  }
2048
2070
  return typeof process < "u" && process.env?.NODE_ENV !== "production";
2049
2071
  }
2050
- function D(t) {
2072
+ function O(t) {
2051
2073
  return t.charAt(0).toUpperCase() + t.slice(1);
2052
2074
  }
2053
- function Oe(t, e) {
2075
+ function Me(t, e) {
2054
2076
  return t.some((o) => o.name === e);
2055
2077
  }
2056
- function io(t, e) {
2057
- const o = to, n = oo, i = /* @__PURE__ */ new Map();
2078
+ function lo(t, e) {
2079
+ const o = io, n = ro, i = /* @__PURE__ */ new Map();
2058
2080
  function r(l, a, c, h, u = !1) {
2059
2081
  i.has(l) || i.set(l, { description: a, importHint: c, fields: [], isConfigProperty: u });
2060
2082
  const p = i.get(l);
@@ -2062,16 +2084,16 @@ function io(t, e) {
2062
2084
  }
2063
2085
  for (const l of n) {
2064
2086
  const a = t[l.property];
2065
- (l.isUsed ? l.isUsed(a) : a !== void 0) && !Oe(e, l.pluginName) && r(l.pluginName, l.description, l.importHint ?? he(l.pluginName), l.property, !0);
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);
2066
2088
  }
2067
2089
  const s = t.columns;
2068
2090
  if (s && s.length > 0)
2069
2091
  for (const l of s)
2070
2092
  for (const a of o) {
2071
2093
  const c = l[a.property];
2072
- if ((a.isUsed ? a.isUsed(c) : c !== void 0) && !Oe(e, a.pluginName)) {
2094
+ if ((a.isUsed ? a.isUsed(c) : c !== void 0) && !Me(e, a.pluginName)) {
2073
2095
  const u = l.field || "<unknown>";
2074
- r(a.pluginName, a.description, a.importHint ?? he(a.pluginName), u);
2096
+ r(a.pluginName, a.description, a.importHint ?? ue(a.pluginName), u);
2075
2097
  }
2076
2098
  }
2077
2099
  if (i.size > 0) {
@@ -2104,7 +2126,7 @@ This validation helps catch misconfigurations early. The properties listed above
2104
2126
  );
2105
2127
  }
2106
2128
  }
2107
- function ro(t) {
2129
+ function ao(t) {
2108
2130
  const e = [], o = [];
2109
2131
  for (const n of t) {
2110
2132
  const r = n.constructor.manifest;
@@ -2112,12 +2134,12 @@ function ro(t) {
2112
2134
  for (const s of r.configRules) {
2113
2135
  const l = n.config;
2114
2136
  if (s.check(l)) {
2115
- const c = `${`[tbw-grid:${D(n.name)}Plugin]`} Configuration warning: ${s.message}`;
2137
+ const c = `${`[tbw-grid:${O(n.name)}Plugin]`} Configuration warning: ${s.message}`;
2116
2138
  s.severity === "error" ? e.push(c) : o.push(c);
2117
2139
  }
2118
2140
  }
2119
2141
  }
2120
- if (o.length > 0 && Ke())
2142
+ if (o.length > 0 && Ze())
2121
2143
  for (const n of o)
2122
2144
  console.warn(n);
2123
2145
  if (e.length > 0)
@@ -2127,30 +2149,30 @@ ${e.join(`
2127
2149
 
2128
2150
  `)}`);
2129
2151
  }
2130
- function so(t, e) {
2152
+ function co(t, e) {
2131
2153
  const o = t.name, i = t.constructor.dependencies ?? [];
2132
2154
  for (const r of i) {
2133
2155
  const s = r.name, l = r.required ?? !0, a = r.reason;
2134
2156
  if (!e.some((h) => h.name === s)) {
2135
- const h = a ?? `${D(o)}Plugin requires ${D(s)}Plugin`, u = he(s);
2157
+ const h = a ?? `${O(o)}Plugin requires ${O(s)}Plugin`, u = ue(s);
2136
2158
  if (l)
2137
2159
  throw new Error(
2138
2160
  `[tbw-grid] Plugin dependency error:
2139
2161
 
2140
2162
  ${h}.
2141
2163
 
2142
- → Add the plugin to your gridConfig.plugins array BEFORE ${D(o)}Plugin:
2164
+ → Add the plugin to your gridConfig.plugins array BEFORE ${O(o)}Plugin:
2143
2165
  ${u}
2144
- plugins: [new ${D(s)}Plugin(), new ${D(o)}Plugin()]`
2166
+ plugins: [new ${O(s)}Plugin(), new ${O(o)}Plugin()]`
2145
2167
  );
2146
2168
  console.info(
2147
- `[tbw-grid] ${D(o)}Plugin: Optional "${s}" plugin not found. Some features may be unavailable.`
2169
+ `[tbw-grid] ${O(o)}Plugin: Optional "${s}" plugin not found. Some features may be unavailable.`
2148
2170
  );
2149
2171
  }
2150
2172
  }
2151
2173
  }
2152
- function lo(t) {
2153
- if (!Ke()) return;
2174
+ function ho(t) {
2175
+ if (!Ze()) return;
2154
2176
  const e = new Set(t.map((n) => n.name)), o = /* @__PURE__ */ new Set();
2155
2177
  for (const n of t) {
2156
2178
  const r = n.constructor.manifest;
@@ -2162,7 +2184,7 @@ function lo(t) {
2162
2184
  o.add(l), console.warn(
2163
2185
  `[tbw-grid] Plugin incompatibility warning:
2164
2186
 
2165
- ${D(n.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currently incompatible.
2187
+ ${O(n.name)}Plugin and ${O(s.name)}Plugin are both loaded, but they are currently incompatible.
2166
2188
 
2167
2189
  → ${s.reason}
2168
2190
 
@@ -2172,7 +2194,7 @@ ${D(n.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currentl
2172
2194
  }
2173
2195
  }
2174
2196
  }
2175
- class ao {
2197
+ class uo {
2176
2198
  constructor(e) {
2177
2199
  this.grid = e;
2178
2200
  }
@@ -2184,12 +2206,14 @@ class ao {
2184
2206
  cellRenderers = /* @__PURE__ */ new Map();
2185
2207
  headerRenderers = /* @__PURE__ */ new Map();
2186
2208
  cellEditors = /* @__PURE__ */ new Map();
2209
+ eventListeners = /* @__PURE__ */ new Map();
2210
+ queryHandlers = /* @__PURE__ */ new Map();
2187
2211
  attachAll(e) {
2188
2212
  for (const o of e)
2189
2213
  this.attach(o);
2190
2214
  }
2191
2215
  attach(e) {
2192
- if (so(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
2216
+ if (co(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
2193
2217
  for (const [o, n] of Object.entries(e.cellRenderers))
2194
2218
  this.cellRenderers.set(o, n);
2195
2219
  if (e.headerRenderers)
@@ -2198,17 +2222,31 @@ class ao {
2198
2222
  if (e.cellEditors)
2199
2223
  for (const [o, n] of Object.entries(e.cellEditors))
2200
2224
  this.cellEditors.set(o, n);
2201
- e.attach(this.grid);
2225
+ this.registerQueryHandlers(e), e.attach(this.grid);
2202
2226
  for (const o of this.plugins)
2203
2227
  o !== e && o.onPluginAttached && o.onPluginAttached(e.name, e);
2204
2228
  }
2229
+ registerQueryHandlers(e) {
2230
+ const n = e.constructor.manifest;
2231
+ if (n?.queries)
2232
+ for (const i of n.queries) {
2233
+ let r = this.queryHandlers.get(i.type);
2234
+ r || (r = /* @__PURE__ */ new Set(), this.queryHandlers.set(i.type, r)), r.add(e);
2235
+ }
2236
+ }
2237
+ unregisterQueryHandlers(e) {
2238
+ for (const [o, n] of this.queryHandlers)
2239
+ n.delete(e), n.size === 0 && this.queryHandlers.delete(o);
2240
+ }
2205
2241
  detachAll() {
2206
2242
  for (const e of this.plugins)
2207
2243
  for (const o of this.plugins)
2208
2244
  o !== e && o.onPluginDetached && o.onPluginDetached(e.name);
2209
- for (let e = this.plugins.length - 1; e >= 0; e--)
2210
- this.plugins[e].detach();
2211
- this.plugins = [], this.pluginMap.clear(), this.cellRenderers.clear(), this.headerRenderers.clear(), this.cellEditors.clear();
2245
+ for (let e = this.plugins.length - 1; e >= 0; e--) {
2246
+ const o = this.plugins[e];
2247
+ this.unsubscribeAll(o), this.unregisterQueryHandlers(o), o.detach();
2248
+ }
2249
+ this.plugins = [], this.pluginMap.clear(), this.cellRenderers.clear(), this.headerRenderers.clear(), this.cellEditors.clear(), this.eventListeners.clear(), this.queryHandlers.clear();
2212
2250
  }
2213
2251
  getPlugin(e) {
2214
2252
  return this.pluginMap.get(e);
@@ -2309,13 +2347,42 @@ class ao {
2309
2347
  return !1;
2310
2348
  }
2311
2349
  queryPlugins(e) {
2312
- const o = [];
2313
- for (const n of this.plugins) {
2314
- const i = n.onPluginQuery?.(e);
2315
- i !== void 0 && o.push(i);
2350
+ const o = [], n = this.queryHandlers.get(e.type);
2351
+ if (n && n.size > 0) {
2352
+ for (const i of n) {
2353
+ const r = i.handleQuery?.(e) ?? i.onPluginQuery?.(e);
2354
+ r !== void 0 && o.push(r);
2355
+ }
2356
+ return o;
2357
+ }
2358
+ for (const i of this.plugins) {
2359
+ const r = i.handleQuery?.(e) ?? i.onPluginQuery?.(e);
2360
+ r !== void 0 && o.push(r);
2316
2361
  }
2317
2362
  return o;
2318
2363
  }
2364
+ subscribe(e, o, n) {
2365
+ let i = this.eventListeners.get(o);
2366
+ i || (i = /* @__PURE__ */ new Map(), this.eventListeners.set(o, i)), i.set(e, n);
2367
+ }
2368
+ unsubscribe(e, o) {
2369
+ const n = this.eventListeners.get(o);
2370
+ n && (n.delete(e), n.size === 0 && this.eventListeners.delete(o));
2371
+ }
2372
+ unsubscribeAll(e) {
2373
+ for (const [o, n] of this.eventListeners)
2374
+ n.delete(e), n.size === 0 && this.eventListeners.delete(o);
2375
+ }
2376
+ emitPluginEvent(e, o) {
2377
+ const n = this.eventListeners.get(e);
2378
+ if (n)
2379
+ for (const i of n.values())
2380
+ try {
2381
+ i(o);
2382
+ } catch (r) {
2383
+ console.error(`[tbw-grid] Error in plugin event handler for "${e}":`, r);
2384
+ }
2385
+ }
2319
2386
  onKeyDown(e) {
2320
2387
  for (const o of this.plugins)
2321
2388
  if (o.onKeyDown?.(e))
@@ -2389,7 +2456,7 @@ class ao {
2389
2456
  }
2390
2457
  class L extends HTMLElement {
2391
2458
  static tagName = "tbw-grid";
2392
- static version = "1.7.0";
2459
+ static version = "1.9.0";
2393
2460
  static #l = 0;
2394
2461
  static adapters = [];
2395
2462
  static registerAdapter(e) {
@@ -2411,7 +2478,7 @@ class L extends HTMLElement {
2411
2478
  #d;
2412
2479
  #h;
2413
2480
  #a = [];
2414
- get #o() {
2481
+ get #n() {
2415
2482
  return this.#t?.effective ?? {};
2416
2483
  }
2417
2484
  #f = !1;
@@ -2427,7 +2494,7 @@ class L extends HTMLElement {
2427
2494
  #r = null;
2428
2495
  #b = !1;
2429
2496
  #R;
2430
- #H = Yt();
2497
+ #H = Qt();
2431
2498
  #w;
2432
2499
  #C;
2433
2500
  #y;
@@ -2440,27 +2507,27 @@ class L extends HTMLElement {
2440
2507
  clientHeight: 0,
2441
2508
  clientWidth: 0
2442
2509
  };
2443
- #n;
2510
+ #o;
2444
2511
  #_;
2445
- #z = !1;
2446
- #O;
2512
+ #M = !1;
2447
2513
  #D;
2514
+ #O;
2448
2515
  #t;
2449
- #e = Wt();
2516
+ #e = Ut();
2450
2517
  #c;
2451
- #M;
2518
+ #z;
2452
2519
  #k = !1;
2453
2520
  #x = /* @__PURE__ */ new Set();
2454
- #T = /* @__PURE__ */ new Map();
2521
+ #A = /* @__PURE__ */ new Map();
2455
2522
  #N;
2456
2523
  #E = /* @__PURE__ */ new Map();
2457
2524
  _rows = [];
2458
2525
  #F = [];
2459
2526
  get _columns() {
2460
- return this.#o.columns ?? [];
2527
+ return this.#n.columns ?? [];
2461
2528
  }
2462
2529
  set _columns(e) {
2463
- this.#o.columns = e;
2530
+ this.#n.columns = e;
2464
2531
  }
2465
2532
  get _visibleColumns() {
2466
2533
  return this._columns.filter((e) => !e.hidden);
@@ -2519,14 +2586,14 @@ class L extends HTMLElement {
2519
2586
  this.#t?.setColumns(e), o !== e && this.#$("columns");
2520
2587
  }
2521
2588
  get gridConfig() {
2522
- return this.#o;
2589
+ return this.#n;
2523
2590
  }
2524
2591
  set gridConfig(e) {
2525
2592
  const o = this.#t?.getGridConfig();
2526
2593
  this.#t?.setGridConfig(e), o !== e && (this.#t.clearLightDomCache(), this.#$("gridConfig"));
2527
2594
  }
2528
2595
  get fitMode() {
2529
- return this.#o.fitMode ?? "stretch";
2596
+ return this.#n.fitMode ?? "stretch";
2530
2597
  }
2531
2598
  set fitMode(e) {
2532
2599
  const o = this.#t?.getFitMode();
@@ -2537,84 +2604,84 @@ class L extends HTMLElement {
2537
2604
  }
2538
2605
  set loading(e) {
2539
2606
  const o = this.#k;
2540
- this.#k = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), o !== e && this.#Oe();
2607
+ this.#k = e, e ? this.setAttribute("loading", "") : this.removeAttribute("loading"), o !== e && this.#De();
2541
2608
  }
2542
2609
  setRowLoading(e, o) {
2543
2610
  const n = this.#x.has(e);
2544
2611
  o ? this.#x.add(e) : this.#x.delete(e), n !== o && this.#he(e, o);
2545
2612
  }
2546
2613
  setCellLoading(e, o, n) {
2547
- let i = this.#T.get(e);
2614
+ let i = this.#A.get(e);
2548
2615
  const r = i?.has(o) ?? !1;
2549
- 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.#ue(e, o, n);
2616
+ 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.#ue(e, o, n);
2550
2617
  }
2551
2618
  isRowLoading(e) {
2552
2619
  return this.#x.has(e);
2553
2620
  }
2554
2621
  isCellLoading(e, o) {
2555
- return this.#T.get(e)?.has(o) ?? !1;
2622
+ return this.#A.get(e)?.has(o) ?? !1;
2556
2623
  }
2557
2624
  clearAllLoading() {
2558
2625
  this.loading = !1;
2559
2626
  for (const e of this.#x)
2560
2627
  this.#he(e, !1);
2561
2628
  this.#x.clear();
2562
- for (const [e, o] of this.#T)
2629
+ for (const [e, o] of this.#A)
2563
2630
  for (const n of o)
2564
2631
  this.#ue(e, n, !1);
2565
- this.#T.clear();
2632
+ this.#A.clear();
2566
2633
  }
2567
2634
  get effectiveConfig() {
2568
- return this.#o;
2635
+ return this.#n;
2569
2636
  }
2570
2637
  get disconnectSignal() {
2571
2638
  return this.#w || (this.#w = new AbortController()), this.#w.signal;
2572
2639
  }
2573
2640
  constructor() {
2574
- super(), this.#we(), this.#d = new Promise((e) => this.#h = e), this.#s = new Lt({
2641
+ super(), this.#we(), this.#d = new Promise((e) => this.#h = e), this.#s = new Ot({
2575
2642
  mergeConfig: () => {
2576
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#ee(), io(this.#o, this.#n?.getPlugins() ?? []), ro(this.#n?.getPlugins() ?? []), lo(this.#n?.getPlugins() ?? []), this.#Pe(), this.#F = [...this._columns];
2643
+ this.#t.parseLightDomColumns(this), this.#t.merge(), this.#ee(), lo(this.#n, this.#o?.getPlugins() ?? []), ao(this.#o?.getPlugins() ?? []), ho(this.#o?.getPlugins() ?? []), this.#Pe(), this.#F = [...this._columns];
2577
2644
  },
2578
2645
  processColumns: () => this.#xe(),
2579
- processRows: () => this.#Te(),
2580
- renderHeader: () => oe(this),
2646
+ processRows: () => this.#Ae(),
2647
+ renderHeader: () => ne(this),
2581
2648
  updateTemplate: () => B(this),
2582
2649
  renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
2583
2650
  afterRender: () => {
2584
- this.#n?.afterRender(), this.#o.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, me(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#W && this.#me();
2651
+ 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.#me();
2585
2652
  },
2586
2653
  isConnected: () => this.isConnected && this.#f
2587
- }), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = Bt(this.#e, {
2654
+ }), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = Yt(this.#e, {
2588
2655
  getShadow: () => this.#i,
2589
- getShellConfig: () => this.#o?.shell,
2656
+ getShellConfig: () => this.#n?.shell,
2590
2657
  getAccordionIcons: () => ({
2591
- expand: this.#o?.icons?.expand ?? k.expand,
2592
- collapse: this.#o?.icons?.collapse ?? k.collapse
2658
+ expand: this.#n?.icons?.expand ?? k.expand,
2659
+ collapse: this.#n?.icons?.collapse ?? k.collapse
2593
2660
  }),
2594
2661
  emit: (e, o) => this.#P(e, o),
2595
2662
  refreshShellHeader: () => this.refreshShellHeader()
2596
- }), this.#t = new ft({
2663
+ }), this.#t = new gt({
2597
2664
  getRows: () => this.#a,
2598
2665
  getSortState: () => this._sortState,
2599
2666
  setSortState: (e) => {
2600
2667
  this._sortState = e;
2601
2668
  },
2602
2669
  onConfigChange: () => {
2603
- this.#s.requestPhase(A.FULL, "configChange");
2670
+ this.#s.requestPhase(T.FULL, "configChange");
2604
2671
  },
2605
2672
  emit: (e, o) => this.#P(e, o),
2606
2673
  clearRowPool: () => {
2607
2674
  this._rowPool.length = 0, this._bodyEl && (this._bodyEl.innerHTML = ""), this.__rowRenderEpoch++;
2608
2675
  },
2609
2676
  setup: () => this.#L(),
2610
- renderHeader: () => oe(this),
2677
+ renderHeader: () => ne(this),
2611
2678
  updateTemplate: () => B(this),
2612
- refreshVirtualWindow: () => this.#s.requestPhase(A.VIRTUALIZATION, "configManager"),
2679
+ refreshVirtualWindow: () => this.#s.requestPhase(T.VIRTUALIZATION, "configManager"),
2613
2680
  getVirtualization: () => this._virtualization,
2614
2681
  setRowHeight: (e) => {
2615
2682
  this._virtualization.rowHeight = e;
2616
2683
  },
2617
- applyAnimationConfig: (e) => this.#Ae(e),
2684
+ applyAnimationConfig: (e) => this.#Te(e),
2618
2685
  getShellLightDomTitle: () => this.#e.lightDomTitle,
2619
2686
  getShellToolPanels: () => this.#e.toolPanels,
2620
2687
  getShellHeaderContents: () => this.#e.headerContents,
@@ -2623,12 +2690,12 @@ class L extends HTMLElement {
2623
2690
  getShellHasToolButtonsContainer: () => this.#e.hasToolButtonsContainer
2624
2691
  });
2625
2692
  }
2626
- static #J = "tbw-grid-styles";
2693
+ static #Z = "tbw-grid-styles";
2627
2694
  static #I = "";
2628
2695
  static #U = /* @__PURE__ */ new Map();
2629
2696
  static #ge() {
2630
- let e = document.getElementById(this.#J);
2631
- return e || (e = document.createElement("style"), e.id = this.#J, e.setAttribute("data-tbw-grid", "true"), document.head.appendChild(e)), e;
2697
+ let e = document.getElementById(this.#Z);
2698
+ return e || (e = document.createElement("style"), e.id = this.#Z, e.setAttribute("data-tbw-grid", "true"), document.head.appendChild(e)), e;
2632
2699
  }
2633
2700
  static #V() {
2634
2701
  const e = this.#ge(), o = Array.from(this.#U.values()).join(`
@@ -2640,8 +2707,8 @@ ${o}`;
2640
2707
  }
2641
2708
  async #we() {
2642
2709
  if (!L.#I) {
2643
- if (ge.length > 0) {
2644
- L.#I = ge, L.#V();
2710
+ if (we.length > 0) {
2711
+ L.#I = we, L.#V();
2645
2712
  return;
2646
2713
  }
2647
2714
  await new Promise((e) => setTimeout(e, 50));
@@ -2669,43 +2736,43 @@ ${o}`;
2669
2736
  }
2670
2737
  }
2671
2738
  getPlugin(e) {
2672
- return this.#n?.getPlugin(e);
2739
+ return this.#o?.getPlugin(e);
2673
2740
  }
2674
2741
  getPluginByName(e) {
2675
- return this.#n?.getPluginByName(e);
2742
+ return this.#o?.getPluginByName(e);
2676
2743
  }
2677
2744
  requestRender() {
2678
- this.#s.requestPhase(A.ROWS, "plugin:requestRender");
2745
+ this.#s.requestPhase(T.ROWS, "plugin:requestRender");
2679
2746
  }
2680
2747
  requestRenderWithFocus() {
2681
- this._restoreFocusAfterRender = !0, this.#s.requestPhase(A.ROWS, "plugin:requestRenderWithFocus");
2748
+ this._restoreFocusAfterRender = !0, this.#s.requestPhase(T.ROWS, "plugin:requestRenderWithFocus");
2682
2749
  }
2683
2750
  updateTemplate() {
2684
2751
  B(this);
2685
2752
  }
2686
2753
  requestAfterRender() {
2687
- this.#s.requestPhase(A.STYLE, "plugin:requestAfterRender");
2754
+ this.#s.requestPhase(T.STYLE, "plugin:requestAfterRender");
2688
2755
  }
2689
- #Q() {
2690
- this.#n = new ao(this);
2691
- const e = this.#o?.plugins, o = Array.isArray(e) ? e : [];
2692
- this.#n.attachAll(o);
2756
+ #J() {
2757
+ this.#o = new uo(this);
2758
+ const e = this.#n?.plugins, o = Array.isArray(e) ? e : [];
2759
+ this.#o.attachAll(o);
2693
2760
  }
2694
2761
  #q() {
2695
- const e = this.#n?.getPluginStyles() ?? [];
2762
+ const e = this.#o?.getPluginStyles() ?? [];
2696
2763
  let o = !1;
2697
2764
  for (const { name: n, styles: i } of e)
2698
2765
  L.#U.has(n) || (L.#U.set(n, i), o = !0);
2699
2766
  o && L.#V();
2700
2767
  }
2701
2768
  #ee() {
2702
- const e = this.#o?.plugins, o = Array.isArray(e) ? e : [];
2769
+ const e = this.#n?.plugins, o = Array.isArray(e) ? e : [];
2703
2770
  if (this.#_ !== o) {
2704
2771
  if (this.#_ && this.#_.length === o.length && this.#_.every((n, i) => n === o[i])) {
2705
2772
  this.#_ = o;
2706
2773
  return;
2707
2774
  }
2708
- this.#n && this.#n.detachAll();
2775
+ this.#o && this.#o.detachAll();
2709
2776
  for (const n of this.#e.toolPanels.keys()) {
2710
2777
  const i = this.#e.lightDomToolPanelIds.has(n), r = this.#e.apiToolPanelIds.has(n);
2711
2778
  if (!i && !r) {
@@ -2717,22 +2784,22 @@ ${o}`;
2717
2784
  const i = this.#e.headerContentCleanups.get(n);
2718
2785
  i && (i(), this.#e.headerContentCleanups.delete(n)), this.#e.headerContents.delete(n);
2719
2786
  }
2720
- this.#Q(), this.#q(), this.#_ = o, this.#te(), this.#b = this.#n?.getAll().some((n) => n.onScroll) ?? !1;
2787
+ this.#J(), this.#q(), this.#_ = o, this.#te(), this.#b = this.#o?.getAll().some((n) => n.onScroll) ?? !1;
2721
2788
  }
2722
2789
  }
2723
2790
  #be() {
2724
- this.#n?.detachAll();
2791
+ this.#o?.detachAll();
2725
2792
  }
2726
2793
  #te() {
2727
- if (!this.#n) return;
2728
- const e = this.#n.getToolPanels();
2794
+ if (!this.#o) return;
2795
+ const e = this.#o.getToolPanels();
2729
2796
  for (const { panel: n } of e)
2730
2797
  this.#e.toolPanels.has(n.id) || this.#e.toolPanels.set(n.id, n);
2731
- const o = this.#n.getHeaderContents();
2798
+ const o = this.#o.getHeaderContents();
2732
2799
  for (const { content: n } of o)
2733
2800
  this.#e.headerContents.has(n.id) || this.#e.headerContents.set(n.id, n);
2734
2801
  }
2735
- #A() {
2802
+ #T() {
2736
2803
  const e = L.getAdapters();
2737
2804
  if (e.length === 0 && !this.__frameworkAdapter) return;
2738
2805
  const o = this.__frameworkAdapter;
@@ -2749,9 +2816,9 @@ ${o}`;
2749
2816
  };
2750
2817
  }
2751
2818
  connectedCallback() {
2752
- 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.#w && (this.#w.abort(), this.#z = !1), this.#w = new AbortController(), this.#p && (Re(this.#p), this.#p = void 0), I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#A()), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#Q();
2753
- const e = this.#o?.plugins;
2754
- this.#_ = Array.isArray(e) ? e : [], this.#te(), this.#u || (this.#K(), this.#q(), this.#u = !0), this.#oe(), this.#p = Pt(
2819
+ 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.#w && (this.#w.abort(), this.#M = !1), this.#w = 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.#J();
2820
+ const e = this.#n?.plugins;
2821
+ this.#_ = Array.isArray(e) ? e : [], this.#te(), this.#u || (this.#K(), this.#q(), this.#u = !0), this.#oe(), this.#p = Dt(
2755
2822
  () => {
2756
2823
  this.#ke();
2757
2824
  },
@@ -2759,7 +2826,7 @@ ${o}`;
2759
2826
  );
2760
2827
  }
2761
2828
  disconnectedCallback() {
2762
- this.#p && (Re(this.#p), this.#p = void 0), this.#be(), Vt(this.#e), this.#c.setInitialized(!1), this.#M?.(), this.#M = void 0, je(this.#H), this.#w && (this.#w.abort(), this.#w = void 0), this.#O?.abort(), this.#O = void 0, this.#z = !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;
2829
+ this.#p && (Ae(this.#p), this.#p = void 0), this.#be(), Xt(this.#e), this.#c.setInitialized(!1), this.#z?.(), this.#z = void 0, Qe(this.#H), this.#w && (this.#w.abort(), this.#w = 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;
2763
2830
  for (const e of this._rowPool)
2764
2831
  e.remove();
2765
2832
  this._rowPool.length = 0, this.__rowsBodyEl = null, this.#f = !1;
@@ -2783,20 +2850,20 @@ ${o}`;
2783
2850
  #oe() {
2784
2851
  const o = this.#i.querySelector(".tbw-grid-content") ?? this.#i.querySelector(".tbw-grid-root");
2785
2852
  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) {
2786
- de(this.#i, this.#e), Pe(this.#i, this.#o?.shell, this.#e);
2787
- const r = this.#o?.shell?.toolPanel?.defaultOpen;
2853
+ he(this.#i, this.#e), He(this.#i, this.#n?.shell, this.#e);
2854
+ const r = this.#n?.shell?.toolPanel?.defaultOpen;
2788
2855
  r && this.#e.toolPanels.has(r) && (this.openToolPanel(), this.#e.expandedSections.add(r));
2789
2856
  }
2790
- if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = xe(this), this.#L(), this.#ie(o), this.#z)
2857
+ if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Te(this), this.#L(), this.#ie(o), this.#M)
2791
2858
  return;
2792
- this.#z = !0;
2859
+ this.#M = !0;
2793
2860
  const n = this.disconnectSignal;
2794
- St(this, this, this.#i, n);
2795
- const i = this.#o.rowHeight;
2796
- i && i > 0 ? this._virtualization.rowHeight = i : requestAnimationFrame(() => this.#ne()), queueMicrotask(() => this.#ve()), this.#s.requestPhase(A.FULL, "afterConnect");
2861
+ At(this, this, this.#i, n);
2862
+ const i = this.#n.rowHeight;
2863
+ i && i > 0 ? this._virtualization.rowHeight = i : requestAnimationFrame(() => this.#ne()), queueMicrotask(() => this.#ve()), this.#s.requestPhase(T.FULL, "afterConnect");
2797
2864
  }
2798
2865
  #ne() {
2799
- if (this.#n.hasExtraHeight())
2866
+ if (this.#o.hasExtraHeight())
2800
2867
  return;
2801
2868
  const e = this._bodyEl?.querySelector(".data-grid-row");
2802
2869
  if (!e) return;
@@ -2807,12 +2874,12 @@ ${o}`;
2807
2874
  l > n && (n = l);
2808
2875
  });
2809
2876
  const i = e.getBoundingClientRect(), r = Math.max(i.height, n);
2810
- r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(A.VIRTUALIZATION, "measureRowHeight"));
2877
+ r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(T.VIRTUALIZATION, "measureRowHeight"));
2811
2878
  }
2812
2879
  #ie(e) {
2813
- this.#O?.abort(), this.#O = new AbortController();
2814
- const o = this.#O.signal, n = e?.querySelector(".faux-vscroll"), i = e?.querySelector(".rows");
2815
- if (this._virtualization.container = n ?? this, this.#b = this.#n?.getAll().some((r) => r.onScroll) ?? !1, n && i) {
2880
+ this.#D?.abort(), this.#D = new AbortController();
2881
+ const o = this.#D.signal, n = e?.querySelector(".faux-vscroll"), i = e?.querySelector(".rows");
2882
+ if (this._virtualization.container = n ?? this, this.#b = this.#o?.getAll().some((r) => r.onScroll) ?? !1, n && i) {
2816
2883
  n.addEventListener(
2817
2884
  "scroll",
2818
2885
  () => {
@@ -2825,7 +2892,7 @@ ${o}`;
2825
2892
  i.style.transform = `translateY(${u}px)`;
2826
2893
  }
2827
2894
  this.#r = l, this.#v || (this.#v = requestAnimationFrame(() => {
2828
- this.#v = 0, this.#r !== null && (this.#De(this.#r), this.#r = null);
2895
+ this.#v = 0, this.#r !== null && (this.#Oe(this.#r), this.#r = null);
2829
2896
  }));
2830
2897
  },
2831
2898
  { passive: !0, signal: o }
@@ -2844,10 +2911,10 @@ ${o}`;
2844
2911
  }
2845
2912
  },
2846
2913
  { passive: !1, signal: o }
2847
- ), eo(r, this.#H, { fauxScrollbar: n, scrollArea: s }, o));
2914
+ ), no(r, this.#H, { fauxScrollbar: n, scrollArea: s }, o));
2848
2915
  }
2849
- this._bodyEl && Et(this, this._bodyEl, o), this.#C?.disconnect(), this._virtualization.viewportEl && (this.#C = new ResizeObserver(() => {
2850
- this.#s.requestPhase(A.VIRTUALIZATION, "resize-observer");
2916
+ this._bodyEl && xt(this, this._bodyEl, o), this.#C?.disconnect(), this._virtualization.viewportEl && (this.#C = new ResizeObserver(() => {
2917
+ this.#s.requestPhase(T.VIRTUALIZATION, "resize-observer");
2851
2918
  }), this.#C.observe(this._virtualization.viewportEl)), this.#i.addEventListener(
2852
2919
  "focusin",
2853
2920
  () => {
@@ -2903,11 +2970,11 @@ ${o}`;
2903
2970
  e.columns && this.#_e(), e.rows && this.#re(), e.fitMode && this.#Ee();
2904
2971
  }
2905
2972
  #re() {
2906
- this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#B(), this.#s.requestPhase(A.ROWS, "applyRowsUpdate");
2973
+ this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#B(), this.#s.requestPhase(T.ROWS, "applyRowsUpdate");
2907
2974
  }
2908
2975
  #B() {
2909
2976
  this.#E.clear();
2910
- const e = this.#o.getRowId;
2977
+ const e = this.#n.getRowId;
2911
2978
  this._rows.forEach((o, n) => {
2912
2979
  const i = this.#se(o, e);
2913
2980
  i !== void 0 && this.#E.set(i, { row: o, index: n });
@@ -2932,31 +2999,31 @@ ${o}`;
2932
2999
  j(this), this.#t.merge(), this.#L();
2933
3000
  }
2934
3001
  #Ee() {
2935
- this.#t.merge(), this.#o.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, me(this)) : (this._columns.forEach((o) => {
3002
+ this.#t.merge(), this.#n.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, ve(this)) : (this._columns.forEach((o) => {
2936
3003
  !o.__userResized && o.__autoSized && delete o.width;
2937
3004
  }), B(this));
2938
3005
  }
2939
3006
  #Se() {
2940
3007
  I(this, this.#e), q(this, this.#e);
2941
3008
  const e = !!this.#i.querySelector(".has-shell"), o = !!this.#i.querySelector(".tbw-tool-panel"), n = this.#i.querySelectorAll(".tbw-accordion-section").length;
2942
- this.#t.parseLightDomColumns(this), this.#t.merge(), this.#ee(), W(this, this.#e, this.#A()), this.#t.markSourcesChanged(), this.#t.merge();
2943
- const i = Ye(this.#o?.shell), r = (this.#o?.shell?.toolPanels?.length ?? 0) > 0, s = (this.#o?.shell?.toolPanels?.length ?? 0) !== n;
3009
+ this.#t.parseLightDomColumns(this), this.#t.merge(), this.#ee(), W(this, this.#e, this.#T()), this.#t.markSourcesChanged(), this.#t.merge();
3010
+ const i = Ke(this.#n?.shell), r = (this.#n?.shell?.toolPanels?.length ?? 0) > 0, s = (this.#n?.shell?.toolPanels?.length ?? 0) !== n;
2944
3011
  if (e !== i || !e && i || !o && r || o && s) {
2945
3012
  this.#K(), this.#q(), this.#oe(), this.#B();
2946
3013
  return;
2947
3014
  }
2948
- e && this.#Re(), this.#B(), this.#s.requestPhase(A.COLUMNS, "applyGridConfigUpdate");
3015
+ e && this.#Re(), this.#B(), this.#s.requestPhase(T.COLUMNS, "applyGridConfigUpdate");
2949
3016
  }
2950
3017
  #Re() {
2951
3018
  const e = this.#i.querySelector(".tbw-shell-header");
2952
3019
  if (!e) return;
2953
- const o = this.#o.shell?.header?.title ?? this.#e.lightDomTitle;
3020
+ const o = this.#n.shell?.header?.title ?? this.#e.lightDomTitle;
2954
3021
  let n = e.querySelector(".tbw-shell-title");
2955
3022
  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();
2956
3023
  }
2957
3024
  #xe() {
2958
- if (this.#n) {
2959
- const e = this.#F.length > 0 ? this.#F : this._columns, o = e.filter((r) => !r.hidden), n = e.filter((r) => r.hidden), i = this.#n.processColumns([...o]);
3025
+ if (this.#o) {
3026
+ const e = this.#F.length > 0 ? this.#F : this._columns, o = e.filter((r) => !r.hidden), n = e.filter((r) => r.hidden), i = this.#o.processColumns([...o]);
2960
3027
  if (i !== o) {
2961
3028
  new Set(o.map((l) => l.field));
2962
3029
  const r = new Set(i.map((l) => l.field));
@@ -2965,21 +3032,21 @@ ${o}`;
2965
3032
  this._columns = [...e];
2966
3033
  }
2967
3034
  }
2968
- #Te() {
3035
+ #Ae() {
2969
3036
  j(this);
2970
- const e = Array.isArray(this.#a) ? [...this.#a] : [], o = this.#n?.processRows(e) ?? e;
3037
+ const e = Array.isArray(this.#a) ? [...this.#a] : [], o = this.#o?.processRows(e) ?? e;
2971
3038
  this._rows = o;
2972
3039
  }
2973
- #Ae(e) {
3040
+ #Te(e) {
2974
3041
  const o = {
2975
- ...Ze,
3042
+ ...Je,
2976
3043
  ...e.animation
2977
3044
  }, n = o.mode ?? "reduced-motion";
2978
3045
  let i = 1;
2979
3046
  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;
2980
3047
  }
2981
3048
  #G(e, o, n = this.__rowRenderEpoch) {
2982
- this.#R || (this.#R = (i, r, s) => this.#n?.renderRow(i, r, s) ?? !1), bt(this, e, o, n, this.#R);
3049
+ this.#R || (this.#R = (i, r, s) => this.#o?.renderRow(i, r, s) ?? !1), Ct(this, e, o, n, this.#R);
2983
3050
  }
2984
3051
  #X = -1;
2985
3052
  #le = -1;
@@ -2993,9 +3060,9 @@ ${o}`;
2993
3060
  #de;
2994
3061
  #Pe() {
2995
3062
  if (!this.__rowsBodyEl) return;
2996
- const e = this.#o.gridAriaLabel, o = this.#o.shell?.header?.title ?? this.#e?.lightDomTitle ?? void 0, n = e ?? o;
3063
+ const e = this.#n.gridAriaLabel, o = this.#n.shell?.header?.title ?? this.#e?.lightDomTitle ?? void 0, n = e ?? o;
2997
3064
  n !== this.#ce && (this.#ce = n, n ? this.__rowsBodyEl.setAttribute("aria-label", n) : this.__rowsBodyEl.removeAttribute("aria-label"));
2998
- const i = this.#o.gridAriaDescribedBy;
3065
+ const i = this.#n.gridAriaDescribedBy;
2999
3066
  i !== this.#de && (this.#de = i, i ? this.__rowsBodyEl.setAttribute("aria-describedby", i) : this.__rowsBodyEl.removeAttribute("aria-describedby"));
3000
3067
  }
3001
3068
  #Le(e) {
@@ -3003,7 +3070,7 @@ ${o}`;
3003
3070
  return o.className = `tbw-spinner tbw-spinner--${e}`, o.setAttribute("role", "progressbar"), o.setAttribute("aria-label", "Loading"), o;
3004
3071
  }
3005
3072
  #He(e) {
3006
- const o = this.#o?.loadingRenderer;
3073
+ const o = this.#n?.loadingRenderer;
3007
3074
  if (o) {
3008
3075
  const n = o({ size: e });
3009
3076
  if (typeof n == "string") {
@@ -3014,7 +3081,7 @@ ${o}`;
3014
3081
  }
3015
3082
  return this.#Le(e);
3016
3083
  }
3017
- #Oe() {
3084
+ #De() {
3018
3085
  const e = this.querySelector(".tbw-grid-root");
3019
3086
  if (e)
3020
3087
  if (this.#k) {
@@ -3044,19 +3111,19 @@ ${o}`;
3044
3111
  }
3045
3112
  #L() {
3046
3113
  if (this.isConnected && !(!this._headerRowEl || !this._bodyEl)) {
3047
- if (this.#t.parseLightDomColumns(this), this.#D) {
3048
- const e = this.#D;
3049
- this.#D = void 0, this.#t.merge();
3050
- const o = this.#n?.getAll() ?? [];
3114
+ if (this.#t.parseLightDomColumns(this), this.#O) {
3115
+ const e = this.#O;
3116
+ this.#O = void 0, this.#t.merge();
3117
+ const o = this.#o?.getAll() ?? [];
3051
3118
  this.#t.applyState(e, o);
3052
3119
  }
3053
- this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(A.FULL, "setup");
3120
+ this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(T.FULL, "setup");
3054
3121
  }
3055
3122
  }
3056
- #De(e) {
3057
- if (this.refreshVirtualWindow(!1), this.#n?.onScrollRender(), this.#b) {
3123
+ #Oe(e) {
3124
+ if (this.refreshVirtualWindow(!1), this.#o?.onScrollRender(), this.#b) {
3058
3125
  const o = this._virtualization.container, n = this.#pe;
3059
- n.scrollTop = e, n.scrollLeft = o?.scrollLeft ?? 0, n.scrollHeight = o?.scrollHeight ?? 0, n.scrollWidth = o?.scrollWidth ?? 0, n.clientHeight = o?.clientHeight ?? 0, n.clientWidth = o?.clientWidth ?? 0, this.#n?.onScroll(n);
3126
+ n.scrollTop = e, n.scrollLeft = o?.scrollLeft ?? 0, n.scrollHeight = o?.scrollHeight ?? 0, n.scrollWidth = o?.scrollWidth ?? 0, n.clientHeight = o?.clientHeight ?? 0, n.clientWidth = o?.clientWidth ?? 0, this.#o?.onScroll(n);
3060
3127
  }
3061
3128
  }
3062
3129
  findHeaderRow() {
@@ -3096,7 +3163,7 @@ ${o}`;
3096
3163
  value: a,
3097
3164
  cellEl: i,
3098
3165
  originalEvent: e
3099
- }, u = this.#n?.onCellClick(h) ?? !1;
3166
+ }, u = this.#o?.onCellClick(h) ?? !1;
3100
3167
  return this.#P("cell-click", h), u;
3101
3168
  }
3102
3169
  _dispatchRowClick(e, o, n, i) {
@@ -3106,7 +3173,7 @@ ${o}`;
3106
3173
  row: n,
3107
3174
  rowEl: i,
3108
3175
  originalEvent: e
3109
- }, s = this.#n?.onRowClick(r) ?? !1;
3176
+ }, s = this.#o?.onRowClick(r) ?? !1;
3110
3177
  return this.#P("row-click", r), s;
3111
3178
  }
3112
3179
  _dispatchHeaderClick(e, o, n) {
@@ -3119,49 +3186,52 @@ ${o}`;
3119
3186
  headerEl: n,
3120
3187
  originalEvent: e
3121
3188
  };
3122
- return this.#n?.onHeaderClick(r) ?? !1;
3189
+ return this.#o?.onHeaderClick(r) ?? !1;
3123
3190
  }
3124
3191
  _dispatchKeyDown(e) {
3125
- return this.#n?.onKeyDown(e) ?? !1;
3192
+ return this.#o?.onKeyDown(e) ?? !1;
3126
3193
  }
3127
3194
  _getHorizontalScrollOffsets(e, o) {
3128
- return this.#n?.getHorizontalScrollOffsets(e, o) ?? { left: 0, right: 0 };
3195
+ return this.#o?.getHorizontalScrollOffsets(e, o) ?? { left: 0, right: 0 };
3129
3196
  }
3130
3197
  queryPlugins(e) {
3131
- return this.#n?.queryPlugins(e) ?? [];
3198
+ return this.#o?.queryPlugins(e) ?? [];
3199
+ }
3200
+ query(e, o) {
3201
+ return this.#o?.queryPlugins({ type: e, context: o }) ?? [];
3132
3202
  }
3133
3203
  _dispatchCellMouseDown(e) {
3134
- return this.#n?.onCellMouseDown(e) ?? !1;
3204
+ return this.#o?.onCellMouseDown(e) ?? !1;
3135
3205
  }
3136
3206
  _dispatchCellMouseMove(e) {
3137
- this.#n?.onCellMouseMove(e);
3207
+ this.#o?.onCellMouseMove(e);
3138
3208
  }
3139
3209
  _dispatchCellMouseUp(e) {
3140
- this.#n?.onCellMouseUp(e);
3210
+ this.#o?.onCellMouseUp(e);
3141
3211
  }
3142
3212
  _afterCellRender(e) {
3143
- this.#n?.afterCellRender(e);
3213
+ this.#o?.afterCellRender(e);
3144
3214
  }
3145
3215
  _hasAfterCellRenderHook() {
3146
- return this.#n?.hasAfterCellRenderHook() ?? !1;
3216
+ return this.#o?.hasAfterCellRenderHook() ?? !1;
3147
3217
  }
3148
3218
  _afterRowRender(e) {
3149
- this.#n?.afterRowRender(e);
3219
+ this.#o?.afterRowRender(e);
3150
3220
  }
3151
3221
  _hasAfterRowRenderHook() {
3152
- return this.#n?.hasAfterRowRenderHook() ?? !1;
3222
+ return this.#o?.hasAfterRowRenderHook() ?? !1;
3153
3223
  }
3154
3224
  async ready() {
3155
3225
  return this.#d;
3156
3226
  }
3157
3227
  async forceLayout() {
3158
- return this.#s.requestPhase(A.FULL, "forceLayout"), this.#s.whenReady();
3228
+ return this.#s.requestPhase(T.FULL, "forceLayout"), this.#s.whenReady();
3159
3229
  }
3160
3230
  async getConfig() {
3161
- return Object.freeze({ ...this.#o || {} });
3231
+ return Object.freeze({ ...this.#n || {} });
3162
3232
  }
3163
3233
  getRowId(e) {
3164
- return this.#ye(e, this.#o.getRowId);
3234
+ return this.#ye(e, this.#n.getRowId);
3165
3235
  }
3166
3236
  getRow(e) {
3167
3237
  return this.#E.get(e)?.row;
@@ -3188,7 +3258,7 @@ ${o}`;
3188
3258
  changes: o,
3189
3259
  source: n
3190
3260
  });
3191
- l.length > 0 && this.#s.requestPhase(A.ROWS, "updateRow");
3261
+ l.length > 0 && this.#s.requestPhase(T.ROWS, "updateRow");
3192
3262
  }
3193
3263
  updateRows(e, o = "api") {
3194
3264
  let n = !1;
@@ -3213,16 +3283,16 @@ ${o}`;
3213
3283
  }));
3214
3284
  }
3215
3285
  }
3216
- n && this.#s.requestPhase(A.ROWS, "updateRows");
3286
+ n && this.#s.requestPhase(T.ROWS, "updateRows");
3217
3287
  }
3218
3288
  animateRow(e, o) {
3219
- pe(this, e, o);
3289
+ ge(this, e, o);
3220
3290
  }
3221
3291
  animateRows(e, o) {
3222
- kt(this, e, o);
3292
+ qt(this, e, o);
3223
3293
  }
3224
3294
  animateRowById(e, o) {
3225
- return Nt(this, e, o);
3295
+ return Wt(this, e, o);
3226
3296
  }
3227
3297
  setColumnVisible(e, o) {
3228
3298
  const n = this.#t.setColumnVisible(e, o);
@@ -3248,26 +3318,26 @@ ${o}`;
3248
3318
  return this.#t.getColumnOrder();
3249
3319
  }
3250
3320
  getColumnState() {
3251
- const e = this.#n?.getAll() ?? [];
3321
+ const e = this.#o?.getAll() ?? [];
3252
3322
  return this.#t.collectState(e);
3253
3323
  }
3254
3324
  set columnState(e) {
3255
- e && (this.#D = e, this.#t.initialColumnState = e, this.#u && this.#ze(e));
3325
+ e && (this.#O = e, this.#t.initialColumnState = e, this.#u && this.#Me(e));
3256
3326
  }
3257
3327
  get columnState() {
3258
3328
  return this.getColumnState();
3259
3329
  }
3260
- #ze(e) {
3261
- const o = this.#n?.getAll() ?? [];
3330
+ #Me(e) {
3331
+ const o = this.#o?.getAll() ?? [];
3262
3332
  this.#t.applyState(e, o), this.#L();
3263
3333
  }
3264
3334
  requestStateChange() {
3265
- const e = this.#n?.getAll() ?? [];
3335
+ const e = this.#o?.getAll() ?? [];
3266
3336
  this.#t.requestStateChange(e);
3267
3337
  }
3268
3338
  resetColumnState() {
3269
- this.#D = void 0, this.__originalOrder = [];
3270
- const e = this.#n?.getAll() ?? [];
3339
+ this.#O = void 0, this.__originalOrder = [];
3340
+ const e = this.#o?.getAll() ?? [];
3271
3341
  this.#t.resetState(e), this.#t.merge(), this.#L();
3272
3342
  }
3273
3343
  get isToolPanelOpen() {
@@ -3318,17 +3388,17 @@ ${o}`;
3318
3388
  #Y = !1;
3319
3389
  refreshShellHeader() {
3320
3390
  this.#Y || (this.#Y = !0, queueMicrotask(() => {
3321
- this.#Y = !1, this.isConnected && (I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#A()), this.#t.markSourcesChanged(), this.#t.merge(), this.#K(), this.#q(), this.#Me());
3391
+ this.#Y = !1, this.isConnected && (I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T()), this.#t.markSourcesChanged(), this.#t.merge(), this.#K(), this.#q(), this.#ze());
3322
3392
  }));
3323
3393
  }
3324
- #Me() {
3394
+ #ze() {
3325
3395
  const o = this.#i.querySelector(".tbw-grid-content") ?? this.#i.querySelector(".tbw-grid-root");
3326
3396
  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) {
3327
- de(this.#i, this.#e), Pe(this.#i, this.#o?.shell, this.#e);
3328
- const n = this.#o?.shell?.toolPanel?.defaultOpen;
3397
+ he(this.#i, this.#e), He(this.#i, this.#n?.shell, this.#e);
3398
+ const n = this.#n?.shell?.toolPanel?.defaultOpen;
3329
3399
  n && this.#e.toolPanels.has(n) && (this.openToolPanel(), this.#e.expandedSections.add(n));
3330
3400
  }
3331
- this._resizeController = xe(this), this.#ie(o), this.#s.requestPhase(A.COLUMNS, "shellRefresh");
3401
+ this._resizeController = Te(this), this.#ie(o), this.#s.requestPhase(T.COLUMNS, "shellRefresh");
3332
3402
  }
3333
3403
  #S = /* @__PURE__ */ new Map();
3334
3404
  registerStyles(e, o) {
@@ -3350,20 +3420,20 @@ ${o}`;
3350
3420
  #ke() {
3351
3421
  const e = () => {
3352
3422
  const n = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
3353
- I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#A());
3423
+ I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T());
3354
3424
  const r = this.#e.lightDomTitle, s = this.#e.hasToolButtonsContainer;
3355
3425
  if (r && !n || s && !i) {
3356
3426
  this.#t.markSourcesChanged(), this.#t.merge();
3357
3427
  const l = this.#i.querySelector(".tbw-shell-header");
3358
3428
  if (l) {
3359
- const a = Ae(
3360
- this.#o.shell,
3429
+ const a = Le(
3430
+ this.#n.shell,
3361
3431
  this.#e,
3362
- this.#o.icons?.toolPanel
3432
+ this.#n.icons?.toolPanel
3363
3433
  ), c = document.createElement("div");
3364
3434
  c.innerHTML = a;
3365
3435
  const h = c.firstElementChild;
3366
- h && (l.replaceWith(h), this.#Z());
3436
+ h && (l.replaceWith(h), this.#Q());
3367
3437
  }
3368
3438
  }
3369
3439
  }, o = () => {
@@ -3374,95 +3444,95 @@ ${o}`;
3374
3444
  refreshColumns() {
3375
3445
  this.__lightDomColumnsCache = void 0, j(this), this.#t.parseLightDomColumns(this);
3376
3446
  const e = this.#e.lightDomTitle, o = this.#e.hasToolButtonsContainer;
3377
- I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#A());
3447
+ I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T());
3378
3448
  const n = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
3379
3449
  if (n && !e || i && !o) {
3380
3450
  this.#t.markSourcesChanged(), this.#t.merge();
3381
3451
  const s = this.#i.querySelector(".tbw-shell-header");
3382
3452
  if (s) {
3383
- const l = Ae(
3384
- this.#o.shell,
3453
+ const l = Le(
3454
+ this.#n.shell,
3385
3455
  this.#e,
3386
- this.#o.icons?.toolPanel
3456
+ this.#n.icons?.toolPanel
3387
3457
  ), a = document.createElement("div");
3388
3458
  a.innerHTML = l;
3389
3459
  const c = a.firstElementChild;
3390
- c && (s.replaceWith(c), this.#Z());
3460
+ c && (s.replaceWith(c), this.#Q());
3391
3461
  }
3392
3462
  }
3393
- this.#s.requestPhase(A.COLUMNS, "refreshColumns");
3463
+ this.#s.requestPhase(T.COLUMNS, "refreshColumns");
3394
3464
  }
3395
3465
  #j(e) {
3396
- 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.#n?.getExtraHeight() ?? 0, f = Math.max(0, r - c);
3466
+ 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);
3397
3467
  return e * o + u + p + f;
3398
3468
  }
3399
3469
  refreshVirtualWindow(e = !1, o = !1) {
3400
3470
  if (!this._bodyEl) return;
3401
3471
  const n = this._rows.length;
3402
3472
  if (!this._virtualization.enabled) {
3403
- this.#G(0, n), o || this.#n?.afterRender();
3473
+ this.#G(0, n), o || this.#o?.afterRender();
3404
3474
  return;
3405
3475
  }
3406
3476
  if (this._rows.length <= this._virtualization.bypassThreshold) {
3407
- this._virtualization.start = 0, this._virtualization.end = n, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#G(0, n, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#j(n)}px`), this.#ae(n, this._visibleColumns.length), o || this.#n?.afterRender();
3477
+ this._virtualization.start = 0, this._virtualization.end = n, e && (this._bodyEl.style.transform = "translateY(0px)"), this.#G(0, n, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${this.#j(n)}px`), this.#ae(n, this._visibleColumns.length), o || this.#o?.afterRender();
3408
3478
  return;
3409
3479
  }
3410
3480
  const i = this._virtualization.container ?? this, r = this._virtualization.viewportEl ?? i, s = r.clientHeight, l = this._virtualization.rowHeight, a = i.scrollTop;
3411
3481
  let c = Math.floor(a / l), h = 0;
3412
3482
  const u = 10;
3413
3483
  for (; h < u; ) {
3414
- const C = this.#n?.getExtraHeightBefore?.(c) ?? 0, _ = Math.floor((a - C) / l);
3484
+ const C = this.#o?.getExtraHeightBefore?.(c) ?? 0, _ = Math.floor((a - C) / l);
3415
3485
  if (_ >= c || _ < 0) break;
3416
3486
  c = _, h++;
3417
3487
  }
3418
3488
  c = c - c % 2, c < 0 && (c = 0);
3419
- const p = this.#n?.adjustVirtualStart(c, a, l);
3489
+ const p = this.#o?.adjustVirtualStart(c, a, l);
3420
3490
  p !== void 0 && p < c && (c = p, c = c - c % 2, c < 0 && (c = 0));
3421
3491
  const f = Math.ceil(s / l) + 3;
3422
3492
  let g = c + f;
3423
3493
  if (g > n && (g = n), this._virtualization.start = c, this._virtualization.end = g, i.clientHeight === 0 && s > 0) {
3424
- this.#s.requestPhase(A.VIRTUALIZATION, "stale-refs-retry");
3494
+ this.#s.requestPhase(T.VIRTUALIZATION, "stale-refs-retry");
3425
3495
  return;
3426
3496
  }
3427
3497
  const w = this.#j(n);
3428
3498
  this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${w}px`);
3429
- const b = this.#n?.getExtraHeightBefore?.(c) ?? 0, S = -(a - c * l - b);
3430
- this._bodyEl.style.transform = `translateY(${S}px)`, this.#G(c, g, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this.#ae(n, this._visibleColumns.length), e && !o && (this.#n?.afterRender(), queueMicrotask(() => {
3499
+ const b = this.#o?.getExtraHeightBefore?.(c) ?? 0, S = -(a - c * l - b);
3500
+ this._bodyEl.style.transform = `translateY(${S}px)`, this.#G(c, g, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this.#ae(n, this._visibleColumns.length), e && !o && (this.#o?.afterRender(), queueMicrotask(() => {
3431
3501
  const C = i.clientHeight, _ = r.clientHeight;
3432
3502
  if (C === 0 && _ > 0) return;
3433
- const T = this.#j(n);
3434
- this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${T}px`);
3503
+ const A = this.#j(n);
3504
+ this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${A}px`);
3435
3505
  }));
3436
3506
  }
3437
3507
  #K() {
3438
- I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#A()), this.#t.markSourcesChanged(), this.#t.merge();
3439
- const e = this.#o?.shell;
3440
- Xt(
3508
+ I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#T()), this.#t.markSourcesChanged(), this.#t.merge();
3509
+ const e = this.#n?.shell;
3510
+ Kt(
3441
3511
  this.#i,
3442
3512
  e,
3443
3513
  { isPanelOpen: this.#e.isPanelOpen, expandedSections: this.#e.expandedSections },
3444
- this.#o?.icons
3445
- ) && (this.#Z(), this.#c.setInitialized(!0));
3514
+ this.#n?.icons
3515
+ ) && (this.#Q(), this.#c.setInitialized(!0));
3446
3516
  }
3447
- #Z() {
3448
- $t(this.#i, this.#o?.shell, this.#e, {
3517
+ #Q() {
3518
+ Vt(this.#i, this.#n?.shell, this.#e, {
3449
3519
  onPanelToggle: () => this.toggleToolPanel(),
3450
3520
  onSectionToggle: (e) => this.toggleToolPanelSection(e)
3451
- }), this.#M?.(), this.#M = Ft(this.#i, this.#o?.shell, (e) => {
3521
+ }), this.#z?.(), this.#z = Bt(this.#i, this.#n?.shell, (e) => {
3452
3522
  this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
3453
3523
  });
3454
3524
  }
3455
3525
  }
3456
3526
  customElements.get(L.tagName) || customElements.define(L.tagName, L);
3457
3527
  globalThis.DataGridElement = L;
3458
- const ho = {
3528
+ const go = {
3459
3529
  CAN_MOVE_COLUMN: "canMoveColumn",
3460
3530
  GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
3461
3531
  };
3462
- class uo {
3532
+ class wo {
3463
3533
  static dependencies;
3464
3534
  static manifest;
3465
- version = "1.7.0";
3535
+ version = "1.9.0";
3466
3536
  styles;
3467
3537
  cellRenderers;
3468
3538
  headerRenderers;
@@ -3493,6 +3563,15 @@ class uo {
3493
3563
  const n = new CustomEvent(e, { detail: o, bubbles: !0, cancelable: !0 });
3494
3564
  return this.grid?.dispatchEvent?.(n), n.defaultPrevented;
3495
3565
  }
3566
+ on(e, o) {
3567
+ this.grid?._pluginManager?.subscribe(this, e, o);
3568
+ }
3569
+ off(e) {
3570
+ this.grid?._pluginManager?.unsubscribe(this, e);
3571
+ }
3572
+ emitPluginEvent(e, o) {
3573
+ this.grid?._pluginManager?.emitPluginEvent(e, o);
3574
+ }
3496
3575
  requestRender() {
3497
3576
  this.grid?.requestRender?.();
3498
3577
  }
@@ -3582,14 +3661,14 @@ const P = {
3582
3661
  GROUP_COUNT: "group-count",
3583
3662
  RANGE_SELECTION: "range-selection",
3584
3663
  SELECTION_OVERLAY: "selection-overlay"
3585
- }, ee = {
3664
+ }, te = {
3586
3665
  ROW_INDEX: "data-row-index",
3587
3666
  COL_INDEX: "data-col-index",
3588
3667
  FIELD: "data-field",
3589
3668
  GROUP_KEY: "data-group-key",
3590
3669
  TREE_LEVEL: "data-tree-level",
3591
3670
  STICKY: "data-sticky"
3592
- }, fo = {
3671
+ }, bo = {
3593
3672
  ROOT: `.${P.ROOT}`,
3594
3673
  HEADER: `.${P.HEADER}`,
3595
3674
  HEADER_ROW: `.${P.HEADER_ROW}`,
@@ -3599,12 +3678,12 @@ const P = {
3599
3678
  DATA_ROW: `.${P.DATA_ROW}`,
3600
3679
  DATA_CELL: `.${P.DATA_CELL}`,
3601
3680
  GROUP_ROW: `.${P.GROUP_ROW}`,
3602
- ROW_BY_INDEX: (t) => `.${P.DATA_ROW}[${ee.ROW_INDEX}="${t}"]`,
3603
- CELL_BY_FIELD: (t) => `.${P.DATA_CELL}[${ee.FIELD}="${t}"]`,
3604
- CELL_AT: (t, e) => `.${P.DATA_ROW}[${ee.ROW_INDEX}="${t}"] .${P.DATA_CELL}[${ee.COL_INDEX}="${e}"]`,
3681
+ ROW_BY_INDEX: (t) => `.${P.DATA_ROW}[${te.ROW_INDEX}="${t}"]`,
3682
+ CELL_BY_FIELD: (t) => `.${P.DATA_CELL}[${te.FIELD}="${t}"]`,
3683
+ CELL_AT: (t, e) => `.${P.DATA_ROW}[${te.ROW_INDEX}="${t}"] .${P.DATA_CELL}[${te.COL_INDEX}="${e}"]`,
3605
3684
  SELECTED_ROWS: `.${P.DATA_ROW}.${P.SELECTED}`,
3606
3685
  EDITING_CELL: `.${P.DATA_CELL}.${P.EDITING}`
3607
- }, po = {
3686
+ }, mo = {
3608
3687
  COLOR_BG: "--tbw-color-bg",
3609
3688
  COLOR_FG: "--tbw-color-fg",
3610
3689
  COLOR_FG_MUTED: "--tbw-color-fg-muted",
@@ -3623,14 +3702,14 @@ const P = {
3623
3702
  BORDER_RADIUS: "--tbw-border-radius",
3624
3703
  FOCUS_OUTLINE: "--tbw-focus-outline"
3625
3704
  };
3626
- function go(t) {
3705
+ function vo(t) {
3627
3706
  const e = document.createElement("tbw-grid");
3628
3707
  return t && (e.gridConfig = t), e;
3629
3708
  }
3630
- function wo(t, e = document) {
3709
+ function Co(t, e = document) {
3631
3710
  return e.querySelector(t);
3632
3711
  }
3633
- const bo = {
3712
+ const yo = {
3634
3713
  CELL_CHANGE: "cell-change",
3635
3714
  CELL_COMMIT: "cell-commit",
3636
3715
  ROW_COMMIT: "row-commit",
@@ -3643,7 +3722,7 @@ const bo = {
3643
3722
  CELL_ACTIVATE: "cell-activate",
3644
3723
  GROUP_TOGGLE: "group-toggle",
3645
3724
  COLUMN_STATE_CHANGE: "column-state-change"
3646
- }, mo = {
3725
+ }, _o = {
3647
3726
  SELECTION_CHANGE: "selection-change",
3648
3727
  TREE_EXPAND: "tree-expand",
3649
3728
  FILTER_CHANGE: "filter-change",
@@ -3661,7 +3740,7 @@ const bo = {
3661
3740
  COLUMN_REORDER: "column-reorder",
3662
3741
  DETAIL_EXPAND: "detail-expand",
3663
3742
  GROUP_EXPAND: "group-expand"
3664
- }, ce = {
3743
+ }, de = {
3665
3744
  sum: (t, e) => t.reduce((o, n) => o + (Number(n[e]) || 0), 0),
3666
3745
  avg: (t, e) => {
3667
3746
  const o = t.reduce((n, i) => n + (Number(i[e]) || 0), 0);
@@ -3672,7 +3751,7 @@ const bo = {
3672
3751
  max: (t, e) => Math.max(...t.map((o) => Number(o[e]) || -1 / 0)),
3673
3752
  first: (t, e) => t[0]?.[e],
3674
3753
  last: (t, e) => t[t.length - 1]?.[e]
3675
- }, V = /* @__PURE__ */ new Map(), z = {
3754
+ }, V = /* @__PURE__ */ new Map(), M = {
3676
3755
  register(t, e) {
3677
3756
  V.set(t, e);
3678
3757
  },
@@ -3681,19 +3760,19 @@ const bo = {
3681
3760
  },
3682
3761
  get(t) {
3683
3762
  if (t !== void 0)
3684
- return typeof t == "function" ? t : V.get(t) ?? ce[t];
3763
+ return typeof t == "function" ? t : V.get(t) ?? de[t];
3685
3764
  },
3686
3765
  run(t, e, o, n) {
3687
3766
  const i = this.get(t);
3688
3767
  return i ? i(e, o, n) : void 0;
3689
3768
  },
3690
3769
  has(t) {
3691
- return V.has(t) || t in ce;
3770
+ return V.has(t) || t in de;
3692
3771
  },
3693
3772
  list() {
3694
- return [...Object.keys(ce), ...V.keys()];
3773
+ return [...Object.keys(de), ...V.keys()];
3695
3774
  }
3696
- }, De = {
3775
+ }, ze = {
3697
3776
  sum: (t) => t.reduce((e, o) => e + o, 0),
3698
3777
  avg: (t) => t.length ? t.reduce((e, o) => e + o, 0) / t.length : 0,
3699
3778
  count: (t) => t.length,
@@ -3702,46 +3781,48 @@ const bo = {
3702
3781
  first: (t) => t[0] ?? 0,
3703
3782
  last: (t) => t[t.length - 1] ?? 0
3704
3783
  };
3705
- function co(t) {
3706
- return De[t] ?? De.sum;
3784
+ function fo(t) {
3785
+ return ze[t] ?? ze.sum;
3707
3786
  }
3708
- function vo(t, e) {
3709
- return co(t)(e);
3787
+ function Eo(t, e) {
3788
+ return fo(t)(e);
3710
3789
  }
3711
- const Co = z.register.bind(z), yo = z.unregister.bind(z), _o = z.get.bind(z), Eo = z.run.bind(z), So = z.list.bind(z);
3790
+ 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);
3712
3791
  export {
3713
- uo as BaseGridPlugin,
3714
- Ze as DEFAULT_ANIMATION_CONFIG,
3792
+ wo as BaseGridPlugin,
3793
+ Je as DEFAULT_ANIMATION_CONFIG,
3715
3794
  k as DEFAULT_GRID_ICONS,
3716
- bo as DGEvents,
3795
+ yo as DGEvents,
3717
3796
  L as DataGridElement,
3718
3797
  X as FitModeEnum,
3719
- po as GridCSSVars,
3798
+ mo as GridCSSVars,
3720
3799
  P as GridClasses,
3721
- ee as GridDataAttrs,
3800
+ te as GridDataAttrs,
3722
3801
  L as GridElement,
3723
- fo as GridSelectors,
3724
- ho as PLUGIN_QUERIES,
3725
- mo as PluginEvents,
3726
- ao as PluginManager,
3727
- A as RenderPhase,
3728
- Mt as a,
3729
- z as aggregatorRegistry,
3802
+ bo as GridSelectors,
3803
+ go as PLUGIN_QUERIES,
3804
+ _o as PluginEvents,
3805
+ uo as PluginManager,
3806
+ T as RenderPhase,
3807
+ It as a,
3808
+ M as aggregatorRegistry,
3730
3809
  $ as b,
3731
- xt as builtInSort,
3732
- ue as c,
3733
- go as createGrid,
3734
- Rt as defaultComparator,
3735
- Me as e,
3736
- Ie as g,
3737
- _o as getAggregator,
3738
- co as getValueAggregator,
3739
- So as listAggregators,
3740
- wo as queryGrid,
3741
- Co as registerAggregator,
3742
- Eo as runAggregator,
3743
- vo as runValueAggregator,
3810
+ Pt as builtInSort,
3811
+ fe as c,
3812
+ vo as createGrid,
3813
+ We as d,
3814
+ Tt as defaultComparator,
3815
+ Ne as e,
3816
+ bt as g,
3817
+ xo as getAggregator,
3818
+ fo as getValueAggregator,
3819
+ To as listAggregators,
3820
+ Co as queryGrid,
3821
+ po as r,
3822
+ So as registerAggregator,
3823
+ Ao as runAggregator,
3824
+ Eo as runValueAggregator,
3744
3825
  F as s,
3745
- yo as unregisterAggregator
3826
+ Ro as unregisterAggregator
3746
3827
  };
3747
3828
  //# sourceMappingURL=index.js.map