@toolbox-web/grid 2.3.0 → 2.4.1

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 (106) hide show
  1. package/all.d.ts +1 -0
  2. package/all.js +2 -2
  3. package/all.js.map +1 -1
  4. package/index.js +1 -1
  5. package/index.js.map +1 -1
  6. package/lib/core/grid.d.ts +2 -1
  7. package/lib/core/internal/aria.d.ts +13 -0
  8. package/lib/core/internal/diagnostics.d.ts +5 -1
  9. package/lib/core/internal/dom-builder.d.ts +0 -25
  10. package/lib/core/internal/drag-drop-registry.d.ts +66 -0
  11. package/lib/core/internal/render-scheduler.d.ts +9 -8
  12. package/lib/core/plugin/base-plugin.d.ts +23 -0
  13. package/lib/core/plugin/plugin-manager.d.ts +9 -0
  14. package/lib/core/types.d.ts +67 -46
  15. package/lib/features/registry.js.map +1 -1
  16. package/lib/features/reorder-rows.d.ts +3 -3
  17. package/lib/features/reorder-rows.js +1 -1
  18. package/lib/features/reorder-rows.js.map +1 -1
  19. package/lib/features/row-drag-drop.d.ts +9 -0
  20. package/lib/features/row-drag-drop.js +2 -0
  21. package/lib/features/row-drag-drop.js.map +1 -0
  22. package/lib/features/server-side.js.map +1 -1
  23. package/lib/plugins/clipboard/index.js +1 -1
  24. package/lib/plugins/clipboard/index.js.map +1 -1
  25. package/lib/plugins/column-virtualization/index.js +1 -1
  26. package/lib/plugins/column-virtualization/index.js.map +1 -1
  27. package/lib/plugins/context-menu/index.js +1 -1
  28. package/lib/plugins/context-menu/index.js.map +1 -1
  29. package/lib/plugins/editing/index.js +1 -1
  30. package/lib/plugins/editing/index.js.map +1 -1
  31. package/lib/plugins/export/ExportPlugin.d.ts +89 -0
  32. package/lib/plugins/export/index.d.ts +3 -2
  33. package/lib/plugins/export/index.js +1 -1
  34. package/lib/plugins/export/index.js.map +1 -1
  35. package/lib/plugins/export/types.d.ts +30 -0
  36. package/lib/plugins/filtering/FilteringPlugin.d.ts +15 -0
  37. package/lib/plugins/filtering/index.js +1 -1
  38. package/lib/plugins/filtering/index.js.map +1 -1
  39. package/lib/plugins/grouping-columns/index.js +1 -1
  40. package/lib/plugins/grouping-columns/index.js.map +1 -1
  41. package/lib/plugins/grouping-rows/index.js +2 -2
  42. package/lib/plugins/grouping-rows/index.js.map +1 -1
  43. package/lib/plugins/master-detail/index.js +1 -1
  44. package/lib/plugins/master-detail/index.js.map +1 -1
  45. package/lib/plugins/multi-sort/index.js +1 -1
  46. package/lib/plugins/multi-sort/index.js.map +1 -1
  47. package/lib/plugins/pinned-columns/index.js +1 -1
  48. package/lib/plugins/pinned-columns/index.js.map +1 -1
  49. package/lib/plugins/pinned-rows/index.js +1 -1
  50. package/lib/plugins/pinned-rows/index.js.map +1 -1
  51. package/lib/plugins/pivot/index.js +1 -1
  52. package/lib/plugins/pivot/index.js.map +1 -1
  53. package/lib/plugins/print/index.js +1 -1
  54. package/lib/plugins/print/index.js.map +1 -1
  55. package/lib/plugins/reorder-columns/index.js +1 -1
  56. package/lib/plugins/reorder-columns/index.js.map +1 -1
  57. package/lib/plugins/reorder-rows/RowReorderPlugin.d.ts +14 -156
  58. package/lib/plugins/reorder-rows/index.d.ts +10 -4
  59. package/lib/plugins/reorder-rows/index.js +1 -1
  60. package/lib/plugins/reorder-rows/index.js.map +1 -1
  61. package/lib/plugins/reorder-rows/types.d.ts +9 -86
  62. package/lib/plugins/responsive/index.js +1 -1
  63. package/lib/plugins/responsive/index.js.map +1 -1
  64. package/lib/plugins/row-drag-drop/RowDragDropPlugin.d.ts +146 -0
  65. package/lib/plugins/row-drag-drop/index.d.ts +9 -0
  66. package/lib/plugins/row-drag-drop/index.js +2 -0
  67. package/lib/plugins/row-drag-drop/index.js.map +1 -0
  68. package/lib/plugins/row-drag-drop/types.d.ts +276 -0
  69. package/lib/plugins/selection/index.js +1 -1
  70. package/lib/plugins/selection/index.js.map +1 -1
  71. package/lib/plugins/server-side/ServerSidePlugin.d.ts +13 -0
  72. package/lib/plugins/server-side/datasource-types.d.ts +54 -7
  73. package/lib/plugins/server-side/datasource.d.ts +10 -2
  74. package/lib/plugins/server-side/index.d.ts +1 -1
  75. package/lib/plugins/server-side/index.js +1 -1
  76. package/lib/plugins/server-side/index.js.map +1 -1
  77. package/lib/plugins/server-side/types.d.ts +1 -1
  78. package/lib/plugins/shared/drag-drop-protocol.d.ts +98 -0
  79. package/lib/plugins/tooltip/index.js +1 -1
  80. package/lib/plugins/tooltip/index.js.map +1 -1
  81. package/lib/plugins/tree/TreePlugin.d.ts +19 -6
  82. package/lib/plugins/tree/index.js +1 -1
  83. package/lib/plugins/tree/index.js.map +1 -1
  84. package/lib/plugins/undo-redo/index.js +1 -1
  85. package/lib/plugins/undo-redo/index.js.map +1 -1
  86. package/lib/plugins/visibility/index.js +1 -1
  87. package/lib/plugins/visibility/index.js.map +1 -1
  88. package/package.json +1 -1
  89. package/umd/grid.all.umd.js +1 -1
  90. package/umd/grid.all.umd.js.map +1 -1
  91. package/umd/grid.umd.js +1 -1
  92. package/umd/grid.umd.js.map +1 -1
  93. package/umd/plugins/export.umd.js +1 -1
  94. package/umd/plugins/export.umd.js.map +1 -1
  95. package/umd/plugins/filtering.umd.js +1 -1
  96. package/umd/plugins/filtering.umd.js.map +1 -1
  97. package/umd/plugins/reorder-rows.umd.js +1 -1
  98. package/umd/plugins/reorder-rows.umd.js.map +1 -1
  99. package/umd/plugins/row-drag-drop.umd.js +2 -0
  100. package/umd/plugins/row-drag-drop.umd.js.map +1 -0
  101. package/umd/plugins/selection.umd.js +1 -1
  102. package/umd/plugins/selection.umd.js.map +1 -1
  103. package/umd/plugins/server-side.umd.js +1 -1
  104. package/umd/plugins/server-side.umd.js.map +1 -1
  105. package/umd/plugins/tree.umd.js +1 -1
  106. package/umd/plugins/tree.umd.js.map +1 -1
@@ -1,2 +1,2 @@
1
- function t(t,e){return`[tbw-grid${t?`#${t}`:""}${e?`:${e}`:""}]`}function e(e,n,o,r){return`${t(o,r)} ${e}: ${n}\n\n → More info: ${function(t){return`https://toolboxjs.com/grid/errors#${t.toLowerCase()}`}(e)}`}const n="__otorp__|__retteGenifed__|__retteSenifed__|rotcurtsnoc|wodniw|sihTlabolg|labolg|ssecorp|noitcnuF|tropmi|lave|tcelfeR|yxorP|rorrE|stnemugra|tnemucod|noitacol|eikooc|egarotSlacol|egarotSnoisses|BDdexedni|hctef|tseuqeRpttHLMX|tekcoSbeW|rekroW|rekroWderahS|rekroWecivreS|renepo|tnerap|pot|semarf|fles".split("|").map(t=>t.split("").reverse().join(""));new RegExp(`__(proto|defineGetter|defineSetter)|${n.slice(3).join("|")}|this\\b`);const o=new Set("script|iframe|object|embed|form|input|button|textarea|select|link|meta|base|style|template|slot|portal|frame|frameset|applet|noscript|noembed|plaintext|xmp|listing".split("|")),r=/^on\w+$/i,i=new Set("href|src|action|formaction|data|srcdoc|xlink:href|poster|srcset".split("|")),s=/^\s*(javascript|vbscript|data|blob):/i;function a(t){if(!t||"string"!=typeof t)return"";if(-1===t.indexOf("<"))return t;const e=document.createElement("template");return e.innerHTML=t,function(t){const e=[],n=t.querySelectorAll("*");for(const a of n){const t=a.tagName.toLowerCase();if(o.has(t)){e.push(a);continue}if("svg"===t||"http://www.w3.org/2000/svg"===a.namespaceURI){if(Array.from(a.attributes).some(t=>r.test(t.name)||"href"===t.name||"xlink:href"===t.name)){e.push(a);continue}}const n=[];for(const e of a.attributes){const t=e.name.toLowerCase();r.test(t)?n.push(e.name):(i.has(t)&&s.test(e.value)||"style"===t&&/expression\s*\(|javascript:|behavior\s*:/i.test(e.value))&&n.push(e.name)}n.forEach(t=>a.removeAttribute(t))}e.forEach(t=>t.remove())}(e.content),e.innerHTML}const l='<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>',g={expand:"▶",collapse:"▼",sortAsc:"▲",sortDesc:"▼",sortNone:"⇅",submenuArrow:"▶",dragHandle:"⋮⋮",toolPanel:"☰",filter:l,filterActive:l,print:"🖨️"};class c{static dependencies;static manifest;aliases;version="undefined"!=typeof __GRID_VERSION__?__GRID_VERSION__:"dev";styles;cellRenderers;headerRenderers;cellEditors;grid;config;userConfig;#t;get defaultConfig(){return{}}constructor(t={}){this.userConfig=t}attach(t){this.#t?.abort(),this.#t=new AbortController,this.grid=t,this.config={...this.defaultConfig,...this.userConfig}}detach(){this.#t?.abort(),this.#t=void 0}getPlugin(t){return this.grid?.getPlugin(t)}emit(t,e){this.grid?.dispatchEvent?.(new CustomEvent(t,{detail:e,bubbles:!0}))}emitCancelable(t,e){const n=new CustomEvent(t,{detail:e,bubbles:!0,cancelable:!0});return this.grid?.dispatchEvent?.(n),n.defaultPrevented}on(t,e){this.grid?._pluginManager?.subscribe(this,t,e)}off(t){this.grid?._pluginManager?.unsubscribe(this,t)}emitPluginEvent(t,e){this.grid?._pluginManager?.emitPluginEvent(t,e)}broadcast(t,e){this.emitPluginEvent(t,e),this.emit(t,e)}requestRender(){this.grid?.requestRender?.()}requestColumnsRender(){this.grid?.requestColumnsRender?.()}requestRenderWithFocus(){this.grid?.requestRenderWithFocus?.()}requestAfterRender(){this.grid?.requestAfterRender?.()}requestVirtualRefresh(){this.grid?.requestVirtualRefresh?.()}get rows(){return this.grid?.rows??[]}get sourceRows(){return this.grid?.sourceRows??[]}get columns(){return this.grid?.columns??[]}get visibleColumns(){return this.grid?._visibleColumns??[]}get gridElement(){return this.grid?._hostElement}get disconnectSignal(){return this.#t?.signal??this.grid?.disconnectSignal}get gridIcons(){const t=this.grid?.gridConfig?.icons??{};return{...g,...t}}get isAnimationEnabled(){const t=this.grid?.effectiveConfig?.animation?.mode??"reduced-motion";if(!1===t||"off"===t)return!1;if(!0===t||"on"===t)return!0;const e=this.gridElement;if(e){return"0"!==getComputedStyle(e).getPropertyValue("--tbw-animation-enabled").trim()}return!0}get animationDuration(){const t=this.gridElement;if(t){const e=getComputedStyle(t).getPropertyValue("--tbw-animation-duration").trim(),n=parseInt(e,10);if(!isNaN(n))return n}return 200}setIcon(t,e,n){t.dataset.icon=e.replace(/([A-Z])/g,"-$1").toLowerCase(),"collapse"===e?t.dataset.expanded="":"expand"===e&&delete t.dataset.expanded;const o=this.#e(e,n);void 0!==o?"string"==typeof o?t.innerHTML=a(o):o instanceof HTMLElement&&(t.innerHTML="",t.appendChild(o.cloneNode(!0))):t.innerHTML=""}#e(t,e){return void 0!==e?e:this.grid?.gridConfig?.icons?.[t]}updateSortIndicator(t,e){t.querySelector('[part~="sort-indicator"], .sort-indicator')?.remove();const n=document.createElement("span");n.setAttribute("part","sort-indicator"),n.className="sort-indicator",e?(t.setAttribute("aria-sort","asc"===e?"ascending":"descending"),t.setAttribute("data-sort",e),this.setIcon(n,"asc"===e?"sortAsc":"sortDesc")):(t.setAttribute("aria-sort","none"),t.removeAttribute("data-sort"),this.setIcon(n,"sortNone"));const o=t.querySelector(".tbw-filter-btn")??t.querySelector(".resize-handle");return o?t.insertBefore(n,o):t.appendChild(n),n}warn(n,o){void 0!==o?console.warn(e(n,o,this.gridElement.id,this.name)):console.warn(`${t(this.gridElement.id,this.name)} ${n}`)}throwDiagnostic(t,n){throw new Error(e(t,n,this.gridElement.id,this.name))}}const d=/* @__PURE__ */new WeakMap;function u(t,e,n){return n?.valueAccessor?function(t,e,n=-1){if(!e.valueAccessor)return t?.[e.field];if("object"!=typeof t||null===t)return e.valueAccessor({row:t,column:e,rowIndex:n});const o=e.field;let r=d.get(t);if(r){if(r.has(o))return r.get(o)}else r=/* @__PURE__ */new Map,d.set(t,r);const i=e.valueAccessor({row:t,column:e,rowIndex:n});return r.set(o,i),i}(t,n):t?.[e]}function h(t){return null==t||""===t||"number"==typeof t&&isNaN(t)}const p={sum:(t,e,n)=>{let o=0;for(let r=0;r<t.length;r++){const i=u(t[r],e,n);if(h(i))continue;const s=Number(i);isNaN(s)||(o+=s)}return o},avg:(t,e,n)=>{if(!t.length)return 0;let o=0,r=0;for(let i=0;i<t.length;i++){const s=u(t[i],e,n);if(h(s))continue;const a=Number(s);isNaN(a)||(o+=a,r++)}return r>0?o/r:0},count:t=>t.length,min:(t,e,n)=>{if(!t.length)return 0;let o=1/0;for(let r=0;r<t.length;r++){const i=u(t[r],e,n);if(h(i))continue;const s=Number(i);isNaN(s)||s<o&&(o=s)}return o===1/0?0:o},max:(t,e,n)=>{if(!t.length)return 0;let o=-1/0;for(let r=0;r<t.length;r++){const i=u(t[r],e,n);if(h(i))continue;const s=Number(i);isNaN(s)||s>o&&(o=s)}return o===-1/0?0:o},first:(t,e,n)=>t[0]?u(t[0],e,n):void 0,last:(t,e,n)=>t.length?u(t[t.length-1],e,n):void 0},f=/* @__PURE__ */new Map,m={register(t,e){f.set(t,e)},unregister(t){f.delete(t)},get(t){if(void 0!==t)return"function"==typeof t?t:f.get(t)??p[t]},run(t,e,n,o){const r=this.get(t);return r?r(e,n,o):void 0},has:t=>f.has(t)||t in p,list:()=>[...Object.keys(p),...f.keys()]};function b(t,e){const n=document.createElement("div");n.className="tbw-pinned-rows",n.setAttribute("role","presentation"),n.setAttribute("aria-live","polite");const o=document.createElement("div");o.className="tbw-pinned-rows-left";const r=document.createElement("div");r.className="tbw-pinned-rows-center";const i=document.createElement("div");if(i.className="tbw-pinned-rows-right",!1!==t.showRowCount){const t=document.createElement("span");t.className="tbw-status-panel tbw-status-panel-row-count",t.textContent=`Total: ${e.totalRows} rows`,o.appendChild(t)}if(t.showFilteredCount&&e.filteredRows!==e.totalRows){const t=document.createElement("span");t.className="tbw-status-panel tbw-status-panel-filtered-count",t.textContent=`Filtered: ${e.filteredRows}`,o.appendChild(t)}if(t.showSelectedCount&&e.selectedRows>0){const t=document.createElement("span");t.className="tbw-status-panel tbw-status-panel-selected-count",t.textContent=`Selected: ${e.selectedRows}`,i.appendChild(t)}if(t.customPanels)for(const s of t.customPanels){const t=y(s,e);switch(s.position){case"left":o.appendChild(t);break;case"center":r.appendChild(t);break;case"right":i.appendChild(t)}}return n.appendChild(o),n.appendChild(r),n.appendChild(i),n}function w(t){const e=document.createElement("div");return e.className=`tbw-aggregation-rows tbw-aggregation-rows-${t}`,e.setAttribute("role","presentation"),e}function v(t,e,n,o,r=!1){t.innerHTML="";for(const i of e){const e=document.createElement("div");e.className="tbw-aggregation-row",e.setAttribute("role","presentation"),i.id&&e.setAttribute("data-aggregation-id",i.id);i.fullWidth??r?C(e,i,n,o):E(e,i,n,o),t.appendChild(e)}}function C(t,e,n,o){const r=document.createElement("div");r.className="tbw-aggregation-cell tbw-aggregation-cell-full",r.style.gridColumn="1 / -1";const i="function"==typeof e.label?e.label(o,n):e.label;if(i){const t=document.createElement("span");t.className="tbw-aggregation-label",t.textContent=i,r.appendChild(t)}const s=function(t,e,n){const o=t.aggregators&&Object.keys(t.aggregators).length>0,r=t.cells&&Object.keys(t.cells).length>0;if(!o&&!r)return null;const i=document.createElement("span");i.className="tbw-aggregation-aggregates";for(const s of e){const{value:e,formatter:o}=A(t,s,n);if(null!=e){const t=document.createElement("span");t.className="tbw-aggregation-aggregate",t.setAttribute("data-field",s.field);const n=s.header??s.field,r=o?o(e,s.field,s):String(e);t.textContent=`${n}: ${r}`,i.appendChild(t)}}return i.children.length>0?i:null}(e,n,o);s&&r.appendChild(s),t.appendChild(r)}function E(t,e,n,o){for(const i of n){const n=document.createElement("div");n.className="tbw-aggregation-cell",n.setAttribute("data-field",i.field);const{value:r,formatter:s}=A(e,i,o);n.textContent=null!=r?s?s(r,i.field,i):String(r):"",t.appendChild(n)}const r="function"==typeof e.label?e.label(o,n):e.label;if(r){const e=document.createElement("span");e.className="tbw-aggregation-label",e.textContent=r,t.appendChild(e)}}function A(t,e,n){let o,r;const i=t.aggregators?.[e.field];if(i)if("object"==typeof(s=i)&&null!==s&&"aggFunc"in s){const t=m.get(i.aggFunc);t&&(o=t(n,e.field,e)),r=i.formatter}else{const t=m.get(i);t&&(o=t(n,e.field,e))}else if(t.cells&&Object.prototype.hasOwnProperty.call(t.cells,e.field)){const r=t.cells[e.field];o="function"==typeof r?r(n,e.field,e):r}var s;return{value:o,formatter:r}}function y(t,e){const n=document.createElement("div");n.className="tbw-status-panel tbw-status-panel-custom",n.id=`status-panel-${t.id}`;const o=t.render(e);return"string"==typeof o?n.innerHTML=o:n.appendChild(o),n}function R(t,e,n,o,r){const i=n?.sourceRows,s=n?.rows,a=Array.isArray(i)?i.length:t.length,l=Array.isArray(s)?s.length:t.length,g=a>0?a:l;return{totalRows:g,filteredRows:r?.cachedResult?.length??(l<a?l:g),selectedRows:o?.selected?.size??0,columns:e,rows:t,grid:n}}class x extends c{name="pinnedRows";styles="@layer tbw-plugins{.tbw-scroll-area{container-type:inline-size}.tbw-footer{flex-shrink:0;z-index:var(--tbw-z-layer-pinned-rows, 20);background:var(--tbw-color-panel-bg);min-width:fit-content}.tbw-pinned-rows{display:flex;align-items:center;justify-content:space-between;padding:var(--tbw-button-padding, var(--tbw-spacing-md, .5rem) var(--tbw-spacing-lg, .75rem));background:var(--tbw-pinned-rows-bg, var(--tbw-color-panel-bg));border-top:1px solid var(--tbw-pinned-rows-border, var(--tbw-color-border));font-size:var(--tbw-font-size-xs, .75rem);color:var(--tbw-pinned-rows-color, var(--tbw-color-fg-muted));min-height:32px;box-sizing:border-box;position:sticky;left:0;min-width:0;width:100cqi}.tbw-pinned-rows-left,.tbw-pinned-rows-center,.tbw-pinned-rows-right{display:flex;align-items:center;gap:var(--tbw-spacing-xl, 1rem)}.tbw-pinned-rows-left{justify-content:flex-start}.tbw-pinned-rows-center{justify-content:center;flex:1}.tbw-pinned-rows-right{justify-content:flex-end}.tbw-status-panel{white-space:nowrap}.tbw-aggregation-rows{min-width:fit-content;background:var(--tbw-aggregation-bg, var(--tbw-color-header-bg))}.tbw-aggregation-rows-top{border-bottom:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-rows-bottom{border-top:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-row{display:grid;grid-template-columns:var(--tbw-column-template);font-size:var(--tbw-aggregation-font-size, .8em);font-weight:var(--tbw-aggregation-font-weight, 600);position:relative;background:inherit}.tbw-aggregation-row>.tbw-aggregation-label{position:sticky;left:0;grid-row:1;grid-column:1;display:flex;align-items:center;padding:var(--tbw-cell-padding, .125rem .5rem);background:inherit;z-index:1;pointer-events:none}.tbw-aggregation-row>.tbw-aggregation-cell:first-child{grid-column:1;grid-row:1}.tbw-aggregation-cell:not(:empty){position:relative;z-index:2;background:inherit}.tbw-aggregation-cell{padding:var(--tbw-cell-padding, .125rem .5rem);min-height:var(--tbw-row-height, 1.75rem);display:block;align-items:center;align-content:center;border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;text-overflow:ellipsis;white-space:var(--tbw-cell-white-space, nowrap)}.tbw-aggregation-cell:last-child{border-right:0}.tbw-aggregation-cell-full{grid-column:1 / -1;border-right:0;display:flex;align-items:center;gap:var(--tbw-spacing-lg, .75rem)}.tbw-aggregation-label{white-space:nowrap}.tbw-aggregation-aggregates{display:flex;align-items:center;gap:var(--tbw-spacing-lg, .75rem);font-weight:400;opacity:.85}.tbw-aggregation-aggregate{white-space:nowrap}}";get defaultConfig(){return{position:"bottom",showRowCount:!0,showSelectedCount:!0,showFilteredCount:!0}}infoBarElement=null;topAggregationContainer=null;bottomAggregationContainer=null;footerWrapper=null;detach(){this.infoBarElement&&(this.infoBarElement.remove(),this.infoBarElement=null),this.topAggregationContainer&&(this.topAggregationContainer.remove(),this.topAggregationContainer=null),this.bottomAggregationContainer&&(this.bottomAggregationContainer.remove(),this.bottomAggregationContainer=null),this.footerWrapper&&(this.footerWrapper.remove(),this.footerWrapper=null)}afterRender(){const t=this.gridElement;if(!t)return;const e=t.querySelector(".tbw-scroll-area")??t.querySelector(".tbw-grid-content")??t.querySelector(".tbw-grid-root");if(!e)return;this.footerWrapper&&!e.contains(this.footerWrapper)&&(this.footerWrapper=null,this.bottomAggregationContainer=null,this.infoBarElement=null),this.topAggregationContainer&&!e.contains(this.topAggregationContainer)&&(this.topAggregationContainer=null),this.infoBarElement&&!e.contains(this.infoBarElement)&&(this.infoBarElement=null);const n=this.getSelectionState(),o=this.getFilterState(),r=R(this.sourceRows,this.columns,this.gridElement,n,o),i=this.config.aggregationRows||[],s=i.filter(t=>"top"===t.position),a=i.filter(t=>"top"!==t.position);if(s.length>0){if(!this.topAggregationContainer){this.topAggregationContainer=w("top");const n=t.querySelector(".header");n&&n.nextSibling?e.insertBefore(this.topAggregationContainer,n.nextSibling):e.appendChild(this.topAggregationContainer)}v(this.topAggregationContainer,s,this.visibleColumns,this.sourceRows,this.config.fullWidth)}else this.topAggregationContainer&&(this.topAggregationContainer.remove(),this.topAggregationContainer=null);const l=!1!==this.config.showRowCount||this.config.showSelectedCount&&r.selectedRows>0||this.config.showFilteredCount&&r.filteredRows!==r.totalRows||this.config.customPanels&&this.config.customPanels.length>0,g=l&&"top"!==this.config.position,c=a.length>0||g;if(l&&"top"===this.config.position)if(this.infoBarElement){const t=b(this.config,r);this.infoBarElement.replaceWith(t),this.infoBarElement=t}else this.infoBarElement=b(this.config,r),e.insertBefore(this.infoBarElement,e.firstChild);else"top"===this.config.position&&this.infoBarElement&&(this.infoBarElement.remove(),this.infoBarElement=null);c?(this.footerWrapper||(this.footerWrapper=document.createElement("div"),this.footerWrapper.className="tbw-footer",e.appendChild(this.footerWrapper)),this.footerWrapper.innerHTML="",a.length>0&&(this.bottomAggregationContainer||(this.bottomAggregationContainer=w("bottom")),this.footerWrapper.appendChild(this.bottomAggregationContainer),v(this.bottomAggregationContainer,a,this.visibleColumns,this.sourceRows,this.config.fullWidth)),g&&(this.infoBarElement=b(this.config,r),this.footerWrapper.appendChild(this.infoBarElement))):this.cleanupFooter()}cleanup(){this.infoBarElement&&(this.infoBarElement.remove(),this.infoBarElement=null),this.topAggregationContainer&&(this.topAggregationContainer.remove(),this.topAggregationContainer=null),this.bottomAggregationContainer&&(this.bottomAggregationContainer.remove(),this.bottomAggregationContainer=null),this.footerWrapper&&(this.footerWrapper.remove(),this.footerWrapper=null)}cleanupFooter(){this.footerWrapper&&(this.footerWrapper.remove(),this.footerWrapper=null),this.bottomAggregationContainer&&(this.bottomAggregationContainer.remove(),this.bottomAggregationContainer=null),this.infoBarElement&&"top"!==this.config.position&&(this.infoBarElement.remove(),this.infoBarElement=null)}getSelectionState(){try{return this.grid?.getPluginState?.("selection")??null}catch{return null}}getFilterState(){try{return this.grid?.getPluginState?.("filtering")??null}catch{return null}}refresh(){this.requestRender()}getContext(){const t=this.getSelectionState(),e=this.getFilterState();return R(this.rows,this.columns,this.gridElement,t,e)}addPanel(t){this.config.customPanels||(this.config.customPanels=[]),this.config.customPanels.push(t),this.requestRender()}removePanel(t){this.config.customPanels&&(this.config.customPanels=this.config.customPanels.filter(e=>e.id!==t),this.requestRender())}addAggregationRow(t){this.config.aggregationRows||(this.config.aggregationRows=[]),this.config.aggregationRows.push(t),this.requestRender()}removeAggregationRow(t){this.config.aggregationRows&&(this.config.aggregationRows=this.config.aggregationRows.filter(e=>e.id!==t),this.requestRender())}}export{x as PinnedRowsPlugin};
1
+ function t(t,e){return`[tbw-grid${t?`#${t}`:""}${e?`:${e}`:""}]`}function e(e,n,o,r){return`${t(o,r)} ${e}: ${n}\n\n → More info: ${function(t){return`https://toolboxjs.com/grid/errors#${t.toLowerCase()}`}(e)}`}const n="__otorp__|__retteGenifed__|__retteSenifed__|rotcurtsnoc|wodniw|sihTlabolg|labolg|ssecorp|noitcnuF|tropmi|lave|tcelfeR|yxorP|rorrE|stnemugra|tnemucod|noitacol|eikooc|egarotSlacol|egarotSnoisses|BDdexedni|hctef|tseuqeRpttHLMX|tekcoSbeW|rekroW|rekroWderahS|rekroWecivreS|renepo|tnerap|pot|semarf|fles".split("|").map(t=>t.split("").reverse().join(""));new RegExp(`__(proto|defineGetter|defineSetter)|${n.slice(3).join("|")}|this\\b`);const o=new Set("script|iframe|object|embed|form|input|button|textarea|select|link|meta|base|style|template|slot|portal|frame|frameset|applet|noscript|noembed|plaintext|xmp|listing".split("|")),r=/^on\w+$/i,i=new Set("href|src|action|formaction|data|srcdoc|xlink:href|poster|srcset".split("|")),s=/^\s*(javascript|vbscript|data|blob):/i;function a(t){if(!t||"string"!=typeof t)return"";if(-1===t.indexOf("<"))return t;const e=document.createElement("template");return e.innerHTML=t,function(t){const e=[],n=t.querySelectorAll("*");for(const a of n){const t=a.tagName.toLowerCase();if(o.has(t)){e.push(a);continue}if("svg"===t||"http://www.w3.org/2000/svg"===a.namespaceURI){if(Array.from(a.attributes).some(t=>r.test(t.name)||"href"===t.name||"xlink:href"===t.name)){e.push(a);continue}}const n=[];for(const e of a.attributes){const t=e.name.toLowerCase();r.test(t)?n.push(e.name):(i.has(t)&&s.test(e.value)||"style"===t&&/expression\s*\(|javascript:|behavior\s*:/i.test(e.value))&&n.push(e.name)}n.forEach(t=>a.removeAttribute(t))}e.forEach(t=>t.remove())}(e.content),e.innerHTML}const l={expand:"▶",collapse:"▼",sortAsc:"▲",sortDesc:"▼",sortNone:"⇅",submenuArrow:"▶",dragHandle:"⋮⋮",toolPanel:"☰",filter:"",filterActive:"",print:"🖨️"};class g{static dependencies;static manifest;aliases;version="undefined"!=typeof __GRID_VERSION__?__GRID_VERSION__:"dev";styles;cellRenderers;headerRenderers;cellEditors;grid;config;userConfig;#t;get defaultConfig(){return{}}constructor(t={}){this.userConfig=t}mergeConfigsFrom(t){if(0===t.length)return;const n={...this.userConfig},o={};for(const e of Object.keys(n))o[e]=this;for(const r of t){const t=r.userConfig;for(const[i,s]of Object.entries(t)){if(void 0===s)continue;if(!(i in n)){n[i]=s,o[i]=r;continue}if(n[i]===s)continue;const t=o[i]?.constructor.name??this.constructor.name,a=r.constructor.name,l=e("TBW025",`Cannot merge plugin configs for "${this.name}": conflicting value for "${i}" supplied by both ${t} and ${a}. Pass the option on a single instance, or remove the duplicate.`,void 0,this.name);throw new Error(l)}}Object.assign(this.userConfig,n)}attach(t){this.#t?.abort(),this.#t=new AbortController,this.grid=t,this.config={...this.defaultConfig,...this.userConfig}}detach(){this.#t?.abort(),this.#t=void 0}getPlugin(t){return this.grid?.getPlugin(t)}emit(t,e){this.grid?.dispatchEvent?.(new CustomEvent(t,{detail:e,bubbles:!0}))}emitCancelable(t,e){const n=new CustomEvent(t,{detail:e,bubbles:!0,cancelable:!0});return this.grid?.dispatchEvent?.(n),n.defaultPrevented}on(t,e){this.grid?._pluginManager?.subscribe(this,t,e)}off(t){this.grid?._pluginManager?.unsubscribe(this,t)}emitPluginEvent(t,e){this.grid?._pluginManager?.emitPluginEvent(t,e)}broadcast(t,e){this.emitPluginEvent(t,e),this.emit(t,e)}requestRender(){this.grid?.requestRender?.()}requestColumnsRender(){this.grid?.requestColumnsRender?.()}requestRenderWithFocus(){this.grid?.requestRenderWithFocus?.()}requestAfterRender(){this.grid?.requestAfterRender?.()}requestVirtualRefresh(){this.grid?.requestVirtualRefresh?.()}get rows(){return this.grid?.rows??[]}get sourceRows(){return this.grid?.sourceRows??[]}get columns(){return this.grid?.columns??[]}get visibleColumns(){return this.grid?._visibleColumns??[]}get gridElement(){return this.grid?._hostElement}get disconnectSignal(){return this.#t?.signal??this.grid?.disconnectSignal}get gridIcons(){const t=this.grid?.gridConfig?.icons??{};return{...l,...t}}get isAnimationEnabled(){const t=this.grid?.effectiveConfig?.animation?.mode??"reduced-motion";if(!1===t||"off"===t)return!1;if(!0===t||"on"===t)return!0;const e=this.gridElement;if(e){return"0"!==getComputedStyle(e).getPropertyValue("--tbw-animation-enabled").trim()}return!0}get animationDuration(){const t=this.gridElement;if(t){const e=getComputedStyle(t).getPropertyValue("--tbw-animation-duration").trim(),n=parseInt(e,10);if(!isNaN(n))return n}return 200}setIcon(t,e,n){t.dataset.icon=e.replace(/([A-Z])/g,"-$1").toLowerCase(),"collapse"===e?t.dataset.expanded="":"expand"===e&&delete t.dataset.expanded;const o=this.#e(e,n);void 0!==o?"string"==typeof o?t.innerHTML=a(o):o instanceof HTMLElement&&(t.innerHTML="",t.appendChild(o.cloneNode(!0))):t.innerHTML=""}#e(t,e){return void 0!==e?e:this.grid?.gridConfig?.icons?.[t]}updateSortIndicator(t,e){t.querySelector('[part~="sort-indicator"], .sort-indicator')?.remove();const n=document.createElement("span");n.setAttribute("part","sort-indicator"),n.className="sort-indicator",e?(t.setAttribute("aria-sort","asc"===e?"ascending":"descending"),t.setAttribute("data-sort",e),this.setIcon(n,"asc"===e?"sortAsc":"sortDesc")):(t.setAttribute("aria-sort","none"),t.removeAttribute("data-sort"),this.setIcon(n,"sortNone"));const o=t.querySelector(".tbw-filter-btn")??t.querySelector(".resize-handle");return o?t.insertBefore(n,o):t.appendChild(n),n}warn(n,o){void 0!==o?console.warn(e(n,o,this.gridElement.id,this.name)):console.warn(`${t(this.gridElement.id,this.name)} ${n}`)}throwDiagnostic(t,n){throw new Error(e(t,n,this.gridElement.id,this.name))}}const c=/* @__PURE__ */new WeakMap;function d(t,e,n){return n?.valueAccessor?function(t,e,n=-1){if(!e.valueAccessor)return t?.[e.field];if("object"!=typeof t||null===t)return e.valueAccessor({row:t,column:e,rowIndex:n});const o=e.field;let r=c.get(t);if(r){if(r.has(o))return r.get(o)}else r=/* @__PURE__ */new Map,c.set(t,r);const i=e.valueAccessor({row:t,column:e,rowIndex:n});return r.set(o,i),i}(t,n):t?.[e]}function u(t){return null==t||""===t||"number"==typeof t&&isNaN(t)}const h={sum:(t,e,n)=>{let o=0;for(let r=0;r<t.length;r++){const i=d(t[r],e,n);if(u(i))continue;const s=Number(i);isNaN(s)||(o+=s)}return o},avg:(t,e,n)=>{if(!t.length)return 0;let o=0,r=0;for(let i=0;i<t.length;i++){const s=d(t[i],e,n);if(u(s))continue;const a=Number(s);isNaN(a)||(o+=a,r++)}return r>0?o/r:0},count:t=>t.length,min:(t,e,n)=>{if(!t.length)return 0;let o=1/0;for(let r=0;r<t.length;r++){const i=d(t[r],e,n);if(u(i))continue;const s=Number(i);isNaN(s)||s<o&&(o=s)}return o===1/0?0:o},max:(t,e,n)=>{if(!t.length)return 0;let o=-1/0;for(let r=0;r<t.length;r++){const i=d(t[r],e,n);if(u(i))continue;const s=Number(i);isNaN(s)||s>o&&(o=s)}return o===-1/0?0:o},first:(t,e,n)=>t[0]?d(t[0],e,n):void 0,last:(t,e,n)=>t.length?d(t[t.length-1],e,n):void 0},f=/* @__PURE__ */new Map,p={register(t,e){f.set(t,e)},unregister(t){f.delete(t)},get(t){if(void 0!==t)return"function"==typeof t?t:f.get(t)??h[t]},run(t,e,n,o){const r=this.get(t);return r?r(e,n,o):void 0},has:t=>f.has(t)||t in h,list:()=>[...Object.keys(h),...f.keys()]};function m(t,e){const n=document.createElement("div");n.className="tbw-pinned-rows",n.setAttribute("role","presentation"),n.setAttribute("aria-live","polite");const o=document.createElement("div");o.className="tbw-pinned-rows-left";const r=document.createElement("div");r.className="tbw-pinned-rows-center";const i=document.createElement("div");if(i.className="tbw-pinned-rows-right",!1!==t.showRowCount){const t=document.createElement("span");t.className="tbw-status-panel tbw-status-panel-row-count",t.textContent=`Total: ${e.totalRows} rows`,o.appendChild(t)}if(t.showFilteredCount&&e.filteredRows!==e.totalRows){const t=document.createElement("span");t.className="tbw-status-panel tbw-status-panel-filtered-count",t.textContent=`Filtered: ${e.filteredRows}`,o.appendChild(t)}if(t.showSelectedCount&&e.selectedRows>0){const t=document.createElement("span");t.className="tbw-status-panel tbw-status-panel-selected-count",t.textContent=`Selected: ${e.selectedRows}`,i.appendChild(t)}if(t.customPanels)for(const s of t.customPanels){const t=A(s,e);switch(s.position){case"left":o.appendChild(t);break;case"center":r.appendChild(t);break;case"right":i.appendChild(t)}}return n.appendChild(o),n.appendChild(r),n.appendChild(i),n}function b(t){const e=document.createElement("div");return e.className=`tbw-aggregation-rows tbw-aggregation-rows-${t}`,e.setAttribute("role","presentation"),e}function w(t,e,n,o,r=!1){t.innerHTML="";for(const i of e){const e=document.createElement("div");e.className="tbw-aggregation-row",e.setAttribute("role","presentation"),i.id&&e.setAttribute("data-aggregation-id",i.id);i.fullWidth??r?v(e,i,n,o):C(e,i,n,o),t.appendChild(e)}}function v(t,e,n,o){const r=document.createElement("div");r.className="tbw-aggregation-cell tbw-aggregation-cell-full",r.style.gridColumn="1 / -1";const i="function"==typeof e.label?e.label(o,n):e.label;if(i){const t=document.createElement("span");t.className="tbw-aggregation-label",t.textContent=i,r.appendChild(t)}const s=function(t,e,n){const o=t.aggregators&&Object.keys(t.aggregators).length>0,r=t.cells&&Object.keys(t.cells).length>0;if(!o&&!r)return null;const i=document.createElement("span");i.className="tbw-aggregation-aggregates";for(const s of e){const{value:e,formatter:o}=E(t,s,n);if(null!=e){const t=document.createElement("span");t.className="tbw-aggregation-aggregate",t.setAttribute("data-field",s.field);const n=s.header??s.field,r=o?o(e,s.field,s):String(e);t.textContent=`${n}: ${r}`,i.appendChild(t)}}return i.children.length>0?i:null}(e,n,o);s&&r.appendChild(s),t.appendChild(r)}function C(t,e,n,o){for(const i of n){const n=document.createElement("div");n.className="tbw-aggregation-cell",n.setAttribute("data-field",i.field);const{value:r,formatter:s}=E(e,i,o);n.textContent=null!=r?s?s(r,i.field,i):String(r):"",t.appendChild(n)}const r="function"==typeof e.label?e.label(o,n):e.label;if(r){const e=document.createElement("span");e.className="tbw-aggregation-label",e.textContent=r,t.appendChild(e)}}function E(t,e,n){let o,r;const i=t.aggregators?.[e.field];if(i)if("object"==typeof(s=i)&&null!==s&&"aggFunc"in s){const t=p.get(i.aggFunc);t&&(o=t(n,e.field,e)),r=i.formatter}else{const t=p.get(i);t&&(o=t(n,e.field,e))}else if(t.cells&&Object.prototype.hasOwnProperty.call(t.cells,e.field)){const r=t.cells[e.field];o="function"==typeof r?r(n,e.field,e):r}var s;return{value:o,formatter:r}}function A(t,e){const n=document.createElement("div");n.className="tbw-status-panel tbw-status-panel-custom",n.id=`status-panel-${t.id}`;const o=t.render(e);return"string"==typeof o?n.innerHTML=o:n.appendChild(o),n}function y(t,e,n,o,r){const i=n?.sourceRows,s=n?.rows,a=Array.isArray(i)?i.length:t.length,l=Array.isArray(s)?s.length:t.length,g=a>0?a:l;return{totalRows:g,filteredRows:r?.cachedResult?.length??(l<a?l:g),selectedRows:o?.selected?.size??0,columns:e,rows:t,grid:n}}class R extends g{name="pinnedRows";styles="@layer tbw-plugins{.tbw-scroll-area{container-type:inline-size}.tbw-footer{flex-shrink:0;z-index:var(--tbw-z-layer-pinned-rows, 20);background:var(--tbw-color-panel-bg);min-width:fit-content}.tbw-pinned-rows{display:flex;align-items:center;justify-content:space-between;padding:var(--tbw-button-padding, var(--tbw-spacing-md, .5rem) var(--tbw-spacing-lg, .75rem));background:var(--tbw-pinned-rows-bg, var(--tbw-color-panel-bg));border-top:1px solid var(--tbw-pinned-rows-border, var(--tbw-color-border));font-size:var(--tbw-font-size-xs, .75rem);color:var(--tbw-pinned-rows-color, var(--tbw-color-fg-muted));min-height:32px;box-sizing:border-box;position:sticky;left:0;min-width:0;width:100cqi}.tbw-pinned-rows-left,.tbw-pinned-rows-center,.tbw-pinned-rows-right{display:flex;align-items:center;gap:var(--tbw-spacing-xl, 1rem)}.tbw-pinned-rows-left{justify-content:flex-start}.tbw-pinned-rows-center{justify-content:center;flex:1}.tbw-pinned-rows-right{justify-content:flex-end}.tbw-status-panel{white-space:nowrap}.tbw-aggregation-rows{min-width:fit-content;background:var(--tbw-aggregation-bg, var(--tbw-color-header-bg))}.tbw-aggregation-rows-top{border-bottom:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-rows-bottom{border-top:1px solid var(--tbw-aggregation-border, var(--tbw-color-border))}.tbw-aggregation-row{display:grid;grid-template-columns:var(--tbw-column-template);font-size:var(--tbw-aggregation-font-size, .8em);font-weight:var(--tbw-aggregation-font-weight, 600);position:relative;background:inherit}.tbw-aggregation-row>.tbw-aggregation-label{position:sticky;left:0;grid-row:1;grid-column:1;display:flex;align-items:center;padding:var(--tbw-cell-padding, .125rem .5rem);background:inherit;z-index:1;pointer-events:none}.tbw-aggregation-row>.tbw-aggregation-cell:first-child{grid-column:1;grid-row:1}.tbw-aggregation-cell:not(:empty){position:relative;z-index:2;background:inherit}.tbw-aggregation-cell{padding:var(--tbw-cell-padding, .125rem .5rem);min-height:var(--tbw-row-height, 1.75rem);display:block;align-items:center;align-content:center;border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;text-overflow:ellipsis;white-space:var(--tbw-cell-white-space, nowrap)}.tbw-aggregation-cell:last-child{border-right:0}.tbw-aggregation-cell-full{grid-column:1 / -1;border-right:0;display:flex;align-items:center;gap:var(--tbw-spacing-lg, .75rem)}.tbw-aggregation-label{white-space:nowrap}.tbw-aggregation-aggregates{display:flex;align-items:center;gap:var(--tbw-spacing-lg, .75rem);font-weight:400;opacity:.85}.tbw-aggregation-aggregate{white-space:nowrap}}";get defaultConfig(){return{position:"bottom",showRowCount:!0,showSelectedCount:!0,showFilteredCount:!0}}infoBarElement=null;topAggregationContainer=null;bottomAggregationContainer=null;footerWrapper=null;detach(){this.infoBarElement&&(this.infoBarElement.remove(),this.infoBarElement=null),this.topAggregationContainer&&(this.topAggregationContainer.remove(),this.topAggregationContainer=null),this.bottomAggregationContainer&&(this.bottomAggregationContainer.remove(),this.bottomAggregationContainer=null),this.footerWrapper&&(this.footerWrapper.remove(),this.footerWrapper=null)}afterRender(){const t=this.gridElement;if(!t)return;const e=t.querySelector(".tbw-scroll-area")??t.querySelector(".tbw-grid-content")??t.querySelector(".tbw-grid-root");if(!e)return;this.footerWrapper&&!e.contains(this.footerWrapper)&&(this.footerWrapper=null,this.bottomAggregationContainer=null,this.infoBarElement=null),this.topAggregationContainer&&!e.contains(this.topAggregationContainer)&&(this.topAggregationContainer=null),this.infoBarElement&&!e.contains(this.infoBarElement)&&(this.infoBarElement=null);const n=this.getSelectionState(),o=this.getFilterState(),r=y(this.sourceRows,this.columns,this.gridElement,n,o),i=this.config.aggregationRows||[],s=i.filter(t=>"top"===t.position),a=i.filter(t=>"top"!==t.position);if(s.length>0){if(!this.topAggregationContainer){this.topAggregationContainer=b("top");const n=t.querySelector(".header");n&&n.nextSibling?e.insertBefore(this.topAggregationContainer,n.nextSibling):e.appendChild(this.topAggregationContainer)}w(this.topAggregationContainer,s,this.visibleColumns,this.sourceRows,this.config.fullWidth)}else this.topAggregationContainer&&(this.topAggregationContainer.remove(),this.topAggregationContainer=null);const l=!1!==this.config.showRowCount||this.config.showSelectedCount&&r.selectedRows>0||this.config.showFilteredCount&&r.filteredRows!==r.totalRows||this.config.customPanels&&this.config.customPanels.length>0,g=l&&"top"!==this.config.position,c=a.length>0||g;if(l&&"top"===this.config.position)if(this.infoBarElement){const t=m(this.config,r);this.infoBarElement.replaceWith(t),this.infoBarElement=t}else this.infoBarElement=m(this.config,r),e.insertBefore(this.infoBarElement,e.firstChild);else"top"===this.config.position&&this.infoBarElement&&(this.infoBarElement.remove(),this.infoBarElement=null);c?(this.footerWrapper||(this.footerWrapper=document.createElement("div"),this.footerWrapper.className="tbw-footer",e.appendChild(this.footerWrapper)),this.footerWrapper.innerHTML="",a.length>0&&(this.bottomAggregationContainer||(this.bottomAggregationContainer=b("bottom")),this.footerWrapper.appendChild(this.bottomAggregationContainer),w(this.bottomAggregationContainer,a,this.visibleColumns,this.sourceRows,this.config.fullWidth)),g&&(this.infoBarElement=m(this.config,r),this.footerWrapper.appendChild(this.infoBarElement))):this.cleanupFooter()}cleanup(){this.infoBarElement&&(this.infoBarElement.remove(),this.infoBarElement=null),this.topAggregationContainer&&(this.topAggregationContainer.remove(),this.topAggregationContainer=null),this.bottomAggregationContainer&&(this.bottomAggregationContainer.remove(),this.bottomAggregationContainer=null),this.footerWrapper&&(this.footerWrapper.remove(),this.footerWrapper=null)}cleanupFooter(){this.footerWrapper&&(this.footerWrapper.remove(),this.footerWrapper=null),this.bottomAggregationContainer&&(this.bottomAggregationContainer.remove(),this.bottomAggregationContainer=null),this.infoBarElement&&"top"!==this.config.position&&(this.infoBarElement.remove(),this.infoBarElement=null)}getSelectionState(){try{return this.grid?.getPluginState?.("selection")??null}catch{return null}}getFilterState(){try{return this.grid?.getPluginState?.("filtering")??null}catch{return null}}refresh(){this.requestRender()}getContext(){const t=this.getSelectionState(),e=this.getFilterState();return y(this.rows,this.columns,this.gridElement,t,e)}addPanel(t){this.config.customPanels||(this.config.customPanels=[]),this.config.customPanels.push(t),this.requestRender()}removePanel(t){this.config.customPanels&&(this.config.customPanels=this.config.customPanels.filter(e=>e.id!==t),this.requestRender())}addAggregationRow(t){this.config.aggregationRows||(this.config.aggregationRows=[]),this.config.aggregationRows.push(t),this.requestRender()}removeAggregationRow(t){this.config.aggregationRows&&(this.config.aggregationRows=this.config.aggregationRows.filter(e=>e.id!==t),this.requestRender())}}export{R as PinnedRowsPlugin};
2
2
  //# sourceMappingURL=index.js.map