@rowsncolumns/spreadsheet 10.6.0 → 10.6.4

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 (182) hide show
  1. package/dist/cjs/api/cf-data-bar.d.ts +73 -0
  2. package/dist/cjs/api/cf-data-bar.d.ts.map +1 -0
  3. package/dist/cjs/api/cf-data-bar.js +182 -0
  4. package/dist/cjs/api/cf-icons.d.ts +73 -0
  5. package/dist/cjs/api/cf-icons.d.ts.map +1 -0
  6. package/dist/cjs/api/cf-icons.js +322 -0
  7. package/dist/cjs/api/cf-overlays.d.ts +89 -3
  8. package/dist/cjs/api/cf-overlays.d.ts.map +1 -1
  9. package/dist/cjs/api/cf-overlays.js +256 -80
  10. package/dist/cjs/api/cf-priority.d.ts +34 -0
  11. package/dist/cjs/api/cf-priority.d.ts.map +1 -0
  12. package/dist/cjs/api/cf-priority.js +94 -0
  13. package/dist/cjs/api/heatmap.d.ts +7 -1
  14. package/dist/cjs/api/heatmap.d.ts.map +1 -1
  15. package/dist/cjs/api/heatmap.js +27 -11
  16. package/dist/cjs/api/selections.d.ts +2 -2
  17. package/dist/cjs/api/validation.d.ts +6 -0
  18. package/dist/cjs/api/validation.d.ts.map +1 -1
  19. package/dist/cjs/api/validation.js +10 -1
  20. package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
  21. package/dist/cjs/components/canvas-grid/index.js +194 -51
  22. package/dist/cjs/components/canvas-grid/overflow.d.ts +37 -0
  23. package/dist/cjs/components/canvas-grid/overflow.d.ts.map +1 -0
  24. package/dist/cjs/components/canvas-grid/overflow.js +49 -0
  25. package/dist/cjs/components/canvas-grid/page-breaks.d.ts +15 -0
  26. package/dist/cjs/components/canvas-grid/page-breaks.d.ts.map +1 -0
  27. package/dist/cjs/components/canvas-grid/page-breaks.js +77 -0
  28. package/dist/cjs/components/canvas-grid/typings.d.ts +25 -0
  29. package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
  30. package/dist/cjs/components/cell/alignment.d.ts +58 -1
  31. package/dist/cjs/components/cell/alignment.d.ts.map +1 -1
  32. package/dist/cjs/components/cell/alignment.js +144 -1
  33. package/dist/cjs/components/cell/cell-background.d.ts +2 -0
  34. package/dist/cjs/components/cell/cell-background.d.ts.map +1 -1
  35. package/dist/cjs/components/cell/cell-background.js +5 -6
  36. package/dist/cjs/components/cell/cell-backgrounds.d.ts.map +1 -1
  37. package/dist/cjs/components/cell/cell-backgrounds.js +5 -1
  38. package/dist/cjs/components/cell/cell-text-runs.js +1 -1
  39. package/dist/cjs/components/cell/index.d.ts.map +1 -1
  40. package/dist/cjs/components/cell/index.js +378 -37
  41. package/dist/cjs/components/cell/number-format-layout.d.ts +35 -0
  42. package/dist/cjs/components/cell/number-format-layout.d.ts.map +1 -0
  43. package/dist/cjs/components/cell/number-format-layout.js +106 -0
  44. package/dist/cjs/components/cell/typings.d.ts +22 -0
  45. package/dist/cjs/components/cell/typings.d.ts.map +1 -1
  46. package/dist/cjs/components/cell-editor/index.js +2 -2
  47. package/dist/cjs/components/cell-filter/index.d.ts.map +1 -1
  48. package/dist/cjs/components/cell-filter/index.js +3 -3
  49. package/dist/cjs/components/cell-overlay/index.d.ts +20 -0
  50. package/dist/cjs/components/cell-overlay/index.d.ts.map +1 -1
  51. package/dist/cjs/components/cell-overlay/index.js +155 -28
  52. package/dist/cjs/components/cf-icon-preview/index.d.ts +16 -0
  53. package/dist/cjs/components/cf-icon-preview/index.d.ts.map +1 -0
  54. package/dist/cjs/components/cf-icon-preview/index.js +48 -0
  55. package/dist/cjs/components/embeds/embed-component.d.ts.map +1 -1
  56. package/dist/cjs/components/embeds/embed-component.js +3 -2
  57. package/dist/cjs/components/hidden-markers/index.d.ts.map +1 -1
  58. package/dist/cjs/components/hidden-markers/index.js +8 -7
  59. package/dist/cjs/components/hidden-markers/style.d.ts +7 -0
  60. package/dist/cjs/components/hidden-markers/style.d.ts.map +1 -1
  61. package/dist/cjs/components/hidden-markers/style.js +13 -2
  62. package/dist/cjs/components/protect-sheet-dialog/index.d.ts +67 -0
  63. package/dist/cjs/components/protect-sheet-dialog/index.d.ts.map +1 -0
  64. package/dist/cjs/components/protect-sheet-dialog/index.js +196 -0
  65. package/dist/cjs/components/toolbar/types.d.ts +1 -1
  66. package/dist/cjs/components/toolbar/types.d.ts.map +1 -1
  67. package/dist/cjs/config.d.ts +13 -1
  68. package/dist/cjs/config.d.ts.map +1 -1
  69. package/dist/cjs/config.js +15 -3
  70. package/dist/cjs/helpers.d.ts +10 -5
  71. package/dist/cjs/helpers.d.ts.map +1 -1
  72. package/dist/cjs/helpers.js +43 -31
  73. package/dist/cjs/hooks/use-border-styles.d.ts.map +1 -1
  74. package/dist/cjs/hooks/use-border-styles.js +5 -28
  75. package/dist/cjs/hooks/use-cell-renderer.d.ts +35 -3
  76. package/dist/cjs/hooks/use-cell-renderer.d.ts.map +1 -1
  77. package/dist/cjs/hooks/use-cell-renderer.js +85 -47
  78. package/dist/cjs/hooks/use-conditional-formatting.d.ts +13 -1
  79. package/dist/cjs/hooks/use-conditional-formatting.d.ts.map +1 -1
  80. package/dist/cjs/hooks/use-conditional-formatting.js +281 -230
  81. package/dist/cjs/index.d.ts +5 -0
  82. package/dist/cjs/index.d.ts.map +1 -1
  83. package/dist/cjs/index.js +5 -0
  84. package/dist/cjs/release-date.js +1 -1
  85. package/dist/cjs/themes.d.ts +8 -0
  86. package/dist/cjs/themes.d.ts.map +1 -1
  87. package/dist/cjs/themes.js +21 -3
  88. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  89. package/dist/cjs/types.d.ts +81 -4
  90. package/dist/cjs/types.d.ts.map +1 -1
  91. package/dist/esm/api/cf-data-bar.d.ts +73 -0
  92. package/dist/esm/api/cf-data-bar.d.ts.map +1 -0
  93. package/dist/esm/api/cf-data-bar.js +178 -0
  94. package/dist/esm/api/cf-icons.d.ts +73 -0
  95. package/dist/esm/api/cf-icons.d.ts.map +1 -0
  96. package/dist/esm/api/cf-icons.js +306 -0
  97. package/dist/esm/api/cf-overlays.d.ts +89 -3
  98. package/dist/esm/api/cf-overlays.d.ts.map +1 -1
  99. package/dist/esm/api/cf-overlays.js +223 -67
  100. package/dist/esm/api/cf-priority.d.ts +34 -0
  101. package/dist/esm/api/cf-priority.d.ts.map +1 -0
  102. package/dist/esm/api/cf-priority.js +61 -0
  103. package/dist/esm/api/heatmap.d.ts +7 -1
  104. package/dist/esm/api/heatmap.d.ts.map +1 -1
  105. package/dist/esm/api/heatmap.js +24 -9
  106. package/dist/esm/api/selections.d.ts +2 -2
  107. package/dist/esm/api/validation.d.ts +6 -0
  108. package/dist/esm/api/validation.d.ts.map +1 -1
  109. package/dist/esm/api/validation.js +6 -0
  110. package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
  111. package/dist/esm/components/canvas-grid/index.js +163 -47
  112. package/dist/esm/components/canvas-grid/overflow.d.ts +37 -0
  113. package/dist/esm/components/canvas-grid/overflow.d.ts.map +1 -0
  114. package/dist/esm/components/canvas-grid/overflow.js +39 -0
  115. package/dist/esm/components/canvas-grid/page-breaks.d.ts +15 -0
  116. package/dist/esm/components/canvas-grid/page-breaks.d.ts.map +1 -0
  117. package/dist/esm/components/canvas-grid/page-breaks.js +50 -0
  118. package/dist/esm/components/canvas-grid/typings.d.ts +25 -0
  119. package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
  120. package/dist/esm/components/cell/alignment.d.ts +58 -1
  121. package/dist/esm/components/cell/alignment.d.ts.map +1 -1
  122. package/dist/esm/components/cell/alignment.js +110 -1
  123. package/dist/esm/components/cell/cell-background.d.ts +2 -0
  124. package/dist/esm/components/cell/cell-background.d.ts.map +1 -1
  125. package/dist/esm/components/cell/cell-background.js +4 -5
  126. package/dist/esm/components/cell/cell-backgrounds.d.ts.map +1 -1
  127. package/dist/esm/components/cell/cell-backgrounds.js +5 -1
  128. package/dist/esm/components/cell/cell-text-runs.js +2 -2
  129. package/dist/esm/components/cell/index.d.ts.map +1 -1
  130. package/dist/esm/components/cell/index.js +339 -39
  131. package/dist/esm/components/cell/number-format-layout.d.ts +35 -0
  132. package/dist/esm/components/cell/number-format-layout.d.ts.map +1 -0
  133. package/dist/esm/components/cell/number-format-layout.js +99 -0
  134. package/dist/esm/components/cell/typings.d.ts +22 -0
  135. package/dist/esm/components/cell/typings.d.ts.map +1 -1
  136. package/dist/esm/components/cell-editor/index.js +2 -2
  137. package/dist/esm/components/cell-filter/index.d.ts.map +1 -1
  138. package/dist/esm/components/cell-filter/index.js +4 -4
  139. package/dist/esm/components/cell-overlay/index.d.ts +20 -0
  140. package/dist/esm/components/cell-overlay/index.d.ts.map +1 -1
  141. package/dist/esm/components/cell-overlay/index.js +111 -25
  142. package/dist/esm/components/cf-icon-preview/index.d.ts +16 -0
  143. package/dist/esm/components/cf-icon-preview/index.d.ts.map +1 -0
  144. package/dist/esm/components/cf-icon-preview/index.js +41 -0
  145. package/dist/esm/components/embeds/embed-component.d.ts.map +1 -1
  146. package/dist/esm/components/embeds/embed-component.js +4 -3
  147. package/dist/esm/components/hidden-markers/index.d.ts.map +1 -1
  148. package/dist/esm/components/hidden-markers/index.js +9 -8
  149. package/dist/esm/components/hidden-markers/style.d.ts +7 -0
  150. package/dist/esm/components/hidden-markers/style.d.ts.map +1 -1
  151. package/dist/esm/components/hidden-markers/style.js +8 -1
  152. package/dist/esm/components/protect-sheet-dialog/index.d.ts +67 -0
  153. package/dist/esm/components/protect-sheet-dialog/index.d.ts.map +1 -0
  154. package/dist/esm/components/protect-sheet-dialog/index.js +154 -0
  155. package/dist/esm/components/toolbar/types.d.ts +1 -1
  156. package/dist/esm/components/toolbar/types.d.ts.map +1 -1
  157. package/dist/esm/config.d.ts +13 -1
  158. package/dist/esm/config.d.ts.map +1 -1
  159. package/dist/esm/config.js +13 -1
  160. package/dist/esm/helpers.d.ts +10 -5
  161. package/dist/esm/helpers.d.ts.map +1 -1
  162. package/dist/esm/helpers.js +40 -28
  163. package/dist/esm/hooks/use-border-styles.d.ts.map +1 -1
  164. package/dist/esm/hooks/use-border-styles.js +5 -26
  165. package/dist/esm/hooks/use-cell-renderer.d.ts +35 -3
  166. package/dist/esm/hooks/use-cell-renderer.d.ts.map +1 -1
  167. package/dist/esm/hooks/use-cell-renderer.js +83 -42
  168. package/dist/esm/hooks/use-conditional-formatting.d.ts +13 -1
  169. package/dist/esm/hooks/use-conditional-formatting.d.ts.map +1 -1
  170. package/dist/esm/hooks/use-conditional-formatting.js +215 -120
  171. package/dist/esm/index.d.ts +5 -0
  172. package/dist/esm/index.d.ts.map +1 -1
  173. package/dist/esm/index.js +5 -0
  174. package/dist/esm/release-date.js +1 -1
  175. package/dist/esm/themes.d.ts +8 -0
  176. package/dist/esm/themes.d.ts.map +1 -1
  177. package/dist/esm/themes.js +20 -3
  178. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  179. package/dist/esm/types.d.ts +81 -4
  180. package/dist/esm/types.d.ts.map +1 -1
  181. package/dist/spreadsheet.min.css +1 -1
  182. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"use-border-styles.d.ts","sourceRoot":"","sources":["../../../hooks/use-border-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,aAAa,EAEd,MAAM,oBAAoB,CAAC;AAS5B,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAI3C,OAAO,KAAK,EAEV,gBAAgB,EAChB,MAAM,EAEN,SAAS,EACV,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,eAAe,CAAC,QAAQ,C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CAAC,CAAC;IACtD,eAAe,EAAE,qBAAqB,EAAE,CAAC;CAC1C,CAAC;AA8BF,eAAO,MAAM,mCAAmC,GAC9C,WAAW,aAAa,CAAC,SAAS,CAAC,EACnC,SAAQ,SAAS,EAAE,GAAG,SAAS,GAAG,IAAS,oFAoC5C,CAAC;AA4BF,eAAO,MAAM,eAAe,GAAI,gXAsB7B,oBAAoB,iBA0XtB,CAAC"}
@@ -11,7 +11,6 @@ var react_1 = require("react");
11
11
  var atoms_1 = require("../atoms");
12
12
  var config_1 = require("../config");
13
13
  var helpers_1 = require("../helpers");
14
- var themes_1 = require("../themes");
15
14
  var use_memo_compare_1 = require("./use-memo-compare");
16
15
  /**
17
16
  * Checks if the user is dragging a table or basicFilter
@@ -100,19 +99,6 @@ var getDraggedColumnStyle = function (direction, borderColor) {
100
99
  };
101
100
  }
102
101
  };
103
- // Get first table border color
104
- var getTableBorder = function (properties) {
105
- var _a, _b;
106
- if (properties.headerBorder) {
107
- return (_a = properties.headerBorder.left) === null || _a === void 0 ? void 0 : _a.color;
108
- }
109
- if (properties.firstBandBorder) {
110
- return (_b = properties.firstBandBorder.bottom) === null || _b === void 0 ? void 0 : _b.color;
111
- }
112
- if (properties.headerColor) {
113
- return properties.headerColor;
114
- }
115
- };
116
102
  var useBorderStyles = function (_a) {
117
103
  var draggedSelection = _a.draggedSelection, initialDraggedSelection = _a.initialDraggedSelection, users = _a.users, currentUserId = _a.userId, renderCollaboratorCursor = _a.renderCollaboratorCursor, currentSheetId = _a.sheetId, borderStyles = _a.borderStyles, flashingBorders = _a.flashingBorders, copiedSelections = _a.copiedSelections, selectionDragBorderColor = _a.selectionDragBorderColor, _b = _a.selectionBorderColor, selectionBorderColor = _b === void 0 ? config_1.SELECTION_BORDER : _b, tableBorderColor = _a.tableBorderColor, _c = _a.pivotTableBorderColor, pivotTableBorderColor = _c === void 0 ? tableBorderColor : _c, tables = _a.tables, pivotTables = _a.pivotTables, basicFilter = _a.basicFilter, hoveredCell = _a.hoveredCell, activeCell = _a.activeCell, theme = _a.theme, agentSuggestions = _a.agentSuggestions, quickEditValues = _a.quickEditValues;
118
104
  var getAddressFromSelection = (0, atoms_1.useGetAddressFromSelection)();
@@ -210,24 +196,17 @@ var useBorderStyles = function (_a) {
210
196
  var styles = [];
211
197
  // Tables
212
198
  tables === null || tables === void 0 ? void 0 : tables.forEach(function (table) {
213
- var _a, _b, _c, _d, _e;
214
199
  if (table.sheetId === currentSheetId) {
215
200
  var range = table.range, id = table.id;
216
201
  var isWithinBounds = cachedRangeIds.has(id);
217
- var hasBorder = ((_a = table.bandedRange) === null || _a === void 0 ? void 0 : _a.rowProperties) ||
218
- ((_b = table.bandedRange) === null || _b === void 0 ? void 0 : _b.columnProperties);
219
- var tableBorder = hasBorder && ((_c = table.bandedRange) === null || _c === void 0 ? void 0 : _c.rowProperties)
220
- ? (_e = (0, themes_1.getStringifiedColor)(getTableBorder((_d = table.bandedRange) === null || _d === void 0 ? void 0 : _d.rowProperties), theme)) !== null && _e !== void 0 ? _e : tableBorderColor
221
- : tableBorderColor;
222
202
  styles.push({
223
203
  index: id,
224
204
  title: isWithinBounds ? table.title : undefined,
225
205
  type: "table",
226
206
  range: range,
227
- style: {
228
- strokeWidth: tableBorder || !hasBorder ? 1 : 0,
229
- stroke: tableBorder,
230
- },
207
+ // Excel draws no outline round a table: its own borders come from
208
+ // the table style. The entry stays for the name tag and dragging.
209
+ style: { strokeWidth: 0 },
231
210
  table: table,
232
211
  draggable: true,
233
212
  });
@@ -366,10 +345,8 @@ var useBorderStyles = function (_a) {
366
345
  index: id,
367
346
  type: "table",
368
347
  range: range,
369
- style: {
370
- strokeWidth: 1,
371
- stroke: tableBorderColor,
372
- },
348
+ // No outline round an AutoFilter range either (Excel).
349
+ style: { strokeWidth: 0 },
373
350
  title: isWithinBounds ? (_a = basicFilter.title) !== null && _a !== void 0 ? _a : undefined : undefined,
374
351
  draggable: false,
375
352
  });
@@ -62,6 +62,11 @@ export type CellRendererProps<T extends CellData = CellData> = {
62
62
  * stays canonical. Canonical when omitted.
63
63
  */
64
64
  formulaLocale?: FormulaLocale;
65
+ /**
66
+ * Number-format locale (BCP 47) the cells' formatted values were rendered
67
+ * with — the painter re-derives `*` fill / `_` / `?` widths with it.
68
+ */
69
+ locale?: string;
65
70
  /**
66
71
  * Get error value of a cell
67
72
  * @param rowIndex
@@ -131,15 +136,42 @@ export type CellRendererProps<T extends CellData = CellData> = {
131
136
  * @param rowIndex
132
137
  * @param columnIndex
133
138
  */
134
- getMaximumOverflowTextWidth(formattedValue: string | undefined, sheetId: number, rowIndex: number, columnIndex: number, canOverflowToNextCell: (next: CellInterface) => boolean, textFormat: TextFormat | undefined | null, shouldWrap: boolean | undefined, direction: Direction): [
139
+ getMaximumOverflowTextWidth(formattedValue: string | undefined, sheetId: number, rowIndex: number, columnIndex: number, canOverflowToNextCell: (next: CellInterface) => boolean, textFormat: TextFormat | undefined | null, shouldWrap: boolean | undefined, direction: Direction,
140
+ /**
141
+ * Centred text: spill half the excess each way. The third tuple entry
142
+ * is then the width claimed on the left.
143
+ */
144
+ centered?: boolean): [
135
145
  number,
136
146
  [
137
147
  columnIndex: number,
138
148
  columnOffset: number,
139
149
  columnWidth: number,
140
150
  cellBackground?: Color | null
141
- ][]
151
+ ][],
152
+ number?
142
153
  ];
154
+ /**
155
+ * Center Across Selection (`centerContinuous`): the empty neighbours on
156
+ * either side that carry the same alignment, as
157
+ * `[totalWidth, columnSpans, leftWidth]`, or `undefined` when there are
158
+ * none.
159
+ */
160
+ /**
161
+ * The active cell: a data-validation list shows its dropdown button beside
162
+ * it only.
163
+ */
164
+ activeCell?: CellInterface | null;
165
+ getCenterAcrossSelectionSpan?(sheetId: number, rowIndex: number, columnIndex: number): [
166
+ number,
167
+ [
168
+ columnIndex: number,
169
+ columnOffset: number,
170
+ columnWidth: number,
171
+ cellBackground?: Color | null
172
+ ][],
173
+ number
174
+ ] | undefined;
143
175
  /**
144
176
  * Get dimensions of a text
145
177
  * @param sheetId
@@ -248,5 +280,5 @@ export type CellRendererProps<T extends CellData = CellData> = {
248
280
  */
249
281
  getDefaultHorizontalAlignment(sheetId: number, rowIndex: number, columnIndex: number): HorizontalAlign | undefined;
250
282
  };
251
- export declare const useCellRenderer: <T extends CellData = CellData>({ sheetId, scale, showGridLines, showZeros, isRowHeader, isColumnHeader, selectedRows, selectedColumns, selectedRowHeaders, selectedColumnHeaders, cellBackgroundColor, headerBorderColor, headerBackgroundColor, headerColor, headerActiveBackgroundColor, headerSelectedBackgroundColor, headerSelectedColor, headerTableBackgroundColor, headerTableActiveBackgroundColor, headerTableSelectedBackgroundColor, chipBackgroundColor, filterIconColor, showCalculatedColumnIcon, enableTextOverflow, showHeaders, theme, getDefaultHorizontalAlignment, isTableFilterVisible, columnContainsTable, rowsContainsTable, canOverflowToNextCell, getTableHeaderSortOrder, getDataValidation, getErrorValue, formulaLocale, getEffectiveValue, getSparklineGroup, getFormattedValue, getNote, getComment, getEffectiveCellFormat, getCellBounds, getCellImageUrl, getCellMetaType, getRowHeaderText, getColumnHeaderText, getMaximumOverflowTextWidth, getTextDimension, getCellGroupingInfo, getTextFormatRuns, onRequestEdit, onFilterClick, onCheckboxClick, isTableHeader, isTableTotalsCell, onTotalsArrowClick, isCalculatedColumnHeader, isTableHeaderFilterActive, HeaderCell, Cell, StructuredResult, gridLineWidth, showNotes, showComments, defaultFontSizePoint, lineHeightMode, readonly, onExpandCollapse, onOverflow, isComparing, getCellDiff, }: CellRendererProps<T>) => readonly [(props: RendererProps) => React.JSX.Element | null, (props: RendererProps) => React.JSX.Element, (props: RendererProps) => React.JSX.Element | null, (props: RendererProps) => React.JSX.Element | null | undefined, (cells: RendererProps[]) => React.JSX.Element];
283
+ export declare const useCellRenderer: <T extends CellData = CellData>({ sheetId, scale, showGridLines, showZeros, isRowHeader, isColumnHeader, selectedRows, selectedColumns, selectedRowHeaders, selectedColumnHeaders, cellBackgroundColor, headerBorderColor, headerBackgroundColor, headerColor, headerActiveBackgroundColor, headerSelectedBackgroundColor, headerSelectedColor, headerTableBackgroundColor, headerTableActiveBackgroundColor, headerTableSelectedBackgroundColor, chipBackgroundColor, filterIconColor, showCalculatedColumnIcon, enableTextOverflow, showHeaders, theme, getDefaultHorizontalAlignment, isTableFilterVisible, columnContainsTable, rowsContainsTable, canOverflowToNextCell, getTableHeaderSortOrder, getDataValidation, getErrorValue, formulaLocale, locale, getEffectiveValue, getSparklineGroup, getFormattedValue, getNote, getComment, getEffectiveCellFormat, getCellBounds, getCellImageUrl, getCellMetaType, getRowHeaderText, getColumnHeaderText, getMaximumOverflowTextWidth, getCenterAcrossSelectionSpan, activeCell, getTextDimension, getCellGroupingInfo, getTextFormatRuns, onRequestEdit, onFilterClick, onCheckboxClick, isTableHeader, isTableTotalsCell, onTotalsArrowClick, isCalculatedColumnHeader, isTableHeaderFilterActive, HeaderCell, Cell, StructuredResult, gridLineWidth, showNotes, showComments, defaultFontSizePoint, lineHeightMode, readonly, onExpandCollapse, onOverflow, isComparing, getCellDiff, }: CellRendererProps<T>) => readonly [(props: RendererProps) => React.JSX.Element | null, (props: RendererProps) => React.JSX.Element, (props: RendererProps) => React.JSX.Element | null, (props: RendererProps) => React.JSX.Element | null | undefined, (cells: RendererProps[]) => React.JSX.Element];
252
284
  //# sourceMappingURL=use-cell-renderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-cell-renderer.d.ts","sourceRoot":"","sources":["../../../hooks/use-cell-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,4BAA4B,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAK/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAsB,MAAM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AAM,EAChB,WAAW,EAAE,MAAM,GAClB,eAAe,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAAE,g1CA2E5D,iBAAiB,CAAC,CAAC,CAAC,uBAgnBX,aAAa,uCAnmBb,aAAa,gCAkfb,aAAa,uCApFb,aAAa,mDAoRb,aAAa,EAAE,uBA0B1B,CAAC"}
@@ -11,6 +11,7 @@ var validation_1 = require("../api/validation");
11
11
  var alignment_1 = require("../components/cell/alignment");
12
12
  var cell_background_1 = require("../components/cell/cell-background");
13
13
  var cell_backgrounds_1 = require("../components/cell/cell-backgrounds");
14
+ var number_format_layout_1 = require("../components/cell/number-format-layout");
14
15
  var cell_diff_1 = require("../components/cell-diff");
15
16
  var cell_overlay_1 = require("../components/cell-overlay");
16
17
  var config_1 = require("../config");
@@ -20,13 +21,13 @@ var themes_1 = require("../themes");
20
21
  var show_zeros_1 = require("./show-zeros");
21
22
  var use_cell_diff_highlight_1 = require("./use-cell-diff-highlight");
22
23
  var useCellRenderer = function (_a) {
23
- var sheetId = _a.sheetId, scale = _a.scale, showGridLines = _a.showGridLines, showZeros = _a.showZeros, isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, selectedRows = _a.selectedRows, selectedColumns = _a.selectedColumns, selectedRowHeaders = _a.selectedRowHeaders, selectedColumnHeaders = _a.selectedColumnHeaders, cellBackgroundColor = _a.cellBackgroundColor, headerBorderColor = _a.headerBorderColor, headerBackgroundColor = _a.headerBackgroundColor, headerColor = _a.headerColor, headerActiveBackgroundColor = _a.headerActiveBackgroundColor, headerSelectedBackgroundColor = _a.headerSelectedBackgroundColor, headerSelectedColor = _a.headerSelectedColor, headerTableBackgroundColor = _a.headerTableBackgroundColor, headerTableActiveBackgroundColor = _a.headerTableActiveBackgroundColor, headerTableSelectedBackgroundColor = _a.headerTableSelectedBackgroundColor, chipBackgroundColor = _a.chipBackgroundColor, filterIconColor = _a.filterIconColor, showCalculatedColumnIcon = _a.showCalculatedColumnIcon, enableTextOverflow = _a.enableTextOverflow, showHeaders = _a.showHeaders, theme = _a.theme, getDefaultHorizontalAlignment = _a.getDefaultHorizontalAlignment, isTableFilterVisible = _a.isTableFilterVisible, columnContainsTable = _a.columnContainsTable, rowsContainsTable = _a.rowsContainsTable, canOverflowToNextCell = _a.canOverflowToNextCell, getTableHeaderSortOrder = _a.getTableHeaderSortOrder, getDataValidation = _a.getDataValidation, getErrorValue = _a.getErrorValue, formulaLocale = _a.formulaLocale, getEffectiveValue = _a.getEffectiveValue, getSparklineGroup = _a.getSparklineGroup, getFormattedValue = _a.getFormattedValue, getNote = _a.getNote, getComment = _a.getComment, getEffectiveCellFormat = _a.getEffectiveCellFormat, getCellBounds = _a.getCellBounds, getCellImageUrl = _a.getCellImageUrl, getCellMetaType = _a.getCellMetaType, getRowHeaderText = _a.getRowHeaderText, getColumnHeaderText = _a.getColumnHeaderText, getMaximumOverflowTextWidth = _a.getMaximumOverflowTextWidth, getTextDimension = _a.getTextDimension, getCellGroupingInfo = _a.getCellGroupingInfo, getTextFormatRuns = _a.getTextFormatRuns, onRequestEdit = _a.onRequestEdit, onFilterClick = _a.onFilterClick, onCheckboxClick = _a.onCheckboxClick, isTableHeader = _a.isTableHeader, isTableTotalsCell = _a.isTableTotalsCell, onTotalsArrowClick = _a.onTotalsArrowClick, isCalculatedColumnHeader = _a.isCalculatedColumnHeader, isTableHeaderFilterActive = _a.isTableHeaderFilterActive, HeaderCell = _a.HeaderCell, Cell = _a.Cell, StructuredResult = _a.StructuredResult, gridLineWidth = _a.gridLineWidth, showNotes = _a.showNotes, showComments = _a.showComments, defaultFontSizePoint = _a.defaultFontSizePoint, lineHeightMode = _a.lineHeightMode, readonly = _a.readonly, onExpandCollapse = _a.onExpandCollapse, onOverflow = _a.onOverflow, _b = _a.isComparing, isComparing = _b === void 0 ? false : _b, getCellDiff = _a.getCellDiff;
24
+ var sheetId = _a.sheetId, scale = _a.scale, showGridLines = _a.showGridLines, showZeros = _a.showZeros, isRowHeader = _a.isRowHeader, isColumnHeader = _a.isColumnHeader, selectedRows = _a.selectedRows, selectedColumns = _a.selectedColumns, selectedRowHeaders = _a.selectedRowHeaders, selectedColumnHeaders = _a.selectedColumnHeaders, cellBackgroundColor = _a.cellBackgroundColor, headerBorderColor = _a.headerBorderColor, headerBackgroundColor = _a.headerBackgroundColor, headerColor = _a.headerColor, headerActiveBackgroundColor = _a.headerActiveBackgroundColor, headerSelectedBackgroundColor = _a.headerSelectedBackgroundColor, headerSelectedColor = _a.headerSelectedColor, headerTableBackgroundColor = _a.headerTableBackgroundColor, headerTableActiveBackgroundColor = _a.headerTableActiveBackgroundColor, headerTableSelectedBackgroundColor = _a.headerTableSelectedBackgroundColor, chipBackgroundColor = _a.chipBackgroundColor, filterIconColor = _a.filterIconColor, showCalculatedColumnIcon = _a.showCalculatedColumnIcon, enableTextOverflow = _a.enableTextOverflow, showHeaders = _a.showHeaders, theme = _a.theme, getDefaultHorizontalAlignment = _a.getDefaultHorizontalAlignment, isTableFilterVisible = _a.isTableFilterVisible, columnContainsTable = _a.columnContainsTable, rowsContainsTable = _a.rowsContainsTable, canOverflowToNextCell = _a.canOverflowToNextCell, getTableHeaderSortOrder = _a.getTableHeaderSortOrder, getDataValidation = _a.getDataValidation, getErrorValue = _a.getErrorValue, formulaLocale = _a.formulaLocale, locale = _a.locale, getEffectiveValue = _a.getEffectiveValue, getSparklineGroup = _a.getSparklineGroup, getFormattedValue = _a.getFormattedValue, getNote = _a.getNote, getComment = _a.getComment, getEffectiveCellFormat = _a.getEffectiveCellFormat, getCellBounds = _a.getCellBounds, getCellImageUrl = _a.getCellImageUrl, getCellMetaType = _a.getCellMetaType, getRowHeaderText = _a.getRowHeaderText, getColumnHeaderText = _a.getColumnHeaderText, getMaximumOverflowTextWidth = _a.getMaximumOverflowTextWidth, getCenterAcrossSelectionSpan = _a.getCenterAcrossSelectionSpan, activeCell = _a.activeCell, getTextDimension = _a.getTextDimension, getCellGroupingInfo = _a.getCellGroupingInfo, getTextFormatRuns = _a.getTextFormatRuns, onRequestEdit = _a.onRequestEdit, onFilterClick = _a.onFilterClick, onCheckboxClick = _a.onCheckboxClick, isTableHeader = _a.isTableHeader, isTableTotalsCell = _a.isTableTotalsCell, onTotalsArrowClick = _a.onTotalsArrowClick, isCalculatedColumnHeader = _a.isCalculatedColumnHeader, isTableHeaderFilterActive = _a.isTableHeaderFilterActive, HeaderCell = _a.HeaderCell, Cell = _a.Cell, StructuredResult = _a.StructuredResult, gridLineWidth = _a.gridLineWidth, showNotes = _a.showNotes, showComments = _a.showComments, defaultFontSizePoint = _a.defaultFontSizePoint, lineHeightMode = _a.lineHeightMode, readonly = _a.readonly, onExpandCollapse = _a.onExpandCollapse, onOverflow = _a.onOverflow, _b = _a.isComparing, isComparing = _b === void 0 ? false : _b, getCellDiff = _a.getCellDiff;
24
25
  // Version comparison diff highlighting - only active when isComparing is true
25
26
  var _c = (0, use_cell_diff_highlight_1.useCellDiffHighlight)(isComparing ? getCellDiff : undefined), mergeCellFormatWithDiff = _c.mergeCellFormatWithDiff, getDiffHighlight = _c.getDiffHighlight;
26
27
  // Edit
27
28
  var onRequestEditCell = (0, react_1.useCallback)(function (cell) { return onRequestEdit === null || onRequestEdit === void 0 ? void 0 : onRequestEdit(sheetId, cell); }, [sheetId, onRequestEdit]);
28
29
  var cellRenderer = (0, react_1.useCallback)(function (props) {
29
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
30
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
30
31
  var rowIndex = props.rowIndex, columnIndex = props.columnIndex, isMergedCell = props.isMergedCell;
31
32
  // Body cell
32
33
  var rawFormattedValue = getFormattedValue(sheetId, rowIndex, columnIndex);
@@ -34,12 +35,17 @@ var useCellRenderer = function (_a) {
34
35
  var effectiveCellFormat = getEffectiveCellFormat(sheetId, rowIndex, columnIndex);
35
36
  // Checkbox for boolean values (Checkbox icon)
36
37
  var effectiveValue = getEffectiveValue(sheetId, rowIndex, columnIndex);
37
- var formattedValue = (0, show_zeros_1.applyShowZeros)(rawFormattedValue, effectiveValue, showZeros);
38
+ // "Show Bar Only" / "Show Icon Only" conditional formats hide the value.
39
+ var hideConditionalValue = Boolean(((_a = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.conditionalDataBar) === null || _a === void 0 ? void 0 : _a.hideValue) ||
40
+ ((_b = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.conditionalIcon) === null || _b === void 0 ? void 0 : _b.hideValue));
41
+ var formattedValue = hideConditionalValue
42
+ ? ""
43
+ : (0, show_zeros_1.applyShowZeros)(rawFormattedValue, effectiveValue, showZeros);
38
44
  var dataValidation = getDataValidation(sheetId, rowIndex, columnIndex);
39
- var validationType = (_a = dataValidation === null || dataValidation === void 0 ? void 0 : dataValidation.condition) === null || _a === void 0 ? void 0 : _a.type;
45
+ var validationType = (_c = dataValidation === null || dataValidation === void 0 ? void 0 : dataValidation.condition) === null || _c === void 0 ? void 0 : _c.type;
40
46
  var horizontalAlignment = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.horizontalAlignment;
41
47
  // Expandable
42
- var _l = tslib_1.__read(getCellGroupingInfo(sheetId, rowIndex, columnIndex), 2), expandable = _l[0], expanded = _l[1];
48
+ var _q = tslib_1.__read(getCellGroupingInfo(sheetId, rowIndex, columnIndex), 2), expandable = _q[0], expanded = _q[1];
43
49
  // Display style
44
50
  var showChip = getCellMetaType(sheetId, rowIndex, columnIndex) === "people";
45
51
  // Image url
@@ -49,7 +55,13 @@ var useCellRenderer = function (_a) {
49
55
  // Show dropdown arrow: a data-validation list, or a table totals cell
50
56
  // whose arrow opens the totals-function picker.
51
57
  var showTotalsArrow = !showFilter && !!(isTableTotalsCell === null || isTableTotalsCell === void 0 ? void 0 : isTableTotalsCell(rowIndex, columnIndex));
52
- var showArrow = (0, validation_1.showValidationDropdownArrow)(dataValidation) || showTotalsArrow;
58
+ // Excel shows a list's in-cell dropdown button only beside the active
59
+ // cell, outside its right edge — it never takes room from the value.
60
+ var showValidationArrow = !showTotalsArrow &&
61
+ (activeCell === null || activeCell === void 0 ? void 0 : activeCell.rowIndex) === rowIndex &&
62
+ (activeCell === null || activeCell === void 0 ? void 0 : activeCell.columnIndex) === columnIndex &&
63
+ (0, validation_1.showValidationDropdownArrow)(dataValidation);
64
+ var showArrow = showValidationArrow || showTotalsArrow;
53
65
  // Has notes
54
66
  var showNote = showNotes
55
67
  ? !!getNote(sheetId, rowIndex, columnIndex)
@@ -66,7 +78,8 @@ var useCellRenderer = function (_a) {
66
78
  // repeats the text to the cell edge — none of them ever spill into
67
79
  // the neighbouring cells.
68
80
  var wrapStrategy = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.wrapStrategy;
69
- var wrapsByAlignment = (0, alignment_1.alignmentImpliesWrap)(horizontalAlignment);
81
+ var wrapsByAlignment = (0, alignment_1.alignmentImpliesWrap)(horizontalAlignment) ||
82
+ (0, alignment_1.verticalAlignmentImpliesWrap)(effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.verticalAlignment);
70
83
  var fillsCell = (0, alignment_1.isFillAlignment)(horizontalAlignment);
71
84
  var shouldWrap = wrapStrategy === "wrap" || wrapsByAlignment;
72
85
  var isWrapEnabled = (wrapStrategy !== null && wrapStrategy !== void 0 ? wrapStrategy : "overflow") === "overflow" &&
@@ -78,7 +91,7 @@ var useCellRenderer = function (_a) {
78
91
  // Indent
79
92
  var isRightAligned = horizontalAlignment === "right";
80
93
  // Only strings which are right aligned can overflow to neighbours
81
- var isStringValue = !(0, utils_1.isNil)((_b = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.sv) !== null && _b !== void 0 ? _b : effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.stringValue);
94
+ var isStringValue = !(0, utils_1.isNil)((_d = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.sv) !== null && _d !== void 0 ? _d : effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.stringValue);
82
95
  var overflowRight = isRightAligned && isStringValue;
83
96
  // shrinkToFit and rotated text both keep the text inside the cell,
84
97
  // so they must not spill into neighbours regardless of wrapStrategy.
@@ -87,30 +100,44 @@ var useCellRenderer = function (_a) {
87
100
  Number.isFinite(numericRotation) &&
88
101
  numericRotation !== 0;
89
102
  var containsTextInside = !!(effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.shrinkToFit) || hasNumericRotation;
90
- var shouldOverflow = enableTextOverflow &&
103
+ var isCentered = horizontalAlignment === "center";
104
+ var isCenterAcross = horizontalAlignment === "centerContinuous";
105
+ var canSpill = enableTextOverflow &&
91
106
  isWrapEnabled &&
92
- !dataValidation &&
93
107
  !showFilter &&
94
108
  !isCalculatedColumn &&
95
- !showArrow &&
109
+ !showTotalsArrow &&
96
110
  !expandable &&
97
111
  !containsTextInside &&
98
112
  // Following Excel and Google sheets behavior
99
113
  // Text does not overflow merged cells
100
- !isMergedCell &&
101
- (isRightAligned ? isStringValue : true) &&
102
- canOverflowToNextCell({
103
- rowIndex: rowIndex,
104
- columnIndex: columnIndex + (isRightAligned ? -1 : 1),
105
- });
106
- var _m = tslib_1.__read(shouldOverflow
107
- ? getMaximumOverflowTextWidth(displayFormattedValue, sheetId, rowIndex, columnIndex,
108
- // Investigate why isHiddenCell and the instance from Sheet-Grid differs
109
- canOverflowToNextCell, effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat, shouldWrap, isRightAligned ? grid_1.Direction.Left : grid_1.Direction.Right)
110
- : [
111
- props.width,
112
- config_1.DEFAULT_ARRAY,
113
- ], 2), cellWidth = _m[0], columnSpans = _m[1];
114
+ !isMergedCell;
115
+ // Center Across Selection: the text centres over the run of empty
116
+ // neighbours that share the alignment, however short it is.
117
+ var centerAcrossSpan = canSpill && isCenterAcross && !(0, utils_1.isNilOrBlank)(displayFormattedValue)
118
+ ? getCenterAcrossSelectionSpan === null || getCenterAcrossSelectionSpan === void 0 ? void 0 : getCenterAcrossSelectionSpan(sheetId, rowIndex, columnIndex)
119
+ : undefined;
120
+ var shouldOverflow = !!centerAcrossSpan ||
121
+ (canSpill &&
122
+ (isRightAligned ? isStringValue : true) &&
123
+ (isCentered
124
+ ? canOverflowToNextCell({ rowIndex: rowIndex, columnIndex: columnIndex - 1 }) ||
125
+ canOverflowToNextCell({ rowIndex: rowIndex, columnIndex: columnIndex + 1 })
126
+ : canOverflowToNextCell({
127
+ rowIndex: rowIndex,
128
+ columnIndex: columnIndex + (isRightAligned ? -1 : 1),
129
+ })));
130
+ var _r = tslib_1.__read(centerAcrossSpan
131
+ ? centerAcrossSpan
132
+ : shouldOverflow
133
+ ? getMaximumOverflowTextWidth(displayFormattedValue, sheetId, rowIndex, columnIndex,
134
+ // Investigate why isHiddenCell and the instance from Sheet-Grid differs
135
+ canOverflowToNextCell, effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat, shouldWrap, isRightAligned ? grid_1.Direction.Left : grid_1.Direction.Right, isCentered)
136
+ : [
137
+ props.width,
138
+ config_1.DEFAULT_ARRAY,
139
+ undefined,
140
+ ], 3), cellWidth = _r[0], columnSpans = _r[1], overflowLeft = _r[2];
114
141
  if (shouldOverflow && cellWidth > props.width) {
115
142
  // Report the full visual width as the required buffer
116
143
  // This ensures that even if we scroll to the far right of the overflow,
@@ -146,7 +173,7 @@ var useCellRenderer = function (_a) {
146
173
  var errorValue = getErrorValue(sheetId, rowIndex, columnIndex);
147
174
  var isInvalid = (errorValue === null || errorValue === void 0 ? void 0 : errorValue.type) === "Invalid";
148
175
  var showCheckbox = !errorValue && validationType === "BOOLEAN";
149
- var isChecked = ((_c = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.bv) !== null && _c !== void 0 ? _c : effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.boolValue) === true;
176
+ var isChecked = ((_e = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.bv) !== null && _e !== void 0 ? _e : effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.boolValue) === true;
150
177
  // Error from formula calculation (Error icon). Both engines store the canonical spelling
151
178
  // (`#VALUE!`); the grid paints the formula locale's (`#ЗНАЧ!`).
152
179
  var isError = (errorValue === null || errorValue === void 0 ? void 0 : errorValue.type) === "Error";
@@ -162,17 +189,24 @@ var useCellRenderer = function (_a) {
162
189
  diffHighlight &&
163
190
  diffHighlight.diffState !== "unchanged") {
164
191
  // Get text color from format or use default
165
- var textColor = ((_d = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _d === void 0 ? void 0 : _d.color)
192
+ var textColor = ((_f = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _f === void 0 ? void 0 : _f.color)
166
193
  ? (0, themes_1.getStringifiedColor)(effectiveCellFormat.textFormat.color, theme)
167
194
  : undefined;
168
195
  // Measure old value width for proper spacing in modified cells
169
196
  // Use the old format for accurate measurement (bold text is wider than normal)
170
197
  var oldValueWidth = diffHighlight.oldFormattedValue
171
- ? getTextDimension(sheetId, rowIndex, columnIndex, diffHighlight.oldFormattedValue, (_f = (_e = diffHighlight.oldFormat) === null || _e === void 0 ? void 0 : _e.textFormat) !== null && _f !== void 0 ? _f : undefined).width
198
+ ? getTextDimension(sheetId, rowIndex, columnIndex, diffHighlight.oldFormattedValue, (_h = (_g = diffHighlight.oldFormat) === null || _g === void 0 ? void 0 : _g.textFormat) !== null && _h !== void 0 ? _h : undefined).width
172
199
  : undefined;
173
- return (react_1.default.createElement(cell_diff_1.CellDiff, tslib_1.__assign({ diffHighlight: diffHighlight, value: formattedValue, defaultColor: textColor, scale: scale, fontSizePt: defaultFontSizePoint, fontFamily: (_g = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _g === void 0 ? void 0 : _g.fontFamily, bold: (_h = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _h === void 0 ? void 0 : _h.bold, italic: (_j = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _j === void 0 ? void 0 : _j.italic, horizontalAlignment: effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.horizontalAlignment, verticalAlignment: effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.verticalAlignment, oldValueWidth: oldValueWidth }, props)));
200
+ return (react_1.default.createElement(cell_diff_1.CellDiff, tslib_1.__assign({ diffHighlight: diffHighlight, value: formattedValue, defaultColor: textColor, scale: scale, fontSizePt: defaultFontSizePoint, fontFamily: (_j = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _j === void 0 ? void 0 : _j.fontFamily, bold: (_k = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _k === void 0 ? void 0 : _k.bold, italic: (_l = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.textFormat) === null || _l === void 0 ? void 0 : _l.italic, horizontalAlignment: effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.horizontalAlignment, verticalAlignment: (effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.verticalAlignment)
201
+ ? (0, alignment_1.resolveCanvasVerticalAlign)(effectiveCellFormat.verticalAlignment)
202
+ : undefined, oldValueWidth: oldValueWidth }, props)));
174
203
  }
175
- return (react_1.default.createElement(Cell, tslib_1.__assign({ value: displayValue, cellFormat: effectiveCellFormat, scale: scale, defaultBackgroundColor: cellBackgroundColor, onRequestEdit: onRequestEditCell, onArrowClick: showTotalsArrow ? onTotalsArrowClick : undefined, showArrow: showArrow, showFilter: showFilter, isCalculatedColumn: isCalculatedColumn, showCheckbox: showCheckbox, showChip: showChip, chipBackgroundColor: chipBackgroundColor, filterIconColor: filterIconColor, onFilterClick: onFilterClick, onCheckboxClick: onCheckboxClick, isChecked: isChecked, isInvalid: isInvalid, isError: isError, imageUrl: imageUrl, isFilterActive: isFilterActive, enableOverflow: enableOverflow, cellWidth: cellWidth, showNote: showNote, showComment: showComment, showCalculatedColumnIcon: showCalculatedColumnIcon, theme: theme, expandable: expandable, expanded: expanded, textWidth: textWidth, columnSpans: columnSpans, overflowRight: overflowRight, showGridLines: showGridLines, structuredValue: effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.structuredValue, sparklineGroupAxis: ((_k = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.structuredValue) === null || _k === void 0 ? void 0 : _k.kind) === "sparkline" &&
204
+ var numberFormatLayout = isError
205
+ ? undefined
206
+ : (0, number_format_layout_1.getCellNumberFormatLayout)((_m = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.numberFormat) === null || _m === void 0 ? void 0 : _m.pattern, (_o = (0, utils_1.getExtendedValueNumber)(effectiveValue)) !== null && _o !== void 0 ? _o : (0, utils_1.getExtendedValueString)(effectiveValue), displayValue, locale);
207
+ return (react_1.default.createElement(Cell, tslib_1.__assign({ value: displayValue, numberFormatLayout: numberFormatLayout, cellFormat: effectiveCellFormat, scale: scale, defaultBackgroundColor: cellBackgroundColor, onRequestEdit: onRequestEditCell, onArrowClick: showTotalsArrow ? onTotalsArrowClick : undefined, showArrow: showArrow, arrowOutside: showValidationArrow, showFilter: showFilter, isCalculatedColumn: isCalculatedColumn, showCheckbox: showCheckbox, showChip: showChip, chipBackgroundColor: chipBackgroundColor, filterIconColor: filterIconColor, onFilterClick: onFilterClick, onCheckboxClick: onCheckboxClick, isChecked: isChecked, isInvalid: isInvalid, isError: isError, imageUrl: imageUrl, isFilterActive: isFilterActive, enableOverflow: enableOverflow, cellWidth: cellWidth, showNote: showNote, showComment: showComment, showCalculatedColumnIcon: showCalculatedColumnIcon, theme: theme, expandable: expandable, expanded: expanded, textWidth: textWidth, columnSpans: columnSpans, overflowRight: overflowRight, overflowLeft: enableOverflow && (isCentered || centerAcrossSpan)
208
+ ? overflowLeft !== null && overflowLeft !== void 0 ? overflowLeft : 0
209
+ : undefined, centerOnSpan: !!centerAcrossSpan, showGridLines: showGridLines, structuredValue: effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.structuredValue, sparklineGroupAxis: ((_p = effectiveValue === null || effectiveValue === void 0 ? void 0 : effectiveValue.structuredValue) === null || _p === void 0 ? void 0 : _p.kind) === "sparkline" &&
176
210
  getSparklineGroup
177
211
  ? (0, sparkline_math_1.sparklineGroupAxisFor)(effectiveValue.structuredValue, function () { return getSparklineGroup(sheetId, { rowIndex: rowIndex, columnIndex: columnIndex }); }, function (cell) {
178
212
  var _a;
@@ -190,6 +224,7 @@ var useCellRenderer = function (_a) {
190
224
  sheetId,
191
225
  scale,
192
226
  showGridLines,
227
+ showZeros,
193
228
  theme,
194
229
  showNotes,
195
230
  showComments,
@@ -209,6 +244,7 @@ var useCellRenderer = function (_a) {
209
244
  getDataValidation,
210
245
  getErrorValue,
211
246
  formulaLocale,
247
+ locale,
212
248
  getEffectiveValue,
213
249
  getSparklineGroup,
214
250
  getFormattedValue,
@@ -218,6 +254,8 @@ var useCellRenderer = function (_a) {
218
254
  getNote,
219
255
  getComment,
220
256
  getMaximumOverflowTextWidth,
257
+ getCenterAcrossSelectionSpan,
258
+ activeCell,
221
259
  getCellGroupingInfo,
222
260
  onCheckboxClick,
223
261
  onFilterClick,
@@ -313,28 +351,28 @@ var useCellRenderer = function (_a) {
313
351
  var strokeDiagonalUpStyle = (_m = borders === null || borders === void 0 ? void 0 : borders.diagonalUp) === null || _m === void 0 ? void 0 : _m.style;
314
352
  var strokeDiagonalDownStyle = (_o = borders === null || borders === void 0 ? void 0 : borders.diagonalDown) === null || _o === void 0 ? void 0 : _o.style;
315
353
  /* Border width */
316
- var strokeTopWidth = (strokeTopStyle === "double" ? 3 : (_q = (_p = borders === null || borders === void 0 ? void 0 : borders.top) === null || _p === void 0 ? void 0 : _p.width) !== null && _q !== void 0 ? _q : 0) * scale;
317
- var strokeBottomWidth = (strokeBottomStyle === "double" ? 3 : (_s = (_r = borders === null || borders === void 0 ? void 0 : borders.bottom) === null || _r === void 0 ? void 0 : _r.width) !== null && _s !== void 0 ? _s : 0) *
354
+ var strokeTopWidth = (strokeTopStyle === "double" ? 3 : (0, helpers_1.getBorderStyleWidth)((_p = borders === null || borders === void 0 ? void 0 : borders.top) === null || _p === void 0 ? void 0 : _p.style, (_q = borders === null || borders === void 0 ? void 0 : borders.top) === null || _q === void 0 ? void 0 : _q.width)) * scale;
355
+ var strokeBottomWidth = (strokeBottomStyle === "double" ? 3 : (0, helpers_1.getBorderStyleWidth)((_r = borders === null || borders === void 0 ? void 0 : borders.bottom) === null || _r === void 0 ? void 0 : _r.style, (_s = borders === null || borders === void 0 ? void 0 : borders.bottom) === null || _s === void 0 ? void 0 : _s.width)) *
318
356
  scale;
319
- var strokeLeftWidth = (strokeLeftStyle === "double" ? 3 : (_u = (_t = borders === null || borders === void 0 ? void 0 : borders.left) === null || _t === void 0 ? void 0 : _t.width) !== null && _u !== void 0 ? _u : 0) * scale;
320
- var strokeRightWidth = (strokeRightStyle === "double" ? 3 : (_w = (_v = borders === null || borders === void 0 ? void 0 : borders.right) === null || _v === void 0 ? void 0 : _v.width) !== null && _w !== void 0 ? _w : 0) *
357
+ var strokeLeftWidth = (strokeLeftStyle === "double" ? 3 : (0, helpers_1.getBorderStyleWidth)((_t = borders === null || borders === void 0 ? void 0 : borders.left) === null || _t === void 0 ? void 0 : _t.style, (_u = borders === null || borders === void 0 ? void 0 : borders.left) === null || _u === void 0 ? void 0 : _u.width)) * scale;
358
+ var strokeRightWidth = (strokeRightStyle === "double" ? 3 : (0, helpers_1.getBorderStyleWidth)((_v = borders === null || borders === void 0 ? void 0 : borders.right) === null || _v === void 0 ? void 0 : _v.style, (_w = borders === null || borders === void 0 ? void 0 : borders.right) === null || _w === void 0 ? void 0 : _w.width)) *
321
359
  scale;
322
360
  var strokeDiagonalUpWidth = (strokeDiagonalUpStyle === "double"
323
361
  ? 3
324
- : (_y = (_x = borders === null || borders === void 0 ? void 0 : borders.diagonalUp) === null || _x === void 0 ? void 0 : _x.width) !== null && _y !== void 0 ? _y : 0) * scale;
362
+ : (0, helpers_1.getBorderStyleWidth)((_x = borders === null || borders === void 0 ? void 0 : borders.diagonalUp) === null || _x === void 0 ? void 0 : _x.style, (_y = borders === null || borders === void 0 ? void 0 : borders.diagonalUp) === null || _y === void 0 ? void 0 : _y.width)) * scale;
325
363
  var strokeDiagonalDownWidth = (strokeDiagonalDownStyle === "double"
326
364
  ? 3
327
- : (_0 = (_z = borders === null || borders === void 0 ? void 0 : borders.diagonalDown) === null || _z === void 0 ? void 0 : _z.width) !== null && _0 !== void 0 ? _0 : 0) * scale;
365
+ : (0, helpers_1.getBorderStyleWidth)((_z = borders === null || borders === void 0 ? void 0 : borders.diagonalDown) === null || _z === void 0 ? void 0 : _z.style, (_0 = borders === null || borders === void 0 ? void 0 : borders.diagonalDown) === null || _0 === void 0 ? void 0 : _0.width)) * scale;
328
366
  // Double inset
329
367
  var strokeDoubleInsetWidth = 1 * scale;
330
368
  /* Border style */
331
- var strokeTopDash = (0, helpers_1.convertBorderStyleToDashArray)((_1 = borders === null || borders === void 0 ? void 0 : borders.top) === null || _1 === void 0 ? void 0 : _1.style);
332
- var strokeBottomDash = (0, helpers_1.convertBorderStyleToDashArray)((_2 = borders === null || borders === void 0 ? void 0 : borders.bottom) === null || _2 === void 0 ? void 0 : _2.style);
333
- var strokeLeftDash = (0, helpers_1.convertBorderStyleToDashArray)((_3 = borders === null || borders === void 0 ? void 0 : borders.left) === null || _3 === void 0 ? void 0 : _3.style);
334
- var strokeRightDash = (0, helpers_1.convertBorderStyleToDashArray)((_4 = borders === null || borders === void 0 ? void 0 : borders.right) === null || _4 === void 0 ? void 0 : _4.style);
335
- var strokeDiagonalUpDash = (0, helpers_1.convertBorderStyleToDashArray)((_5 = borders === null || borders === void 0 ? void 0 : borders.diagonalUp) === null || _5 === void 0 ? void 0 : _5.style);
336
- var strokeDiagonalDownDash = (0, helpers_1.convertBorderStyleToDashArray)((_6 = borders === null || borders === void 0 ? void 0 : borders.diagonalDown) === null || _6 === void 0 ? void 0 : _6.style);
337
- return (0, cell_overlay_1.CellOverlayRenderer)(tslib_1.__assign(tslib_1.__assign({}, props), { strokeDoubleInsetWidth: strokeDoubleInsetWidth, strokeTopColor: strokeTopColor, strokeBottomColor: strokeBottomColor, strokeLeftColor: strokeLeftColor, strokeRightColor: strokeRightColor, strokeDiagonalUpColor: strokeDiagonalUpColor, strokeDiagonalDownColor: strokeDiagonalDownColor, strokeTopWidth: strokeTopWidth, strokeBottomWidth: strokeBottomWidth, strokeLeftWidth: strokeLeftWidth, strokeRightWidth: strokeRightWidth, strokeDiagonalUpWidth: strokeDiagonalUpWidth, strokeDiagonalDownWidth: strokeDiagonalDownWidth, strokeTopDash: strokeTopDash, strokeBottomDash: strokeBottomDash, strokeLeftDash: strokeLeftDash, strokeRightDash: strokeRightDash, strokeDiagonalUpDash: strokeDiagonalUpDash, strokeDiagonalDownDash: strokeDiagonalDownDash, strokeTopStyle: strokeTopStyle, strokeBottomStyle: strokeBottomStyle, strokeLeftStyle: strokeLeftStyle, strokeRightStyle: strokeRightStyle, cellBackgroundColor: finalCellBackgroundColor }));
369
+ var strokeTopDash = (0, helpers_1.convertBorderStyleToDashArray)((_1 = borders === null || borders === void 0 ? void 0 : borders.top) === null || _1 === void 0 ? void 0 : _1.style, scale);
370
+ var strokeBottomDash = (0, helpers_1.convertBorderStyleToDashArray)((_2 = borders === null || borders === void 0 ? void 0 : borders.bottom) === null || _2 === void 0 ? void 0 : _2.style, scale);
371
+ var strokeLeftDash = (0, helpers_1.convertBorderStyleToDashArray)((_3 = borders === null || borders === void 0 ? void 0 : borders.left) === null || _3 === void 0 ? void 0 : _3.style, scale);
372
+ var strokeRightDash = (0, helpers_1.convertBorderStyleToDashArray)((_4 = borders === null || borders === void 0 ? void 0 : borders.right) === null || _4 === void 0 ? void 0 : _4.style, scale);
373
+ var strokeDiagonalUpDash = (0, helpers_1.convertBorderStyleToDashArray)((_5 = borders === null || borders === void 0 ? void 0 : borders.diagonalUp) === null || _5 === void 0 ? void 0 : _5.style, scale);
374
+ var strokeDiagonalDownDash = (0, helpers_1.convertBorderStyleToDashArray)((_6 = borders === null || borders === void 0 ? void 0 : borders.diagonalDown) === null || _6 === void 0 ? void 0 : _6.style, scale);
375
+ return (0, cell_overlay_1.CellOverlayRenderer)(tslib_1.__assign(tslib_1.__assign({}, props), { strokeDoubleInsetWidth: strokeDoubleInsetWidth, strokeTopColor: strokeTopColor, strokeBottomColor: strokeBottomColor, strokeLeftColor: strokeLeftColor, strokeRightColor: strokeRightColor, strokeDiagonalUpColor: strokeDiagonalUpColor, strokeDiagonalDownColor: strokeDiagonalDownColor, strokeTopWidth: strokeTopWidth, strokeBottomWidth: strokeBottomWidth, strokeLeftWidth: strokeLeftWidth, strokeRightWidth: strokeRightWidth, strokeDiagonalUpWidth: strokeDiagonalUpWidth, strokeDiagonalDownWidth: strokeDiagonalDownWidth, strokeTopDash: strokeTopDash, strokeBottomDash: strokeBottomDash, strokeLeftDash: strokeLeftDash, strokeRightDash: strokeRightDash, strokeDiagonalUpDash: strokeDiagonalUpDash, strokeDiagonalDownDash: strokeDiagonalDownDash, strokeTopStyle: strokeTopStyle, strokeBottomStyle: strokeBottomStyle, strokeLeftStyle: strokeLeftStyle, strokeRightStyle: strokeRightStyle, strokeDiagonalUpStyle: strokeDiagonalUpStyle, strokeDiagonalDownStyle: strokeDiagonalDownStyle, cellBackgroundColor: finalCellBackgroundColor }));
338
376
  }, [
339
377
  getEffectiveCellFormat,
340
378
  getCellBounds,
@@ -357,11 +395,11 @@ var useCellRenderer = function (_a) {
357
395
  */
358
396
  var fillPattern = (_a = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.fillPattern) !== null && _a !== void 0 ? _a : null;
359
397
  var gradient = (_b = effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.gradient) !== null && _b !== void 0 ? _b : null;
360
- var hasPaintedPattern = fillPattern && fillPattern !== "none" && fillPattern !== "solid"
398
+ // A pattern with no colour of its own paints in Excel's Automatic
399
+ // (black); a solid pattern needs its foreground.
400
+ var hasPaintedPattern = fillPattern === "solid"
361
401
  ? !!(effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.foregroundColor)
362
- : fillPattern === "solid"
363
- ? !!(effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.foregroundColor)
364
- : false;
402
+ : !!fillPattern && fillPattern !== "none";
365
403
  var hasGradient = !!gradient && ((_d = (_c = gradient.stops) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0;
366
404
  var showFillRectange = !(0, utils_1.isNil)(effectiveCellFormat === null || effectiveCellFormat === void 0 ? void 0 : effectiveCellFormat.backgroundColor) ||
367
405
  isMergedCell ||
@@ -1,4 +1,5 @@
1
1
  import { type GridRange } from "@rowsncolumns/grid";
2
+ import { type CfRangeStats } from "../api/cf-overlays";
2
3
  import type { CanvasGridProps, SpreadsheetTheme } from "../components/canvas-grid/typings";
3
4
  import type { CellData, CellFormat, ConditionalFormatRule, CustomFormulaResult } from "../types";
4
5
  /**
@@ -38,6 +39,17 @@ export type UseConditionalFormattingProps<T extends CellData> = {
38
39
  * JS computation. Omit for engine-free documents.
39
40
  */
40
41
  getConditionalFormatResult?: (sheetId: number, rowIndex: number, columnIndex: number, ruleId: ConditionalFormatRule["id"]) => unknown;
42
+ /**
43
+ * Whole-range statistics of a rule's numeric covered cells, for hosts whose
44
+ * cell data is windowed (an engine that only streams the visible slice).
45
+ * Used for rules cut to the evaluation window, so data bars, colour
46
+ * scales, icon sets, top/bottom-N and averages resolve over the rule's
47
+ * full range. Return `sorted` for percentile / rank thresholds. Hosts
48
+ * should cache per rule and invalidate on edit; without this prop the
49
+ * hook computes the statistics itself from `getValidationValue` and
50
+ * caches them per rule until the data changes.
51
+ */
52
+ getConditionalFormatRuleStats?: (sheetId: number, rule: ConditionalFormatRule) => CfRangeStats | null | undefined;
41
53
  };
42
- export declare const useConditionalFormatting: <T extends CellData>({ sheetId, theme, conditionalFormats, locale, getValidationValue, isNumberValue, getSheetRowCount, getSheetColumnCount, window: evaluationWindow, getConditionalFormatResult, }: UseConditionalFormattingProps<T>) => Map<string, CellFormat | undefined>;
54
+ export declare const useConditionalFormatting: <T extends CellData>({ sheetId, theme, conditionalFormats, locale, getValidationValue, isNumberValue, getSheetRowCount, getSheetColumnCount, window: evaluationWindow, getConditionalFormatResult, getConditionalFormatRuleStats, }: UseConditionalFormattingProps<T>) => Map<string, CellFormat | undefined>;
43
55
  //# sourceMappingURL=use-conditional-formatting.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-conditional-formatting.d.ts","sourceRoot":"","sources":["../../../hooks/use-conditional-formatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAoBpE,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAGlB;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,UAAU,EAClB,OAAO,UAAU,KAChB,UAYF,CAAC;AAaF,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,QAAQ,IAAI;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,gBAAgB,CAAC;IACxB,kBAAkB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,CAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,qBAAqB,KACzB,mBAAmB,CAAC;IACzB,aAAa,CACX,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IACX,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC;IACtD,mBAAmB,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAC5D;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B;;;;;;;;;OASG;IACH,0BAA0B,CAAC,EAAE,CAC3B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,qBAAqB,CAAC,IAAI,CAAC,KAChC,OAAO,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,QAAQ,EAAE,iLAW1D,6BAA6B,CAAC,CAAC,CAAC,wCA0pBlC,CAAC"}
1
+ {"version":3,"file":"use-conditional-formatting.d.ts","sourceRoot":"","sources":["../../../hooks/use-conditional-formatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAWpE,OAAO,EAIL,KAAK,YAAY,EAKlB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,UAAU,EAClB,OA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