@extend-ai/react-xlsx 0.14.1 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -235,7 +235,7 @@ These hooks work inside `XlsxViewer` or `XlsxViewerProvider` context.
235
235
 
236
236
  When `readOnly={false}`, Duke-backed checkboxes, option buttons, dropdowns, list boxes, scrollbars, and spinners are interactive. Changes update linked cells immediately, participate in undo/redo, and are written by `exportXlsx()` / `download()`.
237
237
 
238
- Buttons do not execute Excel macros. Provide `onFormControlAction` to handle a button activation in your application. Labels and group boxes are display-only, and legacy edit boxes remain render-only because Duke Sheets does not expose them as editable form controls.
238
+ Buttons do not execute Excel macros. Provide `onFormControlAction` to handle a button activation in your application. Labels and group boxes are display-only.
239
239
 
240
240
  ```tsx
241
241
  <XlsxViewer
@@ -249,7 +249,32 @@ Buttons do not execute Excel macros. Provide `onFormControlAction` to handle a b
249
249
  />
250
250
  ```
251
251
 
252
- The controller also exposes `addFormControl(input, sheetIndex?)`, `updateFormControl(controlIndex, patch, sheetIndex?)`, `removeFormControl(controlIndex, sheetIndex?)`, and `getFormControlItems(controlIndex, sheetIndex?)`. Inputs use Duke's flat two-cell anchor and kind-specific form-control shape, exported as `XlsxFormControlInput` and related types.
252
+ The controller also exposes `addFormControl(input, sheetIndex?)`, `updateFormControl(controlIndex, patch, sheetIndex?)`, `removeFormControl(controlIndex, sheetIndex?)`, and `getFormControlItems(controlIndex, sheetIndex?)`. `XlsxFormControlInput` uses the same `XlsxImageAnchor` union as images and charts, with an optional `editAs` value for two-cell anchors. Captions accept either a string or rich text runs:
253
+
254
+ ```ts
255
+ const controlIndex = controller.addFormControl({
256
+ anchor: {
257
+ kind: "two-cell",
258
+ from: { col: 1, row: 1, colOffsetEmu: 0, rowOffsetEmu: 0 },
259
+ to: { col: 3, row: 2, colOffsetEmu: 0, rowOffsetEmu: 0 }
260
+ },
261
+ editAs: "twoCell",
262
+ kind: {
263
+ kind: "checkbox",
264
+ caption: {
265
+ runs: [{ text: "Include forecast", font: { bold: true, name: "Aptos", size: 10 } }]
266
+ },
267
+ state: "checked"
268
+ }
269
+ });
270
+ ```
271
+
272
+ ### Migrating To 0.15
273
+
274
+ - `XlsxFormControlAnchor` was removed. Pass an `XlsxImageAnchor` to `XlsxFormControlInput.anchor` instead.
275
+ - Read controls now expose `caption` as `XlsxFormControlCaption`; use `label` when you only need flattened display text.
276
+ - Mutation captions accept either a plain string or `XlsxFormControlCaption` rich text runs.
277
+ - `firstInGroup` is read-only. Duke recomputes option-button grouping when controls are written.
253
278
 
254
279
  ## Chart Selection And Formulas
255
280
 
@@ -633,7 +658,7 @@ The package exports the main types you are likely to use for custom integrations
633
658
  - `XlsxChart`, `XlsxChartSeries`, `XlsxChartAxis`, `XlsxChartElementSelection`, `XlsxChartsheet`
634
659
  - `XlsxFormulaTarget`
635
660
  - `XlsxImage`, `XlsxImageRect`, `XlsxImageRenderProps`, `XlsxImageSelectionRenderProps`
636
- - `XlsxFormControl`, `XlsxFormControlRenderProps`
661
+ - `XlsxFormControl`, `XlsxFormControlInput`, `XlsxFormControlCaption`, `XlsxFormControlCaptionInput`, `XlsxFormControlCaptionRun`, `XlsxFormControlRenderProps`
637
662
  - `XlsxTable`, `XlsxTableColumn`, `XlsxTableHeaderMenuRenderProps`
638
663
  - `XlsxWorkbookTab`, `XlsxCellAddress`, `XlsxCellRange`
639
664
 
Binary file