@sheetxl/react 0.8.0-beta.11 → 0.8.0-beta.13

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.
Files changed (141) hide show
  1. package/browser/esm/{B93LSmhnvkxNXTq-.mjs → -wQNyCnoJdQUTTfP.mjs} +1 -1
  2. package/browser/esm/{Bl2BFCQ00fotauKB.mjs → AL94cpxFjPurAMQG.mjs} +1 -1
  3. package/browser/esm/{BQYS2Yf-EAV_tBLr.mjs → B4K8rf7TAv0SBkbG.mjs} +1 -1
  4. package/browser/esm/{ClAtIfYbsUPA073B.mjs → BrwfFgqKdMG_-iar.mjs} +1 -1
  5. package/browser/esm/ByBGwdqhc_l75i5G.mjs +145 -0
  6. package/browser/esm/{DgL7Dy-Lqcr1TvW6.mjs → C1zqAqKQ6oa4FiTH.mjs} +4851 -4818
  7. package/browser/esm/C9lQPmVMIlUwXkKr.mjs +303 -0
  8. package/browser/esm/{Dnh1kpz3v1JKtRD_.mjs → CIrcPI7uOT93ydNn.mjs} +2 -2
  9. package/browser/esm/{DS66lAIM-9M-YoZQ.mjs → CZsNidKZjsn0lNnA.mjs} +112 -104
  10. package/browser/esm/{Bos4Rkp8UTF7QXUB.mjs → CcewpxckpDrXSiZ-.mjs} +1 -1
  11. package/browser/esm/{BegvsXeRs7e-9t8k.mjs → CdDvFP8Fqm8uU7Rw.mjs} +1 -1
  12. package/browser/esm/{D2u6THGErqw64KQI.mjs → CfewUx0gINn-wXt3.mjs} +1 -1
  13. package/browser/esm/{C1pc9F4Rt2C5FKUo.mjs → CfvYfq6ALVqkCsdg.mjs} +1 -1
  14. package/browser/esm/CulxiChz6lj3G9lw.mjs +341 -0
  15. package/browser/esm/D5Uy22WeT7vUS36Z.mjs +19 -0
  16. package/browser/esm/{1-LEUre9ZLG0OYYB.mjs → Dd8deQ2CDMdrhzF1.mjs} +6 -6
  17. package/browser/esm/Dit7p67J_fDF5RDj.mjs +262 -0
  18. package/browser/esm/{CPnnESfZz2jjJd82.mjs → DzWFl-_dCN-EOkio.mjs} +3 -3
  19. package/browser/esm/{94dxo1A-z8lgiiGw.mjs → MIDbAwdzknMaoTU5.mjs} +2 -2
  20. package/browser/esm/{B26QVfjer2oY2ewK.mjs → ao9zR4H88b7AmZEV.mjs} +1 -1
  21. package/browser/esm/chart.mjs +28 -27
  22. package/browser/esm/control.mjs +74 -73
  23. package/browser/esm/group.mjs +3 -3
  24. package/browser/esm/index.mjs +6195 -5307
  25. package/browser/esm/note.mjs +5 -5
  26. package/browser/esm/picture.mjs +2 -81
  27. package/browser/esm/sXn9faQLuh4P0TZ9.mjs +401 -0
  28. package/browser/esm/shape.mjs +2 -2
  29. package/browser/esm/slicer.mjs +112 -111
  30. package/browser/esm/{CzRIbc-Lk__VMLKM.mjs → u3A8I4A7GKIOLOOb.mjs} +3 -3
  31. package/browser/esm/{DMdsMPT0fWBbTkNn.mjs → x6A47UA3fzV361tO.mjs} +1 -1
  32. package/node/esm/{BiaDWnN3tT7neoRL.mjs → A_4Y7EtzCWp1AG3Y.mjs} +1 -1
  33. package/node/esm/BNwVylzKMErhrx4i.mjs +406 -0
  34. package/node/esm/BPBUSXc5TVnD15By.mjs +146 -0
  35. package/node/esm/{DxQZmb-j4NLUO9Af.mjs → BTT6UB5lGvPxcq3F.mjs} +1 -1
  36. package/node/esm/{JiQGhLkoL8CJpVvA.mjs → BYiAmyF-aOOuMkD1.mjs} +1 -1
  37. package/node/esm/BqS8o-CmPoCjHDHp.mjs +263 -0
  38. package/node/esm/{b-XRVRI1fYQQMkTC.mjs → CC_XgLOFPvqmFyZ_.mjs} +525 -492
  39. package/node/esm/{BaRfst1euuhquupX.mjs → CMGUrHMaBDeCezK5.mjs} +1 -1
  40. package/node/esm/{umljAT66yb3_rURh.mjs → CP07qkepi21zlB0n.mjs} +118 -110
  41. package/node/esm/{BlxXufqBBg1PtsXd.mjs → CQJJMfuXl6mbgHdT.mjs} +1 -1
  42. package/node/esm/{C_SNx7TlFEcwbYjx.mjs → CVDVFhM7OIpaOlyN.mjs} +1 -1
  43. package/node/esm/{gpD-9LDW92phhoma.mjs → CVMuO9bpR5YK0pPb.mjs} +1 -1
  44. package/node/esm/{BMVK5plvmBOAIlxP.mjs → CaZG4HD3SmHvD-Tu.mjs} +1 -1
  45. package/node/esm/{6zApGj9DozhFy-bx.mjs → CuRPfxQCj2jookWL.mjs} +1 -1
  46. package/node/esm/D8mYmUPUA6i8oFgR.mjs +19 -0
  47. package/node/esm/{Dj5FM7_-YWhCtCCt.mjs → DAUtyjkW5uSdnTli.mjs} +1 -1
  48. package/node/esm/{D_pCpfdQowV_4Aje.mjs → DfvJ0Dpn-AP2mGtz.mjs} +5 -5
  49. package/node/esm/{DTMTIrYIK1eZswsM.mjs → DipZYwHed-W6QMtQ.mjs} +1 -1
  50. package/node/esm/{Be9c1GwQkPo8Piuh.mjs → NvP_j9pSsDiJ_PyY.mjs} +3 -3
  51. package/node/esm/chart.mjs +26 -25
  52. package/node/esm/control.mjs +79 -78
  53. package/node/esm/{sigD1UFqvPlWUw_9.mjs → eecr5gnC2KqVhOzX.mjs} +2 -2
  54. package/node/esm/group.mjs +3 -3
  55. package/node/esm/index.mjs +6594 -5705
  56. package/node/esm/note.mjs +18 -18
  57. package/node/esm/picture.mjs +269 -50
  58. package/node/esm/shape.mjs +185 -578
  59. package/node/esm/slicer.mjs +51 -50
  60. package/package.json +7 -7
  61. package/resources/locales/de/picture.cmd.json +157 -0
  62. package/resources/locales/de/sheet.cmd.json +45 -2
  63. package/resources/locales/de/ui.msg.json +3 -0
  64. package/resources/locales/de/workbook.cmd.json +6 -0
  65. package/resources/locales/en/picture.cmd.json +157 -0
  66. package/resources/locales/en/sheet.cmd.json +45 -2
  67. package/resources/locales/en/ui.msg.json +5 -0
  68. package/resources/locales/en/workbook.cmd.json +6 -0
  69. package/types/src/border/useBorders.d.ts +2 -2
  70. package/types/src/cell/CellCheckboxRenderer.d.ts +20 -0
  71. package/types/src/cell/CellContent.d.ts +68 -0
  72. package/types/src/cell/CellControlContext.d.ts +37 -0
  73. package/types/src/cell/{FormulaCellRenderer.d.ts → CellFormulaRenderer.d.ts} +5 -5
  74. package/types/src/cell/CellImageRenderer.d.ts +11 -0
  75. package/types/src/cell/CellRenderers.d.ts +190 -0
  76. package/types/src/cell/{SheetCellRenderer.d.ts → CellTextRenderer.d.ts} +9 -6
  77. package/types/src/cell/ColumnButton.d.ts +3 -3
  78. package/types/src/cell/OutlineButton.d.ts +4 -4
  79. package/types/src/cell/SheetHeaderRenderer.d.ts +1 -1
  80. package/types/src/cell/index.d.ts +8 -2
  81. package/types/src/cell/useFormulaViewAnchor.d.ts +1 -1
  82. package/types/src/cell/useInsertableCellControls.d.ts +25 -0
  83. package/types/src/chart/ChartCommands.d.ts +1 -1
  84. package/types/src/chart/ChartEditor.d.ts +2 -0
  85. package/types/src/chart/ChartElement.d.ts +14 -3
  86. package/types/src/chart/paint/_graphics.d.ts +0 -8
  87. package/types/src/chart/paint/_mode.d.ts +6 -0
  88. package/types/src/chart/paint/echarts.d.ts +6 -3
  89. package/types/src/chart/paint/index.d.ts +1 -1
  90. package/types/src/chart/paint/kinds/ChartPaintKind.d.ts +9 -1
  91. package/types/src/chart/paint/kinds/_builtIns.d.ts +0 -9
  92. package/types/src/chart/paint/toEChartsOption.d.ts +12 -1
  93. package/types/src/editableLabel/EditableLabel.d.ts +3 -1
  94. package/types/src/editor/SheetReferenceHeaderLayer.d.ts +1 -1
  95. package/types/src/editor/useFormulaHints.d.ts +1 -1
  96. package/types/src/layer/CellErrorLayer.d.ts +3 -2
  97. package/types/src/layer/CellIndicatorLayer.d.ts +31 -0
  98. package/types/src/layer/CircularIndicatorLayer.d.ts +1 -1
  99. package/types/src/layer/HeaderSelectionLayer.d.ts +4 -4
  100. package/types/src/layer/HyperlinkLayer.d.ts +12 -5
  101. package/types/src/layer/ProtectionLayer.d.ts +1 -2
  102. package/types/src/layer/SheetCellLayer.d.ts +11 -4
  103. package/types/src/layer/SheetMovableLayer.d.ts +2 -1
  104. package/types/src/layer/SheetOutlineLayer.d.ts +1 -1
  105. package/types/src/layer/TableLayer.d.ts +1 -1
  106. package/types/src/layer/TableToolbar.d.ts +1 -1
  107. package/types/src/layer/ValidationPromptLayer.d.ts +16 -4
  108. package/types/src/layer/_visibleCellFeatures.d.ts +11 -0
  109. package/types/src/layer/index.d.ts +1 -0
  110. package/types/src/layer/useValidationPicker.d.ts +1 -1
  111. package/types/src/listener/useRangeListener.d.ts +13 -7
  112. package/types/src/movable/DefaultMovable.d.ts +1 -1
  113. package/types/src/movable/MovableControl.d.ts +3 -1
  114. package/types/src/movable/MovableFrame.d.ts +2 -1
  115. package/types/src/movable/MovableLayer.d.ts +6 -3
  116. package/types/src/movable/useFramePreview.d.ts +17 -0
  117. package/types/src/picture/PictureCommands.d.ts +8 -0
  118. package/types/src/picture/_pictureHyperlink.d.ts +13 -0
  119. package/types/src/picture/pictureCrop.d.ts +32 -0
  120. package/types/src/sheet/ISheetHeaderElement.d.ts +2 -2
  121. package/types/src/sheet/IWorksheetElement.d.ts +21 -22
  122. package/types/src/sheet/SheetCommandProvider.d.ts +3 -0
  123. package/types/src/sheet/SheetOutlineElement.d.ts +2 -2
  124. package/types/src/sheet/SheetPanels.d.ts +2 -2
  125. package/types/src/sheet/_hyperlinkEdit.d.ts +7 -0
  126. package/types/src/sheet/circularReferences.d.ts +1 -1
  127. package/types/src/tabStrip/Sortable.d.ts +5 -5
  128. package/types/src/tabStrip/TabStrip.d.ts +6 -6
  129. package/types/src/tabStrip/TabStripItem.d.ts +15 -13
  130. package/types/src/taskPane/CellControlPane.d.ts +17 -0
  131. package/types/src/taskPane/index.d.ts +1 -0
  132. package/types/src/taskPane/useTaskPane.d.ts +6 -3
  133. package/types/src/theme/buildDocThemeCSS.d.ts +4 -1
  134. package/types/src/workbook/DefaultRenderers.d.ts +4 -4
  135. package/types/src/workbook/IWorkbookElement.d.ts +52 -20
  136. package/types/src/workbook/WorkbookStrip.d.ts +5 -5
  137. package/browser/esm/CRi6DQ3UXmPEv-w_.mjs +0 -729
  138. package/browser/esm/cQ6xdPFkEcuDlNTN.mjs +0 -75
  139. package/browser/esm/ugfE7YeZALQURDKF.mjs +0 -241
  140. package/node/esm/DJPgbB1X22YmhbaR.mjs +0 -242
  141. package/node/esm/DgGEHydEjD7nfsDB.mjs +0 -76
@@ -26,6 +26,163 @@
26
26
  "tags": [
27
27
  "mutator"
28
28
  ]
29
+ },
30
+ "cropOptions": {
31
+ "label": "Crop",
32
+ "description": "Crop the picture to a shape or a proportion, or place it in its frame.",
33
+ "icon": "Crop"
34
+ },
35
+ "cropToShape": {
36
+ "label": "Crop to Shape",
37
+ "description": "Clip the picture to the outline of a shape, keeping its size and formatting.",
38
+ "icon": "Crop",
39
+ "tags": [
40
+ "mutator"
41
+ ]
42
+ },
43
+ "cropAspectOptions": {
44
+ "label": "Aspect Ratio",
45
+ "description": "Crop the picture to a proportion.",
46
+ "icon": "DrawAspect"
47
+ },
48
+ "cropAspect1x1": {
49
+ "label": "1:1",
50
+ "description": "Crop the picture to a proportion of 1:1, about its center.",
51
+ "icon": "DrawAspect",
52
+ "tags": [
53
+ "mutator"
54
+ ]
55
+ },
56
+ "cropAspect2x3": {
57
+ "label": "2:3",
58
+ "description": "Crop the picture to a proportion of 2:3, about its center.",
59
+ "icon": "DrawAspect",
60
+ "tags": [
61
+ "mutator"
62
+ ]
63
+ },
64
+ "cropAspect3x4": {
65
+ "label": "3:4",
66
+ "description": "Crop the picture to a proportion of 3:4, about its center.",
67
+ "icon": "DrawAspect",
68
+ "tags": [
69
+ "mutator"
70
+ ]
71
+ },
72
+ "cropAspect3x5": {
73
+ "label": "3:5",
74
+ "description": "Crop the picture to a proportion of 3:5, about its center.",
75
+ "icon": "DrawAspect",
76
+ "tags": [
77
+ "mutator"
78
+ ]
79
+ },
80
+ "cropAspect4x5": {
81
+ "label": "4:5",
82
+ "description": "Crop the picture to a proportion of 4:5, about its center.",
83
+ "icon": "DrawAspect",
84
+ "tags": [
85
+ "mutator"
86
+ ]
87
+ },
88
+ "cropAspect3x2": {
89
+ "label": "3:2",
90
+ "description": "Crop the picture to a proportion of 3:2, about its center.",
91
+ "icon": "DrawAspect",
92
+ "tags": [
93
+ "mutator"
94
+ ]
95
+ },
96
+ "cropAspect4x3": {
97
+ "label": "4:3",
98
+ "description": "Crop the picture to a proportion of 4:3, about its center.",
99
+ "icon": "DrawAspect",
100
+ "tags": [
101
+ "mutator"
102
+ ]
103
+ },
104
+ "cropAspect5x3": {
105
+ "label": "5:3",
106
+ "description": "Crop the picture to a proportion of 5:3, about its center.",
107
+ "icon": "DrawAspect",
108
+ "tags": [
109
+ "mutator"
110
+ ]
111
+ },
112
+ "cropAspect5x4": {
113
+ "label": "5:4",
114
+ "description": "Crop the picture to a proportion of 5:4, about its center.",
115
+ "icon": "DrawAspect",
116
+ "tags": [
117
+ "mutator"
118
+ ]
119
+ },
120
+ "cropAspect16x9": {
121
+ "label": "16:9",
122
+ "description": "Crop the picture to a proportion of 16:9, about its center.",
123
+ "icon": "DrawAspect",
124
+ "tags": [
125
+ "mutator"
126
+ ]
127
+ },
128
+ "cropAspect16x10": {
129
+ "label": "16:10",
130
+ "description": "Crop the picture to a proportion of 16:10, about its center.",
131
+ "icon": "DrawAspect",
132
+ "tags": [
133
+ "mutator"
134
+ ]
135
+ },
136
+ "cropFill": {
137
+ "label": "Fill",
138
+ "description": "Cover the whole frame with the picture, keeping its proportions. What overflows is cropped.",
139
+ "icon": "Crop",
140
+ "tags": [
141
+ "mutator"
142
+ ]
143
+ },
144
+ "cropFit": {
145
+ "label": "Fit",
146
+ "description": "Show the whole picture inside the frame, keeping its proportions.",
147
+ "icon": "Crop",
148
+ "tags": [
149
+ "mutator"
150
+ ]
151
+ },
152
+ "pictureHyperlinkOptions": {
153
+ "label": "Link",
154
+ "description": "Link the picture to a web page, a place in this workbook or an email address.",
155
+ "icon": "HyperlinkInsert"
156
+ },
157
+ "updatePictureHyperlink": {
158
+ "label": "Link",
159
+ "description": "Add or edit the link a click on the picture follows.",
160
+ "groupLabels": {
161
+ "pictureHyperlinkOptions": "Edit Link…"
162
+ },
163
+ "icon": "HyperlinkEdit",
164
+ "tags": [
165
+ "mutator"
166
+ ]
167
+ },
168
+ "openPictureHyperlink": {
169
+ "label": "Open Link",
170
+ "description": "Follow the link on the picture.",
171
+ "groupLabels": {
172
+ "pictureHyperlinkOptions": "Open Link"
173
+ },
174
+ "icon": "HyperlinkGoto"
175
+ },
176
+ "deletePictureHyperlink": {
177
+ "label": "Remove Link",
178
+ "description": "Remove the link from the picture.",
179
+ "groupLabels": {
180
+ "pictureHyperlinkOptions": "Remove Link"
181
+ },
182
+ "icon": "HyperlinkDelete",
183
+ "tags": [
184
+ "mutator"
185
+ ]
29
186
  }
30
187
  }
31
188
  }
@@ -1039,7 +1039,7 @@
1039
1039
  "description": "Insert a picture from your device.",
1040
1040
  "groupLabels": {
1041
1041
  "contextMenu": "Insert Image…",
1042
- "insertImageOptions": "From Device…"
1042
+ "insertImageOverCellsOptions": "From Device…"
1043
1043
  },
1044
1044
  "icon": "InsertImage",
1045
1045
  "tags": [
@@ -1050,7 +1050,29 @@
1050
1050
  "label": "Insert Image From Web",
1051
1051
  "description": "Insert a picture from the web.",
1052
1052
  "groupLabels": {
1053
- "insertImageOptions": "From the Web…"
1053
+ "insertImageOverCellsOptions": "From the Web…"
1054
+ },
1055
+ "icon": "InsertImage",
1056
+ "tags": [
1057
+ "mutator"
1058
+ ]
1059
+ },
1060
+ "insertImageInCellFromFile": {
1061
+ "label": "Insert Image in Cell",
1062
+ "description": "Insert a picture from your device as the value of the selected cell.",
1063
+ "groupLabels": {
1064
+ "insertImageInCellOptions": "From Device…"
1065
+ },
1066
+ "icon": "InsertImage",
1067
+ "tags": [
1068
+ "mutator"
1069
+ ]
1070
+ },
1071
+ "insertImageInCellFromURL": {
1072
+ "label": "Insert Image in Cell From Web",
1073
+ "description": "Insert a picture from the web as the value of the selected cell.",
1074
+ "groupLabels": {
1075
+ "insertImageInCellOptions": "From the Web…"
1054
1076
  },
1055
1077
  "icon": "InsertImage",
1056
1078
  "tags": [
@@ -1408,6 +1430,27 @@
1408
1430
  "ctrl+L"
1409
1431
  ]
1410
1432
  },
1433
+ "insertCheckbox": {
1434
+ "label": "Checkbox",
1435
+ "description": "Insert checkboxes in the selected cells. A checked box is TRUE and an unchecked box is FALSE.",
1436
+ "icon": "CheckboxInsert",
1437
+ "tags": [
1438
+ "mutator"
1439
+ ]
1440
+ },
1441
+ "insertCellControl": {
1442
+ "label": "Cell Control",
1443
+ "description": "Insert a cell control of the given type in the selected cells, replacing any control there and keeping the values. A value type, such as a button, replaces the values instead.",
1444
+ "icon": "CheckboxInsert",
1445
+ "tags": [
1446
+ "mutator"
1447
+ ]
1448
+ },
1449
+ "formatCellControl": {
1450
+ "label": "Control Options",
1451
+ "description": "Show the options of the cell control under the active cell.",
1452
+ "icon": "CellsFormat"
1453
+ },
1411
1454
  "editTable": {
1412
1455
  "label": "Edit Table…",
1413
1456
  "description": "Edit the table to adjust formatting, sorting, filtering, or other advanced features.",
@@ -10,6 +10,8 @@
10
10
  "autoFill.preset.linear": "Linear",
11
11
  "autoFill.preset.linearTrend": "Linear Trend",
12
12
  "autoFill.preset.series": "AutoFill",
13
+ "cellControl.pane.empty": "Select a cell with a control to see its options.",
14
+ "cellControl.pane.none": "This control has no options.",
13
15
  "cellError.description.blocked": "Access to the data was blocked",
14
16
  "cellError.description.busy": "The value is still being calculated",
15
17
  "cellError.description.calc": "The formula cannot be calculated, for example an empty array",
@@ -215,6 +217,7 @@
215
217
  "reason.entireRow": "Not available when entire rows are selected.",
216
218
  "reason.freezeOrigin": "Select a cell below and/or right of where the panes should freeze.",
217
219
  "reason.groupNeedsTwo": "Select two or more drawings to group.",
220
+ "reason.hyperlinkIsValue": "The link is the cell's value; change its formula to change it.",
218
221
  "reason.mergeUnavailable": "Merge is not available for this selection.",
219
222
  "reason.mixedSelection": "Not available for a mixed full / partial selection.",
220
223
  "reason.noComments": "The sheet has no comments.",
@@ -235,6 +238,8 @@
235
238
  "reason.notImplemented": "Not yet implemented.",
236
239
  "reason.outlineTooDeep": "Groups can be nested no more than 7 levels deep.",
237
240
  "reason.overlap": "Not available for an overlapping selection.",
241
+ "reason.pictureCropLocked": "The picture does not allow cropping.",
242
+ "reason.pictureNoHyperlink": "The picture has no link.",
238
243
  "reason.protectionNotPausable": "Pausing needs a protected sheet.",
239
244
  "reason.sheetLocked": "The sheet is locked.",
240
245
  "reason.sheetProtected": "The sheet is protected.",
@@ -232,6 +232,12 @@
232
232
  "icon": "Calculate",
233
233
  "shortcut": "ctrl+alt+F9"
234
234
  },
235
+ "refreshAll": {
236
+ "label": "Refresh All",
237
+ "description": "Get the latest data from every source the workbook reads: recalculate every formula, fetch what its functions read from the web again rather than from the copy the workbook keeps, and update every external link.",
238
+ "icon": "RefreshAll",
239
+ "shortcut": "ctrl+alt+F5"
240
+ },
235
241
  "calcModeAutomatic": {
236
242
  "label": "Automatic",
237
243
  "description": "Recalculate formulas whenever their inputs change."
@@ -143,9 +143,9 @@ export interface UseBorderOptions {
143
143
  }
144
144
  export interface UseBorderResults {
145
145
  /**
146
- * Array of functions that return components to overlay
146
+ * Draws a pane's borders, or `null` when it has none.
147
147
  */
148
- renderLayer?: (props: React.HTMLProps<HTMLDivElement>, pane: IGridPane) => React.ReactNode;
148
+ renderLayer?: (pane: IGridPane) => React.ReactNode;
149
149
  }
150
150
  /**
151
151
  * useBorders
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ import { CellContentEntry, CellContentRendererProps } from './CellRenderers';
3
+ /**
4
+ * The checkbox cell control: `TRUE` draws checked, `FALSE` and blank draw unchecked, and a press on
5
+ * the box writes the other.
6
+ *
7
+ * @remarks
8
+ * The box takes the cell's font color and scales with its font size, and sits centered on the line
9
+ * the cell's text would paint in. Under General alignment it is centered, as Excel centers a
10
+ * boolean; an explicit left or right alignment moves it to that edge.
11
+ * A formula cell draws the box but takes no press: it is drawn disabled, and a press on it selects
12
+ * the cell as a press on any cell does.
13
+ */
14
+ export declare const CellCheckboxRenderer: (props: CellContentRendererProps) => React.ReactElement;
15
+ /**
16
+ * What the checkbox control contributes to the UI: the box, the press that writes the other value,
17
+ * and Space, which toggles every checkbox the selection touches.
18
+ */
19
+ export declare const CheckboxCellContent: CellContentEntry;
20
+ //# sourceMappingURL=CellCheckboxRenderer.d.ts.map
@@ -0,0 +1,68 @@
1
+ import { default as React } from 'react';
2
+ import { CellContentRendererProps } from './CellRenderers';
3
+ /**
4
+ * The value type whose General alignment {@link CellContent} follows: text sits left, a number
5
+ * right, a boolean centered.
6
+ */
7
+ export type CellContentAlignAs = 'text' | 'number' | 'boolean';
8
+ /**
9
+ * Props for {@link CellContent}: the renderer's own props, spread whole, plus what the host should
10
+ * do with them.
11
+ */
12
+ export interface CellContentProps extends CellContentRendererProps {
13
+ /**
14
+ * Where General alignment places the children: where it would place a value of this type. An
15
+ * explicit horizontal alignment on the cell places them instead.
16
+ *
17
+ * @defaultValue 'boolean'
18
+ */
19
+ alignAs?: CellContentAlignAs;
20
+ /**
21
+ * Makes the whole cell the hit region: the root carries
22
+ * {@link CellContentRendererProps.interactiveProps}. Leave it off and spread the props on the
23
+ * element inside that should take the pointer instead (a checkbox's box, a rating's stars).
24
+ */
25
+ interactive?: boolean;
26
+ /**
27
+ * Centers the children on the line the cell's text would paint in, rather than placing them
28
+ * against the content box: the cell's vertical alignment, font and row height move them as they
29
+ * move text. For content sized to the font that sits beside text (a checkbox, a slider). Content
30
+ * taller than the room about the line is centered on it and may be shrunk by `max-height`.
31
+ */
32
+ centerOnTextLine?: boolean;
33
+ /**
34
+ * Places the children inside the cell's text insets, the padding text gets. Turn it off for
35
+ * content that runs to the cell's edges, such as a picture or a button.
36
+ *
37
+ * @defaultValue true
38
+ */
39
+ inset?: boolean;
40
+ /** The cell's content. */
41
+ children?: React.ReactNode;
42
+ }
43
+ /**
44
+ * The host a content renderer draws into: the cell's root, placed by the layer, with the renderer's
45
+ * props stripped of what is not for the DOM, its children placed in the cell's content box by the
46
+ * cell's alignment, in the cell's font color and size.
47
+ *
48
+ * @remarks
49
+ * Spread the renderer's props onto it whole and put what the cell shows inside:
50
+ *
51
+ * ```tsx
52
+ * const StarsRenderer: CellContentRenderer = (props) => (
53
+ * <CellContent {...props} alignAs="text">
54
+ * <div {...props.interactiveProps}>★★★☆☆</div>
55
+ * </CellContent>
56
+ * );
57
+ * ```
58
+ *
59
+ * It is a component, so a renderer that uses it is one fiber per cell inside a cached tile; the
60
+ * layer calls the renderer itself as a plain function. A renderer that replaces the text and
61
+ * positions nothing of its own needs nothing else; one that decorates the text wraps
62
+ * {@link CellContentRendererProps.Default} instead, which is its own root.
63
+ */
64
+ export declare const CellContent: {
65
+ (props: CellContentProps): React.ReactElement;
66
+ displayName: string;
67
+ };
68
+ //# sourceMappingURL=CellContent.d.ts.map
@@ -0,0 +1,37 @@
1
+ import { ICell, ICellRange, IWorksheet, Scalar } from '@sheetxl/sdk';
2
+ import { IReactNotifier } from '@sheetxl/utils-react';
3
+ import { EditRejectedNotice } from '../editor/useEditRejectedNotice';
4
+ /**
5
+ * What a cell content entry writes through: guarded writes into the sheet, and the notifier for
6
+ * anything else it has to say. One per layer; every entry of the layer shares it.
7
+ */
8
+ export interface CellControlContext {
9
+ sheet: IWorksheet;
10
+ notifier: IReactNotifier;
11
+ /**
12
+ * Writes `value` into `cell`.
13
+ *
14
+ * @returns `false` when the cell refuses the write: it holds a formula, or it is locked on a
15
+ * protected sheet (the user is told why).
16
+ */
17
+ setCellValue(cell: ICell, value: Scalar): boolean;
18
+ /**
19
+ * Writes `value` into every cell of `range` that holds no formula, in one operation.
20
+ *
21
+ * @returns `false` when nothing was written: every cell holds a formula, or the sheet refused
22
+ * (a locked cell on a protected sheet; the user is told why).
23
+ */
24
+ setRangeValue(range: ICellRange, value: Scalar): boolean;
25
+ }
26
+ /** What {@link createCellControlContext} binds. */
27
+ export interface CellControlContextOptions {
28
+ sheet: IWorksheet;
29
+ notifier: IReactNotifier;
30
+ /** The Excel-style heads-up for a write the sheet's protection refuses. */
31
+ notifyEditRejected: EditRejectedNotice;
32
+ }
33
+ /**
34
+ * Creates the {@link CellControlContext} of a layer.
35
+ */
36
+ export declare function createCellControlContext(options: CellControlContextOptions): CellControlContext;
37
+ //# sourceMappingURL=CellControlContext.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { default as React } from 'react';
2
2
  import { ICalculation, ICell, Size } from '@sheetxl/sdk';
3
3
  /**
4
- * Props for {@link FormulaCellRenderer}.
4
+ * Props for {@link CellFormulaRenderer}.
5
5
  */
6
- export interface FormulaCellRendererProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ export interface CellFormulaRendererProps extends React.HTMLAttributes<HTMLDivElement> {
7
7
  /** The formula cell being rendered (styling source: font, alignment, insets). */
8
8
  cell: ICell;
9
9
  /**
@@ -22,7 +22,7 @@ export interface FormulaCellRendererProps extends React.HTMLAttributes<HTMLDivEl
22
22
  * The **formula-view** cell renderer: the anchor cell's formula as tokenized, syntax-colored text.
23
23
  *
24
24
  * @remarks
25
- * The live counterpart of `SheetCellRenderer`'s (plain) `showFormulas` path: the tiled layer keeps
25
+ * The live counterpart of `CellTextRenderer`'s (plain) `showFormulas` path: the tiled layer keeps
26
26
  * every formula cell as an immutable plain-text snapshot, and `SheetCellLayer` suppresses the
27
27
  * ANCHOR cell (the live `data-rc` CSS channel) and overlays this renderer in its place — so
28
28
  * selection moves never invalidate a tile. Colors are emitted as theme tokens (`light-dark()`
@@ -33,5 +33,5 @@ export interface FormulaCellRendererProps extends React.HTMLAttributes<HTMLDivEl
33
33
  * the letter-spacing that paints the text at its measured width.
34
34
  * (2nd pass: hover highlight/eval tooltips like the editor's overlay.)
35
35
  */
36
- export declare const FormulaCellRenderer: React.FC<FormulaCellRendererProps>;
37
- //# sourceMappingURL=FormulaCellRenderer.d.ts.map
36
+ export declare const CellFormulaRenderer: React.FC<CellFormulaRendererProps>;
37
+ //# sourceMappingURL=CellFormulaRenderer.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { CellContentEntry, CellContentRendererProps } from './CellRenderers';
3
+ /**
4
+ * Draws an image value: the picture in the cell, edge to edge, placed by the cell's alignment
5
+ * (left under General, as text is) and sized by the value's sizing. Nothing draws until the bytes are in;
6
+ * a source with no picture draws `#VALUE!`.
7
+ */
8
+ export declare const CellImageRenderer: (props: CellContentRendererProps) => React.ReactElement;
9
+ /** What an image value contributes to the UI: its picture. */
10
+ export declare const CellImageContent: CellContentEntry;
11
+ //# sourceMappingURL=CellImageRenderer.d.ts.map
@@ -0,0 +1,190 @@
1
+ import { default as React } from 'react';
2
+ import { ICell, ICellControl, IRangeSelection, IWorksheet } from '@sheetxl/sdk';
3
+ import { CellRendererProps } from '@sheetxl/grid-react';
4
+ import { CellTextRendererProps } from './CellTextRenderer';
5
+ import { CellControlContext } from './CellControlContext';
6
+ /**
7
+ * The props spread onto the element of a cell's content that takes the pointer (see
8
+ * {@link CellContentRendererProps.interactiveProps}). A marker only: one frozen object for every
9
+ * cell, no handlers.
10
+ */
11
+ export type CellInteractiveProps = Readonly<Record<string, string>>;
12
+ /**
13
+ * The props of the default text renderer as a content renderer receives it
14
+ * ({@link CellContentRendererProps.Default}): the content props may be spread straight onto it.
15
+ */
16
+ export type DefaultCellContentProps = Omit<CellContentRendererProps, keyof CellContentOnlyProps> & Partial<CellContentOnlyProps> & Partial<Omit<CellTextRendererProps, keyof CellRendererProps<ICell>>>;
17
+ /** The props a content renderer has that the default text renderer does not. */
18
+ export interface CellContentOnlyProps {
19
+ control: ICellControl | null;
20
+ context: CellControlContext;
21
+ interactiveProps: CellInteractiveProps;
22
+ Default: React.ComponentType<DefaultCellContentProps>;
23
+ }
24
+ /**
25
+ * What a cell content renderer is given: the cell layer's props for the cell, the layer's write
26
+ * context, the props that make an element interactive, and the default text renderer.
27
+ *
28
+ * @remarks
29
+ * A renderer is a pure function of these props: it is rendered inside the cell layer's cached
30
+ * tiles and calls no hook.
31
+ */
32
+ export interface CellContentRendererProps extends CellRendererProps<ICell> {
33
+ /**
34
+ * The control the renderer draws for, when it was chosen by the cell's control; `null` when it
35
+ * was chosen by the value's rich data type.
36
+ */
37
+ control: ICellControl | null;
38
+ /**
39
+ * The layer's write context, one for every cell of the layer: guarded writes
40
+ * (`setCellValue(cell, value)`) for a renderer that writes from its own pointer handlers, such
41
+ * as a slider's drag. A press and a key write through the entry instead.
42
+ */
43
+ context: CellControlContext;
44
+ /**
45
+ * Spread onto the element that takes the pointer: the box of a checkbox, a button, the track of a
46
+ * slider. It marks the element, nothing more. A plain press on a marked element selects the cell
47
+ * and then reaches the element; the cell layer runs the entry's {@link CellContentEntry.onPress}
48
+ * for it and stops the press, and keeps a double-click on it from opening the editor. For a drag
49
+ * or hover add your own handlers on the element (capture the pointer on it for a drag); a handler
50
+ * that stops the press keeps the layer out of it.
51
+ */
52
+ interactiveProps: CellInteractiveProps;
53
+ /**
54
+ * The default text renderer, bound to this layer's theme, Normal style and view flags. For a
55
+ * renderer that decorates the text rather than replacing it: `<Default {...props}>{badge}</Default>`.
56
+ */
57
+ Default: React.ComponentType<DefaultCellContentProps>;
58
+ }
59
+ /**
60
+ * Draws a cell's content in place of its text.
61
+ *
62
+ * @remarks
63
+ * A pure function of its props: the layer calls it directly inside its cached tiles, not as a
64
+ * component, so it can hold no state and call no hook (a hook throws). It returns the cell's root,
65
+ * which applies `props.style` to place itself in the cell; `CellContent` is that root ready-made.
66
+ * The layer takes no pointer events; the part that should take the pointer spreads
67
+ * `props.interactiveProps`.
68
+ */
69
+ export type CellContentRenderer = (props: CellContentRendererProps) => React.ReactNode;
70
+ /** What a key offered to a content entry is about: the selection it acts on. */
71
+ export interface CellKeyTarget {
72
+ sheet: IWorksheet;
73
+ selection: IRangeSelection;
74
+ /** The selection's anchor cell. */
75
+ anchor: ICell;
76
+ /** The controls of the entry's type that the selection touches; empty for a rich data entry. */
77
+ controls: ICellControl[];
78
+ }
79
+ /** Props of a content entry's task pane body ({@link CellContentEntry.pane}). */
80
+ export interface CellControlPaneProps {
81
+ sheet: IWorksheet;
82
+ /** The anchor cell. */
83
+ cell: ICell;
84
+ /** The cell's control; `null` for a rich data entry. */
85
+ control: ICellControl | null;
86
+ }
87
+ /**
88
+ * What a type of cell control, or of rich data value, contributes to the UI: how its cells draw,
89
+ * what a press and a key do to them, and the task pane body for them. Every field is optional; a
90
+ * type registered with none draws as text.
91
+ */
92
+ export interface CellContentEntry {
93
+ /** Draws the cell in place of its text. Without it the cell draws as text. */
94
+ renderer?: CellContentRenderer;
95
+ /**
96
+ * A press on the content: a primary press on an element carrying
97
+ * {@link CellContentRendererProps.interactiveProps}. A checkbox writes the other value. The
98
+ * event says what was pressed: a renderer with several hit zones in one cell (the stars of a
99
+ * rating) marks them with attributes of its own and reads `event.target`.
100
+ */
101
+ onPress?: (cell: ICell, ctx: CellControlContext, event: CellPressEvent) => void;
102
+ /**
103
+ * A printable key, Space included, typed on the grid while the selection touches cells of this
104
+ * type. Never Enter, Tab, an arrow, Escape or a function key, and never a key with a modifier.
105
+ * Return `true` when consumed: the key then never starts an edit. Return `false` to let the key
106
+ * start the normal edit of the anchor cell. Offered once per type with the whole selection; a
107
+ * checkbox toggles every checkbox cell of it on Space.
108
+ */
109
+ onKey?: (key: string, target: CellKeyTarget, ctx: CellControlContext) => boolean;
110
+ /** The body the cell control pane shows while a cell of this type is the selection's anchor. */
111
+ pane?: React.ComponentType<CellControlPaneProps>;
112
+ /**
113
+ * The icon where a UI lists the types that can be inserted: a `DynamicIcon` key or an element.
114
+ * The name comes from the sdk kind's `label`.
115
+ */
116
+ icon?: string | React.ReactElement;
117
+ /**
118
+ * Whether a UI lists the type among those that can be inserted. Off for a type whose default
119
+ * value shows nothing, such as an image, which needs a source.
120
+ *
121
+ * @defaultValue true
122
+ */
123
+ insertable?: boolean;
124
+ }
125
+ /** The press handed to {@link CellContentEntry.onPress}: the pointer event, already consumed. */
126
+ export type CellPressEvent = Pick<React.PointerEvent, 'button' | 'target' | 'clientX' | 'clientY' | 'shiftKey' | 'ctrlKey' | 'metaKey' | 'altKey'>;
127
+ /** A cell's content entry and what chose it, as {@link getCellContent} answers it. */
128
+ export interface ResolvedCellContent {
129
+ entry: CellContentEntry;
130
+ /** {@inheritDoc CellContentRendererProps.control} */
131
+ control: ICellControl | null;
132
+ }
133
+ /**
134
+ * Registers what a type of cell control contributes to the UI, replacing the built-in entry.
135
+ *
136
+ * @param type The control type (`ICellControl.getType()`), as registered with `CellControlRegistry`
137
+ * in the SDK.
138
+ * @returns A function that removes the registration.
139
+ */
140
+ export declare function registerCellControl(type: string, entry: CellContentEntry): () => void;
141
+ /**
142
+ * Registers what a type of rich data value contributes to the UI, used when the cell's control
143
+ * does not draw the value. Replaces the built-in entry (`image`).
144
+ *
145
+ * @param type The rich data type (`IRichData.getKind().getName()`), as registered with `RichDataRegistry` in
146
+ * the SDK.
147
+ * @returns A function that removes the registration.
148
+ */
149
+ export declare function registerRichData(type: string, entry: CellContentEntry): () => void;
150
+ /** The entry registered for a rich data type, built-in or not, or `undefined`. */
151
+ export declare function getRichDataEntry(type: string): CellContentEntry | undefined;
152
+ /** The entry registered for a control type, built-in or not, or `undefined`. */
153
+ export declare function getCellControlEntry(type: string): CellContentEntry | undefined;
154
+ /**
155
+ * The content entry for `cell`, or `null` for plain text.
156
+ *
157
+ * @remarks
158
+ * The cell's control comes first, when it accepts the cell's value and an entry is registered for
159
+ * its type; then the entry for the value's rich data type. The entry may still have no renderer,
160
+ * in which case the cell draws as text.
161
+ */
162
+ export declare function getCellContent(cell: ICell): ResolvedCellContent | null;
163
+ /**
164
+ * Calls `listener` whenever what {@link getCellContent} answers may have changed: an entry
165
+ * registered or removed.
166
+ *
167
+ * @returns A function that removes the listener.
168
+ */
169
+ export declare function addCellContentListener(listener: () => void): () => void;
170
+ /**
171
+ * Changes whenever an entry is registered or removed, for `useSyncExternalStore`.
172
+ * @internal
173
+ */
174
+ export declare function getCellContentVersion(): number;
175
+ /**
176
+ * A primary press that reached the cell layer: when it is on interactive content whose entry has a
177
+ * press, runs the press and consumes the event. The layer's own handler, so no cell carries one.
178
+ *
179
+ * @returns Whether the press was taken.
180
+ */
181
+ export declare function pressCellContent(e: CellPressEvent & Pick<React.PointerEvent, 'stopPropagation' | 'preventDefault'>, sheet: IWorksheet, ctx: CellControlContext): boolean;
182
+ /**
183
+ * Offers a printable key typed on the grid to the content entries the selection touches, once per
184
+ * type with the whole selection (the selection's controls grouped by type, then the anchor's rich
185
+ * data type).
186
+ *
187
+ * @returns Whether an entry consumed it. The caller then never starts an edit with the key.
188
+ */
189
+ export declare function offerCellKey(key: string, sheet: IWorksheet, ctx: CellControlContext): boolean;
190
+ //# sourceMappingURL=CellRenderers.d.ts.map