@sheetxl/react 0.7.11 → 0.7.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/react",
3
3
  "description": "React - React components needed to build advanced grid and spreadsheet UIs.",
4
- "version": "0.7.11",
4
+ "version": "0.7.13",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -49,10 +49,10 @@
49
49
  "@dnd-kit/sortable": "^10.0.0",
50
50
  "@dnd-kit/utilities": "^3.2.2",
51
51
  "@monaco-editor/react": "^4.6.0",
52
- "@sheetxl/grid-react": "^0.7.11",
53
- "@sheetxl/sdk": "^0.7.11",
54
- "@sheetxl/utils": "^0.7.11",
55
- "@sheetxl/utils-react": "^0.7.11",
52
+ "@sheetxl/grid-react": "^0.7.13",
53
+ "@sheetxl/sdk": "^0.7.13",
54
+ "@sheetxl/utils": "^0.7.13",
55
+ "@sheetxl/utils-react": "^0.7.13",
56
56
  "clsx": "^2.1.1",
57
57
  "monaco-editor-auto-typings": "^0.4.6",
58
58
  "react-merge-refs": "^3.0.2",
@@ -61,7 +61,11 @@
61
61
  "rooks": "^9.3.0"
62
62
  },
63
63
  "peerDependencies": {
64
- "react": "^19.1.0",
65
- "react-dom": "^19.1.0"
64
+ "react": "^19.0.0",
65
+ "react-dom": "^19.0.0"
66
+ },
67
+ "devDependencies": {
68
+ "@types/react": "^19.2.0",
69
+ "@types/react-dom": "^19.2.0"
66
70
  }
67
71
  }
package/types/index.d.ts CHANGED
@@ -11,6 +11,7 @@ import { CopyPasteResults } from '@sheetxl/utils-react';
11
11
  import { default as default_2 } from 'react';
12
12
  import { DraggableSyntheticListeners } from '@dnd-kit/core';
13
13
  import { EditState } from '@sheetxl/grid-react';
14
+ import { FocusWindowOptions } from '@sheetxl/utils-react';
14
15
  import { FrozenEdge } from '@sheetxl/grid-react';
15
16
  import { GridProps } from '@sheetxl/grid-react';
16
17
  import { GridStyle } from '@sheetxl/grid-react';
@@ -64,6 +65,13 @@ import { TopLeft } from '@sheetxl/utils';
64
65
  import { Transform } from '@dnd-kit/utilities';
65
66
  import { VirtualScrollbarProps } from '@sheetxl/utils-react';
66
67
 
68
+ export declare interface ActivateFrameOptions {
69
+ /**
70
+ * If not provided then will drive autoFocus
71
+ */
72
+ autoFocus?: boolean | string | FocusWindowOptions;
73
+ }
74
+
67
75
  declare interface Border {
68
76
  readonly darkMode: boolean;
69
77
  readonly autoColor: IColor;
@@ -238,7 +246,13 @@ export declare namespace CommandContext {
238
246
  Table,
239
247
  Theme,
240
248
  NamedReference,
241
- FormulaFunction
249
+ ResizeHeaderOptions,
250
+ ResizeHeaderContext,
251
+ NewTable,
252
+ SelectedRange,
253
+ FormulaFunction,
254
+ FindScopeOptions,
255
+ FindReplaceOptions
242
256
  }
243
257
  }
244
258
 
@@ -368,6 +382,53 @@ export declare interface FilterButtonProps extends default_2.HTMLAttributes<HTML
368
382
  */
369
383
  declare const findNextFontSize: (size: number, increase?: boolean, steps?: readonly number[]) => number;
370
384
 
385
+ /**
386
+ * Used for the find/replace dialog.
387
+ */
388
+ declare interface FindReplaceOptions {
389
+ /**
390
+ * Options for find.
391
+ */
392
+ findOptions?: ICellRange.FindOptions;
393
+ /**
394
+ * If replacing with null then set to true.
395
+ */
396
+ replace?: boolean;
397
+ /**
398
+ * The text to replace the found text with.
399
+ */
400
+ replaceText?: string | null;
401
+ /**
402
+ * Options for replace.
403
+ */
404
+ replaceOptions?: IWorkbook.ReplaceOptions;
405
+ /**
406
+ * If true the operation will signal to the ui container to
407
+ * autoFocus.
408
+ *
409
+ * @remarks
410
+ * For replaceAll this is ignored.
411
+ */
412
+ autoFocus?: boolean;
413
+ /**
414
+ * Default value 'Sheet'
415
+ */
416
+ scope?: FindScopeOptions;
417
+ }
418
+
419
+ declare const FindScopeOptions: {
420
+ /**
421
+ * Search the entire workbook
422
+ */
423
+ readonly Workbook: "workbook";
424
+ /**
425
+ * Search the current sheet or range
426
+ */
427
+ readonly Sheet: "sheet";
428
+ };
429
+
430
+ declare type FindScopeOptions = typeof FindScopeOptions[keyof typeof FindScopeOptions];
431
+
371
432
  export declare namespace FontUtils {
372
433
  export {
373
434
  DefaultFontSizes,
@@ -391,6 +452,18 @@ export declare interface IEditableLabelElement extends HTMLDivElement, EditableL
391
452
  export declare interface IEmptyFrameElement extends HTMLDivElement, EmptyFrameAttributes {
392
453
  }
393
454
 
455
+ export declare interface IFrame {
456
+ addListener: (listener: IFrameContainerListener) => RemoveListener;
457
+ close: () => void;
458
+ focus: (options?: FocusWindowOptions) => void;
459
+ }
460
+
461
+ export declare interface IFrameContainerListener {
462
+ onShow?: () => void;
463
+ onBeforeHide?: () => void | Promise<boolean>;
464
+ onHide?: () => void;
465
+ }
466
+
394
467
  export declare interface IMovableAreaElement extends HTMLDivElement, MovableAreaAttributes {
395
468
  }
396
469
 
@@ -546,25 +619,12 @@ export declare interface ITaskPaneArea {
546
619
  * This will show and focus a task pane by key.
547
620
  * @param key The task pane key.
548
621
  */
549
- activateTaskPane: (key: string, options?: {
550
- focus?: boolean;
551
- } & any) => void;
622
+ activateTaskPane: (key: string, options?: ActivateFrameOptions) => void;
552
623
  }
553
624
 
554
625
  export declare interface ITaskPaneAreaElement extends HTMLDivElement, ITaskPaneArea {
555
626
  }
556
627
 
557
- export declare interface ITaskPaneContainerListener {
558
- onShow?: () => void;
559
- onBeforeHide?: () => void | Promise<boolean>;
560
- onHide?: () => void;
561
- }
562
-
563
- export declare interface ITaskPaneFrame {
564
- addListener: (listener: ITaskPaneContainerListener) => RemoveListener;
565
- close: () => void;
566
- }
567
-
568
628
  export declare interface ITaskPaneRegistry {
569
629
  /**
570
630
  * Registers a task pane container.
@@ -605,6 +665,11 @@ export declare const LogoNoPaddingIcon: (props: default_2.SVGProps<SVGSVGElement
605
665
 
606
666
  export declare const LogoTextNoPaddingIcon: (props: default_2.SVGProps<SVGSVGElement>) => JSX.Element;
607
667
 
668
+ export declare interface ModalFrame extends IFrame {
669
+ onCancel?: () => void;
670
+ onDone?: (results?: any) => void;
671
+ }
672
+
608
673
  export declare const MovableArea: default_2.FC<MovableAreaProps & {
609
674
  ref?: default_2.Ref<IMovableAreaElement>;
610
675
  }>;
@@ -727,6 +792,11 @@ declare interface NamedStyle {
727
792
  createTemporaryCell: (update: ICell.Update) => ICell;
728
793
  }
729
794
 
795
+ declare interface NewTable {
796
+ ranges: ICellRanges;
797
+ hasHeader?: boolean;
798
+ }
799
+
730
800
  /**
731
801
  * Returns Date.now() rounded to a nearest time.
732
802
  *
@@ -801,6 +871,18 @@ export declare interface RangeContainer {
801
871
  getRange(address: ICellRange.Address, options?: ICellRange.GetRangeOptions): ICellRange;
802
872
  }
803
873
 
874
+ declare interface ResizeHeaderContext {
875
+ getOrientation(): IRange.Orientation;
876
+ getUnitText(): string;
877
+ toUnits?(value: number): number;
878
+ toPixels?(value: number): number;
879
+ }
880
+
881
+ declare interface ResizeHeaderOptions {
882
+ size: number;
883
+ unit?: string;
884
+ }
885
+
804
886
  export declare const Row: default_2.NamedExoticComponent<Props_2 & default_2.RefAttributes<HTMLDivElement>>;
805
887
 
806
888
  /**
@@ -834,7 +916,7 @@ export declare interface ScriptEditorProps extends default_2.HTMLAttributes<HTML
834
916
  /**
835
917
  * Handle to the frame
836
918
  */
837
- frame?: ITaskPaneFrame;
919
+ frame?: IFrame;
838
920
  /**
839
921
  * Allows for component to be autoFocused.
840
922
  */
@@ -852,6 +934,11 @@ export declare interface ScriptEditorProps extends default_2.HTMLAttributes<HTML
852
934
  darkMode?: boolean;
853
935
  }
854
936
 
937
+ declare interface SelectedRange {
938
+ range: ICellRange;
939
+ cell?: ICell.Address;
940
+ }
941
+
855
942
  export declare type SheetAttributes = {
856
943
  getGridElement: () => IGridElement;
857
944
  getRowHeaderElement: () => ISheetHeaderElement;
@@ -1501,8 +1588,8 @@ export declare interface TaskPaneProps<T = any> {
1501
1588
  */
1502
1589
  entryKey: string;
1503
1590
  model?: T;
1591
+ frame?: IFrame;
1504
1592
  commands?: ICommands.IGroup;
1505
- frame?: ITaskPaneFrame;
1506
1593
  }
1507
1594
 
1508
1595
  export declare const TaskPaneProvider: default_2.FC<TaskPaneProviderProps>;
@@ -1611,7 +1698,7 @@ export declare interface useModelListenerOptions extends IListener.Options {
1611
1698
  * Hook for observing movable commands. This hook will observe a combination
1612
1699
  * of sheet events and an options selection.
1613
1700
  */
1614
- export declare function useMovableCommands(props: useMovableCommandsOptions): ICommands.IGroup;
1701
+ export declare const useMovableCommands: (props: useMovableCommandsOptions) => ICommands.IGroup;
1615
1702
 
1616
1703
  export declare interface useMovableCommandsOptions {
1617
1704
  commands: ICommands.IGroup;
@@ -1660,7 +1747,6 @@ export declare const useRangeListener: (model: RangeContainer, address: ICellRan
1660
1747
  * CTRL+SHIFT+DELETE === cut ? (not seeing this happen)
1661
1748
  *
1662
1749
  * Formulas
1663
- * =,+,- is start formula (make this a shortcut?)
1664
1750
  * Ctrl + / Select current array ?
1665
1751
  * (other formula shortcuts)
1666
1752
  */