@sheetxl/utils-react 0.7.19 → 0.7.21

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/types/index.d.ts CHANGED
@@ -23,25 +23,6 @@ declare function boundPixel(cssPoint: number, _increase?: boolean, _absOffset?:
23
23
 
24
24
  export declare type CellFinder = (activeCoords: CellCoords, isContentfulCell: IsContentfulCell | undefined, hiddenAt: HiddenHeadersAt | undefined, direction: Direction, first: boolean, limit: number) => number;
25
25
 
26
- export declare interface CellLayout {
27
- /**
28
- * Returns the offset given an index.
29
- */
30
- getColOffset: ItemSizer;
31
- /**
32
- * Returns the index given an offset.
33
- */
34
- getColIndex: ItemSizer;
35
- /**
36
- * Returns the offset given an index.
37
- */
38
- getRowOffset: ItemSizer;
39
- /**
40
- * Returns the index given an offset.
41
- */
42
- getRowIndex: ItemSizer;
43
- }
44
-
45
26
  export declare type ClickOrFocusAwayListener = (event: globalThis.MouseEvent | globalThis.KeyboardEvent) => void;
46
27
 
47
28
  export declare interface ClickOrFocusAwayOptions {
@@ -118,7 +99,7 @@ export declare interface CommandButtonOptions<STATE = any, CONTEXT = any> extend
118
99
  * Tooltip properties. If this is specified then the tooltips are used.
119
100
  * Do not provide a child as this component will be the child.
120
101
  */
121
- tooltipProps?: any;
102
+ propsTooltip?: any;
122
103
  /**
123
104
  * How the button will be styles.
124
105
  * @defaultValue CommandButtonType.Toolbar
@@ -291,12 +272,7 @@ export declare function createDynamicIconService(): {
291
272
  */
292
273
  declare const createSyntheticEvent: <T extends Element, E extends Event, R extends React.SyntheticEvent<T, E>>(event: E, currentTarget?: EventTarget & T) => R;
293
274
 
294
- declare const defaultCreateScrollbar: (props: ScrollbarProps, ref?: React.Ref<HTMLDivElement>) => JSX.Element;
295
-
296
- export declare const defaultCreateScrollCorner: ({ width, height }: {
297
- width: any;
298
- height: any;
299
- }) => JSX.Element;
275
+ export declare const defaultCreateScrollCorner: (size: Size) => JSX.Element;
300
276
 
301
277
  /**
302
278
  * TODO - implement styling support similar to other scroll buttons. Currently hardcoded
@@ -350,6 +326,8 @@ export declare class DefaultReactNotifier extends DefaultNotifier implements IRe
350
326
  showInput(options: ShowInputOptions): Promise<InputResults>;
351
327
  }
352
328
 
329
+ declare const defaultRenderScrollbar: (props: ScrollbarProps) => JSX.Element;
330
+
353
331
  /**
354
332
  * Re-export detectIt.
355
333
  *
@@ -400,7 +378,7 @@ export declare interface DynamicIconProps extends default_2.HTMLAttributes<HTMLE
400
378
  role?: 'img' | 'presentation' | string;
401
379
  ariaHidden?: boolean;
402
380
  /** Extra props forwarded to React glyphs (if the glyph is of type `react`) */
403
- sourceProps?: unknown;
381
+ propsSource?: unknown;
404
382
  }
405
383
 
406
384
  declare type DynamicValue<T, CONTEXT> = T | ((context?: DynamicContext<CONTEXT>) => T);
@@ -431,6 +409,20 @@ export declare interface EnqueueNotifierOptions extends NotifierOptions {
431
409
  enqueueProps?: Record<string, any>;
432
410
  }
433
411
 
412
+ /**
413
+ * Props for an Error Panel
414
+ */
415
+ export declare interface ErrorPanelProps extends React.HTMLAttributes<HTMLDivElement> {
416
+ /**
417
+ * The error to show
418
+ */
419
+ error: any;
420
+ /**
421
+ * Ref to the element.
422
+ */
423
+ ref?: React.Ref<HTMLDivElement>;
424
+ }
425
+
434
426
  /**
435
427
  * Simple panel to trigger various error scenarios for testing error boundaries and logging.
436
428
  */
@@ -514,6 +506,25 @@ export declare const HorizontalAlignment: {
514
506
 
515
507
  export declare type HorizontalAlignment = typeof HorizontalAlignment[keyof typeof HorizontalAlignment];
516
508
 
509
+ export declare interface ICellLayout {
510
+ /**
511
+ * Returns the offset given an index.
512
+ */
513
+ getColOffset: ItemSizer;
514
+ /**
515
+ * Returns the index given an offset.
516
+ */
517
+ getColIndex: ItemSizer;
518
+ /**
519
+ * Returns the offset given an index.
520
+ */
521
+ getRowOffset: ItemSizer;
522
+ /**
523
+ * Returns the index given an offset.
524
+ */
525
+ getRowIndex: ItemSizer;
526
+ }
527
+
517
528
  export declare interface ICommand<STATE extends any = any, CONTEXT extends any = void> {
518
529
  /**
519
530
  * A unique key for the command. This is how the command is identified
@@ -905,7 +916,11 @@ export declare interface IScrollbarAttributes extends HTMLDivElement {
905
916
  export declare interface IScrollbarElement extends IScrollbarAttributes, HTMLDivElement {
906
917
  }
907
918
 
908
- export declare interface IScrollPaneElement extends HTMLDivElement, ScrollPaneAttributes {
919
+ export declare interface IScrollPaneAttributes {
920
+ isScrollPane: () => true;
921
+ }
922
+
923
+ export declare interface IScrollPaneElement extends HTMLDivElement, IScrollPaneAttributes {
909
924
  }
910
925
 
911
926
  export declare interface IShowToolTipProperties {
@@ -979,6 +994,8 @@ export declare const KeyCodes: {
979
994
  readonly Slash: 191;
980
995
  readonly BracketRight: 221;
981
996
  readonly BracketLeft: 219;
997
+ /** Android/IME composition key - used when virtual keyboards send composite input */
998
+ readonly Composition: 229;
982
999
  };
983
1000
 
984
1001
  export declare type KeyCodes = typeof KeyCodes[keyof typeof KeyCodes];
@@ -992,6 +1009,37 @@ export declare const KeyModifiers: {
992
1009
 
993
1010
  export declare type KeyModifiers = typeof KeyModifiers[keyof typeof KeyModifiers];
994
1011
 
1012
+ /**
1013
+ * Props for LoadingPanel
1014
+ */
1015
+ export declare interface LoadingPanelProps extends React.HTMLAttributes<HTMLDivElement> {
1016
+ /**
1017
+ * A delay for showing the loading panel.
1018
+ *
1019
+ * @remarks
1020
+ * This helps prevent flicker if loading is very fast.
1021
+ */
1022
+ transitionDelay?: string;
1023
+ /**
1024
+ * Whether the background should be transparent.
1025
+ *
1026
+ * @defaultValue false
1027
+ */
1028
+ transparentBackground?: boolean;
1029
+ /**
1030
+ * Optional callback when mounted
1031
+ */
1032
+ onMount?: () => void;
1033
+ /**
1034
+ * Optional callback when unmounted
1035
+ */
1036
+ onUnmount?: () => void;
1037
+ /**
1038
+ * Ref to the element.
1039
+ */
1040
+ ref?: React.Ref<HTMLDivElement>;
1041
+ }
1042
+
995
1043
  /** LocalStorage state with cross-tab sync */
996
1044
  export declare class LocalStorageStore implements PersistenceStore {
997
1045
  private storage;
@@ -1234,7 +1282,7 @@ export declare type ScrollableViewport = {
1234
1282
  totalHeight: number;
1235
1283
  };
1236
1284
 
1237
- export declare const Scrollbar: default_2.NamedExoticComponent<ScrollbarProps & default_2.RefAttributes<IScrollbarElement>>;
1285
+ export declare const Scrollbar: default_2.NamedExoticComponent<Omit<ScrollbarProps, "ref"> & default_2.RefAttributes<IScrollbarElement>>;
1238
1286
 
1239
1287
  export declare const ScrollbarOrientation: {
1240
1288
  readonly Horizontal: "horizontal";
@@ -1280,38 +1328,39 @@ export declare interface ScrollbarProps extends default_2.HTMLAttributes<HTMLEle
1280
1328
  scrollButtonIncrement?: number | ((offset: number, viewport: number, totalSize: number) => number);
1281
1329
  scrollButtonInitialRepeatDelay?: number;
1282
1330
  scrollButtonAdditionalRepeatDelay?: number;
1283
- createScrollStartButton?: (props: ScrollButtonProps, ref?: default_2.Ref<HTMLElement>) => default_2.ReactElement;
1284
- createScrollEndButton?: (props: ScrollButtonProps, ref?: default_2.Ref<HTMLElement>) => default_2.ReactElement;
1285
- touchThumbProps?: Partial<TouchThumbHandleProps>;
1286
- thumbProps?: default_2.HTMLAttributes<HTMLElement>;
1331
+ renderScrollButtonStart?: (props: ScrollButtonProps) => default_2.ReactElement;
1332
+ renderScrollButtonEnd?: (props: ScrollButtonProps) => default_2.ReactElement;
1333
+ propsTouchThumb?: Partial<TouchThumbHandleProps>;
1334
+ propsThumb?: default_2.HTMLAttributes<HTMLElement>;
1335
+ /**
1336
+ * Reference to the underling element
1337
+ */
1338
+ ref?: default_2.Ref<IScrollbarElement>;
1287
1339
  }
1288
1340
 
1289
- export declare interface ScrollButtonProps {
1290
- style?: default_2.CSSProperties;
1341
+ export declare interface ScrollButtonProps extends default_2.HTMLAttributes<any> {
1291
1342
  orientation?: ScrollbarOrientation;
1292
1343
  disabled?: boolean;
1293
- onMouseUp: (e: default_2.MouseEvent<HTMLElement>) => void;
1294
- onMouseLeave: (e: default_2.MouseEvent<HTMLElement>) => void;
1295
- onMouseDown: (e: default_2.MouseEvent<HTMLElement>) => void;
1296
- onClick?: (e: default_2.MouseEvent<HTMLElement>) => void;
1344
+ onMouseUp: (e: default_2.MouseEvent<any>) => void;
1345
+ onMouseLeave: (e: default_2.MouseEvent<any>) => void;
1346
+ onMouseDown: (e: default_2.MouseEvent<any>) => void;
1347
+ onClick?: (e: default_2.MouseEvent<any>) => void;
1348
+ ref?: default_2.Ref<any>;
1297
1349
  }
1298
1350
 
1299
- export declare const ScrollPane: default_2.FC<ScrollPaneProps & {
1300
- ref?: default_2.Ref<IScrollPaneElement>;
1301
- }>;
1302
-
1303
- export declare interface ScrollPaneAttributes {
1304
- isScrollPane: () => true;
1305
- }
1351
+ export declare const ScrollPane: default_2.NamedExoticComponent<Omit<ScrollPaneProps, "ref"> & default_2.RefAttributes<IScrollPaneElement>>;
1306
1352
 
1353
+ /**
1354
+ * Properties for the ScrollPane
1355
+ */
1307
1356
  export declare interface ScrollPaneProps extends React.HTMLAttributes<HTMLDivElement> {
1308
1357
  viewport: ScrollableViewport;
1309
1358
  onScrollViewport?: (scrollPoint: Partial<TopLeft>) => void;
1310
1359
  showHorizontalScrollbar?: boolean;
1311
1360
  showVerticalScrollbar?: boolean;
1312
1361
  createScrollCorner?: (size: Size) => React.ReactNode;
1313
- createHorizontalScrollbar?: (props: ScrollbarProps, ref?: React.Ref<HTMLDivElement>) => React.ReactNode;
1314
- createVerticalScrollbar?: (props: ScrollbarProps, ref?: React.Ref<HTMLDivElement>) => React.ReactNode;
1362
+ renderScrollbarHorizontal?: (props: ScrollbarProps) => React.ReactNode;
1363
+ renderScrollbarVertical?: (props: ScrollbarProps) => React.ReactNode;
1315
1364
  /**
1316
1365
  * By default the ScrollPane will listen for events on all of the children of the ScrollPane but this
1317
1366
  * allows for a custom element to be specified. Useful when the ScrollPane has some elements
@@ -1323,6 +1372,10 @@ export declare interface ScrollPaneProps extends React.HTMLAttributes<HTMLDivEle
1323
1372
  * @defaultValue false unless no touch events are detected
1324
1373
  */
1325
1374
  disableTouch?: boolean;
1375
+ /**
1376
+ * Reference to the scroll pane element
1377
+ */
1378
+ ref?: React.Ref<IScrollPaneElement>;
1326
1379
  }
1327
1380
 
1328
1381
  export declare interface ScrollState extends TopLeft {
@@ -1333,7 +1386,7 @@ export declare interface ScrollState extends TopLeft {
1333
1386
  export declare namespace ScrollUtils {
1334
1387
  export {
1335
1388
  getScrollTo,
1336
- defaultCreateScrollbar
1389
+ defaultRenderScrollbar
1337
1390
  }
1338
1391
  }
1339
1392
 
@@ -1345,7 +1398,7 @@ export declare interface ShowInputOptions<T = string, C = any> extends ShowOptio
1345
1398
  /**
1346
1399
  * Css style for input
1347
1400
  */
1348
- inputProps?: default_2.HTMLAttributes<HTMLInputElement | HTMLTextAreaElement>;
1401
+ propsInput?: default_2.HTMLAttributes<HTMLInputElement | HTMLTextAreaElement>;
1349
1402
  inputLabel?: string;
1350
1403
  inputType?: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url';
1351
1404
  inputPlaceHolder?: string;
@@ -1457,9 +1510,7 @@ export declare class SimpleCommand extends Command<void, void> {
1457
1510
  * Because this component measures the elements (both panes and the resizer) it is important
1458
1511
  * that none of these have margins or paddings. If these are required then use a nested element.
1459
1512
  */
1460
- export declare const SplitPane: default_2.FC<SplitPaneProps & {
1461
- ref?: default_2.Ref<ISplitPaneElement>;
1462
- }>;
1513
+ export declare const SplitPane: default_2.NamedExoticComponent<Omit<SplitPaneProps, "ref"> & default_2.RefAttributes<ISplitPaneElement>>;
1463
1514
 
1464
1515
  export declare interface SplitPaneAttributes {
1465
1516
  /**
@@ -1526,28 +1577,29 @@ export declare interface SplitPaneProps extends default_2.HTMLAttributes<HTMLDiv
1526
1577
  */
1527
1578
  splitDirection?: 'row' | 'column';
1528
1579
  disabled?: boolean;
1529
- resizerProps?: SplitPaneResizerProps;
1530
- paneProps?: default_2.HTMLAttributes<HTMLElement>;
1531
- paneBeforeProps?: default_2.HTMLAttributes<HTMLElement>;
1532
- paneAfterProps?: default_2.HTMLAttributes<HTMLElement>;
1580
+ propsResizer?: SplitPaneResizerProps;
1581
+ propsPane?: default_2.HTMLAttributes<HTMLElement>;
1582
+ propsPaneBefore?: default_2.HTMLAttributes<HTMLElement>;
1583
+ propsPaneAfter?: default_2.HTMLAttributes<HTMLElement>;
1533
1584
  onDragStart?: () => void;
1534
1585
  onDragResize?: (position: number) => void;
1535
1586
  onDragFinish?: (position: number) => void;
1536
- createResizer?: (props: SplitPaneResizerProps & default_2.Attributes & {
1537
- ref?: default_2.Ref<HTMLDivElement>;
1538
- }) => default_2.ReactElement;
1587
+ renderResizer?: (props: SplitPaneResizerProps) => default_2.ReactElement;
1588
+ /**
1589
+ * A ref that points to the HTMLDivElement.
1590
+ */
1591
+ ref?: default_2.Ref<ISplitPaneElement>;
1539
1592
  }
1540
1593
 
1541
- export declare const SplitPaneResizer: (props: SplitPaneResizerProps & default_2.Attributes & {
1542
- ref?: default_2.Ref<HTMLDivElement>;
1543
- }) => default_2.ReactElement;
1594
+ export declare const SplitPaneResizer: (props: SplitPaneResizerProps) => default_2.ReactElement;
1544
1595
 
1545
- export declare interface SplitPaneResizerProps extends default_2.HTMLAttributes<HTMLDivElement> {
1596
+ export declare interface SplitPaneResizerProps extends default_2.HTMLAttributes<HTMLDivElement>, default_2.Attributes {
1546
1597
  splitDirection?: 'row' | 'column';
1547
1598
  disabled?: boolean;
1548
1599
  paddingBefore?: number;
1549
1600
  paddingAfter?: number;
1550
- hitAreaProps?: default_2.HTMLAttributes<HTMLDivElement>;
1601
+ propsHitArea?: default_2.HTMLAttributes<HTMLDivElement>;
1602
+ ref?: default_2.Ref<HTMLDivElement>;
1551
1603
  }
1552
1604
 
1553
1605
  export declare interface Style {
@@ -1606,6 +1658,12 @@ declare const toPrettyKeyCode: (key: string) => string;
1606
1658
 
1607
1659
  export declare const toShortcutString: (keyStroke: IKeyStroke, modifierSymbol?: boolean) => string;
1608
1660
 
1661
+ declare interface TouchThumbHandleAttributes {
1662
+ }
1663
+
1664
+ declare interface TouchThumbHandleElement extends HTMLDivElement, TouchThumbHandleAttributes {
1665
+ }
1666
+
1609
1667
  declare interface TouchThumbHandleProps extends default_2.HTMLAttributes<HTMLElement> {
1610
1668
  /**
1611
1669
  * The orientation of the scrollbar.
@@ -1638,6 +1696,10 @@ declare interface TouchThumbHandleProps extends default_2.HTMLAttributes<HTMLEle
1638
1696
  elementRoot?: HTMLElement;
1639
1697
  key?: string;
1640
1698
  offset?: number;
1699
+ /**
1700
+ * Ref for the TouchThumbHandle element
1701
+ */
1702
+ ref?: default_2.Ref<TouchThumbHandleElement>;
1641
1703
  }
1642
1704
 
1643
1705
  export declare const UncaughtErrorBoundary: default_2.FC<{
@@ -1845,7 +1907,7 @@ export declare const useUndoManager: ({ manager, commands: commandsParent, disab
1845
1907
  * Because of the virtual nature of the scrollbar the onScroll method is disabled
1846
1908
  * and onScrollOffset must be used.
1847
1909
  */
1848
- export declare const VirtualScrollbar: default_2.NamedExoticComponent<VirtualScrollbarProps & default_2.RefAttributes<HTMLDivElement>>;
1910
+ export declare const VirtualScrollbar: default_2.NamedExoticComponent<Omit<VirtualScrollbarProps, "ref"> & default_2.RefAttributes<IScrollbarElement>>;
1849
1911
 
1850
1912
  export declare interface VirtualScrollbarProps extends Omit<ScrollbarProps, "onScroll"> {
1851
1913
  /**
@@ -1879,7 +1941,7 @@ export declare interface VirtualScrollbarProps extends Omit<ScrollbarProps, "onS
1879
1941
  * @defaultValue 50
1880
1942
  */
1881
1943
  precisionFactor?: number;
1882
- createScrollbar?: (props: ScrollbarProps, ref?: default_2.Ref<HTMLElement>) => default_2.ReactNode;
1944
+ renderScrollbar?: (props: ScrollbarProps) => default_2.ReactNode;
1883
1945
  }
1884
1946
 
1885
1947
  export declare function WalkingIcon(props: WalkingIconProps): JSX.Element;