@ishibashi0112/spreadsheet-grid-core 0.46.1 → 0.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/detailRow.cjs"),t=require("../logic/geometry.cjs"),n=require("../logic/autoScrollGeometry.cjs"),r=require("../logic/slotDom.cjs");function i(e,n,r,i){let a=e.find(e=>e.key===n);if(!a)return null;let o=t.getColumnPane(a),s={left:[],center:[],right:[]},c=new Map;for(let n of e)s[t.getColumnPane(n)].push(n.key),c.set(n.key,n.visible!==!1);let l=s[r].filter(e=>c.get(e)).indexOf(n),u=s[o].indexOf(n);if(u<0)return null;s[o].splice(u,1);let d=i;o===r&&l>=0&&d>l&&--d;let f=s[r].filter(e=>c.get(e));if(d=Math.max(0,Math.min(d,f.length)),o===r&&l>=0&&d===l)return null;let p;return p=d>=f.length?s[r].length:s[r].indexOf(f[d]),s[r].splice(p,0,n),[...s.left,...s.center,...s.right]}var a=32,o=2,s=14,c=12,l=`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="5 9 2 12 5 15"/><polyline points="9 5 12 2 15 5"/><polyline points="15 19 12 22 9 19"/><polyline points="19 9 22 12 19 15"/><line x1="2" y1="12" x2="22" y2="12"/><line x1="12" y1="2" x2="12" y2="22"/></svg>`,u=`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="17" x2="12" y2="22"/><path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"/></svg>`,d=`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="4.9" y1="4.9" x2="19.1" y2="19.1"/></svg>`,f=`0.5`,p=200,m=`cubic-bezier(0.2, 0.7, 0.3, 1)`,h=e=>e?.closest(`.ssg-motion-off`)!=null,g=t=>{if(!t)return null;let n=new Map;return t.querySelectorAll(`[data-ssg-col-key]`).forEach(r=>{if(e.isInsideDetailCardOf(t,r))return;let i=r.dataset.ssgColKey;i&&!n.has(i)&&n.set(i,r.getBoundingClientRect().left)}),n},_=()=>{let _=null,v=null,y=null,b=null,x={x:0,y:0},S=null,C=!1,w=null,T=null,E=null,D=null,O=null,k=()=>({left:_?.leftIndicatorRef.current??null,center:_?.centerIndicatorRef.current??null,right:_?.rightIndicatorRef.current??null}),A=()=>{for(let e of Object.values(k()))e&&(e.style.display=`none`)},j=e=>{if(E)return;let t=document.createElement(`div`);t.setAttribute(`data-grid-drag-ghost`,``),_?.scrollContainerRef.current?.closest(`.ssg-theme-dark`)!=null&&t.classList.add(`ssg-theme-dark`),_?.scrollContainerRef.current?.closest(`.ssg-motion-off`)!=null&&t.classList.add(`ssg-motion-off`),t.style.cssText=[`position:fixed`,`top:0`,`left:0`,`display:inline-flex`,`align-items:center`,`gap:7px`,`padding:7px 12px 7px 10px`,`border-radius:9px`,`border:1px solid var(--ssg-ghost-border)`,`background:var(--ssg-ghost-bg)`,`color:var(--ssg-ghost-text)`,`font-size:12px`,`font-weight:600`,`line-height:1`,`white-space:nowrap`,`box-shadow:var(--ssg-ghost-shadow)`,`pointer-events:none`,`user-select:none`,`z-index:9999`,`will-change:transform`,`transform:translate(-9999px,-9999px)`].join(`;`),r.applySlotToElement(t,_?.ghostSlot);let n=document.createElement(`span`);n.style.cssText=`display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none`;let i=document.createElement(`span`);i.textContent=e,t.appendChild(n),t.appendChild(i),document.body.appendChild(t),E=t,D=n,O=null},M=e=>{let t=E;if(!t)return;t.style.transform=`translate(`+(x.x+s)+`px,`+(x.y+c)+`px)`;let n=e??`out`;if(O===n)return;O=n;let r=D;n===`out`?(t.style.opacity=f,r&&(r.innerHTML=d)):(t.style.opacity=`1`,r&&(r.innerHTML=n===`center`?l:u))},N=()=>{E&&E.parentNode&&E.parentNode.removeChild(E),E=null,D=null,O=null},P=(e,n)=>{if(_===null)return null;let{paneLayout:r,leftPaneScrollRef:i,rightPaneScrollRef:s,bodyScrollRef:c,scrollContainerRef:l,leftLeadingWidth:u,centerLeadingWidth:d,rightLeadingWidth:f}=_,p=l.current;if(p){let t=p.getBoundingClientRect();if(e<t.left||e>t.right||n<t.top||n>t.bottom)return null}let m=i.current,h=s.current;if(m&&r.left.entries.length===0&&e<=m.getBoundingClientRect().left+a)return{pane:`left`,slot:0,leftPx:o};if(m&&r.left.entries.length>0){let n=m.getBoundingClientRect();if(e<n.right){let i=e-n.left-u,a=t.findPaneDropSlot(r.left,i);return{pane:`left`,slot:a,leftPx:u+t.paneDropSlotBoundaryX(r.left,a)}}}if(h&&r.right.entries.length===0&&e>=h.getBoundingClientRect().left-a)return{pane:`right`,slot:0,leftPx:-2};if(h&&r.right.entries.length>0){let n=h.getBoundingClientRect();if(e>=n.left){let i=e-n.left-f,a=t.findPaneDropSlot(r.right,i);return{pane:`right`,slot:a,leftPx:f+t.paneDropSlotBoundaryX(r.right,a)}}}let g=c.current;if(g&&r.center.entries.length>0){let n=g.getBoundingClientRect(),i=g.scrollLeft+e-n.left-d,a=t.findPaneDropSlot(r.center,Math.max(i,0));return{pane:`center`,slot:a,leftPx:d+t.paneDropSlotBoundaryX(r.center,a)}}return null},F=()=>{let e=P(x.x,x.y);if(M(e?e.pane:null),!e){y=null,A();return}y={pane:e.pane,slot:e.slot};let t=k();for(let n of[`left`,`center`,`right`]){let r=t[n];r&&(n===e.pane?(r.style.left=`${e.leftPx}px`,r.style.display=`block`):r.style.display=`none`)}},I=()=>{if(v===null){T=null;return}let e=_?.scrollContainerRef.current??null;if(e&&(C||(!S||n.hasPointerLeftActivationRadius(S,x,6))&&(C=!0),C)){let t=e.getBoundingClientRect(),r=n.resolveScrollContentBox({rectLeft:t.left,rectTop:t.top,clientLeft:e.clientLeft,clientTop:e.clientTop,clientWidth:e.clientWidth,clientHeight:e.clientHeight}),i=n.resolveAutoScrollAxisDirection(x.x,r.left,r.right,24),a=n.computeNextScrollPosition(e.scrollLeft,i,18,e.scrollWidth-e.clientWidth);a!==e.scrollLeft&&e.scrollTo({left:a,behavior:`auto`})}F(),T=requestAnimationFrame(I)},L=e=>{T!==null&&(cancelAnimationFrame(T),T=null),document.body.style.cursor=``,A(),N();let n=v,r=y;if(v=null,y=null,!e||!n||!r||_===null)return;let{columns:a,applyColumnOrderAndPin:o,scrollContainerRef:s}=_,c=i(a,n,r.pane,r.slot);if(!c)return;let l=a.find(e=>e.key===n),u=l?t.getColumnPane(l):null;b=u!==null&&u===r.pane&&!h(s.current)?g(s.current):null,o(c,new Map([[n,r.pane===`center`?void 0:r.pane]]))};return{update:e=>{_=e},onColumnDragHandlePointerDown:(e,t)=>{if(_===null||!_.enabled||t.button!==0)return;t.stopPropagation(),t.preventDefault(),v=e.key,x={x:t.clientX,y:t.clientY},S={x:t.clientX,y:t.clientY},C=!1,document.body.style.cursor=`grabbing`,j(e.title||e.key);let n=t.currentTarget,r=t.pointerId;try{n.setPointerCapture(r)}catch{}let i=e=>{e.pointerId===r&&(x={x:e.clientX,y:e.clientY},F())},a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,s),w=null;try{n.releasePointerCapture(r)}catch{}};function o(e){e.pointerId===r&&(a(),L(!0))}function s(e){e.pointerId===r&&(a(),L(!1))}window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,s),w=a,F(),T=requestAnimationFrame(I)},applyReorderSettle:()=>{let t=b;if(b=null,!t)return;let n=_?.scrollContainerRef.current??null;if(!n)return;let r=new Map,i=new Map;n.querySelectorAll(`[data-ssg-col-key]`).forEach(a=>{if(e.isInsideDetailCardOf(n,a))return;let o=a.dataset.ssgColKey;if(!o||!t.has(o))return;let s=r.get(o);s?s.push(a):(r.set(o,[a]),i.set(o,a.getBoundingClientRect().left))});let a=[];if(r.forEach((e,n)=>{let r=t.get(n),o=i.get(n);if(r===void 0||o===void 0)return;let s=r-o;if(!(Math.abs(s)<.5))for(let t of e)t.style.transition=`none`,t.style.transform=`translateX(${s}px)`,t.style.willChange=`transform`,a.push(t)}),a.length!==0){n.getBoundingClientRect();for(let e of a)e.style.transition=`transform ${p}ms ${m}`,e.style.transform=`translateX(0)`;window.setTimeout(()=>{for(let e of a)e.style.transition=``,e.style.transform=``,e.style.willChange=``},280)}},dispose:()=>{w?.(),w=null,T!==null&&(cancelAnimationFrame(T),T=null),v=null,y=null,document.body.style.cursor=``,N()}}};exports.computeHeaderReorderedKeys=i,exports.createColumnHeaderDragController=_;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/detailRow.cjs"),t=require("../logic/geometry.cjs"),n=require("../logic/autoScrollGeometry.cjs"),r=require("../logic/slotDom.cjs");function i(e,n,r,i){let a=e.find(e=>e.key===n);if(!a)return null;let o=t.getColumnPane(a),s={left:[],center:[],right:[]},c=new Map;for(let n of e)s[t.getColumnPane(n)].push(n.key),c.set(n.key,n.visible!==!1);let l=s[r].filter(e=>c.get(e)).indexOf(n),u=s[o].indexOf(n);if(u<0)return null;s[o].splice(u,1);let d=i;o===r&&l>=0&&d>l&&--d;let f=s[r].filter(e=>c.get(e));if(d=Math.max(0,Math.min(d,f.length)),o===r&&l>=0&&d===l)return null;let p;return p=d>=f.length?s[r].length:s[r].indexOf(f[d]),s[r].splice(p,0,n),[...s.left,...s.center,...s.right]}function a(n,r,i,a){let o=n.filter(e=>t.getColumnPane(e)===i&&e.visible!==!1).map(e=>e.key),{entries:s}=r;for(let t=Math.max(a,0);t<s.length;t+=1){let n=s[t].column.key;if(e.isSyntheticColumnKey(n))continue;let r=o.indexOf(n);return r<0?o.length:r}return o.length}var o=t=>{let n=0;for(;n<t.entries.length&&e.isSyntheticColumnKey(t.entries[n].column.key);)n+=1;return n},s=32,c=2,l=14,u=12,d=`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="5 9 2 12 5 15"/><polyline points="9 5 12 2 15 5"/><polyline points="15 19 12 22 9 19"/><polyline points="19 9 22 12 19 15"/><line x1="2" y1="12" x2="22" y2="12"/><line x1="12" y1="2" x2="12" y2="22"/></svg>`,f=`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="17" x2="12" y2="22"/><path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"/></svg>`,p=`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="4.9" y1="4.9" x2="19.1" y2="19.1"/></svg>`,m=`0.5`,h=200,g=`cubic-bezier(0.2, 0.7, 0.3, 1)`,_=e=>e?.closest(`.ssg-motion-off`)!=null,v=`transform 160ms ${g}`,y=`data-ssg-col-dragging`,b=`4`,x=t=>{let n=[];return t.querySelectorAll(`[data-ssg-col-key]`).forEach(r=>{e.isInsideDetailCardOf(t,r)||n.push(r)}),n},S=t=>{if(!t)return null;let n=new Map;return t.querySelectorAll(`[data-ssg-col-key]`).forEach(r=>{if(e.isInsideDetailCardOf(t,r))return;let i=r.dataset.ssgColKey;i&&!n.has(i)&&n.set(i,r.getBoundingClientRect().left)}),n},C=()=>{let C=null,w=null,T=null,E=null,D={x:0,y:0},O=null,k=!1,A=null,j=null,M=null,N=null,P=null,F=null,I=0,L=null,R=null,z=``,B=()=>C?.motion===`live`,V=()=>({left:C?.leftIndicatorRef.current??null,center:C?.centerIndicatorRef.current??null,right:C?.rightIndicatorRef.current??null}),H=()=>{for(let e of Object.values(V()))e&&(e.style.display=`none`)},U=e=>{if(M)return;let t=document.createElement(`div`);t.setAttribute(`data-grid-drag-ghost`,``),C?.scrollContainerRef.current?.closest(`.ssg-theme-dark`)!=null&&t.classList.add(`ssg-theme-dark`),C?.scrollContainerRef.current?.closest(`.ssg-motion-off`)!=null&&t.classList.add(`ssg-motion-off`),t.style.cssText=[`position:fixed`,`top:0`,`left:0`,`display:inline-flex`,`align-items:center`,`gap:7px`,`padding:7px 12px 7px 10px`,`border-radius:9px`,`border:1px solid var(--ssg-ghost-border)`,`background:var(--ssg-ghost-bg)`,`color:var(--ssg-ghost-text)`,`font-size:12px`,`font-weight:600`,`line-height:1`,`white-space:nowrap`,`box-shadow:var(--ssg-ghost-shadow)`,`pointer-events:none`,`user-select:none`,`z-index:9999`,`will-change:transform`,`transform:translate(-9999px,-9999px)`].join(`;`),r.applySlotToElement(t,C?.ghostSlot);let n=document.createElement(`span`);n.style.cssText=`display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none`;let i=document.createElement(`span`);i.textContent=e,t.appendChild(n),t.appendChild(i),document.body.appendChild(t),M=t,N=n,P=null},W=e=>{let t=M;if(!t)return;t.style.transform=`translate(`+(D.x+l)+`px,`+(D.y+u)+`px)`;let n=e??`out`;if(P===n)return;P=n;let r=N;n===`out`?(t.style.opacity=m,r&&(r.innerHTML=p)):(t.style.opacity=`1`,r&&(r.innerHTML=n===`center`?d:f))},G=()=>{M&&M.parentNode&&M.parentNode.removeChild(M),M=null,N=null,P=null},K=(e,n)=>{if(C===null)return null;let{paneLayout:r,leftPaneScrollRef:i,rightPaneScrollRef:a,bodyScrollRef:l,scrollContainerRef:u,leftLeadingWidth:d,centerLeadingWidth:f,rightLeadingWidth:p}=C,m=u.current;if(m){let t=m.getBoundingClientRect();if(e<t.left||e>t.right||n<t.top||n>t.bottom)return null}let h=i.current,g=a.current;if(h&&r.left.entries.length===0&&e<=h.getBoundingClientRect().left+s)return{pane:`left`,slot:0,leftPx:c};if(h&&r.left.entries.length>0){let n=h.getBoundingClientRect();if(e<n.right){let i=e-n.left-d,a=Math.max(t.findPaneDropSlot(r.left,i),o(r.left));return{pane:`left`,slot:a,leftPx:d+t.paneDropSlotBoundaryX(r.left,a)}}}if(g&&r.right.entries.length===0&&e>=g.getBoundingClientRect().left-s)return{pane:`right`,slot:0,leftPx:-2};if(g&&r.right.entries.length>0){let n=g.getBoundingClientRect();if(e>=n.left){let i=e-n.left-p,a=Math.max(t.findPaneDropSlot(r.right,i),o(r.right));return{pane:`right`,slot:a,leftPx:p+t.paneDropSlotBoundaryX(r.right,a)}}}let _=l.current;if(_&&r.center.entries.length>0){let n=_.getBoundingClientRect(),i=_.scrollLeft+e-n.left-f,a=Math.max(t.findPaneDropSlot(r.center,Math.max(i,0)),o(r.center));return{pane:`center`,slot:a,leftPx:f+t.paneDropSlotBoundaryX(r.center,a)}}return null},q=e=>{let t=V();for(let n of[`left`,`center`,`right`]){let r=t[n];r&&(n===e.pane?(r.style.left=`${e.leftPx}px`,r.style.display=`block`):r.style.display=`none`)}},J=(e,t)=>{let n=R?.get(t);n!==void 0&&R?.delete(t),e.set(t,n??t.style.zIndex)},Y=(e,t)=>{let n=L,r=w,i=F;if(!n||r===null||i===null||C===null)return;let a=C.scrollContainerRef.current;if(!a)return;let o=C.paneLayout[i].entries,s=o.findIndex(e=>e.column.key===r);if(s<0)return;let c=o[s].paneLocalSize,l=!t||e===null?s:e>s?e-1:e,u=new Map;for(let e=Math.min(s,l);e<=Math.max(s,l);e+=1)e!==s&&u.set(o[e].column.key,e>s?-c:c);let d=i===`center`?a.scrollLeft-I:0,f=(O?D.x-O.x:0)+d;for(let e of x(a)){let i=e.dataset.ssgColKey;if(i===void 0)continue;if(i===r){n.has(e)||(J(n,e),e.style.zIndex=b,e.style.willChange=`transform`),t?(e.setAttribute(y,`live`),e.style.transition=`none`,e.style.transform=`translateX(${f}px)`):(e.removeAttribute(y),e.style.transition=v,e.style.transform=`translateX(0px)`);continue}let a=u.get(i)??0;if(a===0&&!n.has(e))continue;n.has(e)||J(n,e);let o=`translateX(${a}px)`;e.style.transform!==o&&(e.style.transition=v,e.style.transform=o)}},X=e=>{e.forEach((e,t)=>{t.style.transition=``,t.style.transform=``,t.style.willChange=``,t.style.zIndex=e,t.removeAttribute(y)})},Z=()=>{let e=K(D.x,D.y);if(B()){e&&(T={pane:e.pane,slot:e.slot});let t=T;if(t!==null&&t.pane!==F){U(z),W(t.pane),e&&q(e),Y(null,!1);return}G(),H(),Y(t===null?null:t.slot,!0);return}if(W(e?e.pane:null),!e){T=null,H();return}T={pane:e.pane,slot:e.slot},q(e)},Q=()=>{if(w===null){j=null;return}let e=C?.scrollContainerRef.current??null;if(e&&(k||(!O||n.hasPointerLeftActivationRadius(O,D,6))&&(k=!0),k)){let t=e.getBoundingClientRect(),r=n.resolveScrollContentBox({rectLeft:t.left,rectTop:t.top,clientLeft:e.clientLeft,clientTop:e.clientTop,clientWidth:e.clientWidth,clientHeight:e.clientHeight}),i=n.resolveAutoScrollAxisDirection(D.x,r.left,r.right,24),a=n.computeNextScrollPosition(e.scrollLeft,i,18,e.scrollWidth-e.clientWidth);a!==e.scrollLeft&&e.scrollTo({left:a,behavior:`auto`})}Z(),j=requestAnimationFrame(Q)},$=e=>{j!==null&&(cancelAnimationFrame(j),j=null),document.body.style.cursor=``,H(),G();let n=w,r=T;w=null,T=null,O=null;let o=L;L=null,F=null;let s=n!==null&&r!==null&&C!==null?C.paneLayout[r.pane].entries.findIndex(e=>e.column.key===n):-1,c=r!==null&&s>=0&&(r.slot===s||r.slot===s+1),l=e&&n&&r&&C!==null&&!c?i(C.columns,n,r.pane,a(C.columns,C.paneLayout[r.pane],r.pane,r.slot)):null;if(o&&!l&&(o.forEach((e,t)=>{t.isConnected&&(t.style.transition=v,t.style.transform=`translateX(0px)`)}),R=o,window.setTimeout(()=>{X(o),R===o&&(R=null)},200)),!l||!n||!r||C===null)return;let{columns:u,applyColumnOrderAndPin:d,scrollContainerRef:f}=C,p=u.find(e=>e.key===n),m=p?t.getColumnPane(p):null;E=m!==null&&m===r.pane&&!_(f.current)?S(f.current):null,o&&X(o),d(l,new Map([[n,r.pane===`center`?void 0:r.pane]]))};return{update:e=>{C=e},onColumnDragHandlePointerDown:(e,n)=>{if(C===null||!C.enabled||n.button!==0)return;n.stopPropagation(),n.preventDefault(),w=e.key,T=null,D={x:n.clientX,y:n.clientY},O={x:n.clientX,y:n.clientY},k=!1,document.body.style.cursor=`grabbing`,z=e.title||e.key,B()?(F=t.getColumnPane(e),I=C.scrollContainerRef.current?.scrollLeft??0,L=new Map):U(z);let r=n.currentTarget,i=n.pointerId;try{r.setPointerCapture(i)}catch{}let a=e=>{e.pointerId===i&&(D={x:e.clientX,y:e.clientY},Z())},o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),window.removeEventListener(`keydown`,l),A=null;try{r.releasePointerCapture(i)}catch{}};function s(e){e.pointerId===i&&(o(),$(!0))}function c(e){e.pointerId===i&&(o(),$(!1))}function l(e){e.key===`Escape`&&(o(),$(!1))}window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,s),window.addEventListener(`pointercancel`,c),window.addEventListener(`keydown`,l),A=o,Z(),j=requestAnimationFrame(Q)},applyReorderSettle:()=>{let t=E;if(E=null,!t)return;let n=C?.scrollContainerRef.current??null;if(!n)return;let r=new Map,i=new Map;n.querySelectorAll(`[data-ssg-col-key]`).forEach(a=>{if(e.isInsideDetailCardOf(n,a))return;let o=a.dataset.ssgColKey;if(!o||!t.has(o))return;let s=r.get(o);s?s.push(a):(r.set(o,[a]),i.set(o,a.getBoundingClientRect().left))});let a=[];if(r.forEach((e,n)=>{let r=t.get(n),o=i.get(n);if(r===void 0||o===void 0)return;let s=r-o;if(!(Math.abs(s)<.5))for(let t of e)t.style.transition=`none`,t.style.transform=`translateX(${s}px)`,t.style.willChange=`transform`,a.push(t)}),a.length!==0){n.getBoundingClientRect();for(let e of a)e.style.transition=`transform ${h}ms ${g}`,e.style.transform=`translateX(0)`;window.setTimeout(()=>{for(let e of a)e.style.transition=``,e.style.transform=``,e.style.willChange=``},280)}},dispose:()=>{A?.(),A=null,j!==null&&(cancelAnimationFrame(j),j=null),w=null,T=null,document.body.style.cursor=``,G(),L&&X(L),L=null,F=null}}};exports.computeHeaderReorderedKeys=i,exports.createColumnHeaderDragController=C,exports.resolveConsumerDropSlot=a;
@@ -1,7 +1,8 @@
1
1
  import type { GridColumn, GridColumnPinned, GridResolvedSlot } from '../model/gridTypes.unbound.js';
2
- import { type ColumnPane, type GridPaneLayout } from '../logic/geometry.js';
2
+ import { type ColumnPane, type GridPaneLayout, type PaneGeometry } from '../logic/geometry.js';
3
3
  type ApplyColumnOrderAndPin = (orderedKeys: string[], pinOverride?: Map<string, GridColumnPinned | undefined>) => void;
4
4
  export declare function computeHeaderReorderedKeys<T>(columns: GridColumn<T>[], draggedKey: string, targetPane: ColumnPane, slotInTargetVisible: number): string[] | null;
5
+ export declare function resolveConsumerDropSlot<T>(columns: GridColumn<T>[], paneGeometry: PaneGeometry<T>, pane: ColumnPane, slot: number): number;
5
6
  type ReadonlyRef<V> = {
6
7
  readonly current: V;
7
8
  };
@@ -21,6 +22,7 @@ export type ColumnHeaderDragArgs<T> = {
21
22
  rightLeadingWidth: number;
22
23
  applyColumnOrderAndPin: ApplyColumnOrderAndPin;
23
24
  ghostSlot?: GridResolvedSlot;
25
+ motion?: 'ghost' | 'live';
24
26
  };
25
27
  export type ColumnDragHandlePointerEvent = {
26
28
  button: number;
@@ -1,32 +1,51 @@
1
- import { isInsideDetailCardOf as e } from "../logic/detailRow.js";
2
- import { findPaneDropSlot as t, getColumnPane as n, paneDropSlotBoundaryX as r } from "../logic/geometry.js";
3
- import { computeNextScrollPosition as i, hasPointerLeftActivationRadius as a, resolveAutoScrollAxisDirection as o, resolveScrollContentBox as s } from "../logic/autoScrollGeometry.js";
4
- import { applySlotToElement as c } from "../logic/slotDom.js";
1
+ import { isInsideDetailCardOf as e, isSyntheticColumnKey as t } from "../logic/detailRow.js";
2
+ import { findPaneDropSlot as n, getColumnPane as r, paneDropSlotBoundaryX as i } from "../logic/geometry.js";
3
+ import { computeNextScrollPosition as a, hasPointerLeftActivationRadius as o, resolveAutoScrollAxisDirection as s, resolveScrollContentBox as c } from "../logic/autoScrollGeometry.js";
4
+ import { applySlotToElement as l } from "../logic/slotDom.js";
5
5
  //#region src/controllers/columnHeaderDragController.ts
6
- function l(e, t, r, i) {
6
+ function u(e, t, n, i) {
7
7
  let a = e.find((e) => e.key === t);
8
8
  if (!a) return null;
9
- let o = n(a), s = {
9
+ let o = r(a), s = {
10
10
  left: [],
11
11
  center: [],
12
12
  right: []
13
13
  }, c = /* @__PURE__ */ new Map();
14
- for (let t of e) s[n(t)].push(t.key), c.set(t.key, t.visible !== !1);
15
- let l = s[r].filter((e) => c.get(e)).indexOf(t), u = s[o].indexOf(t);
14
+ for (let t of e) s[r(t)].push(t.key), c.set(t.key, t.visible !== !1);
15
+ let l = s[n].filter((e) => c.get(e)).indexOf(t), u = s[o].indexOf(t);
16
16
  if (u < 0) return null;
17
17
  s[o].splice(u, 1);
18
18
  let d = i;
19
- o === r && l >= 0 && d > l && --d;
20
- let f = s[r].filter((e) => c.get(e));
21
- if (d = Math.max(0, Math.min(d, f.length)), o === r && l >= 0 && d === l) return null;
19
+ o === n && l >= 0 && d > l && --d;
20
+ let f = s[n].filter((e) => c.get(e));
21
+ if (d = Math.max(0, Math.min(d, f.length)), o === n && l >= 0 && d === l) return null;
22
22
  let p;
23
- return p = d >= f.length ? s[r].length : s[r].indexOf(f[d]), s[r].splice(p, 0, t), [
23
+ return p = d >= f.length ? s[n].length : s[n].indexOf(f[d]), s[n].splice(p, 0, t), [
24
24
  ...s.left,
25
25
  ...s.center,
26
26
  ...s.right
27
27
  ];
28
28
  }
29
- var u = 32, d = 2, f = 14, p = 12, m = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"5 9 2 12 5 15\"/><polyline points=\"9 5 12 2 15 5\"/><polyline points=\"15 19 12 22 9 19\"/><polyline points=\"19 9 22 12 19 15\"/><line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\"/><line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"22\"/></svg>", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"22\"/><path d=\"M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z\"/></svg>", g = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"4.9\" y1=\"4.9\" x2=\"19.1\" y2=\"19.1\"/></svg>", _ = "0.5", v = 200, y = "cubic-bezier(0.2, 0.7, 0.3, 1)", b = (e) => e?.closest(".ssg-motion-off") != null, x = (t) => {
29
+ function d(e, n, i, a) {
30
+ let o = e.filter((e) => r(e) === i && e.visible !== !1).map((e) => e.key), { entries: s } = n;
31
+ for (let e = Math.max(a, 0); e < s.length; e += 1) {
32
+ let n = s[e].column.key;
33
+ if (t(n)) continue;
34
+ let r = o.indexOf(n);
35
+ return r < 0 ? o.length : r;
36
+ }
37
+ return o.length;
38
+ }
39
+ var f = (e) => {
40
+ let n = 0;
41
+ for (; n < e.entries.length && t(e.entries[n].column.key);) n += 1;
42
+ return n;
43
+ }, p = 32, m = 2, h = 14, g = 12, _ = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"5 9 2 12 5 15\"/><polyline points=\"9 5 12 2 15 5\"/><polyline points=\"15 19 12 22 9 19\"/><polyline points=\"19 9 22 12 19 15\"/><line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\"/><line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"22\"/></svg>", v = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"22\"/><path d=\"M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z\"/></svg>", y = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"4.9\" y1=\"4.9\" x2=\"19.1\" y2=\"19.1\"/></svg>", ee = "0.5", te = 200, b = "cubic-bezier(0.2, 0.7, 0.3, 1)", x = (e) => e?.closest(".ssg-motion-off") != null, S = `transform 160ms ${b}`, C = "data-ssg-col-dragging", ne = "4", re = (t) => {
44
+ let n = [];
45
+ return t.querySelectorAll("[data-ssg-col-key]").forEach((r) => {
46
+ e(t, r) || n.push(r);
47
+ }), n;
48
+ }, w = (t) => {
30
49
  if (!t) return null;
31
50
  let n = /* @__PURE__ */ new Map();
32
51
  return t.querySelectorAll("[data-ssg-col-key]").forEach((r) => {
@@ -34,20 +53,20 @@ var u = 32, d = 2, f = 14, p = 12, m = "<svg viewBox=\"0 0 24 24\" width=\"14\"
34
53
  let i = r.dataset.ssgColKey;
35
54
  i && !n.has(i) && n.set(i, r.getBoundingClientRect().left);
36
55
  }), n;
37
- }, S = () => {
38
- let S = null, C = null, w = null, T = null, E = {
56
+ }, T = () => {
57
+ let t = null, T = null, E = null, D = null, O = {
39
58
  x: 0,
40
59
  y: 0
41
- }, D = null, O = !1, k = null, A = null, j = null, M = null, N = null, P = () => ({
42
- left: S?.leftIndicatorRef.current ?? null,
43
- center: S?.centerIndicatorRef.current ?? null,
44
- right: S?.rightIndicatorRef.current ?? null
45
- }), F = () => {
46
- for (let e of Object.values(P())) e && (e.style.display = "none");
47
- }, I = (e) => {
48
- if (j) return;
49
- let t = document.createElement("div");
50
- t.setAttribute("data-grid-drag-ghost", ""), S?.scrollContainerRef.current?.closest(".ssg-theme-dark") != null && t.classList.add("ssg-theme-dark"), S?.scrollContainerRef.current?.closest(".ssg-motion-off") != null && t.classList.add("ssg-motion-off"), t.style.cssText = [
60
+ }, k = null, A = !1, j = null, M = null, N = null, P = null, F = null, I = null, L = 0, R = null, z = null, B = "", V = () => t?.motion === "live", H = () => ({
61
+ left: t?.leftIndicatorRef.current ?? null,
62
+ center: t?.centerIndicatorRef.current ?? null,
63
+ right: t?.rightIndicatorRef.current ?? null
64
+ }), U = () => {
65
+ for (let e of Object.values(H())) e && (e.style.display = "none");
66
+ }, W = (e) => {
67
+ if (N) return;
68
+ let n = document.createElement("div");
69
+ n.setAttribute("data-grid-drag-ghost", ""), t?.scrollContainerRef.current?.closest(".ssg-theme-dark") != null && n.classList.add("ssg-theme-dark"), t?.scrollContainerRef.current?.closest(".ssg-motion-off") != null && n.classList.add("ssg-motion-off"), n.style.cssText = [
51
70
  "position:fixed",
52
71
  "top:0",
53
72
  "left:0",
@@ -69,83 +88,74 @@ var u = 32, d = 2, f = 14, p = 12, m = "<svg viewBox=\"0 0 24 24\" width=\"14\"
69
88
  "z-index:9999",
70
89
  "will-change:transform",
71
90
  "transform:translate(-9999px,-9999px)"
72
- ].join(";"), c(t, S?.ghostSlot);
73
- let n = document.createElement("span");
74
- n.style.cssText = "display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none";
91
+ ].join(";"), l(n, t?.ghostSlot);
75
92
  let r = document.createElement("span");
76
- r.textContent = e, t.appendChild(n), t.appendChild(r), document.body.appendChild(t), j = t, M = n, N = null;
77
- }, L = (e) => {
78
- let t = j;
93
+ r.style.cssText = "display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none";
94
+ let i = document.createElement("span");
95
+ i.textContent = e, n.appendChild(r), n.appendChild(i), document.body.appendChild(n), N = n, P = r, F = null;
96
+ }, G = (e) => {
97
+ let t = N;
79
98
  if (!t) return;
80
- t.style.transform = "translate(" + (E.x + f) + "px," + (E.y + p) + "px)";
99
+ t.style.transform = "translate(" + (O.x + h) + "px," + (O.y + g) + "px)";
81
100
  let n = e ?? "out";
82
- if (N === n) return;
83
- N = n;
84
- let r = M;
85
- n === "out" ? (t.style.opacity = _, r && (r.innerHTML = g)) : (t.style.opacity = "1", r && (r.innerHTML = n === "center" ? m : h));
86
- }, R = () => {
87
- j && j.parentNode && j.parentNode.removeChild(j), j = null, M = null, N = null;
88
- }, z = (e, n) => {
89
- if (S === null) return null;
90
- let { paneLayout: i, leftPaneScrollRef: a, rightPaneScrollRef: o, bodyScrollRef: s, scrollContainerRef: c, leftLeadingWidth: l, centerLeadingWidth: f, rightLeadingWidth: p } = S, m = c.current;
91
- if (m) {
92
- let t = m.getBoundingClientRect();
93
- if (e < t.left || e > t.right || n < t.top || n > t.bottom) return null;
101
+ if (F === n) return;
102
+ F = n;
103
+ let r = P;
104
+ n === "out" ? (t.style.opacity = ee, r && (r.innerHTML = y)) : (t.style.opacity = "1", r && (r.innerHTML = n === "center" ? _ : v));
105
+ }, K = () => {
106
+ N && N.parentNode && N.parentNode.removeChild(N), N = null, P = null, F = null;
107
+ }, ie = (e, r) => {
108
+ if (t === null) return null;
109
+ let { paneLayout: a, leftPaneScrollRef: o, rightPaneScrollRef: s, bodyScrollRef: c, scrollContainerRef: l, leftLeadingWidth: u, centerLeadingWidth: d, rightLeadingWidth: h } = t, g = l.current;
110
+ if (g) {
111
+ let t = g.getBoundingClientRect();
112
+ if (e < t.left || e > t.right || r < t.top || r > t.bottom) return null;
94
113
  }
95
- let h = a.current, g = o.current;
96
- if (h && i.left.entries.length === 0 && e <= h.getBoundingClientRect().left + u) return {
114
+ let _ = o.current, v = s.current;
115
+ if (_ && a.left.entries.length === 0 && e <= _.getBoundingClientRect().left + p) return {
97
116
  pane: "left",
98
117
  slot: 0,
99
- leftPx: d
118
+ leftPx: m
100
119
  };
101
- if (h && i.left.entries.length > 0) {
102
- let n = h.getBoundingClientRect();
103
- if (e < n.right) {
104
- let a = e - n.left - l, o = t(i.left, a);
120
+ if (_ && a.left.entries.length > 0) {
121
+ let t = _.getBoundingClientRect();
122
+ if (e < t.right) {
123
+ let r = e - t.left - u, o = Math.max(n(a.left, r), f(a.left));
105
124
  return {
106
125
  pane: "left",
107
126
  slot: o,
108
- leftPx: l + r(i.left, o)
127
+ leftPx: u + i(a.left, o)
109
128
  };
110
129
  }
111
130
  }
112
- if (g && i.right.entries.length === 0 && e >= g.getBoundingClientRect().left - u) return {
131
+ if (v && a.right.entries.length === 0 && e >= v.getBoundingClientRect().left - p) return {
113
132
  pane: "right",
114
133
  slot: 0,
115
134
  leftPx: -2
116
135
  };
117
- if (g && i.right.entries.length > 0) {
118
- let n = g.getBoundingClientRect();
119
- if (e >= n.left) {
120
- let a = e - n.left - p, o = t(i.right, a);
136
+ if (v && a.right.entries.length > 0) {
137
+ let t = v.getBoundingClientRect();
138
+ if (e >= t.left) {
139
+ let r = e - t.left - h, o = Math.max(n(a.right, r), f(a.right));
121
140
  return {
122
141
  pane: "right",
123
142
  slot: o,
124
- leftPx: p + r(i.right, o)
143
+ leftPx: h + i(a.right, o)
125
144
  };
126
145
  }
127
146
  }
128
- let _ = s.current;
129
- if (_ && i.center.entries.length > 0) {
130
- let n = _.getBoundingClientRect(), a = _.scrollLeft + e - n.left - f, o = t(i.center, Math.max(a, 0));
147
+ let y = c.current;
148
+ if (y && a.center.entries.length > 0) {
149
+ let t = y.getBoundingClientRect(), r = y.scrollLeft + e - t.left - d, o = Math.max(n(a.center, Math.max(r, 0)), f(a.center));
131
150
  return {
132
151
  pane: "center",
133
152
  slot: o,
134
- leftPx: f + r(i.center, o)
153
+ leftPx: d + i(a.center, o)
135
154
  };
136
155
  }
137
156
  return null;
138
- }, B = () => {
139
- let e = z(E.x, E.y);
140
- if (L(e ? e.pane : null), !e) {
141
- w = null, F();
142
- return;
143
- }
144
- w = {
145
- pane: e.pane,
146
- slot: e.slot
147
- };
148
- let t = P();
157
+ }, q = (e) => {
158
+ let t = H();
149
159
  for (let n of [
150
160
  "left",
151
161
  "center",
@@ -154,103 +164,165 @@ var u = 32, d = 2, f = 14, p = 12, m = "<svg viewBox=\"0 0 24 24\" width=\"14\"
154
164
  let r = t[n];
155
165
  r && (n === e.pane ? (r.style.left = `${e.leftPx}px`, r.style.display = "block") : r.style.display = "none");
156
166
  }
157
- }, V = () => {
158
- if (C === null) {
159
- A = null;
167
+ }, J = (e, t) => {
168
+ let n = z?.get(t);
169
+ n !== void 0 && z?.delete(t), e.set(t, n ?? t.style.zIndex);
170
+ }, Y = (e, n) => {
171
+ let r = R, i = T, a = I;
172
+ if (!r || i === null || a === null || t === null) return;
173
+ let o = t.scrollContainerRef.current;
174
+ if (!o) return;
175
+ let s = t.paneLayout[a].entries, c = s.findIndex((e) => e.column.key === i);
176
+ if (c < 0) return;
177
+ let l = s[c].paneLocalSize, u = !n || e === null ? c : e > c ? e - 1 : e, d = /* @__PURE__ */ new Map();
178
+ for (let e = Math.min(c, u); e <= Math.max(c, u); e += 1) e !== c && d.set(s[e].column.key, e > c ? -l : l);
179
+ let f = a === "center" ? o.scrollLeft - L : 0, p = (k ? O.x - k.x : 0) + f;
180
+ for (let e of re(o)) {
181
+ let t = e.dataset.ssgColKey;
182
+ if (t === void 0) continue;
183
+ if (t === i) {
184
+ r.has(e) || (J(r, e), e.style.zIndex = ne, e.style.willChange = "transform"), n ? (e.setAttribute(C, "live"), e.style.transition = "none", e.style.transform = `translateX(${p}px)`) : (e.removeAttribute(C), e.style.transition = S, e.style.transform = "translateX(0px)");
185
+ continue;
186
+ }
187
+ let a = d.get(t) ?? 0;
188
+ if (a === 0 && !r.has(e)) continue;
189
+ r.has(e) || J(r, e);
190
+ let o = `translateX(${a}px)`;
191
+ e.style.transform !== o && (e.style.transition = S, e.style.transform = o);
192
+ }
193
+ }, X = (e) => {
194
+ e.forEach((e, t) => {
195
+ t.style.transition = "", t.style.transform = "", t.style.willChange = "", t.style.zIndex = e, t.removeAttribute(C);
196
+ });
197
+ }, Z = () => {
198
+ let e = ie(O.x, O.y);
199
+ if (V()) {
200
+ e && (E = {
201
+ pane: e.pane,
202
+ slot: e.slot
203
+ });
204
+ let t = E;
205
+ if (t !== null && t.pane !== I) {
206
+ W(B), G(t.pane), e && q(e), Y(null, !1);
207
+ return;
208
+ }
209
+ K(), U(), Y(t === null ? null : t.slot, !0);
160
210
  return;
161
211
  }
162
- let e = S?.scrollContainerRef.current ?? null;
163
- if (e && (O || (!D || a(D, E, 6)) && (O = !0), O)) {
164
- let t = e.getBoundingClientRect(), n = s({
212
+ if (G(e ? e.pane : null), !e) {
213
+ E = null, U();
214
+ return;
215
+ }
216
+ E = {
217
+ pane: e.pane,
218
+ slot: e.slot
219
+ }, q(e);
220
+ }, Q = () => {
221
+ if (T === null) {
222
+ M = null;
223
+ return;
224
+ }
225
+ let e = t?.scrollContainerRef.current ?? null;
226
+ if (e && (A || (!k || o(k, O, 6)) && (A = !0), A)) {
227
+ let t = e.getBoundingClientRect(), n = c({
165
228
  rectLeft: t.left,
166
229
  rectTop: t.top,
167
230
  clientLeft: e.clientLeft,
168
231
  clientTop: e.clientTop,
169
232
  clientWidth: e.clientWidth,
170
233
  clientHeight: e.clientHeight
171
- }), r = o(E.x, n.left, n.right, 24), a = i(e.scrollLeft, r, 18, e.scrollWidth - e.clientWidth);
172
- a !== e.scrollLeft && e.scrollTo({
173
- left: a,
234
+ }), r = s(O.x, n.left, n.right, 24), i = a(e.scrollLeft, r, 18, e.scrollWidth - e.clientWidth);
235
+ i !== e.scrollLeft && e.scrollTo({
236
+ left: i,
174
237
  behavior: "auto"
175
238
  });
176
239
  }
177
- B(), A = requestAnimationFrame(V);
178
- }, H = (e) => {
179
- A !== null && (cancelAnimationFrame(A), A = null), document.body.style.cursor = "", F(), R();
180
- let t = C, r = w;
181
- if (C = null, w = null, !e || !t || !r || S === null) return;
182
- let { columns: i, applyColumnOrderAndPin: a, scrollContainerRef: o } = S, s = l(i, t, r.pane, r.slot);
183
- if (!s) return;
184
- let c = i.find((e) => e.key === t), u = c ? n(c) : null;
185
- T = u !== null && u === r.pane && !b(o.current) ? x(o.current) : null, a(s, /* @__PURE__ */ new Map([[t, r.pane === "center" ? void 0 : r.pane]]));
240
+ Z(), M = requestAnimationFrame(Q);
241
+ }, $ = (e) => {
242
+ M !== null && (cancelAnimationFrame(M), M = null), document.body.style.cursor = "", U(), K();
243
+ let n = T, i = E;
244
+ T = null, E = null, k = null;
245
+ let a = R;
246
+ R = null, I = null;
247
+ let o = n !== null && i !== null && t !== null ? t.paneLayout[i.pane].entries.findIndex((e) => e.column.key === n) : -1, s = i !== null && o >= 0 && (i.slot === o || i.slot === o + 1), c = e && n && i && t !== null && !s ? u(t.columns, n, i.pane, d(t.columns, t.paneLayout[i.pane], i.pane, i.slot)) : null;
248
+ if (a && !c && (a.forEach((e, t) => {
249
+ t.isConnected && (t.style.transition = S, t.style.transform = "translateX(0px)");
250
+ }), z = a, window.setTimeout(() => {
251
+ X(a), z === a && (z = null);
252
+ }, 200)), !c || !n || !i || t === null) return;
253
+ let { columns: l, applyColumnOrderAndPin: f, scrollContainerRef: p } = t, m = l.find((e) => e.key === n), h = m ? r(m) : null;
254
+ D = h !== null && h === i.pane && !x(p.current) ? w(p.current) : null, a && X(a), f(c, /* @__PURE__ */ new Map([[n, i.pane === "center" ? void 0 : i.pane]]));
186
255
  };
187
256
  return {
188
257
  update: (e) => {
189
- S = e;
258
+ t = e;
190
259
  },
191
- onColumnDragHandlePointerDown: (e, t) => {
192
- if (S === null || !S.enabled || t.button !== 0) return;
193
- t.stopPropagation(), t.preventDefault(), C = e.key, E = {
194
- x: t.clientX,
195
- y: t.clientY
196
- }, D = {
197
- x: t.clientX,
198
- y: t.clientY
199
- }, O = !1, document.body.style.cursor = "grabbing", I(e.title || e.key);
200
- let n = t.currentTarget, r = t.pointerId;
260
+ onColumnDragHandlePointerDown: (e, n) => {
261
+ if (t === null || !t.enabled || n.button !== 0) return;
262
+ n.stopPropagation(), n.preventDefault(), T = e.key, E = null, O = {
263
+ x: n.clientX,
264
+ y: n.clientY
265
+ }, k = {
266
+ x: n.clientX,
267
+ y: n.clientY
268
+ }, A = !1, document.body.style.cursor = "grabbing", B = e.title || e.key, V() ? (I = r(e), L = t.scrollContainerRef.current?.scrollLeft ?? 0, R = /* @__PURE__ */ new Map()) : W(B);
269
+ let i = n.currentTarget, a = n.pointerId;
201
270
  try {
202
- n.setPointerCapture(r);
271
+ i.setPointerCapture(a);
203
272
  } catch {}
204
- let i = (e) => {
205
- e.pointerId === r && (E = {
273
+ let o = (e) => {
274
+ e.pointerId === a && (O = {
206
275
  x: e.clientX,
207
276
  y: e.clientY
208
- }, B());
209
- }, a = () => {
210
- window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", s), k = null;
277
+ }, Z());
278
+ }, s = () => {
279
+ window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", c), window.removeEventListener("pointercancel", l), window.removeEventListener("keydown", u), j = null;
211
280
  try {
212
- n.releasePointerCapture(r);
281
+ i.releasePointerCapture(a);
213
282
  } catch {}
214
283
  };
215
- function o(e) {
216
- e.pointerId === r && (a(), H(!0));
284
+ function c(e) {
285
+ e.pointerId === a && (s(), $(!0));
286
+ }
287
+ function l(e) {
288
+ e.pointerId === a && (s(), $(!1));
217
289
  }
218
- function s(e) {
219
- e.pointerId === r && (a(), H(!1));
290
+ function u(e) {
291
+ e.key === "Escape" && (s(), $(!1));
220
292
  }
221
- window.addEventListener("pointermove", i), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), k = a, B(), A = requestAnimationFrame(V);
293
+ window.addEventListener("pointermove", o), window.addEventListener("pointerup", c), window.addEventListener("pointercancel", l), window.addEventListener("keydown", u), j = s, Z(), M = requestAnimationFrame(Q);
222
294
  },
223
295
  applyReorderSettle: () => {
224
- let t = T;
225
- if (T = null, !t) return;
226
- let n = S?.scrollContainerRef.current ?? null;
227
- if (!n) return;
228
- let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
229
- n.querySelectorAll("[data-ssg-col-key]").forEach((a) => {
230
- if (e(n, a)) return;
231
- let o = a.dataset.ssgColKey;
232
- if (!o || !t.has(o)) return;
233
- let s = r.get(o);
234
- s ? s.push(a) : (r.set(o, [a]), i.set(o, a.getBoundingClientRect().left));
296
+ let n = D;
297
+ if (D = null, !n) return;
298
+ let r = t?.scrollContainerRef.current ?? null;
299
+ if (!r) return;
300
+ let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
301
+ r.querySelectorAll("[data-ssg-col-key]").forEach((t) => {
302
+ if (e(r, t)) return;
303
+ let o = t.dataset.ssgColKey;
304
+ if (!o || !n.has(o)) return;
305
+ let s = i.get(o);
306
+ s ? s.push(t) : (i.set(o, [t]), a.set(o, t.getBoundingClientRect().left));
235
307
  });
236
- let a = [];
237
- if (r.forEach((e, n) => {
238
- let r = t.get(n), o = i.get(n);
239
- if (r === void 0 || o === void 0) return;
240
- let s = r - o;
241
- if (!(Math.abs(s) < .5)) for (let t of e) t.style.transition = "none", t.style.transform = `translateX(${s}px)`, t.style.willChange = "transform", a.push(t);
242
- }), a.length !== 0) {
243
- n.getBoundingClientRect();
244
- for (let e of a) e.style.transition = `transform ${v}ms ${y}`, e.style.transform = "translateX(0)";
308
+ let o = [];
309
+ if (i.forEach((e, t) => {
310
+ let r = n.get(t), i = a.get(t);
311
+ if (r === void 0 || i === void 0) return;
312
+ let s = r - i;
313
+ if (!(Math.abs(s) < .5)) for (let t of e) t.style.transition = "none", t.style.transform = `translateX(${s}px)`, t.style.willChange = "transform", o.push(t);
314
+ }), o.length !== 0) {
315
+ r.getBoundingClientRect();
316
+ for (let e of o) e.style.transition = `transform ${te}ms ${b}`, e.style.transform = "translateX(0)";
245
317
  window.setTimeout(() => {
246
- for (let e of a) e.style.transition = "", e.style.transform = "", e.style.willChange = "";
318
+ for (let e of o) e.style.transition = "", e.style.transform = "", e.style.willChange = "";
247
319
  }, 280);
248
320
  }
249
321
  },
250
322
  dispose: () => {
251
- k?.(), k = null, A !== null && (cancelAnimationFrame(A), A = null), C = null, w = null, document.body.style.cursor = "", R();
323
+ j?.(), j = null, M !== null && (cancelAnimationFrame(M), M = null), T = null, E = null, document.body.style.cursor = "", K(), R && X(R), R = null, I = null;
252
324
  }
253
325
  };
254
326
  };
255
327
  //#endregion
256
- export { l as computeHeaderReorderedKeys, S as createColumnHeaderDragController };
328
+ export { u as computeHeaderReorderedKeys, T as createColumnHeaderDragController, d as resolveConsumerDropSlot };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`ssg-body-row--enter`,t=`--ssg-row-enter-index`,n=12,r=1500,i=e=>Number(e.getAttribute(`data-row-index`)),a=e=>e instanceof HTMLElement&&e.classList.contains(`ssg-body-row`),o=`ssg-scroll-container--scrolling`,s=()=>{let n=null,s=null,c={skeletonEnter:!1,mountEnter:!1},l=new Map,u=n=>{n.classList.remove(e),n.style.removeProperty(t);let r=l.get(n);r!==void 0&&(clearTimeout(r),l.delete(n))},d=(n,i)=>{n.style.setProperty(t,String(i)),n.classList.add(e);let a=()=>{n.removeEventListener(`animationend`,a),u(n)};n.addEventListener(`animationend`,a),l.set(n,setTimeout(()=>{n.removeEventListener(`animationend`,a),u(n)},r))},f=e=>{let t=new Set,n=new Set,r=[];for(let o of e)o.removedNodes.forEach(e=>{a(e)&&(e.hasAttribute(`data-skeleton-row`)?t.add(i(e)):n.add(e))}),o.addedNodes.forEach(e=>{a(e)&&!e.hasAttribute(`data-skeleton-row`)&&r.push(e)});if(r.length===0)return;let l=s?.classList.contains(o)===!0,u=r.filter(e=>c.mountEnter&&!l&&!n.has(e)||c.skeletonEnter&&t.has(i(e)));if(u.length===0)return;let f=Array.from(new Set(u.map(i))).sort((e,t)=>e-t),p=new Map;f.forEach((e,t)=>{p.set(e,Math.min(t,12))});for(let e of u)d(e,p.get(i(e))??0)},p=()=>{n?.disconnect(),n=null,s=null;for(let e of Array.from(l.keys()))u(e)};return{update:({scrollContainerRef:e,skeletonEnter:t,mountEnter:r})=>{c={skeletonEnter:t,mountEnter:r};let i=t||r?e.current:null;i!==s&&(p(),!(!i||typeof MutationObserver>`u`)&&(n=new MutationObserver(f),n.observe(i,{childList:!0,subtree:!0}),s=i))},dispose:p}};exports.ROW_ENTER_CLASS_NAME=e,exports.ROW_ENTER_FALLBACK_MS=r,exports.ROW_ENTER_INDEX_VAR=t,exports.ROW_ENTER_STAGGER_CAP=n,exports.createRowEnterController=s;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`ssg-body-row--enter`,t=`--ssg-row-enter-index`,n=12,r=1500,i=e=>Number(e.getAttribute(`data-row-index`)),a=/(?:^|;)\s*transform\s*:\s*([^;]+)/,o=e=>{if(!e)return null;let t=a.exec(e);return t?t[1].trim():null},s=e=>e instanceof HTMLElement&&e.classList.contains(`ssg-body-row`),c=`ssg-scroll-container--scrolling`,l=()=>{let n=null,a=null,l=!1,u={skeletonEnter:!1,mountEnter:!1},d=new Map,f=n=>{n.classList.remove(e),n.style.removeProperty(t);let r=d.get(n);r!==void 0&&(clearTimeout(r),d.delete(n))},p=(n,i)=>{n.style.setProperty(t,String(i)),n.classList.add(e);let a=()=>{n.removeEventListener(`animationend`,a),f(n)};n.addEventListener(`animationend`,a),d.set(n,setTimeout(()=>{n.removeEventListener(`animationend`,a),f(n)},r))},m=(e,t)=>{let n=[];for(let r of e){if(r.style.transition)continue;let e=o(t.get(r)??null),i=r.style.transform;!e||!i||e===i||n.push({el:r,from:e,to:i})}if(n.length!==0){for(let{el:e,from:t}of n)e.style.transform=t;a?.getBoundingClientRect();for(let{el:e,to:t}of n)e.style.transform=t}},h=e=>{let t=new Set,n=new Map,r=new Set,o=[];for(let a of e){if(a.type===`attributes`){let e=a.target;s(e)&&!n.has(e)&&n.set(e,a.oldValue);continue}a.removedNodes.forEach(e=>{s(e)&&(e.hasAttribute(`data-skeleton-row`)?t.add(i(e)):r.add(e))}),a.addedNodes.forEach(e=>{s(e)&&!e.hasAttribute(`data-skeleton-row`)&&o.push(e)})}if(o.length===0)return;let l=a?.classList.contains(c)===!0;u.mountEnter&&!l&&m(o.filter(e=>r.has(e)),n);let d=o.filter(e=>u.mountEnter&&!l&&!r.has(e)||u.skeletonEnter&&t.has(i(e)));if(d.length===0)return;let f=Array.from(new Set(d.map(i))).sort((e,t)=>e-t),h=new Map;f.forEach((e,t)=>{h.set(e,Math.min(t,12))});for(let e of d)p(e,h.get(i(e))??0)},g=()=>{n?.disconnect(),n=null,a=null,l=!1;for(let e of Array.from(d.keys()))f(e)};return{update:({scrollContainerRef:e,skeletonEnter:t,mountEnter:r})=>{u={skeletonEnter:t,mountEnter:r};let i=t||r?e.current:null;i===a&&r===l||(g(),!(!i||typeof MutationObserver>`u`)&&(n=new MutationObserver(h),n.observe(i,r?{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`style`],attributeOldValue:!0}:{childList:!0,subtree:!0}),a=i,l=r))},dispose:g}};exports.ROW_ENTER_CLASS_NAME=e,exports.ROW_ENTER_FALLBACK_MS=r,exports.ROW_ENTER_INDEX_VAR=t,exports.ROW_ENTER_STAGGER_CAP=n,exports.createRowEnterController=l,exports.transformOfStyleText=o;
@@ -14,5 +14,6 @@ export declare const ROW_ENTER_CLASS_NAME = "ssg-body-row--enter";
14
14
  export declare const ROW_ENTER_INDEX_VAR = "--ssg-row-enter-index";
15
15
  export declare const ROW_ENTER_STAGGER_CAP = 12;
16
16
  export declare const ROW_ENTER_FALLBACK_MS = 1500;
17
+ export declare const transformOfStyleText: (styleText: string | null) => string | null;
17
18
  export declare const createRowEnterController: () => RowEnterController;
18
19
  export {};
@@ -1,53 +1,88 @@
1
1
  //#region src/controllers/rowEnterController.ts
2
- var e = "ssg-body-row--enter", t = "--ssg-row-enter-index", n = 12, r = 1500, i = (e) => Number(e.getAttribute("data-row-index")), a = (e) => e instanceof HTMLElement && e.classList.contains("ssg-body-row"), o = "ssg-scroll-container--scrolling", s = () => {
3
- let n = null, s = null, c = {
2
+ var e = "ssg-body-row--enter", t = "--ssg-row-enter-index", n = 12, r = 1500, i = (e) => Number(e.getAttribute("data-row-index")), a = /(?:^|;)\s*transform\s*:\s*([^;]+)/, o = (e) => {
3
+ if (!e) return null;
4
+ let t = a.exec(e);
5
+ return t ? t[1].trim() : null;
6
+ }, s = (e) => e instanceof HTMLElement && e.classList.contains("ssg-body-row"), c = "ssg-scroll-container--scrolling", l = () => {
7
+ let n = null, a = null, l = !1, u = {
4
8
  skeletonEnter: !1,
5
9
  mountEnter: !1
6
- }, l = /* @__PURE__ */ new Map(), u = (n) => {
10
+ }, d = /* @__PURE__ */ new Map(), f = (n) => {
7
11
  n.classList.remove(e), n.style.removeProperty(t);
8
- let r = l.get(n);
9
- r !== void 0 && (clearTimeout(r), l.delete(n));
10
- }, d = (n, i) => {
12
+ let r = d.get(n);
13
+ r !== void 0 && (clearTimeout(r), d.delete(n));
14
+ }, p = (n, i) => {
11
15
  n.style.setProperty(t, String(i)), n.classList.add(e);
12
16
  let a = () => {
13
- n.removeEventListener("animationend", a), u(n);
17
+ n.removeEventListener("animationend", a), f(n);
14
18
  };
15
- n.addEventListener("animationend", a), l.set(n, setTimeout(() => {
16
- n.removeEventListener("animationend", a), u(n);
19
+ n.addEventListener("animationend", a), d.set(n, setTimeout(() => {
20
+ n.removeEventListener("animationend", a), f(n);
17
21
  }, r));
18
- }, f = (e) => {
19
- let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = [];
20
- for (let o of e) o.removedNodes.forEach((e) => {
21
- a(e) && (e.hasAttribute("data-skeleton-row") ? t.add(i(e)) : n.add(e));
22
- }), o.addedNodes.forEach((e) => {
23
- a(e) && !e.hasAttribute("data-skeleton-row") && r.push(e);
24
- });
25
- if (r.length === 0) return;
26
- let l = s?.classList.contains(o) === !0, u = r.filter((e) => c.mountEnter && !l && !n.has(e) || c.skeletonEnter && t.has(i(e)));
27
- if (u.length === 0) return;
28
- let f = Array.from(new Set(u.map(i))).sort((e, t) => e - t), p = /* @__PURE__ */ new Map();
22
+ }, m = (e, t) => {
23
+ let n = [];
24
+ for (let r of e) {
25
+ if (r.style.transition) continue;
26
+ let e = o(t.get(r) ?? null), i = r.style.transform;
27
+ !e || !i || e === i || n.push({
28
+ el: r,
29
+ from: e,
30
+ to: i
31
+ });
32
+ }
33
+ if (n.length !== 0) {
34
+ for (let { el: e, from: t } of n) e.style.transform = t;
35
+ a?.getBoundingClientRect();
36
+ for (let { el: e, to: t } of n) e.style.transform = t;
37
+ }
38
+ }, h = (e) => {
39
+ let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), o = [];
40
+ for (let a of e) {
41
+ if (a.type === "attributes") {
42
+ let e = a.target;
43
+ s(e) && !n.has(e) && n.set(e, a.oldValue);
44
+ continue;
45
+ }
46
+ a.removedNodes.forEach((e) => {
47
+ s(e) && (e.hasAttribute("data-skeleton-row") ? t.add(i(e)) : r.add(e));
48
+ }), a.addedNodes.forEach((e) => {
49
+ s(e) && !e.hasAttribute("data-skeleton-row") && o.push(e);
50
+ });
51
+ }
52
+ if (o.length === 0) return;
53
+ let l = a?.classList.contains(c) === !0;
54
+ u.mountEnter && !l && m(o.filter((e) => r.has(e)), n);
55
+ let d = o.filter((e) => u.mountEnter && !l && !r.has(e) || u.skeletonEnter && t.has(i(e)));
56
+ if (d.length === 0) return;
57
+ let f = Array.from(new Set(d.map(i))).sort((e, t) => e - t), h = /* @__PURE__ */ new Map();
29
58
  f.forEach((e, t) => {
30
- p.set(e, Math.min(t, 12));
59
+ h.set(e, Math.min(t, 12));
31
60
  });
32
- for (let e of u) d(e, p.get(i(e)) ?? 0);
33
- }, p = () => {
34
- n?.disconnect(), n = null, s = null;
35
- for (let e of Array.from(l.keys())) u(e);
61
+ for (let e of d) p(e, h.get(i(e)) ?? 0);
62
+ }, g = () => {
63
+ n?.disconnect(), n = null, a = null, l = !1;
64
+ for (let e of Array.from(d.keys())) f(e);
36
65
  };
37
66
  return {
38
67
  update: ({ scrollContainerRef: e, skeletonEnter: t, mountEnter: r }) => {
39
- c = {
68
+ u = {
40
69
  skeletonEnter: t,
41
70
  mountEnter: r
42
71
  };
43
72
  let i = t || r ? e.current : null;
44
- i !== s && (p(), !(!i || typeof MutationObserver > "u") && (n = new MutationObserver(f), n.observe(i, {
73
+ i === a && r === l || (g(), !(!i || typeof MutationObserver > "u") && (n = new MutationObserver(h), n.observe(i, r ? {
74
+ childList: !0,
75
+ subtree: !0,
76
+ attributes: !0,
77
+ attributeFilter: ["style"],
78
+ attributeOldValue: !0
79
+ } : {
45
80
  childList: !0,
46
81
  subtree: !0
47
- }), s = i));
82
+ }), a = i, l = r));
48
83
  },
49
- dispose: p
84
+ dispose: g
50
85
  };
51
86
  };
52
87
  //#endregion
53
- export { e as ROW_ENTER_CLASS_NAME, r as ROW_ENTER_FALLBACK_MS, t as ROW_ENTER_INDEX_VAR, n as ROW_ENTER_STAGGER_CAP, s as createRowEnterController };
88
+ export { e as ROW_ENTER_CLASS_NAME, r as ROW_ENTER_FALLBACK_MS, t as ROW_ENTER_INDEX_VAR, n as ROW_ENTER_STAGGER_CAP, l as createRowEnterController, o as transformOfStyleText };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/slotDom.cjs"),t=require("../logic/tooltipGeometry.cjs");var n=`data-ssg-tooltip`,r=`[${n}], [data-ssg-tooltip-overflow]`,i=350,a=800,o=0,s=null,c=null,l=0,u=null,d,f;function p(t){f=e.applySlotToElement(t,d,f)}function m(){if(s!==null)return s;let e=document.createElement(`div`);return e.className=`ssg-tooltip`,e.setAttribute(`aria-hidden`,`true`),f=void 0,p(e),document.body.appendChild(e),s=e,e}function h(){c!==null&&(window.clearTimeout(c),c=null)}function g(){h(),u!==null&&(l=Date.now()+a),u=null,s!==null&&s.classList.remove(`ssg-tooltip--visible`)}function _(e){let r=e.getAttribute(n),i=r!==null&&r!==``?r:(e.textContent??``).trim();if(i===``)return;let a=m();a.classList.toggle(`ssg-theme-dark`,e.closest(`.ssg-theme-dark`)!==null),a.classList.toggle(`ssg-motion-off`,e.closest(`.ssg-motion-off`)!==null),a.textContent=i,a.style.left=`0px`,a.style.top=`0px`;let o=t.computeTooltipPlacement({targetRect:e.getBoundingClientRect(),tipWidth:a.offsetWidth,tipHeight:a.offsetHeight,viewportWidth:window.innerWidth});a.style.left=`${o.left}px`,a.style.top=`${o.top}px`,a.classList.add(`ssg-tooltip--visible`),u=e}function v(e){let t=e.target;if(!(t instanceof Element))return;let a=t.closest(r);if(a===null||a===u||!a.hasAttribute(n)&&a.scrollWidth<=a.clientWidth+1)return;let o=u!==null;g(),o||Date.now()<l?_(a):c=window.setTimeout(()=>{c=null,_(a)},i)}function y(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(r);if(n===null)return;let i=e.relatedTarget;i instanceof Node&&n.contains(i)||g()}function b(){g()}function x(e){e.key===`Escape`&&g()}function S(){window.addEventListener(`pointerover`,v,!0),window.addEventListener(`pointerout`,y,!0),window.addEventListener(`focusin`,v,!0),window.addEventListener(`focusout`,y,!0),window.addEventListener(`pointerdown`,b,!0),window.addEventListener(`scroll`,b,!0),window.addEventListener(`keydown`,x,!0)}function C(){window.removeEventListener(`pointerover`,v,!0),window.removeEventListener(`pointerout`,y,!0),window.removeEventListener(`focusin`,v,!0),window.removeEventListener(`focusout`,y,!0),window.removeEventListener(`pointerdown`,b,!0),window.removeEventListener(`scroll`,b,!0),window.removeEventListener(`keydown`,x,!0)}function w(e){o+=1,o===1&&S();let t=!1,n=e=>{d=e,s!==null&&p(s)};return n(e),{setSlot:n,dispose:()=>{t||(t=!0,--o,o===0&&(C(),h(),u=null,s!==null&&(s.remove(),s=null)))}}}exports.acquireTooltipController=w;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/slotDom.cjs"),t=require("../logic/tooltipGeometry.cjs");var n=`data-ssg-tooltip`,r=`[${n}], [data-ssg-tooltip-overflow]`,i=350,a=800,o=0,s=null,c=null,l=0,u=null,d,f;function p(t){f=e.applySlotToElement(t,d,f)}function m(){if(s!==null)return s;let e=document.createElement(`div`);return e.className=`ssg-tooltip`,e.setAttribute(`aria-hidden`,`true`),f=void 0,p(e),document.body.appendChild(e),s=e,e}function h(){c!==null&&(window.clearTimeout(c),c=null)}function g(){h(),u!==null&&(l=Date.now()+a),u=null,s!==null&&s.classList.remove(`ssg-tooltip--visible`)}function _(e){let r=e.getAttribute(n),i=r!==null&&r!==``?r:(e.textContent??``).trim();if(i===``)return;let a=m();a.classList.toggle(`ssg-theme-dark`,e.closest(`.ssg-theme-dark`)!==null),a.classList.toggle(`ssg-motion-off`,e.closest(`.ssg-motion-off`)!==null),a.textContent=i,a.style.left=`0px`,a.style.top=`0px`;let o=t.computeTooltipPlacement({targetRect:e.getBoundingClientRect(),tipWidth:a.offsetWidth,tipHeight:a.offsetHeight,viewportWidth:window.innerWidth});a.style.left=`${o.left}px`,a.style.top=`${o.top}px`,a.classList.add(`ssg-tooltip--visible`),u=e}function v(e){let t=e.target;if(!(t instanceof Element)||typeof PointerEvent<`u`&&e instanceof PointerEvent&&e.buttons!==0)return;let a=t.closest(r);if(a===null||a===u||!a.hasAttribute(n)&&a.scrollWidth<=a.clientWidth+1)return;let o=u!==null;g(),o||Date.now()<l?_(a):c=window.setTimeout(()=>{c=null,_(a)},i)}function y(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(r);if(n===null)return;let i=e.relatedTarget;i instanceof Node&&n.contains(i)||g()}function b(){g()}function x(e){e.key===`Escape`&&g()}function S(){window.addEventListener(`pointerover`,v,!0),window.addEventListener(`pointerout`,y,!0),window.addEventListener(`focusin`,v,!0),window.addEventListener(`focusout`,y,!0),window.addEventListener(`pointerdown`,b,!0),window.addEventListener(`scroll`,b,!0),window.addEventListener(`keydown`,x,!0)}function C(){window.removeEventListener(`pointerover`,v,!0),window.removeEventListener(`pointerout`,y,!0),window.removeEventListener(`focusin`,v,!0),window.removeEventListener(`focusout`,y,!0),window.removeEventListener(`pointerdown`,b,!0),window.removeEventListener(`scroll`,b,!0),window.removeEventListener(`keydown`,x,!0)}function w(e){o+=1,o===1&&S();let t=!1,n=e=>{d=e,s!==null&&p(s)};return n(e),{setSlot:n,dispose:()=>{t||(t=!0,--o,o===0&&(C(),h(),u=null,s!==null&&(s.remove(),s=null)))}}}exports.acquireTooltipController=w;
@@ -31,7 +31,7 @@ function _(e) {
31
31
  }
32
32
  function v(e) {
33
33
  let t = e.target;
34
- if (!(t instanceof Element)) return;
34
+ if (!(t instanceof Element) || typeof PointerEvent < "u" && e instanceof PointerEvent && e.buttons !== 0) return;
35
35
  let a = t.closest(r);
36
36
  if (a === null || a === u || !a.hasAttribute(n) && a.scrollWidth <= a.clientWidth + 1) return;
37
37
  let o = u !== null;
@@ -1639,6 +1639,17 @@ export type SpreadsheetGridProps<T, F extends GridFrameworkTypes = GridFramework
1639
1639
  * @defaultValue `'ghost'`
1640
1640
  */
1641
1641
  rowDragMotion?: 'ghost' | 'live';
1642
+ /**
1643
+ * 列ヘッダーのドラッグ並べ替え(`onColumnsChange` 指定時)の表示方式。`'ghost'` は従来(ゴースト +
1644
+ * 縦線、ドロップ後に新しい位置へスライド)。`'live'` は同じペイン内では掴んだ列(ヘッダー +
1645
+ * 描画中のセル)がポインタに追従し、通る先の列がその場で左右へ退避する(ドロップ先が「隙間」
1646
+ * として見える。枠外で離しても直前の位置へ確定、`Esc` で元へ戻る)。
1647
+ * 固定列のペインをまたいで移す(固定の変更)ときは `'ghost'` と同じ縦線 + ゴーストに切り替わる。
1648
+ * `motion` が `'off'` のときは `'ghost'` と同じ。
1649
+ *
1650
+ * @defaultValue `'ghost'`
1651
+ */
1652
+ columnDragMotion?: 'ghost' | 'live';
1642
1653
  /**
1643
1654
  * **セル内検索**。`true` でグリッド右上の検索バー(`.ssg-find-bar`)と
1644
1655
  * `Ctrl/Cmd+F`(グリッドにフォーカスがあるときだけ横取り)が有効になる。表示文字列(`valueFormatter`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ishibashi0112/spreadsheet-grid-core",
3
- "version": "0.46.1",
3
+ "version": "0.47.1",
4
4
  "description": "SpreadsheetGrid のフレームワーク非依存コア(状態 / 派生値計算 / コマンド / DOM コントローラ)。React 版 @ishibashi0112/spreadsheet-grid と将来の Solid 版が共有します。",
5
5
  "keywords": [
6
6
  "grid",