@rowsncolumns/spreadsheet 10.11.0 → 10.13.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/atoms/calculated-column-fill.atom.d.ts +6 -2
- package/dist/cjs/atoms/calculated-column-fill.atom.d.ts.map +1 -1
- package/dist/cjs/atoms/calculated-column-fill.atom.js +6 -2
- package/dist/cjs/atoms/cell-input-context.atom.d.ts.map +1 -1
- package/dist/cjs/atoms/fill-options.atom.d.ts +5 -0
- package/dist/cjs/atoms/fill-options.atom.d.ts.map +1 -1
- package/dist/cjs/atoms/table-auto-expansion.atom.d.ts +5 -2
- package/dist/cjs/atoms/table-auto-expansion.atom.d.ts.map +1 -1
- package/dist/cjs/atoms/table-auto-expansion.atom.js +5 -2
- package/dist/cjs/components/autocorrect-options-smart-tag/index.d.ts +37 -0
- package/dist/cjs/components/autocorrect-options-smart-tag/index.d.ts.map +1 -0
- package/dist/cjs/components/autocorrect-options-smart-tag/index.js +84 -0
- package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/cjs/components/canvas-grid/index.js +265 -115
- package/dist/cjs/components/canvas-grid/typings.d.ts +25 -0
- package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/cjs/components/embeds/chart-component.d.ts +9 -0
- package/dist/cjs/components/embeds/chart-component.d.ts.map +1 -1
- package/dist/cjs/components/embeds/embed-component.d.ts +9 -0
- package/dist/cjs/components/embeds/embed-component.d.ts.map +1 -1
- package/dist/cjs/components/embeds/embed-component.js +13 -114
- package/dist/cjs/components/embeds/embed-draggable.d.ts +17 -2
- package/dist/cjs/components/embeds/embed-draggable.d.ts.map +1 -1
- package/dist/cjs/components/embeds/embed-draggable.js +323 -25
- package/dist/cjs/components/embeds/object-focus.d.ts +32 -0
- package/dist/cjs/components/embeds/object-focus.d.ts.map +1 -0
- package/dist/cjs/components/embeds/object-focus.js +140 -0
- package/dist/cjs/components/embeds/page-gaps.d.ts +67 -0
- package/dist/cjs/components/embeds/page-gaps.d.ts.map +1 -0
- package/dist/cjs/components/embeds/page-gaps.js +159 -0
- package/dist/cjs/components/embeds/slicer-component.d.ts +9 -0
- package/dist/cjs/components/embeds/slicer-component.d.ts.map +1 -1
- package/dist/cjs/components/embeds/text-box-view.d.ts +18 -0
- package/dist/cjs/components/embeds/text-box-view.d.ts.map +1 -0
- package/dist/cjs/components/embeds/text-box-view.js +130 -0
- package/dist/cjs/components/filter-box/filter-by-color.d.ts.map +1 -1
- package/dist/cjs/components/filter-box/filter-by-color.js +10 -3
- package/dist/cjs/components/filter-box/index.d.ts.map +1 -1
- package/dist/cjs/components/filter-box/index.js +5 -1
- package/dist/cjs/components/print-preview/page-block.d.ts +46 -0
- package/dist/cjs/components/print-preview/page-block.d.ts.map +1 -1
- package/dist/cjs/components/print-preview/page-block.js +111 -6
- package/dist/cjs/components/print-preview/print-cells.d.ts +5 -0
- package/dist/cjs/components/print-preview/print-cells.d.ts.map +1 -1
- package/dist/cjs/components/print-preview/print-cells.js +1 -0
- package/dist/cjs/components/print-preview/print-preview-dialog.d.ts +16 -2
- package/dist/cjs/components/print-preview/print-preview-dialog.d.ts.map +1 -1
- package/dist/cjs/components/print-preview/print-preview-dialog.js +246 -14
- package/dist/cjs/components/print-preview/settings.d.ts +8 -0
- package/dist/cjs/components/print-preview/settings.d.ts.map +1 -1
- package/dist/cjs/components/print-preview/settings.js +4 -1
- package/dist/cjs/components/print-preview/sheet-page-setup.d.ts.map +1 -1
- package/dist/cjs/components/print-preview/sheet-page-setup.js +14 -2
- package/dist/cjs/components/selection/fill-options-menu.d.ts +8 -1
- package/dist/cjs/components/selection/fill-options-menu.d.ts.map +1 -1
- package/dist/cjs/components/selection/fill-options-menu.js +5 -3
- package/dist/cjs/components/selection/index.d.ts +1 -1
- package/dist/cjs/components/selection/index.d.ts.map +1 -1
- package/dist/cjs/components/selection/index.js +5 -6
- package/dist/cjs/components/selection/types.d.ts +13 -8
- package/dist/cjs/components/selection/types.d.ts.map +1 -1
- package/dist/cjs/components/sheet-background/index.d.ts +26 -0
- package/dist/cjs/components/sheet-background/index.d.ts.map +1 -0
- package/dist/cjs/components/sheet-background/index.js +106 -0
- package/dist/cjs/components/sort-range-dialog/index.d.ts.map +1 -1
- package/dist/cjs/components/sort-range-dialog/index.js +6 -3
- package/dist/cjs/hooks/object-clipboard-payload.d.ts +58 -0
- package/dist/cjs/hooks/object-clipboard-payload.d.ts.map +1 -0
- package/dist/cjs/hooks/object-clipboard-payload.js +488 -0
- package/dist/cjs/hooks/object-spec-schema.generated.d.ts +24 -0
- package/dist/cjs/hooks/object-spec-schema.generated.d.ts.map +1 -0
- package/dist/cjs/hooks/object-spec-schema.generated.js +4767 -0
- package/dist/cjs/hooks/use-chart-clipboard.d.ts +55 -9
- package/dist/cjs/hooks/use-chart-clipboard.d.ts.map +1 -1
- package/dist/cjs/hooks/use-chart-clipboard.js +307 -55
- package/dist/cjs/hooks/use-embeds-charts.d.ts +7 -1
- package/dist/cjs/hooks/use-embeds-charts.d.ts.map +1 -1
- package/dist/cjs/hooks/use-embeds-charts.js +74 -14
- package/dist/cjs/hooks/use-selection-renderer.d.ts +16 -5
- package/dist/cjs/hooks/use-selection-renderer.d.ts.map +1 -1
- package/dist/cjs/hooks/use-selection-renderer.js +59 -32
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/release-date.js +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/types.d.ts +58 -0
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/atoms/calculated-column-fill.atom.d.ts +6 -2
- package/dist/esm/atoms/calculated-column-fill.atom.d.ts.map +1 -1
- package/dist/esm/atoms/calculated-column-fill.atom.js +6 -2
- package/dist/esm/atoms/cell-input-context.atom.d.ts.map +1 -1
- package/dist/esm/atoms/fill-options.atom.d.ts +5 -0
- package/dist/esm/atoms/fill-options.atom.d.ts.map +1 -1
- package/dist/esm/atoms/table-auto-expansion.atom.d.ts +5 -2
- package/dist/esm/atoms/table-auto-expansion.atom.d.ts.map +1 -1
- package/dist/esm/atoms/table-auto-expansion.atom.js +5 -2
- package/dist/esm/components/autocorrect-options-smart-tag/index.d.ts +37 -0
- package/dist/esm/components/autocorrect-options-smart-tag/index.d.ts.map +1 -0
- package/dist/esm/components/autocorrect-options-smart-tag/index.js +87 -0
- package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
- package/dist/esm/components/canvas-grid/index.js +186 -51
- package/dist/esm/components/canvas-grid/typings.d.ts +25 -0
- package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
- package/dist/esm/components/embeds/chart-component.d.ts +9 -0
- package/dist/esm/components/embeds/chart-component.d.ts.map +1 -1
- package/dist/esm/components/embeds/embed-component.d.ts +9 -0
- package/dist/esm/components/embeds/embed-component.d.ts.map +1 -1
- package/dist/esm/components/embeds/embed-component.js +12 -113
- package/dist/esm/components/embeds/embed-draggable.d.ts +17 -2
- package/dist/esm/components/embeds/embed-draggable.d.ts.map +1 -1
- package/dist/esm/components/embeds/embed-draggable.js +314 -19
- package/dist/esm/components/embeds/object-focus.d.ts +32 -0
- package/dist/esm/components/embeds/object-focus.d.ts.map +1 -0
- package/dist/esm/components/embeds/object-focus.js +118 -0
- package/dist/esm/components/embeds/page-gaps.d.ts +67 -0
- package/dist/esm/components/embeds/page-gaps.d.ts.map +1 -0
- package/dist/esm/components/embeds/page-gaps.js +86 -0
- package/dist/esm/components/embeds/slicer-component.d.ts +9 -0
- package/dist/esm/components/embeds/slicer-component.d.ts.map +1 -1
- package/dist/esm/components/embeds/text-box-view.d.ts +18 -0
- package/dist/esm/components/embeds/text-box-view.d.ts.map +1 -0
- package/dist/esm/components/embeds/text-box-view.js +118 -0
- package/dist/esm/components/filter-box/filter-by-color.d.ts.map +1 -1
- package/dist/esm/components/filter-box/filter-by-color.js +9 -2
- package/dist/esm/components/filter-box/index.d.ts.map +1 -1
- package/dist/esm/components/filter-box/index.js +5 -1
- package/dist/esm/components/print-preview/page-block.d.ts +46 -0
- package/dist/esm/components/print-preview/page-block.d.ts.map +1 -1
- package/dist/esm/components/print-preview/page-block.js +122 -4
- package/dist/esm/components/print-preview/print-cells.d.ts +5 -0
- package/dist/esm/components/print-preview/print-cells.d.ts.map +1 -1
- package/dist/esm/components/print-preview/print-cells.js +1 -0
- package/dist/esm/components/print-preview/print-preview-dialog.d.ts +16 -2
- package/dist/esm/components/print-preview/print-preview-dialog.d.ts.map +1 -1
- package/dist/esm/components/print-preview/print-preview-dialog.js +195 -4
- package/dist/esm/components/print-preview/settings.d.ts +8 -0
- package/dist/esm/components/print-preview/settings.d.ts.map +1 -1
- package/dist/esm/components/print-preview/settings.js +4 -1
- package/dist/esm/components/print-preview/sheet-page-setup.d.ts.map +1 -1
- package/dist/esm/components/print-preview/sheet-page-setup.js +14 -0
- package/dist/esm/components/selection/fill-options-menu.d.ts +8 -1
- package/dist/esm/components/selection/fill-options-menu.d.ts.map +1 -1
- package/dist/esm/components/selection/fill-options-menu.js +5 -3
- package/dist/esm/components/selection/index.d.ts +1 -1
- package/dist/esm/components/selection/index.d.ts.map +1 -1
- package/dist/esm/components/selection/index.js +5 -6
- package/dist/esm/components/selection/types.d.ts +13 -8
- package/dist/esm/components/selection/types.d.ts.map +1 -1
- package/dist/esm/components/sheet-background/index.d.ts +26 -0
- package/dist/esm/components/sheet-background/index.d.ts.map +1 -0
- package/dist/esm/components/sheet-background/index.js +93 -0
- package/dist/esm/components/sort-range-dialog/index.d.ts.map +1 -1
- package/dist/esm/components/sort-range-dialog/index.js +5 -2
- package/dist/esm/hooks/object-clipboard-payload.d.ts +58 -0
- package/dist/esm/hooks/object-clipboard-payload.d.ts.map +1 -0
- package/dist/esm/hooks/object-clipboard-payload.js +404 -0
- package/dist/esm/hooks/object-spec-schema.generated.d.ts +24 -0
- package/dist/esm/hooks/object-spec-schema.generated.d.ts.map +1 -0
- package/dist/esm/hooks/object-spec-schema.generated.js +4764 -0
- package/dist/esm/hooks/use-chart-clipboard.d.ts +55 -9
- package/dist/esm/hooks/use-chart-clipboard.d.ts.map +1 -1
- package/dist/esm/hooks/use-chart-clipboard.js +298 -53
- package/dist/esm/hooks/use-embeds-charts.d.ts +7 -1
- package/dist/esm/hooks/use-embeds-charts.d.ts.map +1 -1
- package/dist/esm/hooks/use-embeds-charts.js +72 -14
- package/dist/esm/hooks/use-selection-renderer.d.ts +16 -5
- package/dist/esm/hooks/use-selection-renderer.d.ts.map +1 -1
- package/dist/esm/hooks/use-selection-renderer.js +54 -28
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/release-date.js +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types.d.ts +58 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/spreadsheet.min.css +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Excel's Page Layout view draws the sheet as pages of paper with a gap (margins and desk) between
|
|
3
|
+
* them. A chart, picture, shape or slicer keeps its size in sheet pixels, so one that crosses a
|
|
4
|
+
* page boundary is drawn clipped per page: the part on the next page continues past the gap.
|
|
5
|
+
*
|
|
6
|
+
* These helpers map one axis between the grid's coordinates (which include the gaps) and gap-free
|
|
7
|
+
* sheet coordinates (the object's own), and cut an object's extent into its per-page pieces.
|
|
8
|
+
*/
|
|
9
|
+
/** The page boundaries in grid coordinates, read off the grid's cell offsets. */
|
|
10
|
+
export const resolvePageGaps = (indexes, getCellOffsetFromCoords) => {
|
|
11
|
+
if (!getCellOffsetFromCoords)
|
|
12
|
+
return undefined;
|
|
13
|
+
const x = [];
|
|
14
|
+
for (const { index, gap } of indexes.columns) {
|
|
15
|
+
const start = getCellOffsetFromCoords({ rowIndex: 0, columnIndex: index })?.x;
|
|
16
|
+
if (start === undefined)
|
|
17
|
+
return undefined;
|
|
18
|
+
x.push({ start, gap });
|
|
19
|
+
}
|
|
20
|
+
const y = [];
|
|
21
|
+
for (const { index, gap } of indexes.rows) {
|
|
22
|
+
const start = getCellOffsetFromCoords({ rowIndex: index, columnIndex: 0 })?.y;
|
|
23
|
+
if (start === undefined)
|
|
24
|
+
return undefined;
|
|
25
|
+
y.push({ start, gap });
|
|
26
|
+
}
|
|
27
|
+
return { x, y };
|
|
28
|
+
};
|
|
29
|
+
/** A grid coordinate in gap-free sheet pixels; a point inside a gap maps to the page it opens. */
|
|
30
|
+
export const toGapFree = (axis, at) => {
|
|
31
|
+
let gaps = 0;
|
|
32
|
+
for (const { start, gap } of axis) {
|
|
33
|
+
if (at >= start) {
|
|
34
|
+
gaps += gap;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
if (at > start - gap)
|
|
38
|
+
gaps += at - (start - gap);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return at - gaps;
|
|
43
|
+
};
|
|
44
|
+
/** A gap-free sheet coordinate in grid pixels; a page's first pixel lies after its gap. */
|
|
45
|
+
export const toScreen = (axis, at) => {
|
|
46
|
+
let gaps = 0;
|
|
47
|
+
for (const { start, gap } of axis) {
|
|
48
|
+
if (at >= start - gaps - gap) {
|
|
49
|
+
gaps += gap;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return at + gaps;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Cuts an object starting at grid coordinate `start` and `length` gap-free pixels long into its
|
|
59
|
+
* per-page pieces. `extent` is the length drawn from the first piece's start to the last piece's
|
|
60
|
+
* end, gaps included; with no boundary inside the object it is one piece of `length`.
|
|
61
|
+
*/
|
|
62
|
+
export const splitAcrossPages = (axis, start, length) => {
|
|
63
|
+
const from = toGapFree(axis, start);
|
|
64
|
+
const to = from + length;
|
|
65
|
+
const cuts = [];
|
|
66
|
+
let gaps = 0;
|
|
67
|
+
for (const { start: pageStart, gap } of axis) {
|
|
68
|
+
gaps += gap;
|
|
69
|
+
const at = pageStart - gaps;
|
|
70
|
+
if (at > from && at < to)
|
|
71
|
+
cuts.push(at);
|
|
72
|
+
}
|
|
73
|
+
const first = toScreen(axis, from);
|
|
74
|
+
const pieces = [];
|
|
75
|
+
let pieceStart = from;
|
|
76
|
+
for (const cut of [...cuts, to]) {
|
|
77
|
+
pieces.push({
|
|
78
|
+
offset: toScreen(axis, pieceStart) - first,
|
|
79
|
+
length: cut - pieceStart,
|
|
80
|
+
content: pieceStart - from,
|
|
81
|
+
});
|
|
82
|
+
pieceStart = cut;
|
|
83
|
+
}
|
|
84
|
+
const last = pieces[pieces.length - 1];
|
|
85
|
+
return { start: first, extent: last.offset + last.length, pieces };
|
|
86
|
+
};
|
|
@@ -2,6 +2,15 @@ import React from "react";
|
|
|
2
2
|
import type { PivotTable, Slicer, TableView } from "../../types";
|
|
3
3
|
import type { CanvasGridProps, SpreadsheetTheme } from "../canvas-grid/typings";
|
|
4
4
|
export type SlicerComponentProps = {
|
|
5
|
+
/**
|
|
6
|
+
* In Page Layout view an object a page boundary cuts is drawn once per page piece: which piece
|
|
7
|
+
* this is (`index` of `count`). Absent when the object is drawn whole. A component that registers
|
|
8
|
+
* itself by id (an image export, say) should register for the first piece (`index` 0) only.
|
|
9
|
+
*/
|
|
10
|
+
pageLayoutPiece?: {
|
|
11
|
+
index: number;
|
|
12
|
+
count: number;
|
|
13
|
+
};
|
|
5
14
|
sheetId: number;
|
|
6
15
|
slicer: Slicer;
|
|
7
16
|
theme: SpreadsheetTheme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slicer-component.d.ts","sourceRoot":"","sources":["../../../../components/embeds/slicer-component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAIlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAMhF,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,gBAAgB,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAClD,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IACjD;;;;;OAKG;IACH,aAAa,CAAC,CACZ,aAAa,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAClC,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EAAE,GACvB,IAAI,CAAC;IAER,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAClC,iBAAiB,CAAC,EAAE,eAAe,CAAC,mBAAmB,CAAC,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,eAAe,0IAUvB,oBAAoB,uBA2UxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"slicer-component.d.ts","sourceRoot":"","sources":["../../../../components/embeds/slicer-component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAIlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAMhF,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;;OAIG;IACH,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,gBAAgB,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAClD,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IACjD;;;;;OAKG;IACH,aAAa,CAAC,CACZ,aAAa,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAClC,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EAAE,GACvB,IAAI,CAAC;IAER,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAClC,iBAAiB,CAAC,EAAE,eAAe,CAAC,mBAAmB,CAAC,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,eAAe,0IAUvB,oBAAoB,uBA2UxB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { EmbedFormControlSpec, EmbedTextBoxSpec } from "../../types";
|
|
3
|
+
import type { SpreadsheetTheme } from "../canvas-grid/typings";
|
|
4
|
+
export type TextBoxViewProps = {
|
|
5
|
+
spec: EmbedTextBoxSpec;
|
|
6
|
+
theme: SpreadsheetTheme;
|
|
7
|
+
};
|
|
8
|
+
export declare const TextBoxView: ({ spec, theme }: TextBoxViewProps) => React.JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* What a form control's placeholder shows, in the grid and in print: a check box's square or an
|
|
11
|
+
* option button's circle before the caption, and the caption (its text, else its name, else its
|
|
12
|
+
* kind). The control itself does not run here.
|
|
13
|
+
*/
|
|
14
|
+
export declare const formControlFace: (spec: EmbedFormControlSpec) => {
|
|
15
|
+
marker: "square" | "circle" | null;
|
|
16
|
+
caption: string;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=text-box-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-box-view.d.ts","sourceRoot":"","sources":["../../../../components/embeds/text-box-view.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,iBAAiB,gBAAgB,sBAgI5D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM,oBAAoB,KACzB;IAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAQtD,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// One text box's face, as the grid draws it and print prints it: the box's fill, borders,
|
|
2
|
+
// padding, alignment and wrapping, and its text (rich runs or plain) in the theme's fonts. A
|
|
3
|
+
// shape's text body draws through it too. Inline styles only: print copies the page's markup
|
|
4
|
+
// into an iframe without the app's stylesheets.
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { getStringifiedColor, resolveThemeFontFamily } from "../../themes";
|
|
7
|
+
import { resolveCanvasTextAlign } from "../cell/alignment";
|
|
8
|
+
export const TextBoxView = ({ spec, theme }) => {
|
|
9
|
+
const backgroundColor = spec.backgroundColor
|
|
10
|
+
? getStringifiedColor(spec.backgroundColor, theme)
|
|
11
|
+
: undefined;
|
|
12
|
+
const textColor = spec.textFormat?.color
|
|
13
|
+
? getStringifiedColor(spec.textFormat.color, theme)
|
|
14
|
+
: undefined;
|
|
15
|
+
const textStyle = {
|
|
16
|
+
fontFamily: resolveThemeFontFamily(spec.textFormat?.fontFamily, theme) || undefined,
|
|
17
|
+
fontSize: spec.textFormat?.fontSize
|
|
18
|
+
? `${spec.textFormat.fontSize * (spec.textFormat?.baselineOffset ? 0.58 : 1)}px`
|
|
19
|
+
: spec.textFormat?.baselineOffset
|
|
20
|
+
? "0.58em"
|
|
21
|
+
: undefined,
|
|
22
|
+
verticalAlign: spec.textFormat?.baselineOffset === "superscript"
|
|
23
|
+
? "super"
|
|
24
|
+
: spec.textFormat?.baselineOffset === "subscript"
|
|
25
|
+
? "sub"
|
|
26
|
+
: undefined,
|
|
27
|
+
fontWeight: spec.textFormat?.bold ? "bold" : undefined,
|
|
28
|
+
fontStyle: spec.textFormat?.italic ? "italic" : undefined,
|
|
29
|
+
textDecoration: [
|
|
30
|
+
spec.textFormat?.strikethrough ? "line-through" : "",
|
|
31
|
+
spec.textFormat?.underline ? "underline" : "",
|
|
32
|
+
]
|
|
33
|
+
.filter(Boolean)
|
|
34
|
+
.join(" ") || undefined,
|
|
35
|
+
color: textColor,
|
|
36
|
+
margin: 0,
|
|
37
|
+
};
|
|
38
|
+
const containerStyle = {
|
|
39
|
+
width: "100%",
|
|
40
|
+
height: "100%",
|
|
41
|
+
backgroundColor,
|
|
42
|
+
padding: spec.padding ? `${spec.padding}px` : "4px",
|
|
43
|
+
textAlign: spec.horizontalAlignment
|
|
44
|
+
? resolveCanvasTextAlign(spec.horizontalAlignment)
|
|
45
|
+
: undefined,
|
|
46
|
+
display: "flex",
|
|
47
|
+
flexDirection: "column",
|
|
48
|
+
justifyContent: spec.verticalAlignment === "top"
|
|
49
|
+
? "flex-start"
|
|
50
|
+
: spec.verticalAlignment === "bottom"
|
|
51
|
+
? "flex-end"
|
|
52
|
+
: "center",
|
|
53
|
+
wordWrap: spec.wrapStrategy === "wrap" ? "break-word" : undefined,
|
|
54
|
+
overflow: spec.wrapStrategy === "clip" ? "hidden" : undefined,
|
|
55
|
+
whiteSpace: spec.wrapStrategy === "overflow" ? "nowrap" : "pre-wrap",
|
|
56
|
+
borderTop: spec.borders?.top
|
|
57
|
+
? `${spec.borders.top.width}px ${spec.borders.top.style} ${getStringifiedColor(spec.borders.top.color, theme)}`
|
|
58
|
+
: undefined,
|
|
59
|
+
borderRight: spec.borders?.right
|
|
60
|
+
? `${spec.borders.right.width}px ${spec.borders.right.style} ${getStringifiedColor(spec.borders.right.color, theme)}`
|
|
61
|
+
: undefined,
|
|
62
|
+
borderBottom: spec.borders?.bottom
|
|
63
|
+
? `${spec.borders.bottom.width}px ${spec.borders.bottom.style} ${getStringifiedColor(spec.borders.bottom.color, theme)}`
|
|
64
|
+
: undefined,
|
|
65
|
+
borderLeft: spec.borders?.left
|
|
66
|
+
? `${spec.borders.left.width}px ${spec.borders.left.style} ${getStringifiedColor(spec.borders.left.color, theme)}`
|
|
67
|
+
: undefined,
|
|
68
|
+
lineHeight: 1.15,
|
|
69
|
+
};
|
|
70
|
+
// Render rich text if available
|
|
71
|
+
if (spec.richText && spec.richText.length > 0) {
|
|
72
|
+
return (React.createElement("div", { style: containerStyle },
|
|
73
|
+
React.createElement("div", { style: textStyle }, spec.richText.map((run, index) => {
|
|
74
|
+
const runStyle = {
|
|
75
|
+
fontFamily: resolveThemeFontFamily(run.format?.fontFamily, theme) ||
|
|
76
|
+
undefined,
|
|
77
|
+
fontSize: run.format?.fontSize
|
|
78
|
+
? `${run.format.fontSize * (run.format?.baselineOffset ? 0.58 : 1)}px`
|
|
79
|
+
: run.format?.baselineOffset
|
|
80
|
+
? "0.58em"
|
|
81
|
+
: undefined,
|
|
82
|
+
verticalAlign: run.format?.baselineOffset === "superscript"
|
|
83
|
+
? "super"
|
|
84
|
+
: run.format?.baselineOffset === "subscript"
|
|
85
|
+
? "sub"
|
|
86
|
+
: undefined,
|
|
87
|
+
fontWeight: run.format?.bold ? "bold" : undefined,
|
|
88
|
+
fontStyle: run.format?.italic ? "italic" : undefined,
|
|
89
|
+
textDecoration: [
|
|
90
|
+
run.format?.strikethrough ? "line-through" : "",
|
|
91
|
+
run.format?.underline ? "underline" : "",
|
|
92
|
+
]
|
|
93
|
+
.filter(Boolean)
|
|
94
|
+
.join(" ") || undefined,
|
|
95
|
+
color: run.format?.color
|
|
96
|
+
? getStringifiedColor(run.format.color, theme)
|
|
97
|
+
: undefined,
|
|
98
|
+
};
|
|
99
|
+
return (React.createElement("span", { key: index, style: runStyle }, run.text));
|
|
100
|
+
}))));
|
|
101
|
+
}
|
|
102
|
+
// Render plain text
|
|
103
|
+
return (React.createElement("div", { style: containerStyle },
|
|
104
|
+
React.createElement("div", { style: textStyle }, spec.text || "")));
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* What a form control's placeholder shows, in the grid and in print: a check box's square or an
|
|
108
|
+
* option button's circle before the caption, and the caption (its text, else its name, else its
|
|
109
|
+
* kind). The control itself does not run here.
|
|
110
|
+
*/
|
|
111
|
+
export const formControlFace = (spec) => ({
|
|
112
|
+
marker: spec.objectType === "CheckBox"
|
|
113
|
+
? "square"
|
|
114
|
+
: spec.objectType === "Radio"
|
|
115
|
+
? "circle"
|
|
116
|
+
: null,
|
|
117
|
+
caption: spec.text ?? spec.name ?? spec.objectType,
|
|
118
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-by-color.d.ts","sourceRoot":"","sources":["../../../../components/filter-box/filter-by-color.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"filter-by-color.d.ts","sourceRoot":"","sources":["../../../../components/filter-box/filter-by-color.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAI3E,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACzC,yCAAyC;IACzC,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACvC,iEAAiE;IACjE,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,+CAA+C;IAC/C,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5D,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3D,CAAC;AAyEF,eAAO,MAAM,aAAa,8JASrB,kBAAkB,uBAiKtB,CAAC"}
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
import { CheckIcon } from "@rowsncolumns/icons";
|
|
9
9
|
import { Button } from "@rowsncolumns/ui";
|
|
10
10
|
import React, { memo, useCallback } from "react";
|
|
11
|
+
import { getCfIcon } from "../../api/cf-icons";
|
|
12
|
+
import { CfIconPreview } from "../cf-icon-preview";
|
|
11
13
|
const Row = ({ selected, onClick, swatch, label, title, }) => (React.createElement(Button, { type: "button", "aria-pressed": selected, "aria-label": title, title: title, onClick: (e) => {
|
|
12
14
|
e.stopPropagation();
|
|
13
15
|
onClick();
|
|
@@ -16,7 +18,12 @@ const Row = ({ selected, onClick, swatch, label, title, }) => (React.createEleme
|
|
|
16
18
|
swatch,
|
|
17
19
|
React.createElement("span", { className: "whitespace-nowrap overflow-hidden text-ellipsis" }, label)));
|
|
18
20
|
const ColorSwatch = ({ color }) => (React.createElement("span", { className: "inline-block h-4 w-4 rounded border border-gray-300 shrink-0", style: { backgroundColor: color } }));
|
|
19
|
-
|
|
21
|
+
/**
|
|
22
|
+
* A conditional-format icon, drawn by the grid's own icon painter so it never depends on a font
|
|
23
|
+
* having the glyph (3 Stars' half star is U+2BEA, which common fonts lack); the text stand-in
|
|
24
|
+
* only when the icon set is unknown.
|
|
25
|
+
*/
|
|
26
|
+
const IconSwatch = ({ glyph, color, iconSet, iconId, }) => iconSet && typeof iconId === "number" && getCfIcon(iconSet, iconId) ? (React.createElement(CfIconPreview, { iconSet: iconSet, iconId: iconId, size: 16 })) : (React.createElement("span", { className: "inline-block h-4 w-4 leading-none text-center text-sm shrink-0", style: color ? { color } : undefined }, glyph));
|
|
20
27
|
const sameColor = (a, b) => !!(a && b) && a.toLowerCase() === b.toLowerCase();
|
|
21
28
|
export const FilterByColor = memo(({ colorFilter, iconFilter, availableCellColors, availableFontColors, availableIcons, onChangeColorFilter, onChangeIconFilter, }) => {
|
|
22
29
|
const cellColors = availableCellColors ?? [];
|
|
@@ -79,7 +86,7 @@ export const FilterByColor = memo(({ colorFilter, iconFilter, availableCellColor
|
|
|
79
86
|
e.stopPropagation();
|
|
80
87
|
handleIcon(icon);
|
|
81
88
|
}, className: `h-7 w-7 p-0 flex items-center justify-center ${selected ? "ring-2 ring-blue-500" : ""}` },
|
|
82
|
-
React.createElement(IconSwatch, { glyph: icon.glyph, color: icon.color })));
|
|
89
|
+
React.createElement(IconSwatch, { glyph: icon.glyph, color: icon.color, iconSet: icon.iconSet, iconId: icon.iconId })));
|
|
83
90
|
})))) : null));
|
|
84
91
|
});
|
|
85
92
|
FilterByColor.displayName = "FilterByColor";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/filter-box/index.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAsC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/filter-box/index.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAO3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAMV,cAAc,EACd,UAAU,EAGV,SAAS,EACV,MAAM,aAAa,CAAC;AAMrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,MAAM,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IACtC,QAAQ,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IAC1C,mBAAmB,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC;IAC3D,mBAAmB,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC;IAC3D,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,+DAA+D;IAC/D,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,sEAAsE;IACtE,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CAC1B,CAAC;AAGF,eAAO,MAAM,WAAW,GACtB,QAAQ,UAAU,GAAG,SAAS,KAC7B,MAAM,IAAI,SAEZ,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,cAAc,GAAG,SAAS,KACnC,OAQA,CAAC;AA0BJ,eAAO,MAAM,gBAAgB,4NAexB,cAAc,uBA+lBlB,CAAC;AAIF,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS;YAAW,cAAc;;CA4C9C,CAAC"}
|
|
@@ -6,7 +6,9 @@ import React, { useEffect, useRef, useState } from "react";
|
|
|
6
6
|
import { memo, useCallback, useMemo } from "react";
|
|
7
7
|
import { useFocusSheet, useGetFormattedValue } from "../../atoms";
|
|
8
8
|
import { useOpenSortDialog } from "../../atoms/sort-dialog.atom";
|
|
9
|
+
import { getCfIcon } from "../../api/cf-icons";
|
|
9
10
|
import { BLANK_LABEL } from "../../config";
|
|
11
|
+
import { CfIconPreview } from "../cf-icon-preview";
|
|
10
12
|
import { StyledFakeTriggerButton } from "../context-menu/style";
|
|
11
13
|
import { classifyFilterColumn } from "./date-tree";
|
|
12
14
|
import { FilterByColor } from "./filter-by-color";
|
|
@@ -386,7 +388,9 @@ export const FilterBoxWrapper = memo(({ dimensionIndex, onOpenChange, onSort, on
|
|
|
386
388
|
sortBy: "icon",
|
|
387
389
|
sortIcon: { iconSet: icon.iconSet, iconId: icon.iconId },
|
|
388
390
|
}), className: "justify-start px-2 py-0 gap-2 text-sm text-left w-full h-6" },
|
|
389
|
-
|
|
391
|
+
getCfIcon(icon.iconSet, icon.iconId) ? (
|
|
392
|
+
// Drawn by the grid's icon painter: no font glyph (3 Stars' half star).
|
|
393
|
+
React.createElement(CfIconPreview, { iconSet: icon.iconSet, iconId: icon.iconId, size: 16 })) : (React.createElement("span", { className: "inline-block h-4 w-4 leading-none text-center text-sm shrink-0", style: icon.color ? { color: icon.color } : undefined }, icon.glyph)),
|
|
390
394
|
"Icon"))))) : null,
|
|
391
395
|
React.createElement(PopoverMenuItem, { type: "button", disabled: !canClearColumn, onClick: onClearColumnFilter },
|
|
392
396
|
React.createElement(DropdownLeftSlot, { className: "text-base leading-4" },
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { CellFormat, GridRange } from "@rowsncolumns/common-types";
|
|
2
|
+
import type { CSSProperties } from "react";
|
|
2
3
|
import React from "react";
|
|
4
|
+
import type { EmbedFormControlSpec, EmbedImageSpec, EmbedShapeSpec, EmbedTextBoxSpec, PrintErrorMode } from "../../types";
|
|
5
|
+
import type { SpreadsheetTheme } from "../canvas-grid/typings";
|
|
3
6
|
import type { PrintCellInfo } from "./print-cells";
|
|
4
7
|
import { type HeaderFooterFields, type Margins, type PrintAlignment, type PrintVerticalAlignment } from "./settings";
|
|
5
8
|
import type { PageBlock as PageBlockType, PrintedChart } from "./use-page-layout";
|
|
@@ -40,6 +43,13 @@ export type PageBlockProps = CellAccess & {
|
|
|
40
43
|
/** Print the row numbers and column letters (Excel's Print ▸ Row and column headings). */
|
|
41
44
|
showHeadings?: boolean;
|
|
42
45
|
showNotes: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Excel's Page Setup ▸ Sheet ▸ "Cell errors as": what an error cell prints.
|
|
48
|
+
* `"displayed"` (the default) prints the error token itself; the others
|
|
49
|
+
* substitute for it. Only the PRINTED text changes — the cell keeps its
|
|
50
|
+
* value, and nothing is written to the workbook.
|
|
51
|
+
*/
|
|
52
|
+
printErrors?: PrintErrorMode;
|
|
43
53
|
horizontalAlignment: PrintAlignment;
|
|
44
54
|
verticalAlignment: PrintVerticalAlignment;
|
|
45
55
|
/**
|
|
@@ -92,6 +102,17 @@ export type PageBlockProps = CellAccess & {
|
|
|
92
102
|
charts?: Array<PrintedChart & {
|
|
93
103
|
imageUrl?: string;
|
|
94
104
|
}>;
|
|
105
|
+
/**
|
|
106
|
+
* Pictures, shapes, text boxes and form controls whose anchor cell lands on this page, placed
|
|
107
|
+
* like `charts` and drawn over the cells the way the grid draws them: a picture from its
|
|
108
|
+
* `imageUrl`; a shape from its geometry, fill and outline (`ShapeSvg`, with `theme`) with its
|
|
109
|
+
* text over it; a text box's box and text (`TextBoxView`); a form control's placeholder (a
|
|
110
|
+
* check box's square or an option button's circle, and its caption). Turned by `rotation`
|
|
111
|
+
* degrees about their centre.
|
|
112
|
+
*/
|
|
113
|
+
objects?: PrintedObject[];
|
|
114
|
+
/** The workbook theme a shape's theme colours resolve in. */
|
|
115
|
+
theme?: SpreadsheetTheme;
|
|
95
116
|
/**
|
|
96
117
|
* The sheet displays right-to-left (`<sheetView rightToLeft="1">`): Excel
|
|
97
118
|
* prints it mirrored — the first column on the right edge of the page,
|
|
@@ -102,5 +123,30 @@ export type PageBlockProps = CellAccess & {
|
|
|
102
123
|
*/
|
|
103
124
|
rightToLeft?: boolean;
|
|
104
125
|
};
|
|
126
|
+
/** A drawing laid onto one printed page (`placeChartsOnPages`' frame plus what to draw). */
|
|
127
|
+
export type PrintedObject = PrintedChart & {
|
|
128
|
+
rotation?: number;
|
|
129
|
+
} & (({
|
|
130
|
+
kind: "image";
|
|
131
|
+
imageUrl: string;
|
|
132
|
+
} & Pick<EmbedImageSpec, "crop" | "brightness" | "contrast" | "transparency">) | {
|
|
133
|
+
kind: "shape";
|
|
134
|
+
spec: EmbedShapeSpec;
|
|
135
|
+
} | {
|
|
136
|
+
kind: "textbox";
|
|
137
|
+
spec: EmbedTextBoxSpec;
|
|
138
|
+
} | {
|
|
139
|
+
kind: "formControl";
|
|
140
|
+
spec: EmbedFormControlSpec;
|
|
141
|
+
});
|
|
142
|
+
/**
|
|
143
|
+
* A picture's Picture Format as print draws it, the way the sheet shows it: the part its crop
|
|
144
|
+
* keeps stretched to the frame (each edge trims that fraction of the picture), brightness and
|
|
145
|
+
* contrast (-1 … 1) as filters, transparency (0 = opaque) as opacity.
|
|
146
|
+
*/
|
|
147
|
+
export declare const printedPicture: (picture: Pick<EmbedImageSpec, "crop" | "brightness" | "contrast" | "transparency">, width: number, height: number) => {
|
|
148
|
+
wrapper?: CSSProperties;
|
|
149
|
+
image: CSSProperties;
|
|
150
|
+
};
|
|
105
151
|
export declare const PageBlock: React.FC<PageBlockProps>;
|
|
106
152
|
//# sourceMappingURL=page-block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-block.d.ts","sourceRoot":"","sources":["../../../../components/print-preview/page-block.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACV,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"page-block.d.ts","sourceRoot":"","sources":["../../../../components/print-preview/page-block.tsx"],"names":[],"mappings":"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"}
|
|
@@ -7,8 +7,25 @@
|
|
|
7
7
|
// `screen={false}`) so the printed output matches the on-screen
|
|
8
8
|
// preview byte-for-byte.
|
|
9
9
|
import React, { useMemo } from "react";
|
|
10
|
+
import { defaultSpreadsheetTheme } from "../../config";
|
|
11
|
+
import { ShapeSvg } from "../embeds/shape-svg";
|
|
12
|
+
import { formControlFace, TextBoxView } from "../embeds/text-box-view";
|
|
10
13
|
import { cellInlineStyle } from "./cell-styles";
|
|
11
14
|
import { FOOTER_STRIP_HEIGHT, HEADER_STRIP_HEIGHT, PRINT_HEADINGS, } from "./settings";
|
|
15
|
+
/**
|
|
16
|
+
* The text an error cell prints under Page Setup ▸ Sheet ▸ "Cell errors as".
|
|
17
|
+
* A cell that is not an error, and the default `"displayed"`, print what the
|
|
18
|
+
* grid shows.
|
|
19
|
+
*/
|
|
20
|
+
const printedErrorText = (value, isError, mode) => {
|
|
21
|
+
if (!isError || mode === "displayed")
|
|
22
|
+
return value;
|
|
23
|
+
if (mode === "blank")
|
|
24
|
+
return "";
|
|
25
|
+
if (mode === "dash")
|
|
26
|
+
return "--";
|
|
27
|
+
return "#N/A";
|
|
28
|
+
};
|
|
12
29
|
/** Excel's horizontal alignments as the printed cell lays them out. */
|
|
13
30
|
const mirrorAlignment = (alignment) => alignment === "left" ? "right" : alignment === "right" ? "left" : alignment;
|
|
14
31
|
/**
|
|
@@ -49,6 +66,93 @@ const columnHeadingText = (column) => {
|
|
|
49
66
|
}
|
|
50
67
|
return letters;
|
|
51
68
|
};
|
|
69
|
+
/**
|
|
70
|
+
* A form control's placeholder on paper: the grid's (`EmbedComponent`) with its utility classes
|
|
71
|
+
* written out as inline styles, since print carries no stylesheet.
|
|
72
|
+
*/
|
|
73
|
+
const PrintedFormControl = ({ spec }) => {
|
|
74
|
+
const face = formControlFace(spec);
|
|
75
|
+
return (React.createElement("div", { style: {
|
|
76
|
+
display: "flex",
|
|
77
|
+
alignItems: "center",
|
|
78
|
+
gap: 4,
|
|
79
|
+
width: "100%",
|
|
80
|
+
height: "100%",
|
|
81
|
+
overflow: "hidden",
|
|
82
|
+
whiteSpace: "nowrap",
|
|
83
|
+
padding: "0 4px",
|
|
84
|
+
fontSize: 12,
|
|
85
|
+
lineHeight: "16px",
|
|
86
|
+
} },
|
|
87
|
+
face.marker ? (React.createElement("span", { style: {
|
|
88
|
+
display: "inline-block",
|
|
89
|
+
width: 12,
|
|
90
|
+
height: 12,
|
|
91
|
+
flexShrink: 0,
|
|
92
|
+
border: "1px solid currentColor",
|
|
93
|
+
borderRadius: face.marker === "circle" ? "50%" : 2,
|
|
94
|
+
} })) : null,
|
|
95
|
+
React.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, face.caption)));
|
|
96
|
+
};
|
|
97
|
+
/** What one printed object draws inside its frame. */
|
|
98
|
+
const PrintedObjectFace = ({ object, theme, }) => {
|
|
99
|
+
switch (object.kind) {
|
|
100
|
+
case "image": {
|
|
101
|
+
const picture = printedPicture(object, object.width, object.height);
|
|
102
|
+
const image = React.createElement("img", { src: object.imageUrl, alt: object.title ?? "", style: picture.image });
|
|
103
|
+
return picture.wrapper ? React.createElement("div", { style: picture.wrapper }, image) : image;
|
|
104
|
+
}
|
|
105
|
+
case "shape":
|
|
106
|
+
return object.spec.textBody ? (React.createElement("div", { style: { position: "relative", width: "100%", height: "100%" } },
|
|
107
|
+
React.createElement(ShapeSvg, { spec: object.spec, width: object.width, height: object.height, theme: theme }),
|
|
108
|
+
React.createElement("div", { style: { position: "absolute", inset: 0, overflowWrap: "break-word" } },
|
|
109
|
+
React.createElement(TextBoxView, { spec: { type: "textbox", ...object.spec.textBody }, theme: theme })))) : (React.createElement(ShapeSvg, { spec: object.spec, width: object.width, height: object.height, theme: theme }));
|
|
110
|
+
case "textbox":
|
|
111
|
+
return (React.createElement("div", { style: { width: "100%", height: "100%", overflowWrap: "break-word" } },
|
|
112
|
+
React.createElement(TextBoxView, { spec: object.spec, theme: theme })));
|
|
113
|
+
case "formControl":
|
|
114
|
+
return React.createElement(PrintedFormControl, { spec: object.spec });
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const clampUnit = (value, min, max) => Math.min(max, Math.max(min, value ?? 0));
|
|
118
|
+
/**
|
|
119
|
+
* A picture's Picture Format as print draws it, the way the sheet shows it: the part its crop
|
|
120
|
+
* keeps stretched to the frame (each edge trims that fraction of the picture), brightness and
|
|
121
|
+
* contrast (-1 … 1) as filters, transparency (0 = opaque) as opacity.
|
|
122
|
+
*/
|
|
123
|
+
export const printedPicture = (picture, width, height) => {
|
|
124
|
+
const { crop, brightness, contrast, transparency } = picture;
|
|
125
|
+
const left = clampUnit(crop?.left, 0, 0.99);
|
|
126
|
+
const top = clampUnit(crop?.top, 0, 0.99);
|
|
127
|
+
const visibleWidth = Math.max(0.01, 1 - left - clampUnit(crop?.right, 0, 0.99));
|
|
128
|
+
const visibleHeight = Math.max(0.01, 1 - top - clampUnit(crop?.bottom, 0, 0.99));
|
|
129
|
+
const filters = [
|
|
130
|
+
brightness ? `brightness(${1 + clampUnit(brightness, -1, 1)})` : "",
|
|
131
|
+
contrast ? `contrast(${1 + clampUnit(contrast, -1, 1)})` : "",
|
|
132
|
+
].filter(Boolean);
|
|
133
|
+
const adjustments = {
|
|
134
|
+
...(filters.length ? { filter: filters.join(" ") } : {}),
|
|
135
|
+
...(transparency ? { opacity: 1 - clampUnit(transparency, 0, 1) } : {}),
|
|
136
|
+
};
|
|
137
|
+
if (visibleWidth >= 1 && visibleHeight >= 1) {
|
|
138
|
+
return {
|
|
139
|
+
image: { width: "100%", height: "100%", display: "block", ...adjustments },
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
wrapper: { position: "relative", width: "100%", height: "100%", overflow: "hidden" },
|
|
144
|
+
image: {
|
|
145
|
+
position: "absolute",
|
|
146
|
+
display: "block",
|
|
147
|
+
maxWidth: "none",
|
|
148
|
+
width: width / visibleWidth,
|
|
149
|
+
height: height / visibleHeight,
|
|
150
|
+
left: (-left * width) / visibleWidth,
|
|
151
|
+
top: (-top * height) / visibleHeight,
|
|
152
|
+
...adjustments,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
};
|
|
52
156
|
/**
|
|
53
157
|
* Build a (row, col) → "skip" map for cells covered by a merge anchor
|
|
54
158
|
* elsewhere, plus an anchor → {rowSpan, colSpan} map for the cells
|
|
@@ -157,7 +261,7 @@ const HeaderFooterStrip = ({ position, data }) => {
|
|
|
157
261
|
React.createElement("div", { style: { ...cellBase, justifyContent: "center" } }, center),
|
|
158
262
|
React.createElement("div", { style: { ...cellBase, justifyContent: "flex-end" } }, right)));
|
|
159
263
|
};
|
|
160
|
-
export const PageBlock = ({ block, pageWidth, pageHeight, margins, scale, showGridlines, showHeadings = false, showNotes, horizontalAlignment, verticalAlignment, sheetId, getFormattedValue, getEffectiveFormat, getColumnWidth, getRowHeight, merges, hasNote, getCellInfo, frozenRowStart, frozenRowEnd, frozenColumnStart, frozenColumnEnd, headerFooter, screen = true, charts, rightToLeft = false, }) => {
|
|
264
|
+
export const PageBlock = ({ block, pageWidth, pageHeight, margins, scale, showGridlines, showHeadings = false, showNotes, printErrors = "displayed", horizontalAlignment, verticalAlignment, sheetId, getFormattedValue, getEffectiveFormat, getColumnWidth, getRowHeight, merges, hasNote, getCellInfo, frozenRowStart, frozenRowEnd, frozenColumnStart, frozenColumnEnd, headerFooter, screen = true, charts, objects, theme = defaultSpreadsheetTheme, rightToLeft = false, }) => {
|
|
161
265
|
const showFrozenRows = frozenRowStart !== undefined &&
|
|
162
266
|
frozenRowEnd !== undefined &&
|
|
163
267
|
frozenRowEnd >= frozenRowStart;
|
|
@@ -340,9 +444,10 @@ export const PageBlock = ({ block, pageWidth, pageHeight, margins, scale, showGr
|
|
|
340
444
|
return null;
|
|
341
445
|
const span = anchors.get(key);
|
|
342
446
|
const format = getEffectiveFormat(sheetId, r, c);
|
|
343
|
-
const
|
|
447
|
+
const info0 = getCellInfo?.(sheetId, r, c);
|
|
448
|
+
const value = printedErrorText(getFormattedValue(sheetId, r, c) ?? "", info0?.isError === true, printErrors);
|
|
344
449
|
const cellHeight = rowHeight * (span?.rowSpan ?? 1);
|
|
345
|
-
const info =
|
|
450
|
+
const info = info0;
|
|
346
451
|
const alignment = printedAlignment(format?.horizontalAlignment ??
|
|
347
452
|
(rightToLeft && format?.readingOrder !== "ltr"
|
|
348
453
|
? mirrorAlignment(info?.defaultAlignment ?? "left")
|
|
@@ -460,6 +565,19 @@ export const PageBlock = ({ block, pageWidth, pageHeight, margins, scale, showGr
|
|
|
460
565
|
fontSize: 12,
|
|
461
566
|
color: "#6b7280",
|
|
462
567
|
} }, chart.title ?? "Chart"))));
|
|
463
|
-
})
|
|
568
|
+
}),
|
|
569
|
+
objects?.map((object) => (React.createElement("div", { key: object.chartId, "data-print-object": object.chartId, style: {
|
|
570
|
+
position: "absolute",
|
|
571
|
+
...(rightToLeft
|
|
572
|
+
? { right: object.left + headingWidth }
|
|
573
|
+
: { left: object.left + headingWidth }),
|
|
574
|
+
top: object.top + headingHeight,
|
|
575
|
+
width: object.width,
|
|
576
|
+
height: object.height,
|
|
577
|
+
...(object.rotation
|
|
578
|
+
? { transform: `rotate(${object.rotation}deg)` }
|
|
579
|
+
: {}),
|
|
580
|
+
} },
|
|
581
|
+
React.createElement(PrintedObjectFace, { object: object, theme: theme })))))),
|
|
464
582
|
headerFooter ? (React.createElement(HeaderFooterStrip, { position: "footer", data: headerFooter })) : null));
|
|
465
583
|
};
|
|
@@ -8,6 +8,11 @@ export type PrintCellInfo = {
|
|
|
8
8
|
blocksSpill: boolean;
|
|
9
9
|
/** The picture the cell shows (`=IMAGE()`'s result or an in-cell image). */
|
|
10
10
|
imageUrl?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The cell's value is an error (`#DIV/0!`, `#N/A`, …) — what Page Setup ▸
|
|
13
|
+
* Sheet ▸ "Cell errors as" substitutes for.
|
|
14
|
+
*/
|
|
15
|
+
isError: boolean;
|
|
11
16
|
};
|
|
12
17
|
export declare const describePrintCell: (cell: CellData | null | undefined, formattedValue: string | null | undefined) => PrintCellInfo;
|
|
13
18
|
//# sourceMappingURL=print-cells.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print-cells.d.ts","sourceRoot":"","sources":["../../../../components/print-preview/print-cells.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,QAAQ,EAGR,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAUpC,MAAM,MAAM,aAAa,GAAG;IAC1B,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,eAAe,CAAC;IACnC,yFAAyF;IACzF,MAAM,EAAE,OAAO,CAAC;IAChB,uEAAuE;IACvE,WAAW,EAAE,OAAO,CAAC;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"print-cells.d.ts","sourceRoot":"","sources":["../../../../components/print-preview/print-cells.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,QAAQ,EAGR,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAUpC,MAAM,MAAM,aAAa,GAAG;IAC1B,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,eAAe,CAAC;IACnC,yFAAyF;IACzF,MAAM,EAAE,OAAO,CAAC;IAChB,uEAAuE;IACvE,WAAW,EAAE,OAAO,CAAC;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAUF,eAAO,MAAM,iBAAiB,GAC5B,MAAM,QAAQ,GAAG,IAAI,GAAG,SAAS,EACjC,gBAAgB,MAAM,GAAG,IAAI,GAAG,SAAS,KACxC,aA6BF,CAAC"}
|
|
@@ -25,6 +25,7 @@ export const describePrintCell = (cell, formattedValue) => {
|
|
|
25
25
|
return {
|
|
26
26
|
defaultAlignment,
|
|
27
27
|
imageUrl,
|
|
28
|
+
isError: getExtendedValueError(effectiveValue) !== undefined,
|
|
28
29
|
spills: !imageUrl && !isNumber && !isNilOrBlank(formattedValue),
|
|
29
30
|
blocksSpill: blocksOverflow({
|
|
30
31
|
formattedValue,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { CellData, CellFormat } from "@rowsncolumns/common-types";
|
|
2
|
-
import type
|
|
2
|
+
import { type SelectionArea } from "@rowsncolumns/grid";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import type { EmbeddedChart, Sheet } from "../../types";
|
|
4
|
+
import type { BandedRange, EmbeddedChart, EmbeddedObject, Sheet } from "../../types";
|
|
5
|
+
import type { SpreadsheetTheme } from "../canvas-grid/typings";
|
|
5
6
|
import { type PrintComment } from "./print-comments";
|
|
6
7
|
import { type PrintSettings } from "./settings";
|
|
7
8
|
export type PrintPreviewDialogProps = {
|
|
@@ -53,6 +54,19 @@ export type PrintPreviewDialogProps = {
|
|
|
53
54
|
* no renderer to capture and prints as a titled frame.
|
|
54
55
|
*/
|
|
55
56
|
charts?: EmbeddedChart[];
|
|
57
|
+
/**
|
|
58
|
+
* The workbook's pictures and shapes — same array the grid renders. Each prints on the page its
|
|
59
|
+
* anchor cell lands on: a picture from its image, a shape from its geometry, fill and outline.
|
|
60
|
+
* Shape text, text boxes, form controls, OLE objects and linked pictures are not drawn.
|
|
61
|
+
*/
|
|
62
|
+
embeds?: EmbeddedObject[];
|
|
63
|
+
/**
|
|
64
|
+
* The banded ranges the grid draws (tables' styles included): their fills, font colours and
|
|
65
|
+
* borders print under each cell's own format, as on screen.
|
|
66
|
+
*/
|
|
67
|
+
bandedRanges?: BandedRange[];
|
|
68
|
+
/** The workbook theme, for table styles and shapes in theme colours. */
|
|
69
|
+
theme?: SpreadsheetTheme;
|
|
56
70
|
/**
|
|
57
71
|
* The sheet's threaded comments, for "Comments and notes ▸ At end of sheet" (each thread with its
|
|
58
72
|
* replies, Excel's printout). Omitted: the list carries the cells' notes only.
|