@rowsncolumns/spreadsheet 10.10.5 → 10.11.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/cjs/api/split-pane.d.ts +10 -0
- package/dist/cjs/api/split-pane.d.ts.map +1 -1
- package/dist/cjs/api/split-pane.js +29 -1
- package/dist/cjs/atoms/cell-input-context.atom.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +114 -52
- package/dist/cjs/components/canvas-grid/typings.d.ts +8 -1
- package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/cjs/hooks/use-grid-children.d.ts +8 -2
- package/dist/cjs/hooks/use-grid-children.d.ts.map +1 -1
- package/dist/cjs/hooks/use-grid-children.js +71 -4
- package/dist/esm/api/split-pane.d.ts +10 -0
- package/dist/esm/api/split-pane.d.ts.map +1 -1
- package/dist/esm/api/split-pane.js +25 -0
- package/dist/esm/atoms/cell-input-context.atom.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +64 -3
- package/dist/esm/components/canvas-grid/typings.d.ts +8 -1
- package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/esm/hooks/use-grid-children.d.ts +8 -2
- package/dist/esm/hooks/use-grid-children.d.ts.map +1 -1
- package/dist/esm/hooks/use-grid-children.js +71 -4
- package/dist/spreadsheet.min.css +1 -1
- package/package.json +2 -2
|
@@ -16,4 +16,14 @@ export declare const splitPanePixels: (pane: SplitPane | null | undefined) => {
|
|
|
16
16
|
x?: number;
|
|
17
17
|
y?: number;
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* The sheet's `<pane>` for a split the grid reports in CSS px — the inverse of
|
|
21
|
+
* {@link splitPanePixels}. What the sheet already stored about the split (which pane is active,
|
|
22
|
+
* the bottom-right pane's first cell) is kept; `null` from the grid means the split was removed,
|
|
23
|
+
* which the caller stores as a `null` `splitPane`.
|
|
24
|
+
*/
|
|
25
|
+
export declare const splitPaneFromPixels: (pixels: {
|
|
26
|
+
x?: number;
|
|
27
|
+
y?: number;
|
|
28
|
+
}, previous?: SplitPane | null) => SplitPane;
|
|
19
29
|
//# sourceMappingURL=split-pane.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-pane.d.ts","sourceRoot":"","sources":["../../../api/split-pane.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wEAAwE;AACxE,eAAO,MAAM,eAAe,KAAK,CAAC;AAUlC;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,YAAY,aAAa,EACzB,cAAc,aAAa,EAC3B,gBAAgB,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,EAC/C,cAAc,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,KACzC,SAAS,GAAG,SAmCd,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,eAAe,GAC1B,MAAM,SAAS,GAAG,IAAI,GAAG,SAAS,KACjC;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAI1B,CAAC"}
|
|
1
|
+
{"version":3,"file":"split-pane.d.ts","sourceRoot":"","sources":["../../../api/split-pane.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wEAAwE;AACxE,eAAO,MAAM,eAAe,KAAK,CAAC;AAUlC;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,YAAY,aAAa,EACzB,cAAc,aAAa,EAC3B,gBAAgB,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,EAC/C,cAAc,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,KACzC,SAAS,GAAG,SAmCd,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,eAAe,GAC1B,MAAM,SAAS,GAAG,IAAI,GAAG,SAAS,KACjC;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAI1B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,QAAQ;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAClC,WAAW,SAAS,GAAG,IAAI,KAC1B,SAgBF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.splitPanePixels = exports.splitPaneAtCell = exports.TWIPS_PER_PIXEL = void 0;
|
|
3
|
+
exports.splitPaneFromPixels = exports.splitPanePixels = exports.splitPaneAtCell = exports.TWIPS_PER_PIXEL = void 0;
|
|
4
4
|
/** Twentieths of a point per CSS pixel (96 px = 72 pt = 1440 twips). */
|
|
5
5
|
exports.TWIPS_PER_PIXEL = 15;
|
|
6
6
|
var columnLetters = function (column) {
|
|
@@ -68,3 +68,31 @@ var splitPanePixels = function (pane) {
|
|
|
68
68
|
return { x: px(pane === null || pane === void 0 ? void 0 : pane.xSplit), y: px(pane === null || pane === void 0 ? void 0 : pane.ySplit) };
|
|
69
69
|
};
|
|
70
70
|
exports.splitPanePixels = splitPanePixels;
|
|
71
|
+
/**
|
|
72
|
+
* The sheet's `<pane>` for a split the grid reports in CSS px — the inverse of
|
|
73
|
+
* {@link splitPanePixels}. What the sheet already stored about the split (which pane is active,
|
|
74
|
+
* the bottom-right pane's first cell) is kept; `null` from the grid means the split was removed,
|
|
75
|
+
* which the caller stores as a `null` `splitPane`.
|
|
76
|
+
*/
|
|
77
|
+
var splitPaneFromPixels = function (pixels, previous) {
|
|
78
|
+
var twips = function (px) {
|
|
79
|
+
return typeof px === "number" && px > 0 ? Math.round(px * exports.TWIPS_PER_PIXEL) : undefined;
|
|
80
|
+
};
|
|
81
|
+
var pane = {};
|
|
82
|
+
var xSplit = twips(pixels.x);
|
|
83
|
+
var ySplit = twips(pixels.y);
|
|
84
|
+
if (xSplit !== undefined)
|
|
85
|
+
pane.xSplit = xSplit;
|
|
86
|
+
if (ySplit !== undefined)
|
|
87
|
+
pane.ySplit = ySplit;
|
|
88
|
+
if (previous === null || previous === void 0 ? void 0 : previous.topLeftCell)
|
|
89
|
+
pane.topLeftCell = previous.topLeftCell;
|
|
90
|
+
pane.activePane =
|
|
91
|
+
xSplit !== undefined && ySplit !== undefined
|
|
92
|
+
? "bottomRight"
|
|
93
|
+
: xSplit !== undefined
|
|
94
|
+
? "topRight"
|
|
95
|
+
: "bottomLeft";
|
|
96
|
+
return pane;
|
|
97
|
+
};
|
|
98
|
+
exports.splitPaneFromPixels = splitPaneFromPixels;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-input-context.atom.d.ts","sourceRoot":"","sources":["../../../atoms/cell-input-context.atom.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,mBAAmB;;;;
|
|
1
|
+
{"version":3,"file":"cell-input-context.atom.d.ts","sourceRoot":"","sources":["../../../atoms/cell-input-context.atom.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,mBAAmB;;;;oBACy2yF,CAAC;qBAAwB,CAAC;;;;;;;;;;;CADp1yF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/canvas-grid/index.tsx"],"names":[],"mappings":"AAoEA,OAAO,KASN,MAAM,OAAO,CAAC;AAyQf,OAAO,KAAK,EAGV,QAAQ,EAYT,MAAM,aAAa,CAAC;AA4CrB,OAAO,KAAK,EACV,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,WAAW,CAAC;AA6sOnB,eAAO,MAAM,UAAU,EAA4C,CACjE,CAAC,SAAS,QAAQ,CAAC,GAAG,CAAC,EAEvB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GACvB,wBAAwB,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC"}
|