@extend-ai/react-xlsx 0.14.0 → 0.15.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 +54 -2
- package/dist/duke_sheets_wasm_bg.wasm +0 -0
- package/dist/index.cjs +1125 -1181
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +107 -37
- package/dist/index.d.ts +107 -37
- package/dist/index.js +1125 -1181
- package/dist/index.js.map +1 -1
- package/dist/xlsx-worker.js +290 -78
- package/dist/xlsx-worker.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -441,56 +441,58 @@ interface XlsxShape {
|
|
|
441
441
|
type XlsxFormControlKind = "button" | "checkbox" | "dropdown" | "editbox" | "group-box" | "label" | "listbox" | "radio" | "scrollbar" | "spinner" | "unknown";
|
|
442
442
|
type XlsxFormControlState = "unchecked" | "checked" | "mixed";
|
|
443
443
|
type XlsxFormControlSelectionMode = "single" | "multi" | "extend";
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
toRowOffset: number;
|
|
455
|
-
}
|
|
456
|
-
/** Kind-specific input accepted by Duke Sheets for form-control mutations. */
|
|
444
|
+
interface XlsxFormControlCaptionRun {
|
|
445
|
+
font?: XlsxCellFontStyleInput;
|
|
446
|
+
text: string;
|
|
447
|
+
}
|
|
448
|
+
interface XlsxFormControlCaption {
|
|
449
|
+
horizontalAlignment?: "general" | "left" | "center" | "right" | "fill" | "justify" | "centerContinuous" | "distributed";
|
|
450
|
+
runs: XlsxFormControlCaptionRun[];
|
|
451
|
+
verticalAlignment?: "top" | "center" | "bottom" | "justify" | "distributed";
|
|
452
|
+
}
|
|
453
|
+
type XlsxFormControlCaptionInput = string | XlsxFormControlCaption;
|
|
457
454
|
type XlsxFormControlKindInput = {
|
|
458
455
|
kind: "button";
|
|
459
|
-
caption:
|
|
456
|
+
caption: XlsxFormControlCaptionInput;
|
|
460
457
|
} | {
|
|
461
458
|
kind: "checkbox";
|
|
462
|
-
caption:
|
|
459
|
+
caption: XlsxFormControlCaptionInput;
|
|
463
460
|
state: XlsxFormControlState;
|
|
464
461
|
cellLink?: string;
|
|
465
|
-
no3D
|
|
462
|
+
no3D?: boolean;
|
|
466
463
|
} | {
|
|
467
464
|
kind: "optionButton";
|
|
468
|
-
caption:
|
|
465
|
+
caption: XlsxFormControlCaptionInput;
|
|
469
466
|
state: Exclude<XlsxFormControlState, "mixed">;
|
|
470
467
|
cellLink?: string;
|
|
471
|
-
|
|
472
|
-
no3D: boolean;
|
|
468
|
+
no3D?: boolean;
|
|
473
469
|
} | {
|
|
474
470
|
kind: "label";
|
|
475
|
-
caption:
|
|
471
|
+
caption: XlsxFormControlCaptionInput;
|
|
476
472
|
} | {
|
|
477
473
|
kind: "groupBox";
|
|
478
|
-
caption:
|
|
479
|
-
no3D
|
|
474
|
+
caption: XlsxFormControlCaptionInput;
|
|
475
|
+
no3D?: boolean;
|
|
480
476
|
} | {
|
|
481
477
|
kind: "listBox";
|
|
482
478
|
inputRange?: string;
|
|
483
479
|
cellLink?: string;
|
|
484
480
|
selection: XlsxFormControlSelectionMode;
|
|
485
|
-
selected
|
|
486
|
-
no3D
|
|
481
|
+
selected?: number[];
|
|
482
|
+
no3D?: boolean;
|
|
487
483
|
} | {
|
|
488
484
|
kind: "dropdown";
|
|
489
485
|
inputRange?: string;
|
|
490
486
|
cellLink?: string;
|
|
491
487
|
selected?: number;
|
|
492
488
|
lines: number;
|
|
493
|
-
no3D
|
|
489
|
+
no3D?: boolean;
|
|
490
|
+
} | {
|
|
491
|
+
kind: "editbox";
|
|
492
|
+
caption: XlsxFormControlCaptionInput;
|
|
493
|
+
legacyObjectType?: number;
|
|
494
|
+
rawObj?: Uint8Array | number[];
|
|
495
|
+
rawProperties?: Array<[string, string]>;
|
|
494
496
|
} | {
|
|
495
497
|
kind: "scrollbar";
|
|
496
498
|
value: number;
|
|
@@ -498,7 +500,7 @@ type XlsxFormControlKindInput = {
|
|
|
498
500
|
max: number;
|
|
499
501
|
increment: number;
|
|
500
502
|
page: number;
|
|
501
|
-
horizontal
|
|
503
|
+
horizontal?: boolean;
|
|
502
504
|
cellLink?: string;
|
|
503
505
|
} | {
|
|
504
506
|
kind: "spinner";
|
|
@@ -507,30 +509,51 @@ type XlsxFormControlKindInput = {
|
|
|
507
509
|
max: number;
|
|
508
510
|
increment: number;
|
|
509
511
|
cellLink?: string;
|
|
512
|
+
} | {
|
|
513
|
+
kind: "unknown";
|
|
514
|
+
objectType: string;
|
|
515
|
+
legacyObjectType?: number;
|
|
516
|
+
caption?: XlsxFormControlCaptionInput;
|
|
517
|
+
rawObj?: Uint8Array | number[];
|
|
518
|
+
rawProperties?: Array<[string, string]>;
|
|
510
519
|
};
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
520
|
+
interface XlsxFormControlMetadataInput {
|
|
521
|
+
altText?: string;
|
|
522
|
+
hidden?: boolean;
|
|
514
523
|
kind: XlsxFormControlKindInput;
|
|
515
524
|
locked?: boolean;
|
|
525
|
+
macroName?: string;
|
|
516
526
|
name?: string;
|
|
517
527
|
printable?: boolean;
|
|
528
|
+
rawClientData?: Array<Uint8Array | number[]>;
|
|
529
|
+
title?: string;
|
|
518
530
|
}
|
|
519
|
-
|
|
520
|
-
|
|
531
|
+
type XlsxFormControlInput = XlsxFormControlMetadataInput & ({
|
|
532
|
+
anchor: Extract<XlsxImageAnchor, {
|
|
533
|
+
kind: "two-cell";
|
|
534
|
+
}>;
|
|
535
|
+
editAs?: "twoCell" | "oneCell" | "absolute";
|
|
536
|
+
} | {
|
|
537
|
+
anchor: Exclude<XlsxImageAnchor, {
|
|
538
|
+
kind: "two-cell";
|
|
539
|
+
}>;
|
|
540
|
+
editAs?: never;
|
|
541
|
+
});
|
|
542
|
+
type XlsxFormControlPatch = Partial<Omit<XlsxFormControlMetadataInput, "kind">> & {
|
|
543
|
+
anchor?: XlsxImageAnchor;
|
|
544
|
+
editAs?: "twoCell" | "oneCell" | "absolute";
|
|
521
545
|
kind?: XlsxFormControlKindInput;
|
|
522
546
|
};
|
|
523
547
|
interface XlsxFormControl {
|
|
524
548
|
anchor: XlsxImageAnchor;
|
|
525
|
-
|
|
526
|
-
caption
|
|
549
|
+
altText?: string;
|
|
550
|
+
/** Original rich caption reported by Duke Sheets. */
|
|
551
|
+
caption?: XlsxFormControlCaption;
|
|
527
552
|
checked?: boolean;
|
|
528
553
|
/** Duke Sheets' stable zero-based index for this worksheet load. */
|
|
529
554
|
controlIndex?: number;
|
|
530
|
-
/** Original
|
|
555
|
+
/** Original two-cell anchor behavior. */
|
|
531
556
|
editAs?: "twoCell" | "oneCell" | "absolute";
|
|
532
|
-
/** Exact Duke Sheets anchor. Use this when cloning or updating the control through the controller. */
|
|
533
|
-
dukeAnchor?: XlsxFormControlAnchor;
|
|
534
557
|
firstInGroup?: boolean;
|
|
535
558
|
fontFamily?: string;
|
|
536
559
|
fontSizePt?: number;
|
|
@@ -539,17 +562,25 @@ interface XlsxFormControl {
|
|
|
539
562
|
id: string;
|
|
540
563
|
increment?: number;
|
|
541
564
|
inputRange?: string;
|
|
565
|
+
/** Current formatted labels resolved from a dropdown or list box input range. */
|
|
566
|
+
items?: string[];
|
|
542
567
|
kind: XlsxFormControlKind;
|
|
543
568
|
label?: string;
|
|
544
569
|
lines?: number;
|
|
545
570
|
linkedCell?: string;
|
|
546
571
|
locked?: boolean;
|
|
572
|
+
macroName?: string;
|
|
547
573
|
max?: number;
|
|
548
574
|
min?: number;
|
|
549
575
|
name?: string;
|
|
550
576
|
no3D?: boolean;
|
|
551
577
|
page?: number;
|
|
552
578
|
printable?: boolean;
|
|
579
|
+
objectType?: string;
|
|
580
|
+
legacyObjectType?: number;
|
|
581
|
+
rawClientData?: number[][];
|
|
582
|
+
rawObj?: number[];
|
|
583
|
+
rawProperties?: Array<[string, string]>;
|
|
553
584
|
/** Zero-based selected item index or indexes, matching Duke Sheets. */
|
|
554
585
|
selected?: number | number[];
|
|
555
586
|
selection?: XlsxFormControlSelectionMode;
|
|
@@ -557,6 +588,7 @@ interface XlsxFormControl {
|
|
|
557
588
|
state?: XlsxFormControlState;
|
|
558
589
|
textAlign?: "center" | "left" | "right";
|
|
559
590
|
textColor?: string;
|
|
591
|
+
title?: string;
|
|
560
592
|
value?: number;
|
|
561
593
|
workbookSheetIndex: number;
|
|
562
594
|
zIndex: number;
|
|
@@ -570,6 +602,38 @@ interface XlsxFormControlChangeEvent {
|
|
|
570
602
|
previousControl: XlsxFormControl;
|
|
571
603
|
type: "change";
|
|
572
604
|
}
|
|
605
|
+
interface XlsxFormControlRenderProps {
|
|
606
|
+
/** Activates a button control. No-ops in read-only mode. */
|
|
607
|
+
activate: () => void;
|
|
608
|
+
/** Current checked state for checkbox and radio controls. */
|
|
609
|
+
checked: boolean;
|
|
610
|
+
/** Full parsed control metadata. Switch on `control.kind` to render a kind-specific component. */
|
|
611
|
+
control: XlsxFormControl;
|
|
612
|
+
/** True when this control cannot be changed through the viewer. */
|
|
613
|
+
disabled: boolean;
|
|
614
|
+
/** Current formatted dropdown or list box items resolved from the control input range. */
|
|
615
|
+
items: string[];
|
|
616
|
+
/** Display label after placeholder Excel names have been removed. */
|
|
617
|
+
label: string;
|
|
618
|
+
/** True when a checkbox is in Excel's indeterminate state. */
|
|
619
|
+
mixed: boolean;
|
|
620
|
+
/** True when the viewer is rendering without workbook mutation support. */
|
|
621
|
+
readOnly: boolean;
|
|
622
|
+
/** Calculated worksheet-relative control rectangle in CSS pixels. */
|
|
623
|
+
rect: XlsxImageRect;
|
|
624
|
+
/** Persists a dropdown or list box selection. No-ops for other control kinds or in read-only mode. */
|
|
625
|
+
setSelected: (selected: number | number[] | undefined) => boolean;
|
|
626
|
+
/** Persists a checkbox or radio state. No-ops for other control kinds or in read-only mode. */
|
|
627
|
+
setState: (state: XlsxFormControlState) => boolean;
|
|
628
|
+
/** Persists a scrollbar or spinner value. No-ops for other control kinds or in read-only mode. */
|
|
629
|
+
setValue: (value: number) => boolean;
|
|
630
|
+
/** Stops an event from leaking into worksheet selection. */
|
|
631
|
+
stopPropagation: (event: React.SyntheticEvent) => void;
|
|
632
|
+
/** Apply this style to the custom control root to preserve worksheet positioning and sizing. */
|
|
633
|
+
style: React.CSSProperties;
|
|
634
|
+
/** Current worksheet zoom multiplier, where `1` is 100%. */
|
|
635
|
+
zoomFactor: number;
|
|
636
|
+
}
|
|
573
637
|
interface XlsxChartReference {
|
|
574
638
|
formula?: string;
|
|
575
639
|
refType?: string;
|
|
@@ -1456,6 +1520,12 @@ interface XlsxViewerProps extends UseXlsxViewerControllerOptions {
|
|
|
1456
1520
|
onFormControlChange?: (event: XlsxFormControlChangeEvent) => void;
|
|
1457
1521
|
/** Replaces the chart loading placeholder. */
|
|
1458
1522
|
renderChartLoading?: (props: XlsxChartLoadingRenderProps) => React.ReactNode;
|
|
1523
|
+
/**
|
|
1524
|
+
* Replaces built-in worksheet form-control rendering.
|
|
1525
|
+
* Apply `style` to the custom root and use `stopPropagation` on pointer/click handlers.
|
|
1526
|
+
* The supplied setters preserve Duke mutation, linked-cell, undo/redo, and change-event behavior.
|
|
1527
|
+
*/
|
|
1528
|
+
renderFormControl?: (props: XlsxFormControlRenderProps) => React.ReactNode;
|
|
1459
1529
|
/**
|
|
1460
1530
|
* Replaces worksheet images while preserving their calculated rect and style.
|
|
1461
1531
|
*
|
|
@@ -1560,4 +1630,4 @@ declare function useXlsxViewerThumbnails(options?: UseXlsxViewerThumbnailsOption
|
|
|
1560
1630
|
declare function XlsxViewer(props: XlsxViewerProps): react_jsx_runtime.JSX.Element;
|
|
1561
1631
|
declare function DefaultXlsxToolbar(): react_jsx_runtime.JSX.Element;
|
|
1562
1632
|
|
|
1563
|
-
export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, XlsxFileSizeLimitExceededError, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type
|
|
1633
|
+
export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, XlsxFileSizeLimitExceededError, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type XlsxFormControlCaption, type XlsxFormControlCaptionInput, type XlsxFormControlCaptionRun, type XlsxFormControlChangeEvent, type XlsxFormControlInput, type XlsxFormControlKind, type XlsxFormControlKindInput, type XlsxFormControlPatch, type XlsxFormControlRenderProps, type XlsxFormControlSelectionMode, type XlsxFormControlState, type XlsxFormulaTarget, type XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxScrollerRenderProps, type XlsxShape, type XlsxShapeFill, type XlsxShapeParagraph, type XlsxShapeStroke, type XlsxShapeTextBox, type XlsxShapeTextRun, type XlsxSheetData, type XlsxSheetThumbnail, type XlsxSheetThumbnailResolution, type XlsxSheetVisibility, type XlsxTable, type XlsxTableColumn, type XlsxTableHeaderMenuRenderProps, type XlsxTableSortDirection, type XlsxTableSortState, type XlsxThemePalette, XlsxViewer, type XlsxViewerCharts, type XlsxViewerController, type XlsxViewerEditing, type XlsxViewerImages, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWasmSource, type XlsxWorkbookTab, initWasm, setWasmSource, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
|
package/dist/index.d.ts
CHANGED
|
@@ -441,56 +441,58 @@ interface XlsxShape {
|
|
|
441
441
|
type XlsxFormControlKind = "button" | "checkbox" | "dropdown" | "editbox" | "group-box" | "label" | "listbox" | "radio" | "scrollbar" | "spinner" | "unknown";
|
|
442
442
|
type XlsxFormControlState = "unchecked" | "checked" | "mixed";
|
|
443
443
|
type XlsxFormControlSelectionMode = "single" | "multi" | "extend";
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
toRowOffset: number;
|
|
455
|
-
}
|
|
456
|
-
/** Kind-specific input accepted by Duke Sheets for form-control mutations. */
|
|
444
|
+
interface XlsxFormControlCaptionRun {
|
|
445
|
+
font?: XlsxCellFontStyleInput;
|
|
446
|
+
text: string;
|
|
447
|
+
}
|
|
448
|
+
interface XlsxFormControlCaption {
|
|
449
|
+
horizontalAlignment?: "general" | "left" | "center" | "right" | "fill" | "justify" | "centerContinuous" | "distributed";
|
|
450
|
+
runs: XlsxFormControlCaptionRun[];
|
|
451
|
+
verticalAlignment?: "top" | "center" | "bottom" | "justify" | "distributed";
|
|
452
|
+
}
|
|
453
|
+
type XlsxFormControlCaptionInput = string | XlsxFormControlCaption;
|
|
457
454
|
type XlsxFormControlKindInput = {
|
|
458
455
|
kind: "button";
|
|
459
|
-
caption:
|
|
456
|
+
caption: XlsxFormControlCaptionInput;
|
|
460
457
|
} | {
|
|
461
458
|
kind: "checkbox";
|
|
462
|
-
caption:
|
|
459
|
+
caption: XlsxFormControlCaptionInput;
|
|
463
460
|
state: XlsxFormControlState;
|
|
464
461
|
cellLink?: string;
|
|
465
|
-
no3D
|
|
462
|
+
no3D?: boolean;
|
|
466
463
|
} | {
|
|
467
464
|
kind: "optionButton";
|
|
468
|
-
caption:
|
|
465
|
+
caption: XlsxFormControlCaptionInput;
|
|
469
466
|
state: Exclude<XlsxFormControlState, "mixed">;
|
|
470
467
|
cellLink?: string;
|
|
471
|
-
|
|
472
|
-
no3D: boolean;
|
|
468
|
+
no3D?: boolean;
|
|
473
469
|
} | {
|
|
474
470
|
kind: "label";
|
|
475
|
-
caption:
|
|
471
|
+
caption: XlsxFormControlCaptionInput;
|
|
476
472
|
} | {
|
|
477
473
|
kind: "groupBox";
|
|
478
|
-
caption:
|
|
479
|
-
no3D
|
|
474
|
+
caption: XlsxFormControlCaptionInput;
|
|
475
|
+
no3D?: boolean;
|
|
480
476
|
} | {
|
|
481
477
|
kind: "listBox";
|
|
482
478
|
inputRange?: string;
|
|
483
479
|
cellLink?: string;
|
|
484
480
|
selection: XlsxFormControlSelectionMode;
|
|
485
|
-
selected
|
|
486
|
-
no3D
|
|
481
|
+
selected?: number[];
|
|
482
|
+
no3D?: boolean;
|
|
487
483
|
} | {
|
|
488
484
|
kind: "dropdown";
|
|
489
485
|
inputRange?: string;
|
|
490
486
|
cellLink?: string;
|
|
491
487
|
selected?: number;
|
|
492
488
|
lines: number;
|
|
493
|
-
no3D
|
|
489
|
+
no3D?: boolean;
|
|
490
|
+
} | {
|
|
491
|
+
kind: "editbox";
|
|
492
|
+
caption: XlsxFormControlCaptionInput;
|
|
493
|
+
legacyObjectType?: number;
|
|
494
|
+
rawObj?: Uint8Array | number[];
|
|
495
|
+
rawProperties?: Array<[string, string]>;
|
|
494
496
|
} | {
|
|
495
497
|
kind: "scrollbar";
|
|
496
498
|
value: number;
|
|
@@ -498,7 +500,7 @@ type XlsxFormControlKindInput = {
|
|
|
498
500
|
max: number;
|
|
499
501
|
increment: number;
|
|
500
502
|
page: number;
|
|
501
|
-
horizontal
|
|
503
|
+
horizontal?: boolean;
|
|
502
504
|
cellLink?: string;
|
|
503
505
|
} | {
|
|
504
506
|
kind: "spinner";
|
|
@@ -507,30 +509,51 @@ type XlsxFormControlKindInput = {
|
|
|
507
509
|
max: number;
|
|
508
510
|
increment: number;
|
|
509
511
|
cellLink?: string;
|
|
512
|
+
} | {
|
|
513
|
+
kind: "unknown";
|
|
514
|
+
objectType: string;
|
|
515
|
+
legacyObjectType?: number;
|
|
516
|
+
caption?: XlsxFormControlCaptionInput;
|
|
517
|
+
rawObj?: Uint8Array | number[];
|
|
518
|
+
rawProperties?: Array<[string, string]>;
|
|
510
519
|
};
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
520
|
+
interface XlsxFormControlMetadataInput {
|
|
521
|
+
altText?: string;
|
|
522
|
+
hidden?: boolean;
|
|
514
523
|
kind: XlsxFormControlKindInput;
|
|
515
524
|
locked?: boolean;
|
|
525
|
+
macroName?: string;
|
|
516
526
|
name?: string;
|
|
517
527
|
printable?: boolean;
|
|
528
|
+
rawClientData?: Array<Uint8Array | number[]>;
|
|
529
|
+
title?: string;
|
|
518
530
|
}
|
|
519
|
-
|
|
520
|
-
|
|
531
|
+
type XlsxFormControlInput = XlsxFormControlMetadataInput & ({
|
|
532
|
+
anchor: Extract<XlsxImageAnchor, {
|
|
533
|
+
kind: "two-cell";
|
|
534
|
+
}>;
|
|
535
|
+
editAs?: "twoCell" | "oneCell" | "absolute";
|
|
536
|
+
} | {
|
|
537
|
+
anchor: Exclude<XlsxImageAnchor, {
|
|
538
|
+
kind: "two-cell";
|
|
539
|
+
}>;
|
|
540
|
+
editAs?: never;
|
|
541
|
+
});
|
|
542
|
+
type XlsxFormControlPatch = Partial<Omit<XlsxFormControlMetadataInput, "kind">> & {
|
|
543
|
+
anchor?: XlsxImageAnchor;
|
|
544
|
+
editAs?: "twoCell" | "oneCell" | "absolute";
|
|
521
545
|
kind?: XlsxFormControlKindInput;
|
|
522
546
|
};
|
|
523
547
|
interface XlsxFormControl {
|
|
524
548
|
anchor: XlsxImageAnchor;
|
|
525
|
-
|
|
526
|
-
caption
|
|
549
|
+
altText?: string;
|
|
550
|
+
/** Original rich caption reported by Duke Sheets. */
|
|
551
|
+
caption?: XlsxFormControlCaption;
|
|
527
552
|
checked?: boolean;
|
|
528
553
|
/** Duke Sheets' stable zero-based index for this worksheet load. */
|
|
529
554
|
controlIndex?: number;
|
|
530
|
-
/** Original
|
|
555
|
+
/** Original two-cell anchor behavior. */
|
|
531
556
|
editAs?: "twoCell" | "oneCell" | "absolute";
|
|
532
|
-
/** Exact Duke Sheets anchor. Use this when cloning or updating the control through the controller. */
|
|
533
|
-
dukeAnchor?: XlsxFormControlAnchor;
|
|
534
557
|
firstInGroup?: boolean;
|
|
535
558
|
fontFamily?: string;
|
|
536
559
|
fontSizePt?: number;
|
|
@@ -539,17 +562,25 @@ interface XlsxFormControl {
|
|
|
539
562
|
id: string;
|
|
540
563
|
increment?: number;
|
|
541
564
|
inputRange?: string;
|
|
565
|
+
/** Current formatted labels resolved from a dropdown or list box input range. */
|
|
566
|
+
items?: string[];
|
|
542
567
|
kind: XlsxFormControlKind;
|
|
543
568
|
label?: string;
|
|
544
569
|
lines?: number;
|
|
545
570
|
linkedCell?: string;
|
|
546
571
|
locked?: boolean;
|
|
572
|
+
macroName?: string;
|
|
547
573
|
max?: number;
|
|
548
574
|
min?: number;
|
|
549
575
|
name?: string;
|
|
550
576
|
no3D?: boolean;
|
|
551
577
|
page?: number;
|
|
552
578
|
printable?: boolean;
|
|
579
|
+
objectType?: string;
|
|
580
|
+
legacyObjectType?: number;
|
|
581
|
+
rawClientData?: number[][];
|
|
582
|
+
rawObj?: number[];
|
|
583
|
+
rawProperties?: Array<[string, string]>;
|
|
553
584
|
/** Zero-based selected item index or indexes, matching Duke Sheets. */
|
|
554
585
|
selected?: number | number[];
|
|
555
586
|
selection?: XlsxFormControlSelectionMode;
|
|
@@ -557,6 +588,7 @@ interface XlsxFormControl {
|
|
|
557
588
|
state?: XlsxFormControlState;
|
|
558
589
|
textAlign?: "center" | "left" | "right";
|
|
559
590
|
textColor?: string;
|
|
591
|
+
title?: string;
|
|
560
592
|
value?: number;
|
|
561
593
|
workbookSheetIndex: number;
|
|
562
594
|
zIndex: number;
|
|
@@ -570,6 +602,38 @@ interface XlsxFormControlChangeEvent {
|
|
|
570
602
|
previousControl: XlsxFormControl;
|
|
571
603
|
type: "change";
|
|
572
604
|
}
|
|
605
|
+
interface XlsxFormControlRenderProps {
|
|
606
|
+
/** Activates a button control. No-ops in read-only mode. */
|
|
607
|
+
activate: () => void;
|
|
608
|
+
/** Current checked state for checkbox and radio controls. */
|
|
609
|
+
checked: boolean;
|
|
610
|
+
/** Full parsed control metadata. Switch on `control.kind` to render a kind-specific component. */
|
|
611
|
+
control: XlsxFormControl;
|
|
612
|
+
/** True when this control cannot be changed through the viewer. */
|
|
613
|
+
disabled: boolean;
|
|
614
|
+
/** Current formatted dropdown or list box items resolved from the control input range. */
|
|
615
|
+
items: string[];
|
|
616
|
+
/** Display label after placeholder Excel names have been removed. */
|
|
617
|
+
label: string;
|
|
618
|
+
/** True when a checkbox is in Excel's indeterminate state. */
|
|
619
|
+
mixed: boolean;
|
|
620
|
+
/** True when the viewer is rendering without workbook mutation support. */
|
|
621
|
+
readOnly: boolean;
|
|
622
|
+
/** Calculated worksheet-relative control rectangle in CSS pixels. */
|
|
623
|
+
rect: XlsxImageRect;
|
|
624
|
+
/** Persists a dropdown or list box selection. No-ops for other control kinds or in read-only mode. */
|
|
625
|
+
setSelected: (selected: number | number[] | undefined) => boolean;
|
|
626
|
+
/** Persists a checkbox or radio state. No-ops for other control kinds or in read-only mode. */
|
|
627
|
+
setState: (state: XlsxFormControlState) => boolean;
|
|
628
|
+
/** Persists a scrollbar or spinner value. No-ops for other control kinds or in read-only mode. */
|
|
629
|
+
setValue: (value: number) => boolean;
|
|
630
|
+
/** Stops an event from leaking into worksheet selection. */
|
|
631
|
+
stopPropagation: (event: React.SyntheticEvent) => void;
|
|
632
|
+
/** Apply this style to the custom control root to preserve worksheet positioning and sizing. */
|
|
633
|
+
style: React.CSSProperties;
|
|
634
|
+
/** Current worksheet zoom multiplier, where `1` is 100%. */
|
|
635
|
+
zoomFactor: number;
|
|
636
|
+
}
|
|
573
637
|
interface XlsxChartReference {
|
|
574
638
|
formula?: string;
|
|
575
639
|
refType?: string;
|
|
@@ -1456,6 +1520,12 @@ interface XlsxViewerProps extends UseXlsxViewerControllerOptions {
|
|
|
1456
1520
|
onFormControlChange?: (event: XlsxFormControlChangeEvent) => void;
|
|
1457
1521
|
/** Replaces the chart loading placeholder. */
|
|
1458
1522
|
renderChartLoading?: (props: XlsxChartLoadingRenderProps) => React.ReactNode;
|
|
1523
|
+
/**
|
|
1524
|
+
* Replaces built-in worksheet form-control rendering.
|
|
1525
|
+
* Apply `style` to the custom root and use `stopPropagation` on pointer/click handlers.
|
|
1526
|
+
* The supplied setters preserve Duke mutation, linked-cell, undo/redo, and change-event behavior.
|
|
1527
|
+
*/
|
|
1528
|
+
renderFormControl?: (props: XlsxFormControlRenderProps) => React.ReactNode;
|
|
1459
1529
|
/**
|
|
1460
1530
|
* Replaces worksheet images while preserving their calculated rect and style.
|
|
1461
1531
|
*
|
|
@@ -1560,4 +1630,4 @@ declare function useXlsxViewerThumbnails(options?: UseXlsxViewerThumbnailsOption
|
|
|
1560
1630
|
declare function XlsxViewer(props: XlsxViewerProps): react_jsx_runtime.JSX.Element;
|
|
1561
1631
|
declare function DefaultXlsxToolbar(): react_jsx_runtime.JSX.Element;
|
|
1562
1632
|
|
|
1563
|
-
export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, XlsxFileSizeLimitExceededError, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type
|
|
1633
|
+
export { DefaultXlsxToolbar, type UseXlsxViewerControllerOptions, type UseXlsxViewerThumbnailsOptions, type XlsxCellAddress, type XlsxCellAlignmentInput, type XlsxCellBorderEdgeInput, type XlsxCellBorderStyleInput, type XlsxCellFillStyleInput, type XlsxCellFontStyleInput, type XlsxCellGradientStopInput, type XlsxCellNumberFormatInput, type XlsxCellProtectionInput, type XlsxCellRange, type XlsxCellStyleColorInput, type XlsxCellStyleContext, type XlsxCellStyleInput, type XlsxChart, type XlsxChartAxis, type XlsxChartDataLabels, type XlsxChartElementSelection, type XlsxChartLoadingRenderProps, type XlsxChartReference, type XlsxChartSeries, type XlsxChartsheet, XlsxFileSizeLimitExceededError, type XlsxFileTooLargeRenderProps, type XlsxFormControl, type XlsxFormControlActionEvent, type XlsxFormControlCaption, type XlsxFormControlCaptionInput, type XlsxFormControlCaptionRun, type XlsxFormControlChangeEvent, type XlsxFormControlInput, type XlsxFormControlKind, type XlsxFormControlKindInput, type XlsxFormControlPatch, type XlsxFormControlRenderProps, type XlsxFormControlSelectionMode, type XlsxFormControlState, type XlsxFormulaTarget, type XlsxImage, type XlsxImageAnchor, type XlsxImageRect, type XlsxImageRenderProps, type XlsxImageResizeHandlePosition, type XlsxImageSelectionRenderProps, type XlsxScrollerRenderProps, type XlsxShape, type XlsxShapeFill, type XlsxShapeParagraph, type XlsxShapeStroke, type XlsxShapeTextBox, type XlsxShapeTextRun, type XlsxSheetData, type XlsxSheetThumbnail, type XlsxSheetThumbnailResolution, type XlsxSheetVisibility, type XlsxTable, type XlsxTableColumn, type XlsxTableHeaderMenuRenderProps, type XlsxTableSortDirection, type XlsxTableSortState, type XlsxThemePalette, XlsxViewer, type XlsxViewerCharts, type XlsxViewerController, type XlsxViewerEditing, type XlsxViewerImages, type XlsxViewerProps, XlsxViewerProvider, type XlsxViewerProviderProps, type XlsxViewerSelection, type XlsxViewerTables, type XlsxViewerThumbnails, type XlsxViewerZoom, type XlsxWasmSource, type XlsxWorkbookTab, initWasm, setWasmSource, useXlsxViewer, useXlsxViewerCharts, useXlsxViewerController, useXlsxViewerEditing, useXlsxViewerImages, useXlsxViewerSelection, useXlsxViewerTables, useXlsxViewerThumbnails, useXlsxViewerZoom };
|