@ishibashi0112/spreadsheet-grid-core 0.46.1 → 0.47.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/controllers/columnHeaderDragController.cjs +1 -1
- package/dist/controllers/columnHeaderDragController.d.ts +1 -0
- package/dist/controllers/columnHeaderDragController.js +132 -74
- package/dist/controllers/rowEnterController.cjs +1 -1
- package/dist/controllers/rowEnterController.d.ts +1 -0
- package/dist/controllers/rowEnterController.js +65 -30
- package/dist/model/gridTypes.core.d.ts +11 -0
- package/package.json +1 -1
|
@@ -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},
|
|
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=`transform 160ms ${m}`,_=`data-ssg-col-dragging`,v=`4`,y=t=>{let n=[];return t.querySelectorAll(`[data-ssg-col-key]`).forEach(r=>{e.isInsideDetailCardOf(t,r)||n.push(r)}),n},b=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},x=()=>{let x=null,S=null,C=null,w=null,T={x:0,y:0},E=null,D=!1,O=null,k=null,A=null,j=null,M=null,N=null,P=0,F=null,I=null,L=``,R=()=>x?.motion===`live`,z=()=>({left:x?.leftIndicatorRef.current??null,center:x?.centerIndicatorRef.current??null,right:x?.rightIndicatorRef.current??null}),B=()=>{for(let e of Object.values(z()))e&&(e.style.display=`none`)},V=e=>{if(A)return;let t=document.createElement(`div`);t.setAttribute(`data-grid-drag-ghost`,``),x?.scrollContainerRef.current?.closest(`.ssg-theme-dark`)!=null&&t.classList.add(`ssg-theme-dark`),x?.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,x?.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),A=t,j=n,M=null},H=e=>{let t=A;if(!t)return;t.style.transform=`translate(`+(T.x+s)+`px,`+(T.y+c)+`px)`;let n=e??`out`;if(M===n)return;M=n;let r=j;n===`out`?(t.style.opacity=f,r&&(r.innerHTML=d)):(t.style.opacity=`1`,r&&(r.innerHTML=n===`center`?l:u))},U=()=>{A&&A.parentNode&&A.parentNode.removeChild(A),A=null,j=null,M=null},W=(e,n)=>{if(x===null)return null;let{paneLayout:r,leftPaneScrollRef:i,rightPaneScrollRef:s,bodyScrollRef:c,scrollContainerRef:l,leftLeadingWidth:u,centerLeadingWidth:d,rightLeadingWidth:f}=x,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},G=e=>{let t=z();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`)}},K=(e,t)=>{let n=I?.get(t);n!==void 0&&I?.delete(t),e.set(t,n??t.style.zIndex)},q=(e,t)=>{let n=F,r=S,i=N;if(!n||r===null||i===null||x===null)return;let a=x.scrollContainerRef.current;if(!a)return;let o=x.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-P:0,f=(E?T.x-E.x:0)+d;for(let e of y(a)){let i=e.dataset.ssgColKey;if(i===void 0)continue;if(i===r){n.has(e)||(K(n,e),e.style.zIndex=v,e.style.willChange=`transform`),t?(e.setAttribute(_,`live`),e.style.transition=`none`,e.style.transform=`translateX(${f}px)`):(e.removeAttribute(_),e.style.transition=g,e.style.transform=`translateX(0px)`);continue}let a=u.get(i)??0;if(a===0&&!n.has(e))continue;n.has(e)||K(n,e);let o=`translateX(${a}px)`;e.style.transform!==o&&(e.style.transition=g,e.style.transform=o)}},J=e=>{e.forEach((e,t)=>{t.style.transition=``,t.style.transform=``,t.style.willChange=``,t.style.zIndex=e,t.removeAttribute(_)})},Y=()=>{let e=W(T.x,T.y);if(R()){e&&(C={pane:e.pane,slot:e.slot});let t=C;if(t!==null&&t.pane!==N){V(L),H(t.pane),e&&G(e),q(null,!1);return}U(),B(),q(t===null?null:t.slot,!0);return}if(H(e?e.pane:null),!e){C=null,B();return}C={pane:e.pane,slot:e.slot},G(e)},X=()=>{if(S===null){k=null;return}let e=x?.scrollContainerRef.current??null;if(e&&(D||(!E||n.hasPointerLeftActivationRadius(E,T,6))&&(D=!0),D)){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(T.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`})}Y(),k=requestAnimationFrame(X)},Z=e=>{k!==null&&(cancelAnimationFrame(k),k=null),document.body.style.cursor=``,B(),U();let n=S,r=C;S=null,C=null,E=null;let a=F;F=null,N=null;let o=e&&n&&r&&x!==null?i(x.columns,n,r.pane,r.slot):null;if(a&&!o&&(a.forEach((e,t)=>{t.isConnected&&(t.style.transition=g,t.style.transform=`translateX(0px)`)}),I=a,window.setTimeout(()=>{J(a),I===a&&(I=null)},200)),!o||!n||!r||x===null)return;let{columns:s,applyColumnOrderAndPin:c,scrollContainerRef:l}=x,u=s.find(e=>e.key===n),d=u?t.getColumnPane(u):null;w=d!==null&&d===r.pane&&!h(l.current)?b(l.current):null,a&&J(a),c(o,new Map([[n,r.pane===`center`?void 0:r.pane]]))};return{update:e=>{x=e},onColumnDragHandlePointerDown:(e,n)=>{if(x===null||!x.enabled||n.button!==0)return;n.stopPropagation(),n.preventDefault(),S=e.key,C=null,T={x:n.clientX,y:n.clientY},E={x:n.clientX,y:n.clientY},D=!1,document.body.style.cursor=`grabbing`,L=e.title||e.key,R()?(N=t.getColumnPane(e),P=x.scrollContainerRef.current?.scrollLeft??0,F=new Map):V(L);let r=n.currentTarget,i=n.pointerId;try{r.setPointerCapture(i)}catch{}let a=e=>{e.pointerId===i&&(T={x:e.clientX,y:e.clientY},Y())},o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),window.removeEventListener(`keydown`,l),O=null;try{r.releasePointerCapture(i)}catch{}};function s(e){e.pointerId===i&&(o(),Z(!0))}function c(e){e.pointerId===i&&(o(),Z(!1))}function l(e){e.key===`Escape`&&(o(),Z(!1))}window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,s),window.addEventListener(`pointercancel`,c),window.addEventListener(`keydown`,l),O=o,Y(),k=requestAnimationFrame(X)},applyReorderSettle:()=>{let t=w;if(w=null,!t)return;let n=x?.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:()=>{O?.(),O=null,k!==null&&(cancelAnimationFrame(k),k=null),S=null,C=null,document.body.style.cursor=``,U(),F&&J(F),F=null,N=null}}};exports.computeHeaderReorderedKeys=i,exports.createColumnHeaderDragController=x;
|
|
@@ -26,7 +26,12 @@ function l(e, t, r, i) {
|
|
|
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)",
|
|
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)", ee = (e) => e?.closest(".ssg-motion-off") != null, b = `transform 160ms ${y}`, x = "data-ssg-col-dragging", S = "4", C = (t) => {
|
|
30
|
+
let n = [];
|
|
31
|
+
return t.querySelectorAll("[data-ssg-col-key]").forEach((r) => {
|
|
32
|
+
e(t, r) || n.push(r);
|
|
33
|
+
}), n;
|
|
34
|
+
}, te = (t) => {
|
|
30
35
|
if (!t) return null;
|
|
31
36
|
let n = /* @__PURE__ */ new Map();
|
|
32
37
|
return t.querySelectorAll("[data-ssg-col-key]").forEach((r) => {
|
|
@@ -34,20 +39,20 @@ var u = 32, d = 2, f = 14, p = 12, m = "<svg viewBox=\"0 0 24 24\" width=\"14\"
|
|
|
34
39
|
let i = r.dataset.ssgColKey;
|
|
35
40
|
i && !n.has(i) && n.set(i, r.getBoundingClientRect().left);
|
|
36
41
|
}), n;
|
|
37
|
-
},
|
|
38
|
-
let
|
|
42
|
+
}, w = () => {
|
|
43
|
+
let w = null, T = null, E = null, D = null, O = {
|
|
39
44
|
x: 0,
|
|
40
45
|
y: 0
|
|
41
|
-
},
|
|
42
|
-
left:
|
|
43
|
-
center:
|
|
44
|
-
right:
|
|
45
|
-
}),
|
|
46
|
-
for (let e of Object.values(
|
|
47
|
-
},
|
|
48
|
-
if (
|
|
46
|
+
}, k = null, A = !1, j = null, M = null, N = null, P = null, F = null, I = null, L = 0, R = null, z = null, B = "", V = () => w?.motion === "live", H = () => ({
|
|
47
|
+
left: w?.leftIndicatorRef.current ?? null,
|
|
48
|
+
center: w?.centerIndicatorRef.current ?? null,
|
|
49
|
+
right: w?.rightIndicatorRef.current ?? null
|
|
50
|
+
}), U = () => {
|
|
51
|
+
for (let e of Object.values(H())) e && (e.style.display = "none");
|
|
52
|
+
}, W = (e) => {
|
|
53
|
+
if (N) return;
|
|
49
54
|
let t = document.createElement("div");
|
|
50
|
-
t.setAttribute("data-grid-drag-ghost", ""),
|
|
55
|
+
t.setAttribute("data-grid-drag-ghost", ""), w?.scrollContainerRef.current?.closest(".ssg-theme-dark") != null && t.classList.add("ssg-theme-dark"), w?.scrollContainerRef.current?.closest(".ssg-motion-off") != null && t.classList.add("ssg-motion-off"), t.style.cssText = [
|
|
51
56
|
"position:fixed",
|
|
52
57
|
"top:0",
|
|
53
58
|
"left:0",
|
|
@@ -69,25 +74,25 @@ var u = 32, d = 2, f = 14, p = 12, m = "<svg viewBox=\"0 0 24 24\" width=\"14\"
|
|
|
69
74
|
"z-index:9999",
|
|
70
75
|
"will-change:transform",
|
|
71
76
|
"transform:translate(-9999px,-9999px)"
|
|
72
|
-
].join(";"), c(t,
|
|
77
|
+
].join(";"), c(t, w?.ghostSlot);
|
|
73
78
|
let n = document.createElement("span");
|
|
74
79
|
n.style.cssText = "display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none";
|
|
75
80
|
let r = document.createElement("span");
|
|
76
|
-
r.textContent = e, t.appendChild(n), t.appendChild(r), document.body.appendChild(t),
|
|
77
|
-
},
|
|
78
|
-
let t =
|
|
81
|
+
r.textContent = e, t.appendChild(n), t.appendChild(r), document.body.appendChild(t), N = t, P = n, F = null;
|
|
82
|
+
}, G = (e) => {
|
|
83
|
+
let t = N;
|
|
79
84
|
if (!t) return;
|
|
80
|
-
t.style.transform = "translate(" + (
|
|
85
|
+
t.style.transform = "translate(" + (O.x + f) + "px," + (O.y + p) + "px)";
|
|
81
86
|
let n = e ?? "out";
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
let r =
|
|
87
|
+
if (F === n) return;
|
|
88
|
+
F = n;
|
|
89
|
+
let r = P;
|
|
85
90
|
n === "out" ? (t.style.opacity = _, r && (r.innerHTML = g)) : (t.style.opacity = "1", r && (r.innerHTML = n === "center" ? m : h));
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
if (
|
|
90
|
-
let { paneLayout: i, leftPaneScrollRef: a, rightPaneScrollRef: o, bodyScrollRef: s, scrollContainerRef: c, leftLeadingWidth: l, centerLeadingWidth: f, rightLeadingWidth: p } =
|
|
91
|
+
}, K = () => {
|
|
92
|
+
N && N.parentNode && N.parentNode.removeChild(N), N = null, P = null, F = null;
|
|
93
|
+
}, ne = (e, n) => {
|
|
94
|
+
if (w === null) return null;
|
|
95
|
+
let { paneLayout: i, leftPaneScrollRef: a, rightPaneScrollRef: o, bodyScrollRef: s, scrollContainerRef: c, leftLeadingWidth: l, centerLeadingWidth: f, rightLeadingWidth: p } = w, m = c.current;
|
|
91
96
|
if (m) {
|
|
92
97
|
let t = m.getBoundingClientRect();
|
|
93
98
|
if (e < t.left || e > t.right || n < t.top || n > t.bottom) return null;
|
|
@@ -135,17 +140,8 @@ var u = 32, d = 2, f = 14, p = 12, m = "<svg viewBox=\"0 0 24 24\" width=\"14\"
|
|
|
135
140
|
};
|
|
136
141
|
}
|
|
137
142
|
return null;
|
|
138
|
-
},
|
|
139
|
-
let
|
|
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();
|
|
143
|
+
}, q = (e) => {
|
|
144
|
+
let t = H();
|
|
149
145
|
for (let n of [
|
|
150
146
|
"left",
|
|
151
147
|
"center",
|
|
@@ -154,13 +150,66 @@ var u = 32, d = 2, f = 14, p = 12, m = "<svg viewBox=\"0 0 24 24\" width=\"14\"
|
|
|
154
150
|
let r = t[n];
|
|
155
151
|
r && (n === e.pane ? (r.style.left = `${e.leftPx}px`, r.style.display = "block") : r.style.display = "none");
|
|
156
152
|
}
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
|
|
153
|
+
}, J = (e, t) => {
|
|
154
|
+
let n = z?.get(t);
|
|
155
|
+
n !== void 0 && z?.delete(t), e.set(t, n ?? t.style.zIndex);
|
|
156
|
+
}, Y = (e, t) => {
|
|
157
|
+
let n = R, r = T, i = I;
|
|
158
|
+
if (!n || r === null || i === null || w === null) return;
|
|
159
|
+
let a = w.scrollContainerRef.current;
|
|
160
|
+
if (!a) return;
|
|
161
|
+
let o = w.paneLayout[i].entries, s = o.findIndex((e) => e.column.key === r);
|
|
162
|
+
if (s < 0) return;
|
|
163
|
+
let c = o[s].paneLocalSize, l = !t || e === null ? s : e > s ? e - 1 : e, u = /* @__PURE__ */ new Map();
|
|
164
|
+
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);
|
|
165
|
+
let d = i === "center" ? a.scrollLeft - L : 0, f = (k ? O.x - k.x : 0) + d;
|
|
166
|
+
for (let e of C(a)) {
|
|
167
|
+
let i = e.dataset.ssgColKey;
|
|
168
|
+
if (i === void 0) continue;
|
|
169
|
+
if (i === r) {
|
|
170
|
+
n.has(e) || (J(n, e), e.style.zIndex = S, e.style.willChange = "transform"), t ? (e.setAttribute(x, "live"), e.style.transition = "none", e.style.transform = `translateX(${f}px)`) : (e.removeAttribute(x), e.style.transition = b, e.style.transform = "translateX(0px)");
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
let a = u.get(i) ?? 0;
|
|
174
|
+
if (a === 0 && !n.has(e)) continue;
|
|
175
|
+
n.has(e) || J(n, e);
|
|
176
|
+
let o = `translateX(${a}px)`;
|
|
177
|
+
e.style.transform !== o && (e.style.transition = b, e.style.transform = o);
|
|
178
|
+
}
|
|
179
|
+
}, X = (e) => {
|
|
180
|
+
e.forEach((e, t) => {
|
|
181
|
+
t.style.transition = "", t.style.transform = "", t.style.willChange = "", t.style.zIndex = e, t.removeAttribute(x);
|
|
182
|
+
});
|
|
183
|
+
}, Z = () => {
|
|
184
|
+
let e = ne(O.x, O.y);
|
|
185
|
+
if (V()) {
|
|
186
|
+
e && (E = {
|
|
187
|
+
pane: e.pane,
|
|
188
|
+
slot: e.slot
|
|
189
|
+
});
|
|
190
|
+
let t = E;
|
|
191
|
+
if (t !== null && t.pane !== I) {
|
|
192
|
+
W(B), G(t.pane), e && q(e), Y(null, !1);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
K(), U(), Y(t === null ? null : t.slot, !0);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (G(e ? e.pane : null), !e) {
|
|
199
|
+
E = null, U();
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
E = {
|
|
203
|
+
pane: e.pane,
|
|
204
|
+
slot: e.slot
|
|
205
|
+
}, q(e);
|
|
206
|
+
}, Q = () => {
|
|
207
|
+
if (T === null) {
|
|
208
|
+
M = null;
|
|
160
209
|
return;
|
|
161
210
|
}
|
|
162
|
-
let e =
|
|
163
|
-
if (e && (
|
|
211
|
+
let e = w?.scrollContainerRef.current ?? null;
|
|
212
|
+
if (e && (A || (!k || a(k, O, 6)) && (A = !0), A)) {
|
|
164
213
|
let t = e.getBoundingClientRect(), n = s({
|
|
165
214
|
rectLeft: t.left,
|
|
166
215
|
rectTop: t.top,
|
|
@@ -168,62 +217,71 @@ var u = 32, d = 2, f = 14, p = 12, m = "<svg viewBox=\"0 0 24 24\" width=\"14\"
|
|
|
168
217
|
clientTop: e.clientTop,
|
|
169
218
|
clientWidth: e.clientWidth,
|
|
170
219
|
clientHeight: e.clientHeight
|
|
171
|
-
}), r = o(
|
|
220
|
+
}), r = o(O.x, n.left, n.right, 24), a = i(e.scrollLeft, r, 18, e.scrollWidth - e.clientWidth);
|
|
172
221
|
a !== e.scrollLeft && e.scrollTo({
|
|
173
222
|
left: a,
|
|
174
223
|
behavior: "auto"
|
|
175
224
|
});
|
|
176
225
|
}
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
let t =
|
|
181
|
-
|
|
182
|
-
let
|
|
183
|
-
|
|
184
|
-
let
|
|
185
|
-
|
|
226
|
+
Z(), M = requestAnimationFrame(Q);
|
|
227
|
+
}, $ = (e) => {
|
|
228
|
+
M !== null && (cancelAnimationFrame(M), M = null), document.body.style.cursor = "", U(), K();
|
|
229
|
+
let t = T, r = E;
|
|
230
|
+
T = null, E = null, k = null;
|
|
231
|
+
let i = R;
|
|
232
|
+
R = null, I = null;
|
|
233
|
+
let a = e && t && r && w !== null ? l(w.columns, t, r.pane, r.slot) : null;
|
|
234
|
+
if (i && !a && (i.forEach((e, t) => {
|
|
235
|
+
t.isConnected && (t.style.transition = b, t.style.transform = "translateX(0px)");
|
|
236
|
+
}), z = i, window.setTimeout(() => {
|
|
237
|
+
X(i), z === i && (z = null);
|
|
238
|
+
}, 200)), !a || !t || !r || w === null) return;
|
|
239
|
+
let { columns: o, applyColumnOrderAndPin: s, scrollContainerRef: c } = w, u = o.find((e) => e.key === t), d = u ? n(u) : null;
|
|
240
|
+
D = d !== null && d === r.pane && !ee(c.current) ? te(c.current) : null, i && X(i), s(a, /* @__PURE__ */ new Map([[t, r.pane === "center" ? void 0 : r.pane]]));
|
|
186
241
|
};
|
|
187
242
|
return {
|
|
188
243
|
update: (e) => {
|
|
189
|
-
|
|
244
|
+
w = e;
|
|
190
245
|
},
|
|
191
246
|
onColumnDragHandlePointerDown: (e, t) => {
|
|
192
|
-
if (
|
|
193
|
-
t.stopPropagation(), t.preventDefault(),
|
|
247
|
+
if (w === null || !w.enabled || t.button !== 0) return;
|
|
248
|
+
t.stopPropagation(), t.preventDefault(), T = e.key, E = null, O = {
|
|
194
249
|
x: t.clientX,
|
|
195
250
|
y: t.clientY
|
|
196
|
-
},
|
|
251
|
+
}, k = {
|
|
197
252
|
x: t.clientX,
|
|
198
253
|
y: t.clientY
|
|
199
|
-
},
|
|
200
|
-
let
|
|
254
|
+
}, A = !1, document.body.style.cursor = "grabbing", B = e.title || e.key, V() ? (I = n(e), L = w.scrollContainerRef.current?.scrollLeft ?? 0, R = /* @__PURE__ */ new Map()) : W(B);
|
|
255
|
+
let r = t.currentTarget, i = t.pointerId;
|
|
201
256
|
try {
|
|
202
|
-
|
|
257
|
+
r.setPointerCapture(i);
|
|
203
258
|
} catch {}
|
|
204
|
-
let
|
|
205
|
-
e.pointerId ===
|
|
259
|
+
let a = (e) => {
|
|
260
|
+
e.pointerId === i && (O = {
|
|
206
261
|
x: e.clientX,
|
|
207
262
|
y: e.clientY
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
window.removeEventListener("pointermove",
|
|
263
|
+
}, Z());
|
|
264
|
+
}, o = () => {
|
|
265
|
+
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", s), window.removeEventListener("pointercancel", c), window.removeEventListener("keydown", l), j = null;
|
|
211
266
|
try {
|
|
212
|
-
|
|
267
|
+
r.releasePointerCapture(i);
|
|
213
268
|
} catch {}
|
|
214
269
|
};
|
|
215
|
-
function o(e) {
|
|
216
|
-
e.pointerId === r && (a(), H(!0));
|
|
217
|
-
}
|
|
218
270
|
function s(e) {
|
|
219
|
-
e.pointerId ===
|
|
271
|
+
e.pointerId === i && (o(), $(!0));
|
|
272
|
+
}
|
|
273
|
+
function c(e) {
|
|
274
|
+
e.pointerId === i && (o(), $(!1));
|
|
275
|
+
}
|
|
276
|
+
function l(e) {
|
|
277
|
+
e.key === "Escape" && (o(), $(!1));
|
|
220
278
|
}
|
|
221
|
-
window.addEventListener("pointermove",
|
|
279
|
+
window.addEventListener("pointermove", a), window.addEventListener("pointerup", s), window.addEventListener("pointercancel", c), window.addEventListener("keydown", l), j = o, Z(), M = requestAnimationFrame(Q);
|
|
222
280
|
},
|
|
223
281
|
applyReorderSettle: () => {
|
|
224
|
-
let t =
|
|
225
|
-
if (
|
|
226
|
-
let n =
|
|
282
|
+
let t = D;
|
|
283
|
+
if (D = null, !t) return;
|
|
284
|
+
let n = w?.scrollContainerRef.current ?? null;
|
|
227
285
|
if (!n) return;
|
|
228
286
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
229
287
|
n.querySelectorAll("[data-ssg-col-key]").forEach((a) => {
|
|
@@ -248,9 +306,9 @@ var u = 32, d = 2, f = 14, p = 12, m = "<svg viewBox=\"0 0 24 24\" width=\"14\"
|
|
|
248
306
|
}
|
|
249
307
|
},
|
|
250
308
|
dispose: () => {
|
|
251
|
-
|
|
309
|
+
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
310
|
}
|
|
253
311
|
};
|
|
254
312
|
};
|
|
255
313
|
//#endregion
|
|
256
|
-
export { l as computeHeaderReorderedKeys,
|
|
314
|
+
export { l as computeHeaderReorderedKeys, w as createColumnHeaderDragController };
|
|
@@ -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`),
|
|
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 = (
|
|
3
|
-
|
|
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
|
-
},
|
|
10
|
+
}, d = /* @__PURE__ */ new Map(), f = (n) => {
|
|
7
11
|
n.classList.remove(e), n.style.removeProperty(t);
|
|
8
|
-
let r =
|
|
9
|
-
r !== void 0 && (clearTimeout(r),
|
|
10
|
-
},
|
|
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),
|
|
17
|
+
n.removeEventListener("animationend", a), f(n);
|
|
14
18
|
};
|
|
15
|
-
n.addEventListener("animationend", a),
|
|
16
|
-
n.removeEventListener("animationend", a),
|
|
19
|
+
n.addEventListener("animationend", a), d.set(n, setTimeout(() => {
|
|
20
|
+
n.removeEventListener("animationend", a), f(n);
|
|
17
21
|
}, r));
|
|
18
|
-
},
|
|
19
|
-
let
|
|
20
|
-
for (let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
59
|
+
h.set(e, Math.min(t, 12));
|
|
31
60
|
});
|
|
32
|
-
for (let e of
|
|
33
|
-
},
|
|
34
|
-
n?.disconnect(), n = null,
|
|
35
|
-
for (let e of Array.from(
|
|
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
|
-
|
|
68
|
+
u = {
|
|
40
69
|
skeletonEnter: t,
|
|
41
70
|
mountEnter: r
|
|
42
71
|
};
|
|
43
72
|
let i = t || r ? e.current : null;
|
|
44
|
-
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
|
-
}),
|
|
82
|
+
}), a = i, l = r));
|
|
48
83
|
},
|
|
49
|
-
dispose:
|
|
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,
|
|
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 };
|
|
@@ -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