@alaarab/ogrid-core 2.5.5 → 2.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -35
- package/dist/esm/index.js +4 -4
- package/dist/types/constants/formulaBar.d.ts +1 -1
- package/dist/types/formula/dependencyGraph.d.ts +1 -1
- package/dist/types/formula/evaluator.d.ts +1 -1
- package/dist/types/formula/formulaEngine.d.ts +3 -3
- package/dist/types/formula/index.d.ts +1 -1
- package/dist/types/formula/parser.d.ts +14 -14
- package/dist/types/formula/types.d.ts +2 -2
- package/dist/types/index.d.ts +3 -2
- package/dist/types/types/columnTypes.d.ts +15 -1
- package/dist/types/types/dataGridTypes.d.ts +2 -2
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/clipboardHelpers.d.ts +1 -1
- package/dist/types/utils/dataGridViewModel.d.ts +10 -8
- package/dist/types/utils/dateFormatter.d.ts +49 -0
- package/dist/types/utils/dom.d.ts +1 -1
- package/dist/types/utils/fillHelpers.d.ts +10 -1
- package/dist/types/utils/formulaBarHelpers.d.ts +1 -1
- package/dist/types/utils/gridRowComparator.d.ts +1 -1
- package/dist/types/utils/index.d.ts +2 -1
- package/dist/types/utils/keyboardNavigation.d.ts +5 -5
- package/dist/types/utils/responsiveColumns.d.ts +6 -6
- package/dist/types/utils/selectionHelpers.d.ts +1 -1
- package/dist/types/utils/undoRedoStack.d.ts +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,32 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<strong>OGrid Core</strong> — Pure TypeScript types, algorithms, and utilities for OGrid data grids.
|
|
3
|
-
</p>
|
|
1
|
+
# @alaarab/ogrid-core
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
<a href="https://www.npmjs.com/package/@alaarab/ogrid-core"><img src="https://img.shields.io/npm/v/@alaarab/ogrid-core?color=%23217346&label=npm" alt="npm version" /></a>
|
|
7
|
-
<a href="https://github.com/alaarab/ogrid/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT License" /></a>
|
|
8
|
-
<img src="https://img.shields.io/badge/TypeScript-strict-blue" alt="TypeScript strict" />
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<a href="https://alaarab.github.io/ogrid/">Documentation</a> · <a href="https://alaarab.github.io/ogrid/docs/getting-started/overview">Getting Started</a> · <a href="https://alaarab.github.io/ogrid/docs/api/ogrid-props">API Reference</a>
|
|
13
|
-
</p>
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
Framework-agnostic foundation for [OGrid](https://github.com/alaarab/ogrid) data grids. **Zero dependencies** — pure TypeScript types and utilities shared by [`@alaarab/ogrid-react`](https://www.npmjs.com/package/@alaarab/ogrid-react) and [`@alaarab/ogrid-js`](https://www.npmjs.com/package/@alaarab/ogrid-js).
|
|
18
|
-
|
|
19
|
-
You typically don't need to install this directly — the UI packages re-export everything from core.
|
|
20
|
-
|
|
21
|
-
## What's Inside
|
|
22
|
-
|
|
23
|
-
### Types
|
|
24
|
-
|
|
25
|
-
`IColumnDef<T>` · `IColumnGroupDef` · `IDataSource<T>` · `IFilters` · `FilterValue` · `IDateFilterValue` · `UserLike` · `IOGridApi<T>` · `IOGridProps<T>` · `IOGridDataGridProps<T>` · `ICellEditorProps<T>` · `IGridColumnState` · `ISideBarDef` · `ColumnFilterType` · `IColumnMeta`
|
|
26
|
-
|
|
27
|
-
### Utilities
|
|
28
|
-
|
|
29
|
-
`getCellValue` · `buildHeaderRows` · `parseValue` · `normalizeSelectionRange` · `isInSelectionRange` · `toUserLike`
|
|
3
|
+
Pure TypeScript types, algorithms, and utilities shared by all OGrid framework packages.
|
|
30
4
|
|
|
31
5
|
## Install
|
|
32
6
|
|
|
@@ -34,12 +8,10 @@ You typically don't need to install this directly — the UI packages re-export
|
|
|
34
8
|
npm install @alaarab/ogrid-core
|
|
35
9
|
```
|
|
36
10
|
|
|
37
|
-
|
|
11
|
+
You typically don't need to install this directly - the UI packages (`@alaarab/ogrid-react-radix`, `@alaarab/ogrid-vue-radix`, etc.) re-export everything from core.
|
|
38
12
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
## License
|
|
13
|
+
```typescript
|
|
14
|
+
import type { IColumnDef, IDataSource } from '@alaarab/ogrid-core';
|
|
15
|
+
```
|
|
44
16
|
|
|
45
|
-
|
|
17
|
+
See the [OGrid docs](https://alaarab.github.io/ogrid/) for full documentation.
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
2
|
-
`)?`"${e.replace(/"/g,'""')}"`:e}function
|
|
3
|
-
`);z(a,r??`export_${new Date().toISOString().slice(0,10)}.csv`);}function z(t,e){let n=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(n),o=document.createElement("a");try{o.setAttribute("href",r),o.setAttribute("download",e),o.style.visibility="hidden",document.body.appendChild(o),o.click();}finally{try{document.body.removeChild(o);}catch{}URL.revokeObjectURL(r);}}function x(t,e){return e.valueGetter?e.valueGetter(t):t[e.columnId]}function h(t,e){return t.editable===true||typeof t.editable=="function"&&t.editable(e)}function ce(t,e){return {getCellValue:(n,r)=>r<0||r>=t.length||n<0||n>=e.length?null:x(t[r],e[n]),getRowCount:()=>t.length,getColumnCount:()=>e.length}}function O(t){return "children"in t&&Array.isArray(t.children)}function j(t){let e=[];for(let n of t)O(n)?e.push(...j(n.children)):e.push(n);return e}function me(t,e){function n(c,m){let s=m;for(let u of c)O(u)&&(s=Math.max(s,n(u.children,m+1)));return s}let r=n(t,0);if(r===0){let c=[];for(let m of t)if(!O(m)){if(e&&!e.has(m.columnId))continue;c.push({label:m.name,colSpan:1,isGroup:false,columnDef:m,depth:0});}return [c]}let o=r+1,l=Array.from({length:o},()=>[]),i=new Map;function a(c){let m=i.get(c);if(m!==void 0)return m;let s=0;for(let u of c)O(u)?s+=a(u.children):(!e||e.has(u.columnId))&&s++;return i.set(c,s),s}function d(c,m){for(let s of c)if(O(s)){let u=a(s.children);if(u===0)continue;l[m].push({label:s.headerName,colSpan:u,isGroup:true,depth:m}),d(s.children,m+1);}else {if(e&&!e.has(s.columnId))continue;l[m].push({label:s.name,colSpan:1,isGroup:false,columnDef:s,depth:m});}}return d(t,0),l.filter(c=>c.length>0)}function E(t){return t!=null&&typeof t=="object"&&"type"in t}function w(t){return (E(t.filterable)?t.filterable:null)?.filterField??t.columnId}function fe(t,e,n){if(n===void 0||n.type==="text"&&n.value.trim()===""||n.type==="multiSelect"&&n.value.length===0||n.type==="date"&&!n.value.from&&!n.value.to||n.type==="people"&&!n.value){let{[e]:o,...l}=t;return l}return {...t,[e]:n}}function pe(t,e){let n=[];for(let l=0;l<e.length;l++){let i=e[l];(E(i.filterable)?i.filterable:null)?.type==="multiSelect"&&n.push({col:i,field:w(i)});}if(n.length===0)return {};let r=new Map;for(let l=0;l<n.length;l++)r.set(n[l].field,new Set);for(let l=0;l<t.length;l++){let i=t[l];for(let a=0;a<n.length;a++){let d=x(i,n[a].col),c=r.get(n[a].field);d!=null&&d!==""&&c&&c.add(String(d));}}let o={};for(let l=0;l<n.length;l++){let i=r.get(n[l].field);o[n[l].field]=i?Array.from(i).sort():[];}return o}function ge(t){let e=[];for(let n of t)(E(n.filterable)?n.filterable:null)?.type==="multiSelect"&&e.push(w(n));return e}function Ce(t){let{totalCount:e,filteredCount:n,selectedCount:r,selectedCellCount:o,aggregation:l,suppressRowCount:i}=t,a=[];return i||a.push({key:"total",label:"Rows:",value:e}),n!==void 0&&n!==e&&a.push({key:"filtered",label:"Filtered:",value:n}),r!==void 0&&r>0&&a.push({key:"selected",label:"Selected:",value:r}),o!==void 0&&o>1&&a.push({key:"cells",label:"Cells:",value:o}),l&&(a.push({key:"sum",label:"Sum:",value:l.sum}),a.push({key:"avg",label:"Avg:",value:Math.round(l.avg*100)/100}),a.push({key:"min",label:"Min:",value:l.min}),a.push({key:"max",label:"Max:",value:l.max}),a.push({key:"count",label:"Count:",value:l.count})),a}function Ie(t,e,n,r){return t?typeof t=="object"?t:{totalCount:e,selectedCount:n>0?n:void 0,filteredCount:r!==void 0&&r!==e?r:void 0}:null}var K=[10,25,50,100];function Mt(t,e){return e.includes(t)?e:[...e,t].sort((n,r)=>n-r)}var Z=5;function be(t,e,n,r){if(n<=0)return null;let o=r?.maxPageButtons??Z,l=Math.ceil(n/e),i,a,d;if(l<=o){i=[];for(let s=1;s<=l;s++)i.push(s);a=false,d=false;}else {let s=Math.max(1,t-2),u=Math.min(l,t+2);u-s+1<o&&(s===1?u=Math.min(l,s+o-1):u===l&&(s=Math.max(1,u-o+1))),i=[];for(let f=s;f<=u;f++)i.push(f);a=s>1,d=u<l;}let c=Math.max(1,(t-1)*e+1),m=Math.min(t*e,n);return {totalPages:l,pageNumbers:i,showStartEllipsis:a,showEndEllipsis:d,startItem:c,endItem:m,pageSizeOptions:Mt(e,r?.pageSizeOptions??K)}}var xe=[{id:"undo",label:"Undo",shortcut:"Ctrl+Z"},{id:"redo",label:"Redo",shortcut:"Ctrl+Y"},{id:"copy",label:"Copy",shortcut:"Ctrl+C",disabledWhenNoSelection:true,dividerBefore:true},{id:"cut",label:"Cut",shortcut:"Ctrl+X",disabledWhenNoSelection:true},{id:"paste",label:"Paste",shortcut:"Ctrl+V"},{id:"selectAll",label:"Select all",shortcut:"Ctrl+A",dividerBefore:true}];function he(t){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent)?t.replace("Ctrl","\u2318"):t}function Re(t){let{onCopy:e,onCut:n,onPaste:r,onSelectAll:o,onUndo:l,onRedo:i,onClose:a}=t;return {undo:()=>{l(),a();},redo:()=>{i(),a();},copy:()=>{e(),a();},cut:()=>{n(),a();},paste:()=>{r(),a();},selectAll:()=>{o(),a();}}}var ye=[{id:"pinLeft",label:"Pin left"},{id:"pinRight",label:"Pin right"},{id:"unpin",label:"Unpin"}];function Se(t){let{canPinLeft:e,canPinRight:n,canUnpin:r,currentSort:o,isSortable:l=true,isResizable:i=true}=t,a=[];if(a.push({id:"pinLeft",label:"Pin left",disabled:!e},{id:"pinRight",label:"Pin right",disabled:!n},{id:"unpin",label:"Unpin",disabled:!r,divider:l||i}),l)if(!o)a.push({id:"sortAsc",label:"Sort ascending"},{id:"sortDesc",label:"Sort descending",divider:i});else {let d=o==="asc"?"desc":"asc",c=o==="asc"?"Sort descending":"Sort ascending";a.push({id:`sort${d==="asc"?"Asc":"Desc"}`,label:c},{id:"clearSort",label:"Clear sort",divider:i});}return i&&a.push({id:"autosizeThis",label:"Autosize this column"},{id:"autosizeAll",label:"Autosize all columns"}),a}function S(t,e,n,r){if(r.valueParser){let l={newValue:t,oldValue:e,data:n,column:r},i=r.valueParser(l);return i===void 0?{valid:false,value:void 0}:{valid:true,value:i}}if(r.cellEditor==="select"&&r.cellEditorParams?.values!=null&&Array.isArray(r.cellEditorParams.values)){let l=r.cellEditorParams.values,i=typeof t=="string"?t:String(t??"");if(i==="")return {valid:true,value:""};let a=l.find(d=>String(d).toLowerCase()===i.toLowerCase());return a!==void 0?{valid:true,value:a}:{valid:false,value:void 0}}let o=r.type;if(o==="date"){let l=Q({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}if(o==="boolean"){let l=J({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}if(o==="numeric"){let l=Y({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}return {valid:true,value:t}}function Y(t){let{newValue:e}=t;if(e===""||e==null)return null;let n=String(e).replace(/[\s,]/g,""),r=Number(n);return Number.isNaN(r)?void 0:r}function Te(t){let{newValue:e}=t;if(e===""||e==null)return null;let n=String(e).replace(/[$\u20AC\u00A3\u00A5]/g,"").replace(/[\s,]/g,""),r=Number(n);return Number.isNaN(r)?void 0:r}function Q(t){let{newValue:e}=t;if(e===""||e==null)return null;let n=String(e).trim(),r=new Date(n);if(!Number.isNaN(r.getTime()))return r.toISOString()}function we(t){let{newValue:e}=t;if(e===""||e==null)return null;let n=String(e).trim();return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)?n:void 0}function J(t){let{newValue:e}=t;if(e===""||e==null)return null;let n=String(e).trim().toLowerCase();if(["true","yes","1"].includes(n))return true;if(["false","no","0"].includes(n))return false}function ve(t,e,n){if(!n)return null;let r=R(n),o=0,l=0,i=1/0,a=-1/0,d=0;for(let c=r.startRow;c<=r.endRow;c++)for(let m=r.startCol;m<=r.endCol;m++){if(c>=t.length||m>=e.length)continue;o++;let s=t[c],u=e[m],f=x(s,u),p=typeof f=="number"?f:Number(f);!isNaN(p)&&isFinite(p)&&(l+=p,p<i&&(i=p),p>a&&(a=p),d++);}return o<2||d===0?null:{sum:l,avg:l/d,min:i,max:a,count:d}}var Ee=new WeakMap;function M(t,e,n,r,o){let l=Ee.get(e);if(!l){l=new Map;for(let c=0;c<e.length;c++)l.set(e[c].columnId,e[c]);Ee.set(e,l);}let i=[];for(let c=0;c<e.length;c++){let m=e[c],s=w(m),u=n[s];if(u)switch(u.type){case "multiSelect":if(u.value.length>0){let f=new Set(u.value);i.push(p=>f.has(String(x(p,m))));}break;case "text":{let f=u.value.trim();if(f){let p=f.toLowerCase(),g=new Map;for(let I=0;I<t.length;I++)g.set(t[I],String(x(t[I],m)??"").toLowerCase());i.push(I=>(g.get(I)??"").includes(p));}break}case "people":{let f=u.value.email.toLowerCase(),p=new Map;for(let g=0;g<t.length;g++)p.set(t[g],String(x(t[g],m)??"").toLowerCase());i.push(g=>(p.get(g)??"")===f);break}case "date":{let f=u.value,p=f.from?new Date(f.from+"T00:00:00").getTime():NaN,g=f.to?new Date(f.to+"T23:59:59.999").getTime():NaN,I=new Map;for(let C=0;C<t.length;C++){let b=x(t[C],m);if(b==null)I.set(t[C],NaN);else {let y=new Date(String(b)).getTime();I.set(t[C],Number.isNaN(y)?NaN:y);}}i.push(C=>{let b=I.get(C)??NaN;return !(Number.isNaN(b)||!Number.isNaN(p)&&b<p||!Number.isNaN(g)&&b>g)});break}}}let a=i.length>0,d=a?t.filter(c=>{for(let m=0;m<i.length;m++)if(!i[m](c))return false;return true}):t;if(r){let c=a?d:d.slice(),m=l.get(r),s=m?.compare,u=o==="asc"?1:-1;if(m?.type==="date"&&!s){let p=new Map;for(let g=0;g<c.length;g++){let I=c[g],C=m?x(I,m):I[r];if(C==null)p.set(I,NaN);else {let b=new Date(String(C)).getTime();p.set(I,Number.isNaN(b)?0:b);}}c.sort((g,I)=>{let C=p.get(g)??NaN,b=p.get(I)??NaN;return Number.isNaN(C)&&Number.isNaN(b)?0:Number.isNaN(C)?-1*u:Number.isNaN(b)?1*u:C===b?0:C>b?u:-u});}else if(s)c.sort((p,g)=>s(p,g)*u);else {let p=new Map;for(let g=0;g<c.length;g++){let I=c[g],C=m?x(I,m):I[r];C==null?p.set(I,void 0):typeof C=="number"?p.set(I,C):p.set(I,String(C).toLowerCase());}c.sort((g,I)=>{let C=p.get(g),b=p.get(I);return C===void 0&&b===void 0?0:C===void 0?-1*u:b===void 0?1*u:C===b?0:C>b?u:-u});}return c}return d}function v(t,e){if(!t)return false;let n=Math.min(t.startRow,t.endRow),r=Math.max(t.startRow,t.endRow);return e>=n&&e<=r}function De(t,e){if(t.item!==e.item||t.isSelected!==e.isSelected||t.hasCheckboxCol!==e.hasCheckboxCol||t.visibleCols!==e.visibleCols||t.columnMeta!==e.columnMeta||t.cellClassMap!==e.cellClassMap||t.columnLayouts!==e.columnLayouts)return false;let n=t.rowIndex;if(t.editingRowId!==e.editingRowId&&(t.editingRowId===t.rowId||e.editingRowId===e.rowId))return false;let r=t.activeCell?.rowIndex===n,o=e.activeCell?.rowIndex===n;if(r!==o||r&&o&&t.activeCell?.columnIndex!==e.activeCell?.columnIndex)return false;let l=v(t.selectionRange,n),i=v(e.selectionRange,n);if(l!==i||l&&i&&(t.selectionRange?.startCol!==e.selectionRange?.startCol||t.selectionRange?.endCol!==e.selectionRange?.endCol))return false;let a=t.selectionRange?.endRow===n,d=e.selectionRange?.endRow===n;return !(a!==d||(a||d)&&t.isDragging!==e.isDragging||t.cutRange!==e.cutRange&&(v(t.cutRange,n)||v(e.cutRange,n))||t.copyRange!==e.copyRange&&(v(t.copyRange,n)||v(e.copyRange,n)))}function ee(t,e){return e?e.left?.includes(t)?"left":e.right?.includes(t)?"right":"unpinned":"unpinned"}function Fe(t,e,n){let r=t.filter(i=>i!==e),o=Math.max(0,Math.min(n,r.length)),l=[...r];return l.splice(o,0,e),l}function Me(t){let{mouseX:e,columnOrder:n,draggedColumnId:r,draggedPinState:o,tableElement:l,pinnedColumns:i}=t,a=l.querySelectorAll("[data-column-id]");if(a.length===0)return null;let d=[];if(a.forEach(u=>{let f=u.getAttribute("data-column-id");if(!f||ee(f,i)!==o)return;let g=u.getBoundingClientRect(),I=n.indexOf(f);I!==-1&&d.push({columnId:f,left:g.left,right:g.right,midX:g.left+g.width/2,orderIndex:I});}),d.length===0)return null;d.sort((u,f)=>u.left-f.left);let c,m;if(e<=d[0].midX)c=d[0].orderIndex,m=d[0].left;else if(e>=d[d.length-1].midX){let u=d[d.length-1];c=u.orderIndex+1,m=u.right;}else {let u=-1;for(let f=0;f<d.length-1;f++)if(e>=d[f].midX&&e<d[f+1].midX){u=f;break}if(u===-1)return null;c=d[u].orderIndex+1,m=d[u].right;}let s=n.indexOf(r);return s===c||s+1===c?{targetIndex:c,indicatorX:null}:{targetIndex:c,indicatorX:m}}function Ne(t,e,n,r=2){if(e.length===0||n<=0)return {startIndex:0,endIndex:-1,leftOffset:0,rightOffset:0};let o=0,l=e.length,i=-1;for(let s=0;s<e.length;s++){let u=o;o+=e[s],o>t&&l===e.length&&(l=s),u<t+n&&(i=s);}if(l>i)return {startIndex:0,endIndex:-1,leftOffset:0,rightOffset:0};let a=Math.max(0,l-r),d=Math.min(e.length-1,i+r),c=0;for(let s=0;s<a;s++)c+=e[s];let m=0;for(let s=d+1;s<e.length;s++)m+=e[s];return {startIndex:a,endIndex:d,leftOffset:c,rightOffset:m}}function Pe(t,e,n){let r=[],o=[],l=[];for(let a of t){let d=n?.[a.columnId];d==="left"?r.push(a):d==="right"?o.push(a):l.push(a);}if(!e||e.endIndex<0)return {pinnedLeft:r,virtualizedUnpinned:l,pinnedRight:o,leftSpacerWidth:0,rightSpacerWidth:0};let i=l.slice(e.startIndex,e.endIndex+1);return {pinnedLeft:r,virtualizedUnpinned:i,pinnedRight:o,leftSpacerWidth:e.leftOffset,rightSpacerWidth:e.rightOffset}}function Ae(t,e,n,r,o=5){if(r<=0||e<=0||n<=0)return {startIndex:0,endIndex:0,offsetTop:0,offsetBottom:0};let l=Math.max(0,Math.floor(t/e)-o),i=Math.min(r-1,Math.ceil((t+n)/e)+o),a=l*e,d=Math.max(0,(r-i-1)*e);return {startIndex:l,endIndex:i,offsetTop:a,offsetBottom:d}}function ke(t,e){return t*e}function Le(t,e,n,r="start"){let o=t*e;switch(r){case "start":return o;case "center":return Math.max(0,o-(n-e)/2);case "end":return Math.max(0,o-n+e)}}function Oe(){let t=self;t.onmessage=e=>{let n=e.data;if(n.type!=="sort-filter")return;let{requestId:r,values:o,filters:l,sort:i}=n,a=o.length,d=[],c=Object.entries(l);if(c.length===0){d=new Array(a);for(let s=0;s<a;s++)d[s]=s;}else for(let s=0;s<a;s++){let u=true;for(let f=0;f<c.length;f++){let p=Number(c[f][0]),g=c[f][1],I=o[s][p];switch(g.type){case "text":{let C=g.value.trim().toLowerCase();C&&!String(I??"").toLowerCase().includes(C)&&(u=false);break}case "multiSelect":{g.value.length>0&&(new Set(g.value).has(String(I??""))||(u=false));break}case "date":{if(I==null){u=false;break}let C=new Date(String(I)).getTime();if(isNaN(C)){u=false;break}if(g.value.from){let b=new Date(g.value.from+"T00:00:00").getTime();if(C<b){u=false;break}}if(g.value.to){let b=new Date(g.value.to+"T23:59:59.999").getTime();if(C>b){u=false;break}}break}}if(!u)break}u&&d.push(s);}if(i){let{columnIndex:s,direction:u}=i,f=u==="asc"?1:-1;d.sort((p,g)=>{let I=o[p][s],C=o[g][s];if(I==null&&C==null)return 0;if(I==null)return -1*f;if(C==null)return 1*f;if(typeof I=="number"&&typeof C=="number")return I===C?0:I>C?f:-f;let b=String(I).toLowerCase(),y=String(C).toLowerCase();return b===y?0:b>y?f:-f});}let m={type:"sort-filter-result",requestId:r,indices:d};t.postMessage(m);};}var T=null,Nt=0,D=new Map;function te(){if(T)return T;if(typeof Worker>"u"||typeof Blob>"u"||typeof URL>"u")return null;try{let t=Oe.toString(),e=new Blob([`(${t})()`],{type:"application/javascript"}),n=URL.createObjectURL(e);return T=new Worker(n),URL.revokeObjectURL(n),T.onmessage=r=>{let{requestId:o,indices:l}=r.data,i=D.get(o);i&&(D.delete(o),i.resolve(l));},T.onerror=r=>{for(let[o,l]of D)l.reject(new Error(r.message||"Worker error")),D.delete(o);},T}catch{return null}}function _e(){T&&(T.terminate(),T=null);for(let[t,e]of D)e.reject(new Error("Worker terminated")),D.delete(t);}function ne(t,e){let n=new Array(t.length);for(let r=0;r<t.length;r++){let o=new Array(e.length);for(let l=0;l<e.length;l++){let i=x(t[r],e[l]);i==null?o[l]=null:typeof i=="string"||typeof i=="number"||typeof i=="boolean"?o[l]=i:o[l]=String(i);}n[r]=o;}return n}function Ve(t,e,n,r,o){if(r&&e.find(f=>f.columnId===r)?.compare)return Promise.resolve(M(t,e,n,r,o));let l=te();if(!l)return Promise.resolve(M(t,e,n,r,o));let i=new Map;for(let u=0;u<e.length;u++)i.set(e[u].columnId,u);let a=ne(t,e),d=e.map((u,f)=>({type:u.type??"text",index:f})),c={};for(let u of e){let f=w(u),p=n[f];if(!p)continue;let g=i.get(u.columnId);if(g!==void 0)switch(p.type){case "text":c[g]={type:"text",value:p.value};break;case "multiSelect":c[g]={type:"multiSelect",value:p.value};break;case "date":c[g]={type:"date",value:{from:p.value.from,to:p.value.to}};break;case "people":return Promise.resolve(M(t,e,n,r,o))}}let m;if(r){let u=i.get(r);u!==void 0&&(m={columnIndex:u,direction:o??"asc"});}let s=++Nt;return new Promise((u,f)=>{D.set(s,{resolve:g=>{let I=new Array(g.length);for(let C=0;C<g.length;C++)I[C]=t[g[C]];u(I);},reject:f});let p={type:"sort-filter",requestId:s,values:a,columnMeta:d,filters:c,sort:m};l.postMessage(p);})}var _=class{constructor(e,n){this.type=e;this.message=n;}toString(){return this.type}};function He(t,e){let n=E(t.filterable)?t.filterable:null,r=n?.type??"none",o=n?.filterField??t.columnId,l=t.sortable!==false,i=e.filters[o],a={columnKey:t.columnId,columnName:t.name,filterType:r,isSorted:e.sortBy===t.columnId,isSortedDescending:e.sortBy===t.columnId&&e.sortDirection==="desc",onSort:l?()=>e.onColumnSort(t.columnId):void 0};return r==="text"?{...a,textValue:i?.type==="text"?i.value:"",onTextChange:d=>e.onFilterChange(o,d.trim()?{type:"text",value:d}:void 0)}:r==="people"?{...a,selectedUser:i?.type==="people"?i.value:void 0,onUserChange:d=>e.onFilterChange(o,d?{type:"people",value:d}:void 0),peopleSearch:e.peopleSearch}:r==="multiSelect"?{...a,options:e.filterOptions[o]??[],isLoadingOptions:e.loadingFilterOptions[o]??false,selectedValues:i?.type==="multiSelect"?i.value:[],onFilterChange:d=>e.onFilterChange(o,d.length?{type:"multiSelect",value:d}:void 0)}:r==="date"?{...a,dateValue:i?.type==="date"?i.value:void 0,onDateChange:d=>e.onFilterChange(o,d?{type:"date",value:d}:void 0)}:a}var B=class B{constructor(){this.cache=new Map;this.lastVersion="";}static computeVersion(e){let n=e.editingCell,r=e.activeCell,o=e.selectionRange,l=e.cutRange,i=e.copyRange;return (n?`${String(n.rowId)}\0${n.columnId}`:"")+""+(r?`${r.rowIndex}\0${r.columnIndex}`:"")+""+(o?`${o.startRow}\0${o.startCol}\0${o.endRow}\0${o.endCol}`:"")+""+(l?`${l.startRow}\0${l.startCol}\0${l.endRow}\0${l.endCol}`:"")+""+(i?`${i.startRow}\0${i.startCol}\0${i.endRow}\0${i.endCol}`:"")+""+(e.isDragging?"1":"0")+""+(e.editable!==false?"1":"0")+""+(e.onCellValueChanged?"1":"0")+""+(e.formulaVersion??0)}get(e,n,r,o){let l=e*B.MAX_COL_STRIDE+n,i=this.cache.get(l);if(i!==void 0&&i.version===r)return i.descriptor;let a=o();return this.cache.set(l,{version:r,descriptor:a}),a}updateVersion(e){this.lastVersion=e;}get currentVersion(){return this.lastVersion}clear(){this.cache.clear();}};B.MAX_COL_STRIDE=1024;var H=B;function Be(t,e,n,r,o,l){return l!==void 0?l.get(n,r,l.currentVersion,()=>Ue(t,e,n,r,o)):Ue(t,e,n,r,o)}function Ue(t,e,n,r,o){let l=o.getRowId(t),i=r+o.colOffset,a=h(e,t),d=o.editable!==false&&a&&!!o.onCellValueChanged&&typeof e.cellEditor!="function",c=o.editable!==false&&a&&!!o.onCellValueChanged&&typeof e.cellEditor=="function"&&e.cellEditorPopup!==false,m=d||c,s=o.editingCell?.rowId===l&&o.editingCell?.columnId===e.columnId,u=!o.isDragging&&o.activeCell?.rowIndex===n&&o.activeCell?.columnIndex===i,f=o.selectionRange!=null&&o.selectionRange.startRow===o.selectionRange.endRow&&o.selectionRange.startCol===o.selectionRange.endCol,p=o.selectionRange!=null&&!f&&F(o.selectionRange,n,r),g=o.cutRange!=null&&F(o.cutRange,n,r),I=o.copyRange!=null&&F(o.copyRange,n,r),C=!o.isDragging&&o.copyRange==null&&o.cutRange==null&&o.selectionRange!=null&&n===o.selectionRange.endRow&&r===o.selectionRange.endCol,b=e.pinned!=null,y=e.pinned??void 0,P=x(t,e),A=o.hasFormula?.(r,n)??false,U=A?o.getFormulaValue?.(r,n):void 0,$="display",k;s&&d?($="editing-inline",e.cellEditor==="text"||e.cellEditor==="select"||e.cellEditor==="checkbox"||e.cellEditor==="richSelect"||e.cellEditor==="date"?k=e.cellEditor:e.type==="date"?k="date":e.type==="boolean"?k="checkbox":k="text"):s&&c&&typeof e.cellEditor=="function"&&($="editing-popover");let Ft=s&&A?o.getFormula?.(r,n)??P:P;return {mode:$,editorType:k,value:Ft,isActive:u,isInRange:p,isInCutRange:g,isInCopyRange:I,isSelectionEndCell:C,canEditAny:m,isPinned:b,pinnedSide:y,globalColIndex:i,rowId:l,rowIndex:n,displayValue:U!==void 0?U:P,columnType:e.type}}function Ge(t,e,n){if(n instanceof _)return n.toString();let r=t;if(r.renderCell&&typeof r.renderCell=="function")return r.renderCell(e);if(t.valueFormatter)return t.valueFormatter(n,e);if(n==null)return null;if(t.type==="date"){let o=new Date(String(n));if(!Number.isNaN(o.getTime()))return o.toLocaleDateString(void 0,{timeZone:"UTC"})}return t.type==="boolean"?n?"True":"False":String(n)}function We(t,e,n){let r=t,o=n instanceof _,l=r.cellStyle?typeof r.cellStyle=="function"?r.cellStyle(e):r.cellStyle:void 0;return o?{...l,color:"var(--ogrid-formula-error-color, #d32f2f)"}:l}function $e(t,e,n,r){return {value:n.value,item:t,column:e,rowIndex:n.rowIndex,editorType:n.editorType??"text",onCommit:o=>r.commitCellEdit(t,e.columnId,n.value,o,n.rowIndex,n.globalColIndex),onCancel:()=>r.setEditingCell(null)}}function Xe(t,e,n,r,o){let l=n.value;return {value:r!==void 0?r:l,onValueChange:o.setPendingEditorValue,onCommit:()=>{let a=r!==void 0?r:l;o.commitCellEdit(t,e.columnId,l,a,n.rowIndex,n.globalColIndex);},onCancel:o.cancelPopoverEdit,item:t,column:e,cellEditorParams:e.cellEditorParams}}function qe(t,e){let n=null,r=((...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...o),n=null;},e);});return r.cancel=()=>{n!==null&&(clearTimeout(n),n=null);},r}function ze(t,e,n){let r=e.startCol+n,o=e.endCol+n,l=t.querySelector(`[data-row-index="${e.startRow}"][data-col-index="${r}"]`),i=t.querySelector(`[data-row-index="${e.endRow}"][data-col-index="${o}"]`);if(!l||!i)return null;let a=t.getBoundingClientRect(),d=l.getBoundingClientRect(),c=i.getBoundingClientRect();return {top:d.top-a.top,left:d.left-a.left,width:c.right-d.left,height:c.bottom-d.top}}function je(t){let e=new Map;if(!t)return e;let n=t.querySelectorAll("[data-row-index][data-col-index]");for(let r=0;r<n.length;r++){let o=n[r],l=o.getAttribute("data-row-index")??"",i=o.getAttribute("data-col-index")??"";e.set(`${l},${i}`,o);}return e}function Ke(t,e){if(typeof document>"u"||document.getElementById(t))return;let n=document.createElement("style");n.id=t,n.textContent=e,document.head.appendChild(n);}function Ze(t,e,n){return n===null?{field:"",direction:"asc"}:n?{field:e,direction:n}:{field:e,direction:t.field===e&&t.direction==="asc"?"desc":"asc"}}var Ye=48,Qe=50,re=80,Je=16,et=30,tt="__row_number__",nt=6;var oe=16,le=520;function Pt(t){let e=getComputedStyle(t),n=(parseFloat(e.paddingLeft)||0)+(parseFloat(e.paddingRight)||0),r=(parseFloat(e.borderLeftWidth)||0)+(parseFloat(e.borderRightWidth)||0),o=0;for(let s=0;s<t.children.length;s++){let u=t.children[s],f=u.className||"";if(f.includes("resizeHandle")||f.includes("resize-handle")||f.includes("ogrid-resize-handle")){o=u.offsetWidth;break}}let l=t.firstElementChild;if(!l)return t.offsetWidth;let i=[],a=s=>{for(let u=0;u<s.children.length;u++){let f=s.children[u],p=getComputedStyle(f);(p.overflow==="hidden"||p.flexShrink!=="0")&&(i.push({el:f,overflow:f.style.overflow,flexShrink:f.style.flexShrink,width:f.style.width,minWidth:f.style.minWidth,maxWidth:f.style.maxWidth}),f.style.overflow="visible",f.style.flexShrink="0",f.style.width="max-content",f.style.minWidth="max-content",f.style.maxWidth="none"),a(f);}},d=l.style.position,c=l.style.width;l.style.position="absolute",l.style.width="max-content",a(l);let m=l.offsetWidth;l.style.position=d,l.style.width=c;for(let s of i)s.el.style.overflow=s.overflow,s.el.style.flexShrink=s.flexShrink,s.el.style.width=s.width,s.el.style.minWidth=s.minWidth,s.el.style.maxWidth=s.maxWidth;return m+o+n+r}function rt(t,e,n){let r=e??80,l=(n??document).querySelectorAll(`[data-column-id="${t}"]`);if(l.length===0)return r;let i=r,a=[],d=[],c=[];if(l.forEach(m=>{let s=m;if(!!s.querySelector?.("[data-header-label]"))i=Math.max(i,Pt(s));else {let f=s.firstElementChild??s;a.push(f);}}),a.length>0){for(let m=0;m<a.length;m++){let s=a[m];d.push(s.style.position),c.push(s.style.width),s.style.position="absolute",s.style.width="max-content";}for(let m=0;m<a.length;m++)i=Math.max(i,a[m].offsetWidth+oe);for(let m=0;m<a.length;m++)a[m].style.position=d[m],a[m].style.width=c[m];}return Math.min(le,Math.max(r,Math.ceil(i)))}function N(t,e,n,r){if(t===e)return t;let o=t+n;if(!r(t)&&!r(o)){let i=o;for(;i!==e;){if(r(i+n))return i;i+=n;}return e}let l=o;for(;l!==e;){if(!r(l))return l;l+=n;}return e}function ot(t,e,n,r,o,l){let i=t,a=e;return l?e>o?a=e-1:t>0&&(i=t-1,a=r):e<r?a=e+1:t<n&&(i=t+1,a=o),{rowIndex:i,columnIndex:a}}function lt(t){let{direction:e,rowIndex:n,columnIndex:r,dataColIndex:o,colOffset:l,maxRowIndex:i,maxColIndex:a,visibleColCount:d,isCtrl:c,isShift:m,selectionRange:s,isEmptyAt:u}=t,f=n,p=r;e==="ArrowDown"?f=c?N(n,i,1,b=>u(b,Math.max(0,o))):Math.min(n+1,i):e==="ArrowUp"?f=c?N(n,0,-1,b=>u(b,Math.max(0,o))):Math.max(n-1,0):e==="ArrowRight"?c&&o>=0?p=N(o,d-1,1,b=>u(n,b))+l:p=Math.min(r+1,a):c&&o>=0?p=N(o,0,-1,b=>u(n,b))+l:p=Math.max(r-1,l);let g=p-l,I=e==="ArrowDown"||e==="ArrowUp",C;return m?I?C=R({startRow:s?.startRow??n,startCol:s?.startCol??o,endRow:f,endCol:s?.endCol??o}):C=R({startRow:s?.startRow??n,startCol:s?.startCol??o,endRow:s?.endRow??n,endCol:g}):C={startRow:f,startCol:g,endRow:f,endCol:g},{newRowIndex:f,newColumnIndex:p,newDataColIndex:g,newRange:C}}function it(t,e,n){let r=R(t),o=[];for(let l=r.startRow;l<=r.endRow;l++)for(let i=r.startCol;i<=r.endCol;i++){if(l>=e.length||i>=n.length)continue;let a=e[l],d=n[i];if(!h(d,a))continue;let c=x(a,d),m=S("",c,a,d);m.valid&&o.push({item:a,columnId:d.columnId,oldValue:c,newValue:m.value,rowIndex:l});}return o}function at(t,e){return t===e?true:!t||!e?false:t.startRow===e.startRow&&t.endRow===e.endRow&&t.startCol===e.startCol&&t.endCol===e.endCol}function st(t,e,n){return e<0||n<0?null:{startRow:Math.max(0,Math.min(t.startRow,e)),endRow:Math.max(0,Math.min(t.endRow,e)),startCol:Math.max(0,Math.min(t.startCol,n)),endCol:Math.max(0,Math.min(t.endCol,n))}}function ut(t,e=40,n=2,r=20){let o=Math.min(t/e,1);return n+o*(r-n)}function dt(t,e,n,r,o,l){let i=new Set(l),a=Math.min(t,e),d=Math.max(t,e);for(let c=a;c<=d;c++)if(c<r.length){let m=o(r[c]);n?i.add(m):i.delete(m);}return i}function ct(t,e,n){if(t.size===0||e.length===0)return {allSelected:false,someSelected:false};let r=t.size>=e.length&&e.every(l=>t.has(n(l))),o=!r&&t.size>0;return {allSelected:r,someSelected:o}}function ie(t,e){let n=e!=null&&e!==""?e:t;if(n==null||n==="")return "";try{return String(n).replace(/[\t\n]/g," ")}catch{return "[Object]"}}function mt(t,e,n,r){let o=R(n),l=[];for(let i=o.startRow;i<=o.endRow;i++){let a=[];for(let d=o.startCol;d<=o.endCol&&!(i>=t.length||d>=e.length);d++){let c=t[i],m=e[d];if(r?.hasFormula&&r?.getFormula){let p=r.flatColumns.findIndex(g=>g.columnId===m.columnId);if(p>=0&&r.hasFormula(p,i)){let g=r.getFormula(p,i);if(g){a.push(g);continue}}}let s=x(c,m),f=(m.clipboardFormatter?m.clipboardFormatter(s,c):null)??(m.valueFormatter?m.valueFormatter(s,c):s);a.push(ie(s,f));}l.push(a.join(" "));}return l.join(`\r
|
|
4
|
-
`)}function
|
|
1
|
+
function me(t){if(t)return {id:t.id,displayName:t.displayName,email:"email"in t&&t.email?t.email:t.mail||t.userPrincipalName||"",photo:t.photo}}function F(t,e,n){let r=Math.min(t.startRow,t.endRow),o=Math.max(t.startRow,t.endRow),l=Math.min(t.startCol,t.endCol),i=Math.max(t.startCol,t.endCol);return e>=r&&e<=o&&n>=l&&n<=i}function R(t){return {startRow:Math.min(t.startRow,t.endRow),endRow:Math.max(t.startRow,t.endRow),startCol:Math.min(t.startCol,t.endCol),endCol:Math.max(t.startCol,t.endCol)}}function k(t){if(t==null)return "";let e=String(t);return e.includes(",")||e.includes('"')||e.includes(`
|
|
2
|
+
`)?`"${e.replace(/"/g,'""')}"`:e}function z(t){return t.map(e=>k(e.name)).join(",")}function Y(t,e,n,r){return t.map((o,l)=>e.map(i=>{if(r?.exportMode==="formulas"&&r.hasFormula&&r.getFormula&&r.columnIdToIndex){let a=r.columnIdToIndex.get(i.columnId);if(a!==void 0&&r.hasFormula(a,l)){let u=r.getFormula(a,l);if(u)return k(u)}}return k(n(o,i.columnId))}).join(","))}function fe(t,e,n,r,o){let l=z(e),i=Y(t,e,n,o),a=[l,...i].join(`
|
|
3
|
+
`);j(a,r??`export_${new Date().toISOString().slice(0,10)}.csv`);}function j(t,e){let n=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(n),o=document.createElement("a");try{o.setAttribute("href",r),o.setAttribute("download",e),o.style.visibility="hidden",document.body.appendChild(o),o.click();}finally{try{document.body.removeChild(o);}catch{}URL.revokeObjectURL(r);}}function x(t,e){return e.valueGetter?e.valueGetter(t):t[e.columnId]}function h(t,e){return t.editable===true||typeof t.editable=="function"&&t.editable(e)}function pe(t,e){return {getCellValue:(n,r)=>r<0||r>=t.length||n<0||n>=e.length?null:x(t[r],e[n]),getRowCount:()=>t.length,getColumnCount:()=>e.length}}function _(t){return "children"in t&&Array.isArray(t.children)}function K(t){let e=[];for(let n of t)_(n)?e.push(...K(n.children)):e.push(n);return e}function ge(t,e){function n(m,c){let s=c;for(let d of m)_(d)&&(s=Math.max(s,n(d.children,c+1)));return s}let r=n(t,0);if(r===0){let m=[];for(let c of t)if(!_(c)){if(e&&!e.has(c.columnId))continue;m.push({label:c.name,colSpan:1,isGroup:false,columnDef:c,depth:0});}return [m]}let o=r+1,l=Array.from({length:o},()=>[]),i=new Map;function a(m){let c=i.get(m);if(c!==void 0)return c;let s=0;for(let d of m)_(d)?s+=a(d.children):(!e||e.has(d.columnId))&&s++;return i.set(m,s),s}function u(m,c){for(let s of m)if(_(s)){let d=a(s.children);if(d===0)continue;l[c].push({label:s.headerName,colSpan:d,isGroup:true,depth:c}),u(s.children,c+1);}else {if(e&&!e.has(s.columnId))continue;l[c].push({label:s.name,colSpan:1,isGroup:false,columnDef:s,depth:c});}}return u(t,0),l.filter(m=>m.length>0)}function v(t){return t!=null&&typeof t=="object"&&"type"in t}function w(t){return (v(t.filterable)?t.filterable:null)?.filterField??t.columnId}function Ce(t,e,n){if(n===void 0||n.type==="text"&&n.value.trim()===""||n.type==="multiSelect"&&n.value.length===0||n.type==="date"&&!n.value.from&&!n.value.to||n.type==="people"&&!n.value){let{[e]:o,...l}=t;return l}return {...t,[e]:n}}function Ie(t,e){let n=[];for(let l=0;l<e.length;l++){let i=e[l];(v(i.filterable)?i.filterable:null)?.type==="multiSelect"&&n.push({col:i,field:w(i)});}if(n.length===0)return {};let r=new Map;for(let l=0;l<n.length;l++)r.set(n[l].field,new Set);for(let l=0;l<t.length;l++){let i=t[l];for(let a=0;a<n.length;a++){let u=x(i,n[a].col),m=r.get(n[a].field);u!=null&&u!==""&&m&&m.add(String(u));}}let o={};for(let l=0;l<n.length;l++){let i=r.get(n[l].field);o[n[l].field]=i?Array.from(i).sort():[];}return o}function be(t){let e=[];for(let n of t)(v(n.filterable)?n.filterable:null)?.type==="multiSelect"&&e.push(w(n));return e}function xe(t){let{totalCount:e,filteredCount:n,selectedCount:r,selectedCellCount:o,aggregation:l,suppressRowCount:i}=t,a=[];return i||a.push({key:"total",label:"Rows:",value:e}),n!==void 0&&n!==e&&a.push({key:"filtered",label:"Filtered:",value:n}),r!==void 0&&r>0&&a.push({key:"selected",label:"Selected:",value:r}),o!==void 0&&o>1&&a.push({key:"cells",label:"Cells:",value:o}),l&&(a.push({key:"sum",label:"Sum:",value:l.sum}),a.push({key:"avg",label:"Avg:",value:Math.round(l.avg*100)/100}),a.push({key:"min",label:"Min:",value:l.min}),a.push({key:"max",label:"Max:",value:l.max}),a.push({key:"count",label:"Count:",value:l.count})),a}function he(t,e,n,r){return t?typeof t=="object"?t:{totalCount:e,selectedCount:n>0?n:void 0,filteredCount:r!==void 0&&r!==e?r:void 0}:null}var Z=[10,25,50,100];function kt(t,e){return e.includes(t)?e:[...e,t].sort((n,r)=>n-r)}var Q=5;function Re(t,e,n,r){if(n<=0)return null;let o=r?.maxPageButtons??Q,l=Math.ceil(n/e),i,a,u;if(l<=o){i=[];for(let s=1;s<=l;s++)i.push(s);a=false,u=false;}else {let s=Math.max(1,t-2),d=Math.min(l,t+2);d-s+1<o&&(s===1?d=Math.min(l,s+o-1):d===l&&(s=Math.max(1,d-o+1))),i=[];for(let f=s;f<=d;f++)i.push(f);a=s>1,u=d<l;}let m=Math.max(1,(t-1)*e+1),c=Math.min(t*e,n);return {totalPages:l,pageNumbers:i,showStartEllipsis:a,showEndEllipsis:u,startItem:m,endItem:c,pageSizeOptions:kt(e,r?.pageSizeOptions??Z)}}var ye=[{id:"undo",label:"Undo",shortcut:"Ctrl+Z"},{id:"redo",label:"Redo",shortcut:"Ctrl+Y"},{id:"copy",label:"Copy",shortcut:"Ctrl+C",disabledWhenNoSelection:true,dividerBefore:true},{id:"cut",label:"Cut",shortcut:"Ctrl+X",disabledWhenNoSelection:true},{id:"paste",label:"Paste",shortcut:"Ctrl+V"},{id:"selectAll",label:"Select all",shortcut:"Ctrl+A",dividerBefore:true}];function Te(t){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent)?t.replace("Ctrl","\u2318"):t}function Se(t){let{onCopy:e,onCut:n,onPaste:r,onSelectAll:o,onUndo:l,onRedo:i,onClose:a}=t;return {undo:()=>{l(),a();},redo:()=>{i(),a();},copy:()=>{e(),a();},cut:()=>{n(),a();},paste:()=>{r(),a();},selectAll:()=>{o(),a();}}}var we=[{id:"pinLeft",label:"Pin left"},{id:"pinRight",label:"Pin right"},{id:"unpin",label:"Unpin"}];function De(t){let{canPinLeft:e,canPinRight:n,canUnpin:r,currentSort:o,isSortable:l=true,isResizable:i=true}=t,a=[];if(a.push({id:"pinLeft",label:"Pin left",disabled:!e},{id:"pinRight",label:"Pin right",disabled:!n},{id:"unpin",label:"Unpin",disabled:!r,divider:l||i}),l)if(!o)a.push({id:"sortAsc",label:"Sort ascending"},{id:"sortDesc",label:"Sort descending",divider:i});else {let u=o==="asc"?"desc":"asc",m=o==="asc"?"Sort descending":"Sort ascending";a.push({id:`sort${u==="asc"?"Asc":"Desc"}`,label:m},{id:"clearSort",label:"Clear sort",divider:i});}return i&&a.push({id:"autosizeThis",label:"Autosize this column"},{id:"autosizeAll",label:"Autosize all columns"}),a}function T(t,e,n,r){if(r.valueParser){let l={newValue:t,oldValue:e,data:n,column:r},i=r.valueParser(l);return i===void 0?{valid:false,value:void 0}:{valid:true,value:i}}if(r.cellEditor==="select"&&r.cellEditorParams?.values!=null&&Array.isArray(r.cellEditorParams.values)){let l=r.cellEditorParams.values,i=typeof t=="string"?t:String(t??"");if(i==="")return {valid:true,value:""};let a=l.find(u=>String(u).toLowerCase()===i.toLowerCase());return a!==void 0?{valid:true,value:a}:{valid:false,value:void 0}}let o=r.type;if(o==="date"){let l=ee({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}if(o==="boolean"){let l=te({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}if(o==="numeric"){let l=J({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}return {valid:true,value:t}}function J(t){let{newValue:e}=t;if(e===""||e==null)return null;let n=String(e).replace(/[\s,]/g,""),r=Number(n);return Number.isNaN(r)?void 0:r}function ve(t){let{newValue:e}=t;if(e===""||e==null)return null;let n=String(e).replace(/[$\u20AC\u00A3\u00A5]/g,"").replace(/[\s,]/g,""),r=Number(n);return Number.isNaN(r)?void 0:r}function ee(t){let{newValue:e}=t;if(e===""||e==null)return null;let n=String(e).trim(),r=new Date(n);if(!Number.isNaN(r.getTime()))return r.toISOString()}function Ee(t){let{newValue:e}=t;if(e===""||e==null)return null;let n=String(e).trim();return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)?n:void 0}function te(t){let{newValue:e}=t;if(e===""||e==null)return null;let n=String(e).trim().toLowerCase();if(["true","yes","1"].includes(n))return true;if(["false","no","0"].includes(n))return false}function Fe(t,e,n){if(!n)return null;let r=R(n),o=0,l=0,i=1/0,a=-1/0,u=0;for(let m=r.startRow;m<=r.endRow;m++)for(let c=r.startCol;c<=r.endCol;c++){if(m>=t.length||c>=e.length)continue;o++;let s=t[m],d=e[c],f=x(s,d),p=typeof f=="number"?f:Number(f);!isNaN(p)&&isFinite(p)&&(l+=p,p<i&&(i=p),p>a&&(a=p),u++);}return o<2||u===0?null:{sum:l,avg:l/u,min:i,max:a,count:u}}var Me=new WeakMap;function M(t,e,n,r,o){let l=Me.get(e);if(!l){l=new Map;for(let m=0;m<e.length;m++)l.set(e[m].columnId,e[m]);Me.set(e,l);}let i=[];for(let m=0;m<e.length;m++){let c=e[m],s=w(c),d=n[s];if(d)switch(d.type){case "multiSelect":if(d.value.length>0){let f=new Set(d.value);i.push(p=>f.has(String(x(p,c))));}break;case "text":{let f=d.value.trim();if(f){let p=f.toLowerCase(),g=new Map;for(let I=0;I<t.length;I++)g.set(t[I],String(x(t[I],c)??"").toLowerCase());i.push(I=>(g.get(I)??"").includes(p));}break}case "people":{let f=d.value.email.toLowerCase(),p=new Map;for(let g=0;g<t.length;g++)p.set(t[g],String(x(t[g],c)??"").toLowerCase());i.push(g=>(p.get(g)??"")===f);break}case "date":{let f=d.value,p=f.from?new Date(f.from+"T00:00:00").getTime():NaN,g=f.to?new Date(f.to+"T23:59:59.999").getTime():NaN,I=new Map;for(let C=0;C<t.length;C++){let b=x(t[C],c);if(b==null)I.set(t[C],NaN);else {let y=new Date(String(b)).getTime();I.set(t[C],Number.isNaN(y)?NaN:y);}}i.push(C=>{let b=I.get(C)??NaN;return !(Number.isNaN(b)||!Number.isNaN(p)&&b<p||!Number.isNaN(g)&&b>g)});break}}}let a=i.length>0,u=a?t.filter(m=>{for(let c=0;c<i.length;c++)if(!i[c](m))return false;return true}):t;if(r){let m=a?u:u.slice(),c=l.get(r),s=c?.compare,d=o==="asc"?1:-1;if(c?.type==="date"&&!s){let p=new Map;for(let g=0;g<m.length;g++){let I=m[g],C=c?x(I,c):I[r];if(C==null)p.set(I,NaN);else {let b=new Date(String(C)).getTime();p.set(I,Number.isNaN(b)?0:b);}}m.sort((g,I)=>{let C=p.get(g)??NaN,b=p.get(I)??NaN;return Number.isNaN(C)&&Number.isNaN(b)?0:Number.isNaN(C)?-1*d:Number.isNaN(b)?1*d:C===b?0:C>b?d:-d});}else if(s)m.sort((p,g)=>s(p,g)*d);else {let p=new Map;for(let g=0;g<m.length;g++){let I=m[g],C=c?x(I,c):I[r];C==null?p.set(I,void 0):typeof C=="number"?p.set(I,C):p.set(I,String(C).toLowerCase());}m.sort((g,I)=>{let C=p.get(g),b=p.get(I);return C===void 0&&b===void 0?0:C===void 0?-1*d:b===void 0?1*d:C===b?0:C>b?d:-d});}return m}return u}function D(t,e){if(!t)return false;let n=Math.min(t.startRow,t.endRow),r=Math.max(t.startRow,t.endRow);return e>=n&&e<=r}function Ne(t,e){if(t.item!==e.item||t.isSelected!==e.isSelected||t.hasCheckboxCol!==e.hasCheckboxCol||t.visibleCols!==e.visibleCols||t.columnMeta!==e.columnMeta||t.cellClassMap!==e.cellClassMap||t.columnLayouts!==e.columnLayouts)return false;let n=t.rowIndex;if(t.editingRowId!==e.editingRowId&&(t.editingRowId===t.rowId||e.editingRowId===e.rowId))return false;let r=t.activeCell?.rowIndex===n,o=e.activeCell?.rowIndex===n;if(r!==o||r&&o&&t.activeCell?.columnIndex!==e.activeCell?.columnIndex)return false;let l=D(t.selectionRange,n),i=D(e.selectionRange,n);if(l!==i||l&&i&&(t.selectionRange?.startCol!==e.selectionRange?.startCol||t.selectionRange?.endCol!==e.selectionRange?.endCol))return false;let a=t.selectionRange?.endRow===n,u=e.selectionRange?.endRow===n;return !(a!==u||(a||u)&&t.isDragging!==e.isDragging||t.cutRange!==e.cutRange&&(D(t.cutRange,n)||D(e.cutRange,n))||t.copyRange!==e.copyRange&&(D(t.copyRange,n)||D(e.copyRange,n)))}function ne(t,e){return e?e.left?.includes(t)?"left":e.right?.includes(t)?"right":"unpinned":"unpinned"}function Pe(t,e,n){let r=t.filter(i=>i!==e),o=Math.max(0,Math.min(n,r.length)),l=[...r];return l.splice(o,0,e),l}function Ae(t){let{mouseX:e,columnOrder:n,draggedColumnId:r,draggedPinState:o,tableElement:l,pinnedColumns:i}=t,a=l.querySelectorAll("[data-column-id]");if(a.length===0)return null;let u=[];if(a.forEach(d=>{let f=d.getAttribute("data-column-id");if(!f||ne(f,i)!==o)return;let g=d.getBoundingClientRect(),I=n.indexOf(f);I!==-1&&u.push({columnId:f,left:g.left,right:g.right,midX:g.left+g.width/2,orderIndex:I});}),u.length===0)return null;u.sort((d,f)=>d.left-f.left);let m,c;if(e<=u[0].midX)m=u[0].orderIndex,c=u[0].left;else if(e>=u[u.length-1].midX){let d=u[u.length-1];m=d.orderIndex+1,c=d.right;}else {let d=-1;for(let f=0;f<u.length-1;f++)if(e>=u[f].midX&&e<u[f+1].midX){d=f;break}if(d===-1)return null;m=u[d].orderIndex+1,c=u[d].right;}let s=n.indexOf(r);return s===m||s+1===m?{targetIndex:m,indicatorX:null}:{targetIndex:m,indicatorX:c}}function Oe(t,e,n,r=2){if(e.length===0||n<=0)return {startIndex:0,endIndex:-1,leftOffset:0,rightOffset:0};let o=0,l=e.length,i=-1;for(let s=0;s<e.length;s++){let d=o;o+=e[s],o>t&&l===e.length&&(l=s),d<t+n&&(i=s);}if(l>i)return {startIndex:0,endIndex:-1,leftOffset:0,rightOffset:0};let a=Math.max(0,l-r),u=Math.min(e.length-1,i+r),m=0;for(let s=0;s<a;s++)m+=e[s];let c=0;for(let s=u+1;s<e.length;s++)c+=e[s];return {startIndex:a,endIndex:u,leftOffset:m,rightOffset:c}}function ke(t,e,n){let r=[],o=[],l=[];for(let a of t){let u=n?.[a.columnId];u==="left"?r.push(a):u==="right"?o.push(a):l.push(a);}if(!e||e.endIndex<0)return {pinnedLeft:r,virtualizedUnpinned:l,pinnedRight:o,leftSpacerWidth:0,rightSpacerWidth:0};let i=l.slice(e.startIndex,e.endIndex+1);return {pinnedLeft:r,virtualizedUnpinned:i,pinnedRight:o,leftSpacerWidth:e.leftOffset,rightSpacerWidth:e.rightOffset}}function _e(t,e,n,r,o=5){if(r<=0||e<=0||n<=0)return {startIndex:0,endIndex:0,offsetTop:0,offsetBottom:0};let l=Math.max(0,Math.floor(t/e)-o),i=Math.min(r-1,Math.ceil((t+n)/e)+o),a=l*e,u=Math.max(0,(r-i-1)*e);return {startIndex:l,endIndex:i,offsetTop:a,offsetBottom:u}}function Le(t,e){return t*e}function Ve(t,e,n,r="start"){let o=t*e;switch(r){case "start":return o;case "center":return Math.max(0,o-(n-e)/2);case "end":return Math.max(0,o-n+e)}}function Ue(){let t=self;t.onmessage=e=>{let n=e.data;if(n.type!=="sort-filter")return;let{requestId:r,values:o,filters:l,sort:i}=n,a=o.length,u=[],m=Object.entries(l);if(m.length===0){u=new Array(a);for(let s=0;s<a;s++)u[s]=s;}else for(let s=0;s<a;s++){let d=true;for(let f=0;f<m.length;f++){let p=Number(m[f][0]),g=m[f][1],I=o[s][p];switch(g.type){case "text":{let C=g.value.trim().toLowerCase();C&&!String(I??"").toLowerCase().includes(C)&&(d=false);break}case "multiSelect":{g.value.length>0&&(new Set(g.value).has(String(I??""))||(d=false));break}case "date":{if(I==null){d=false;break}let C=new Date(String(I)).getTime();if(isNaN(C)){d=false;break}if(g.value.from){let b=new Date(g.value.from+"T00:00:00").getTime();if(C<b){d=false;break}}if(g.value.to){let b=new Date(g.value.to+"T23:59:59.999").getTime();if(C>b){d=false;break}}break}}if(!d)break}d&&u.push(s);}if(i){let{columnIndex:s,direction:d}=i,f=d==="asc"?1:-1;u.sort((p,g)=>{let I=o[p][s],C=o[g][s];if(I==null&&C==null)return 0;if(I==null)return -1*f;if(C==null)return 1*f;if(typeof I=="number"&&typeof C=="number")return I===C?0:I>C?f:-f;let b=String(I).toLowerCase(),y=String(C).toLowerCase();return b===y?0:b>y?f:-f});}let c={type:"sort-filter-result",requestId:r,indices:u};t.postMessage(c);};}var S=null,_t=0,E=new Map;function re(){if(S)return S;if(typeof Worker>"u"||typeof Blob>"u"||typeof URL>"u")return null;try{let t=Ue.toString(),e=new Blob([`(${t})()`],{type:"application/javascript"}),n=URL.createObjectURL(e);return S=new Worker(n),URL.revokeObjectURL(n),S.onmessage=r=>{let{requestId:o,indices:l}=r.data,i=E.get(o);i&&(E.delete(o),i.resolve(l));},S.onerror=r=>{for(let[o,l]of E)l.reject(new Error(r.message||"Worker error")),E.delete(o);},S}catch{return null}}function He(){S&&(S.terminate(),S=null);for(let[t,e]of E)e.reject(new Error("Worker terminated")),E.delete(t);}function oe(t,e){let n=new Array(t.length);for(let r=0;r<t.length;r++){let o=new Array(e.length);for(let l=0;l<e.length;l++){let i=x(t[r],e[l]);i==null?o[l]=null:typeof i=="string"||typeof i=="number"||typeof i=="boolean"?o[l]=i:o[l]=String(i);}n[r]=o;}return n}function Be(t,e,n,r,o){if(r&&e.find(f=>f.columnId===r)?.compare)return Promise.resolve(M(t,e,n,r,o));let l=re();if(!l)return Promise.resolve(M(t,e,n,r,o));let i=new Map;for(let d=0;d<e.length;d++)i.set(e[d].columnId,d);let a=oe(t,e),u=e.map((d,f)=>({type:d.type??"text",index:f})),m={};for(let d of e){let f=w(d),p=n[f];if(!p)continue;let g=i.get(d.columnId);if(g!==void 0)switch(p.type){case "text":m[g]={type:"text",value:p.value};break;case "multiSelect":m[g]={type:"multiSelect",value:p.value};break;case "date":m[g]={type:"date",value:{from:p.value.from,to:p.value.to}};break;case "people":return Promise.resolve(M(t,e,n,r,o))}}let c;if(r){let d=i.get(r);d!==void 0&&(c={columnIndex:d,direction:o??"asc"});}let s=++_t;return new Promise((d,f)=>{E.set(s,{resolve:g=>{let I=new Array(g.length);for(let C=0;C<g.length;C++)I[C]=t[g[C]];d(I);},reject:f});let p={type:"sort-filter",requestId:s,values:a,columnMeta:u,filters:m,sort:c};l.postMessage(p);})}var H="YYYY-MM-DD";function B(t,e,n="UTC"){if(t==null)return null;let r=t instanceof Date?t:new Date(String(t));if(Number.isNaN(r.getTime()))return null;let o,l,i;if(n==="UTC")o=r.getUTCFullYear(),l=r.getUTCMonth()+1,i=r.getUTCDate();else {let s=new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(r);o=parseInt(s.find(d=>d.type==="year")?.value??"0",10),l=parseInt(s.find(d=>d.type==="month")?.value??"0",10),i=parseInt(s.find(d=>d.type==="day")?.value??"0",10);}let a=String(o).padStart(4,"0"),u=String(l).padStart(2,"0"),m=String(i).padStart(2,"0");return e.replace("YYYY",a).replace("MM",u).replace("DD",m)}function Ge(t,e){if(!t||!t.trim())return null;let r=t.trim().split(/[/\-.\s]+/).filter(Boolean);if(r.length===0)return null;let o=new Date().getUTCFullYear(),l=Lt(e),i,a,u;if(r.length===3){let[c,s,d]=r.map(Number);l==="YMD"?(i=c,a=s,u=d):l==="DMY"?(u=c,a=s,i=d):(a=c,u=s,i=d),i!==void 0&&i<100&&(i=i<50?2e3+i:1900+i);}else if(r.length===2){let[c,s]=r.map(Number);l==="DMY"?(u=c,a=s):(a=c,u=s),i=o;}else if(r.length===1){let c=r[0];if(/^\d+$/.test(c))if(c.length===8)i=parseInt(c.slice(0,4),10),a=parseInt(c.slice(4,6),10),u=parseInt(c.slice(6,8),10);else if(c.length===4)a=parseInt(c.slice(0,2),10),u=parseInt(c.slice(2,4),10),i=o;else return null;else return null}else return null;if(!Vt(i,a,u))return null;let m=new Date(Date.UTC(i,a-1,u));return m.getUTCFullYear()!==i||m.getUTCMonth()+1!==a||m.getUTCDate()!==u?null:m}function We(t){return t}function Lt(t){let e=t.indexOf("Y"),n=t.indexOf("M"),r=t.indexOf("D");return e===-1||n===-1||r===-1?"MDY":e<n&&n<r?"YMD":r<n&&n<e?"DMY":"MDY"}function Vt(t,e,n){return !(t==null||e==null||n==null||!Number.isFinite(t)||!Number.isFinite(e)||!Number.isFinite(n)||e<1||e>12||n<1||n>31)}var L=class{constructor(e,n){this.type=e;this.message=n;}toString(){return this.type}};function Xe(t,e){let n=v(t.filterable)?t.filterable:null,r=n?.type??"none",o=n?.filterField??t.columnId,l=t.sortable!==false,i=e.filters[o],a={columnKey:t.columnId,columnName:t.name,filterType:r,isSorted:e.sortBy===t.columnId,isSortedDescending:e.sortBy===t.columnId&&e.sortDirection==="desc",onSort:l?()=>e.onColumnSort(t.columnId):void 0};return r==="text"?{...a,textValue:i?.type==="text"?i.value:"",onTextChange:u=>e.onFilterChange(o,u.trim()?{type:"text",value:u}:void 0)}:r==="people"?{...a,selectedUser:i?.type==="people"?i.value:void 0,onUserChange:u=>e.onFilterChange(o,u?{type:"people",value:u}:void 0),peopleSearch:e.peopleSearch}:r==="multiSelect"?{...a,options:e.filterOptions[o]??[],isLoadingOptions:e.loadingFilterOptions[o]??false,selectedValues:i?.type==="multiSelect"?i.value:[],onFilterChange:u=>e.onFilterChange(o,u.length?{type:"multiSelect",value:u}:void 0)}:r==="date"?{...a,dateValue:i?.type==="date"?i.value:void 0,onDateChange:u=>e.onFilterChange(o,u?{type:"date",value:u}:void 0)}:a}var W=class W{constructor(){this.cache=new Map;this.lastVersion="";}static computeVersion(e){let n=e.editingCell,r=e.activeCell,o=e.selectionRange,l=e.cutRange,i=e.copyRange;return (n?`${String(n.rowId)}\0${n.columnId}`:"")+""+(r?`${r.rowIndex}\0${r.columnIndex}`:"")+""+(o?`${o.startRow}\0${o.startCol}\0${o.endRow}\0${o.endCol}`:"")+""+(l?`${l.startRow}\0${l.startCol}\0${l.endRow}\0${l.endCol}`:"")+""+(i?`${i.startRow}\0${i.startCol}\0${i.endRow}\0${i.endCol}`:"")+""+(e.isDragging?"1":"0")+""+(e.editable!==false?"1":"0")+""+(e.onCellValueChanged?"1":"0")+""+(e.formulaVersion??0)}get(e,n,r,o){let l=e*W.MAX_COL_STRIDE+n,i=this.cache.get(l);if(i!==void 0&&i.version===r)return i.descriptor;let a=o();return this.cache.set(l,{version:r,descriptor:a}),a}updateVersion(e){this.lastVersion=e;}get currentVersion(){return this.lastVersion}clear(){this.cache.clear();}};W.MAX_COL_STRIDE=1024;var G=W;function qe(t,e,n,r,o,l){return l!==void 0?l.get(n,r,l.currentVersion,()=>$e(t,e,n,r,o)):$e(t,e,n,r,o)}function $e(t,e,n,r,o){let l=o.getRowId(t),i=r+o.colOffset,a=h(e,t),u=o.editable!==false&&a&&!!o.onCellValueChanged&&typeof e.cellEditor!="function",m=o.editable!==false&&a&&!!o.onCellValueChanged&&typeof e.cellEditor=="function"&&e.cellEditorPopup!==false,c=u||m,s=o.editingCell?.rowId===l&&o.editingCell?.columnId===e.columnId,d=!o.isDragging&&o.activeCell?.rowIndex===n&&o.activeCell?.columnIndex===i,f=o.selectionRange!=null&&o.selectionRange.startRow===o.selectionRange.endRow&&o.selectionRange.startCol===o.selectionRange.endCol,p=o.selectionRange!=null&&!f&&F(o.selectionRange,n,r),g=o.cutRange!=null&&F(o.cutRange,n,r),I=o.copyRange!=null&&F(o.copyRange,n,r),C=!o.isDragging&&o.copyRange==null&&o.cutRange==null&&o.selectionRange!=null&&n===o.selectionRange.endRow&&r===o.selectionRange.endCol,b=e.pinned!=null,y=e.pinned??void 0,P=x(t,e),A=o.hasFormula?.(r,n)??false,U=A?o.getFormulaValue?.(r,n):void 0,q="display",O;s&&u?(q="editing-inline",e.cellEditor==="text"||e.cellEditor==="select"||e.cellEditor==="checkbox"||e.cellEditor==="richSelect"||e.cellEditor==="date"?O=e.cellEditor:e.type==="date"?O="date":e.type==="boolean"?O="checkbox":O="text"):s&&m&&typeof e.cellEditor=="function"&&(q="editing-popover");let Ot=s&&A?o.getFormula?.(r,n)??P:P;return {mode:q,editorType:O,value:Ot,isActive:d,isInRange:p,isInCutRange:g,isInCopyRange:I,isSelectionEndCell:C,canEditAny:c,isPinned:b,pinnedSide:y,globalColIndex:i,rowId:l,rowIndex:n,displayValue:U!==void 0?U:P,columnType:e.type}}function ze(t,e,n){if(n instanceof L)return n.toString();let r=t;if(r.renderCell&&typeof r.renderCell=="function")return r.renderCell(e);if(t.valueFormatter)return t.valueFormatter(n,e);if(n==null)return null;if(t.type==="date"){let o=t.dateFormat??H,l=B(n,o);if(l!==null)return l}return t.type==="boolean"?n?"True":"False":String(n)}function Ye(t,e,n){let r=t,o=n instanceof L,l=r.cellStyle?typeof r.cellStyle=="function"?r.cellStyle(e):r.cellStyle:void 0;return o?{...l,color:"var(--ogrid-formula-error-color, #d32f2f)"}:l}function je(t,e,n,r){let o=n.editorType??"text";return {value:n.value,item:t,column:e,rowIndex:n.rowIndex,editorType:o,onCommit:l=>r.commitCellEdit(t,e.columnId,n.value,l,n.rowIndex,n.globalColIndex,o==="checkbox"?{skipAdvance:true}:void 0),onCancel:()=>r.setEditingCell(null)}}function Ke(t,e,n,r,o){let l=n.value,i=r!==void 0?r:l,a=r;return {value:i,onValueChange:u=>{a=u,o.setPendingEditorValue(u);},onCommit:()=>{let u=a!==void 0?a:l;o.commitCellEdit(t,e.columnId,l,u,n.rowIndex,n.globalColIndex);},onCancel:o.cancelPopoverEdit,item:t,column:e,cellEditorParams:e.cellEditorParams}}function Ze(t,e){let n=null,r=((...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...o),n=null;},e);});return r.cancel=()=>{n!==null&&(clearTimeout(n),n=null);},r}function Qe(t,e,n){let r=e.startCol+n,o=e.endCol+n,l=t.querySelector(`[data-row-index="${e.startRow}"][data-col-index="${r}"]`),i=t.querySelector(`[data-row-index="${e.endRow}"][data-col-index="${o}"]`);if(!l||!i)return null;let a=t.getBoundingClientRect(),u=l.getBoundingClientRect(),m=i.getBoundingClientRect();return {top:u.top-a.top,left:u.left-a.left,width:m.right-u.left,height:m.bottom-u.top}}function Je(t){let e=new Map;if(!t)return e;let n=t.querySelectorAll("[data-row-index][data-col-index]");for(let r=0;r<n.length;r++){let o=n[r],l=o.getAttribute("data-row-index")??"",i=o.getAttribute("data-col-index")??"";e.set(`${l},${i}`,o);}return e}function et(t,e){if(typeof document>"u"||document.getElementById(t))return;let n=document.createElement("style");n.id=t,n.textContent=e,document.head.appendChild(n);}function tt(t,e,n){return n===null?{field:"",direction:"asc"}:n?{field:e,direction:n}:{field:e,direction:t.field===e&&t.direction==="asc"?"desc":"asc"}}var nt=48,rt=50,le=80,ot=16,lt=30,it="__row_number__",at=6;var ie=16,ae=520;function Ut(t){let e=getComputedStyle(t),n=(parseFloat(e.paddingLeft)||0)+(parseFloat(e.paddingRight)||0),r=(parseFloat(e.borderLeftWidth)||0)+(parseFloat(e.borderRightWidth)||0),o=0;for(let s=0;s<t.children.length;s++){let d=t.children[s],f=d.className||"";if(f.includes("resizeHandle")||f.includes("resize-handle")||f.includes("ogrid-resize-handle")){o=d.offsetWidth;break}}let l=t.firstElementChild;if(!l)return t.offsetWidth;let i=[],a=s=>{for(let d=0;d<s.children.length;d++){let f=s.children[d],p=getComputedStyle(f);(p.overflow==="hidden"||p.flexShrink!=="0")&&(i.push({el:f,overflow:f.style.overflow,flexShrink:f.style.flexShrink,width:f.style.width,minWidth:f.style.minWidth,maxWidth:f.style.maxWidth}),f.style.overflow="visible",f.style.flexShrink="0",f.style.width="max-content",f.style.minWidth="max-content",f.style.maxWidth="none"),a(f);}},u=l.style.position,m=l.style.width;l.style.position="absolute",l.style.width="max-content",a(l);let c=l.offsetWidth;l.style.position=u,l.style.width=m;for(let s of i)s.el.style.overflow=s.overflow,s.el.style.flexShrink=s.flexShrink,s.el.style.width=s.width,s.el.style.minWidth=s.minWidth,s.el.style.maxWidth=s.maxWidth;return c+o+n+r}function st(t,e,n){let r=e??80,l=(n??document).querySelectorAll(`[data-column-id="${t}"]`);if(l.length===0)return r;let i=r,a=[],u=[],m=[];if(l.forEach(c=>{let s=c;if(!!s.querySelector?.("[data-header-label]"))i=Math.max(i,Ut(s));else {let f=s.firstElementChild??s;a.push(f);}}),a.length>0){for(let c=0;c<a.length;c++){let s=a[c];u.push(s.style.position),m.push(s.style.width),s.style.position="absolute",s.style.width="max-content";}for(let c=0;c<a.length;c++)i=Math.max(i,a[c].offsetWidth+ie);for(let c=0;c<a.length;c++)a[c].style.position=u[c],a[c].style.width=m[c];}return Math.min(ae,Math.max(r,Math.ceil(i)))}function N(t,e,n,r){if(t===e)return t;let o=t+n;if(!r(t)&&!r(o)){let i=o;for(;i!==e;){if(r(i+n))return i;i+=n;}return e}let l=o;for(;l!==e;){if(!r(l))return l;l+=n;}return e}function ut(t,e,n,r,o,l){let i=t,a=e;return l?e>o?a=e-1:t>0&&(i=t-1,a=r):e<r?a=e+1:t<n&&(i=t+1,a=o),{rowIndex:i,columnIndex:a}}function dt(t){let{direction:e,rowIndex:n,columnIndex:r,dataColIndex:o,colOffset:l,maxRowIndex:i,maxColIndex:a,visibleColCount:u,isCtrl:m,isShift:c,selectionRange:s,isEmptyAt:d}=t,f=n,p=r;e==="ArrowDown"?f=m?N(n,i,1,b=>d(b,Math.max(0,o))):Math.min(n+1,i):e==="ArrowUp"?f=m?N(n,0,-1,b=>d(b,Math.max(0,o))):Math.max(n-1,0):e==="ArrowRight"?m&&o>=0?p=N(o,u-1,1,b=>d(n,b))+l:p=Math.min(r+1,a):m&&o>=0?p=N(o,0,-1,b=>d(n,b))+l:p=Math.max(r-1,l);let g=p-l,I=e==="ArrowDown"||e==="ArrowUp",C;return c?I?C=R({startRow:s?.startRow??n,startCol:s?.startCol??o,endRow:f,endCol:s?.endCol??o}):C=R({startRow:s?.startRow??n,startCol:s?.startCol??o,endRow:s?.endRow??n,endCol:g}):C={startRow:f,startCol:g,endRow:f,endCol:g},{newRowIndex:f,newColumnIndex:p,newDataColIndex:g,newRange:C}}function ct(t,e,n){let r=R(t),o=[];for(let l=r.startRow;l<=r.endRow;l++)for(let i=r.startCol;i<=r.endCol;i++){if(l>=e.length||i>=n.length)continue;let a=e[l],u=n[i];if(!h(u,a))continue;let m=x(a,u),c=T("",m,a,u);c.valid&&o.push({item:a,columnId:u.columnId,oldValue:m,newValue:c.value,rowIndex:l});}return o}function mt(t,e){return t===e?true:!t||!e?false:t.startRow===e.startRow&&t.endRow===e.endRow&&t.startCol===e.startCol&&t.endCol===e.endCol}function ft(t,e,n){return e<0||n<0?null:{startRow:Math.max(0,Math.min(t.startRow,e)),endRow:Math.max(0,Math.min(t.endRow,e)),startCol:Math.max(0,Math.min(t.startCol,n)),endCol:Math.max(0,Math.min(t.endCol,n))}}function pt(t,e=40,n=2,r=20){let o=Math.min(t/e,1);return n+o*(r-n)}function gt(t,e,n,r,o,l){let i=new Set(l),a=Math.min(t,e),u=Math.max(t,e);for(let m=a;m<=u;m++)if(m<r.length){let c=o(r[m]);n?i.add(c):i.delete(c);}return i}function Ct(t,e,n){if(t.size===0||e.length===0)return {allSelected:false,someSelected:false};let r=t.size>=e.length&&e.every(l=>t.has(n(l))),o=!r&&t.size>0;return {allSelected:r,someSelected:o}}function se(t,e){let n=e!=null&&e!==""?e:t;if(n==null||n==="")return "";try{return String(n).replace(/[\t\n]/g," ")}catch{return "[Object]"}}function It(t,e,n,r){let o=R(n),l=[];for(let i=o.startRow;i<=o.endRow;i++){let a=[];for(let u=o.startCol;u<=o.endCol&&!(i>=t.length||u>=e.length);u++){let m=t[i],c=e[u];if(r?.hasFormula&&r?.getFormula){let p=r.flatColumns.findIndex(g=>g.columnId===c.columnId);if(p>=0&&r.hasFormula(p,i)){let g=r.getFormula(p,i);if(g){a.push(g);continue}}}let s=x(m,c),f=(c.clipboardFormatter?c.clipboardFormatter(s,m):null)??(c.valueFormatter?c.valueFormatter(s,m):s);a.push(se(s,f));}l.push(a.join(" "));}return l.join(`\r
|
|
4
|
+
`)}function bt(t){return t.trim()?t.split(/\r?\n/).filter(n=>n.length>0).map(n=>n.split(" ")):[]}function xt(t,e,n,r,o,l){let i=[];for(let a=0;a<t.length;a++){let u=t[a];for(let m=0;m<u.length;m++){let c=e+a,s=n+m;if(c>=r.length||s>=o.length)continue;let d=r[c],f=o[s];if(!h(f,d))continue;let p=u[m]??"";if(p.startsWith("=")&&l?.setFormula){let C=l.flatColumns.findIndex(b=>b.columnId===f.columnId);if(C>=0){l.setFormula(C,c,p);continue}}let g=x(d,f),I=T(p,g,d,f);I.valid&&i.push({item:d,columnId:f.columnId,oldValue:g,newValue:I.value,rowIndex:c});}}return i}function ht(t,e,n){let r=[];for(let o=t.startRow;o<=t.endRow;o++)for(let l=t.startCol;l<=t.endCol;l++){if(o>=e.length||l>=n.length)continue;let i=e[o],a=n[l];if(!h(a,i))continue;let u=x(i,a),m=T("",u,i,a);m.valid&&r.push({item:i,columnId:a.columnId,oldValue:u,newValue:m.value,rowIndex:o});}return r}function V(t){let e="",n=t;for(;n>=0;)e=String.fromCharCode(n%26+65)+e,n=Math.floor(n/26)-1;return e}function $(t){let e=0,n=t.toUpperCase();for(let r=0;r<n.length;r++)e=e*26+(n.charCodeAt(r)-64);return e-1}function Rt(t,e){return `${V(t)}${e}`}var yt=/(?:'[^']*'!|[A-Za-z_]\w*!)?(\$?)([A-Z]+)(\$?)(\d+)/g;function Tt(t,e,n){return yt.lastIndex=0,t.replace(yt,(r,o,l,i,a)=>{let u=r.indexOf(o+l),m=u>0?r.substring(0,u):"",c=l,s=a;if(o!=="$"){let d=$(l)+e;if(d<0)return "#REF!";c=V(d);}if(i!=="$"){let d=parseInt(a,10)+n;if(d<1)return "#REF!";s=String(d);}return `${m}${o}${c}${i}${s}`})}function ue(t,e){if(t.columnId===e.columnId)return true;let n=t.type??"text",r=e.type??"text";return !(n!==r||t.cellEditor!==e.cellEditor)}function St(t,e,n,r,o,l){let i=[],a=r[t.startRow],u=o[t.startCol];if(!a||!u)return i;let m=x(a,u),c=l?l.flatColumns.findIndex(s=>s.columnId===u.columnId):-1;for(let s=t.startRow;s<=t.endRow;s++)for(let d=t.startCol;d<=t.endCol;d++){if(s===e&&d===n||s>=r.length||d>=o.length)continue;let f=r[s],p=o[d];if(!h(p,f)||!ue(u,p))continue;if(l&&l.hasFormula&&l.getFormula&&l.setFormula&&c>=0&&l.hasFormula(c,e)){let C=l.getFormula(c,e);if(C){let b=s-e,y=d-n,P=Tt(C,y,b),A=l.flatColumns.findIndex(U=>U.columnId===p.columnId);if(A>=0){l.setFormula(A,s,P);continue}}}let g=x(f,p),I=T(m,g,f,p);I.valid&&i.push({item:f,columnId:p.columnId,oldValue:g,newValue:I.value,rowIndex:s});}return i}var X=class{constructor(e=100){this.history=[];this.redoStack=[];this.batch=null;this.maxDepth=e;}get canUndo(){return this.history.length>0}get canRedo(){return this.redoStack.length>0}get historyLength(){return this.history.length}get redoLength(){return this.redoStack.length}get isBatching(){return this.batch!==null}push(e){e.length!==0&&(this.batch!==null?this.batch.push(...e):(this.history.push(e),this.history.length>this.maxDepth&&this.history.splice(0,this.history.length-this.maxDepth),this.redoStack.length=0));}record(e){this.push([e]);}beginBatch(){this.batch===null&&(this.batch=[]);}endBatch(){let e=this.batch;this.batch=null,!(!e||e.length===0)&&(this.history.push(e),this.history.length>this.maxDepth&&this.history.splice(0,this.history.length-this.maxDepth),this.redoStack.length=0);}undo(){let e=this.history.pop();return e?(this.redoStack.push(e),e):null}redo(){let e=this.redoStack.pop();return e?(this.history.push(e),e):null}clear(){this.history=[],this.redoStack=[];}};function wt(t){if(!Array.isArray(t)||t.length===0){console.warn("[OGrid] columns prop is empty or not an array");return}let e=typeof process<"u"&&process.env?.NODE_ENV!=="production",n=new Set;for(let r of t)r.columnId||console.warn("[OGrid] Column missing columnId:",r),n.has(r.columnId)&&console.warn(`[OGrid] Duplicate columnId: "${r.columnId}"`),n.add(r.columnId),e&&r.editable===true&&r.cellEditor==null&&console.warn(`[OGrid] Column "${r.columnId}" has editable=true but no cellEditor defined. Cells will not open an editor on double-click. Set cellEditor to 'text', 'select', 'checkbox', 'date', or a custom component.`);}function Dt(t){typeof process<"u"&&process.env?.NODE_ENV==="production"||t.enabled===true&&(!t.rowHeight||t.rowHeight<=0)&&console.warn("[OGrid] virtualScroll.enabled is true but rowHeight is missing or <= 0. Set a positive rowHeight (e.g. virtualScroll: { enabled: true, rowHeight: 36 }) for correct virtual scrolling behavior.");}function vt(t,e){if(typeof process<"u"&&process.env.NODE_ENV==="production"||!e)return;let n=new Set,r=Math.min(t.length,100);for(let o=0;o<r;o++){let l=e(t[o]);if(l==null){console.warn(`[OGrid] getRowId returned null/undefined for row ${o}`);return}if(n.has(l)){console.warn(`[OGrid] Duplicate row ID "${l}" at index ${o}. getRowId must return unique values.`);return}n.add(l);}}var de=[{minWidth:0,maxPriority:0},{minWidth:576,maxPriority:1},{minWidth:768,maxPriority:2},{minWidth:992,maxPriority:3},{minWidth:1200,maxPriority:1/0}];function ce(t,e,n){let r=n?.breakpoints??de,o=new Set;if(t<=0||e.length===0)return o;let l=1/0;for(let i=r.length-1;i>=0;i--)if(t>=r[i].minWidth){l=r[i].maxPriority;break}if(l===1/0)return o;for(let i of e)i.responsivePriority!=null&&(i.required||i.responsivePriority>l&&o.add(i.columnId));return o}function Et(t){return t===true?{}:t||void 0}function Ft(t,e,n){if(!n||e<=0)return t;let r=ce(e,t,n);return r.size===0?t:t.filter(o=>!r.has(o.columnId))}var Mt=300,Nt=300,Pt=300;var At={RESIZE_HANDLE:1,ACTIVE_CELL:2,FILL_HANDLE:3,SELECTION_OVERLAY:4,ROW_NUMBER:5,CLIPBOARD_OVERLAY:5,PINNED:6,SELECTION_CELL:7,THEAD:8,PINNED_HEADER:10,HEADER_FOCUS:11,SELECTION_HEADER_PINNED:12,LOADING:2,DROP_INDICATOR:100,DROPDOWN:1e3,FILTER_POPOVER:1e3,MODAL:2e3,FULLSCREEN:9999,CONTEXT_MENU:1e4};export{ie as AUTOSIZE_EXTRA_PX,ae as AUTOSIZE_MAX_PX,ot as CELL_PADDING,nt as CHECKBOX_COLUMN_WIDTH,we as COLUMN_HEADER_MENU_ITEMS,G as CellDescriptorCache,H as DEFAULT_DATE_FORMAT,Mt as DEFAULT_DEBOUNCE_MS,le as DEFAULT_MIN_COLUMN_WIDTH,at as GRID_BORDER_RADIUS,ye as GRID_CONTEXT_MENU_ITEMS,Q as MAX_PAGE_BUTTONS,Z as PAGE_SIZE_OPTIONS,Nt as PEOPLE_SEARCH_DEBOUNCE_MS,de as RESPONSIVE_BREAKPOINTS,it as ROW_NUMBER_COLUMN_ID,lt as ROW_NUMBER_COLUMN_MIN_WIDTH,rt as ROW_NUMBER_COLUMN_WIDTH,Pt as SIDEBAR_TRANSITION_MS,X as UndoRedoStack,At as Z_INDEX,ct as applyCellDeletion,ht as applyCutClear,St as applyFillValues,xt as applyPastedValues,gt as applyRangeRowSelection,Ft as applyResponsiveHiding,ue as areFillCompatible,Ne as areGridRowPropsEqual,te as booleanParser,Je as buildCellIndex,z as buildCsvHeader,Y as buildCsvRows,ge as buildHeaderRows,je as buildInlineEditorProps,Ke as buildPopoverEditorProps,Ae as calculateDropTarget,ft as clampSelectionToBounds,$ as columnLetterToIndex,Fe as computeAggregations,dt as computeArrowNavigation,pt as computeAutoScrollSpeed,tt as computeNextSortState,Ct as computeRowSelectionState,ut as computeTabNavigation,Le as computeTotalHeight,Oe as computeVisibleColumnRange,_e as computeVisibleRange,pe as createGridDataAccessor,re as createSortFilterWorker,ve as currencyParser,ee as dateParser,Ze as debounce,Ie as deriveFilterOptionsFromData,Ee as emailParser,k as escapeCsvValue,fe as exportToCsv,oe as extractValueMatrix,N as findCtrlArrowTarget,K as flattenColumns,Rt as formatCellReference,se as formatCellValueForTsv,B as formatDateForDisplay,It as formatSelectionAsTsv,Te as formatShortcut,qe as getCellRenderDescriptor,x as getCellValue,De as getColumnHeaderMenuItems,Se as getContextMenuHandlers,he as getDataGridStatusBarConfig,We as getDateInputPlaceholder,w as getFilterField,Xe as getHeaderFilterConfig,be as getMultiSelectFilterFields,Re as getPaginationViewModel,ne as getPinStateForColumn,ce as getResponsiveHiddenColumns,Ve as getScrollTopForRow,xe as getStatusBarParts,V as indexToColumnLetter,et as injectGlobalStyles,h as isColumnEditable,v as isFilterConfig,F as isInSelectionRange,D as isRowInRange,st as measureColumnContentWidth,Qe as measureRange,Ce as mergeFilter,R as normalizeSelectionRange,J as numberParser,bt as parseTsvClipboard,Ge as parseUserInputDate,T as parseValue,ke as partitionColumnsForVirtualization,M as processClientSideData,Be as processClientSideDataAsync,mt as rangesEqual,Pe as reorderColumnArray,ze as resolveCellDisplayContent,Ye as resolveCellStyle,Et as resolveResponsiveConfig,He as terminateSortFilterWorker,me as toUserLike,j as triggerCsvDownload,wt as validateColumns,vt as validateRowIds,Dt as validateVirtualScrollConfig};
|
|
@@ -11,7 +11,7 @@ export declare const FORMULA_BAR_CSS: {
|
|
|
11
11
|
readonly fxLabel: "padding:2px 8px;font-style:italic;font-weight:600;color:var(--ogrid-muted-fg, #888);user-select:none;border-right:1px solid var(--ogrid-border, #e0e0e0);line-height:24px;font-size:12px;";
|
|
12
12
|
readonly input: "flex:1;border:none;outline:none;padding:2px 8px;font-family:monospace;font-size:12px;line-height:24px;background:transparent;color:var(--ogrid-fg, #242424);min-width:0;";
|
|
13
13
|
};
|
|
14
|
-
/** Style objects for the formula bar
|
|
14
|
+
/** Style objects for the formula bar - used by React and Vue (CSSProperties-compatible). */
|
|
15
15
|
export declare const FORMULA_BAR_STYLES: {
|
|
16
16
|
readonly bar: {
|
|
17
17
|
readonly display: "flex";
|
|
@@ -65,7 +65,7 @@ export declare class DependencyGraph {
|
|
|
65
65
|
* cells or the changed cells themselves).
|
|
66
66
|
* 4. Process queue: for each cell, reduce in-degree of its dependents,
|
|
67
67
|
* add to queue when in-degree reaches 0.
|
|
68
|
-
* 5. If any cells remain unprocessed, they're in a cycle
|
|
68
|
+
* 5. If any cells remain unprocessed, they're in a cycle - append them
|
|
69
69
|
* at the end (engine marks as #CIRC!).
|
|
70
70
|
*/
|
|
71
71
|
private topologicalSort;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* FormulaEngine
|
|
2
|
+
* FormulaEngine - orchestrates parser, evaluator, dependency graph, and formula storage.
|
|
3
3
|
*/
|
|
4
4
|
import type { IFormulaEngineConfig, IRecalcResult, IFormulaFunction, IGridDataAccessor, IAuditEntry, IAuditTrail } from './types';
|
|
5
5
|
export declare class FormulaEngine {
|
|
@@ -68,7 +68,7 @@ export declare class FormulaEngine {
|
|
|
68
68
|
formula: string;
|
|
69
69
|
}>, accessor: IGridDataAccessor): IRecalcResult;
|
|
70
70
|
/**
|
|
71
|
-
* Define a named range (e.g. "Revenue"
|
|
71
|
+
* Define a named range (e.g. "Revenue" to "A1:A10").
|
|
72
72
|
*/
|
|
73
73
|
defineNamedRange(name: string, ref: string): void;
|
|
74
74
|
/**
|
|
@@ -76,7 +76,7 @@ export declare class FormulaEngine {
|
|
|
76
76
|
*/
|
|
77
77
|
removeNamedRange(name: string): void;
|
|
78
78
|
/**
|
|
79
|
-
* Get all named ranges as a Map (name
|
|
79
|
+
* Get all named ranges as a Map (name to ref).
|
|
80
80
|
*/
|
|
81
81
|
getNamedRanges(): ReadonlyMap<string, string>;
|
|
82
82
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Formula system
|
|
2
|
+
* Formula system - barrel export.
|
|
3
3
|
*/
|
|
4
4
|
export type { ICellAddress, ICellRange, CellKey, FormulaErrorType, TokenType, Token, ASTNode, NumberLiteral, StringLiteral, BooleanLiteral, CellRefNode, RangeNode, FunctionCallNode, BinaryOp, BinaryOpNode, UnaryOpNode, ErrorNode, IFormulaContext, IFormulaFunction, IEvaluator, IRecalcResult, IFormulaEngineConfig, IGridDataAccessor, INamedRange, IAuditEntry, IAuditTrail, } from './types';
|
|
5
5
|
export { FormulaError } from './types';
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Recursive descent parser: converts Token[] to an ASTNode.
|
|
3
3
|
*
|
|
4
|
-
* Grammar (precedence low
|
|
5
|
-
* expression
|
|
6
|
-
* comparison
|
|
7
|
-
* concat
|
|
8
|
-
* addition
|
|
9
|
-
* multiplication
|
|
10
|
-
* power
|
|
11
|
-
* unary
|
|
12
|
-
* postfix
|
|
13
|
-
* primary
|
|
4
|
+
* Grammar (precedence low to high):
|
|
5
|
+
* expression to comparison
|
|
6
|
+
* comparison to concat (('>' | '<' | '>=' | '<=' | '=' | '<>') concat)*
|
|
7
|
+
* concat to addition ('&' addition)*
|
|
8
|
+
* addition to multiplication (('+' | '-') multiplication)*
|
|
9
|
+
* multiplication to power (('*' | '/') power)*
|
|
10
|
+
* power to unary ('^' unary)*
|
|
11
|
+
* unary to ('-' | '+') unary | postfix
|
|
12
|
+
* postfix to primary '%'?
|
|
13
|
+
* primary to NUMBER | STRING | BOOLEAN | cellRefOrRange | functionCall
|
|
14
14
|
* | '(' expression ')'
|
|
15
|
-
* cellRefOrRange
|
|
16
|
-
* functionCall
|
|
15
|
+
* cellRefOrRange to CELL_REF (':' CELL_REF)?
|
|
16
|
+
* functionCall to FUNCTION '(' (expression (',' expression)*)? ')'
|
|
17
17
|
*/
|
|
18
18
|
import type { Token, ASTNode } from './types';
|
|
19
19
|
/**
|
|
20
20
|
* Parse an array of tokens into an AST.
|
|
21
|
-
* Never throws
|
|
21
|
+
* Never throws - returns an ErrorNode on parse errors.
|
|
22
22
|
*
|
|
23
23
|
* @param tokens - The token array from the tokenizer.
|
|
24
|
-
* @param namedRanges - Optional map of named ranges (name
|
|
24
|
+
* @param namedRanges - Optional map of named ranges (name to ref string like "A1:B10").
|
|
25
25
|
*/
|
|
26
26
|
export declare function parse(tokens: Token[], namedRanges?: Map<string, string>): ASTNode;
|
|
@@ -108,10 +108,10 @@ export interface IRecalcResult {
|
|
|
108
108
|
export interface IFormulaEngineConfig {
|
|
109
109
|
maxChainLength?: number;
|
|
110
110
|
customFunctions?: Record<string, IFormulaFunction>;
|
|
111
|
-
/** Named ranges: name
|
|
111
|
+
/** Named ranges: name to cell/range reference string (e.g. "A1:B10"). */
|
|
112
112
|
namedRanges?: Record<string, string>;
|
|
113
113
|
}
|
|
114
|
-
/** Grid data accessor
|
|
114
|
+
/** Grid data accessor - bridge between FormulaEngine and the grid's data model. */
|
|
115
115
|
export interface IGridDataAccessor {
|
|
116
116
|
getCellValue(col: number, row: number): unknown;
|
|
117
117
|
getRowCount(): number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ColumnFilterType, IDateFilterValue, IColumnFilterDef, IColumnMeta, IValueParserParams, IColumnDef, ICellValueChangedEvent, ICellEditorProps, CellEditorParams, IColumnGroupDef, HeaderCell, HeaderRow, IColumnDefinition, } from './types';
|
|
1
|
+
export type { ColumnFilterType, IDateFilterValue, IColumnFilterDef, DateFormat, IColumnMeta, IValueParserParams, IColumnDef, ICellValueChangedEvent, ICellEditorProps, CellEditorParams, IColumnGroupDef, HeaderCell, HeaderRow, IColumnDefinition, } from './types';
|
|
2
2
|
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, ISheetDef, IVirtualScrollConfig, IColumnReorderConfig, IOGridApi, } from './types';
|
|
3
3
|
export { toUserLike, isInSelectionRange, normalizeSelectionRange, } from './types';
|
|
4
4
|
export { escapeCsvValue, buildCsvHeader, buildCsvRows, exportToCsv, triggerCsvDownload, } from './utils';
|
|
@@ -38,7 +38,7 @@ export { findCtrlArrowTarget, computeTabNavigation, computeArrowNavigation, appl
|
|
|
38
38
|
export type { ArrowNavigationContext, ArrowNavigationResult } from './utils';
|
|
39
39
|
export { rangesEqual, clampSelectionToBounds, computeAutoScrollSpeed, applyRangeRowSelection, computeRowSelectionState } from './utils';
|
|
40
40
|
export { formatCellValueForTsv, formatSelectionAsTsv, parseTsvClipboard, applyPastedValues, applyCutClear, } from './utils';
|
|
41
|
-
export { applyFillValues } from './utils';
|
|
41
|
+
export { applyFillValues, areFillCompatible } from './utils';
|
|
42
42
|
export type { IFillFormulaOptions } from './utils';
|
|
43
43
|
export { UndoRedoStack } from './utils';
|
|
44
44
|
export { validateColumns, validateRowIds, validateVirtualScrollConfig } from './utils';
|
|
@@ -46,6 +46,7 @@ export { indexToColumnLetter, columnLetterToIndex, formatCellReference } from '.
|
|
|
46
46
|
export type { FormulaReference } from './utils';
|
|
47
47
|
export { getResponsiveHiddenColumns, RESPONSIVE_BREAKPOINTS, resolveResponsiveConfig, applyResponsiveHiding } from './utils';
|
|
48
48
|
export type { IResponsiveColumnsConfig } from './utils';
|
|
49
|
+
export { formatDateForDisplay, parseUserInputDate, getDateInputPlaceholder, DEFAULT_DATE_FORMAT } from './utils';
|
|
49
50
|
export { CHECKBOX_COLUMN_WIDTH, ROW_NUMBER_COLUMN_WIDTH, ROW_NUMBER_COLUMN_MIN_WIDTH, ROW_NUMBER_COLUMN_ID, DEFAULT_MIN_COLUMN_WIDTH, CELL_PADDING, GRID_BORDER_RADIUS, } from './constants';
|
|
50
51
|
export { DEFAULT_DEBOUNCE_MS, PEOPLE_SEARCH_DEBOUNCE_MS, SIDEBAR_TRANSITION_MS, } from './constants';
|
|
51
52
|
export { Z_INDEX } from './constants';
|
|
@@ -11,11 +11,14 @@ export interface IColumnFilterDef {
|
|
|
11
11
|
options?: string[];
|
|
12
12
|
yearsCount?: number;
|
|
13
13
|
}
|
|
14
|
+
export type DateFormat = 'MM/DD/YYYY' | 'DD/MM/YYYY' | 'YYYY-MM-DD' | string;
|
|
14
15
|
export interface IColumnMeta {
|
|
15
16
|
columnId: string;
|
|
16
17
|
name: string;
|
|
17
18
|
/** Column type shorthand. Affects alignment, default editor, filter type, sorting, and display formatting. */
|
|
18
19
|
type?: 'text' | 'numeric' | 'date' | 'boolean';
|
|
20
|
+
/** Display format for date columns. Overrides the grid-level defaultDateFormat. Supported: 'MM/DD/YYYY', 'DD/MM/YYYY', 'YYYY-MM-DD', or a custom pattern. */
|
|
21
|
+
dateFormat?: DateFormat;
|
|
19
22
|
sortable?: boolean;
|
|
20
23
|
/** Omit for not filterable; set to IColumnFilterDef for filterable. */
|
|
21
24
|
filterable?: IColumnFilterDef;
|
|
@@ -61,7 +64,7 @@ export interface IColumnDef<T = unknown> extends IColumnMeta {
|
|
|
61
64
|
/** Whether the cell is editable (per-column or per-row). */
|
|
62
65
|
editable?: boolean | ((item: T) => boolean);
|
|
63
66
|
/** Built-in editor type or framework-specific custom editor (e.g. React component).
|
|
64
|
-
* Core utilities never inspect this value
|
|
67
|
+
* Core utilities never inspect this value - framework packages narrow the type. */
|
|
65
68
|
cellEditor?: unknown;
|
|
66
69
|
/** When true, custom cell editor is rendered in a popover/popper instead of inline. */
|
|
67
70
|
cellEditorPopup?: boolean;
|
|
@@ -94,6 +97,17 @@ export interface CellEditorParams {
|
|
|
94
97
|
values?: unknown[];
|
|
95
98
|
/** Format a value for display in rich select editor. */
|
|
96
99
|
formatValue?: (value: unknown) => string;
|
|
100
|
+
/**
|
|
101
|
+
* Date editor display/input format. Supported: 'MM/DD/YYYY', 'DD/MM/YYYY', 'YYYY-MM-DD'.
|
|
102
|
+
* Defaults to 'YYYY-MM-DD'. Only used when editorType is 'date' or column type is 'date'.
|
|
103
|
+
*/
|
|
104
|
+
dateFormat?: DateFormat;
|
|
105
|
+
/**
|
|
106
|
+
* Type of date editor widget to render.
|
|
107
|
+
* - 'text': plain text input with custom format parsing (default, Excel-style)
|
|
108
|
+
* - 'native': browser native <input type="date"> (always YYYY-MM-DD input)
|
|
109
|
+
*/
|
|
110
|
+
editorType?: 'text' | 'native';
|
|
97
111
|
}
|
|
98
112
|
/** Column group for multi-row header (has children, no columnId for data). */
|
|
99
113
|
export interface IColumnGroupDef<T = unknown> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IDateFilterValue } from './columnTypes';
|
|
2
|
-
/** Row identifier type
|
|
2
|
+
/** Row identifier type - grids accept string or number IDs. */
|
|
3
3
|
export type RowId = string | number;
|
|
4
4
|
export interface UserLike {
|
|
5
5
|
id?: string;
|
|
@@ -150,7 +150,7 @@ export interface IVirtualScrollConfig {
|
|
|
150
150
|
* higher values keep small grids fully rendered (no scroll offset artifacts).
|
|
151
151
|
*/
|
|
152
152
|
threshold?: number;
|
|
153
|
-
/** Enable column virtualization
|
|
153
|
+
/** Enable column virtualization - only render visible columns (default: false). */
|
|
154
154
|
columns?: boolean;
|
|
155
155
|
/** Number of extra columns to render outside the visible area (default: 2). */
|
|
156
156
|
columnOverscan?: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { ColumnFilterType, IDateFilterValue, IColumnFilterDef, IColumnMeta, IValueParserParams, IColumnDef, ICellValueChangedEvent, ICellEditorProps, CellEditorParams, IColumnGroupDef, HeaderCell, HeaderRow, IColumnDefinition, } from './columnTypes';
|
|
1
|
+
export type { ColumnFilterType, IDateFilterValue, IColumnFilterDef, DateFormat, IColumnMeta, IValueParserParams, IColumnDef, ICellValueChangedEvent, ICellEditorProps, CellEditorParams, IColumnGroupDef, HeaderCell, HeaderRow, IColumnDefinition, } from './columnTypes';
|
|
2
2
|
export type { RowId, UserLike, UserLikeInput, FilterValue, IFilters, IFetchParams, IPageResult, IDataSource, IGridColumnState, RowSelectionMode, IRowSelectionChangeEvent, StatusBarPanel, IStatusBarProps, IActiveCell, ISelectionRange, SideBarPanelId, ISideBarDef, ISheetDef, IVirtualScrollConfig, IColumnReorderConfig, IOGridApi, } from './dataGridTypes';
|
|
3
3
|
export { toUserLike, isInSelectionRange, normalizeSelectionRange, } from './dataGridTypes';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure clipboard helpers shared across React, Vue, Angular, and JS.
|
|
3
|
-
* No framework dependencies
|
|
3
|
+
* No framework dependencies - operates on plain values and produces strings.
|
|
4
4
|
*/
|
|
5
5
|
import type { IColumnDef, ICellValueChangedEvent } from '../types/columnTypes';
|
|
6
6
|
import type { ISelectionRange } from '../types/dataGridTypes';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* View model helpers for DataGridTable.
|
|
3
|
-
* Pure TypeScript
|
|
3
|
+
* Pure TypeScript - no framework dependencies (React, Angular, Vue).
|
|
4
4
|
* Framework packages re-export these and may add thin framework-specific wrappers.
|
|
5
5
|
*/
|
|
6
6
|
import type { ColumnFilterType, IDateFilterValue, ICellEditorProps } from '../types/columnTypes';
|
|
@@ -73,7 +73,7 @@ export interface CellRenderDescriptorInput<T> {
|
|
|
73
73
|
getRowId: (item: T) => RowId;
|
|
74
74
|
editable?: boolean;
|
|
75
75
|
onCellValueChanged?: unknown;
|
|
76
|
-
/** True while user is drag-selecting cells
|
|
76
|
+
/** True while user is drag-selecting cells - hides fill handle during drag. */
|
|
77
77
|
isDragging?: boolean;
|
|
78
78
|
/** Get the formula engine's computed value for a cell (colIdx, rowIndex). */
|
|
79
79
|
getFormulaValue?: (col: number, row: number) => unknown;
|
|
@@ -81,7 +81,7 @@ export interface CellRenderDescriptorInput<T> {
|
|
|
81
81
|
hasFormula?: (col: number, row: number) => boolean;
|
|
82
82
|
/** Get the formula string for a cell (e.g. '=SUM(A1:A5)'). Used to populate the editor with the formula instead of the computed value. */
|
|
83
83
|
getFormula?: (col: number, row: number) => string | undefined;
|
|
84
|
-
/** Monotonic counter incremented on each formula recalculation
|
|
84
|
+
/** Monotonic counter incremented on each formula recalculation - used for cache invalidation. */
|
|
85
85
|
formulaVersion?: number;
|
|
86
86
|
}
|
|
87
87
|
export interface CellRenderDescriptor {
|
|
@@ -108,7 +108,7 @@ export interface CellRenderDescriptor {
|
|
|
108
108
|
* Per-grid cache for cell render descriptors.
|
|
109
109
|
*
|
|
110
110
|
* Problem: A 50-column × 100-row grid calls getCellRenderDescriptor 5,000 times per render.
|
|
111
|
-
* Most cells don't change between renders
|
|
111
|
+
* Most cells don't change between renders - only cells in the active row, selection range,
|
|
112
112
|
* or editing row need recomputation. The cache skips recomputation for unchanged cells.
|
|
113
113
|
*
|
|
114
114
|
* Design:
|
|
@@ -137,7 +137,7 @@ export declare class CellDescriptorCache {
|
|
|
137
137
|
/**
|
|
138
138
|
* Compute a version string from the volatile parts of CellRenderDescriptorInput.
|
|
139
139
|
* This string changes whenever any input that affects per-cell output changes.
|
|
140
|
-
* Cheap to compute (simple string concat)
|
|
140
|
+
* Cheap to compute (simple string concat) - O(1) regardless of grid size.
|
|
141
141
|
*/
|
|
142
142
|
static computeVersion<T>(input: CellRenderDescriptorInput<T>): string;
|
|
143
143
|
/**
|
|
@@ -186,7 +186,7 @@ export declare function getCellRenderDescriptor<T>(item: T, col: IColumnDef<T>,
|
|
|
186
186
|
/**
|
|
187
187
|
* Resolves display content for a cell in display mode.
|
|
188
188
|
* Handles the renderCell -> valueFormatter -> String() fallback chain.
|
|
189
|
-
* Returns `unknown`
|
|
189
|
+
* Returns `unknown` - framework packages may narrow to their own node type.
|
|
190
190
|
*/
|
|
191
191
|
export declare function resolveCellDisplayContent<T>(col: IColumnDef<T>, item: T, displayValue: unknown): unknown;
|
|
192
192
|
/**
|
|
@@ -198,14 +198,16 @@ export declare function resolveCellStyle<T>(col: IColumnDef<T>, item: T, display
|
|
|
198
198
|
* Builds props for InlineCellEditor. Shared across all UI packages.
|
|
199
199
|
*/
|
|
200
200
|
export declare function buildInlineEditorProps<T>(item: T, col: IColumnDef<T>, descriptor: CellRenderDescriptor, callbacks: {
|
|
201
|
-
commitCellEdit: (item: T, columnId: string, oldValue: unknown, newValue: unknown, rowIndex: number, globalColIndex: number
|
|
201
|
+
commitCellEdit: (item: T, columnId: string, oldValue: unknown, newValue: unknown, rowIndex: number, globalColIndex: number, options?: {
|
|
202
|
+
skipAdvance?: boolean;
|
|
203
|
+
}) => void;
|
|
202
204
|
setEditingCell: (cell: null) => void;
|
|
203
205
|
}): {
|
|
204
206
|
value: unknown;
|
|
205
207
|
item: T;
|
|
206
208
|
column: IColumnDef<T>;
|
|
207
209
|
rowIndex: number;
|
|
208
|
-
editorType: "
|
|
210
|
+
editorType: "select" | "text" | "date" | "checkbox" | "richSelect";
|
|
209
211
|
onCommit: (newValue: unknown) => void;
|
|
210
212
|
onCancel: () => void;
|
|
211
213
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date formatting utilities for OGrid.
|
|
3
|
+
* Pure TypeScript — no framework dependencies.
|
|
4
|
+
* All operations default to UTC to avoid off-by-one day shifts.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_DATE_FORMAT = "YYYY-MM-DD";
|
|
7
|
+
/**
|
|
8
|
+
* Format a date value for display using the given format string.
|
|
9
|
+
*
|
|
10
|
+
* Supported tokens:
|
|
11
|
+
* YYYY — 4-digit year
|
|
12
|
+
* MM — 2-digit month (01–12)
|
|
13
|
+
* DD — 2-digit day (01–31)
|
|
14
|
+
*
|
|
15
|
+
* Custom separators (/, -, ., space, etc.) are preserved as-is.
|
|
16
|
+
*
|
|
17
|
+
* @param value Raw cell value (ISO string, Date, number, or anything coercible to a date string).
|
|
18
|
+
* @param format Target display format (e.g. 'MM/DD/YYYY').
|
|
19
|
+
* @param timeZone IANA timezone for display. Defaults to 'UTC'.
|
|
20
|
+
* @returns Formatted date string, or null when the value is null/undefined/invalid.
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatDateForDisplay(value: unknown, format: string, timeZone?: string): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Parse a user-typed date string into a UTC Date object.
|
|
25
|
+
*
|
|
26
|
+
* The parser is deliberately forgiving:
|
|
27
|
+
* - Accepts common separators: `/`, `-`, `.`, or whitespace
|
|
28
|
+
* - Accepts partial dates: two parts (M/D or D/M) → implies current UTC year
|
|
29
|
+
* - Accepts condensed 8-digit (YYYYMMDD) or 4-digit (MMDD) numbers
|
|
30
|
+
* - Handles two-digit years (< 50 → 20xx, >= 50 → 19xx)
|
|
31
|
+
* - The `format` hint determines field order (M/D/Y vs D/M/Y vs Y/M/D)
|
|
32
|
+
*
|
|
33
|
+
* @param input The raw string typed by the user.
|
|
34
|
+
* @param format Format hint that indicates expected field order (e.g. 'MM/DD/YYYY').
|
|
35
|
+
* @returns A UTC Date at midnight (00:00:00.000Z), or null for invalid/unparseable input.
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseUserInputDate(input: string, format: string): Date | null;
|
|
38
|
+
/**
|
|
39
|
+
* Returns a placeholder string appropriate for the given date format.
|
|
40
|
+
*
|
|
41
|
+
* For the three standard formats (and any custom format), the format pattern
|
|
42
|
+
* itself is returned so the user knows what to type.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* getDateInputPlaceholder('MM/DD/YYYY') // => 'MM/DD/YYYY'
|
|
46
|
+
* getDateInputPlaceholder('DD/MM/YYYY') // => 'DD/MM/YYYY'
|
|
47
|
+
* getDateInputPlaceholder('YYYY-MM-DD') // => 'YYYY-MM-DD'
|
|
48
|
+
*/
|
|
49
|
+
export declare function getDateInputPlaceholder(format: string): string;
|
|
@@ -36,7 +36,7 @@ export declare function measureRange(container: HTMLElement, range: ISelectionRa
|
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
/**
|
|
39
|
-
* Build a Map of `"rowIndex,colIndex"`
|
|
39
|
+
* Build a Map of `"rowIndex,colIndex"` to HTMLElement for O(1) cell lookups during drag operations.
|
|
40
40
|
* Scans the container once via querySelectorAll instead of per-frame DOM queries.
|
|
41
41
|
*/
|
|
42
42
|
export declare function buildCellIndex(container: HTMLElement | null): Map<string, HTMLElement>;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure fill handle helpers shared across React, Vue, Angular, and JS.
|
|
3
|
-
* No framework dependencies
|
|
3
|
+
* No framework dependencies - operates on plain arrays and column definitions.
|
|
4
4
|
*/
|
|
5
5
|
import type { IColumnDef, ICellValueChangedEvent } from '../types/columnTypes';
|
|
6
6
|
import type { ISelectionRange } from '../types/dataGridTypes';
|
|
7
|
+
/**
|
|
8
|
+
* Check whether two columns are type-compatible for fill operations.
|
|
9
|
+
* Returns true if a value from the source column can be filled into the target column.
|
|
10
|
+
*
|
|
11
|
+
* Columns are compatible when they share the same built-in type AND the same cellEditor.
|
|
12
|
+
* This prevents dragging a text value onto a color picker, or a rating onto a date field.
|
|
13
|
+
* Same-column fills (different rows) always pass because both sides are identical.
|
|
14
|
+
*/
|
|
15
|
+
export declare function areFillCompatible<T>(source: IColumnDef<T>, target: IColumnDef<T>): boolean;
|
|
7
16
|
/**
|
|
8
17
|
* Options for formula-aware fill. When provided, source cells with formulas will
|
|
9
18
|
* have their relative references adjusted instead of copying raw values.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Extracts cell/range references from a formula string for highlighting.
|
|
5
5
|
* Uses the formula tokenizer to parse CELL_REF and range tokens.
|
|
6
6
|
*/
|
|
7
|
-
/** A parsed reference from a formula
|
|
7
|
+
/** A parsed reference from a formula - either a single cell or a range. */
|
|
8
8
|
export interface FormulaReference {
|
|
9
9
|
type: 'cell' | 'range';
|
|
10
10
|
col: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks whether a given row index falls within a selection range.
|
|
3
|
-
* O(1)
|
|
3
|
+
* O(1) - used by React.memo comparators to skip unchanged rows.
|
|
4
4
|
*/
|
|
5
5
|
export declare function isRowInRange(range: {
|
|
6
6
|
startRow: number;
|
|
@@ -35,7 +35,7 @@ export { findCtrlArrowTarget, computeTabNavigation, computeArrowNavigation, appl
|
|
|
35
35
|
export type { ArrowNavigationContext, ArrowNavigationResult } from './keyboardNavigation';
|
|
36
36
|
export { rangesEqual, clampSelectionToBounds, computeAutoScrollSpeed, applyRangeRowSelection, computeRowSelectionState } from './selectionHelpers';
|
|
37
37
|
export { formatCellValueForTsv, formatSelectionAsTsv, parseTsvClipboard, applyPastedValues, applyCutClear, } from './clipboardHelpers';
|
|
38
|
-
export { applyFillValues } from './fillHelpers';
|
|
38
|
+
export { applyFillValues, areFillCompatible } from './fillHelpers';
|
|
39
39
|
export type { IFillFormulaOptions } from './fillHelpers';
|
|
40
40
|
export { UndoRedoStack } from './undoRedoStack';
|
|
41
41
|
export { validateColumns, validateRowIds, validateVirtualScrollConfig } from './validation';
|
|
@@ -44,3 +44,4 @@ export { extractFormulaReferences, processFormulaBarCommit, deriveFormulaBarText
|
|
|
44
44
|
export type { FormulaReference } from './formulaBarHelpers';
|
|
45
45
|
export { getResponsiveHiddenColumns, RESPONSIVE_BREAKPOINTS, resolveResponsiveConfig, applyResponsiveHiding } from './responsiveColumns';
|
|
46
46
|
export type { IResponsiveColumnsConfig } from './responsiveColumns';
|
|
47
|
+
export { formatDateForDisplay, parseUserInputDate, getDateInputPlaceholder, DEFAULT_DATE_FORMAT } from './dateFormatter';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure keyboard navigation helpers shared across React, Vue, Angular, and JS.
|
|
3
|
-
* No framework dependencies
|
|
3
|
+
* No framework dependencies - takes plain values, returns plain values.
|
|
4
4
|
*/
|
|
5
5
|
import type { ISelectionRange } from '../types/dataGridTypes';
|
|
6
6
|
import type { IColumnDef, ICellValueChangedEvent } from '../types/columnTypes';
|
|
7
7
|
/**
|
|
8
8
|
* Excel-style Ctrl+Arrow: find the target position along a 1D axis.
|
|
9
|
-
* - Non-empty current + non-empty next
|
|
10
|
-
* - Otherwise
|
|
9
|
+
* - Non-empty current + non-empty next to scan through non-empties, stop at last before empty/edge.
|
|
10
|
+
* - Otherwise to skip empties, land on next non-empty or edge.
|
|
11
11
|
*
|
|
12
12
|
* @param pos Current position (row or column index).
|
|
13
13
|
* @param edge The boundary position (0 for backward, max for forward).
|
|
@@ -57,7 +57,7 @@ export interface ArrowNavigationResult {
|
|
|
57
57
|
* Computes the next active cell position and selection range for a single arrow key press.
|
|
58
58
|
* Handles Ctrl+Arrow (jump to edge), Shift+Arrow (extend selection), and plain Arrow (move).
|
|
59
59
|
*
|
|
60
|
-
* Pure function
|
|
60
|
+
* Pure function - no framework dependencies.
|
|
61
61
|
*
|
|
62
62
|
* @param ctx Arrow navigation context with current position, direction, modifiers, and grid bounds.
|
|
63
63
|
* @returns The new row/column indices and selection range.
|
|
@@ -68,7 +68,7 @@ export declare function computeArrowNavigation(ctx: ArrowNavigationContext): Arr
|
|
|
68
68
|
* For each editable cell in the range, parses an empty string as the new value
|
|
69
69
|
* and emits a cell value changed event.
|
|
70
70
|
*
|
|
71
|
-
* Pure function
|
|
71
|
+
* Pure function - no framework dependencies.
|
|
72
72
|
*
|
|
73
73
|
* @param range The normalized selection range to clear.
|
|
74
74
|
* @param items Array of all row data objects.
|
|
@@ -6,11 +6,11 @@ import type { IColumnMeta } from '../types/columnTypes';
|
|
|
6
6
|
* wider containers show progressively more columns.
|
|
7
7
|
*
|
|
8
8
|
* Example with default thresholds:
|
|
9
|
-
* container < 576px
|
|
10
|
-
* container < 768px
|
|
11
|
-
* container < 992px
|
|
12
|
-
* container < 1200px
|
|
13
|
-
* container ≥ 1200px
|
|
9
|
+
* container < 576px to show only priority 0
|
|
10
|
+
* container < 768px to show priority 0–1
|
|
11
|
+
* container < 992px to show priority 0–2
|
|
12
|
+
* container < 1200px to show priority 0–3
|
|
13
|
+
* container ≥ 1200px to show all (no limit)
|
|
14
14
|
*/
|
|
15
15
|
export declare const RESPONSIVE_BREAKPOINTS: readonly {
|
|
16
16
|
minWidth: number;
|
|
@@ -36,7 +36,7 @@ export declare function getResponsiveHiddenColumns<T extends IColumnMeta>(contai
|
|
|
36
36
|
/**
|
|
37
37
|
* Normalize the `responsiveColumns` prop value (boolean | config | undefined)
|
|
38
38
|
* into a config object or undefined. Used by all framework packages so they
|
|
39
|
-
* don't each duplicate the `true
|
|
39
|
+
* don't each duplicate the `true to {}` coercion.
|
|
40
40
|
*/
|
|
41
41
|
export declare function resolveResponsiveConfig(value: boolean | IResponsiveColumnsConfig | undefined): IResponsiveColumnsConfig | undefined;
|
|
42
42
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure selection helpers shared across React, Vue, Angular, and JS.
|
|
3
|
-
* No framework dependencies
|
|
3
|
+
* No framework dependencies - operates only on plain ISelectionRange values.
|
|
4
4
|
*/
|
|
5
5
|
import type { ISelectionRange } from '../types/dataGridTypes';
|
|
6
6
|
export { normalizeSelectionRange } from '../types/dataGridTypes';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pure undo/redo stack data structure shared across React, Vue, Angular, and JS.
|
|
3
|
-
* No framework dependencies
|
|
3
|
+
* No framework dependencies - all state is plain arrays.
|
|
4
4
|
*
|
|
5
5
|
* Usage:
|
|
6
6
|
* const stack = new UndoRedoStack<MyEvent>(100);
|
|
@@ -40,12 +40,12 @@ export declare class UndoRedoStack<T> {
|
|
|
40
40
|
*/
|
|
41
41
|
record(event: T): void;
|
|
42
42
|
/**
|
|
43
|
-
* Start a batch
|
|
43
|
+
* Start a batch - subsequent record/push calls accumulate into one undo step.
|
|
44
44
|
* Has no effect if a batch is already open.
|
|
45
45
|
*/
|
|
46
46
|
beginBatch(): void;
|
|
47
47
|
/**
|
|
48
|
-
* End a batch
|
|
48
|
+
* End a batch - commits all accumulated events as one undo step.
|
|
49
49
|
* Has no effect if no batch is open or if the batch is empty.
|
|
50
50
|
*/
|
|
51
51
|
endBatch(): void;
|
|
@@ -65,7 +65,7 @@ export declare class UndoRedoStack<T> {
|
|
|
65
65
|
redo(): T[] | null;
|
|
66
66
|
/**
|
|
67
67
|
* Clear all history and redo state.
|
|
68
|
-
* Does not affect any open batch
|
|
68
|
+
* Does not affect any open batch - call endBatch() first if needed.
|
|
69
69
|
*/
|
|
70
70
|
clear(): void;
|
|
71
71
|
}
|
package/package.json
CHANGED