@extend-ai/react-xlsx 0.13.3 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -231,6 +231,26 @@ These hooks work inside `XlsxViewer` or `XlsxViewerProvider` context.
231
231
  - `useXlsxViewerCharts()` for chart, chart element, formula, and chartsheet state
232
232
  - `useXlsxViewerThumbnails(options)` for painting worksheet thumbnails into your own canvases
233
233
 
234
+ ## Form Control Editing
235
+
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
+
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.
239
+
240
+ ```tsx
241
+ <XlsxViewer
242
+ file={file}
243
+ onFormControlAction={({ control }) => {
244
+ console.log("Activated", control.name);
245
+ }}
246
+ onFormControlChange={({ control, previousControl }) => {
247
+ console.log(previousControl.state, "->", control.state);
248
+ }}
249
+ />
250
+ ```
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.
253
+
234
254
  ## Chart Selection And Formulas
235
255
 
236
256
  Chart interactions follow Excel's selection progression: clicking a chart selects the chart frame, clicking a plotted item or legend entry again selects the series, and clicking an item in an already-selected series selects that point. `selectedChartElement` exposes the current chart, series, legend entry, or point selection through the controller and `useXlsxViewerCharts()`.
Binary file