@alaarab/ogrid-core 2.5.8 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +4 -4
- package/dist/types/index.d.ts +2 -0
- package/dist/types/types/columnTypes.d.ts +4 -0
- package/dist/types/types/groupingTypes.d.ts +18 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/rowGrouping.d.ts +11 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
2
|
-
`)?`"${e.replace(/"/g,'""')}"`:e}function
|
|
3
|
-
`);K(a,r??`export_${new Date().toISOString().slice(0,10)}.csv`);}function K(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 L(t){return "children"in t&&Array.isArray(t.children)}function Z(t){let e=[];for(let n of t)L(n)?e.push(...Z(n.children)):e.push(n);return e}function ge(t,e){function n(m,c){let d=c;for(let s of m)L(s)&&(d=Math.max(d,n(s.children,c+1)));return d}let r=n(t,0);if(r===0){let m=[];for(let c of t)if(!L(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 d=0;for(let s of m)L(s)?d+=a(s.children):(!e||e.has(s.columnId))&&d++;return i.set(m,d),d}function u(m,c){for(let d of m)if(L(d)){let s=a(d.children);if(s===0)continue;l[c].push({label:d.headerName,colSpan:s,isGroup:true,depth:c}),u(d.children,c+1);}else {if(e&&!e.has(d.columnId))continue;l[c].push({label:d.name,colSpan:1,isGroup:false,columnDef:d,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 Q=[10,25,50,100];function Lt(t,e){return e.includes(t)?e:[...e,t].sort((n,r)=>n-r)}var J=5;function Re(t,e,n,r){if(n<=0)return null;let o=r?.maxPageButtons??J,l=Math.ceil(n/e),i,a,u;if(l<=o){i=[];for(let d=1;d<=l;d++)i.push(d);a=false,u=false;}else {let d=Math.max(1,t-2),s=Math.min(l,t+2);s-d+1<o&&(d===1?s=Math.min(l,d+o-1):s===l&&(d=Math.max(1,s-o+1))),i=[];for(let f=d;f<=s;f++)i.push(f);a=d>1,u=s<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:Lt(e,r?.pageSizeOptions??Q)}}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=te({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}if(o==="boolean"){let l=ne({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}if(o==="numeric"){let l=ee({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}return {valid:true,value:t}}function ee(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 te(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 ne(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 d=t[m],s=e[c],f=x(d,s),g=typeof f=="number"?f:Number(f);!isNaN(g)&&isFinite(g)&&(l+=g,g<i&&(i=g),g>a&&(a=g),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],d=w(c),s=n[d];if(s)switch(s.type){case "multiSelect":if(s.value.length>0){let f=new Set(s.value);i.push(g=>f.has(String(x(g,c))));}break;case "text":{let f=s.value.trim();if(f){let g=f.toLowerCase(),p=new Map;for(let I=0;I<t.length;I++)p.set(t[I],String(x(t[I],c)??"").toLowerCase());i.push(I=>(p.get(I)??"").includes(g));}break}case "people":{let f=s.value.email.toLowerCase(),g=new Map;for(let p=0;p<t.length;p++)g.set(t[p],String(x(t[p],c)??"").toLowerCase());i.push(p=>(g.get(p)??"")===f);break}case "date":{let f=s.value,g=f.from?new Date(f.from+"T00:00:00").getTime():NaN,p=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(g)&&b<g||!Number.isNaN(p)&&b>p)});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),d=c?.compare,s=o==="asc"?1:-1;if(c?.type==="date"&&!d){let g=new Map;for(let p=0;p<m.length;p++){let I=m[p],C=c?x(I,c):I[r];if(C==null)g.set(I,NaN);else {let b=new Date(String(C)).getTime();g.set(I,Number.isNaN(b)?0:b);}}m.sort((p,I)=>{let C=g.get(p)??NaN,b=g.get(I)??NaN;return Number.isNaN(C)&&Number.isNaN(b)?0:Number.isNaN(C)?-1*s:Number.isNaN(b)?1*s:C===b?0:C>b?s:-s});}else if(d)m.sort((g,p)=>d(g,p)*s);else {let g=new Map;for(let p=0;p<m.length;p++){let I=m[p],C=c?x(I,c):I[r];C==null?g.set(I,void 0):typeof C=="number"?g.set(I,C):g.set(I,String(C).toLowerCase());}m.sort((p,I)=>{let C=g.get(p),b=g.get(I);return C===void 0&&b===void 0?0:C===void 0?-1*s:b===void 0?1*s:C===b?0:C>b?s:-s});}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 Pe(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 re(t,e){return e?e.left?.includes(t)?"left":e.right?.includes(t)?"right":"unpinned":"unpinned"}function Ne(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(s=>{let f=s.getAttribute("data-column-id");if(!f||re(f,i)!==o)return;let p=s.getBoundingClientRect(),I=n.indexOf(f);I!==-1&&u.push({columnId:f,left:p.left,right:p.right,midX:p.left+p.width/2,orderIndex:I});}),u.length===0)return null;u.sort((s,f)=>s.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 s=u[u.length-1];m=s.orderIndex+1,c=s.right;}else {let s=-1;for(let f=0;f<u.length-1;f++)if(e>=u[f].midX&&e<u[f+1].midX){s=f;break}if(s===-1)return null;m=u[s].orderIndex+1,c=u[s].right;}let d=n.indexOf(r);return d===m||d+1===m?{targetIndex:m,indicatorX:null}:{targetIndex:m,indicatorX:c}}function _e(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 d=0;d<e.length;d++){let s=o;o+=e[d],o>t&&l===e.length&&(l=d),s<t+n&&(i=d);}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 d=0;d<a;d++)m+=e[d];let c=0;for(let d=u+1;d<e.length;d++)c+=e[d];return {startIndex:a,endIndex:u,leftOffset:m,rightOffset:c}}function Oe(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 ke(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 d=0;d<a;d++)u[d]=d;}else for(let d=0;d<a;d++){let s=true;for(let f=0;f<m.length;f++){let g=Number(m[f][0]),p=m[f][1],I=o[d][g];switch(p.type){case "text":{let C=p.value.trim().toLowerCase();C&&!String(I??"").toLowerCase().includes(C)&&(s=false);break}case "multiSelect":{p.value.length>0&&(new Set(p.value).has(String(I??""))||(s=false));break}case "date":{if(I==null){s=false;break}let C=new Date(String(I)).getTime();if(isNaN(C)){s=false;break}if(p.value.from){let b=new Date(p.value.from+"T00:00:00").getTime();if(C<b){s=false;break}}if(p.value.to){let b=new Date(p.value.to+"T23:59:59.999").getTime();if(C>b){s=false;break}}break}}if(!s)break}s&&u.push(d);}if(i){let{columnIndex:d,direction:s}=i,f=s==="asc"?1:-1;u.sort((g,p)=>{let I=o[g][d],C=o[p][d];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,Vt=0,E=new Map;function oe(){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 le(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=oe();if(!l)return Promise.resolve(M(t,e,n,r,o));let i=new Map;for(let s=0;s<e.length;s++)i.set(e[s].columnId,s);let a=le(t,e),u=e.map((s,f)=>({type:s.type??"text",index:f})),m={};for(let s of e){let f=w(s),g=n[f];if(!g)continue;let p=i.get(s.columnId);if(p!==void 0)switch(g.type){case "text":m[p]={type:"text",value:g.value};break;case "multiSelect":m[p]={type:"multiSelect",value:g.value};break;case "date":m[p]={type:"date",value:{from:g.value.from,to:g.value.to}};break;case "people":return Promise.resolve(M(t,e,n,r,o))}}let c;if(r){let s=i.get(r);s!==void 0&&(c={columnIndex:s,direction:o??"asc"});}let d=++Vt;return new Promise((s,f)=>{E.set(d,{resolve:p=>{let I=new Array(p.length);for(let C=0;C<p.length;C++)I[C]=t[p[C]];s(I);},reject:f});let g={type:"sort-filter",requestId:d,values:a,columnMeta:u,filters:m,sort:c};l.postMessage(g);})}var B="YYYY-MM-DD";function G(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 d=new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(r);o=parseInt(d.find(s=>s.type==="year")?.value??"0",10),l=parseInt(d.find(s=>s.type==="month")?.value??"0",10),i=parseInt(d.find(s=>s.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=Ut(e),i,a,u;if(r.length===3){let[c,d,s]=r.map(Number);l==="YMD"?(i=c,a=d,u=s):l==="DMY"?(u=c,a=d,i=s):(a=c,u=d,i=s),i!==void 0&&i<100&&(i=i<50?2e3+i:1900+i);}else if(r.length===2){let[c,d]=r.map(Number);l==="DMY"?(u=c,a=d):(a=c,u=d),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(!Ht(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 Ut(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 Ht(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 V=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 $=class ${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*$.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();}};$.MAX_COL_STRIDE=1024;var 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,d=o.editingCell?.rowId===l&&o.editingCell?.columnId===e.columnId,s=!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,g=o.selectionRange!=null&&!f&&F(o.selectionRange,n,r),p=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,N=x(t,e),H=o.hasFormula?.(r,n)??false,A=H?o.getFormulaValue?.(r,n):void 0,_="display",O;d&&u?(_="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"):d&&m&&typeof e.cellEditor=="function"&&(_="editing-popover");let kt=d&&H?o.getFormula?.(r,n)??N:N;return {mode:_,editorType:O,value:kt,isActive:s,isInRange:g,isInCutRange:p,isInCopyRange:I,isSelectionEndCell:C,canEditAny:c,isPinned:b,pinnedSide:y,globalColIndex:i,rowId:l,rowIndex:n,displayValue:A!==void 0?A:N,columnType:e.type}}function ze(t,e,n){if(n instanceof V)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??B,l=G(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 V,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,X=80,ot=16,lt=30,it="__row_number__",at=6;var ie=16,ae=520,Bt=44,Gt=8;function st(t){return Math.max(80,Math.ceil(t.length*Gt+Bt))}function Wt(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 d=0;d<t.children.length;d++){let s=t.children[d],f=s.className||"";if(f.includes("resizeHandle")||f.includes("resize-handle")||f.includes("ogrid-resize-handle")){o=s.offsetWidth;break}}let l=t.firstElementChild;if(!l)return t.offsetWidth;let i=[],a=d=>{for(let s=0;s<d.children.length;s++){let f=d.children[s],g=getComputedStyle(f);(g.overflow==="hidden"||g.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 d of i)d.el.style.overflow=d.overflow,d.el.style.flexShrink=d.flexShrink,d.el.style.width=d.width,d.el.style.minWidth=d.minWidth,d.el.style.maxWidth=d.maxWidth;return c+o+n+r}function ut(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 d=c;if(!!d.querySelector?.("[data-header-label]"))i=Math.max(i,Wt(d));else {let f=d.firstElementChild??d;a.push(f);}}),a.length>0){for(let c=0;c<a.length;c++){let d=a[c];u.push(d.style.position),m.push(d.style.width),d.style.position="absolute",d.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 P(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 dt(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 ct(t){let{direction:e,rowIndex:n,columnIndex:r,dataColIndex:o,colOffset:l,maxRowIndex:i,maxColIndex:a,visibleColCount:u,isCtrl:m,isShift:c,selectionRange:d,isEmptyAt:s}=t,f=n,g=r;e==="ArrowDown"?f=m?P(n,i,1,b=>s(b,Math.max(0,o))):Math.min(n+1,i):e==="ArrowUp"?f=m?P(n,0,-1,b=>s(b,Math.max(0,o))):Math.max(n-1,0):e==="ArrowRight"?m&&o>=0?g=P(o,u-1,1,b=>s(n,b))+l:g=Math.min(r+1,a):m&&o>=0?g=P(o,0,-1,b=>s(n,b))+l:g=Math.max(r-1,l);let p=g-l,I=e==="ArrowDown"||e==="ArrowUp",C;return c?I?C=R({startRow:d?.startRow??n,startCol:d?.startCol??o,endRow:f,endCol:d?.endCol??o}):C=R({startRow:d?.startRow??n,startCol:d?.startCol??o,endRow:d?.endRow??n,endCol:p}):C={startRow:f,startCol:p,endRow:f,endCol:p},{newRowIndex:f,newColumnIndex:g,newDataColIndex:p,newRange:C}}function mt(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 ft(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 pt(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 gt(t,e=40,n=2,r=20){let o=Math.min(t/e,1);return n+o*(r-n)}function Ct(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 It(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 bt(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 g=r.flatColumns.findIndex(p=>p.columnId===c.columnId);if(g>=0&&r.hasFormula(g,i)){let p=r.getFormula(g,i);if(p){a.push(p);continue}}}let d=x(m,c),f=(c.clipboardFormatter?c.clipboardFormatter(d,m):null)??(c.valueFormatter?c.valueFormatter(d,m):d);a.push(se(d,f));}l.push(a.join(" "));}return l.join(`\r
|
|
4
|
-
`)}function
|
|
1
|
+
function fe(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 O(t){if(t==null)return "";let e=String(t);return e.includes(",")||e.includes('"')||e.includes(`
|
|
2
|
+
`)?`"${e.replace(/"/g,'""')}"`:e}function j(t){return t.map(e=>O(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 s=r.columnIdToIndex.get(i.columnId);if(s!==void 0&&r.hasFormula(s,l)){let d=r.getFormula(s,l);if(d)return O(d)}}return O(n(o,i.columnId))}).join(","))}function pe(t,e,n,r,o){let l=j(e),i=Y(t,e,n,o),s=[l,...i].join(`
|
|
3
|
+
`);K(s,r??`export_${new Date().toISOString().slice(0,10)}.csv`);}function K(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 ge(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 V(t){return "children"in t&&Array.isArray(t.children)}function Z(t){let e=[];for(let n of t)V(n)?e.push(...Z(n.children)):e.push(n);return e}function Ce(t,e){function n(m,c){let a=c;for(let u of m)V(u)&&(a=Math.max(a,n(u.children,c+1)));return a}let r=n(t,0);if(r===0){let m=[];for(let c of t)if(!V(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 s(m){let c=i.get(m);if(c!==void 0)return c;let a=0;for(let u of m)V(u)?a+=s(u.children):(!e||e.has(u.columnId))&&a++;return i.set(m,a),a}function d(m,c){for(let a of m)if(V(a)){let u=s(a.children);if(u===0)continue;l[c].push({label:a.headerName,colSpan:u,isGroup:true,depth:c}),d(a.children,c+1);}else {if(e&&!e.has(a.columnId))continue;l[c].push({label:a.name,colSpan:1,isGroup:false,columnDef:a,depth:c});}}return d(t,0),l.filter(m=>m.length>0)}function v(t){return t!=null&&typeof t=="object"&&"type"in t}function S(t){return (v(t.filterable)?t.filterable:null)?.filterField??t.columnId}function Ie(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 be(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:S(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 s=0;s<n.length;s++){let d=x(i,n[s].col),m=r.get(n[s].field);d!=null&&d!==""&&m&&m.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 xe(t){let e=[];for(let n of t)(v(n.filterable)?n.filterable:null)?.type==="multiSelect"&&e.push(S(n));return e}function he(t){let{totalCount:e,filteredCount:n,selectedCount:r,selectedCellCount:o,aggregation:l,suppressRowCount:i}=t,s=[];return i||s.push({key:"total",label:"Rows:",value:e}),n!==void 0&&n!==e&&s.push({key:"filtered",label:"Filtered:",value:n}),r!==void 0&&r>0&&s.push({key:"selected",label:"Selected:",value:r}),o!==void 0&&o>1&&s.push({key:"cells",label:"Cells:",value:o}),l&&(s.push({key:"sum",label:"Sum:",value:l.sum}),s.push({key:"avg",label:"Avg:",value:Math.round(l.avg*100)/100}),s.push({key:"min",label:"Min:",value:l.min}),s.push({key:"max",label:"Max:",value:l.max}),s.push({key:"count",label:"Count:",value:l.count})),s}function Re(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 Q=[10,25,50,100];function Bt(t,e){return e.includes(t)?e:[...e,t].sort((n,r)=>n-r)}var J=5;function ye(t,e,n,r){if(n<=0)return null;let o=r?.maxPageButtons??J,l=Math.ceil(n/e),i,s,d;if(l<=o){i=[];for(let a=1;a<=l;a++)i.push(a);s=false,d=false;}else {let a=Math.max(1,t-2),u=Math.min(l,t+2);u-a+1<o&&(a===1?u=Math.min(l,a+o-1):u===l&&(a=Math.max(1,u-o+1))),i=[];for(let f=a;f<=u;f++)i.push(f);s=a>1,d=u<l;}let m=Math.max(1,(t-1)*e+1),c=Math.min(t*e,n);return {totalPages:l,pageNumbers:i,showStartEllipsis:s,showEndEllipsis:d,startItem:m,endItem:c,pageSizeOptions:Bt(e,r?.pageSizeOptions??Q)}}var Te=[{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 we(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:s}=t;return {undo:()=>{l(),s();},redo:()=>{i(),s();},copy:()=>{e(),s();},cut:()=>{n(),s();},paste:()=>{r(),s();},selectAll:()=>{o(),s();}}}var De=[{id:"pinLeft",label:"Pin left"},{id:"pinRight",label:"Pin right"},{id:"unpin",label:"Unpin"}];function ve(t){let{canPinLeft:e,canPinRight:n,canUnpin:r,currentSort:o,isSortable:l=true,isResizable:i=true}=t,s=[];if(s.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)s.push({id:"sortAsc",label:"Sort ascending"},{id:"sortDesc",label:"Sort descending",divider:i});else {let d=o==="asc"?"desc":"asc",m=o==="asc"?"Sort descending":"Sort ascending";s.push({id:`sort${d==="asc"?"Asc":"Desc"}`,label:m},{id:"clearSort",label:"Clear sort",divider:i});}return i&&s.push({id:"autosizeThis",label:"Autosize this column"},{id:"autosizeAll",label:"Autosize all columns"}),s}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 s=l.find(d=>String(d).toLowerCase()===i.toLowerCase());return s!==void 0?{valid:true,value:s}:{valid:false,value:void 0}}let o=r.type;if(o==="date"){let l=te({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}if(o==="boolean"){let l=ne({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}if(o==="numeric"){let l=ee({newValue:t});return l===void 0?{valid:false,value:void 0}:{valid:true,value:l}}return {valid:true,value:t}}function ee(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 Ee(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 te(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 Fe(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 ne(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 Me(t,e,n){if(!n)return null;let r=R(n),o=0,l=0,i=1/0,s=-1/0,d=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 a=t[m],u=e[c],f=x(a,u),p=typeof f=="number"?f:Number(f);!isNaN(p)&&isFinite(p)&&(l+=p,p<i&&(i=p),p>s&&(s=p),d++);}return o<2||d===0?null:{sum:l,avg:l/d,min:i,max:s,count:d}}var Pe=new WeakMap;function M(t,e,n,r,o){let l=Pe.get(e);if(!l){l=new Map;for(let m=0;m<e.length;m++)l.set(e[m].columnId,e[m]);Pe.set(e,l);}let i=[];for(let m=0;m<e.length;m++){let c=e[m],a=S(c),u=n[a];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,c))));}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],c)??"").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],c)??"").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],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 s=i.length>0,d=s?t.filter(m=>{for(let c=0;c<i.length;c++)if(!i[c](m))return false;return true}):t;if(r){let m=s?d:d.slice(),c=l.get(r),a=c?.compare,u=o==="asc"?1:-1;if(c?.type==="date"&&!a){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*u:Number.isNaN(b)?1*u:C===b?0:C>b?u:-u});}else if(a)m.sort((p,g)=>a(p,g)*u);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*u:b===void 0?1*u:C===b?0:C>b?u:-u});}return m}return d}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 s=t.selectionRange?.endRow===n,d=e.selectionRange?.endRow===n;return !(s!==d||(s||d)&&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 re(t,e){return e?e.left?.includes(t)?"left":e.right?.includes(t)?"right":"unpinned":"unpinned"}function Ae(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 _e(t){let{mouseX:e,columnOrder:n,draggedColumnId:r,draggedPinState:o,tableElement:l,pinnedColumns:i}=t,s=l.querySelectorAll("[data-column-id]");if(s.length===0)return null;let d=[];if(s.forEach(u=>{let f=u.getAttribute("data-column-id");if(!f||re(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 m,c;if(e<=d[0].midX)m=d[0].orderIndex,c=d[0].left;else if(e>=d[d.length-1].midX){let u=d[d.length-1];m=u.orderIndex+1,c=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;m=d[u].orderIndex+1,c=d[u].right;}let a=n.indexOf(r);return a===m||a+1===m?{targetIndex:m,indicatorX:null}:{targetIndex:m,indicatorX:c}}function ke(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 a=0;a<e.length;a++){let u=o;o+=e[a],o>t&&l===e.length&&(l=a),u<t+n&&(i=a);}if(l>i)return {startIndex:0,endIndex:-1,leftOffset:0,rightOffset:0};let s=Math.max(0,l-r),d=Math.min(e.length-1,i+r),m=0;for(let a=0;a<s;a++)m+=e[a];let c=0;for(let a=d+1;a<e.length;a++)c+=e[a];return {startIndex:s,endIndex:d,leftOffset:m,rightOffset:c}}function Oe(t,e,n){let r=[],o=[],l=[];for(let s of t){let d=n?.[s.columnId];d==="left"?r.push(s):d==="right"?o.push(s):l.push(s);}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 Ve(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),s=l*e,d=Math.max(0,(r-i-1)*e);return {startIndex:l,endIndex:i,offsetTop:s,offsetBottom:d}}function Le(t,e){return t*e}function Ue(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 He(){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,s=o.length,d=[],m=Object.entries(l);if(m.length===0){d=new Array(s);for(let a=0;a<s;a++)d[a]=a;}else for(let a=0;a<s;a++){let u=true;for(let f=0;f<m.length;f++){let p=Number(m[f][0]),g=m[f][1],I=o[a][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(a);}if(i){let{columnIndex:a,direction:u}=i,f=u==="asc"?1:-1;d.sort((p,g)=>{let I=o[p][a],C=o[g][a];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:d};t.postMessage(c);};}var w=null,Wt=0,E=new Map;function oe(){if(w)return w;if(typeof Worker>"u"||typeof Blob>"u"||typeof URL>"u")return null;try{let t=He.toString(),e=new Blob([`(${t})()`],{type:"application/javascript"}),n=URL.createObjectURL(e);return w=new Worker(n),URL.revokeObjectURL(n),w.onmessage=r=>{let{requestId:o,indices:l}=r.data,i=E.get(o);i&&(E.delete(o),i.resolve(l));},w.onerror=r=>{for(let[o,l]of E)l.reject(new Error(r.message||"Worker error")),E.delete(o);},w}catch{return null}}function Ge(){w&&(w.terminate(),w=null);for(let[t,e]of E)e.reject(new Error("Worker terminated")),E.delete(t);}function le(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=oe();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 s=le(t,e),d=e.map((u,f)=>({type:u.type??"text",index:f})),m={};for(let u of e){let f=S(u),p=n[f];if(!p)continue;let g=i.get(u.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 u=i.get(r);u!==void 0&&(c={columnIndex:u,direction:o??"asc"});}let a=++Wt;return new Promise((u,f)=>{E.set(a,{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:a,values:s,columnMeta:d,filters:m,sort:c};l.postMessage(p);})}var G="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 a=new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(r);o=parseInt(a.find(u=>u.type==="year")?.value??"0",10),l=parseInt(a.find(u=>u.type==="month")?.value??"0",10),i=parseInt(a.find(u=>u.type==="day")?.value??"0",10);}let s=String(o).padStart(4,"0"),d=String(l).padStart(2,"0"),m=String(i).padStart(2,"0");return e.replace("YYYY",s).replace("MM",d).replace("DD",m)}function We(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=$t(e),i,s,d;if(r.length===3){let[c,a,u]=r.map(Number);l==="YMD"?(i=c,s=a,d=u):l==="DMY"?(d=c,s=a,i=u):(s=c,d=a,i=u),i!==void 0&&i<100&&(i=i<50?2e3+i:1900+i);}else if(r.length===2){let[c,a]=r.map(Number);l==="DMY"?(d=c,s=a):(s=c,d=a),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),s=parseInt(c.slice(4,6),10),d=parseInt(c.slice(6,8),10);else if(c.length===4)s=parseInt(c.slice(0,2),10),d=parseInt(c.slice(2,4),10),i=o;else return null;else return null}else return null;if(!Xt(i,s,d))return null;let m=new Date(Date.UTC(i,s-1,d));return m.getUTCFullYear()!==i||m.getUTCMonth()+1!==s||m.getUTCDate()!==d?null:m}function $e(t){return t}function $t(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 Xt(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 qe(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],s={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"?{...s,textValue:i?.type==="text"?i.value:"",onTextChange:d=>e.onFilterChange(o,d.trim()?{type:"text",value:d}:void 0)}:r==="people"?{...s,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"?{...s,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"?{...s,dateValue:i?.type==="date"?i.value:void 0,onDateChange:d=>e.onFilterChange(o,d?{type:"date",value:d}:void 0)}:s}var $=class ${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*$.MAX_COL_STRIDE+n,i=this.cache.get(l);if(i!==void 0&&i.version===r)return i.descriptor;let s=o();return this.cache.set(l,{version:r,descriptor:s}),s}updateVersion(e){this.lastVersion=e;}get currentVersion(){return this.lastVersion}clear(){this.cache.clear();}};$.MAX_COL_STRIDE=1024;var W=$;function ze(t,e,n,r,o,l){return l!==void 0?l.get(n,r,l.currentVersion,()=>Xe(t,e,n,r,o)):Xe(t,e,n,r,o)}function Xe(t,e,n,r,o){let l=o.getRowId(t),i=r+o.colOffset,s=h(e,t),d=o.editable!==false&&s&&!!o.onCellValueChanged&&typeof e.cellEditor!="function",m=o.editable!==false&&s&&!!o.onCellValueChanged&&typeof e.cellEditor=="function"&&e.cellEditorPopup!==false,c=d||m,a=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,N=x(t,e),H=o.hasFormula?.(r,n)??false,A=H?o.getFormulaValue?.(r,n):void 0,_="display",k;a&&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"):a&&m&&typeof e.cellEditor=="function"&&(_="editing-popover");let Gt=a&&H?o.getFormula?.(r,n)??N:N;return {mode:_,editorType:k,value:Gt,isActive:u,isInRange:p,isInCutRange:g,isInCopyRange:I,isSelectionEndCell:C,canEditAny:c,isPinned:b,pinnedSide:y,globalColIndex:i,rowId:l,rowIndex:n,displayValue:A!==void 0?A:N,columnType:e.type}}function je(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??G,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 Ke(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 Ze(t,e,n,r,o){let l=n.value,i=r!==void 0?r:l,s=r;return {value:i,onValueChange:d=>{s=d,o.setPendingEditorValue(d);},onCommit:()=>{let d=s!==void 0?s:l;o.commitCellEdit(t,e.columnId,l,d,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 Je(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 s=t.getBoundingClientRect(),d=l.getBoundingClientRect(),m=i.getBoundingClientRect();return {top:d.top-s.top,left:d.left-s.left,width:m.right-d.left,height:m.bottom-d.top}}function et(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 tt(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 nt(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 rt=48,ot=50,X=80,lt=16,it=30,st="__row_number__",at=6;var ie=16,se=520,qt=44,zt=8;function ut(t){return Math.max(80,Math.ceil(t.length*zt+qt))}function jt(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 a=0;a<t.children.length;a++){let u=t.children[a],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=[],s=a=>{for(let u=0;u<a.children.length;u++){let f=a.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"),s(f);}},d=l.style.position,m=l.style.width;l.style.position="absolute",l.style.width="max-content",s(l);let c=l.offsetWidth;l.style.position=d,l.style.width=m;for(let a of i)a.el.style.overflow=a.overflow,a.el.style.flexShrink=a.flexShrink,a.el.style.width=a.width,a.el.style.minWidth=a.minWidth,a.el.style.maxWidth=a.maxWidth;return c+o+n+r}function dt(t,e,n){let r=e??80,l=(n??document).querySelectorAll(`[data-column-id="${t}"]`);if(l.length===0)return r;let i=r,s=[],d=[],m=[];if(l.forEach(c=>{let a=c;if(!!a.querySelector?.("[data-header-label]"))i=Math.max(i,jt(a));else {let f=a.firstElementChild??a;s.push(f);}}),s.length>0){for(let c=0;c<s.length;c++){let a=s[c];d.push(a.style.position),m.push(a.style.width),a.style.position="absolute",a.style.width="max-content";}for(let c=0;c<s.length;c++)i=Math.max(i,s[c].offsetWidth+ie);for(let c=0;c<s.length;c++)s[c].style.position=d[c],s[c].style.width=m[c];}return Math.min(se,Math.max(r,Math.ceil(i)))}function P(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 ct(t,e,n,r,o,l){let i=t,s=e;return l?e>o?s=e-1:t>0&&(i=t-1,s=r):e<r?s=e+1:t<n&&(i=t+1,s=o),{rowIndex:i,columnIndex:s}}function mt(t){let{direction:e,rowIndex:n,columnIndex:r,dataColIndex:o,colOffset:l,maxRowIndex:i,maxColIndex:s,visibleColCount:d,isCtrl:m,isShift:c,selectionRange:a,isEmptyAt:u}=t,f=n,p=r;e==="ArrowDown"?f=m?P(n,i,1,b=>u(b,Math.max(0,o))):Math.min(n+1,i):e==="ArrowUp"?f=m?P(n,0,-1,b=>u(b,Math.max(0,o))):Math.max(n-1,0):e==="ArrowRight"?m&&o>=0?p=P(o,d-1,1,b=>u(n,b))+l:p=Math.min(r+1,s):m&&o>=0?p=P(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 c?I?C=R({startRow:a?.startRow??n,startCol:a?.startCol??o,endRow:f,endCol:a?.endCol??o}):C=R({startRow:a?.startRow??n,startCol:a?.startCol??o,endRow:a?.endRow??n,endCol:g}):C={startRow:f,startCol:g,endRow:f,endCol:g},{newRowIndex:f,newColumnIndex:p,newDataColIndex:g,newRange:C}}function ft(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 s=e[l],d=n[i];if(!h(d,s))continue;let m=x(s,d),c=T("",m,s,d);c.valid&&o.push({item:s,columnId:d.columnId,oldValue:m,newValue:c.value,rowIndex:l});}return o}function pt(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 gt(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 Ct(t,e=40,n=2,r=20){let o=Math.min(t/e,1);return n+o*(r-n)}function It(t,e,n,r,o,l){let i=new Set(l),s=Math.min(t,e),d=Math.max(t,e);for(let m=s;m<=d;m++)if(m<r.length){let c=o(r[m]);n?i.add(c):i.delete(c);}return i}function bt(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 ae(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 xt(t,e,n,r){let o=R(n),l=[];for(let i=o.startRow;i<=o.endRow;i++){let s=[];for(let d=o.startCol;d<=o.endCol&&!(i>=t.length||d>=e.length);d++){let m=t[i],c=e[d];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){s.push(g);continue}}}let a=x(m,c),f=(c.clipboardFormatter?c.clipboardFormatter(a,m):null)??(c.valueFormatter?c.valueFormatter(a,m):a);s.push(ae(a,f));}l.push(s.join(" "));}return l.join(`\r
|
|
4
|
+
`)}function ht(t){return t.trim()?t.split(/\r?\n/).filter(n=>n.length>0).map(n=>n.split(" ")):[]}function Rt(t,e,n,r,o,l){let i=[];for(let s=0;s<t.length;s++){let d=t[s];for(let m=0;m<d.length;m++){let c=e+s,a=n+m;if(c>=r.length||a>=o.length)continue;let u=r[c],f=o[a];if(!h(f,u))continue;let p=d[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(u,f),I=T(p,g,u,f);I.valid&&i.push({item:u,columnId:f.columnId,oldValue:g,newValue:I.value,rowIndex:c});}}return i}function yt(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],s=n[l];if(!h(s,i))continue;let d=x(i,s),m=T("",d,i,s);m.valid&&r.push({item:i,columnId:s.columnId,oldValue:d,newValue:m.value,rowIndex:o});}return r}function U(t){let e="",n=t;for(;n>=0;)e=String.fromCharCode(n%26+65)+e,n=Math.floor(n/26)-1;return e}function q(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 Tt(t,e){return `${U(t)}${e}`}var wt=/(?:'[^']*'!|[A-Za-z_]\w*!)?(\$?)([A-Z]+)(\$?)(\d+)/g;function St(t,e,n){return wt.lastIndex=0,t.replace(wt,(r,o,l,i,s)=>{let d=r.indexOf(o+l),m=d>0?r.substring(0,d):"",c=l,a=s;if(o!=="$"){let u=q(l)+e;if(u<0)return "#REF!";c=U(u);}if(i!=="$"){let u=parseInt(s,10)+n;if(u<1)return "#REF!";a=String(u);}return `${m}${o}${c}${i}${a}`})}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 Dt(t,e,n,r,o,l){let i=[],s=r[t.startRow],d=o[t.startCol];if(!s||!d)return i;let m=x(s,d),c=l?l.flatColumns.findIndex(u=>u.columnId===d.columnId):-1,a=new Set;for(let u=t.startCol;u<=t.endCol;u++)u<o.length&&ue(d,o[u])&&a.add(u);for(let u=t.startRow;u<=t.endRow;u++)for(let f=t.startCol;f<=t.endCol;f++){if(u===e&&f===n||u>=r.length||!a.has(f))continue;let p=r[u],g=o[f];if(!h(g,p))continue;if(l&&l.hasFormula&&l.getFormula&&l.setFormula&&c>=0&&l.hasFormula(c,e)){let b=l.getFormula(c,e);if(b){let y=u-e,N=f-n,H=St(b,N,y),A=l.flatColumns.findIndex(_=>_.columnId===g.columnId);if(A>=0){l.setFormula(A,u,H);continue}}}let I=x(p,g),C=T(m,I,p,g);C.valid&&i.push({item:p,columnId:g.columnId,oldValue:I,newValue:C.value,rowIndex:u});}return i}var z=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 vt(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 Et(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 Ft(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 Mt(t){return t===true?{}:t||void 0}function Pt(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))}function Nt(t,e,n,r,o){t.stopPropagation();let l=n-r;o.setActiveCell({rowIndex:e,columnIndex:n}),o.setSelectionRange({startRow:e,startCol:l,endRow:e,endCol:l});}function At(t){return t!==null&&typeof t=="object"&&"__ogridGroupHeader"in t&&t.__ogridGroupHeader===true}function me(t,e){return `${t}::${String(e??"")}`}function Yt(t,e,n){return t==null||t===""?"(blank)":e?.valueFormatter?e.valueFormatter(t,n):String(t)}function _t(t,e,n,r,o){if(n.length===0||t.length===0)return [];let l=n[0],i=n.slice(1),s=e.find(c=>c.columnId===l),d=new Map,m=[];for(let c of t){let a=s?x(c,s):c[l],u=me(l,a),f=o?`${o}>${u}`:u,p=d.get(f);p||(p={value:a,rows:[]},d.set(f,p),m.push(f)),p.rows.push(c);}return m.map(c=>{let a=d.get(c),u=i.length>0?_t(a.rows,e,i,r+1,c):void 0,f=u?u.reduce((p,g)=>p+g.itemCount,0):a.rows.length;return {groupKey:c,groupValue:a.value,columnId:l,displayText:Yt(a.value,s,a.rows[0]),items:a.rows,itemCount:f,subGroups:u,depth:r}})}function kt(t,e){let n=[];for(let r of t)n.push({__ogridGroupHeader:true,group:r}),e.has(r.groupKey)&&(r.subGroups&&r.subGroups.length>0?n.push(...kt(r.subGroups,e)):n.push(...r.items));return n}function Ot(t,e,n,r){if(n.length===0)return {displayRows:t,groupTree:[]};let o=_t(t,e,n,0,"");return {displayRows:kt(o,r),groupTree:o}}var Vt=300,Lt=300,Ut=300;var Ht={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,se as AUTOSIZE_MAX_PX,lt as CELL_PADDING,rt as CHECKBOX_COLUMN_WIDTH,De as COLUMN_HEADER_MENU_ITEMS,W as CellDescriptorCache,G as DEFAULT_DATE_FORMAT,Vt as DEFAULT_DEBOUNCE_MS,X as DEFAULT_MIN_COLUMN_WIDTH,at as GRID_BORDER_RADIUS,Te as GRID_CONTEXT_MENU_ITEMS,J as MAX_PAGE_BUTTONS,Q as PAGE_SIZE_OPTIONS,Lt as PEOPLE_SEARCH_DEBOUNCE_MS,de as RESPONSIVE_BREAKPOINTS,st as ROW_NUMBER_COLUMN_ID,it as ROW_NUMBER_COLUMN_MIN_WIDTH,ot as ROW_NUMBER_COLUMN_WIDTH,Ut as SIDEBAR_TRANSITION_MS,z as UndoRedoStack,Ht as Z_INDEX,ft as applyCellDeletion,yt as applyCutClear,Dt as applyFillValues,Rt as applyPastedValues,It as applyRangeRowSelection,Pt as applyResponsiveHiding,ue as areFillCompatible,Ne as areGridRowPropsEqual,ne as booleanParser,et as buildCellIndex,j as buildCsvHeader,Y as buildCsvRows,Ot as buildGroupedRows,Ce as buildHeaderRows,Ke as buildInlineEditorProps,Ze as buildPopoverEditorProps,_e as calculateDropTarget,gt as clampSelectionToBounds,q as columnLetterToIndex,Me as computeAggregations,mt as computeArrowNavigation,Ct as computeAutoScrollSpeed,nt as computeNextSortState,bt as computeRowSelectionState,ct as computeTabNavigation,Le as computeTotalHeight,ke as computeVisibleColumnRange,Ve as computeVisibleRange,ge as createGridDataAccessor,oe as createSortFilterWorker,Ee as currencyParser,te as dateParser,Qe as debounce,be as deriveFilterOptionsFromData,Fe as emailParser,O as escapeCsvValue,ut as estimateHeaderMinWidth,pe as exportToCsv,le as extractValueMatrix,P as findCtrlArrowTarget,Z as flattenColumns,Tt as formatCellReference,ae as formatCellValueForTsv,B as formatDateForDisplay,xt as formatSelectionAsTsv,we as formatShortcut,ze as getCellRenderDescriptor,x as getCellValue,ve as getColumnHeaderMenuItems,Se as getContextMenuHandlers,Re as getDataGridStatusBarConfig,$e as getDateInputPlaceholder,S as getFilterField,me as getGroupKey,qe as getHeaderFilterConfig,xe as getMultiSelectFilterFields,ye as getPaginationViewModel,re as getPinStateForColumn,ce as getResponsiveHiddenColumns,Ue as getScrollTopForRow,he as getStatusBarParts,Nt as handleBooleanCellPointerDown,U as indexToColumnLetter,tt as injectGlobalStyles,h as isColumnEditable,v as isFilterConfig,At as isGroupHeader,F as isInSelectionRange,D as isRowInRange,dt as measureColumnContentWidth,Je as measureRange,Ie as mergeFilter,R as normalizeSelectionRange,ee as numberParser,ht as parseTsvClipboard,We as parseUserInputDate,T as parseValue,Oe as partitionColumnsForVirtualization,M as processClientSideData,Be as processClientSideDataAsync,pt as rangesEqual,Ae as reorderColumnArray,je as resolveCellDisplayContent,Ye as resolveCellStyle,Mt as resolveResponsiveConfig,Ge as terminateSortFilterWorker,fe as toUserLike,K as triggerCsvDownload,vt as validateColumns,Ft as validateRowIds,Et as validateVirtualScrollConfig};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
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
|
+
export type { IRowGroup, IRowGroupingConfig, RowGroupingDisplayRow, } from './types';
|
|
4
5
|
export { escapeCsvValue, buildCsvHeader, buildCsvRows, exportToCsv, triggerCsvDownload, } from './utils';
|
|
5
6
|
export type { CsvColumn, FormulaExportOptions } from './utils';
|
|
6
7
|
export { getCellValue, isColumnEditable, createGridDataAccessor } from './utils';
|
|
@@ -49,6 +50,7 @@ export type { FormulaReference } from './utils';
|
|
|
49
50
|
export { getResponsiveHiddenColumns, RESPONSIVE_BREAKPOINTS, resolveResponsiveConfig, applyResponsiveHiding } from './utils';
|
|
50
51
|
export type { IResponsiveColumnsConfig } from './utils';
|
|
51
52
|
export { formatDateForDisplay, parseUserInputDate, getDateInputPlaceholder, DEFAULT_DATE_FORMAT } from './utils';
|
|
53
|
+
export { isGroupHeader, getGroupKey, buildGroupedRows } from './utils';
|
|
52
54
|
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';
|
|
53
55
|
export { DEFAULT_DEBOUNCE_MS, PEOPLE_SEARCH_DEBOUNCE_MS, SIDEBAR_TRANSITION_MS, } from './constants';
|
|
54
56
|
export { Z_INDEX } from './constants';
|
|
@@ -53,6 +53,10 @@ export interface IColumnDef<T = unknown> extends IColumnMeta {
|
|
|
53
53
|
valueGetter?: (item: T) => unknown;
|
|
54
54
|
/** Format the cell value for display (used when no renderCell). */
|
|
55
55
|
valueFormatter?: (value: unknown, item: T) => string;
|
|
56
|
+
/** When true, this column is used as a grouping dimension. */
|
|
57
|
+
rowGroup?: boolean;
|
|
58
|
+
/** When true, keep the column visible even when it's being grouped by (default: hidden). */
|
|
59
|
+
showRowGroup?: boolean;
|
|
56
60
|
/** Format the cell value for clipboard copy. When set, overrides valueFormatter for copy/paste. */
|
|
57
61
|
clipboardFormatter?: (value: unknown, item: T) => string;
|
|
58
62
|
/**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface IRowGroup<T> {
|
|
2
|
+
groupKey: string;
|
|
3
|
+
groupValue: unknown;
|
|
4
|
+
columnId: string;
|
|
5
|
+
displayText: string;
|
|
6
|
+
items: T[];
|
|
7
|
+
itemCount: number;
|
|
8
|
+
subGroups?: IRowGroup<T>[];
|
|
9
|
+
depth: number;
|
|
10
|
+
}
|
|
11
|
+
export interface IRowGroupingConfig {
|
|
12
|
+
groupBy: string[];
|
|
13
|
+
expandedGroups: Set<string>;
|
|
14
|
+
}
|
|
15
|
+
export type RowGroupingDisplayRow<T> = T | {
|
|
16
|
+
__ogridGroupHeader: true;
|
|
17
|
+
group: IRowGroup<T>;
|
|
18
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
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
|
+
export type { IRowGroup, IRowGroupingConfig, RowGroupingDisplayRow, } from './groupingTypes';
|
|
3
4
|
export { toUserLike, isInSelectionRange, normalizeSelectionRange, } from './dataGridTypes';
|
|
@@ -47,3 +47,4 @@ export type { IResponsiveColumnsConfig } from './responsiveColumns';
|
|
|
47
47
|
export { formatDateForDisplay, parseUserInputDate, getDateInputPlaceholder, DEFAULT_DATE_FORMAT } from './dateFormatter';
|
|
48
48
|
export { handleBooleanCellPointerDown } from './checkboxUtils';
|
|
49
49
|
export type { BooleanCellSelectHandlers } from './checkboxUtils';
|
|
50
|
+
export { isGroupHeader, getGroupKey, buildGroupedRows } from './rowGrouping';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IColumnDef } from '../types/columnTypes';
|
|
2
|
+
import type { IRowGroup, RowGroupingDisplayRow } from '../types/groupingTypes';
|
|
3
|
+
export declare function isGroupHeader<T>(row: RowGroupingDisplayRow<T>): row is {
|
|
4
|
+
__ogridGroupHeader: true;
|
|
5
|
+
group: IRowGroup<T>;
|
|
6
|
+
};
|
|
7
|
+
export declare function getGroupKey(columnId: string, value: unknown): string;
|
|
8
|
+
export declare function buildGroupedRows<T>(items: T[], columns: IColumnDef<T>[], groupByColumnIds: string[], expandedGroups: Set<string>): {
|
|
9
|
+
displayRows: RowGroupingDisplayRow<T>[];
|
|
10
|
+
groupTree: IRowGroup<T>[];
|
|
11
|
+
};
|
package/package.json
CHANGED