@ishibashi0112/spreadsheet-grid-core 0.48.0 → 0.49.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/autoHeightMeasurer.cjs +1 -1
- package/dist/controllers/autoHeightMeasurer.js +4 -2
- package/dist/controllers/clipboardController.cjs +1 -1
- package/dist/controllers/clipboardController.d.ts +2 -1
- package/dist/controllers/clipboardController.js +67 -61
- package/dist/controllers/columnAutosizeRunner.cjs +1 -1
- package/dist/controllers/columnAutosizeRunner.d.ts +3 -0
- package/dist/controllers/columnAutosizeRunner.js +40 -24
- package/dist/controllers/columnHeaderDragController.cjs +1 -1
- package/dist/controllers/columnHeaderDragController.js +5 -2
- package/dist/controllers/editController.cjs +1 -1
- package/dist/controllers/editController.js +2 -2
- package/dist/controllers/fillHandleController.cjs +1 -0
- package/dist/controllers/fillHandleController.d.ts +87 -0
- package/dist/controllers/fillHandleController.js +346 -0
- package/dist/controllers/filterPopoverController.cjs +1 -1
- package/dist/controllers/filterPopoverController.js +55 -46
- package/dist/controllers/globalFilteredOrder.cjs +1 -1
- package/dist/controllers/globalFilteredOrder.js +5 -5
- package/dist/controllers/historyController.cjs +1 -1
- package/dist/controllers/historyController.d.ts +1 -0
- package/dist/controllers/historyController.js +8 -5
- package/dist/controllers/keyboardController.cjs +1 -1
- package/dist/controllers/keyboardController.js +2 -2
- package/dist/controllers/pointerInteractionsController.cjs +1 -1
- package/dist/controllers/pointerInteractionsController.d.ts +2 -0
- package/dist/controllers/pointerInteractionsController.js +136 -132
- package/dist/controllers/rowDragController.cjs +1 -1
- package/dist/controllers/rowDragController.d.ts +1 -0
- package/dist/controllers/rowDragController.js +104 -97
- package/dist/controllers/scrollSyncController.cjs +1 -1
- package/dist/controllers/scrollSyncController.d.ts +1 -0
- package/dist/controllers/scrollSyncController.js +32 -21
- package/dist/controllers/selectOptionsCollector.cjs +1 -1
- package/dist/controllers/selectOptionsCollector.js +5 -5
- package/dist/controllers/selectionAggregatesRunner.cjs +1 -0
- package/dist/controllers/selectionAggregatesRunner.d.ts +27 -0
- package/dist/controllers/selectionAggregatesRunner.js +65 -0
- package/dist/controllers/serverSideRowModel.cjs +1 -1
- package/dist/controllers/serverSideRowModel.js +75 -69
- package/dist/controllers/tooltipController.cjs +1 -1
- package/dist/controllers/tooltipController.js +44 -43
- package/dist/controllers/viewportSyncController.cjs +1 -1
- package/dist/controllers/viewportSyncController.d.ts +3 -2
- package/dist/controllers/viewportSyncController.js +6 -4
- package/dist/engine/columnCommands.cjs +1 -1
- package/dist/engine/columnCommands.js +1 -1
- package/dist/engine/columnLayout.cjs +1 -1
- package/dist/engine/columnLayout.js +1 -1
- package/dist/engine/createGridEngine.cjs +1 -1
- package/dist/engine/createGridEngine.d.ts +2 -0
- package/dist/engine/createGridEngine.js +43 -41
- package/dist/engine/gridApi.cjs +1 -1
- package/dist/engine/gridApi.d.ts +6 -0
- package/dist/engine/gridApi.js +134 -123
- package/dist/logic/aggregation.cjs +1 -1
- package/dist/logic/aggregation.d.ts +1 -0
- package/dist/logic/aggregation.js +16 -7
- package/dist/logic/autoScrollGeometry.cjs +1 -1
- package/dist/logic/autoScrollGeometry.d.ts +1 -0
- package/dist/logic/autoScrollGeometry.js +3 -3
- package/dist/logic/clearCells.cjs +1 -1
- package/dist/logic/clearCells.d.ts +1 -1
- package/dist/logic/clearCells.js +7 -7
- package/dist/logic/columnAutosize.cjs +1 -1
- package/dist/logic/columnAutosize.d.ts +6 -0
- package/dist/logic/columnAutosize.js +60 -39
- package/dist/logic/exportCsv.cjs +2 -2
- package/dist/logic/exportCsv.d.ts +5 -1
- package/dist/logic/exportCsv.js +16 -15
- package/dist/logic/exportData.cjs +1 -1
- package/dist/logic/exportData.d.ts +2 -1
- package/dist/logic/exportData.js +27 -21
- package/dist/logic/fillHandle.cjs +1 -0
- package/dist/logic/fillHandle.d.ts +69 -0
- package/dist/logic/fillHandle.js +254 -0
- package/dist/logic/fillSeries.cjs +1 -0
- package/dist/logic/fillSeries.d.ts +11 -0
- package/dist/logic/fillSeries.js +239 -0
- package/dist/logic/filtering.cjs +1 -1
- package/dist/logic/filtering.js +37 -37
- package/dist/logic/gridState.cjs +1 -1
- package/dist/logic/gridState.js +1 -1
- package/dist/logic/imeInput.cjs +1 -1
- package/dist/logic/imeInput.js +2 -2
- package/dist/logic/labelRows.cjs +1 -1
- package/dist/logic/labelRows.js +1 -1
- package/dist/logic/selectOptions.cjs +1 -1
- package/dist/logic/selectOptions.js +1 -1
- package/dist/logic/selectionAggregates.cjs +1 -0
- package/dist/logic/selectionAggregates.d.ts +25 -0
- package/dist/logic/selectionAggregates.js +74 -0
- package/dist/logic/totalRow.cjs +1 -0
- package/dist/logic/totalRow.d.ts +25 -0
- package/dist/logic/totalRow.js +90 -0
- package/dist/model/gridReducer.cjs +1 -1
- package/dist/model/gridReducer.js +1 -1
- package/dist/model/gridTypes.core.d.ts +202 -16
- package/dist/model/gridTypes.unbound.d.ts +4 -0
- package/dist/utils/clipboard.cjs +1 -1
- package/dist/utils/clipboard.d.ts +1 -1
- package/dist/utils/clipboard.js +9 -9
- package/dist/utils/permissions.cjs +1 -1
- package/dist/utils/permissions.d.ts +6 -2
- package/dist/utils/permissions.js +8 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../utils/permissions.cjs");var t=21,n=4,r=41,i=13,a=600,o=60,s=16,c=null,l=()=>c||(typeof document>`u`?null:(c=document.createElement(`canvas`).getContext(`2d`),c)),u=`system-ui, sans-serif`,d=e=>{let t=u,n=13,r=`400`;if(e&&typeof window<`u`){let i=window.getComputedStyle(e);i.fontFamily&&(t=i.fontFamily);let a=Number.parseFloat(i.fontSize);Number.isFinite(a)&&a>0&&(n=a),i.fontWeight&&(r=i.fontWeight)}return{cellFont:`${r} ${n}px ${t}`,headerFont:`${a} ${i}px ${t}`}},f=(e,t,n)=>Math.min(Math.max(e,t),n),p=e=>e>=4352&&e<=4447||e>=11904&&e<=12350||e>=12353&&e<=13311||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=40960&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=127744&&e<=129791||e>=131072&&e<=262141,m=e=>{let t=0;for(let n of e){let e=n.codePointAt(0)??0;t+=p(e)?2:1}return t},h=(t,n)=>{let r=e.getCellValue(t,n);return n.valueFormatter?n.valueFormatter({value:r,row:t,column:n}):String(r??``)},g=e=>{if(!e||typeof document>`u`)return null;let t=document.createElement(`div`);return t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:absolute;top:-99999px;left:-99999px;visibility:hidden;pointer-events:none;width:auto;height:auto;contain:layout style;`,e.appendChild(t),t},_=e=>{let t=document.createElement(`div`);return t.className=`ssg-body-cell`,t.style.cssText=`display:inline-block;position:static;top:auto;left:auto;width:auto;height:auto;white-space:nowrap;overflow:visible;`,t.textContent=e,t},v=e=>e.suppressAutoSize===!0||e.autoHeight===!0;function
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../utils/permissions.cjs");var t=21,n=4,r=41,i=13,a=600,o=60,s=16,c=null,l=()=>c||(typeof document>`u`?null:(c=document.createElement(`canvas`).getContext(`2d`),c)),u=`system-ui, sans-serif`,d=e=>{let t=u,n=13,r=`400`;if(e&&typeof window<`u`){let i=window.getComputedStyle(e);i.fontFamily&&(t=i.fontFamily);let a=Number.parseFloat(i.fontSize);Number.isFinite(a)&&a>0&&(n=a),i.fontWeight&&(r=i.fontWeight)}return{cellFont:`${r} ${n}px ${t}`,headerFont:`${a} ${i}px ${t}`}},f=(e,t,n)=>Math.min(Math.max(e,t),n),p=e=>e>=4352&&e<=4447||e>=11904&&e<=12350||e>=12353&&e<=13311||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=40960&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=127744&&e<=129791||e>=131072&&e<=262141,m=e=>{let t=0;for(let n of e){let e=n.codePointAt(0)??0;t+=p(e)?2:1}return t},h=(t,n)=>{let r=e.getCellValue(t,n);return n.valueFormatter?n.valueFormatter({value:r,row:t,column:n}):String(r??``)},g=e=>{if(!e||typeof document>`u`)return null;let t=document.createElement(`div`);return t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:absolute;top:-99999px;left:-99999px;visibility:hidden;pointer-events:none;width:auto;height:auto;contain:layout style;`,e.appendChild(t),t},_=e=>{let t=document.createElement(`div`);return t.className=`ssg-body-cell`,t.style.cssText=`display:inline-block;position:static;top:auto;left:auto;width:auto;height:auto;white-space:nowrap;overflow:visible;`,t.textContent=e,t},v=e=>{let t=_(``);t.className=`ssg-body-cell ssg-total-cell`;let n=document.createElement(`span`);if(n.className=`ssg-total-value`,e.caption!==void 0&&e.caption!==``){let t=document.createElement(`span`);t.className=`ssg-total-caption`,t.textContent=e.caption,n.appendChild(t)}return n.appendChild(document.createTextNode(e.text)),t.appendChild(n),t},y=e=>e.suppressAutoSize===!0||e.autoHeight===!0;function b(i){let a=i.map(()=>[]),c=i.map(()=>[]),u=i.map(()=>1/0),p=i.map(()=>0);return{collect:t=>{for(let n=0;n<i.length;n+=1){if(y(i[n]))continue;let r=i[n].estimateCellWidth;if(r){let e=r(t,i[n]);e>p[n]&&(p[n]=e);continue}let o=String(e.getCellValue(t,i[n])??``);if(o===``)continue;let l=a[n],d=c[n];if(l.length===s&&2*o.length<=u[n])continue;let f=m(o);if(l.length<s){if(l.push(t),d.push(f),l.length===s){let e=d[0];for(let t=1;t<s;t+=1)d[t]<e&&(e=d[t]);u[n]=e}continue}if(f<=u[n])continue;let h=0;for(let e=1;e<s;e+=1)d[e]<d[h]&&(h=e);l[h]=t,d[h]=f;let g=d[0];for(let e=1;e<s;e+=1)d[e]<g&&(g=d[e]);u[n]=g}},finalize:({gridRoot:e,currentWidths:s,totalRowTexts:c})=>{let u=l();if(!u||i.length===0)return{};let{cellFont:m,headerFont:b}=d(e),x={},S=g(e);try{let e=null,l=null;if(S){let t=i.map(e=>{let t=c?.get(e.key);if(y(e)||t===void 0||t.text===``)return null;let n=v(t);return S.appendChild(n),n}),n=[];for(let e=0;e<i.length;e+=1){if(y(i[e])){n.push([]);continue}if(i[e].estimateCellWidth){n.push([]);continue}let t=a[e],r=[];for(let n=0;n<t.length;n+=1){let a=h(t[n],i[e]);if(a===``)continue;let o=_(a);S.appendChild(o),r.push(o)}n.push(r)}l=t.map(e=>e?e.offsetWidth:0),e=n.map(e=>{let t=0;for(let n=0;n<e.length;n+=1){let r=e[n].offsetWidth;r>t&&(t=r)}return t})}for(let d=0;d<i.length;d+=1){let g=i[d];if(y(g))continue;u.font=b;let _=g.title||g.key,v=u.measureText(_).width+n+r,S;if(g.estimateCellWidth)S=p[d]>0?p[d]+t:0;else if(e)S=e[d];else{u.font=m;let e=0,r=a[d];for(let t=0;t<r.length;t+=1){let n=h(r[t],g);if(n===``)continue;let i=u.measureText(n).width;i>e&&(e=i)}S=e>0?e+n+t:0}let C=0,w=c?.get(g.key);if(l)C=l[d];else if(w!==void 0&&w.text!==``){u.font=m;let e=w.caption?`${w.caption} ${w.text}`:w.text;C=u.measureText(e).width+n+t}let T=Math.ceil(f(Math.max(v,S,C),g.minWidth??o,g.maxWidth??1/0));s[g.key]!==T&&(x[g.key]=T)}}finally{S&&S.parentNode&&S.parentNode.removeChild(S)}return x}}}function x(){return l()!==null}function S({columns:e,getRow:t,viewRowCount:n,gridRoot:r,currentWidths:i}){if(e.length===0||l()===null)return{};let a=b(e);for(let e=0;e<n;e+=1){let n=t(e);n&&a.collect(n)}return a.finalize({gridRoot:r,currentWidths:i})}exports.canMeasureAutosize=x,exports.computeAutosizedColumnWidths=S,exports.createColumnWidthAccumulator=b;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { GridColumn } from '../model/gridTypes.unbound.js';
|
|
2
|
+
export type AutosizeTotalRowText = {
|
|
3
|
+
text: string;
|
|
4
|
+
caption?: string;
|
|
5
|
+
};
|
|
6
|
+
export type AutosizeTotalRowTexts = ReadonlyMap<string, AutosizeTotalRowText>;
|
|
2
7
|
export type ColumnAutosizeParams<T> = {
|
|
3
8
|
columns: GridColumn<T>[];
|
|
4
9
|
getRow: (viewIndex: number) => T;
|
|
@@ -11,6 +16,7 @@ export type ColumnWidthAccumulator<T> = {
|
|
|
11
16
|
finalize: (params: {
|
|
12
17
|
gridRoot: HTMLElement | null;
|
|
13
18
|
currentWidths: Record<string, number>;
|
|
19
|
+
totalRowTexts?: AutosizeTotalRowTexts;
|
|
14
20
|
}) => Record<string, number>;
|
|
15
21
|
};
|
|
16
22
|
export declare function createColumnWidthAccumulator<T>(columns: GridColumn<T>[]): ColumnWidthAccumulator<T>;
|
|
@@ -33,13 +33,22 @@ var t = 21, n = 4, r = 41, i = 13, a = 600, o = 60, s = 16, c = null, l = () =>
|
|
|
33
33
|
}, _ = (e) => {
|
|
34
34
|
let t = document.createElement("div");
|
|
35
35
|
return t.className = "ssg-body-cell", t.style.cssText = "display:inline-block;position:static;top:auto;left:auto;width:auto;height:auto;white-space:nowrap;overflow:visible;", t.textContent = e, t;
|
|
36
|
-
}, v = (e) =>
|
|
37
|
-
|
|
36
|
+
}, v = (e) => {
|
|
37
|
+
let t = _("");
|
|
38
|
+
t.className = "ssg-body-cell ssg-total-cell";
|
|
39
|
+
let n = document.createElement("span");
|
|
40
|
+
if (n.className = "ssg-total-value", e.caption !== void 0 && e.caption !== "") {
|
|
41
|
+
let t = document.createElement("span");
|
|
42
|
+
t.className = "ssg-total-caption", t.textContent = e.caption, n.appendChild(t);
|
|
43
|
+
}
|
|
44
|
+
return n.appendChild(document.createTextNode(e.text)), t.appendChild(n), t;
|
|
45
|
+
}, y = (e) => e.suppressAutoSize === !0 || e.autoHeight === !0;
|
|
46
|
+
function b(i) {
|
|
38
47
|
let a = i.map(() => []), c = i.map(() => []), u = i.map(() => Infinity), p = i.map(() => 0);
|
|
39
48
|
return {
|
|
40
49
|
collect: (t) => {
|
|
41
50
|
for (let n = 0; n < i.length; n += 1) {
|
|
42
|
-
if (
|
|
51
|
+
if (y(i[n])) continue;
|
|
43
52
|
let r = i[n].estimateCellWidth;
|
|
44
53
|
if (r) {
|
|
45
54
|
let e = r(t, i[n]);
|
|
@@ -68,33 +77,38 @@ function y(i) {
|
|
|
68
77
|
u[n] = g;
|
|
69
78
|
}
|
|
70
79
|
},
|
|
71
|
-
finalize: ({ gridRoot: e, currentWidths: s }) => {
|
|
72
|
-
let
|
|
73
|
-
if (!
|
|
74
|
-
let { cellFont:
|
|
80
|
+
finalize: ({ gridRoot: e, currentWidths: s, totalRowTexts: c }) => {
|
|
81
|
+
let u = l();
|
|
82
|
+
if (!u || i.length === 0) return {};
|
|
83
|
+
let { cellFont: m, headerFont: b } = d(e), x = {}, S = g(e);
|
|
75
84
|
try {
|
|
76
|
-
let e = null;
|
|
77
|
-
if (
|
|
78
|
-
let t =
|
|
85
|
+
let e = null, l = null;
|
|
86
|
+
if (S) {
|
|
87
|
+
let t = i.map((e) => {
|
|
88
|
+
let t = c?.get(e.key);
|
|
89
|
+
if (y(e) || t === void 0 || t.text === "") return null;
|
|
90
|
+
let n = v(t);
|
|
91
|
+
return S.appendChild(n), n;
|
|
92
|
+
}), n = [];
|
|
79
93
|
for (let e = 0; e < i.length; e += 1) {
|
|
80
|
-
if (
|
|
81
|
-
|
|
94
|
+
if (y(i[e])) {
|
|
95
|
+
n.push([]);
|
|
82
96
|
continue;
|
|
83
97
|
}
|
|
84
98
|
if (i[e].estimateCellWidth) {
|
|
85
|
-
|
|
99
|
+
n.push([]);
|
|
86
100
|
continue;
|
|
87
101
|
}
|
|
88
|
-
let
|
|
89
|
-
for (let
|
|
90
|
-
let a = h(n
|
|
102
|
+
let t = a[e], r = [];
|
|
103
|
+
for (let n = 0; n < t.length; n += 1) {
|
|
104
|
+
let a = h(t[n], i[e]);
|
|
91
105
|
if (a === "") continue;
|
|
92
106
|
let o = _(a);
|
|
93
|
-
|
|
107
|
+
S.appendChild(o), r.push(o);
|
|
94
108
|
}
|
|
95
|
-
|
|
109
|
+
n.push(r);
|
|
96
110
|
}
|
|
97
|
-
|
|
111
|
+
l = t.map((e) => e ? e.offsetWidth : 0), e = n.map((e) => {
|
|
98
112
|
let t = 0;
|
|
99
113
|
for (let n = 0; n < e.length; n += 1) {
|
|
100
114
|
let r = e[n].offsetWidth;
|
|
@@ -103,40 +117,47 @@ function y(i) {
|
|
|
103
117
|
return t;
|
|
104
118
|
});
|
|
105
119
|
}
|
|
106
|
-
for (let
|
|
107
|
-
let
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
let
|
|
111
|
-
if (
|
|
112
|
-
else if (e)
|
|
120
|
+
for (let d = 0; d < i.length; d += 1) {
|
|
121
|
+
let g = i[d];
|
|
122
|
+
if (y(g)) continue;
|
|
123
|
+
u.font = b;
|
|
124
|
+
let _ = g.title || g.key, v = u.measureText(_).width + n + r, S;
|
|
125
|
+
if (g.estimateCellWidth) S = p[d] > 0 ? p[d] + t : 0;
|
|
126
|
+
else if (e) S = e[d];
|
|
113
127
|
else {
|
|
114
|
-
|
|
115
|
-
let e = 0, r = a[
|
|
128
|
+
u.font = m;
|
|
129
|
+
let e = 0, r = a[d];
|
|
116
130
|
for (let t = 0; t < r.length; t += 1) {
|
|
117
|
-
let n = h(r[t],
|
|
131
|
+
let n = h(r[t], g);
|
|
118
132
|
if (n === "") continue;
|
|
119
|
-
let i =
|
|
133
|
+
let i = u.measureText(n).width;
|
|
120
134
|
i > e && (e = i);
|
|
121
135
|
}
|
|
122
|
-
|
|
136
|
+
S = e > 0 ? e + n + t : 0;
|
|
137
|
+
}
|
|
138
|
+
let C = 0, w = c?.get(g.key);
|
|
139
|
+
if (l) C = l[d];
|
|
140
|
+
else if (w !== void 0 && w.text !== "") {
|
|
141
|
+
u.font = m;
|
|
142
|
+
let e = w.caption ? `${w.caption} ${w.text}` : w.text;
|
|
143
|
+
C = u.measureText(e).width + n + t;
|
|
123
144
|
}
|
|
124
|
-
let
|
|
125
|
-
s[
|
|
145
|
+
let T = Math.ceil(f(Math.max(v, S, C), g.minWidth ?? o, g.maxWidth ?? Infinity));
|
|
146
|
+
s[g.key] !== T && (x[g.key] = T);
|
|
126
147
|
}
|
|
127
148
|
} finally {
|
|
128
|
-
|
|
149
|
+
S && S.parentNode && S.parentNode.removeChild(S);
|
|
129
150
|
}
|
|
130
|
-
return
|
|
151
|
+
return x;
|
|
131
152
|
}
|
|
132
153
|
};
|
|
133
154
|
}
|
|
134
|
-
function
|
|
155
|
+
function x() {
|
|
135
156
|
return l() !== null;
|
|
136
157
|
}
|
|
137
|
-
function
|
|
158
|
+
function S({ columns: e, getRow: t, viewRowCount: n, gridRoot: r, currentWidths: i }) {
|
|
138
159
|
if (e.length === 0 || l() === null) return {};
|
|
139
|
-
let a =
|
|
160
|
+
let a = b(e);
|
|
140
161
|
for (let e = 0; e < n; e += 1) {
|
|
141
162
|
let n = t(e);
|
|
142
163
|
n && a.collect(n);
|
|
@@ -147,4 +168,4 @@ function x({ columns: e, getRow: t, viewRowCount: n, gridRoot: r, currentWidths:
|
|
|
147
168
|
});
|
|
148
169
|
}
|
|
149
170
|
//#endregion
|
|
150
|
-
export {
|
|
171
|
+
export { x as canMeasureAutosize, S as computeAutosizedColumnWidths, b as createColumnWidthAccumulator };
|
package/dist/logic/exportCsv.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../utils/permissions.cjs");var t=(e,t)=>e.includes(t)||e.includes(`"`)||e.includes(`
|
|
2
|
-
`)||e.includes(`\r`)?`"${e.replace(/"/g,`""`)}"`:e,n=(t,n)=>{let r=e.getCellValue(t,n);return n.formatClipboardValue?n.formatClipboardValue(r,t):String(r??``)},
|
|
3
|
-
`);return
|
|
2
|
+
`)||e.includes(`\r`)?`"${e.replace(/"/g,`""`)}"`:e,n=/^[=+\-@\t\r]/,r=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,i=e=>n.test(e)&&!r.test(e)?`'${e}`:e,a=(t,n)=>{let r=e.getCellValue(t,n);return n.formatClipboardValue?n.formatClipboardValue(r,t):String(r??``)},o=e=>e==null?``:String(e),s=e=>e==null?``:String(e),c=({getRow:e,startRow:n,endRow:r,columns:c,delimiter:l=`,`,includeHeaders:u=!0,bom:d=!1,escapeFormulas:f=!1,isRowIncluded:p,getLabelLine:m,totalLine:h})=>{let g=[],_=e=>t(f?i(e):e,l);u&&g.push(c.map(e=>t(e.title||e.key,l)).join(l));for(let t=n;t<r;t+=1){let n=e(t);if(!n){let e=m?.(t);e&&g.push(c.map((t,n)=>_(o(e[n]))).join(l));continue}if(p&&!p(n,t))continue;let r=c.map(e=>_(a(n,e)));g.push(r.join(l))}h&&g.push(c.map((e,t)=>_(s(h[t]))).join(l));let v=g.join(`\r
|
|
3
|
+
`);return d?`\uFEFF${v}`:v};exports.escapeCsvFormula=i,exports.labelExportCellText=o,exports.serializeRowsToCsv=c,exports.totalExportCellText=s;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GridColumn } from '../model/gridTypes.unbound.js';
|
|
2
|
+
export declare const escapeCsvFormula: (value: string) => string;
|
|
2
3
|
export type SerializeRowsToCsvParams<T> = {
|
|
3
4
|
getRow: (viewIndex: number) => T;
|
|
4
5
|
startRow: number;
|
|
@@ -7,9 +8,12 @@ export type SerializeRowsToCsvParams<T> = {
|
|
|
7
8
|
delimiter?: string;
|
|
8
9
|
includeHeaders?: boolean;
|
|
9
10
|
bom?: boolean;
|
|
11
|
+
escapeFormulas?: boolean;
|
|
10
12
|
isRowIncluded?: (row: T, rowIndex: number) => boolean;
|
|
11
13
|
getLabelLine?: (rowIndex: number) => LabelExportLine | undefined;
|
|
14
|
+
totalLine?: ReadonlyArray<unknown>;
|
|
12
15
|
};
|
|
13
16
|
export type LabelExportLine = ReadonlyArray<string | number | null | undefined>;
|
|
14
17
|
export declare const labelExportCellText: (value: string | number | null | undefined) => string;
|
|
15
|
-
export declare const
|
|
18
|
+
export declare const totalExportCellText: (value: unknown) => string;
|
|
19
|
+
export declare const serializeRowsToCsv: <T>({ getRow, startRow, endRow, columns, delimiter, includeHeaders, bom, escapeFormulas, isRowIncluded, getLabelLine, totalLine, }: SerializeRowsToCsvParams<T>) => string;
|
package/dist/logic/exportCsv.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { getCellValue as e } from "../utils/permissions.js";
|
|
2
2
|
//#region src/logic/exportCsv.ts
|
|
3
|
-
var t = (e, t) => e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? `"${e.replace(/"/g, "\"\"")}"` : e, n = (t, n) => {
|
|
3
|
+
var t = (e, t) => e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? `"${e.replace(/"/g, "\"\"")}"` : e, n = /^[=+\-@\t\r]/, r = /^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i, i = (e) => n.test(e) && !r.test(e) ? `'${e}` : e, a = (t, n) => {
|
|
4
4
|
let r = e(t, n);
|
|
5
5
|
return n.formatClipboardValue ? n.formatClipboardValue(r, t) : String(r ?? "");
|
|
6
|
-
},
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
for (let
|
|
10
|
-
let
|
|
11
|
-
if (!
|
|
12
|
-
let e =
|
|
13
|
-
e &&
|
|
6
|
+
}, o = (e) => e == null ? "" : String(e), s = (e) => e == null ? "" : String(e), c = ({ getRow: e, startRow: n, endRow: r, columns: c, delimiter: l = ",", includeHeaders: u = !0, bom: d = !1, escapeFormulas: f = !1, isRowIncluded: p, getLabelLine: m, totalLine: h }) => {
|
|
7
|
+
let g = [], _ = (e) => t(f ? i(e) : e, l);
|
|
8
|
+
u && g.push(c.map((e) => t(e.title || e.key, l)).join(l));
|
|
9
|
+
for (let t = n; t < r; t += 1) {
|
|
10
|
+
let n = e(t);
|
|
11
|
+
if (!n) {
|
|
12
|
+
let e = m?.(t);
|
|
13
|
+
e && g.push(c.map((t, n) => _(o(e[n]))).join(l));
|
|
14
14
|
continue;
|
|
15
15
|
}
|
|
16
|
-
if (
|
|
17
|
-
let
|
|
18
|
-
|
|
16
|
+
if (p && !p(n, t)) continue;
|
|
17
|
+
let r = c.map((e) => _(a(n, e)));
|
|
18
|
+
g.push(r.join(l));
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
h && g.push(c.map((e, t) => _(s(h[t]))).join(l));
|
|
21
|
+
let v = g.join("\r\n");
|
|
22
|
+
return d ? `\uFEFF${v}` : v;
|
|
22
23
|
};
|
|
23
24
|
//#endregion
|
|
24
|
-
export {
|
|
25
|
+
export { i as escapeCsvFormula, o as labelExportCellText, c as serializeRowsToCsv, s as totalExportCellText };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../utils/permissions.cjs"),t=require("./exportCsv.cjs");var n=({getRow:n,startRow:r,endRow:i,columns:a,isRowIncluded:o,getLabelLine:s})=>{let
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../utils/permissions.cjs"),t=require("./exportCsv.cjs");var n=({getRow:n,startRow:r,endRow:i,columns:a,isRowIncluded:o,getLabelLine:s,totalLine:c})=>{let l=a.map(e=>({key:e.key,title:e.title||e.key})),u=[],d=s||c?[]:void 0;for(let c=r;c<i;c+=1){let r=n(c);if(!r){let e=s?.(c);e&&(u.push(a.map((n,r)=>{let i=e[r];return{value:i??null,text:t.labelExportCellText(i)}})),d?.push(`label`));continue}o&&!o(r,c)||(d?.push(`data`),u.push(a.map(t=>{let n=e.getCellValue(r,t);return{value:n,text:t.formatClipboardValue?t.formatClipboardValue(n,r):String(n??``)}})))}return c&&(u.push(a.map((e,n)=>{let r=c[n];return{value:r??null,text:t.totalExportCellText(r)}})),d?.push(`total`)),d?{columns:l,rows:u,rowKinds:d}:{columns:l,rows:u}};exports.buildGridExportData=n;
|
|
@@ -7,5 +7,6 @@ export type BuildGridExportDataParams<T> = {
|
|
|
7
7
|
columns: GridColumn<T>[];
|
|
8
8
|
isRowIncluded?: (row: T, rowIndex: number) => boolean;
|
|
9
9
|
getLabelLine?: (rowIndex: number) => LabelExportLine | undefined;
|
|
10
|
+
totalLine?: ReadonlyArray<unknown>;
|
|
10
11
|
};
|
|
11
|
-
export declare const buildGridExportData: <T>({ getRow, startRow, endRow, columns, isRowIncluded, getLabelLine, }: BuildGridExportDataParams<T>) => GridExportData;
|
|
12
|
+
export declare const buildGridExportData: <T>({ getRow, startRow, endRow, columns, isRowIncluded, getLabelLine, totalLine, }: BuildGridExportDataParams<T>) => GridExportData;
|
package/dist/logic/exportData.js
CHANGED
|
@@ -1,40 +1,46 @@
|
|
|
1
1
|
import { getCellValue as e } from "../utils/permissions.js";
|
|
2
|
-
import { labelExportCellText as t } from "./exportCsv.js";
|
|
2
|
+
import { labelExportCellText as t, totalExportCellText as n } from "./exportCsv.js";
|
|
3
3
|
//#region src/logic/exportData.ts
|
|
4
|
-
var
|
|
5
|
-
let
|
|
4
|
+
var r = ({ getRow: r, startRow: i, endRow: a, columns: o, isRowIncluded: s, getLabelLine: c, totalLine: l }) => {
|
|
5
|
+
let u = o.map((e) => ({
|
|
6
6
|
key: e.key,
|
|
7
|
-
title: e.title
|
|
8
|
-
})),
|
|
9
|
-
for (let
|
|
10
|
-
let
|
|
11
|
-
if (!
|
|
12
|
-
let e =
|
|
13
|
-
e && (
|
|
7
|
+
title: e.title || e.key
|
|
8
|
+
})), d = [], f = c || l ? [] : void 0;
|
|
9
|
+
for (let n = i; n < a; n += 1) {
|
|
10
|
+
let i = r(n);
|
|
11
|
+
if (!i) {
|
|
12
|
+
let e = c?.(n);
|
|
13
|
+
e && (d.push(o.map((n, r) => {
|
|
14
14
|
let i = e[r];
|
|
15
15
|
return {
|
|
16
16
|
value: i ?? null,
|
|
17
17
|
text: t(i)
|
|
18
18
|
};
|
|
19
|
-
})),
|
|
19
|
+
})), f?.push("label"));
|
|
20
20
|
continue;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
let n = e(
|
|
22
|
+
s && !s(i, n) || (f?.push("data"), d.push(o.map((t) => {
|
|
23
|
+
let n = e(i, t);
|
|
24
24
|
return {
|
|
25
25
|
value: n,
|
|
26
|
-
text: t.formatClipboardValue ? t.formatClipboardValue(n,
|
|
26
|
+
text: t.formatClipboardValue ? t.formatClipboardValue(n, i) : String(n ?? "")
|
|
27
27
|
};
|
|
28
28
|
})));
|
|
29
29
|
}
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
return l && (d.push(o.map((e, t) => {
|
|
31
|
+
let r = l[t];
|
|
32
|
+
return {
|
|
33
|
+
value: r ?? null,
|
|
34
|
+
text: n(r)
|
|
35
|
+
};
|
|
36
|
+
})), f?.push("total")), f ? {
|
|
37
|
+
columns: u,
|
|
38
|
+
rows: d,
|
|
39
|
+
rowKinds: f
|
|
34
40
|
} : {
|
|
35
|
-
columns:
|
|
36
|
-
rows:
|
|
41
|
+
columns: u,
|
|
42
|
+
rows: d
|
|
37
43
|
};
|
|
38
44
|
};
|
|
39
45
|
//#endregion
|
|
40
|
-
export {
|
|
46
|
+
export { r as buildGridExportData };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../utils/permissions.cjs"),t=require("./detailRow.cjs"),n=require("./geometry.cjs"),r=require("./validation.cjs"),i=require("./fillSeries.cjs");var a=(e,t,n,r)=>{let i;if(e?.type===`cell`){let{start:t,end:n}=e.range;i={startRow:Math.min(t.row,n.row),endRow:Math.max(t.row,n.row),startCol:Math.min(t.col,n.col),endCol:Math.max(t.col,n.col)}}else if(e===null&&t)i={startRow:t.row,endRow:t.row,startCol:t.col,endCol:t.col};else return null;return i.startRow<0||i.endRow>=n||i.startCol<0||i.endCol>=r?null:i},o=(e,t)=>({startRow:Math.min(e.startRow,t.range.startRow),endRow:Math.max(e.endRow,t.range.endRow),startCol:Math.min(e.startCol,t.range.startCol),endCol:Math.max(e.endCol,t.range.endCol)}),s=(e,t)=>e.startRow===t.startRow&&e.endRow===t.endRow&&e.startCol===t.startCol&&e.endCol===t.endCol,c=e=>{let n=-1,r=-1;return e.forEach((e,i)=>{t.isSyntheticColumnKey(e.key)||(n===-1&&(n=i),r=i)}),n===-1?null:{first:n,last:r}},l=(e,t,n,r)=>{if(n<=0)return null;let i=Math.min(Math.max(t.row,0),n-1),a=Math.min(Math.max(t.col,r.first),r.last),o=i-e.endRow,s=e.startRow-i,c=a-e.endCol,l=e.startCol-a,u=Math.max(o,s,0),d=Math.max(c,l,0);return u===0&&d===0?null:u>=d?o>0?{direction:`down`,range:{startRow:e.endRow+1,endRow:i,startCol:e.startCol,endCol:e.endCol}}:{direction:`up`,range:{startRow:i,endRow:e.startRow-1,startCol:e.startCol,endCol:e.endCol}}:c>0?{direction:`right`,range:{startRow:e.startRow,endRow:e.endRow,startCol:e.endCol+1,endCol:a}}:{direction:`left`,range:{startRow:e.startRow,endRow:e.endRow,startCol:a,endCol:e.startCol-1}}},u=(e,t)=>e.getLabelRow?.(t)!==void 0||e.getGroupRow?.(t)!==void 0,d=e=>e!=null&&e!==``,f=(e,n,r)=>{let i=!1;for(let n=e.startCol;n<=e.endCol;n+=1){let e=r[n];if(e!==void 0&&!t.isSyntheticColumnKey(e.key)){i=!0;break}}if(!i)return!1;for(let t=e.startRow;t<=e.endRow;t+=1)if(!u(n,t))return!0;return!1},p=(n,r,i)=>{let a=r.getRowCount(),o=n.endRow+1;if(o>=a)return null;let s=e=>u(r,e)?void 0:r.getRow(e),c=(e,n)=>{for(let r=e;r>=0&&r<i.length;r+=n)if(!t.isSyntheticColumnKey(i[r].key))return r;return-1},l=i.slice(n.startCol,n.endCol+1).filter(e=>!t.isSyntheticColumnKey(e.key));if(l.length===0)return null;for(let t of[c(n.startCol-1,-1),c(n.endCol+1,1)]){if(t===-1)continue;let r=i[t],c=n.endRow;for(let t=o;t<a;t+=1){let n=s(t);if(n===void 0||!d(e.getCellValue(n,r))||l.some(t=>d(e.getCellValue(n,t))))break;c=t}if(c>n.endRow)return{direction:`down`,range:{startRow:o,endRow:c,startCol:n.startCol,endCol:n.endCol}}}return null},m=(e,t,n,r)=>{let i=[];for(let a=e;n===1?a<=t:a>=t;a+=n)r(a)&&i.push(a);return i},h=({rowModel:n,columns:a,source:o,target:s,request:c,canWriteCell:l,getFillValue:d})=>{let f=[],p=`copy`,h=!1,{direction:g,range:_}=s,v=g===`down`||g===`up`,y=g===`down`||g===`right`,b=(e,t,n)=>{if(e.length===0||t.length===0)return;let a=i.analyzeFillLine(e,{backward:!y}),o=i.resolveFillLineKind(a,c);a.series!==null&&(h=!0),o===`series`&&(p=`series`);let s=i.createFillLineValues(e,a,o);t.forEach((t,i)=>{let{viewIndex:a,colIndex:c,row:u,column:p}=n(t);if(u===void 0||!l(a,c,u,p))return;let m=s(i),h=d?d({column:p,row:u,rowIndex:a,sourceValues:e,index:i,direction:g,kind:o,defaultValue:m}):m;r.decideCellWrite(p,u,h).action!==`reject`&&f.push({viewIndex:a,column:p,value:h})})};if(v){let r=e=>!u(n,e),i=y?m(o.startRow,o.endRow,1,r):m(o.endRow,o.startRow,-1,r),s=y?m(_.startRow,_.endRow,1,r):m(_.endRow,_.startRow,-1,r);for(let r=o.startCol;r<=o.endCol;r+=1){let o=a[r];if(!o||t.isSyntheticColumnKey(o.key))continue;let c=[],l=!0;for(let t of i){let r=n.getRow(t);if(r===void 0){l=!1;break}c.push(e.getCellValue(r,o))}l&&b(c,s,e=>({viewIndex:e,colIndex:r,row:n.getRow(e),column:o}))}}else{let r=e=>{let n=a[e];return n!==void 0&&!t.isSyntheticColumnKey(n.key)},i=y?m(o.startCol,o.endCol,1,r):m(o.endCol,o.startCol,-1,r),s=y?m(_.startCol,_.endCol,1,r):m(_.endCol,_.startCol,-1,r);for(let t=o.startRow;t<=o.endRow;t+=1){if(u(n,t))continue;let r=n.getRow(t);r!==void 0&&b(i.map(t=>e.getCellValue(r,a[t])),s,e=>({viewIndex:t,colIndex:e,row:r,column:a[e]}))}}return{edits:f,kind:p,seriesAvailable:h}},g=({rowModel:n,columns:r,source:a,target:o,request:s,canWriteCell:c,getFillValue:l})=>{let{direction:d,range:f}=o,p=d===`down`||d===`up`,h=d===`down`||d===`right`,g,_,v,y,b,x=!1,S;if(p){let i=m(a.startCol,a.endCol,1,e=>{let n=r[e];return n!==void 0&&!t.isSyntheticColumnKey(n.key)})[0];if(i===void 0)return null;v=i,_=r[v];let o=e=>!u(n,e),s=h?m(a.startRow,a.endRow,1,o):m(a.endRow,a.startRow,-1,o),c=h?m(f.startRow,f.endRow,1,o):m(f.endRow,f.startRow,-1,o);if(s.length===0||c.length===0)return null;g=[];let l;for(let t of s){if(l=n.getRow(t),l===void 0)return null;g.push(e.getCellValue(l,_))}S=c.length-1,y=c[S],b=n.getRow(y),x=b===void 0,b??=l}else{let i=m(a.startRow,a.endRow,1,e=>!u(n,e))[0];if(i===void 0)return null;let o=n.getRow(i);if(o===void 0)return null;let s=e=>{let n=r[e];return n!==void 0&&!t.isSyntheticColumnKey(n.key)},c=h?m(a.startCol,a.endCol,1,s):m(a.endCol,a.startCol,-1,s),l=h?m(f.startCol,f.endCol,1,s):m(f.endCol,f.startCol,-1,s);if(c.length===0||l.length===0)return null;g=c.map(t=>e.getCellValue(o,r[t])),S=l.length-1,v=l[S],_=r[v],y=i,b=o}let C=i.analyzeFillLine(g,{backward:!h}),w=i.resolveFillLineKind(C,s),T=i.createFillLineValues(g,C,w)(S),E=l&&b!==void 0&&!x&&(c===void 0||c(y,v,b,_))?l({column:_,row:b,rowIndex:y,sourceValues:g,index:S,direction:d,kind:w,defaultValue:T}):T;return{column:_,row:b,value:E}},_=(t,n,r)=>{if(r.length===0)return t;let i=[...t];for(let{viewIndex:t,column:a,value:o}of r){let r=n.getSourceIndex(t);if(r===void 0)continue;let s=i[r];s!==void 0&&(i[r]=e.setCellValue(s,a,o))}return i},v=(e,t,r,i,a)=>{if(e.endRow<i||e.endRow>a)return null;let o=n.computeSinglePaneColumnExtent(t,e.endCol);return o?{pane:o.pane,x:o.extent.end,y:r.rowTop(e.endRow)+r.cellHeight(e.endRow),paneWidth:t[o.pane].totalWidth}:null},y=36,b=22,x=4,S=(e,t,n=1/0)=>({x:e.x+x+36<=e.paneWidth?e.x+x:Math.max(e.x-36-x,0),y:e.y+x+22<=Math.min(t,n)?e.y+x:Math.max(e.y-22-x,0)});exports.FILL_OPTIONS_CHIP_HEIGHT=b,exports.FILL_OPTIONS_CHIP_WIDTH=y,exports.applyFillEditsToRows=_,exports.buildFillEdits=h,exports.hasFillableSource=f,exports.isSameFillRange=s,exports.previewFillValue=g,exports.resolveFillColumnBounds=c,exports.resolveFillCornerPlacement=v,exports.resolveFillDoubleClickTarget=p,exports.resolveFillOptionsChipPosition=S,exports.resolveFillSource=a,exports.resolveFillTarget=l,exports.unionFillRange=o;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { CellCoord, GridColumn, GridFillDirection, GridFillKind, GridFillValueParams, GridSelection, RowModel } from '../model/gridTypes.unbound.js';
|
|
2
|
+
import { type ColumnPane, type GridPaneLayout } from './geometry.js';
|
|
3
|
+
import type { RowMetrics } from './verticalGeometry.js';
|
|
4
|
+
import { type FillRequest } from './fillSeries.js';
|
|
5
|
+
export type FillRange = {
|
|
6
|
+
startRow: number;
|
|
7
|
+
endRow: number;
|
|
8
|
+
startCol: number;
|
|
9
|
+
endCol: number;
|
|
10
|
+
};
|
|
11
|
+
export type FillTarget = {
|
|
12
|
+
direction: GridFillDirection;
|
|
13
|
+
range: FillRange;
|
|
14
|
+
};
|
|
15
|
+
export type FillCellEdit<T> = {
|
|
16
|
+
viewIndex: number;
|
|
17
|
+
column: GridColumn<T>;
|
|
18
|
+
value: unknown;
|
|
19
|
+
};
|
|
20
|
+
export declare const resolveFillSource: (selection: GridSelection, activeCell: CellCoord | null, rowCount: number, columnCount: number) => FillRange | null;
|
|
21
|
+
export declare const unionFillRange: (source: FillRange, target: FillTarget) => FillRange;
|
|
22
|
+
export declare const isSameFillRange: (a: FillRange, b: FillRange) => boolean;
|
|
23
|
+
export declare const resolveFillColumnBounds: <T>(columns: readonly GridColumn<T>[]) => {
|
|
24
|
+
first: number;
|
|
25
|
+
last: number;
|
|
26
|
+
} | null;
|
|
27
|
+
export declare const resolveFillTarget: (source: FillRange, pointer: CellCoord, rowCount: number, columnBounds: {
|
|
28
|
+
first: number;
|
|
29
|
+
last: number;
|
|
30
|
+
}) => FillTarget | null;
|
|
31
|
+
export declare const hasFillableSource: <T>(source: FillRange, rowModel: RowModel<T>, columns: readonly GridColumn<T>[]) => boolean;
|
|
32
|
+
export declare const resolveFillDoubleClickTarget: <T>(source: FillRange, rowModel: RowModel<T>, columns: readonly GridColumn<T>[]) => FillTarget | null;
|
|
33
|
+
export type BuildFillEditsParams<T> = {
|
|
34
|
+
rowModel: RowModel<T>;
|
|
35
|
+
columns: readonly GridColumn<T>[];
|
|
36
|
+
source: FillRange;
|
|
37
|
+
target: FillTarget;
|
|
38
|
+
request: FillRequest;
|
|
39
|
+
canWriteCell: (viewIndex: number, colIndex: number, row: T, column: GridColumn<T>) => boolean;
|
|
40
|
+
getFillValue?: (params: GridFillValueParams<T>) => unknown;
|
|
41
|
+
};
|
|
42
|
+
export type FillEditsResult<T> = {
|
|
43
|
+
edits: FillCellEdit<T>[];
|
|
44
|
+
kind: GridFillKind;
|
|
45
|
+
seriesAvailable: boolean;
|
|
46
|
+
};
|
|
47
|
+
export declare const buildFillEdits: <T>({ rowModel, columns, source, target, request, canWriteCell, getFillValue, }: BuildFillEditsParams<T>) => FillEditsResult<T>;
|
|
48
|
+
export type FillPreview<T> = {
|
|
49
|
+
column: GridColumn<T>;
|
|
50
|
+
row: T | undefined;
|
|
51
|
+
value: unknown;
|
|
52
|
+
};
|
|
53
|
+
export declare const previewFillValue: <T>({ rowModel, columns, source, target, request, canWriteCell, getFillValue, }: Omit<BuildFillEditsParams<T>, "canWriteCell"> & {
|
|
54
|
+
canWriteCell?: BuildFillEditsParams<T>["canWriteCell"];
|
|
55
|
+
}) => FillPreview<T> | null;
|
|
56
|
+
export declare const applyFillEditsToRows: <T>(rows: readonly T[], rowModel: Pick<RowModel<T>, "getSourceIndex">, edits: readonly FillCellEdit<T>[]) => T[];
|
|
57
|
+
export type FillCornerPlacement = {
|
|
58
|
+
pane: ColumnPane;
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
paneWidth: number;
|
|
62
|
+
};
|
|
63
|
+
export declare const resolveFillCornerPlacement: <T>(range: FillRange, paneLayout: GridPaneLayout<T>, rowMetrics: Pick<RowMetrics, "rowTop" | "cellHeight">, windowFirstRow: number, windowLastRow: number) => FillCornerPlacement | null;
|
|
64
|
+
export declare const FILL_OPTIONS_CHIP_WIDTH = 36;
|
|
65
|
+
export declare const FILL_OPTIONS_CHIP_HEIGHT = 22;
|
|
66
|
+
export declare const resolveFillOptionsChipPosition: (corner: FillCornerPlacement, totalBodyHeight: number, visibleBottom?: number) => {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
};
|